hifiberry / hifiberry-os

Linux distribution optimized for audio playback
MIT License
998 stars 125 forks source link

Bluetooth remote support is broken at the kernel level #480

Closed jkp closed 8 months ago

jkp commented 11 months ago

Describe the bug My Bluetooth remote (the teenage engineering OR1) stopped working since the 20211105 release.

HiFiBerryOS version I bisected by flashing historic versions of the OS and found out that any release after 20211105 is broken.

HiFiBerry sound card Post the exact type, e.g. DAC+ Pro instead of "DAC+".

To Reproduce Steps to reproduce the behavior:

  1. Pair the remote to the system using bluetoothctl
  2. Run ls /dev/input: no device node is registered with the system.

Expected behavior A device node should be registered with the system

Screenshots N/A

Browser (if applicable) N/A

Additional context This looks to be an issue caused by a kernel update: the device pairs properly so the bluetooth stack is fully functional, however the kernel doesn't load a device driver. It broke between the 20211105 and 20220228 releases which at least gives a narrow range of commits to focus on.

hifiberry commented 8 months ago

We don't have any BT remote controls to test this. If you can find the root cause for the problem, feel free to provide a patch.

jkp commented 6 months ago

Running the latest HiFiBerryOS64 to see if this is resolved and unfrotunately its still an issue :|

I'm happy to try to find a resolution but it requires a kernel rebuild ... is there any documentation about how to build a custom kernel for this system?

hifiberry commented 6 months ago

HiFIBerryOS64 uses the latest official Raspberry Pi kernel. What exactly do you want to "rebuild"?

jkp commented 6 months ago

Check out my original bug report above. In older releases (pre 20211105) I could connect a bluetooth remote and it would register an input device which would then feed events straight to audiocontrol2 via the keyboard module. This was broken after that release. I'm still able to pair the remote using bluetoothctl but a device node is no longer instantiated by the kernel.

If you're using a stock kernel that's good to know...I guess it means I can broaden my hunt to see if any similar behaviour is known in other projects that use the same kernel...

But open to ideas here: any suggestions why this would have broken?

hifiberry commented 6 months ago

No, I don't know any details about the BT stack and the BT drivers in the kernel.

jkp commented 6 months ago

I’ve played around with a bunch of vanilla installs on various pis now and they all have the same problem. So this is not hifiberry specific

If anyone knows where the appropriate upstream place to raise this issue would be I’ll happily chase it that way?

Thanks

Sent from Proton Mail for iOS

On Wed, Mar 27, 2024 at 20:51, HiFiBerry @.***(mailto:On Wed, Mar 27, 2024 at 20:51, HiFiBerry < wrote:

No, I don't know any details about the BT stack and the BT drivers in the kernel.

— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you authored the thread.Message ID: @.***>

hifiberry commented 6 months ago

I would recommend to contact the manufacturer. They should understand better than anyone else how this should work.

jkp commented 6 months ago

OK, I won't be beaten here! I've been playing around for days trying to track the bug down and at least part of it I have figured out.

In the release I mentioned in my original post there was an upgrade to buildroot that in turn had the side-effect of disabling a bunch of stuff in bluetoothd that was previously enabled by default: in this case specifically the issue is HID and HOG support (see your buildroot config files).

I've confirmed that with the older bluetoothd binary copied onto a newer system the nodes in /dev/input are created correctly: this will directly be to the missing plugins that have been compiled out in later versions of hifiberry. To bring back parity it would just need someone to review the options that have been set in the configs and flip a few of them to true (I'd also love to see btmon back on the system!)

jkp commented 6 months ago

I’ve played around with a bunch of vanilla installs on various pis now and they all have the same problem. So this is not hifiberry specific If anyone knows where the appropriate upstream place to raise this issue would be I’ll happily chase it that way? Thanks Sent from Proton Mail for iOS On Wed, Mar 27, 2024 at 20:51, HiFiBerry @.(mailto:On Wed, Mar 27, 2024 at 20:51, HiFiBerry < wrote: No, I don't know any details about the BT stack and the BT drivers in the kernel. — Reply to this email directly, [view it on GitHub](#480 (comment)), or unsubscribe. You are receiving this because you authored the thread.Message ID: @.>

This turns out to have been an incorrect statement as it goes...there's a second issue downstream of the input nodes being created that seems to be present on many more systems that I'm continuing to hunt down. I'll post back as I find more...

jkp commented 6 months ago

And the second issue...seems to be an issue on the side of the remote hardware I'm using. It seems that sometimes it gets stuck in some funky state and I need to remove the batteries and start totally from scratch for the device to function properly once paired. Once I do this everything works. So in summary, if we could get those missing plugins back into the bluetooth config things should likely work again as intended on newer builds!

hifiberry commented 6 months ago

I don't know what "missing plugins" you're refering to. We update software regularly, it's possible that something has been removed from the standard options in later releases. Feel free to provide a pull request, but we won't dig into this further.