I try to connect my Ubuntu 23.10 with an LG C2 TV to then output the sound from LG to Ubuntu; the same works fine with my iPhone which then plays some music through my Ubuntu attached speakers. I use bluetoothctl
:
devices Paired
Device 20:28:BC:81:F8:D9 [LG] webOS TV OLED55C22LB
connect 20:28:BC:81:F8:D9
Attempting to connect to 20:28:BC:81:F8:D9
[CHG] Device 20:28:BC:81:F8:D9 Connected: yes
Connection successful
[CHG] Device 20:28:BC:81:F8:D9 ServicesResolved: yes
but then I can't see in the LG's "Bluetooth Device" menu my Ubuntu as a speaker.
What should I do to solve this?
Actually, for iPhone to output audio to Bluetooth, I had first to specify that the Bluetooth connection's target (i.e. computer) is a speaker.
PS: I use pipewire, pipewire-pulse and wireplumber which work fine
info 20:28:BC:81:F8:D9
Device 20:28:BC:81:F8:D9 (public)
Name: LG TV[[LG] webOS TV OLED55C22LB
Alias: LG TV[[LG] webOS TV OLED55C22LB
Class: 0x0008243c (533564)
Icon: audio-card
Paired: yes
Bonded: yes
Trusted: yes
Blocked: no
Connected: yes
LegacyPairing: no
UUID: Audio Source (0000110a-0000-1000-8000-00805f9b34fb)
UUID: Audio Sink (0000110b-0000-1000-8000-00805f9b34fb)
UUID: A/V Remote Control Target (0000110c-0000-1000-8000-00805f9b34fb)
UUID: A/V Remote Control (0000110e-0000-1000-8000-00805f9b34fb)
UUID: PnP Information (00001200-0000-1000-8000-00805f9b34fb)
UUID: Generic Access Profile (00001800-0000-1000-8000-00805f9b34fb)
UUID: Generic Attribute Profile (00001801-0000-1000-8000-00805f9b34fb)
UUID: LG Electronics (0000feb9-0000-1000-8000-00805f9b34fb)
Modalias: bluetooth:v0046p1200d1436
ManufacturerData Key: 0x00c4 (196)
ManufacturerData Value:
02 34 15 13 17 fd 80 .4.....
We can set the device class manually:
Paste the following into
/etc/systemd/system/bluetooth-class-askubuntu-1504191-1004020.service
:sudo systemctl enable --now bluetooth-class-askubuntu-1504191-1004020.service
If we examine the new device class, we will see that it means its Service class is Rendering and Audio, its Major device class is Audio/Video, and its Minor service class is Loudspeaker. I extracted the numbers from my Logitech Bluetooth speaker, so this will your computer pretend to be the same.
The normal setting is
0x7C010C
, which means its Service class is Rendering, Capturing, Object Transfer, Audio, and Telephony, its Major device class is Computer, and its Minor service class is Laptop. Your LG TV will skip devices of computer class and only show devices of class speaker:Setting
Class = 0x240414
in/etc/bluetooth/main.conf
doesn't work because it doesn't set all the bits. Devices vary in how much they care. Android doesn't care at all, and TVs might need some or all of the bits set properly. When I edited that file, only the major/minor part being0x0414
got somewhat respected, and this is only after I disabled all the profiles (which also add their own bits to the class) in the bluetooth.service command line parameters. There may be an option to set the service class0x24
, but its taking a lot of debugging.