Notification of wired headset removal - Windows Mobile Development and Hacking General

Is there a way to detect when a wired headset has been removed? I'd like to write a program to stop audio playback if the headphones are unplugged, since it's pretty embarrassing to have the music blaring out of the speaker.
I figured this should be possible since the phone itself can detect the presence of a headset to know whether to auto-pickup a call. (This is for the apache, though i imagine the function call would be the same for other devices as well.) Thanks.

any ideas?

That's cool to have, but on the HTC Magician, the earpiece is just a normal 2.5mm with mic, plus a answer button, plugging it in doesn't have any visible notification on the phone.
It might work for yours, but I'm not sure about all other devices.

On WM5 just use the state and notification broker. State is saved in the registry.
For WM2003 you have to go at a much lower level I think.
V

If someone is writing an apps, please include for wireless bluetooth stereo headset when lose bluetooth connections.

aatreya said:
Is there a way to detect when a wired headset has been removed? I'd like to write a program to stop audio playback if the headphones are unplugged, since it's pretty embarrassing to have the music blaring out of the speaker.
I figured this should be possible since the phone itself can detect the presence of a headset to know whether to auto-pickup a call. (This is for the apache, though i imagine the function call would be the same for other devices as well.) Thanks.
Click to expand...
Click to collapse
I think this would be a really useful program, especially for Universal owners as sometimes when we disconnect the wired headset, the phone still thinks that it is plugged in and thus we cannot hear any notifications.

Hmm - that's what I thought too, but it looks like (at least on the Apache) that there is no such state. One of the other threads referenced a state named "Headset", but I can't seem to find it.
Nonetheless, the phone must know whether the headset is plugged in, because it prevents you from turning on the speakerphone if the heaset is in.

Any ideas?

you are right!... i will do some work on this and see what happens

Related

Must SKYPE be on speakerphone at all times?

I notice with skype (running OMAP at 240) when i make calls it is on speaker phone....any way to have sound come out of the earpiece, or toggle between it and speaker phone when i dont have headset in?
thanks...
stumped..
anybody aware of it?
I also want to know this as well..
Regardless of which entity is responsible for this not being implemented, the absence of small yet important features such as this are what make the entire Pocket PC platform seem juvenile at times
I downloaded skype v2 for wm5 yesterday, and it actually works on the wizard... HOORAY!!! download the version for the universal
and YES... it works with the headphones, otherwise sound goes to the external speaker
The new imate rom comes with skype 1.1 and it worked....but more as a technology demo... completely unusable unless you wanted to reset every other minute to get your contacts back... memory hog yadayadayada.
ref: http://forum.skype.com/viewtopic.php?t=51781
so its an issue....
that skype forum proves no help, no responses! hah
it is not an issue. it is how things work. there is not way to fix it. The normal phone speaker is hardwired to the gsm radio. there is no way to get any audio that does not come off of a GSM phone call to go to that speaker.
u ever used speakerphone with gsm?
So even though your GSM calls can be routed to the external speakers, the audio port or even a bluetooth device which uses the handsfree profile, you're telling me there's no possible way to route audio into the internal handset speaker. Do you know this for a fact or are you just making assumptions based on limited knowledge of these devices?
this isn't about speakerphones and such, as you're telling the audio signal to go to different places. what eguess is saying is that the little speaker we hear from isn't connected to a simple audio solder, but straight to the radio. and that radio doesn't get input audio from anywhere else but the radio itself. get it now?
eguess said:
it is not an issue. it is how things work. there is not way to fix it. The normal phone speaker is hardwired to the gsm radio. there is no way to get any audio that does not come off of a GSM phone call to go to that speaker.
Click to expand...
Click to collapse
So i was just wondering with skype work with a bluetooth headset? Thanks
not true. i could listen music in the built in earpeice once before while on the phone. it doesn't seem to work now. idk weird.
i could also listen to music on the included headset before while on the phone but it doesn't seem to work anymore.
so i don't think its hardwired. it must be in the registry somewhere enabling/disabling internal earpeice.
tweaker said:
so i don't think its hardwired. it must be in the registry somewhere enabling/disabling internal earpeice.
Click to expand...
Click to collapse
Well, not everything is in the registry either. Ok, why does Opera for PPC leave extra spaces? Absolutely ridiculous.
murdokiwi said:
I downloaded skype v2 for wm5 yesterday, and it actually works on the wizard... HOORAY!!! download the version for the universal
and YES... it works with the headphones, otherwise sound goes to the external speaker
The new imate rom comes with skype 1.1 and it worked....but more as a technology demo... completely unusable unless you wanted to reset every other minute to get your contacts back... memory hog yadayadayada.
Click to expand...
Click to collapse
what about delay

Reroute Sound to Speaker with a headset plug plugged in

It seems I can not find a way to route the sound to the internal speaker when a (headset)plug is connected to the phone. I would like to use the phone for conf calls with a docking station as well as for charging as listening to music. For the conf calls I need the internall speaker to work but it seems this is not possible when connected to a docking station with a sound plug.
Rerouting software like this one does not work with a plug plugged in.
teksoftco.com > AudioRoute 1.2.020
Does anyone know of a way to make this work? I was alrady amazed that this was not available in S2P or Windows mediaplayer before but now it is really annoying for calls. This basic functionality was already on 4 year old Sony Ericsson phones.
Many thanks
Update: I tried the rerouting with a bluetooth headset and it does not work. I am unable to reroute a call that is answered in a headset back to the phone
Has anyone actually gotten this yet? Ive got an HTC Apache I really need this done to, the back speaker went out i need to see if i can make it ring from the earpiece.

Microphone stops working when headset connected

Has anyone experienced the following bug: Make or receive a call using a bluetooth headset. A2DP or not, this doesn't matter. Then, use the voice command feature or try to record with Tape Machine, while your headset or car kit is still conencted. The microphone won't activate. This is quite aggravating if I try to use the voice dial or map finding capabilities while in the car... anyone else experience this?
i have the same problem when my phone is plugged into the aux in my car. the mic just stops working :/
I can verify this issue. I most want to be able to use this feature while in the car and using hands free, but I can't.
Try this http://forum.xda-developers.com/showpost.php?p=7986072&postcount=10
dever76 said:
I can verify this issue. I most want to be able to use this feature while in the car and using hands free, but I can't.
Click to expand...
Click to collapse
It's annoying - my EVO didn't do this before I returned it.
I ordered a few inline microphone adapters for $2 each on ebay with free shipping - they're the things that allow you to use any pair of headphones with a cell phone as a headset. That should solve that problem, but it'd be nice to be able to use the phone mic when it's connected to my car stereo, as a speakerphone.
I guess the way Samsung saw it if you plug in a headset with a microphone(like the one included with your phone) you would then have 2 working microphones and get an echo. We all know this ends up being a problem in scenario #2 where you plug it into the AUX port on your car, but I guess Samsung did not consider that the most likely usage.
The best solution would be to have a software toggle to pick if the microphone is turned off or not.
This topic is basically the same thing, might want to continue the discussion there. http://forum.xda-developers.com/showthread.php?p=7986072
I wonder if, on the Epic, this is a hardware thing we're stuck with or if there truly is a software fix.
If the hardware wasn't built to detect when there is/isn't a microphone by checking out the connector, we may be SOL.
While I'm sure the rationale may be the same, please note that this thread, though similar to the 3.5mm headset thread, specifically references bluetooth. The issue happens even if the headset is paired - independently of whether or not it is in use. That's the problem.
just unpair bluetooth when you want to use the speech. only work around so far.

How does MyTouch 4G deal with headphones with no mic and how to favour bluetooth?

Hi,
I've been using the Car Dock Home v3 app launched from HTC's car dock when I'm driving. Yesterday I was also listening to some podcasts form the phone by connecting the headphone jack to my car's aux input. I had a bluetooth headset connected.
Then someone decided to call me and it was disastrous. The car mode causes the phone to read the incoming phone number and let you answer or decline by voice, which is neat, but instead of going through the car's speaker (headphone out) it goes through the built in speaker. I don't know why it would do this, but with the car noise it was impossible to hear it.
Then after answering the call, instead of going through the bluetooth headset, I heard the caller through the car's speakers (sounded great) but they couldn't hear me at all. I can switch to the bluetooth headset manually, but it's too dangerous to try and navigate the tiny buttons and text while driving. With another caller they could hear me, though.
So I can't figure out what the phone is doing when you have something plugged into the headphone jack but no wired mic. It seems like the phone's microphone is active, but not in speakerphone mode, so it's probably too quiet on the other end to clearly hear me unless I talk right into the mic, which I can't do while driving.
So questions:
1. Is there any way to increase the internal mic gain to use the phone connected to the car speakers as a true speakerphone (and can this be done without creating echo/feedback)?
2. Is there any way to have the phone automatically prioritize a connected bluetooth device over the headphone jack?
3. If the answers to 1. and 2. are no, is there any way to have a car mode specific dialer screen with nice big buttons for selecting audio source manually?
4. Can I get the car mode to read incoming call info into the headphone jack rather than the internal speaker?
Thanks!
Key action you must take when your phone rings...
DON'T touch the screen. Click your BT device to answer.
HTC Glacier CM7 #something
jggimi said:
Key action you must take when your phone rings...
DON'T touch the screen. Click your BT device to answer.
HTC Glacier CM7 #something
Click to expand...
Click to collapse
Are you sure that works? I didn't try that, but I used my bluetooth headset to launch genius and dial a contact by voice. Everything worked through the bluetooth headset, but once the call connected, it switched to the car's speakers.
I'm pretty sure that the car mode initiates hands-free mode, which automatically turns on the phones internal speaker when a call comes in. See if there's a setting that prevents hands-free from turning on in the app. That might fix things the way you use them.
Sent from my HTC Glacier
While the phone is ringing, activate the connection via BT. It works for me now, and it worked on the stock ROM. But you don't ned to take my word for it, just try it.
HTC Glacier CM7 #something
I'll give that I try when I get a chance. There is an option to automatically enable speakerphone in the car dock app, so maybe disabling that will also fix the problem. However, so long as the headphone jack isn't in use, it works exactly like I want it to:
If the bluetooth headset is connected, it gets used for answering and making calls. If the bluetooth headset is not connected, when answering or making calls the phone's spakerphone is automatically enabled.
The issue is that with the headphone jack in use, it seems to take precedence over both internal speakerphone and bluetooth headset.
My guess is that if the headphone jack is in use the phone assumes that you're using a wired headphone/headset with its own mic. If that were the case, the behaviour actually makes sense: if you've got a wired headset in your ears, that's where you'd want the audio to go. I suppose if there is no external mic but you're wearing headphones, using the internal mic without speakerphone gain also may make sense: you'd hear through the headphones and hold the mic near your mouth to talk. The problem is it ignores the case of external speakers versus headphones. Especially in car mode it should be smarter about how it deals with these options. Of course, some of the issue may be due to the third party dock app, so maybe I'll have to try with that disabled or contact the developer to see if he can do anything.
It's little usability issues like this that make me want to drop Android, although I have no idea if there's actually anything that really works better.
tmagritte said:
...It's little usability issues like this that make me want to drop Android.....
Click to expand...
Click to collapse
Training yourself to touch the earpiece instead of the phone to answer is not overly difficult. It only took me one or two "oops" experiences to stop touching the phone.
I use the phone and aux input all the time while driving, but the difference is that I don't have a bluetooth headset involved.
Audio comes out of the headphone jack and I speak into the phone's mic and it works fine. Turn the phone volume to max and use the headunit volume to adjust.
So I have had a chance to test it. It's true, if you use the bluetooth headset's button to answer a call it does get properly routed to the headset. If you answer by taping answer on the screen it gets routed the headphone/speaker + internal mic.
It does also seem like the internal mic is used correctly and pretty much sounds as good as the speaker phone mode, so answering a call while wearing headphones or using speakers doesn't seem like it should be a problem (assuming echo isn't an issue with speakers). Don't know why that one caller couldn't hear me, but that could be some other reason.
What doesn't work, though, is initiating a call from the bluetooth headset if the headphone jack is in use. Using the bluetooth headset button to initiate genius voice dialing works as expected until the call is connected, at which pint it then gets routed to the headphone/mic instead of the bluetooth headset. There doesn't seem to be any way around this. Of course, since you are initiating the call, it's probably not too bad to just unplug the headphone jack first...

[Q] Bluetooth Headset for Phone, and Audio Jack for Music

Hi all,
Basically, I'm trying to figure out if the subject is possible.
What is happening now is that if I have a standard stereo audio cable plugged in (non-mic) with BT connected to a headset and I receive a call, the audio for the call goes through the headset jack instead of the BT, and because of that there is no mic to pick up my voice. This leaves me able to hear the caller, but them not able to hear me.
Any thoughts?
Thanks,
Ben
Fmstrat said:
Hi all,
Basically, I'm trying to figure out if the subject is possible.
What is happening now is that if I have a standard stereo audio cable plugged in (non-mic) with BT connected to a headset and I receive a call, the audio for the call goes through the headset jack instead of the BT, and because of that there is no mic to pick up my voice. This leaves me able to hear the caller, but them not able to hear me.
Any thoughts?
Thanks,
Ben
Click to expand...
Click to collapse
Had sort of the same thing happen to me, except I tried making a BT call while plugged into headphone jack and other end was plugged into my car's aux port. Started to make the call and quit. Guess its another limitation of the current set of roms, if I'm reading correctly.
My question is under android I would have a microphone on the keyboard so that if I was going to navigate somewhere I could just hit that and say where I wanted to go instead of typing out a long address. I am using HTC Locations, and don't see any provision for allowing me to speak my destination point.
I don't think that's possible yet, but there is a lot in the way of BT profile and audio settings that may help that. we'd probably want to look for something that doesn't auto cut off when a jack is inserted
as it stands, BT is buggered (music playback) on ultrafruit ROMs anyway so we're not missing much, xbmods ROM worked fine but his left for pastures new and everyone else is being silent on the matter.

Categories

Resources