Recently, I have returned to this challenge. The goal is to reduce our daily grind of getting kids out the door ON TIME, which has me thinking that I can send rule based announcements over Bluetooth. Ideally, I want to send BT actions to the various Echo & Dots in our home. I should be able to define each as a Sink, and then action them as individual BT speakers. What I’m not trying to do is create some whole home Audio network.
With the advent of the RPi3 on-board BT support, I have successfully Paired and Played audio files over BT from the command line using paplay and mpg123 to a JamBox speaker. Where things fall down is between OH2 and the Java side (I think!). I have also successfully used the 3.5mm Jack Line Out for OH2 Say and Play methods so I know it’s possible. I probably just need to send to the correct sink. So I’m having successes, just not together. I have tried to make sure that I’ve switched what the default Pulse Audio Sink is for BT or Jack output in my testing.
I know that OH thinks it’s playing the audio file because if I use an incorrect filename it will complain. I’m not sure what Java Category I should be setting to DEBUG, but something is falling down on the outbound.
I know the documentation of Audio and Sinks is “coming”, but it’s very difficult to piece all of the details together. So I challenge the community back here to say, all of the pieces appear to be there now. Why don’t we have this figured out? It’s not clear to me if I, should, can, or how to create an Audio Sink in OH. Or if I should be using only the enhancedjavasound sink directly.
RPi3
OH2 -> Rules -> JavaSound / CmdLine -> PulseAudio Sink -> BT -> Speaker
This should be do-able at this point.
For those who are interested, the things I know and have been testing. Most of this is simply found under BT Headset pairing.
On RPi3, PulseAudio is used.
The BT modules need to be added.
Reconnect can also be added.
Created a PulseAudio Service running in headless server mode. Making sure to edit the server config file, not that user file.
Go through the bluetoothctl to scan trust pair and connect.
Set the PulseAudio default sink
Test with paplay or other players. BT Audio out works.
Set up the OH2 Rules or Console commands. This is where it all falls down. I can only get OH to pass Audio to the 3.5 line out jack.
There is something that I am missing about passing from OH java to the PulseAudio BT sink.
Suggestions?
I’m happy to help with documentation, but I need some more support at the java layer.