microsoft / vscode

Visual Studio Code
https://code.visualstudio.com
MIT License
162.74k stars 28.72k forks source link

Speech: getting `SPXERR_MIC_NOT_AVAILABLE` on some distributions or Snap installs #205758

Open connor4312 opened 7 months ago

connor4312 commented 7 months ago

Testing #205523

  1. Have an Ubuntu 22.04 install--I'm using KDE as my desktop environment and its default PulseAudio configuration. I remoted in (using x2go) and verified the OS could pick up audio using a voice recorder app.
  2. Click the microphone button 🎤 in the chat panel
  3. No words are ever deciphered

I didn't find any settings or commands that would let me e.g. try to change input sources.

rzhao271 commented 7 months ago

Same issue on my personal Linux device. Posting more offline.

bpasero commented 7 months ago

To figure out more about this issue related to voice recognition, can you do this:

Can you then share the output from the extension output channel as well as any log files in the folder of VSCODE_SPEECH_LOGS_PATH. Thanks!

[1]

image image image

[2]

image
connor4312 commented 7 months ago

Here's the VS Code Speech output for me, no files in the log directory:

2024-02-21 10:04:20.801 [trace] [vscode-speech-0] starting speech-to-text session
2024-02-21 10:04:21.062 [error] [vscode-speech-0] error: Exception with an error code: 0x8 (SPXERR_FILE_OPEN_FAILED)
[CALL STACK BEGIN]

/home/connor/.vscode-insiders/extensions/ms-vscode.vscode-speech-0.5.2024021516-linux-x64/node_modules/@vscode/node-speech/build/Release/libMicrosoft.CognitiveServices.Speech.core.so(+0xf1347) [0x7fbe0f24d347]
/home/connor/.vscode-insiders/extensions/ms-vscode.vscode-speech-0.5.2024021516-linux-x64/node_modules/@vscode/node-speech/build/Release/libMicrosoft.CognitiveServices.Speech.core.so(diagnostics_log_apply_properties+0xc8) [0x7fbe0f2041b8]
/home/connor/.vscode-insiders/extensions/ms-vscode.vscode-speech-0.5.2024021516-linux-x64/node_modules/@vscode/node-speech/build/Release/libMicrosoft.CognitiveServices.Speech.core.so(+0xffa57) [0x7fbe0f25ba57]
/home/connor/.vscode-insiders/extensions/ms-vscode.vscode-speech-0.5.2024021516-linux-x64/node_modules/@vscode/node-speech/build/Release/libMicrosoft.CognitiveServices.Speech.core.so(+0x13fa4e) [0x7fbe0f29ba4e]
/home/connor/.vscode-insiders/extensions/ms-vscode.vscode-speech-0.5.2024021516-linux-x64/node_modules/@vscode/node-speech/build/Release/libMicrosoft.CognitiveServices.Speech.core.so(+0x140084) [0x7fbe0f29c084]
/home/connor/.vscode-insiders/extensions/ms-vscode.vscode-speech-0.5.2024021516-linux-x64/node_modules/@vscode/node-speech/build/Release/libMicrosoft.CognitiveServices.Speech.core.so(+0x114890) [0x7fbe0f270890]
/home/connor/.vscode-insiders/extensions/ms-vscode.vscode-speech-0.5.2024021516-linux-x64/node_modules/@vscode/node-speech/build/Release/libMicrosoft.CognitiveServices.Speech.core.so(+0x1e6043) [0x7fbe0f342043]
/home/connor/.vscode-insiders/extensions/ms-vscode.vscode-speech-0.5.2024021516-linux-x64/node_modules/@vscode/node-speech/build/Release/libMicrosoft.CognitiveServices.Speech.core.so(+0x13e0fb) [0x7fbe0f29a0fb]
/home/connor/.vscode-insiders/extensions/ms-vscode.vscode-speech-0.5.2024021516-linux-x64/node_modules/@vscode/node-speech/build/Release/libMicrosoft.CognitiveServices.Speech.core.so(+0x1f94a9) [0x7fbe0f3554a9]
/home/connor/.vscode-insiders/extensions/ms-vscode.vscode-speech-0.5.2024021516-linux-x64/node_modules/@vscode/node-speech/build/Release/libMicrosoft.CognitiveServices.Speech.core.so(+0x13e5a9) [0x7fbe0f29a5a9]
/home/connor/.vscode-insiders/extensions/ms-vscode.vscode-speech-0.5.2024021516-linux-x64/node_modules/@vscode/node-speech/build/Release/libMicrosoft.CognitiveServices.Speech.core.so(+0x216d8a) [0x7fbe0f372d8a]
/home/connor/.vscode-insiders/extensions/ms-vscode.vscode-speech-0.5.2024021516-linux-x64/node_modules/@vscode/node-speech/build/Release/libMicrosoft.CognitiveServices.Speech.core.so(recognizer_create_speech_recognizer_from_config+0x10b) [0x7fbe0f21a8fd]
/home/connor/.vscode-insiders/extensions/ms-vscode.vscode-speech-0.5.2024021516-linux-x64/node_modules/@vscode/node-speech/build/Release/speechapi.node(TranscriptionWorker::Execute(Napi::AsyncProgressQueueWorker<TranscriptionWorkerCallbackResult>::ExecutionProgress const&)+0x1ee) [0x7fbe0f8a561e]
/home/connor/.vscode-insiders/extensions/ms-vscode.vscode-speech-0.5.2024021516-linux-x64/node_modules/@vscode/node-speech/build/Release/speechapi.node(Napi::AsyncProgressQueueWorker<TranscriptionWorkerCallbackResult>::Execute()+0x16) [0x7fbe0f895096]
/home/connor/.vscode-insiders/extensions/ms-vscode.vscode-speech-0.5.2024021516-linux-x64/node_modules/@vscode/node-speech/build/Release/speechapi.node(Napi::AsyncWorker::OnAsyncWorkExecute(napi_env__*, void*)+0x24) [0x7fbe0f89e3e4]
/snap/code-insiders/1550/usr/share/code-insiders/code-insiders --type=utility --utility-sub-type=node.mojom.NodeService --lang=en-US --service-sandbox-type=none --no-sandbox --dns-result-order=ipv4first --inspect-port=0 --crashpad-handler-pid=3972448 --enable-crash-reporter=2e4be331-422e-4b29-a311-95af4e8acb92,no_channel --user-data-dir=/home/connor/.config/Code - Insiders --standard-schemes=vscode-webview,vscode-file --secure-schemes=vscode-webview,vscode-file --cors-schemes=vscode-webview,vscode-file --fetch-schemes=vscode-webview,vscode-file --service-worker-schemes=vscode-webview --code-cache-schemes=vscode-webview,vscode-file --shared-files=v8_context_snapshot_data:100 --field-trial-handle=0,i,14712368710131511903,559304601608160854,262144 --disable-features=CalculateNativeWinOcclusion,SpareRendererForSitePerProcess(+0x92ca4e0) [0x5584a1c184e0]
[CALL STACK END]

2024-02-21 10:04:21.063 [trace] [vscode-speech-0] disposed speech-to-text session
2024-02-21 10:04:48.725 [trace] [vscode-speech-0] disposing speech-to-text session
bpasero commented 7 months ago

@connor4312 any difference when you are not using VS Code from Snap, but an archive or DEB?

connor4312 commented 7 months ago

Ah, indeed, using deb works!

bpasero commented 7 months ago

I am not able to reproduce btw, for me Snap works fine 🤔

h3110Fr13nd commented 7 months ago

Getting Similar Issue. It works sometimes for first time only when reload window. My machine is ubuntu 22.04.

2024-02-25 04:20:20.635 [error] [vscode-speech-1] error: Exception with an error code: 0xe (SPXERR_MIC_NOT_AVAILABLE)
[CALL STACK BEGIN]

/home/h3110fr13nd/.vscode-insiders/extensions/ms-vscode.vscode-speech-0.4.0-linux-x64/node_modules/@vscode/node-speech/build/Release/libMicrosoft.CognitiveServices.Speech.extension.audio.sys.so(+0xe1e9) [0x7f509540e1e9]
/home/h3110fr13nd/.vscode-insiders/extensions/ms-vscode.vscode-speech-0.4.0-linux-x64/node_modules/@vscode/node-speech/build/Release/libMicrosoft.CognitiveServices.Speech.core.so(+0x1f44f9) [0x7f5097bf44f9]
/home/h3110fr13nd/.vscode-insiders/extensions/ms-vscode.vscode-speech-0.4.0-linux-x64/node_modules/@vscode/node-speech/build/Release/libMicrosoft.CognitiveServices.Speech.core.so(+0xff4f7) [0x7f5097aff4f7]
/home/h3110fr13nd/.vscode-insiders/extensions/ms-vscode.vscode-speech-0.4.0-linux-x64/node_modules/@vscode/node-speech/build/Release/libMicrosoft.CognitiveServices.Speech.core.so(+0x1af42f) [0x7f5097baf42f]
/home/h3110fr13nd/.vscode-insiders/extensions/ms-vscode.vscode-speech-0.4.0-linux-x64/node_modules/@vscode/node-speech/build/Release/libMicrosoft.CognitiveServices.Speech.core.so(+0xf108d) [0x7f5097af108d]
/home/h3110fr13nd/.vscode-insiders/extensions/ms-vscode.vscode-speech-0.4.0-linux-x64/node_modules/@vscode/node-speech/build/Release/libMicrosoft.CognitiveServices.Speech.core.so(+0x1f44f9) [0x7f5097bf44f9]
/home/h3110fr13nd/.vscode-insiders/extensions/ms-vscode.vscode-speech-0.4.0-linux-x64/node_modules/@vscode/node-speech/build/Release/libMicrosoft.CognitiveServices.Speech.core.so(+0xff4f7) [0x7f5097aff4f7]
/home/h3110fr13nd/.vscode-insiders/extensions/ms-vscode.vscode-speech-0.4.0-linux-x64/node_modules/@vscode/node-speech/build/Release/libMicrosoft.CognitiveServices.Speech.core.so(+0x1ab483) [0x7f5097bab483]
/home/h3110fr13nd/.vscode-insiders/extensions/ms-vscode.vscode-speech-0.4.0-linux-x64/node_modules/@vscode/node-speech/build/Release/libMicrosoft.CognitiveServices.Speech.core.so(+0x192d81) [0x7f5097b92d81]
/home/h3110fr13nd/.vscode-insiders/extensions/ms-vscode.vscode-speech-0.4.0-linux-x64/node_modules/@vscode/node-speech/build/Release/libMicrosoft.CognitiveServices.Speech.core.so(+0x130379) [0x7f5097b30379]
/home/h3110fr13nd/.vscode-insiders/extensions/ms-vscode.vscode-speech-0.4.0-linux-x64/node_modules/@vscode/node-speech/build/Release/libMicrosoft.CognitiveServices.Speech.core.so(+0x130379) [0x7f5097b30379]
/home/h3110fr13nd/.vscode-insiders/extensions/ms-vscode.vscode-speech-0.4.0-linux-x64/node_modules/@vscode/node-speech/build/Release/libMicrosoft.CognitiveServices.Speech.core.so(+0x19b4f5) [0x7f5097b9b4f5]
/home/h3110fr13nd/.vscode-insiders/extensions/ms-vscode.vscode-speech-0.4.0-linux-x64/node_modules/@vscode/node-speech/build/Release/libMicrosoft.CognitiveServices.Speech.core.so(+0x13e44f) [0x7f5097b3e44f]
/home/h3110fr13nd/.vscode-insiders/extensions/ms-vscode.vscode-speech-0.4.0-linux-x64/node_modules/@vscode/node-speech/build/Release/libMicrosoft.CognitiveServices.Speech.core.so(+0x1e65f6) [0x7f5097be65f6]
/home/h3110fr13nd/.vscode-insiders/extensions/ms-vscode.vscode-speech-0.4.0-linux-x64/node_modules/@vscode/node-speech/build/Release/libMicrosoft.CognitiveServices.Speech.core.so(+0x139b9b) [0x7f5097b39b9b]
/home/h3110fr13nd/.vscode-insiders/extensions/ms-vscode.vscode-speech-0.4.0-linux-x64/node_modules/@vscode/node-speech/build/Release/libMicrosoft.CognitiveServices.Speech.core.so(+0x20dfe2) [0x7f5097c0dfe2]
/home/h3110fr13nd/.vscode-insiders/extensions/ms-vscode.vscode-speech-0.4.0-linux-x64/node_modules/@vscode/node-speech/build/Release/libMicrosoft.CognitiveServices.Speech.core.so(recognizer_create_keyword_recognizer_from_audio_config+0xd3) [0x7f5097abeca2]
[CALL STACK END]

I'm getting SPXERR_MIC_NOT_AVAILABLE. Weird cuz works for first time.

connor4312 commented 7 months ago

@h3110Fr13nd did you also install via snap?

h3110Fr13nd commented 7 months ago

For me I uninstalled the code-insiders from snap and installed it using Deb package downloaded from official website. And also reinstalled pulseaudio. It solved the issue for me.

goodjobs-ta commented 6 months ago

For me also had to install the .deb version as snap version had the same problem. .deb Version from APT-Repo seems to work fine on 22.04

drmaniac commented 6 months ago

Got the same error message on arch linux:

2024-02-29 13:09:12.845 [trace] [vscode-speech-0] starting speech-to-text session (language: en-US, model: Microsoft Speech Recognizer en-US FP Model V8.1)
2024-02-29 13:09:12.880 [error] [vscode-speech-0] error: Exception with an error code: 0xe (SPXERR_MIC_NOT_AVAILABLE)
[CALL STACK BEGIN]

/home/cipi/.vscode/extensions/ms-vscode.vscode-speech-0.6.0-linux-x64/node_modules/@vscode/node-speech/build/Release/libMicrosoft.CognitiveServices.Speech.extension.audio.sys.so(+0xe1e9) [0x7b3c1f00e1e9]
/home/cipi/.vscode/extensions/ms-vscode.vscode-speech-0.6.0-linux-x64/node_modules/@vscode/node-speech/build/Release/libMicrosoft.CognitiveServices.Speech.core.so(+0x1e6043) [0x7b3e24fe6043]
/home/cipi/.vscode/extensions/ms-vscode.vscode-speech-0.6.0-linux-x64/node_modules/@vscode/node-speech/build/Release/libMicrosoft.CognitiveServices.Speech.core.so(+0x101118) [0x7b3e24f01118]
/home/cipi/.vscode/extensions/ms-vscode.vscode-speech-0.6.0-linux-x64/node_modules/@vscode/node-speech/build/Release/libMicrosoft.CognitiveServices.Speech.core.so(+0x199747) [0x7b3e24f99747]
/home/cipi/.vscode/extensions/ms-vscode.vscode-speech-0.6.0-linux-x64/node_modules/@vscode/node-speech/build/Release/libMicrosoft.CognitiveServices.Speech.core.so(+0xf2865) [0x7b3e24ef2865]
/home/cipi/.vscode/extensions/ms-vscode.vscode-speech-0.6.0-linux-x64/node_modules/@vscode/node-speech/build/Release/libMicrosoft.CognitiveServices.Speech.core.so(+0x1e6043) [0x7b3e24fe6043]
/home/cipi/.vscode/extensions/ms-vscode.vscode-speech-0.6.0-linux-x64/node_modules/@vscode/node-speech/build/Release/libMicrosoft.CognitiveServices.Speech.core.so(+0x101118) [0x7b3e24f01118]
/home/cipi/.vscode/extensions/ms-vscode.vscode-speech-0.6.0-linux-x64/node_modules/@vscode/node-speech/build/Release/libMicrosoft.CognitiveServices.Speech.core.so(+0x195ef6) [0x7b3e24f95ef6]
/home/cipi/.vscode/extensions/ms-vscode.vscode-speech-0.6.0-linux-x64/node_modules/@vscode/node-speech/build/Release/libMicrosoft.CognitiveServices.Speech.core.so(+0x19bb4b) [0x7b3e24f9bb4b]
/home/cipi/.vscode/extensions/ms-vscode.vscode-speech-0.6.0-linux-x64/node_modules/@vscode/node-speech/build/Release/libMicrosoft.CognitiveServices.Speech.core.so(+0x133d13) [0x7b3e24f33d13]
/home/cipi/.vscode/extensions/ms-vscode.vscode-speech-0.6.0-linux-x64/node_modules/@vscode/node-speech/build/Release/libMicrosoft.CognitiveServices.Speech.core.so(+0x133d13) [0x7b3e24f33d13]
/home/cipi/.vscode/extensions/ms-vscode.vscode-speech-0.6.0-linux-x64/node_modules/@vscode/node-speech/build/Release/libMicrosoft.CognitiveServices.Speech.core.so(+0x187535) [0x7b3e24f87535]
/home/cipi/.vscode/extensions/ms-vscode.vscode-speech-0.6.0-linux-x64/node_modules/@vscode/node-speech/build/Release/libMicrosoft.CognitiveServices.Speech.core.so(+0x140b1d) [0x7b3e24f40b1d]
/home/cipi/.vscode/extensions/ms-vscode.vscode-speech-0.6.0-linux-x64/node_modules/@vscode/node-speech/build/Release/libMicrosoft.CognitiveServices.Speech.core.so(+0x1f945e) [0x7b3e24ff945e]
/home/cipi/.vscode/extensions/ms-vscode.vscode-speech-0.6.0-linux-x64/node_modules/@vscode/node-speech/build/Release/libMicrosoft.CognitiveServices.Speech.core.so(+0x13e5a9) [0x7b3e24f3e5a9]
/home/cipi/.vscode/extensions/ms-vscode.vscode-speech-0.6.0-linux-x64/node_modules/@vscode/node-speech/build/Release/libMicrosoft.CognitiveServices.Speech.core.so(+0x216d8a) [0x7b3e25016d8a]
/home/cipi/.vscode/extensions/ms-vscode.vscode-speech-0.6.0-linux-x64/node_modules/@vscode/node-speech/build/Release/libMicrosoft.CognitiveServices.Speech.core.so(recognizer_create_speech_recognizer_from_config+0x10b) [0x7b3e24ebe8fd]
[CALL STACK END]

From my point of view it looks like that the used library only supports pulseaudio alsa but not working with pipewire and pipewire-pulse pipewire-alsa. This makes me very unhappy cause most linux distribution are switched already to pipewire per default.

maxbraeutigam commented 6 months ago

Can confirm that it is not working on Archlinux with pipewire

bpasero commented 6 months ago

The Speech SDK that we are using has specific requirements on the target (with Archlinux not supported as far as I can tell):

image

Refs: https://learn.microsoft.com/en-us/azure/ai-services/speech-service/quickstarts/setup-platform?tabs=linux%2Cubuntu%2Cdotnetcli%2Cdotnet%2Cjre%2Cmaven%2Cnodejs%2Cmac%2Cpypi&pivots=programming-language-cpp#platform-requirements

But I am still puzzled why using Snap vs Deb would make any difference here...

aitor commented 6 months ago

Just another report confirming the same SPXERR_MIC_NOT_AVAILABLE on Pop!_OS 22.04 LTS x86_64 (Kernel 6.6.10-76060610-generic)

Full logs:

2024-03-05 12:01:14.275 [trace] [vscode-speech-0] starting speech-to-text session (language: es-ES, model: Microsoft Speech Recognizer es-ES FP Model V2.1)
2024-03-05 12:01:14.337 [error] [vscode-speech-0] error: Exception with an error code: 0xe (SPXERR_MIC_NOT_AVAILABLE)
[CALL STACK BEGIN]

/home/aitor/.vscode/extensions/ms-vscode.vscode-speech-0.6.0-linux-x64/node_modules/@vscode/node-speech/build/Release/libMicrosoft.CognitiveServices.Speech.extension.audio.sys.so(+0xe1e9) [0x7c11e4a0e1e9]
/home/aitor/.vscode/extensions/ms-vscode.vscode-speech-0.6.0-linux-x64/node_modules/@vscode/node-speech/build/Release/libMicrosoft.CognitiveServices.Speech.core.so(+0x1e6043) [0x7c12679e6043]
/home/aitor/.vscode/extensions/ms-vscode.vscode-speech-0.6.0-linux-x64/node_modules/@vscode/node-speech/build/Release/libMicrosoft.CognitiveServices.Speech.core.so(+0x101118) [0x7c1267901118]
/home/aitor/.vscode/extensions/ms-vscode.vscode-speech-0.6.0-linux-x64/node_modules/@vscode/node-speech/build/Release/libMicrosoft.CognitiveServices.Speech.core.so(+0x199747) [0x7c1267999747]
/home/aitor/.vscode/extensions/ms-vscode.vscode-speech-0.6.0-linux-x64/node_modules/@vscode/node-speech/build/Release/libMicrosoft.CognitiveServices.Speech.core.so(+0xf2865) [0x7c12678f2865]
/home/aitor/.vscode/extensions/ms-vscode.vscode-speech-0.6.0-linux-x64/node_modules/@vscode/node-speech/build/Release/libMicrosoft.CognitiveServices.Speech.core.so(+0x1e6043) [0x7c12679e6043]
/home/aitor/.vscode/extensions/ms-vscode.vscode-speech-0.6.0-linux-x64/node_modules/@vscode/node-speech/build/Release/libMicrosoft.CognitiveServices.Speech.core.so(+0x101118) [0x7c1267901118]
/home/aitor/.vscode/extensions/ms-vscode.vscode-speech-0.6.0-linux-x64/node_modules/@vscode/node-speech/build/Release/libMicrosoft.CognitiveServices.Speech.core.so(+0x195ef6) [0x7c1267995ef6]
/home/aitor/.vscode/extensions/ms-vscode.vscode-speech-0.6.0-linux-x64/node_modules/@vscode/node-speech/build/Release/libMicrosoft.CognitiveServices.Speech.core.so(+0x19bb4b) [0x7c126799bb4b]
/home/aitor/.vscode/extensions/ms-vscode.vscode-speech-0.6.0-linux-x64/node_modules/@vscode/node-speech/build/Release/libMicrosoft.CognitiveServices.Speech.core.so(+0x133d13) [0x7c1267933d13]
/home/aitor/.vscode/extensions/ms-vscode.vscode-speech-0.6.0-linux-x64/node_modules/@vscode/node-speech/build/Release/libMicrosoft.CognitiveServices.Speech.core.so(+0x133d13) [0x7c1267933d13]
/home/aitor/.vscode/extensions/ms-vscode.vscode-speech-0.6.0-linux-x64/node_modules/@vscode/node-speech/build/Release/libMicrosoft.CognitiveServices.Speech.core.so(+0x187535) [0x7c1267987535]
/home/aitor/.vscode/extensions/ms-vscode.vscode-speech-0.6.0-linux-x64/node_modules/@vscode/node-speech/build/Release/libMicrosoft.CognitiveServices.Speech.core.so(+0x140b1d) [0x7c1267940b1d]
/home/aitor/.vscode/extensions/ms-vscode.vscode-speech-0.6.0-linux-x64/node_modules/@vscode/node-speech/build/Release/libMicrosoft.CognitiveServices.Speech.core.so(+0x1f945e) [0x7c12679f945e]
/home/aitor/.vscode/extensions/ms-vscode.vscode-speech-0.6.0-linux-x64/node_modules/@vscode/node-speech/build/Release/libMicrosoft.CognitiveServices.Speech.core.so(+0x13e5a9) [0x7c126793e5a9]
/home/aitor/.vscode/extensions/ms-vscode.vscode-speech-0.6.0-linux-x64/node_modules/@vscode/node-speech/build/Release/libMicrosoft.CognitiveServices.Speech.core.so(+0x216d8a) [0x7c1267a16d8a]
/home/aitor/.vscode/extensions/ms-vscode.vscode-speech-0.6.0-linux-x64/node_modules/@vscode/node-speech/build/Release/libMicrosoft.CognitiveServices.Speech.core.so(recognizer_create_speech_recognizer_from_config+0x10b) [0x7c12678be8fd]
[CALL STACK END]

2024-03-05 12:01:14.337 [trace] [vscode-speech-0] disposed speech-to-text session
vnva commented 6 months ago

Same issue (Pipewire)

2024-03-07 01:13:10.810 [error] [vscode-speech-0] error: Exception with an error code: 0xe (SPXERR_MIC_NOT_AVAILABLE)
[CALL STACK BEGIN]

/home/vnva/.vscode/extensions/ms-vscode.vscode-speech-0.6.0-linux-x64/node_modules/@vscode/node-speech/build/Release/libMicrosoft.CognitiveServices.Speech.extension.audio.sys.so(+0xe1e9) [0x7207f400e1e9]
/home/vnva/.vscode/extensions/ms-vscode.vscode-speech-0.6.0-linux-x64/node_modules/@vscode/node-speech/build/Release/libMicrosoft.CognitiveServices.Speech.core.so(+0x1e6043) [0x720877be6043]
/home/vnva/.vscode/extensions/ms-vscode.vscode-speech-0.6.0-linux-x64/node_modules/@vscode/node-speech/build/Release/libMicrosoft.CognitiveServices.Speech.core.so(+0x101118) [0x720877b01118]
/home/vnva/.vscode/extensions/ms-vscode.vscode-speech-0.6.0-linux-x64/node_modules/@vscode/node-speech/build/Release/libMicrosoft.CognitiveServices.Speech.core.so(+0x199747) [0x720877b99747]
/home/vnva/.vscode/extensions/ms-vscode.vscode-speech-0.6.0-linux-x64/node_modules/@vscode/node-speech/build/Release/libMicrosoft.CognitiveServices.Speech.core.so(+0xf2865) [0x720877af2865]
/home/vnva/.vscode/extensions/ms-vscode.vscode-speech-0.6.0-linux-x64/node_modules/@vscode/node-speech/build/Release/libMicrosoft.CognitiveServices.Speech.core.so(+0x1e6043) [0x720877be6043]
/home/vnva/.vscode/extensions/ms-vscode.vscode-speech-0.6.0-linux-x64/node_modules/@vscode/node-speech/build/Release/libMicrosoft.CognitiveServices.Speech.core.so(+0x101118) [0x720877b01118]
/home/vnva/.vscode/extensions/ms-vscode.vscode-speech-0.6.0-linux-x64/node_modules/@vscode/node-speech/build/Release/libMicrosoft.CognitiveServices.Speech.core.so(+0x195ef6) [0x720877b95ef6]
/home/vnva/.vscode/extensions/ms-vscode.vscode-speech-0.6.0-linux-x64/node_modules/@vscode/node-speech/build/Release/libMicrosoft.CognitiveServices.Speech.core.so(+0x19bb4b) [0x720877b9bb4b]
/home/vnva/.vscode/extensions/ms-vscode.vscode-speech-0.6.0-linux-x64/node_modules/@vscode/node-speech/build/Release/libMicrosoft.CognitiveServices.Speech.core.so(+0x133d13) [0x720877b33d13]
/home/vnva/.vscode/extensions/ms-vscode.vscode-speech-0.6.0-linux-x64/node_modules/@vscode/node-speech/build/Release/libMicrosoft.CognitiveServices.Speech.core.so(+0x133d13) [0x720877b33d13]
/home/vnva/.vscode/extensions/ms-vscode.vscode-speech-0.6.0-linux-x64/node_modules/@vscode/node-speech/build/Release/libMicrosoft.CognitiveServices.Speech.core.so(+0x187535) [0x720877b87535]
/home/vnva/.vscode/extensions/ms-vscode.vscode-speech-0.6.0-linux-x64/node_modules/@vscode/node-speech/build/Release/libMicrosoft.CognitiveServices.Speech.core.so(+0x140b1d) [0x720877b40b1d]
/home/vnva/.vscode/extensions/ms-vscode.vscode-speech-0.6.0-linux-x64/node_modules/@vscode/node-speech/build/Release/libMicrosoft.CognitiveServices.Speech.core.so(+0x1f945e) [0x720877bf945e]
/home/vnva/.vscode/extensions/ms-vscode.vscode-speech-0.6.0-linux-x64/node_modules/@vscode/node-speech/build/Release/libMicrosoft.CognitiveServices.Speech.core.so(+0x13e5a9) [0x720877b3e5a9]
/home/vnva/.vscode/extensions/ms-vscode.vscode-speech-0.6.0-linux-x64/node_modules/@vscode/node-speech/build/Release/libMicrosoft.CognitiveServices.Speech.core.so(+0x216d8a) [0x720877c16d8a]
/home/vnva/.vscode/extensions/ms-vscode.vscode-speech-0.6.0-linux-x64/node_modules/@vscode/node-speech/build/Release/libMicrosoft.CognitiveServices.Speech.core.so(recognizer_create_speech_recognizer_from_config+0x10b) [0x720877abe8fd]
[CALL STACK END]
drmaniac commented 6 months ago

I've confirmed that the SpeechSDK generally works with both Arch Linux and Pipewire. However, I encountered an issue where the auto-discovery feature didn't detect my microphone (SPXERR_MIC_NOT_AVAILABLE).

Using the C++ example (https://gist.github.com/drmaniac/23a4faf462caabd57f0175f281739ada lines 25-26), I successfully worked around the issue by manually configuring the device ID.

It would be helpful if the SpeechSDK offered an option to directly configure the device ID. This would provide a valuable workaround for cases where auto-discovery fails.

bpasero commented 6 months ago

@drmaniac thanks a lot for drilling into this deeper, I think it would be valuable for the team to hear from your findings in a new bug report at https://github.com/Azure-Samples/cognitive-services-speech-sdk

drmaniac commented 6 months ago

@bpasero The ability to directly configure the microphone device ID through a VS Code settings file would be a valuable workaround for potential auto-discovery failures in the future. This would provide greater flexibility and user control over audio input settings e.g. select a different mic than the default one.

Anyway I have created a bug report for the cognitive-services-speech-sdk

drmaniac commented 6 months ago

I found a solution for my setup that work. I set the default alsa device for my user via $HOME/.asoundrc

  1. Find your mic
    ❯ arecord -l
    **** List of CAPTURE Hardware Devices ****
    card 1: Generic [HD-Audio Generic], device 0: ALC887-VD Analog [ALC887-VD Analog]
    Subdevices: 1/1
    Subdevice #0: subdevice #0
    card 1: Generic [HD-Audio Generic], device 2: ALC887-VD Alt Analog [ALC887-VD Alt Analog]
    Subdevices: 1/1
    Subdevice #0: subdevice #0
    card 2: Microphone [GXT 244 Microphone], device 0: USB Audio [USB Audio]
    Subdevices: 1/1
    Subdevice #0: subdevice #0
  2. create/edit .asoundrc in your home directory
    defaults.pcm.card 2
    defaults.ctl.card 2

Anyway I would still prefer a setting via vs code settings.

aitor commented 6 months ago

I can confirm that using the id obtained by arecord -l or cat /proc/asound/cards to set the default microphone in ~/.asoundrc works correctly in PopOS 🎉 . Thank you @drmaniac!

maxbraeutigam commented 6 months ago

create/edit .asoundrc in your home directory

defaults.pcm.card 2
defaults.ctl.card 2

That’s great. Thank you very much, @drmaniac. Works under ArchLinux/Pipewire, too.

hamirmahal commented 5 months ago

Screencast from 03-29-2024 04:10:30 PM.webm

hamirmahal commented 5 months ago

I just ran into this issue today on my desktop.

~ $ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description:    Ubuntu 22.04.4 LTS
Release:    22.04
Codename:   jammy
Version: 1.87.2
Commit: 863d2581ecda6849923a2118d93a088b0745d9d6
Date: 2024-03-08T15:14:59.643Z
Electron: 27.3.2
ElectronBuildId: 26836302
Chromium: 118.0.5993.159
Node.js: 18.17.1
V8: 11.8.172.18-electron.0
OS: Linux x64 6.5.0-26-generic snap
2024-03-29 16:10:15.501 [error] [vscode-speech-0] error: Exception with an error code: 0xe (SPXERR_MIC_NOT_AVAILABLE)
[CALL STACK BEGIN]

/home/hamir/.vscode/extensions/ms-vscode.vscode-speech-0.6.0-linux-x64/node_modules/@vscode/node-speech/build/Release/libMicrosoft.CognitiveServices.Speech.extension.audio.sys.so(+0xe1e9) [0x7e587dc0e1e9]
/home/hamir/.vscode/extensions/ms-vscode.vscode-speech-0.6.0-linux-x64/node_modules/@vscode/node-speech/build/Release/libMicrosoft.CognitiveServices.Speech.core.so(+0x1e6043) [0x7e5a815e6043]
/home/hamir/.vscode/extensions/ms-vscode.vscode-speech-0.6.0-linux-x64/node_modules/@vscode/node-speech/build/Release/libMicrosoft.CognitiveServices.Speech.core.so(+0x101118) [0x7e5a81501118]
/home/hamir/.vscode/extensions/ms-vscode.vscode-speech-0.6.0-linux-x64/node_modules/@vscode/node-speech/build/Release/libMicrosoft.CognitiveServices.Speech.core.so(+0x199747) [0x7e5a81599747]
/home/hamir/.vscode/extensions/ms-vscode.vscode-speech-0.6.0-linux-x64/node_modules/@vscode/node-speech/build/Release/libMicrosoft.CognitiveServices.Speech.core.so(+0xf2865) [0x7e5a814f2865]
/home/hamir/.vscode/extensions/ms-vscode.vscode-speech-0.6.0-linux-x64/node_modules/@vscode/node-speech/build/Release/libMicrosoft.CognitiveServices.Speech.core.so(+0x1e6043) [0x7e5a815e6043]
/home/hamir/.vscode/extensions/ms-vscode.vscode-speech-0.6.0-linux-x64/node_modules/@vscode/node-speech/build/Release/libMicrosoft.CognitiveServices.Speech.core.so(+0x101118) [0x7e5a81501118]
/home/hamir/.vscode/extensions/ms-vscode.vscode-speech-0.6.0-linux-x64/node_modules/@vscode/node-speech/build/Release/libMicrosoft.CognitiveServices.Speech.core.so(+0x195ef6) [0x7e5a81595ef6]
/home/hamir/.vscode/extensions/ms-vscode.vscode-speech-0.6.0-linux-x64/node_modules/@vscode/node-speech/build/Release/libMicrosoft.CognitiveServices.Speech.core.so(+0x19bb4b) [0x7e5a8159bb4b]
/home/hamir/.vscode/extensions/ms-vscode.vscode-speech-0.6.0-linux-x64/node_modules/@vscode/node-speech/build/Release/libMicrosoft.CognitiveServices.Speech.core.so(+0x133d13) [0x7e5a81533d13]
/home/hamir/.vscode/extensions/ms-vscode.vscode-speech-0.6.0-linux-x64/node_modules/@vscode/node-speech/build/Release/libMicrosoft.CognitiveServices.Speech.core.so(+0x133d13) [0x7e5a81533d13]
/home/hamir/.vscode/extensions/ms-vscode.vscode-speech-0.6.0-linux-x64/node_modules/@vscode/node-speech/build/Release/libMicrosoft.CognitiveServices.Speech.core.so(+0x187535) [0x7e5a81587535]
/home/hamir/.vscode/extensions/ms-vscode.vscode-speech-0.6.0-linux-x64/node_modules/@vscode/node-speech/build/Release/libMicrosoft.CognitiveServices.Speech.core.so(+0x140b1d) [0x7e5a81540b1d]
/home/hamir/.vscode/extensions/ms-vscode.vscode-speech-0.6.0-linux-x64/node_modules/@vscode/node-speech/build/Release/libMicrosoft.CognitiveServices.Speech.core.so(+0x1f945e) [0x7e5a815f945e]
/home/hamir/.vscode/extensions/ms-vscode.vscode-speech-0.6.0-linux-x64/node_modules/@vscode/node-speech/build/Release/libMicrosoft.CognitiveServices.Speech.core.so(+0x13e5a9) [0x7e5a8153e5a9]
/home/hamir/.vscode/extensions/ms-vscode.vscode-speech-0.6.0-linux-x64/node_modules/@vscode/node-speech/build/Release/libMicrosoft.CognitiveServices.Speech.core.so(+0x216d8a) [0x7e5a81616d8a]
/home/hamir/.vscode/extensions/ms-vscode.vscode-speech-0.6.0-linux-x64/node_modules/@vscode/node-speech/build/Release/libMicrosoft.CognitiveServices.Speech.core.so(recognizer_create_speech_recognizer_from_config+0x10b) [0x7e5a814be8fd]
[CALL STACK END]
hamirmahal commented 5 months ago

I don't mind staying on the snap version of VSCode to provide any troubleshooting or debugging help, in case that helps resolve this issue.

hardchor commented 5 months ago

I found a solution for my setup that work. I set the default alsa device for my user via $HOME/.asoundrc

  1. Find your mic
❯ arecord -l
**** List of CAPTURE Hardware Devices ****
card 1: Generic [HD-Audio Generic], device 0: ALC887-VD Analog [ALC887-VD Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: Generic [HD-Audio Generic], device 2: ALC887-VD Alt Analog [ALC887-VD Alt Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 2: Microphone [GXT 244 Microphone], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
  1. create/edit .asoundrc in your home directory
defaults.pcm.card 2
defaults.ctl.card 2

Anyway I would still prefer a setting via vs code settings.

This initially didn't fix it for me (I also had multiple microphones), but then switching from snap to deb did the trick :partying_face:

hazondata commented 4 months ago

I thought it was an AppArmor issue (even though code is installed classic/unconfined) and tried adding rw permissions to the AppArmor profile for /dev/snd/* but was unsuccessful. Switched to deb like everyone else and it finally worked. Can this be moved to theworkbench-voice label so others can find it from the extension link? @bpasero

bpasero commented 4 months ago

The label is already applied:

image

Could people here see if anything improves when installing our latest VS Code insider (1.90.x) as snap and the latest pre-release version of Speech (v0.9.2024042312 (pre-release)). It includes an updated Speech SDK with a fix for https://github.com/Azure-Samples/cognitive-services-speech-sdk/issues/2292

You can give our preview releases a try from: https://code.visualstudio.com/insiders/

Thanks!

ganakee commented 4 months ago

The method by @maxbraeutigam works for me on POP OS 22.04 as of 2024-05-17.

The arecord -l command is the letter 'L' as in List.

arecord -l
**** List of CAPTURE Hardware Devices ****
card 0: PCH [HDA Intel PCH], device 0: ALC892 Analog [ALC892 Analog]
  Subdevices: 0/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 2: ALC892 Alt Analog [ALC892 Alt Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 2: Headset [Logitech USB Headset], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

Then use a text editor to add a file in home ~/.asoundrc

defaults.pcm.card 2
defaults.ctl.card 2

The 2 denotes the card 2 from thearecord above. Restart VS Code.

I also needed to re-map the keybinding to start Voice. CTRL+ALT+V did not work for me as this combination mapped to paste.

To change the keyboard shortcut in VS Code,

  1. Open VS Code
  2. go to File ...Preferences...Keyboard Shortcuts.
  3. In the search box search Voice
  4. Look forVoice: Start Dictation in Editor.
  5. Select that row.
  6. A prompt opens to replace the current key combination. I used CTRL+SHIFT+ALT+V.
  7. Accept the new combination.
  8. Close the Keyboard Shortcuts.
  9. Now, use the CTRL+SHIFT+ALT+V to start dictation in the editor.

{ "key": "ctrl+shift+alt+v", "command": "workbench.action.editorDictation.start", "when": "hasSpeechProvider && !editorDictation.inProgress && !editorReadonly" }

hazondata commented 4 months ago

@bpasero still not working in code-insiders latest/stable f209ce35 snap and VS Code Speech v0.9.2024050912 (pre-release).

bpasero commented 4 months ago

@hazondata

To figure out more about this issue related to voice recognition, can you do this:

Can you then share the log files in the VSCODE_SPEECH_LOGS_PATH. Thanks!