voice-engine / ec

Echo Canceller, part of Voice Engine project
GNU General Public License v3.0
240 stars 69 forks source link

alsa + ReSpeaker 4-Mic Linear Array Kit for Raspberry Pi + ec #4

Open blademckain opened 5 years ago

blademckain commented 5 years ago

Hello, I have an echo cancellation problem in a raspberry application that works using the alsa default channel. Would it be possible to set ec + ReSpeaker 4-Mic Linear Array Kit for Raspberry Pi as the default alsa channel (so that it can be used by my application)? I would like it to work on a raspberry Pi zero W, do you think it can support it?

xiongyihui commented 5 years ago

It works with Pi zero W. You can modify /etc/asound.conf and ~/.asoundrc to configure ALSA default channel. Check https://alsa-project.org/wiki/Asoundrc

blademckain commented 5 years ago

Hi, i have installed the ReSpeaker 4-Mic Linear Array following this guide http://wiki.seeedstudio.com/ReSpeaker_4-Mic_Linear_Array_Kit_for_Raspberry_Pi/

now my default alsa device is the ReSpeaker 4-Mic Linear Array

i have installed ec

if i execute ./ec_hw -i plughw:1 -c 8 -l 7 -m 0,1,2,3

i get:

warning: The echo canceller started acting funny and got slapped (reset). It swears it will behave now. warning: The echo canceller started acting funny and got slapped (reset). It swears it will behave now. warning: The echo canceller started acting funny and got slapped (reset). It swears it will behave now. warning: The echo canceller started acting funny and got slapped (reset). It swears it will behave now. seems, that ./ec_hw -i plughw:1 -c 8 -l 7 -m 0,1,2,3 is not the correct command for the 4mic linear array

1) what is the correct command for the 4 mic linear array? 2) ec_hw is to be started manually every time? 3) how can I make that the default capture device ( ALSA ) use the EC (ec_hw)?

` root@raspberrypi:/tmp# arecord -L null Discard all samples (playback) or generate zero samples (capture) jack JACK Audio Connection Kit pulse PulseAudio Sound Server default ac108 dmixer ac101 eco usbstream:CARD=ALSA bcm2835 ALSA USB Stream Output sysdefault:CARD=seeed8micvoicec seeed-8mic-voicecard, Default Audio Device dmix:CARD=seeed8micvoicec,DEV=0 seeed-8mic-voicecard, Direct sample mixing device dsnoop:CARD=seeed8micvoicec,DEV=0 seeed-8mic-voicecard, Direct sample snooping device hw:CARD=seeed8micvoicec,DEV=0 seeed-8mic-voicecard, Direct hardware device without any conversions plughw:CARD=seeed8micvoicec,DEV=0 seeed-8mic-voicecard, Hardware device with all software conversions usbstream:CARD=seeed8micvoicec seeed-8mic-voicecard USB Stream Output

root@raspberrypi:/tmp# aplay -L null Discard all samples (playback) or generate zero samples (capture) jack JACK Audio Connection Kit pulse PulseAudio Sound Server default ac108 dmixer ac101 eco sysdefault:CARD=ALSA bcm2835 ALSA, bcm2835 ALSA Default Audio Device dmix:CARD=ALSA,DEV=0 bcm2835 ALSA, bcm2835 ALSA Direct sample mixing device dmix:CARD=ALSA,DEV=1 bcm2835 ALSA, bcm2835 IEC958/HDMI Direct sample mixing device dsnoop:CARD=ALSA,DEV=0 bcm2835 ALSA, bcm2835 ALSA Direct sample snooping device dsnoop:CARD=ALSA,DEV=1 bcm2835 ALSA, bcm2835 IEC958/HDMI Direct sample snooping device hw:CARD=ALSA,DEV=0 bcm2835 ALSA, bcm2835 ALSA Direct hardware device without any conversions hw:CARD=ALSA,DEV=1 bcm2835 ALSA, bcm2835 IEC958/HDMI Direct hardware device without any conversions plughw:CARD=ALSA,DEV=0 bcm2835 ALSA, bcm2835 ALSA Hardware device with all software conversions plughw:CARD=ALSA,DEV=1 bcm2835 ALSA, bcm2835 IEC958/HDMI Hardware device with all software conversions usbstream:CARD=ALSA bcm2835 ALSA USB Stream Output sysdefault:CARD=seeed8micvoicec seeed-8mic-voicecard, Default Audio Device dmix:CARD=seeed8micvoicec,DEV=0 seeed-8mic-voicecard, Direct sample mixing device dsnoop:CARD=seeed8micvoicec,DEV=0 seeed-8mic-voicecard, Direct sample snooping device hw:CARD=seeed8micvoicec,DEV=0 seeed-8mic-voicecard, Direct hardware device without any conversions plughw:CARD=seeed8micvoicec,DEV=0 seeed-8mic-voicecard, Hardware device with all software conversions usbstream:CARD=seeed8micvoicec seeed-8mic-voicecard USB Stream Output root@raspberrypi:/tmp# `

blademckain commented 5 years ago

help!

xiongyihui commented 5 years ago

It seems that your sound number is 0 (CARD=seeed8micvoicec,DEV=0).

./ec_hw -i plughw:seeed8micvoicec -c 8 -l 7 -m 0,1,2,3

To run ec_hw automatically, you should write a systemd service.

With asound.conf. the output of ec_hw will be set as the default capturing device.

blademckain commented 5 years ago

Thx u, i try! Can u put in your repo a systemd service for Raspbian?

blademckain commented 5 years ago

with your asound.conf I can't play audio Is it possible to use ec_hw and simultaneously play audio?