iqballk
Posts: 3
Joined: Mon Mar 12, 2018 1:34 pm

ReSpeaker_2_Mics_Pi_HAT ALSA Configuration..!

Fri Mar 30, 2018 10:56 am

Hi all ! This is my first post !

I've purchased the ReSpeaker 2-Mics HAT for the Raspberry PI and

would love to use it !

I've followed the instructions on the wiki -

http://wiki.seeedstudio.com/ReSpeaker_2_Mics_Pi_HAT/

but no sound in the headphone port of 2mics hat. i have 3 audio

outputs in my pi. built in audio, HDMI and 2-mics hat. then i

disable builtin sound device via boot config file.

Code: Select all

aplay -l && arecord -l

**** List of PLAYBACK Hardware Devices ****
card 0: seeed2micvoicec [seeed-2mic-voicecard], device 0: bcm2835-

i2s-wm8960-hifi wm8960-hifi-0 []
  Subdevices: 0/1
  Subdevice #0: subdevice #0
**** 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
root@SmartMirror:/home/pi#

Code: Select all

sudo nano /boot/config.txt

# Enable audio (loads snd_bcm2835)
#dtparam=audio=on
start_x=1
gpu_mem=128
DISPLAY_ROTATE=0
dtoverlay=i2s-mmap
then i copy asound.conf and asound.state files from the source dist

of the re-speaker driver on github and installing them according to

the instructions (put asound.conf in /etc, use alsactl command to

install asound.state)

Image

Code: Select all

sudo nano /etc/asound.conf

# The IPC key of dmix or dsnoop plugin must be unique
# If 555555 or 666666 is used by other processes, use another one

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"
    ipc_key 555555
}

pcm.array {
    type dsnoop
    slave {
        pcm "hw:0,0"
        channels 2
    }
    ipc_key 666666
}
still no sound in 2-mics hat. alsa.conf also not changed.

Code: Select all

sudo nano /usr/share/alsa/alsa.conf

defaults.ctl.card 0
defaults.pcm.card 0
defaults.pcm.device 0
defaults.pcm.subdevice -0
defaults.pcm.nonblock 1
defaults.pcm.compat 0
defaults.pcm.minperiodtime 5000         # in us
defaults.pcm.ipc_key 5678293
defaults.pcm.ipc_gid audio
defaults.pcm.ipc_perm 0660
defaults.pcm.dmix.max_periods 0
defaults.pcm.dmix.rate 48000
defaults.pcm.dmix.format "unchanged"
defaults.pcm.dmix.card defaults.pcm.card
defaults.pcm.dmix.device defaults.pcm.device
defaults.pcm.dsnoop.card defaults.pcm.card
defaults.pcm.dsnoop.device defaults.pcm.device
defaults.pcm.front.card defaults.pcm.card
defaults.pcm.front.device defaults.pcm.device
defaults.pcm.rear.card defaults.pcm.card

this is my .asoundrc file

Code: Select all

sudo nano ~/.asoundrc

pcm.!default {
  type asym
  playback.pcm
  {
    type hw
    card 0
    device 0
  }
  capture.pcm
  {
    type hw
    card 0
    device 0
  }
}

when i use omxplayer command without conditions, i can listen the

song via TV HDMI interface.

Code: Select all

omxplayer vaa.mp3
if i force omxplayer with alsa.. theirs no sound in HDMI or 2-mics

hat headphone port.

Code: Select all

omxplayer vaa.mp3 -o alsa

Code: Select all

omxplayer vaa.mp3 -o alsa:hw:0,0
Audio codec mp3 channels 2 samplerate 44100 bitspersample 16
Subtitle count: 0, state: off, index: 1, delay: 0
when i check speaker by..

Code: Select all

arecord -f cd -Dhw:0 | aplay -Dhw:0
Recording WAVE 'stdin' : Signed 16 bit Little Endian, Rate 44100 

Hz, Stereo
Warning: rate is not accurate (requested = 44100Hz, got = 48000Hz)
         please, try the plug plugin
aplay: main:788: audio open error: Device or resource busy
Hardware;

* Raspberry pi 3b
* seeedstudio 2-mics Hat
* 22" HDMI TV
* usb powerd speakers connected to 3.5mm jack of 2-mics Hat

Software;
Raspian Stretch
NPM@3.10.10
NODE@v6.13.1
Java@1.8.0_65-b17
Python@2.7.13

Note: PulseAudio not installed.

Please save my life..

Return to “General discussion”