Using the audio output (Device or resource busy)

Here’s the situation: I have three audio output soft-volume channels that are working fine with regular alsa raspberry pi bcm2835 environment. One plays music (or video) sound, the other channel plays voice prompts and the third channel plays sounds to signal “understood”, “ready” or “error”. The idea is that the user can set all volumes independently.



Here’s how it is supposed to work : The user is playing an audio stream and says the wake word. The device mutes the audio and plays a “bing” signal to let the user know it is ready to receive the voice command. The user says “what time is it” … the unit plays another “bing” to signal it understood and speaks the requested information. After this has been done, the audio stream is unmuted and that’s that.



Again - this works fine with alsa (bcm2835) . Using the re-speaker as output, I can’t use the alsa softvol channels because I get (Device or resource busy) when ever I try to play a second audio stream. Is there a way to work around this?



m.

OK … I dug into the issue. Turns out the audio-out accepts only one audio stream. That wouldn’t be a problem if it were not for the required S24_3LE format of the audio chip that - for the time being, doesn’t allow the usage of ALSA dmix / softvol combination. Is there any way to reduce the format to S16_LE?



m.

Hi M.



We had a long weekend due to moving offices, and now the employees are setting up their workstations today. The response for this may be delayed a bit more that usual - but it will come! I apologize for the possible delay.

It’s been a year now and I still can’t play multiple streams with the speaker. C’mon guys - I really love the microphone, but a > $60 device should be able to play more than one audio stream at a time.



Please advise.



Michaela

Many embedded devices need audio output for user feedback. The techniques and sounds used vary quite a bit as seen in the video below about designing sound feedback for cars. Several examples will be provided with the mbed APIs using both PWM and Analog Out with some additional low cost parts. Hooking up the speaker directly to an mbed output pin results in very low volume and a driver circuit is needed to boost the current levels to drive the speaker to provide adequate volume levels. PWM output pins have a bit more drive current than the AnalogOut pin. The volume is even lower on the AnalogOut pin without a driver. A lot of this volume difference is due to the fact the square waves sound louder to humans than sine waves at low frequencies.