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
auto-discovery for input device fails on some linux systems #2292
Comments
I just wanted to confirm that this issue is present in Pop!_OS 22.04 LTS, too. |
Hi, the SDK uses the ALSA API ( |
I can confirm that using the id obtained by |
The .asoundrc workaround (microsoft/vscode/issues/205758) highlights a potential discrepancy in device selection between the Speech SDK and standard ALSA tools. Since arecord and others correctly use Pipewire/WirePlumber's default device, it suggests the SDK may have a unique selection logic. Can the Speech SDK development team investigate and potentially adapt its device selection to align with Pipewire/WirePlumber conventions? |
@drmaniac Are you sure that The SDK uses the standard ALSA API. Sound servers like PulseAudio, PipeWire etc. work on top of ALSA, not the other way round. |
I played a little bit. It looks like AudioConfig::FromDefaultMicrophoneInput() might not always correctly detect the default device. Using AudioConfig::FromMicrophoneInput("default") seems to work reliably. I confirmed this behavior by changing my default microphone settings in GNOME. Also my test with So maybe it's only a missing documentation which seams to cause so many confusions.
As far as I see arecord does the same with the 'default' string https://git.alsa-project.org/?p=alsa-utils.git;a=blob;f=aplay/aplay.c @pankopon To answer your question more specifically, WirePlumber sets the default audio alsa device dynamically, so there is a default device but not in any configuration file. Edit: |
@drmaniac Thank you for the details.
Would you be willing to try out the change in environments where you previously were able to reproduce the issue, so that we can get more coverage? |
I agree that must be then a minimum requirement. On the other hand this would be normaly managed by a sound server like pulseaudio, or pipewire. To have more values here are my list of configured PCM devices. Arch Linux (completely updated) ❯ arecord -L
null
Discard all samples (playback) or generate zero samples (capture)
pipewire
PipeWire Sound Server
pulse
PulseAudio Sound Server
default
Default ALSA Output (currently PipeWire Media Server)
... Ubuntu 20.04 LTS (fresh installation, no specific sound configuration done) $ arecord -L
default
Playback/recording through the PulseAudio sound server
null
Discard all samples (playback) or generate zero samples (capture)
pulse
PulseAudio Sound Server Ubuntu 23.10 (fresh installation, no specific sound configuration done) $ LC_ALL=C arecord -L
null
Discard all samples (playback) or generate zero samples (capture)
pipewire
PipeWire Sound Server
default
Default ALSA Output (currently PipeWire Media Server)
Sure, i can do it. |
@drmaniac Please see attached a zip with Replace the original library file from the Speech SDK 1.36.0 release with this updated one:
If this version does not work in some environment, please post the output of |
@pankopon I have tested [library name] on the following systems:
Initial results indicate positive compatibility. I'll also be testing on a Raspberry Pi 4 with Arch. Will provide results soon. |
@drmaniac Many thanks for testing this. Based on your results so far it seems the change is good. So if there are no further updates, we'll include it in the next Speech SDK release (1.37.0). |
Internal work item ref. 6862878. |
This item has been open without activity for 19 days. Provide a comment on status and remove "update needed" label. |
Changes have been released (Speech SDK 1.37.0). |
Thanks a lot ❤️ ! |
Mic not found
Exception with an error code: 0xe (SPXERR_MIC_NOT_AVAILABLE)
The SpeechSDK generally works with Arch Linux and Pipewire. However, I encountered an issue where the auto-discovery feature didn't detect my microphone (SPXERR_MIC_NOT_AVAILABLE).
On the same computer it is working with ubuntu(23.10) also with pipewire.
Example: https://gist.github.com/drmaniac/23a4faf462caabd57f0175f281739ada lines 25-26
This is related to microsoft/vscode#205758
Expected behavior
I would expect that auto-discovery on linux is more robust.
Version of the Cognitive Services Speech SDK
SpeechSDK-Linux-1.36.0
Platform, Operating System, and Programming Language
Additional context
The text was updated successfully, but these errors were encountered: