Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Issue with external audio device #21

Open
wkwhwh opened this issue Oct 31, 2023 · 6 comments
Open

Issue with external audio device #21

wkwhwh opened this issue Oct 31, 2023 · 6 comments

Comments

@wkwhwh
Copy link

wkwhwh commented Oct 31, 2023

Not sure exactly what is the cause of this, but when I run the cli tool the audio is glitched (high pitched) and also comes out of all the outputs of my device.

CleanShot.2023-10-31.at.15.13.13.mp4
@chaosprint
Copy link
Member

chaosprint commented Nov 1, 2023

Can you try to clone this repo, change the BLOCK_SIZE to 64 (Line 34 at main.rs) and run with cargo run --release?
Also try to change the content of test.glicol to o: sin 440. Hopefully you can get a pure sine tone.

@wkwhwh
Copy link
Author

wkwhwh commented Nov 1, 2023

Just tried your recommended changes but I still get a very high pitched tone that gets sent to all the software playback channels of my soundcard (RME Babyface Pro fs) - I also tried a sampling rate of 44.1kHz but it gives me the same result.

It works completely fine if I set my default output device to my Macbook Pro speakers.

here is what I did to get the result showed in the video:

  • Cloned the repo, had to run cargo update because of this error (error: failed to run custom build command for coreaudio-sys v0.2.11)
  • Changed the BLOCK_SIZE to 64 as you mentioned

and ran cargo run --release test.glicol

CleanShot.2023-11-01.at.10.57.29.mp4

@chaosprint
Copy link
Member

Just tried your recommended changes but I still get a very high pitched tone that gets sent to all the software playback channels of my soundcard (RME Babyface Pro fs) - I also tried a sampling rate of 44.1kHz but it gives me the same result.

It works completely fine if I set my default output device to my Macbook Pro speakers.

here is what I did to get the result showed in the video:

  • Cloned the repo, had to run cargo update because of this error (error: failed to run custom build command for coreaudio-sys v0.2.11)
  • Changed the BLOCK_SIZE to 64 as you mentioned

and ran cargo run --release test.glicol

CleanShot.2023-11-01.at.10.57.29.mp4

right. can you try to clone this repo: https://github.com/RustAudio/cpal/

and run cargo run --release --example beep

glicol cli depends on cpal to access the audio interface

@wkwhwh
Copy link
Author

wkwhwh commented Nov 1, 2023

cpal gives me a nice 440Hz tone. It sounds distorted on the recording probably because it still sends the audio to some extra software outputs when it should just go to AN 1/2 and I assume the screen recorder captures them all.

CleanShot.2023-11-01.at.12.26.07.mp4

@chaosprint
Copy link
Member

cpal gives me a nice 440Hz tone. It sounds distorted on the recording probably because it still sends the audio to some extra software outputs when it should just go to AN 1/2 and I assume the screen recorder captures them all.

CleanShot.2023-11-01.at.12.26.07.mp4

thanks for the info. I will look into it with my Focusrite audio interface when I get home. You may try the first method one more time if possible but change the block size to 32.

@wkwhwh
Copy link
Author

wkwhwh commented Nov 2, 2023

Thanks! I tried with a block size of 32 and get the same result as using any other block size (instead of 440Hz I get 3080Hz tone)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants