Pyo / Portaudio / Raspberry Pi 4 / Bluetooth Problems...

123 views
Skip to first unread message

Ch S

unread,
Sep 24, 2021, 4:38:39 PM9/24/21
to pyo-discuss
Hey Pyo-Community !
I am using Pyo as Soundlibrary in my Phyton Project on a Raspberry Pi 4.
On the whole its about Sonfication of realtime Data and output that to Bluetooth Headphones.
Till my first Raspberry 4 was damaged there never were problems, but due modification on the Bluetooth Hardware 
it was not possible to get my old working image to the second, newer Raspberry Pi 4 [Because of a bluetooth problem].
So i flashed a newer blank Raspberry Pi OS Image but then i realised that the Audio Software Stack also changed last December.
Till December 2020 there was Alsa & bluez & bluez-alsa -> Portaudio worked perfect with Alsa so and Bluetooth Headphones worked perfect bis Pyo.
Since December 2020 there is Pulseaudio on top of Alsa, and bluetooth is not anymore on Alsa Level, instead its connected on the Pulseaudio Level. 
So it was not possible to make realtime Output from Pyo to the Bluetooth Headphones because Portaudio had no Pulseaudio Host.
First i tryed to deinstall pulseaudio and create a Audio/Bluetooth Softwarestack like it was before December 2020.
Everything worked again with bluetooth & alsa & portaudio, but not when starting Pyo - i documented the problems here:
It seemed that portaudio tryed to open the A2DP device for both capture and playback - even when only playback is requested !
It was very frustrating and time consuming so i take another plan because i found the portaudio fork of illuusio which adds Pulseaudio support
to Portaudio.
After compiling this version of portaudio - all of your Pyo examples were working on the bluetooth Headphones again
But when i started my application the Sound was very disturbing and not the same like it was before...
So i found out that your Examples allways used:
s.gui(locals()) to keep the server running 
In my application instead there is a While Loop in which the realtimedata comes from a Sensor and directly modify Parameters of Pyo Objects,
so i never needed the s.gui(locals()) Command but everything worked perfectly.
I think that Illuusio's Portaudio Fork with the Pulseaudiohost has Threading Issues and this is the reason for the very disturbing sound if you don't 
use Pyo with s.gui(locals())
Has anyone suggestions which Step i should try next ? 
* Installing a Jack Server next to Pulseaudio [or on top of Pulseaudio, because like i described above Bluetooth is on Pulseaudio Level] ?
* Trying again the Alsa - bluez - bluealsa Possibilty and fix the Portaudio Problem there ?
* ... or anything else ?
Thx alot !
Reply all
Reply to author
Forward
0 new messages