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

Respeaker 2 Mic Hat #89

Closed
wangodanny opened this issue Dec 16, 2017 · 14 comments
Closed

Respeaker 2 Mic Hat #89

wangodanny opened this issue Dec 16, 2017 · 14 comments
Labels

Comments

@wangodanny
Copy link

wangodanny commented Dec 16, 2017

Hello

I have a Respeaker 2 Mic Hat: https://www.amazon.co.uk/ZIYUN-ReSpeaker-dual-microphone-expansion-applications/dp/B074Z25HXX/ref=sr_1_1?ie=UTF8&qid=1513442978&sr=8-1&keywords=ZIYUN+ReSpeaker+2-Mics+Pi+HAT

I don't know how to make this hat work with your project and some help would be appreciated. I have already set this up but using with GassistPi is hard and I also don't know how to change the hardware ID's. Thanks

@shivasiddharth
Copy link
Owner

Google Assistant has audio issues with all of those Respeaker HATs. They do not work out of the box. I definitely, would not recommend any of the Respeaker HATs for google assistant project. That said, i will try my best to assist you. Try running Pulseaudio in the background and also try changing the number of channels in the asound.conf from 2 to 1.

@valascus
Copy link
Contributor

I got respeaker 4 mic hat working fine. It took a lot of time, but i did it.
Actually, i've wiped my microsd card to update to the new version and i'm right now doing it again.

@wangodanny
Copy link
Author

wangodanny commented Dec 26, 2017 via email

@noemu
Copy link

noemu commented Dec 31, 2017

i've got it working with an diffrent Project.
Maybe it helps.
i'm using the driver from seeeed https://github.com/respeaker/seeed-voicecard

I've also deactivated snd_bcm2853 (modify dtparam=audio=on to #dtparam=audio=on in /boot/config.txt )
and modified the alsa config (/etc/asound.conf)
That's for the 2mic version

pcm.!default {
    type asym
    playback.pcm "playback"
    capture.pcm "capture"
}

pcm.playback {
    type plug
    slave.pcm "dmixed"
    }

pcm.capture {
    type plug
    slave.pcm "array"
}

pcm.dmixed {
    type dmix
    slave {
        pcm "hw:0,0"
        period_time 0
        period_size 1024
        buffer_size 8192
        rate 44100
        format S16_LE
}
    ipc_key 1024
}

pcm.array {
    type dsnoop
    slave {
        pcm "hw:0,0"
        channels 2
    }
    ipc_key 666666
}

I'm not very familiar with alsa and i'm working on a pi zero w.

@jabulonboaz
Copy link

@wangodanny did you try the solution described by @noemu or did you solve the issue any other way?
My Pi zero w and ReSpeaker 2mic arrive this week I will attempt @noemu solution.

@valascus how did you manage to solve it exactly?

@wangodanny
Copy link
Author

wangodanny commented Feb 1, 2018 via email

@jabulonboaz
Copy link

I have fixed this by modding the asoundrc and asoundrc.cofig

@BadFlo
Copy link

BadFlo commented Feb 4, 2018

Hi, can you upload your modified asoundrc.config file to maybe add it to the project?

@jabulonboaz
Copy link

Ok will do soon as i am done trying to make it work with pi zero w now. I got only one respeaker hat and took it off pi3 and trying to install ga on pi0w now make it hotword activated.

@jabulonboaz
Copy link

Note: i do not know how to submit this as a contribution to this project so i wrote it here i hope that @sid will use this in a coments section for others to benefit from and thank uou Sid!
I have successfully instaled using AssistantsPi Alexa on a Pi zero W using the Pi3 instal process and it works with wakeword activation - no need for the button.
I have not only completed the install on a Pi3 but allso on a PiOw and it works like a charm. I have only installed Alexa from the options of assistant pi as with Google assistant and Alexa running simultaneously it won't work on Pi0 but it does on Pi3 btw.
The way i done it was to install the AssitantsPi by choosing option 2 Alexa only and choose 1 for AIY hat as soundcard option. That leaves the asound.conf empty. I have an AIY hat so i could test the sound but u don't need to have one i believe you can just go ahead and finish the install any way without confirming the sound check. Then when i finished installing on the pi3 (btw i skipped the very last command of the instructions on the Assistant Pi git that activated Google assistant) i removed the AIY hat and placed the Respeaker 2 mic on the Pi3. I Then downloaded the Rspeaker 2mic drivers from their git https://github.com/respeaker/seeed-voicecard and the rebooted.
Miraculously the respeaker drivers had deleted the only other appearing audio card that was the AIY hat's and the asound.conf file was populated. BTW Copy pasting the contents of the asound to asoundrc made no difference.
Alexa is working perfectly the only thing there is no "hello" sound when she starts up it must be because i skipped the last command that was supposed to activate the Google assistant i assume it contained some .wav for Alexa or maybe simply the instal script runs in a way that if u install only alexa you get no "hello" at startup. Any way i then took the very SD card with that Pi3 build and another miracle happened when i put it and the respeaker on a Pi zero W it works there too and i have sound from all channels! Only thing on the Pi0 it takes a good 3 to 5 minutes to boot up as the Pi0 is slow.
Any way very please with Alexa from AssistantsPi works headless and with the hotword activation -no button needed, and the package of the device is so small it can fit into anything. My next step it to use Snowboy for custom wake words and activate some of the GPiO pins to be able to control a relay from the PiO. Thank you Sid!

@Pnether
Copy link

Pnether commented Feb 9, 2018

I use a Seeed Respeaker 2-mics Pi HAT without problems by following the instructions
as were given in a magazine to build a DIY Google Assistant with the Respeaker.
The installation did not give problems and works well. I use a Raspberry Pi 3B.

RASPBIAN VERSION as installed prior to Github GassistPi installation:

2017-11-29-raspbian-stretch with desktop (Kernel 4.9).

PUT RESPEAKER BOARD ON THE RASPBERRY:

sudo apt install git         (note: latest update was already on pi)
git clone https://github.com/respeaker/seeed-voicecard.git
cd seeed-voicecard
sudo ./install.sh 2mic

REBOOT 1:

sudo reboot                  

CHECK 1: LIST OF ALL AUDIO DEVICES:

a) check list with various recording devices: arecord -l
pi@raspberrypi:~ $ arecord -l
**** List of CAPTURE Hardware Devices ****
card 1: seeed2micvoicec [seeed-2mic-voicecard], device 0: bcm2835-i2s-wm8960-hifi wm8960-hifi-0 []
Subdevices: 1/1
Subdevice #0: subdevice #0
pi@raspberrypi:~ $

b) check list with various playback devices: aplay -l
pi@raspberrypi:~ $ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: ALSA [bcm2835 ALSA], device 0: bcm2835 ALSA [bcm2835 ALSA]
Subdevices: 8/8
Subdevice #0: subdevice #0
Subdevice #1: subdevice #1
Subdevice #2: subdevice #2
Subdevice #3: subdevice #3
Subdevice #4: subdevice #4
Subdevice #5: subdevice #5
Subdevice #6: subdevice #6
Subdevice #7: subdevice #7
card 0: ALSA [bcm2835 ALSA], device 1: bcm2835 ALSA [bcm2835 IEC958/HDMI]
Subdevices: 1/1
Subdevice #0: subdevice #0
card 1: seeed2micvoicec [seeed-2mic-voicecard], device 0: bcm2835-i2s-wm8960-hifi wm8960-hifi-0 []
Subdevices: 1/1
Subdevice #0: subdevice #0
pi@raspberrypi:~ $

AUDIO DEVICES CONFIGURATION:

Switch off the onboard audio of the Raspberry, by creating a NEW file
with contents "blacklist snd_bcm2835" (one line only, without the quotes):
cd /etc/modprobe.d
ls
sudo nano /etc/modprobe.d/blacklist-alsa.conf
( insert a line with: blacklist snd_bcm2835 )

REBOOT 2:

sudo reboot

CHECK 2: LIST OF 2-MIC AUDIO DEVICE ONLY:

a) check list arecord -l (compare with check 1 above: same, only seeed hardware)
pi@raspberrypi:~ $ arecord -l
**** List of CAPTURE Hardware Devices ****
card 0: seeed2micvoicec [seeed-2mic-voicecard], device 0: bcm2835-i2s-wm8960-hifi wm8960-hifi-0 []
Subdevices: 1/1
Subdevice #0: subdevice #0
pi@raspberrypi:~ $

b) check list aplay -l (compare with check 1 above, now only seeed hardware)
pi@raspberrypi:~ $ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: seeed2micvoicec [seeed-2mic-voicecard], device 0: bcm2835-i2s-wm8960-hifi wm8960-hifi-0 []
Subdevices: 1/1
Subdevice #0: subdevice #0
pi@raspberrypi:~ $

VERIFY 1 SOUND RECORDING AND PLAYBACK:

    arecord -f S16_LE -d 5 test.wav         (record sound for 5 seconds)
aplay test.wav		         	(playback works, with a lot of background noise,
                                                      but that seems no problem for Gassist).

CONFIGURE ALSA MIXER SETTINGS:

    pi@raspberrypi:~ $ alsamixer
    in F3 Playback use the L en R arrow keys to select a device / bar.
	Set the headphones on level 0 
            and set the two speakers on the right on level 0.
    in F4 Capture use the L en R arrow keys to select a device / bar.
	Set Capture on level 84.
    	<esc> = exit
    in F5 All the corrections are only visible after <esc> and restart of AlsaMixer.

VERIFY 2 SOUND RECORDING AND PLAYBACK:

    arecord -f S16_LE -d 5 test.wav         (record sound for 5 seconds)
aplay test.wav			        (playback works, with a lot of background noise)
                                                        but that seems no problem for Gassist).

VERIFY 3 SOUND PLAYBACK:

speaker-test -t wav                     (as in Gassist installation guide)

REBOOT 3: TO BE SURE EVERYTHING IS OK

sudo reboot

Now the Google Assistant can be installed, as described on weblink https://github.com/shivasiddharth/GassistPi.
proceed with alinea "CONTINUE after SETTING UP AUDIO".

Repository owner deleted a comment from jabulonboaz Feb 11, 2018
@shivasiddharth
Copy link
Owner

@jabulonboaz , I had to delete your comment, because it was filled with either IGNORE THIS or NOT WORKING and the instructions you posted was outdated. @Pnether 's post seems to be the latest/working instruction.

@jabulonboaz
Copy link

@shivasiddharth this was not the same, this was how to install the new drivers the above post shows how to install the old drivers. Both work for AssitantsPi though but in some cases the old method does not. I had it all explained but its up to you.
The comments in capital letters where there as part of the "history" explanation in fact i took the time to explain everything that the Seeed engineer did to fix the issue by displaying tje entire history. Instead of deleting the entire post you could have optionally deleted these parts then but hey your git your call.
Thank you any way i love assistanspi.

@shivasiddharth
Copy link
Owner

Closing this for inactivity.

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

No branches or pull requests

7 participants