Unable to record audio from dsnoop audio device

I recently started playing with Rhasspy and im hooked! I am using the “server + satellites” configuration and have had success with using Raspberry Pi 3b as a dedicated satellite.

My current issue is with converting an existing Raspberry Pi 4b that has been running a video / audio baby monitor + Mycroft voice assistant from Mycroft to a Rhasspy satellite. I figured this would be simple, but im running in to one hiccup getting Rhasspy to recognize the microphone that is also being used by the baby monitor software.

This is my asound.conf which allows both the baby monitor and Mycroft to access the mic simultaneously:

pcm.dsnooped {
    type dsnoop
    ipc_key 2241234
    slave {
        pcm "hw:1,0"
        channels 1
        rate 16000
    }
}

pcm.!default {
        type asym
        playback.pcm {
                type plug
                slave.pcm "hw:0,0"
        }
        capture.pcm {
                type plug
                slave.pcm "dsnooped"
        }
}

Mycroft and the baby monitor can simultaneously record from this dsnooped device, but in the Rhasspy interface i am unable to get audio recording to work.

I’ve done some cursory searches of related questions and it seems like this may be a limitation of Docker (or the rhasspy docker image) and its ability to interact with dsnoop devices on the host machine? Is this correct? or am i missing something?

Some extra details if they’re helpful:

  • arecord -L on host
pi@picroft:~ $ arecord -L
null
    Discard all samples (playback) or generate zero samples (capture)
jack
    JACK Audio Connection Kit
pulse
    PulseAudio Sound Server
dsnooped
default
    Playback/recording through the PulseAudio sound server
usbstream:CARD=Headphones
    bcm2835 Headphones
    USB Stream Output
sysdefault:CARD=Mic
    Samson Go Mic, USB Audio
    Default Audio Device
front:CARD=Mic,DEV=0
    Samson Go Mic, USB Audio
    Front speakers
surround21:CARD=Mic,DEV=0
    Samson Go Mic, USB Audio
    2.1 Surround output to Front and Subwoofer speakers
surround40:CARD=Mic,DEV=0
    Samson Go Mic, USB Audio
    4.0 Surround output to Front and Rear speakers
surround41:CARD=Mic,DEV=0
    Samson Go Mic, USB Audio
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=Mic,DEV=0
    Samson Go Mic, USB Audio
    5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=Mic,DEV=0
    Samson Go Mic, USB Audio
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=Mic,DEV=0
    Samson Go Mic, USB Audio
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=Mic,DEV=0
    Samson Go Mic, USB Audio
    IEC958 (S/PDIF) Digital Audio Output
dmix:CARD=Mic,DEV=0
    Samson Go Mic, USB Audio
    Direct sample mixing device
dsnoop:CARD=Mic,DEV=0
    Samson Go Mic, USB Audio
    Direct sample snooping device
hw:CARD=Mic,DEV=0
    Samson Go Mic, USB Audio
    Direct hardware device without any conversions
plughw:CARD=Mic,DEV=0
    Samson Go Mic, USB Audio
    Hardware device with all software conversions
usbstream:CARD=Mic
    Samson Go Mic
    USB Stream Output
  • arecord -l on host
pi@picroft:~ $ arecord -l
**** List of CAPTURE Hardware Devices ****
card 1: Mic [Samson Go Mic], device 0: USB Audio [USB Audio]
  Subdevices: 0/1
  Subdevice #0: subdevice #0

Screenshots from Rhasspy audio interface:

Thanks in advance for any help!

You are likely missing a permission line with the ipc.

Read this thread and with docker make sure libs and asound.conf exist inside the continer.

1 Like

Hi roylan, thank you for the response. You’re a wizard!

After incorporating many tips from that thread it’s now working!

This is my Docker run:

sudo docker run -d \
    -p 12101:12101 \
    --name rhasspy-satellite \
    --restart unless-stopped \
    -v "$HOME/.config/rhasspy/profiles:/profiles" \
    -v "/etc/localtime:/etc/localtime:ro" \
    -v "/etc/asound.conf:/etc/asound.conf" \
    --device /dev/snd:/dev/snd \
    --ipc="host" \
    rhasspy/rhasspy \
    --profile en \
    --user-profiles /profiles

This is my asound.conf now used by both the host and container. I think some of the stuff I’ve added in may not be necessary, I was trying many different things. But it does work now.:

defaults.pcm.rate_converter "samplerate"
defaults.pcm.ipc_perm 0666

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

pcm.speakers {
	type hw
	card 0
}

pcm.dsnooped {
    type dsnoop
    ipc_key 2241234
    ipc_perm 0666
    slave {
        pcm "hw:1,0"
        channels 1
        rate 16000
    }
}

Thanks again!

1 Like