Rockbox Technical Forums

Support and General Use => Hardware => Topic started by: silverbear on February 08, 2022, 06:53:18 AM

Title: Bluetooth - current situation
Post by: silverbear on February 08, 2022, 06:53:18 AM
Can anyone summarise here where the Bluetooth development is at? I've seen various comments like one dev waiting for a UI design to others saying that it can't be done.
Title: Re: Bluetooth - current situation
Post by: amachronic on February 08, 2022, 03:53:03 PM
Code for Bluetooth support is basically non-existent. As far as I know nobody is actively working it either. Bluetooth is definitely doable for certain ports, but somebody actually has to write the code. I'd be happy to give help or advice to anyone who wants to work on BT support and provide feedback on patches.


To implement Bluetooth support in Rockbox, we need a backend to do the work of managing connections, transmitting audio & whatever else, glue code to hook up that functionality to existing Rockbox code, and of course a frontend UI to control it all. The frontend would be shared across all platforms and I don't think it poses much difficulty. Each target would have to implement its own backend though, which is where things start getting tedious.

For 'hosted' targets that run atop a Linux OS it should be relatively easy to write a backend, since Rockbox runs as a normal Linux app and uses standard libraries like ALSA and BlueZ. I'm pretty sure the new-ish Bluetooth capable targets like the xDuoos, AGPTek Rocker, Eros Q/Hifiwalker H2/etc, run on top of similar userspaces so their backends could probably share most code with a few device-specific tweaks here and there.

For 'native' targets, where Rockbox is the kernel, things are more difficult. We'd need to implement the entire 'kernel side' of Bluetooth which entails learning the details of the BT hardware in each device and writing drivers to control it. We'd also need to write our own Bluetooth stack, or as speachy suggests, it may be more practical to port BlueZ. This is more in the territory of "it can't be done" -- it's such a massive undertaking it's unlikely native ports will ever get Bluetooth, even if it's possible in principle.
Title: Re: Bluetooth - current situation
Post by: Milardo on February 08, 2022, 07:04:37 PM
Code for Bluetooth support is basically non-existent. As far as I know nobody is actively working it either. Bluetooth is definitely doable for certain ports, but somebody actually has to write the code. I'd be happy to give help or advice to anyone who wants to work on BT support and provide feedback on patches.


To implement Bluetooth support in Rockbox, we need a backend to do the work of managing connections, transmitting audio & whatever else, glue code to hook up that functionality to existing Rockbox code, and of course a frontend UI to control it all. The frontend would be shared across all platforms and I don't think it poses much difficulty. Each target would have to implement its own backend though, which is where things start getting tedious.

For 'hosted' targets that run atop a Linux OS it should be relatively easy to write a backend, since Rockbox runs as a normal Linux app and uses standard libraries like ALSA and BlueZ. I'm pretty sure the new-ish Bluetooth capable targets like the xDuoos, AGPTek Rocker, Eros Q/Hifiwalker H2/etc, run on top of similar userspaces so their backends could probably share most code with a few device-specific tweaks here and there.

For 'native' targets, where Rockbox is the kernel, things are more difficult. We'd need to implement the entire 'kernel side' of Bluetooth which entails learning the details of the BT hardware in each device and writing drivers to control it. We'd also need to write our own Bluetooth stack, or as speachy suggests, it may be more practical to port BlueZ. This is more in the territory of "it can't be done" -- it's such a massive undertaking it's unlikely native ports will ever get Bluetooth, even if it's possible in principle.

Not sure if I am wrong, but didn't wodz had something done with bluetooth in the agptek rocker, only thing that was mostly needed was a gui design?
Title: Re: Bluetooth - current situation
Post by: 7o9 on February 09, 2022, 12:51:02 AM
You are referring to this: https://gerrit.rockbox.org/r/c/rockbox/+/3044

I think this is the start of the 'glue code' or perhaps UI code on a 'hosted' scenario.
Title: Re: Bluetooth - current situation
Post by: Bilgus on February 09, 2022, 09:25:33 AM
I don't think wodz liked my idea for UI but unfortunately I'm not versed well enough in the Bluetooth backend to do much more than this

feel free to run with it.