You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
ViPER4Android gets stuck on disconnected car stereo #92
I have a car, Golf 7. Whenever I connect with bluetooth, it will recognize it. However, there is a chance that, after disconnecting, V4A-RE gets "stuck", still thinking it's still connected to the car.
It will switch to headphones when connected, but revert to car when disconnected instead of switching to speaker. Killing the app doesn't solve it, only restart or connecting and disconnecting to the car stereo again.
Now it doesn't do this every time, and connect-disconnect doesn't work every time. It just gets stuck when it feels like it, and connect-disconnect also solves it when it feels like it.
Not a big deal, since I listen by SD card instead of phone in my car, but it means I either use both just speaker optimization for both car and phone speaker, or turn it off when it's stuck.
Sometimes, while it's "stuck", on my S21 Ultra stock One UI 6.0 (Android 14) latest at the moment of writing, while Shanling UA3 is connected (headphones), it will sometimes switch back to car, then switch back to Shanling moments later. Sometimes it will stay as car and won't switch back. Doesn't happen too often. Solution is to disconnect and reconnect headphones.
Didn't happen in LineageOS 21 experimental (Android 14) or official LineageOS 20 (Android 13) on my previous S10+.
Sometimes, while it's "stuck", on my S21 Ultra stock One UI 6.0 (Android 14) latest at the moment of writing, while Shanling UA3 is connected (headphones), it will sometimes switch back to car, then switch back to Shanling moments later. Sometimes it will stay as car and won't switch back. Doesn't happen too often. Solution is to disconnect and reconnect headphones.
Didn't happen in LineageOS 21 experimental (Android 14) or official LineageOS 20 (Android 13) on my previous S10+.
Hm, may it happens because of battery?
I'm sure that you know that while Bluetooth broadcasting it migh have the issue with overheating or more often because of amounts of data transfer. Same as ViperFX is a driver but later androids versions is very careful to the battery usage. Try to set the unlimited battery usage for the ViperFX and the audio player that you're preferred for your android device. Maybe that could solve some troubles. Idk I never had the issues within direct connection (through the cable) to the car (Citroen C4, with AUX input)...
Another issue.
Sometimes, while it's "stuck", on my S21 Ultra stock One UI 6.0 (Android 14) latest at the moment of writing, while Shanling UA3 is connected (headphones), it will sometimes switch back to car, then switch back to Shanling moments later. Sometimes it will stay as car and won't switch back. Doesn't happen too often. Solution is to disconnect and reconnect headphones.
Didn't happen in LineageOS 21 experimental (Android 14) or official LineageOS 20 (Android 13) on my previous S10+.
Hm, may it happens because of battery?
I'm sure that you know that while Bluetooth broadcasting it migh have the issue with overheating or more often because of amounts of data transfer. Same as ViperFX is a driver but later androids versions is very careful to the battery usage. Try to set the unlimited battery usage for the ViperFX and the audio player that you're preferred for your android device. Maybe that could solve some troubles. Idk I never had the issues within direct connection (through the cable) to the car (Citroen C4, with AUX input)...
Mmm, makes sense. I've been keeping it on optimized because it worked without issues on S10+. I'll put it into unrestricted when it asks.
Samsung has sleep (run periodically in background) and deep sleep (never run in background) options, which supersede the standard restricted battery mode. With that on (47 apps in deep sleep, 12 in sleep), plus Naptime in NFS Injector, plus disable sensor during Doze with NUKED, plus deep doze and doze optimisations in NUKED, plus Lift to Wake disabled, I've been able to have good screen off battery (from 100 to 92 in 10 or so hours screen off) and I've not permitted V4A-RE to run unrestricted because it worked without problems in optimized. I've not put it in either of those two options.
I'll run it in unrestricted now. This all happened while screen is on every time (the switching to car while headphones were connected) so no Doze issues. Thanks for the suggestion that battery management might be the culprit.
And no, there were no bluetooth connections when this happened. Not even handsfree. Hmmm, maybe the HFP (handsfree) mode in conjunction with A2DP causes V4A-RE to be "stuck"? I can test it with laptop which has only A2DP (there's a bluetooth app which connects to A2DP capable devices in W10/11 on Microsoft store). But don't remember it being "stuck" with laptop.
I'll reboot and try connecting and disconnecting to laptop multiple times later in the day to see if it gets "stuck" since there's no handsfree, only A2DP.
I have tried to connect and disconnect A2DP on my PC many times and it reverts. You can see JamesDSP switching to bluetooth, and V4A showing DESKTOP. Only thing left to try is disable HFP in my car and see if that's the issue.
Okay! HFP definitely interferes. As you can see in the video, if you first disconnect A2DP, without first disconnecting HFP, it gets "stuck". If you disconnect HFP first, then A2DP, it reverts. Not even connecting and disconnecting just HFP solves it, you must connect A2DP again and disconnect it, without connecting HFP. See the screen recording below.
So the solution is to either disconnect calls manually first then turn off the car, or if you made the mistake and didn't and it gets stuck, just connect A2DP to the car and disconnect it again. Have to see if any bluetooth or must be the exact same bluetooth device.
HFP causes the issue if it disconnects before A2DP disconnects it seems.
Edit: any A2DP will suffice if it's "stuck". Connect and disconnect any A2DP device and it will revert.
Is it possible for V4A-RE to detect HFP, and act accordingly? Or ignore it completely, removing any traces of HFP? Maybe it tries to process HFP somehow. It is, after all, reverse-engineered.
If it detects HFP on the same device, then next step is to "force" it to revert to speaker upon disconnect.
I'm not a programmer so I don't know about this, but is it possible to integrate BluetoothHeadset API to detect HFP that way, and when detected, next step is to force revertion to speaker upon bluetooth disconnect while ignoring headset (in case headset is connected at the same time as bluetooth)?
hello, i have the same issue. after connect the car when i dissconnect it from, i stuck at car bluetooth. only restarting phone or connect any bt headphone fix it problem.
Activity
vjburic1 commentedon Mar 29, 2024
Here's the video of it being stuck despite no bluetooth connection.
Screen_Recording_20240329_183535_One.UI.Home_1_1.mp4
iscle commentedon Mar 30, 2024
Hi!
Yes, this is a known issue, the same happens to me as well.
I'm investigating the issue, as it can get really annoying depending on your preset.
I'll let you know when a fix is available.
Regards!
vjburic1 commentedon Apr 3, 2024
Another issue.
Sometimes, while it's "stuck", on my S21 Ultra stock One UI 6.0 (Android 14) latest at the moment of writing, while Shanling UA3 is connected (headphones), it will sometimes switch back to car, then switch back to Shanling moments later. Sometimes it will stay as car and won't switch back. Doesn't happen too often. Solution is to disconnect and reconnect headphones.
Didn't happen in LineageOS 21 experimental (Android 14) or official LineageOS 20 (Android 13) on my previous S10+.
griha41 commentedon Apr 3, 2024
Hm, may it happens because of battery?
I'm sure that you know that while Bluetooth broadcasting it migh have the issue with overheating or more often because of amounts of data transfer. Same as ViperFX is a driver but later androids versions is very careful to the battery usage. Try to set the unlimited battery usage for the ViperFX and the audio player that you're preferred for your android device. Maybe that could solve some troubles. Idk I never had the issues within direct connection (through the cable) to the car (Citroen C4, with AUX input)...
vjburic1 commentedon Apr 4, 2024
Mmm, makes sense. I've been keeping it on optimized because it worked without issues on S10+. I'll put it into unrestricted when it asks.
Samsung has sleep (run periodically in background) and deep sleep (never run in background) options, which supersede the standard restricted battery mode. With that on (47 apps in deep sleep, 12 in sleep), plus Naptime in NFS Injector, plus disable sensor during Doze with NUKED, plus deep doze and doze optimisations in NUKED, plus Lift to Wake disabled, I've been able to have good screen off battery (from 100 to 92 in 10 or so hours screen off) and I've not permitted V4A-RE to run unrestricted because it worked without problems in optimized. I've not put it in either of those two options.
I'll run it in unrestricted now. This all happened while screen is on every time (the switching to car while headphones were connected) so no Doze issues. Thanks for the suggestion that battery management might be the culprit.
And no, there were no bluetooth connections when this happened. Not even handsfree. Hmmm, maybe the HFP (handsfree) mode in conjunction with A2DP causes V4A-RE to be "stuck"? I can test it with laptop which has only A2DP (there's a bluetooth app which connects to A2DP capable devices in W10/11 on Microsoft store). But don't remember it being "stuck" with laptop.
I'll reboot and try connecting and disconnecting to laptop multiple times later in the day to see if it gets "stuck" since there's no handsfree, only A2DP.
vjburic1 commentedon Apr 4, 2024
I have tried to connect and disconnect A2DP on my PC many times and it reverts. You can see JamesDSP switching to bluetooth, and V4A showing DESKTOP. Only thing left to try is disable HFP in my car and see if that's the issue.
screen-recording-20240404-155405-firefox_v0xU1gMf.mp4
vjburic1 commentedon Apr 4, 2024
Okay! HFP definitely interferes. As you can see in the video, if you first disconnect A2DP, without first disconnecting HFP, it gets "stuck". If you disconnect HFP first, then A2DP, it reverts. Not even connecting and disconnecting just HFP solves it, you must connect A2DP again and disconnect it, without connecting HFP. See the screen recording below.
So the solution is to either disconnect calls manually first then turn off the car, or if you made the mistake and didn't and it gets stuck, just connect A2DP to the car and disconnect it again. Have to see if any bluetooth or must be the exact same bluetooth device.
HFP causes the issue if it disconnects before A2DP disconnects it seems.
Edit: any A2DP will suffice if it's "stuck". Connect and disconnect any A2DP device and it will revert.
screen-recording-20240404-161242-settings_ySfdeaTT.mp4
iscle commentedon Apr 4, 2024
I originally thought that this change would fix it, but aweing the last video, I'm not that sure 🤔
iscle/ViPER4Android-RE@7472989
vjburic1 commentedon Apr 4, 2024
Is it possible for V4A-RE to detect HFP, and act accordingly? Or ignore it completely, removing any traces of HFP? Maybe it tries to process HFP somehow. It is, after all, reverse-engineered.
If it detects HFP on the same device, then next step is to "force" it to revert to speaker upon disconnect.
iscle commentedon Apr 4, 2024
This works using the MediaRouter API. I will investigate the code and see if there is some workaround or something.
vjburic1 commentedon Apr 5, 2024
I'm not a programmer so I don't know about this, but is it possible to integrate BluetoothHeadset API to detect HFP that way, and when detected, next step is to force revertion to speaker upon bluetooth disconnect while ignoring headset (in case headset is connected at the same time as bluetooth)?
https://developer.android.com/reference/android/bluetooth/BluetoothHeadset
vaterfa commentedon Aug 7, 2024
hello, i have the same issue. after connect the car when i dissconnect it from, i stuck at car bluetooth. only restarting phone or connect any bt headphone fix it problem.