Bluetooth handoff between car and headphones
-
I have:
- a pair of overly expensive bluetooth headphones
- a bluetooth to FM adapter in my car
- an android phone
Here's what I want to have happen:
- I am walking down the street, listening to music on my headphones
- I enter the car, turn on the engine
- The bluetooth-to-FM adapter turns on, appears on my phone (me having paired it earlier)
- My selected bluetooth device automatically switches to the in-car adapter. Music stops playing on my headphones and continues playing in the car.
- Later, I stop, turn off the engine.
- In-car bluetooth adapter goes off.
- Phone automatically switches back to headphones, music continues playing
Bolded parts are what I can't figure out how to get done. You'd think it'd be easy, but there doesn't seem to be an in-built feature or an app in PlayStore that helps me achieve this.
Anyone has a setup like this? Is this even feasible?
Don't tell me I'll have to make my own app, which is how I seem to want to solve every tech problem I encounter in my life. I hate android development. Please, there's got to be some solution out there.
-
@cartman82 Last time I tested this same scenario, part 1 worked fine (switching over to the bluetooth addon in my car), but when I left the car again it automatically paused the music app and I had to tell it to play again. I think it has to do with the fact that when the bluetooth in the car disconnects, there's a momentary pause between the disconnect and when it reconnects to my headphones, which the phone sees as a full disconnect which causes the audio to pause.
I honestly don't know if there's a way to work around that.
-
I've never seen anything that lets you set priorities of Bluetooth connections.
The simple solution (and about the only one that I can think of) is probably just that you'll have to switch the Bluetooth headphones off when you get into your car, and back on when you get out.
edit: I think that the prority is handled so that the most recently added device is the highest priority, so removing and re-adding devices would theoretically put them at the top of the list.
-
@e4tmyl33t said in Bluetooth handoff between car and headphones:
@cartman82 Last time I tested this same scenario, part 1 worked fine (switching over to the bluetooth addon in my car), but when I left the car again it automatically paused the music app and I had to tell it to play again. I think it has to do with the fact that when the bluetooth in the car disconnects, there's a momentary pause between the disconnect and when it reconnects to my headphones, which the phone sees as a full disconnect which causes the audio to pause.
How did you get the handoff working? Some app, or built in feature in the phone?
-
@cartman82 It's just Android's built-in priority system in my Pixel 2 XL. I suppose, working off @anotherusername's suggestion above, that because I paired the car bluetooth thing later than the headphones, it claims it as higher priority, so when I turn on the car and the bluetooth adapter pings out to connect to the phone automatically the phone just switches right over to it.
-
@e4tmyl33t said in Bluetooth handoff between car and headphones:
@cartman82 It's just Android's built-in priority system in my Pixel 2 XL. I suppose, working off @anotherusername's suggestion above, that because I paired the car bluetooth thing later than the headphones, it claims it as higher priority, so when I turn on the car and the bluetooth adapter pings out to connect to the phone automatically the phone just switches right over to it.
That doesn't happen for me. The music just keeps playing over headphones until I manually switch active BT device to the car adapter.
(I have a Sony Xperia phone with Android 8.0)
-
@cartman82 Did you try unpairing both, then pairing in the order of headphones then car adapter?
What OS version does your phone have?
-
@e4tmyl33t said in Bluetooth handoff between car and headphones:
@cartman82 Did you try unpairing both, then pairing in the order of headphones then car adapter?
What OS version does your phone have?
I have a Sony Xperia phone with Android 8.0
I'll try to switch the pairing order the next time I'm in car.
-
@e4tmyl33t said in Bluetooth handoff between car and headphones:
@cartman82 Did you try unpairing both, then pairing in the order of headphones then car adapter?
What OS version does your phone have?
Really just unpairing and re-pairing the car should be adequate.
Though I'm wondering if some devices might not actually disconnect an active connection just because a higher-priority connection became visible.
-
There's this app called Automate that could let you do that. Check if the list of devices includes the car; if so, pair with the car; if not, pair with the headphones.
-
@pie_flavor That would handle the pairing/connection end, but wouldn't stop the "Android pauses audio when its bluetooth speaker disconnects" function...
-
@e4tmyl33t said in Bluetooth handoff between car and headphones:
@pie_flavor That would handle the pairing/connection end, but wouldn't stop the "Android pauses audio when its bluetooth speaker disconnects" function...
I'm wondering if there's a conditional checking storage. Like "Check if Audio Media is playing and save yes/no. Connect Bluetooth device. If saved audio state was true, press PlayPause key"
-
@e4tmyl33t Which is also a global action and therefore manageable from Automate.
-
@cartman82 said in Bluetooth handoff between car and headphones:
I hate android development.
What is so bad about it? I'm doing an Udacity training and so far it seems fun.
-
@sockpuppet7 said in Bluetooth handoff between car and headphones:
@cartman82 said in Bluetooth handoff between car and headphones:
I hate android development.
What is so bad about it? I'm doing an Udacity training and so far it seems fun.
Compatibility shims are the biggest pain. If you want to make a commercial app supporting 95% of the devices out there and do anything beyond the basics API-level compatibility will drive you completely insane.
Lifecycle is also a complete clusterfuck. It looks OK in the design guidelines but then you start running into bizarre edge-cases which also drive you insane.
The BLE stack has some serious issues that haven't been fixed in any of the API levels I have to use.
Android Studio is a buggy piece of garbage that updates every three seconds. ADB doesn't on a regular basis. Gradle is also a bloated mess.
I don't hate Android development but it really does have some rough edges
-
@cursorkeys said in Bluetooth handoff between car and headphones:
Android Studio is a buggy piece of garbage that updates every three seconds.
Then don't use it. It's basically just a new coat of paint over IntelliJ IDEA, and AFAIK the Android plugin for IDEA can do anything Android Studio itself can, minus the fucking stupid nature of it especially if you already have an Ultimate Edition license.
@cursorkeys said in Bluetooth handoff between car and headphones:
Gradle is also a bloated mess.
Maybe your daemons aren't running properly.
-
@pie_flavor said in Bluetooth handoff between car and headphones:
Maybe your daemons aren't running properly.
May I suggest changing from the standard whip to a 9-tailed version?