Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
blademckain opened this issue May 26, 2019 · 6 comments
Open

Comments

@blademckain
Copy link

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
Copy link
Member

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
Copy link
Author

blademckain commented Jul 31, 2019

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
Copy link
Author

help!

@xiongyihui
Copy link
Member

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
Copy link
Author

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

@blademckain
Copy link
Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants