Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Can setting the connection interval parameter be added? #112

Open
Jah-On opened this issue Nov 28, 2023 · 10 comments
Open

Can setting the connection interval parameter be added? #112

Jah-On opened this issue Nov 28, 2023 · 10 comments
Labels
enhancement New feature or request

Comments

@Jah-On
Copy link

Jah-On commented Nov 28, 2023

Hello,

Is it possible to set the connection interval in BlueR or is this a "wait for bluetoothd to add it then we will" issue?

Thanks

@surban surban self-assigned this Nov 28, 2023
@surban
Copy link
Collaborator

surban commented Nov 28, 2023

What method do you use to set the connection interval?

@Jah-On
Copy link
Author

Jah-On commented Nov 28, 2023

What method do you use to set the connection interval?

We think it's LoadConnectionParameters but we have not tried it with a command line utility yet. We tried

echo "16" > /sys/kernel/debug/bluetooth/hci0/conn_min_interval

echo "16" > /sys/kernel/debug/bluetooth/hci0/conn_max_interval

as sudo but could not modify the file even after stopping BlueZ.

@surban
Copy link
Collaborator

surban commented Nov 28, 2023

Given the path it seems to be a debug-only setting.

@Vudentz Do you know a supported method to achieve the same result? Does it make sense to extend the Bluetooth D-Bus API to change adapter settings like these?

@surban surban added the enhancement New feature or request label Nov 28, 2023
@Jah-On
Copy link
Author

Jah-On commented Nov 28, 2023

Without this ability, ASHA can not be implemented for Linux. As we understand it, the connection interval must be set to 10 or 20 ms for hearing aids and cochlear implants to properly receive the data. For some reason, Cochlear's N7 advertises a max interval of 30ms but this will not work for streaming. Google's ASHA implementation forces the interval to be either 10 or 20ms.

@hxk1633
Copy link

hxk1633 commented Nov 28, 2023

I support adding this enhancement. Setting the connection interval is required for implementing ASHA on Linux.

@shareefalis
Copy link

Same here, this is much needed for ASHA, we noticed https://github.com/bluez/bluez-asha
Can we have an official place for this?

@Jah-On
Copy link
Author

Jah-On commented Jan 22, 2024

Hello,

Just checking in to see if there are any updates on if or when this will be added. I reckon I could use the old BlueZ 4 kernel API to set the connection interval. This possibly can be done with FFI but I'm not sure if that's a good idea. Ideally, everything should be managed via BlueR.

Thanks!

@OmarCastro
Copy link

Hello,

I am also interested in ASHA in linux, while I do not undestand much about the internals of blueZ, there is this code about the HCI, https://github.com/bluez/bluez/blob/master/lib/hci.c , that helps in defining the connection interval

I think creating Rust bindings to the HCI part of blueZ, is a good start to solve this issue, what do y'all think?

@surban
Copy link
Collaborator

surban commented Jan 25, 2024

Although I like the idea of adding a HCI interface to BlueR, I don't think that it is the right solution to this particular problem. You will run into permission problems, since HCI functions are not available to non-root users. Furthermore, to my knowledge bluetoothd (if running) should be the only process using the HCI interface.

While I am not an expert on this particular issue, I suppose the way forward is to implement functionality to set the connection interval in bluetoothd and expose it via D-Bus. Since it is a global parameter of the Bluetooth controller, bluetoothd will have to merge requests from different clients.

Afterwards it is a simple step to include an API for that in BlueR.

@Jah-On
Copy link
Author

Jah-On commented Jan 25, 2024

Hey @surban, thanks for your reply! I opened an issue on the main BlueZ repo, bluez/bluez#731, so hopefully we can get somewhere with it.

Cheers

@surban surban removed their assignment Feb 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

5 participants