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

Bluetooth auto reconnect service #1029

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

RowlaxX
Copy link

@RowlaxX RowlaxX commented Oct 9, 2024

Motivation

Hi, after installing ChimeraOS, I was unable to connect my Xbox Series controller until I navigated to the bluetooth settings. It was very similar to this issue

Investigation

After searching the cause of this problem, it seems that a Bluetooth scan was triggered while navigating to the Gnome Bluetooth Settings, and disabled when leaving that page.

Later, I was able to reconnect my controller by using the command bluetoothctl -t -1 scan on without navigating to the bluetooth settings

Solution

This PR add a simple systemd service that periodically scan for previously connected Bluetooth devices

I am now able to automatically reconnect my controller in the following cases :

  • On startup even before the session is loaded
  • When I unplug & replug my bluetooth dongle
  • When my controller is disconnected due to idle or battery and I press the guide button

Mention

It seems that Bluez allow for periodic scans in the config via ScanIntervalAutoConnect & ScanWindowAutoConnect parameters (link).

This could be a way cleaner solution, but I was unable to make them work.

Hardware & Software

Note

This is my first PR for Chimera so I may not have respected some design & architectural choice

@RowlaxX RowlaxX changed the title Auto bluetooth auto reconnect service Bluetooth auto reconnect service Oct 9, 2024
@alkazar
Copy link
Member

alkazar commented Oct 16, 2024

Thanks for the work, but I am a bit confused as to why this is necessary.

If the controller is paired, it should be able to autoconnect without this service.

@RowlaxX
Copy link
Author

RowlaxX commented Oct 17, 2024

It appears that Bluez don't support autoconnect for some bluetooth controller unless there is a bluetooth scan occuring. It was the case with the bluetooth dongle mentioned above.

However, I tried to run a fresh chimeraos with another bluetooth dongle (this one) and didn't got any issue

This service is a fix for controllers that need a scan for connecting devices

@alkazar
Copy link
Member

alkazar commented Oct 17, 2024

I see, so it is hardware dependent. Thank you.

I am not sure if it is a good idea to be scanning constantly like that. I will have to do some research and think about it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants