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

The mystery of the intermittent USB Audio (Raspi) #86

Closed
d8ahazard opened this issue Feb 3, 2021 · 2 comments
Closed

The mystery of the intermittent USB Audio (Raspi) #86

d8ahazard opened this issue Feb 3, 2021 · 2 comments

Comments

@d8ahazard
Copy link

So, I'm driving myself nuts trying to figure this one out...

Using a HDMI to USB input device attached to a raspberry pi. The goal is to capture the audio and do some visualizations using the FFT.

For some reason, the audio just kind of decides to work when it wants to. Presently, I'm not getting any input, regardless of how I fiddle with the system.

I've tried enabling/disabling other sound cards, messing with alsamixer settings...nothing there seems to help. Same with reboots, etc.

My code is here:

https://github.com/d8ahazard/glimmr/blob/dev/src/Models/ColorSource/Audio/AudioStream.cs

The result of starting the audio service:

12:46:20 DBG][AudioStream][LoadData] Reloading audio data [12:46:20 INF][][<ExecuteAsync>b__0] DreamScene: Color Builder canceled. [12:46:20 DBG][AudioStream][LoadData] Audio device: {"Name":"Default","Driver":"default","IsDefault":true,"IsEnabled":true,"IsInitialized":false,"IsLoopback":false,"Type":0} [12:46:20 DBG][AudioStream][LoadData] Selecting recording device index 0: Default [12:46:21 DBG][AudioStream][LoadData] Audio device: {"Name":"MS2109: USB Audio","Driver":"hw:0,0","IsDefault":false,"IsEnabled":true,"IsInitialized":false,"IsLoopback":false,"Type":0} [12:46:21 DBG][][<ExecuteAsync>b__0] Starting stream with device 0 [12:46:21 DBG][][<ExecuteAsync>b__0] Info: {"SupportedFormats":0,"Inputs":1,"SingleInput":false,"Frequency":0,"Channels":0,"IsCertified":false,"SupportsDirectSound":false} [12:46:21 DBG][][<ExecuteAsync>b__0] Record start int: -2147483647 [12:46:21 DBG][][<ExecuteAsync>b__0] Error check: OK

I can see that "isInitialized" becomes "true" once I init recording, I get no errors, and my "update" loop is firing regularly.

So, that begs the question...why is there no audio data???

Using arecord on the pi, while the app is running (but not trying to cap audio), I can save a .mp3 of the current audio with no issue. It's just in managedbass that the sound is presently not working.

I've tried various combinations of init and recordinit and free and recordfree thinking it was maybe something here...but no luck. And again, rebooting is no help.

Any help would be HUGELY appreciated. I've been driving myself nuts with this, initially blaming the capture device and HDMI handshaking...but no...audio into the USB device is rock-solid.

@d8ahazard
Copy link
Author

Just noticed something new that I suspect is the culprit...

When the app launches, I see this message in the startup log:

ALSA lib pcm_dmix.c:1108:(snd_pcm_dmix_open) unable to open slave

I could be mistaken and this could be unrelated, but I have a feeling this is where it's at. Any ideas, anybody?

@d8ahazard
Copy link
Author

Closed...100% PEBKAC...

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

No branches or pull requests

1 participant