2

I have an AlexaPi running, but I also want a voice activated (and controlled) radio machine.

The radio part is sorted, and so is the AlexaPi, but there is a problem.

Running them both at ones presents me with the error

alsaaudio.ALSAAudioError: Device or resource busy.

I have considered moving them into the same file but that would be very difficult, considering the AlexaPi is GPIO activated.

Is it possible to use the mic in the two places at once?

One is always listening, the other isn't.

if that can't be done, could it be possible to, when I push the GPIO button to make the AlexaPi listen, have it take control of the mic for the duration of the button being pushed, then return it to the other?

Thanks guys!

1

Yes it is possible. You should used the dsnoop alsa plugin. This will allow you to open the same device twice in different applications.

Here is an example : arecord -Ddsnoop -f cd test.wav

  • Thanks, but I got this ALSA lib pcm_dmix.c:961:(snd_pcm_dmix_open) The dmix plugin supports only playba ck stream – Will Sep 6 '16 at 6:44
  • What does arecord -L report ? – Matt Sep 6 '16 at 23:10
  • pastebin.com/jfXqpeiM – Will Sep 7 '16 at 10:30
  • The USB camera is my microphone – Will Sep 7 '16 at 10:30
  • The actual line that initiates the recording is inp = alsaaudio.PCM(alsaaudio.PCM_CAPTURE, alsaaudio.PCM_NORMAL, device) I am pretty sure – Will Sep 7 '16 at 10:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.