I am currently using the ReSpeaker 2-Mics Pi HAT (version 1.0) with a Raspberry Pi Zero 2W running a custom setup based on Raspberry Pi OS Bookworm. After successfully installing the drivers from the v6.12 branch of the HinTak seeed-voicecard repository, I am able to see the ReSpeaker device listed with device index '0' when running the Python script get_device_index.py. However, when I attempt to record audio using the provided Python recording example (record.py) targeting device index '0', I encounter the following error at the bottom of all this output and highlighted in green (sorry for the long output, the key issue is the PyAudio stream failing with this unanticiapted host error):
pi@aliaspi:~/mic_hat $ python3 recording_examples/record.py
ALSA lib pcm_asym.c:105:(_snd_pcm_asym_open) capture slave is not defined
ALSA lib pcm.c
(snd_pcm_open_noupdate) Unknown PCM cards.pcm.front
ALSA lib pcm.c
(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear
ALSA lib pcm.c
(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe
ALSA lib pcm.c
(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side
ALSA lib pcm.c
(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround21
ALSA lib pcm.c
(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround21
ALSA lib pcm.c
(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround40
ALSA lib pcm.c
(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround41
ALSA lib pcm.c
(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround50
ALSA lib pcm.c
(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround51
ALSA lib pcm.c
(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround71
ALSA lib pcm.c
(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
ALSA lib pcm.c
(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
ALSA lib pcm.c
(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958
ALSA lib pcm.c
(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c
(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem
ALSA lib pcm.c
(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline
ALSA lib pcm.c
(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:397:(_snd_pcm_oss_open) Cannot open device /dev/dsp
ALSA lib pcm_oss.c:397:(_snd_pcm_oss_open) Cannot open device /dev/dsp
ALSA lib pcm_a52.c
(_snd_pcm_a52_open) a52 is only for playback
ALSA lib conf.c:5670:(snd_config_expand) Unknown parameters {AES0 0x6 AES1 0x82 AES2 0x0 AES3 0x2 CARD 0}
ALSA lib pcm.c
(snd_pcm_open_noupdate) Unknown PCM iec958:{AES0 0x6 AES1 0x82 AES2 0x0 AES3 0x2 CARD 0}
ALSA lib confmisc.c:160:(snd_config_get_card) Invalid field card
ALSA lib pcm_usb_stream.c:482:(_snd_pcm_usb_stream_open) Invalid card 'card'
ALSA lib confmisc.c:160:(snd_config_get_card) Invalid field card
ALSA lib pcm_usb_stream.c:482:(_snd_pcm_usb_stream_open) Invalid card 'card'
ALSA lib pcm_dmix.c:972:(snd_pcm_dmix_open) The dmix plugin supports only playback stream
ALSA lib pcm_direct.c
(snd1_pcm_direct_initialize_slave) unable to install hw params
ALSA lib pcm_dmix.c
(snd_pcm_dmix_open) unable to initialize slave
ALSA lib pcm_direct.c
(snd1_pcm_direct_initialize_slave) unable to install hw params
ALSA lib pcm_dsnoop.c:577:(snd_pcm_dsnoop_open) unable to initialize slave
ALSA lib pcm_dsnoop.c:540:(snd_pcm_dsnoop_open) The dsnoop plugin supports only capture stream
ALSA lib pcm_dmix.c:972:(snd_pcm_dmix_open) The dmix plugin supports only playback stream
ALSA lib pcm_direct.c
(snd1_pcm_direct_initialize_slave) unable to install hw params
ALSA lib pcm_dmix.c
(snd_pcm_dmix_open) unable to initialize slave
ALSA lib pcm_direct.c
(snd1_pcm_direct_initialize_slave) unable to install hw params
ALSA lib pcm_dsnoop.c:577:(snd_pcm_dsnoop_open) unable to initialize slave
ALSA lib pcm_dsnoop.c:540:(snd_pcm_dsnoop_open) The dsnoop plugin supports only capture stream
ALSA lib pcm_dmix.c:999:(snd_pcm_dmix_open) unable to open slave
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
Expression 'r' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 2097
Expression 'PaAlsaStreamComponent_FinishConfigure( &self->capture, hwParamsCapture, inParams, self->primeBuffers, realSr, inputLatency )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 2730
Expression 'PaAlsaStream_Configure( stream, inputParameters, outputParameters, sampleRate, framesPerBuffer, &inputLatency, &outputLatency, &hostBufferSizeMode )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 2842
Traceback (most recent call last):
File "/home/pi/mic_hat/recording_examples/record.py", line 15, in <module>
stream = p.open(
^^^^^^^
File "/home/pi/.local/lib/python3.11/site-packages/pyaudio/__init__.py", line 639, in open
stream = PyAudio.Stream(self, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/pi/.local/lib/python3.11/site-packages/pyaudio/__init__.py", line 441, in __init__
self._stream = pa.open(**arguments)
^^^^^^^^^^^^^^^^^^^^
OSError: [Errno -9999] Unanticipated host error
This error appears during the initialization of the PyAudio stream, and I have been unable to successfully record audio from the device through Python. Basic recording with arecord works only with limited parameters, but the Python interface seems to fail consistently.
Does anyone have a solution for this? I've been troubleshooting the ReSpeaker for 2 days now, and I finally was able to get it recognized by my Raspberry Pi Zero 2W using the Bookworm OS. I have plugged in some speakers in the 3.5 mm jack and I have tried plugging in earplugs as well. aplay -l and arecord -l. I've opened the alsamixer and selected the correct card, and played with some volumes, but it doesn't seem to record anything. I determined the device index with python3 recordding_examples/get_device_index.py which shows:
Input device id 0 - seeed-2mic-voicecard: bcm2835-i2s-wm8960-hifi (hw:1,0).
Also, now that I've edited the ~/recording_examples/record.py file line 8 "RESPEAKER INDEX = 2" and changed "2" to "0" I'm getting the error when I try to record. I think the index '2' was the 'default' recorder. The seeed-2-mic-voicecard shows up when I type aplay -l and arecord -l, so it's recognized as a device.
pi@aliaspi:~/mic_hat $ python3 recording_examples/record.py
ALSA lib pcm_asym.c:105:(_snd_pcm_asym_open) capture slave is not defined
ALSA lib pcm.c
ALSA lib pcm.c
ALSA lib pcm.c
ALSA lib pcm.c
ALSA lib pcm.c
ALSA lib pcm.c
ALSA lib pcm.c
ALSA lib pcm.c
ALSA lib pcm.c
ALSA lib pcm.c
ALSA lib pcm.c
ALSA lib pcm.c
ALSA lib pcm.c
ALSA lib pcm.c
ALSA lib pcm.c
ALSA lib pcm.c
ALSA lib pcm.c
ALSA lib pcm.c
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:397:(_snd_pcm_oss_open) Cannot open device /dev/dsp
ALSA lib pcm_oss.c:397:(_snd_pcm_oss_open) Cannot open device /dev/dsp
ALSA lib pcm_a52.c
ALSA lib conf.c:5670:(snd_config_expand) Unknown parameters {AES0 0x6 AES1 0x82 AES2 0x0 AES3 0x2 CARD 0}
ALSA lib pcm.c
ALSA lib confmisc.c:160:(snd_config_get_card) Invalid field card
ALSA lib pcm_usb_stream.c:482:(_snd_pcm_usb_stream_open) Invalid card 'card'
ALSA lib confmisc.c:160:(snd_config_get_card) Invalid field card
ALSA lib pcm_usb_stream.c:482:(_snd_pcm_usb_stream_open) Invalid card 'card'
ALSA lib pcm_dmix.c:972:(snd_pcm_dmix_open) The dmix plugin supports only playback stream
ALSA lib pcm_direct.c
ALSA lib pcm_dmix.c
ALSA lib pcm_direct.c
ALSA lib pcm_dsnoop.c:577:(snd_pcm_dsnoop_open) unable to initialize slave
ALSA lib pcm_dsnoop.c:540:(snd_pcm_dsnoop_open) The dsnoop plugin supports only capture stream
ALSA lib pcm_dmix.c:972:(snd_pcm_dmix_open) The dmix plugin supports only playback stream
ALSA lib pcm_direct.c
ALSA lib pcm_dmix.c
ALSA lib pcm_direct.c
ALSA lib pcm_dsnoop.c:577:(snd_pcm_dsnoop_open) unable to initialize slave
ALSA lib pcm_dsnoop.c:540:(snd_pcm_dsnoop_open) The dsnoop plugin supports only capture stream
ALSA lib pcm_dmix.c:999:(snd_pcm_dmix_open) unable to open slave
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
Expression 'r' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 2097
Expression 'PaAlsaStreamComponent_FinishConfigure( &self->capture, hwParamsCapture, inParams, self->primeBuffers, realSr, inputLatency )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 2730
Expression 'PaAlsaStream_Configure( stream, inputParameters, outputParameters, sampleRate, framesPerBuffer, &inputLatency, &outputLatency, &hostBufferSizeMode )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 2842
Traceback (most recent call last):
File "/home/pi/mic_hat/recording_examples/record.py", line 15, in <module>
stream = p.open(
^^^^^^^
File "/home/pi/.local/lib/python3.11/site-packages/pyaudio/__init__.py", line 639, in open
stream = PyAudio.Stream(self, *args, **kwargs)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/pi/.local/lib/python3.11/site-packages/pyaudio/__init__.py", line 441, in __init__
self._stream = pa.open(**arguments)
^^^^^^^^^^^^^^^^^^^^
OSError: [Errno -9999] Unanticipated host error
This error appears during the initialization of the PyAudio stream, and I have been unable to successfully record audio from the device through Python. Basic recording with arecord works only with limited parameters, but the Python interface seems to fail consistently.
Does anyone have a solution for this? I've been troubleshooting the ReSpeaker for 2 days now, and I finally was able to get it recognized by my Raspberry Pi Zero 2W using the Bookworm OS. I have plugged in some speakers in the 3.5 mm jack and I have tried plugging in earplugs as well. aplay -l and arecord -l. I've opened the alsamixer and selected the correct card, and played with some volumes, but it doesn't seem to record anything. I determined the device index with python3 recordding_examples/get_device_index.py which shows:
Input device id 0 - seeed-2mic-voicecard: bcm2835-i2s-wm8960-hifi (hw:1,0).
Also, now that I've edited the ~/recording_examples/record.py file line 8 "RESPEAKER INDEX = 2" and changed "2" to "0" I'm getting the error when I try to record. I think the index '2' was the 'default' recorder. The seeed-2-mic-voicecard shows up when I type aplay -l and arecord -l, so it's recognized as a device.
Statistics: Posted by Gison43 — Sun Aug 10, 2025 5:50 pm