Forum

Using the new Bluetooth audio profiles


#1

I just built an image from tag builds/webosose/master/49 to try out playing audio through my Bluetooth earphones.

There does not seem to be any way of pairing the devices in the UI. I was expecting Settings to have been extended, perhaps, to enable that, but I still see only General and Network.

Have I not really built the latest code? (I kept my sstate cache folder from last time.)

Is the Bluetooth capability there but I need to write my own software to make use of it?

Just trying to understand. Thanks.


#2

Hello elvispre.
Currently, the pairing the device through UI is not available. You need to use luna send to pair it. The user scene through Settings is under development.


#3

Hello Elvispre,
I hope you were able to pair and play audio on your bluetooth earphone using luna commands.
If not, you can refer to the below API reference link for commands to pair, connect your bluetooth earphone.
Link: http://webosose.org/develop/ls2-api/ls2-api-reference/com-webos-service-bluetooth2/

Hope it helps

You can pair and connect with below commands:
Turn on BT

luna-send -n 1 -f luna://com.webos.service.bluetooth2/adapter/setState '{"powered":true}'

Expected Response:

{
"adapterAddress": "00:00:97:1c:c9:3c",
"returnValue": true
}

Start Discovery

luna-send -n 1 -f luna://com.webos.service.bluetooth2/adapter/startDiscovery '{}'

Expected Response:

{
"adapterAddress": "00:00:97:1c:c9:3c",
"returnValue": true
}

Search your bluetooth earphone device for example LG HBS700

luna-send -n 1 -f luna://com.webos.service.bluetooth2/device/getStatus '{}' | grep "LG HBS700" -C 10

Expected Response:

{

"serviceClasses": [
],
"trusted": false,
"connectedProfiles": [
],
"pairing": false,
"rssi": -62,
"name": "LG HSB700",
"address": "xx:xx:xx:xx:xx:xx",
"paired": false,
"typeOfDevice": "bredr",
"adapterAddress": "",
"classOfDevice": 5898764,
"blocked": false
},

Cancel discovery

luna-send -n 1 -f luna://com.webos.service.bluetooth2/adapter/cancelDiscovery '{}'

Expected Response:

{
"adapterAddress": "00:00:97:1c:c9:3c",
"returnValue": true
}

Pair LG HBS700 deivce, replace xx:xx:xx:xx:xx:xx by your bluetooth earphone address

luna-send -i -f luna://com.webos.service.bluetooth2/adapter/pair '{ "address": "xx:xx:xx:xx:xx:xx", "subscribe":true}'

Expected Response:

{
"subscribed": false,
"returnValue": true,
"request": "endPairing"
}

Bluetooth A2DP device Connect
luna-send -i -f luna://com.webos.service.bluetooth2/a2dp/connect '{"address":"xx:xx:xx:xx:xx:xx","subscribe":true}'

Expected Response:

{
"subscribed": true,
"adapterAddress": "00:00:97:1c:c9:3c",
"returnValue": true
}


#4

Thank you very much for the detailed instructions.

I managed to pair my headphones alright, but the connect fails with "Profile backend is not available".


#5

If I call adapter/queryAvailable, I only see GATT and SPP in my list. I think this confirms my suspicion that I did not really build the latest code this time...

...And in fact, after a rebuild, I have successfully played some YouTube video sounds through my Bluetooth headphones using webOS OSE :slight_smile:


#6

Yes, you figured it right. A2DP not on the list is the reason for "Profile backend is not available".
I hope the new build with latest code solved the problem.