Bluetooth audio auto connect

I think bluetooth sucks in geneal. I tested with Redmi Airdots and my results:

  • on Android: as soon as I power on headphones, Android immediately connects and audio is automatically switched to Bluetooth. When power off headphones, audio is again on speaker
  • on Coreelec: tried to connect/pair. After 10th attempt, with various error messages like “no response from device”, “function not implemented” and some others I don’t remember, finally it connected. But, unfortunately, only right earphobe. So, again a few attempts and it finally worked. However, with 2 seconds sound lag. Of course, when power off device, Coreelec never switch to hdmi audio, as well as it never connect automatically when device appears. It also never connect to available device after boot. It sticks to bt audio output setting, without even any attempt to auto connect to device and there’s no sound. If audio output is set to hdmi, it never attempts to connect to bluetooth and switch to bluetooth audio as Android do

In my case, it’s useless. Maybe it only exists for fun. But not for use. If somebody thinks about BT audio on Coreelec, forget it. Nothing more than waste of time, unless you have nerves of steel

1 Like

Bluetooth audio automatic connection and automatic switch to bluetooth audio when connected got reworked in CE-19 already. I will try to backport it for CE-9.2

In general bluetooth is a bit complicated about connect/reconnect. Some devices have no issues, some need manual interaction, some do not work at all.

EDIT:
the bluetooth changes should be also in tomorrow 9.2 nightly

3 Likes

Thank you! Tested it! Working now with the bluetooth even if passthrough is enabled. But I had to switch Audio Source after connecting the bt device and had to switch back to HDMI PCM when the device was disabled. Maybe you can fix this? The button switch audio source doesn’t work. Will try the CE 19 maybe too.
Thank you for your work!

when you change this option to switch audio source you need to reboot one time as kodi need to be reloaded to get the new settings active. when you have the option enabled and you see the notify pop up BT connected/disconnected it should also switch the audio device. for error handling turn on debug logging in kodi and provide a kodi.log

I did install newest nightly from CE19. Bluetooth autoswitch is working here!! did not work on 9.2
PLEASE make it so that passthough gets disabled once bluetooth is connected. i have to disable passthough to hear anything in for example netflix. It does not make sense or this is the error in logic of the audio settings. I think when bt headphones are connected the passthrough function should be disabled. Because there is: passthough device: HDMI and bt headphones cannot decode sound but i like when my AVR is doing it.

1 Like

same to me. I 2nd that!

1 Like
d7336cbe8c: Fri Jan 29 10:07:03 2021 +0100 – CoreELEC-settings: bump package to 5eac7b49 turn off passthrough when BT audio device get switched (Portisch)

We love you! :slight_smile:

2 Likes

Bluetooth autoswitching (connect and disconnect) works well with my C4 and a LogiLink USB-BT adapter on nightly_20210130, also disabling passthrough when BT is connected and enabling it again when BT disconnects.

I had to disable/uninstall the AddOn “Bluetooth Audio Device Changer” from the CoreELEC Nightly Add-ons repository, otherwise the passthrough ensbling/disabling does not work correctly. It costed me hours to recognize this…

But now: thanks a lot, @Portisch

2 Likes

Yes, the addon must be removed. forgot about it…

1 Like

My device is passive, so it won’t initiate connection, Kodi needs to do that. Is it possible? There’s no option “auto connect” in CE BT settings for particular device

Right now it tries each device what was connected before one time to reconnect after kodi is started.
So when here the device is already powered it should be connected. When you power it on after kodi is started it needs to be the client to try to establish a connection. Not sure what happens if Kodi run in endless loop and try to connect a bt device.

1 Like

There used to be a good (perfect) solution for Bluetooth auto connect (via udev rules), but it got broken somewhere around april 2020. cdu13a tried to look into it back then, but could find a fix. I didn’t update my CE installations since then anymore because I don’t want to lose this feature which I use every day. It is described here: Nightly builds (NEW)
Is it still broken?

GunterO, I was testing this version with udev and it worked few weeks back: https://pastebin.com/vMXsj5MA

But now it is not needed anyway.

2 Likes

Thanks for confirming this. I guess I can start upgrading again :slight_smile:

It is working now without the udev rules. Connects directly and works perfectly. And disables passthough if it is enabled in audiosettings and reenables it again when bt device disconnected again.

1 Like

Do you mean current CE stable? If so, that never happens in my case. Kodi never connects to device, I neeed to go to CE settings and choose connect option. Then it works.

No, it should work in current nightlies

Maybe in next stable? Pretty please… TIA

I have installed the CE19 Matrix and there it works just perfectly. Connects immediately to the headphones.

1 Like

On stable CE Bluetooth disconnects itself without any reason after 5-6 hours. Audio device disconnects and there’s no sound anymore.

Pretty annoying