0

I'm building a baby monitor based on Raspberry Pi. I use Picam and rtsp-server to stream the pi camera and the sound of the USB Microphone to a video view in an android app.

At the same time pyaudio reads data of the USB Microphone and analyses wheter the baby is crying or not. This is transported through a websocket to the app.

To use an input device simultaneously i tried to use the ALSA plugin dsnoop with the following config in ~/.asoundrc :

pcm.record_picam {
    type dsnoop
    ipc_key 2048
    slave {
        pcm "hw:1,0"
        channels 1
    }
}
pcm.record_websocket {
    type dsnoop
    ipc_key 2048
    slave {
        pcm "hw:1,0"
        channels 1
    }
}

With this I can simultaneously run two instances of arecord. But when I use one of the two devices with picam, pyaudio cant find the other one. When I start the python script at first, I got different errors from picam such as wrong buffer_size (already tried to set it in asoundrc, no change)

Did I something wrong with the dsnoop config? Is it not possible to use a dsnoop device with pyaudio?

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Browse other questions tagged or ask your own question.