Closed bshogeman closed 6 years ago
Do you have other applications, such as pulseaudio, using the recording ALSA device?
You can run echo 'autospawn = no
> ~/.config/pulse/client.confto disable pulseaudio autostart, run
pulseaudio -k` to kill pulseaudio.
The script uses ac108
alsa device. Try arecord -f S16_LE -r 16000 -c 4 -D ac108 -v s.wav
to test if the ac108
alsa device is available, then run the script.
I have a similar problem
Recording works fine on using arecord, and I am not using pulseaudio.
I don't see a108 is only for capture
however
I have a ReSpeaker 4mic version. kws_doa.py Channels changed to 4 vad_doa mic_array.py test_4mic() enabled and disabled test_8mic()
Most command's give an error: google_home_lights.py: No USB device found.
google_assistant_for_raspberry_pi.py : No USB device found Traceback (most recent call last): File "google_assistant_for_raspberry_pi.py", line 81, in
main()
File "google_assistant_for_raspberry_pi.py", line 75, in main
with Assistant(credentials) as assistant:
TypeError: init() takes exactly 3 arguments (2 given)
pi@retropie:~/mic_array $ python vad_doa.py No USB device found ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.front ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.rear ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.center_lfe ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.side ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround21 ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround21 ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround40 ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround41 ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround50 ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround51 ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.surround71 ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958 ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958 ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.iec958 ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.hdmi ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.modem ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM cards.pcm.phoneline ALSA lib pcm_dmix.c:990:(snd_pcm_dmix_open) The dmix plugin supports only playback stream ALSA lib pcm_dmix.c:1052:(snd_pcm_dmix_open) unable to open slave ALSA lib pcm_dmix.c:990:(snd_pcm_dmix_open) The dmix plugin supports only playback stream ALSA lib pcm_dmix.c:1052:(snd_pcm_dmix_open) unable to open slave ALSA lib pcm_ac108.c:469:(_snd_pcm_ac108_open) a108 is only for capture ALSA lib pcm_dmix.c:1052:(snd_pcm_dmix_open) unable to open slave (0, 'seeed-4mic-voicecard: - (hw:0,0)', 2L, 0L) (1, 'bcm2835 ALSA: - (hw:1,0)', 0L, 2L) (2, 'bcm2835 ALSA: IEC958/HDMI (hw:1,1)', 0L, 2L) (3, 'sysdefault', 128L, 0L) (4, 'mic', 0L, 128L) (5, 'speaker', 128L, 0L) (6, 'default', 32L, 32L) Traceback (most recent call last): File "vad_doa.py", line 52, in
main()
File "vad_doa.py", line 23, in main
with MicArray(RATE, CHANNELS, RATE * VAD_FRAMES / 1000) as mic:
File "/home/pi/mic_array/mic_array.py", line 42, in init
raise Exception('can not find input device with {} channel(s)'.format(self.channels))
Exception: can not find input device with 4 channel(s)
That last one is a real issue. Drivers are installed but also I can't record from this device. pi@retropie:~/mic_array $ arecord -L null Discard all samples (playback) or generate zero samples (capture)
playback
dmixed ac108 default Playback/recording through the PulseAudio sound server mic speaker sysdefault:CARD=seeed4micvoicec seeed-4mic-voicecard, Default Audio Device dmix:CARD=seeed4micvoicec,DEV=0 seeed-4mic-voicecard, Direct sample mixing device dsnoop:CARD=seeed4micvoicec,DEV=0 seeed-4mic-voicecard, Direct sample snooping device hw:CARD=seeed4micvoicec,DEV=0 seeed-4mic-voicecard, Direct hardware device without any conversions plughw:CARD=seeed4micvoicec,DEV=0 seeed-4mic-voicecard, Hardware device with all software conversions