Closed eichblatt closed 2 years ago
I have learned a lot about bluetooth lately.
At least one of the reasons why it isn't working is that I cannot use "pulse" as my audio-device.
The reason I can't use pulse as the audio-device is that my program is launched by a systemd service, which is really run by root as a system-wide process. Pulse audio is only run as a per-user daemon. So, when I launch the service, it's not connecting to my user's pulseaudio daemon.
Note: If i wanted to set the audio device as pulse, this would be in the GDPlayer object __init__
function;
class GDPlayer(MPV):
""" A media player to play a GDTape """
def __init__(self, tape=None):
super().__init__()
# self._set_property('prefetch-playlist','yes')
# self._set_property('cache-dir','/home/steve/cache')
# self._set_property('cache-on-disk','yes')
self._set_property('audio-buffer', 10.0) # This allows to play directly from the html without a gap!
self._set_property('cache', 'yes')
# self.default_audio_device = 'pulse'
self.default_audio_device = 'auto'
audio_device = self.default_audio_device
self._set_property('audio-device', audio_device)
self.download_when_possible = False
self.tape = None
if tape is not None:
self.insert_tape(tape)
I remember struggling to figure this out back when I was moving to using a systemd service. Ugh!
Anyway, if I could use pulse, things would be a lot easier.
This is now working
Damn this is hard. I've made a lot of progress, and am able to connect, but it fails with this message when i try to pair the headphones to the Raspberry Pi: