Couldn't choose usb audio device on python linux sdk

Hi everyone.
I have problem with choose the usb mic on python linux sdk. I am running on raspberry pi 4 and also my laptop debian 11, that I am getting similar problem.

and I have issue with the alsa when run python sdk:

ALSA lib pcm.c:2660:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c:2660:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c:2660:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib pcm.c:2660:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2660:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi
ALSA lib pcm.c:2660:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2660:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c:2660:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib pcm.c:2660:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
ALSA lib pcm_oss.c:377:(_snd_pcm_oss_open) Unknown field port
ALSA lib pcm_oss.c:377:(_snd_pcm_oss_open) Unknown field port
ALSA lib pcm_a52.c:823:(_snd_pcm_a52_open) a52 is only for playback
ALSA lib pcm_usb_stream.c:486:(_snd_pcm_usb_stream_open) Invalid type for card
ALSA lib pcm_usb_stream.c:486:(_snd_pcm_usb_stream_open) Invalid type for card
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unlock
0 → USB Audio Device: - (hw:0,0)
1 → Fantech Leviosa: USB Audio (hw:1,0)
2 → sysdefault
6 → spdif
7 → lavrate
8 → samplerate
9 → speexrate
10 → pulse
12 → upmix
13 → vdownmix
15 → default
Type the id of the audio device you want to use:
1
That device is not compatible
0 → USB Audio Device: - (hw:0,0)
1 → Fantech Leviosa: USB Audio (hw:1,0)
2 → sysdefault
6 → spdif
7 → lavrate
8 → samplerate
9 → speexrate
10 → pulse
12 → upmix
13 → vdownmix
15 → default
Type the id of the audio device you want to use:

how I solve this problem?

regards,

Hi @dexvils,

I do not have a Fantech Leviosa, so I cannot personally test that the microphone will work with Linux or Edge Impulse. Do you have another USB mic that you could try? Also, what happens when you select 0 for “USB Audio Device?”

hi, @shawn_edgeimpulse thanks for your response.
I am using another mic USB, but the result is the same. you can only choose “default”. so
the only solution you should change the default USB microphone in your system. since fantech leviosa is not my default USB mic in my Linux system so I have to change it manually.
I am following this tutorial:
change to default

I hope the edge-impulse team can fix this issue. so if you have multiple USB mics you can choose from the option in the python SDK.

Hi @dexvils,

Glad to hear you found a solution. Were you unable to choose “0” or any other option when presented with the prompt? I just want to make sure I understand the problem before submitting a bug.

On my Raspberry Pi, I was able to choose “0” to select a USB mic to get it to work (I was using this mic).

maybe it only works with a mini USB like yours. I have two USB mic from this one and fantech.
btw after you run python SDK, is there a notif like mine " invalid type for card"?

Can you try updating the runner with the following?

npm update -g edge-impulse-linux

When I did that and ran again with

edge-impulse-linux-runner

it gave me the option to select my microphone with the arrow keys rather than a number entry. From there, I was able to perform keyword spotting on the Raspberry Pi with the USB mic I mentioned earlier.

I tried downloading an .eim file for a continuous wake word example to use with this demo code (linux-sdk-python/classify.py at master · edgeimpulse/linux-sdk-python · GitHub). I see some similar errors as yours (the Unknown PCM front, etc.).

With my USB microphone, I selected ‘6’ (for “pulse”), and I was able to get inference working: