Inbuilt speaker still on after a voice call - Windows Mobile Development and Hacking General

I'm having a problem turning off the speaker after a voice call. The proprioty software I've written runs on top of shell32 using the TAPI. The voice call goes through successfully but after the lineDrop() function the inbuilt mic and speaker are still switched on. Interference / crackling can be heard if you put the XDAII to your ear. The exact same code works perfectly on the original XDA.
I've tried muting the volume and setting the mic and speaker on-hook via phoneSetHookSwitch() function but to no avail.
The phone software under shell32 seems to get the same problem except after a few seconds the speaker makes two short, quiet beeps and places the mic and speaker on-hook.
The only lead I have is that a few portions of shell32 had to be chopped out due to incompatability issues with my software. Maybe one of these components have affected the phone? Any ideas would be appreciated.

You won't believe the solution.
Play a short (silent) .WAV file after the voice call has been dropped.
This sorts the problem.

Related

How to prevent OS from muting audio output when making a phone call

I'm working with an app running at Windows Mobile 5.0 pocket pc. And I
use 'waveout' functions to play some audio file, sometimes my app need
to automatically make some phone call using TAPI. Here comes the OS
behavior which I don't want: the audio output is somehow muted. I want
the audio output keeps the same volume, is there any way do it? Thanks
a lot!
When call is in progress, audio path is changed. This is a hardware feature (you can read about it in many posts about answering machines).
Currently there is nothing that can be done about this.
I had not actually tested this so I gave it a go. No sound gets through when I programmatically play a sound or when I use the media player. I belive Levnum is correct because when I play a sound and hang up the phone during the play back, the sound returns but is choppy for an instant. That would be caused by the path of the audio being switched. When i programatically change volume it is normally very clean, eg loud to soft but with not noise between.
a bit off topic...
One thing that bothers me about this isolation of the phone audio hardware is the presence of the GSM 6.0 input properties for the microphone. If the hardware is truly isolated from the system then why have this sampling format? Wouldn't the phone be doing its own sampling and not need windows to have this capablity?
What a bad news! Thank you anyway.
experimenting with the volume during a call
In June played a lot with audio levels on my hp h6315 while using TAPI and recorded my results. The 6315 isn’t an HTC device but I think it probably works similarly. I have a wizard too, but haven’t experimented as much with it.
Here are my notes that I typed when I did it:
(perhaps they will be useful to someone)
[size=+2] Playing wave stream while establishing a GSM call using built-in phone software[/size]
Inbound GSM call with ear bud (speaker and phone volume low setting)
Sound continues through ringing
Sound cuts out for ~1 second after selecting answer
Sound continues mixed with call
After call hang-up sound still continues
Inbound GSM call without ear bud (speaker and phone volume highest setting)
Sound switches to a lower setting (front speaker?)
After selecting answer, sound changes momentarily to high
Then Sound cuts out for ~1 second
Sound then resumes at lower level
If phone is put on speakerphone the sound goes to high level
Sound continues mixed with call
After call hang-up, with call on speakerphone, sound continues after a brief interruption
After call hang-up, sound reverts to loud and continues. There is a gap as in Speakerphone case, but it isn’t as noticeable since the change in volume helps to mask it.
Outbound GSM call with ear bud (speaker and phone volume low setting)
Sound is interrupted for about 1-2 seconds after hitting talk
Sound then continues through answer and hang-up. (mixed with call)
Outbound GSM call without ear bud (speaker and phone volume highest setting)
Sound is interrupted for about 1 seconds after hitting talk
Sound resumes at lower volume through call
Sound has brief interruption at hang-up while on speakerphone.
Sound reverts to higher volume after small gap at hang-up while not on speakerphone
[size=+2]Recording while establishing a GSM call using built-in phone software[/size]
Inbound GSM call with ear bud (mic on gain 5)
Recording continues through ringing
Slight break while answering then resume for brief time then changes to much lower gain.
Remains at lower gain
Inbound GSM call with ear bud (mic on gain 1)
Same as mic gain on 5, didn’t seem any quiter, also same with mic on AGC
OutBound GSM call with ear bud (mic on gain 5)
Slight break after pressing talk then resume for brief time then changes to much lower gain.
Remains at lower gain
Click to expand...
Click to collapse
I think my largest problem was the microphone gain, but I don’t remember for sure. On my typical volume settings, the cases where the volume level lowers, it often lowered so much that I couldn’t hear it without listening very carefully. Originally, I thought it was totally muted.
To help minimize the change in volume level, try adjusting the regular system volume to a relatively low level and put the phone volume on max. This helps some, but to fix the problem try multiplied the audio samples by 2 or more before playing them to the speaker. Find the best multiplication factor by trial and error.
Of course, your’s may be different.
For the off topic part, I thought the audio path for the microphone always was available to windows mobile and only the audio to the “telephone receiver” wasn’t.. There is only one microphone, but two speakers. The main system speaker is the one that you use to play wave files. The “telephone receiver” is the one that as far as I now is only used for telephone calls. I expect that this telephone receiver speaker is connected directly to the GSM chipset. I think when put on speaker phone the sound goes out through the main speaker. (I don’t have my phone with me so I can’t check right now)
Yes that is what I think as well. So if the phone "chip" is recording/playing the sound using the same hardware why dose windows need to be able to sample at that rate? Its the phone that needs to do the smapling.
The drivers on individual devices can vary a lot when it comes to sound. For example, on some of my devices playback will comence as soon as I add buffers that are appropriately prepared. This is not correct behaviour - the driver should wait for the waveOutWrite before it starts. On other devices the driver continues playing until a buffer is finished even if the waveOutReset is called. When it comes to setting the volume with waveOutSetVolume I have has more varying results on just about every device. Because of this I think it is not very usefull to spend a lot of time perfecting code for this sort of thing. Even if as a programmer you do everything correct its going to sound wrong somewhere.
If the phone can stream the call to and from a bluetooth headset then doesn't this mean the in call audio is accessible programmatically somehow?
Or am i missing something
Actually there was a theory floating around that if you could create a 'fake' / virtual BT driver you could capture and send sound from and to the phone.
As far as I know no one on this forum has done this.
It should be noted that some companies like gigabyte are producing phones with built in answering machines.
I think the hardware separation thing may just be an HTC thing and even then only for certain models.
reddreamster -
If you just want to play the audio to the user at the local end, and not down the phone line it is possible. As the others have said HTC keep the phone and local audio completely separate, so you can't play the audio down the phone.
Calling TerminateProcess to kill off cprog.exe can reduce the amount the system interferes in your TAPI calls ;-)
But to re-enable the local audio output this will probably not be enough. You need to call entry point 218 in \Windows\ossvcs.dll
This function takes 1 DWORD parameter, and you should pass the value 1.
I can't remember the return details, but it can be treated as a boolean:
if (return_code)
{ it succeeded }
Make this call AFTER you have made the TAPI connection, and it will re-enable the local audio output.
Hope that helps
Stuart
Solution
Microsoft published the anwser to this in Jan (2007). It's probably no longer of interest to reddreamster, but I thought I would publish a link to the answer in hopes that I might help the next person with the same question that manages to find this thread.
http://blogs.msdn.com/medmedia/archive/2007/01/04/the-wavedev2-gainclass-implementation.aspx
Also, you might be interested in this about the Mixers
http://blogs.msdn.com/medmedia/archive/2007/01/12/what-do-you-mean-by-mixer.aspx
Keywords that might have helped you find this:
mixer api mixerapi wave api waveapi tapi wavedev2 audio gain gainclass volume waveOutMessage waveOutSetVolume wave device
levenum said:
Actually there was a theory floating around that if you could create a 'fake' / virtual BT driver you could capture and send sound from and to the phone.
As far as I know no one on this forum has done this.
It should be noted that some companies like gigabyte are producing phones with built in answering machines.
I think the hardware separation thing may just be an HTC thing and even then only for certain models.
Click to expand...
Click to collapse
Yes there was a theory. And here is the final answer to that too:
http://teksoftco.com/forum/viewtopic.php?t=34&start=15
We had another attempt of making PhoneREC possible - by intercepting the voice flowing through the BT driver when a Bluetooth headset is connected:
1) when a call is established, the software would have enabled voice routing to Bluetooth headset
2) if a headset was not present, it would have been emulated (to be able to use the device without headsets with phonerec too)
3) voice data over bluetooth would have been in the form of SCO packets
4) our software would have intercepted the SCO packets, extract the voice data, record it to a file, and play it on the device's speaker (so no need of using the headset to hear the other party in the call)
Unfortunatelly this failed too, as the SCO packets are handled in the hardware, so we found no way of capturing those from a software program.
The only remaining option is to use a custom made wired headset with PhoneREC. This works and assures high fidelity sound for both parties, but the phoneREC user can only record the phone call by using the special wired headset.
Click to expand...
Click to collapse
So consider the subject closed, and sorry for the bad news,
Radu

phone call audio problem with ameo

I don't know if this is a fault or something I didn't expect but would be glad to here how others have found it.
I have had the ameo for a few weeks and have noticed that if I use a bluetooth or wired headphone everything seems to be fine on a phone call. However when I try to use it as a speakerphone, whoever I am speaking to complains that my voice is breaking up (I have a strong signal strength). It appears that if there is any response from the person I call or any noise in their background then the microphone at my end is interrupted making my voice unintelligible. I know the manual says to use a headset but what is the point of having a speakerphone if you can't use it? Does anyone else have the same problem or have I got a faulty unit?
bobg said:
I don't know if this is a fault or something I didn't expect but would be glad to here how others have found it.
I have had the ameo for a few weeks and have noticed that if I use a bluetooth or wired headphone everything seems to be fine on a phone call. However when I try to use it as a speakerphone, whoever I am speaking to complains that my voice is breaking up (I have a strong signal strength). It appears that if there is any response from the person I call or any noise in their background then the microphone at my end is interrupted making my voice unintelligible. I know the manual says to use a headset but what is the point of having a speakerphone if you can't use it? Does anyone else have the same problem or have I got a faulty unit?
Click to expand...
Click to collapse
I get this on full volume in a small room. Turning the volume down a bit usually seems to solve it. I think the mic is pretty sensitive and can get flooded a bit too easily.
bobg said:
I don't know if this is a fault or something I didn't expect but would be glad to here how others have found it.
I have had the ameo for a few weeks and have noticed that if I use a bluetooth or wired headphone everything seems to be fine on a phone call. However when I try to use it as a speakerphone, whoever I am speaking to complains that my voice is breaking up (I have a strong signal strength). It appears that if there is any response from the person I call or any noise in their background then the microphone at my end is interrupted making my voice unintelligible. I know the manual says to use a headset but what is the point of having a speakerphone if you can't use it? Does anyone else have the same problem or have I got a faulty unit?
Click to expand...
Click to collapse
I have used both the Ameo and the Dopod rom on the same device and can conirm that this problem is worse on the Ameo rom
Could other dopod users tell their experiences regarding hands-free calling
bobg said:
I don't know if this is a fault or something I didn't expect but would be glad to here how others have found it.
I have had the ameo for a few weeks and have noticed that if I use a bluetooth or wired headphone everything seems to be fine on a phone call. However when I try to use it as a speakerphone, whoever I am speaking to complains that my voice is breaking up (I have a strong signal strength). It appears that if there is any response from the person I call or any noise in their background then the microphone at my end is interrupted making my voice unintelligible. I know the manual says to use a headset but what is the point of having a speakerphone if you can't use it? Does anyone else have the same problem or have I got a faulty unit?
Click to expand...
Click to collapse
I experienced something similar but only when the caller has a lot of background noise on their end. It's not a consistent problem here so I assume it's not the same issue you're having.
Thanks for the replies - it looks as if the unit is working to spec but that there is a 'built-in' problem when using the phone as a speakerphone. I didn't get this on the spv2000 I replaced with the ameo so wasn't expecting it. Background noise does seem to trigger it - I just tried phoning using the speaker phone to call an answerphone and it worked fine with clear audio at the other end. I think a day or 2 of playing with the volume to minimise the problem is the next step. I'll post back when I can be more definite but would be grateful for any other opinions.
Cheers
BobG
On my U1000 the mic works fine in speakerphone mode. There are no brakeups of voice even while walking mid-traffic. Yes, I have to speak loud but that is expected with background noise over 85db.
However, the speakers do not return sound very loud at all (for a speakerphone). I have to lean way forward and almost put my face on the screen to be able to clearly hear the other side (even in a totally quiet environment).
Would have been great to have had a decent speaker phone, but as it is I'm sticking to my bluetooth headset.
The 2 drawbacks with bluetooth is the answer delay, it takes a good 1 second before the connection is established between the headset and phone. The second thing is the sensitivity of the mic, it picks up everything that goes on around you, and drowns out your voice. I have to move the mic close to my mouth if there is other noises going on around me (but this is most likely a bluetooth headset problem, and not related to the U1000).
OK several calls later and after fiddling about with the volume I've found that the best way for this problem to be overcome is to set the 'in call' volume to its lowest! I've also set the main unit volume to about 40% but that shouldn't really have any effect. It's odd that the best way for the speakerphone to work is on minimum volume - fine for single calls but not much use if I want a few other people to listen in. However this is a very small problem now and the benefits of this device hugely outweigh this small drawback.

can't hear the ring tone , microphone and speakerphone doesn't work

Hi there,
I am having some issue with my O2 Atom Exec external speaker.
When the phone rings:
- I can't hear the ring tone (phone and pda volume settings turned up to high)
When I pick up:
- microphone does not work
- phone speaker does not work
Actually microphone seems to no longer work same with external speaker. I try to play music and no sound comes out externally. When I use the combined stereo headphones and microphone, these work fine. I have tried a hard reset and looking into the Windows registry for some obscure volume settings but this did not resolve the problem.
Anyone else experiencing a similar issue? Please help,
Hi,
You have a problem with the headphone socket. what I would suggest is play a file in media player and put the headphone plug in halfway and gently move it around left to right. You will know when it's fixed because the sound will start coming out of the speakers. This is a known fault that has been around a long time.
Cheers.
rdman
Today I faced this problem, I tried to do everything.
Then I did exactly what you said, and this procedure
fixed my speakers. Thank you ,very very much for help.
We can see this thread below, talking about this problem.
http://forum.xda-developers.com/showthread.php?t=267056

In call microphone issues when using headphones

Does anyone else have the problem where the other person can't hear you when you use a pair of headphones while in a call? When removed, they can hear me fine. I'm hoping that this is a software issue that can be resolved in an update. If not, then i want to return it before my remorse period is over.
I am having distorted sound - other party hearing it unclear and distorted..
looks like a hardware issue.. tried with 2 earpiece... no luck.
I'm actually starting to wonder about that. It may actually be a software/driver issue. I was on the phone yesterday and decided to do some testing. Unplugging them and plugging them back in provides perfect audio to the other person for a few seconds before going back to garbage, as does muting and then un-muting the microphone when in a call. Something I've noticed about the microphone is that the gain seems to be set too high - try to make a recording of cars going by - guaranteed clipping (don't have the volume too loud or you could blow out the speaker you're listening to it on).
rr5678 said:
Does anyone else have the problem where the other person can't hear you when you use a pair of headphones while in a call? When removed, they can hear me fine. I'm hoping that this is a software issue that can be resolved in an update. If not, then i want to return it before my remorse period is over.
Click to expand...
Click to collapse
I ran into the same issue. However, the headphones I was using didn't have a built in microphone. I discovered that if I plug in headphones that lacked a built-in mic, the phone switches its internal microphone's gain to the gain it would use if you were holding the headset to your ear. I held the microphone in close proximity to my mouth and that solved the issue.
I guess this would be a software issue.
KlipperKyle said:
I ran into the same issue. However, the headphones I was using didn't have a built in microphone. I discovered that if I plug in headphones that lacked a built-in mic, the phone switches its internal microphone's gain to the gain it would use if you were holding the headset to your ear. I held the microphone in close proximity to my mouth and that solved the issue.
I guess this would be a software issue.
Click to expand...
Click to collapse
That's exactly the testing I did and exactly what I was thinking. Now to wait for LG or Google to fix it.
Another experiment you might try would be to put your finger over the secondary microphone on top of the phone and see if that makes a difference. (My guess is that the reason your voice comes through softly with the headphone plugged in is that the phone is still doing background noise suppression, which works by taking the difference between the main microphone, which picks up your voice plus ambient noise, and the secondary microphone, which mostly picks up just the ambient noise. When your mouth is far away from the phone, your voice is equally loud in both microphones, so the difference doesn't yield much voice signal. If your voice comes through louder after stopping up the secondary microphone, that would confirm this explanation for the problem.)
wmm said:
Another experiment you might try would be to put your finger over the secondary microphone on top of the phone and see if that makes a difference. (My guess is that the reason your voice comes through softly with the headphone plugged in is that the phone is still doing background noise suppression, which works by taking the difference between the main microphone, which picks up your voice plus ambient noise, and the secondary microphone, which mostly picks up just the ambient noise. When your mouth is far away from the phone, your voice is equally loud in both microphones, so the difference doesn't yield much voice signal. If your voice comes through louder after stopping up the secondary microphone, that would confirm this explanation for the problem.)
Click to expand...
Click to collapse
Next time I'm in a long phone call where I am using headphones, I'm going to try that. It could be possible.
wmm said:
Another experiment you might try would be to put your finger over the secondary microphone on top of the phone and see if that makes a difference. (My guess is that the reason your voice comes through softly with the headphone plugged in is that the phone is still doing background noise suppression, which works by taking the difference between the main microphone, which picks up your voice plus ambient noise, and the secondary microphone, which mostly picks up just the ambient noise. When your mouth is far away from the phone, your voice is equally loud in both microphones, so the difference doesn't yield much voice signal. If your voice comes through louder after stopping up the secondary microphone, that would confirm this explanation for the problem.)
Click to expand...
Click to collapse
This appears to be what is happening. The top mic is doing noise cancelation for the bottom mic.
I called a friend and plugged in headphones. When I didn't cover either mic, she said I was quiet (because the phone thought I was background noise). When I covered the top mic, she could hear me fine.
At this point, I'm inclined to say this is a software issue because the phone app can switch between microphones and which one is used for background noise cancelation. (Putting the device in speaker mode appears to use the top mic only.)
Sent from my Nexus 10
That's good confirmation -- thanks for running the experiment. Maybe I'll put a little wad of putty in the car to stick over the top microphone while I'm driving!

Galaxy S8 Clicking noise coming from earpiece

I recently started to hear faint clicking/ticking noises coming from the earpiece while having phone calls on my S8 (I heard those noises in the past but I thought they were caused by the other person on the call).
I downloaded an app called "Earpiece" (that lets you listen to music trough the earpiece instead of the speakers) and the ticking noises persist (even if I'm not having a phone call).
What's even weirder than that, I actually discovered that the earpiece makes those noises all the time (even when I'm not listening to anything and I'm not having a phone call), but they are not that loud.
I found that if I turn Airplane Mode on (without Wifi enabled), the noises stop. To give you some concrete examples:
- Connected to network( + WiFi on): Earpiece makes those noises at all times.
- Airplane Mode on + Wifi on: Earpiece makes noises at all times.
- Airplane Mode on + WiFi off: Earpiece doesn't make any noises. If I listen to offline music trough the earpiece (using "Earpiece" app) there are also no clicking noises.
* Those clicking noises don't have a constant rythm (they sometimes stop for a second or two).
*If I press my ear to the earpiece a bit, I can hear them very very well.
What do you think might cause this?
Thanks.
I am also suffering from a similar issue.
I haven't much noticed if it is there with wifi on or off etc, but it is really irritating.
Samsung says if you can prove we can refund, but it is really difficult to prove. I have noticed that when I press the phone hard on my ears the noise diminishes but doesn't go away.
is your problem solved, please share an update or any other please suggest a workaround.
Thanks
even i am facing same issue after updating to 8.0 beta version
Strange clicking from my Samsung S8+.
I have been hearing a strange clicking sound from my smartphone. Not being used or on charger, it makes this clicking sound that is very quiet but others do hear it. Is there an app that would cause this?
Having same issue seems to be the WiFi makes faint clicking noises while it's transferring data back and to anyone resolved the problem. Only an issue while I am on the phone
I have this issue as well- but it is so quiet you can't hear it unless the room your in in pretty silent
If you open the camera app and listen to the call speaker it gets alot worse. Think it's the WiFi mechanism vibrating against the outo focus mechanism of the camera

Resources