Asoundrc help? SEED 4-mic USB array for input, Jabra 410 USB speaker for output

Any alsa configuration wizards around? :wink:

I want to continue using the Jabra 410 speaker for sound output, while using the ReSpeaker 4-Mic USB array for sound input. I have disabled the system’s Broadcom sound device at startup. Here’s the output of aplay -l command:

root@RhasspyListener:~# aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: ArrayUAC10 [ReSpeaker 4 Mic Array (UAC1.0)], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: USB [Jabra SPEAK 410 USB], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

I tried defining separate pcm. and ctl. entities for each device and it appeared to work in the host Raspbian Buster environment, but when I copied it to the Docker container, I got no sound input. :frowning: Here’s the elementary asoundrc file:

pcm.jabra {
    type hw
    card 1
    device 0
    rate 48000
    format "S16_LE"
    channels 2
}

pcm.ReSpeaker {
    type hw
    card 0
    device 0
}

ctl.ReSpeaker {
    type hw
    card 0
    device 0
}

pcm.!sysdefault {
  type asym
  playback.pcm {
    type plug
    slave.pcm "jabra"
  }
  capture.pcm {
    type plug
    slave.pcm "ReSpeaker"
  }
}

pcm.!default {
  type asym
  playback.pcm {
    type plug
    slave.pcm "jabra"
  }
  capture.pcm {
    type plug
    slave.pcm "ReSpeaker"
  }
}

Thanks in advance, and if you’ve read this far, congratulations. :wink:

It gets more interesting. Rebooting the Pi, it’s not guaranteed the USB devices will register in the same order every time. :open_mouth: Eek!!

I do not know about the asound.conf, but you can solve the USB stuff

https://www.domoticz.com/wiki/Assign_fixed_device_name_to_USB_port

2 Likes

Many, many thanks! :smiley:
For the benefit of others who may wish to combine the ReSpeaker USB microphone with other USB sound devices, here is what I’ve configured for my test platform:

pi@rhasspyTest:/etc/udev/rules.d $ cat 10-usb-sound.rules
SUBSYSTEM=="sound", ATTRS{idVendor}=="2886", ATTRS{idProduct}=="0018", ATTRS{product}=="ReSpeaker 4 Mic Array (UAC1.0)", SYMLINK+="sndUAC10"
SUBSYSTEM=="sound", ATTRS{idVendor}=="0b0e", ATTRS{idProduct}=="0412", ATTRS{product}=="Jabra SPEAK 410 USB", SYMLINK+="sndJabra410"

pi@rhasspyTest:/dev $ ls -la -d snd*
drwxr-xr-x 4 root root 240 Jan 18 09:47 snd
lrwxrwxrwx 1 root root  13 Jan 18 09:47 sndJabra410 -> snd/controlC0
lrwxrwxrwx 1 root root  12 Jan 18 09:47 sndUAC10 -> snd/pcmC1D0p
2 Likes

I started trying to assemble an .asoundrc config file that takes input from the SEEED/ReSpeaker microphone while playing output to the Jabra speaker. At this point, it seems that my testbed Pi decided to start being flaky/balky. :frowning:

The good news is, an .asoundrc file is really only necessary when you want to use the ‘default’ or ‘sysdefault’ ALSA devices. With Rhasspy’s settings GUI, you can actually select the separate sound devices for arecord and aplay. :slight_smile:

1 Like

And now it’s working correctly. With the USB rules above, the following settings work very nicely.

    "microphone": {
        "arecord": {
            "device": "default:CARD=ArrayUAC10"
        },
        "system": "arecord"
    },
    "sounds": {
        "aplay": {
            "device": "sysdefault:CARD=USB"
        },
    },

Here’s one to help other Jabra users. Depending on the precise variety of device you get, the USB device ID values can be slightly different. Tonight, I found a different JabraSpeak 410 Product ID. The value is “0410” instead of the earlier “0412”. In order to find out which device you have, use the command

lsusb -vvv

to find out the precise details of your USB device. In this case, the new USB rules file is

pi@rhasspyTest:/etc/udev/rules.d $ cat 10-usb-sound.rules
SUBSYSTEM=="sound", ATTRS{idVendor}=="0b0e", ATTRS{idProduct}=="0410", ATTRS{product}=="Jabra SPEAK 410 USB", SYMLINK+="sndJabra410"