Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

[GPL] epicBT - Call Audio Router ( Epic4G ) - bluetooth/wired conflict hotfix - 11/26

OP cicada

17th November 2010, 07:14 AM   |  #1  
cicada's Avatar
OP Senior Member
Denver, CO
Thanks Meter: 149
 
171 posts
Join Date:Joined: Nov 2009
Donate to Me
More
This application is a hotfix for a really annoying (and potentially unsafe!) bug in the Epic4G:

http://code.google.com/p/android/issues/detail?id=11372
http://forum.sdx-developers.com/epic...990/#msg115990

The long and sort of it is that when anything is plugged into the 3.5mm headphone jack, the phone will only play call audio over that jack.

In order to route the audio through the earpiece, bluetooth or speakerphone, you must pull the plug out of the jack. This is at the very least annoying, and at the very worst potentially dangerous if, for example, you're driving.

How-To

Download the APK attached below for your android version.
Install like any other APK using adb or your favorite file manager.




What it does

This simple application allows you to pick the audio device to use for call audio to override this behavior, and can be changed on the fly.

All in-call audio will be routed to the device you specify when something is plugged into the 3.5mm headphone jack. If nothing is in the jack, the default behavior for the phone applies.

This also allows you to use the Speaker Phone when the headphone jack is occupied, even though the button on the call screen is disabled!

Your configuration should persist between reboots.


What it doesn't do

This app does not route any other type of audio. Your music, notifications, etc will still play over the headphone jack or phone speaker.


Again, this *only* affects in-call voice audio, and only when something is plugged into the headphone jack.




Notes

This app completely overrides the options on the call page! If you want to switch outputs during a call, you will have to do it from this app - your call will not be dropped when changing the output device.

In order to route the call audio properly, the system's mediaserver service must be restarted, however.

This means that any other audio you have playing when you apply the change will be disrupted, and related services may force close. For example, Pandora will skip to the next song. Other applications may not behave that well.



Disclaimer

This app modifies files in the /system partition, so use this at your own risk! I am not responsible for any problems that arise from this hotfix on your device!

This is currently for the EPIC4G *ONLY* - Do not use this on any other device. Please contact me if you have a different phone which experiences this bug and I will see if I can get it working for you as well.

This is *BETA* software, a work in progress, please post here if you experience any issues, but I cannot guarantee it will work for you!

ROM DEVs, feel free to bake this into your roms in whole or part, I encourage it as this provides a workaround for a safety issue, but please give credit if you use or derive from this application.


Special thanks to UberPinguin - his initiative, debugging, code-diving and testing helped make this happen every step of the way!

Many, many thanks to everyone in #samsung-epic for helping me test and work this out.


Be sure to download the APK for the right android version on your phone!

epicBT - v0.3.5 (Froyo)
* Fixed crash/reboot when applying settings in DK17 roms

epicBT - v0.3
* Layout cleanup when root is unavailable

epicBT - v0.2
* Requires root!
* Superuser compatible
* auto-remounts /system RW if necessary
* Sends call audio to wired device ( default ), speaker phone, or bluetooth

Sources
https://github.com/cicada/epicBT
Attached Files
File Type: apk epicBT-eclair-0.3.apk - [Click for QR Code] (23.3 KB, 170 views)
File Type: apk epicBT-froyo-0.3.5.apk - [Click for QR Code] (23.7 KB, 703 views)
Last edited by cicada; 27th November 2010 at 08:02 AM.
The Following 4 Users Say Thank You to cicada For This Useful Post: [ View ]
17th November 2010, 07:21 AM   |  #2  
Senior Member
Thanks Meter: 34
 
370 posts
Join Date:Joined: Oct 2009
If this works as described above I will be so f-ing happy. One of my biggest gripes, solved.
17th November 2010, 07:26 AM   |  #3  
Junior Member
Thanks Meter: 0
 
12 posts
Join Date:Joined: Sep 2007
More
No sh#t! I was just about to start searching the Market for an app like this! Downloading now to test.

Thank you!
17th November 2010, 08:33 AM   |  #4  
m5james's Avatar
Senior Member
Thanks Meter: 11
 
470 posts
Join Date:Joined: Aug 2010
Quote:
Originally Posted by bigdbag

If this works as described above I will be so f-ing happy. One of my biggest gripes, solved.

I agree
17th November 2010, 07:04 PM   |  #5  
cicada's Avatar
OP Senior Member
Denver, CO
Thanks Meter: 149
 
171 posts
Join Date:Joined: Nov 2009
Donate to Me
More
updated OP with source link
The Following User Says Thank You to cicada For This Useful Post: [ View ]
17th November 2010, 08:11 PM   |  #6  
Senior Member
Thanks Meter: 12
 
218 posts
Join Date:Joined: Nov 2008
First of all,...Thank you, Thank you, Thank you for working on this... This was one of my biggest gripes with this phone and I couldn't understand why the "geniuses" at Samsung/Sprint couldn't get this right.

I've done some extensive testing in my car for the Eclair version and wanted to share my results:

For the most part, the app does what it's supposed to...but I did notice that:

1) the "on the fly" feature doesn't work so well. That is, when changing from one mode to the other, I had to reboot the phone to get the new setting to take effect. This feature would be great with an app like Tasker, which could automatically open up the app and ask you which setting you want to use when a headset/aux jack is plugged in,...thus giving you the flexibility to use the best option depending on your situation. Is there a way to tweak the app to recognize the switch without rebooting by resetting something like the mediashare service?

2) For some reason, the mic volume (volume heard on the opposite end of call) on the bluetooth setting is lower when the headset/aux jack is plugged in. I'm not sure whether the regular phone mic, speaker phone mic, or the bluetooth mic is utilized in this setting, but the volume is definitely harder to hear on the other end than when the headset jack is unplugged. I would guess about 20-25% lower. I tested this effect during the call as well by plugging and unplugging the jack while counting 1 to 10 and it's the same. Is there away to increase the sensitivity of the bluetooth mic when the headset jack is plugged in?


Donation coming if you can get this working! Thanks again.
17th November 2010, 08:25 PM   |  #7  
cicada's Avatar
OP Senior Member
Denver, CO
Thanks Meter: 149
 
171 posts
Join Date:Joined: Nov 2009
Donate to Me
More
Quote:
Originally Posted by sinman02

1) the "on the fly" feature doesn't work so well. That is, when changing from one mode to the other, I had to reboot the phone to get the new setting to take effect.

Strange, it works well for me - it takes a second to switch outputs while mediaserver is restarting, but never had to reboot. I'll look into this, may have accidentally tweaked something in the last build.

UberPinguin and I are still looking at the sources to find a better fix that works the way it's supposed to - the trouble seems to be that Phone.apk is actually selecting the 'correct' source and setting options appropriately, but the underlying OS isn't switching outputs. Restarting mediaserver was the only workaround I could find for this.

Quote:
Originally Posted by sinman02

2) For some reason, the mic volume (volume heard on the opposite end of call) on the bluetooth setting is lower when the headset/aux jack is plugged in. I'm not sure whether the regular phone mic, speaker phone mic, or the bluetooth mic is utilized in this setting, but the volume is definitely harder to hear on the other end than when the headset jack is unplugged. I would guess about 20-25% lower. I tested this effect during the call as well by plugging and unplugging the jack while counting 1 to 10 and it's the same. Is there away to increase the sensitivity of the bluetooth mic when the headset jack is plugged in?

I hadn't noticed any volume issues but truthfully I haven't been using the BT often because of this bug - I've just been letting my calls go to VM instead of crashing my car Volume selection should be working properly so I'll see if I can add something to select volume as well.

To be clear on the MIC, input should always be the proper input for whichever mode you choose - phone MIC for speakerphone and BT mic for BT HP/HS.

If you're on stock then the phone mic should be used when your wired device doesn't have it's own, however this is broken in all of our custom community kernels - Wired Headset mode should only be used when you actually have a wired headset with a MIC of it's own if you're using one of these, otherwise the phone doesn't enable any MIC at all.
17th November 2010, 09:09 PM   |  #8  
Senior Member
Thanks Meter: 12
 
218 posts
Join Date:Joined: Nov 2008
I should note, that all my tests were conducted on outgoing phone calls. I don't know if incoming calls are any different. I am using the Syndicate rom.

If you can get the bluetooth volume issue resolved, I'll likely leave it there, but it would be nice to be able to switch on the fly to speakerphone mode when bluetooth isn't handy.

Question: Does the froyo version have the same implementation?

Please keep up the good work!

Sent from my SPH-D700 using XDA App
17th November 2010, 09:16 PM   |  #9  
cicada's Avatar
OP Senior Member
Denver, CO
Thanks Meter: 149
 
171 posts
Join Date:Joined: Nov 2009
Donate to Me
More
Quote:
Originally Posted by sinman02

Question: Does the froyo version have the same implementation?

Yes, the froyo version is the same - Samsung used a different asound.conf in froyo ( added in some interesting VOIP pcm ), so this is the only difference between versions currently.
17th November 2010, 10:41 PM   |  #10  
Junior Member
Thanks Meter: 0
 
12 posts
Join Date:Joined: Oct 2009
Quote:
Originally Posted by cicada

This application is a hotfix for a really annoying (and potentially unsafe!) bug in the Epic4G:

The long and sort of it is that when anything is plugged into the 3.5mm headphone jack, the phone will only play call audio over that jack.

In order to route the audio through the earpiece, bluetooth or speakerphone, you must pull the plug out of the jack. This is at the very least annoying, and at the very worst potentially dangerous if, for example, you're driving.

...So this should work on for Sip/VOIP apps like Sipdroid, 3CX, and Fring? I managed to pick up 3CX and Sipdroid through my bluetooth headset but no mic...meaning the other end could not hear me... There aren't that many good sip/voip soft wares out there for the Android today.. I rated Fring the BEST but with no bluetooth support.

EDIT: Nevermind... I read the post again.. I don't think this will do the job other than support for the actual phone.. but it would be nice to have that option for sip/voip as well.

Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes