BlueWave Studio forum
Sound outside of OAP - Printable Version

+- BlueWave Studio forum (https://bluewavestudio.io/community)
+-- Forum: OpenAuto Pro (https://bluewavestudio.io/community/forum-86.html)
+--- Forum: External applications (https://bluewavestudio.io/community/forum-68.html)
+--- Thread: Sound outside of OAP (/thread-1489.html)



Sound outside of OAP - jvteam - 03-03-2020

I built a voice assistant and chatbot to install as one of my applications.  However when I run it...it doesn't seem to want to use the microphone or speakers.  When it goes to play the opening mp3 it says....

Can't find a suitable libao driver. (Is device in use?)

microphone section has a similar issue.

I don't want to screw up the sound in OAP as I had to wrestle with that awhile ago. Kodi audio works fine.  Other applications I launch seem to be ok.  Any tips on next steps to try?


RE: Sound outside of OAP - BlueWave - 03-03-2020

Please check whether your application uses PulseAudio as an audio backend. If it outputs error like "device already in use" most probably it uses ALSA under the hood that does not support simultaneous usage of the audio devices by different applications.

On the other hand, libao might be compiled without support of the PulseAudio API - then you have to recompile it by yourself with PulseAudio API support or switch to another audio library.

https://www.xiph.org/ao/doc/ao_driver_id.html
https://www.xiph.org/ao/doc/drivers.html
https://www.xiph.org/ao/doc/ao_open_live.html


RE: Sound outside of OAP - jvteam - 03-03-2020

(03-03-2020, 08:13 AM)BlueWave Wrote: Please check whether your application uses PulseAudio as an audio backend. If it outputs error like "device already in use" most probably it uses ALSA under the hood that does not support simultaneous usage of the audio devices by different applications.

On the other hand, libao might be compiled without support of the PulseAudio API - then you have to recompile it by yourself with PulseAudio API support or switch to another audio library.

https://www.xiph.org/ao/doc/ao_driver_id.html
https://www.xiph.org/ao/doc/drivers.html
https://www.xiph.org/ao/doc/ao_open_live.html
I'm using a subprocess call to mpg321.  So yes. It uses alsa.

Do you know of another mp3 program (and recording) that uses pulse? I'm planning to try vlc, ffplay and paplay.


RE: Sound outside of OAP - BlueWave - 03-03-2020

The esiest way would be to use cvlc.


RE: Sound outside of OAP - jvteam - 03-03-2020

(03-03-2020, 11:45 AM)BlueWave Wrote: The esiest way would be to use cvlc.
What about on the input/recording side?  Right now I'm using arecord.

subprocess.call(['arecord --device=plughw:1,0 -d 6 -f cd -t wav rec.wav'], shell=True)


RE: Sound outside of OAP - jvteam - 03-03-2020

no suggestions?


RE: Sound outside of OAP - ktb - 03-04-2020

(03-03-2020, 11:37 PM)jvteam Wrote: no suggestions?
Ummm... did you try using arecord?

subprocess.call(['arecord --device=pulse -d 6 -f cd -t wav rec.wav'], shell=True)


RE: Sound outside of OAP - jvteam - 03-04-2020

(03-04-2020, 12:07 AM)ktb Wrote:
(03-03-2020, 11:37 PM)jvteam Wrote: no suggestions?
Ummm... did you try using arecord?

subprocess.call(['arecord --device=pulse -d 6 -f cd -t wav rec.wav'], shell=True)
PERFECT!  Thanks.


GPT-2 chatbot now works!