Microphone Gain Control and Current Audio Path - Windows Mobile Development and Hacking General

Hello, all
Hopefully there're some real developers here who can help me
Recently developing VoIP App for HTC devices I've found that none of them support 'Hardware Mixer' functionality. This means that mixerGetNumDevs() had returned 0 for all 4 different devices I had.
My App should at least control Microphone Input Gain to prevent signal distortion with echo from loudspeaker. In addition I'd like to control current audio path, because all HTC devices use rear loudspeaker indstead of the front one when you try to use waveOutOpen() with the single supported device ID (0).
Did anyone here develop audio recording/playing solution???
Are there any hints on this problem???
Please, help me, if you can
P.S. For now it looks like HTC produces the worst devices in the World from developers' point of view

Related

answering machine (without recording, I have read others)

Well from reading other threads I learned that an answering machine software is not possible due to lacking ability to record from the radio audio output (on most phones, possible on univ?).
Well then how about not recording, but automatic pickup and sending prerecorded audio? Would that be possible? Like in: someone calls my phone->software picks up and plays back prerecorded message to caller "I'm in a meeting, please call back at 5pm" ->software hangs up.
Possible or not? Who would be willing to write something like this?
I think there's the same issue - the phone audio path is seperated from the PDA audio path. Read Odeean's posts on TAPI and his frustrations. However, the http://teksoftco.com boys seem to have hinted that this may in fact be possible anyway.
It may be possible I suppose, by writing specific drivers, but I don't think any of us have ever tried I guess.
V
We'll keep you updated with what can be done altough the system is not built to support this kind of features. Firstly because in the US recording audio on phone conversation is ilegal so MSFT doesn't supports this and onestly i don't see HTC being able to offer this kind of support.
Also what Vijay outlined is correct... but we have a few more ideas that we are curently testing...as i said we'll post it if we succeded.
Cheers,
Raul
i believe that it is not a hardware limitation.
The sound from the gsm is not analogue. It passes through the OS somehow, otherwise how is the audio transmitted to the bt hfree?
I don't believe that the transmition of audio (from gsm) to the bt hfree is done only by hardware.
Please comment
andrew_sh is making a good point there. Maybe something can be done by "faking" bluetooth data input?
We have a working answering machine on Himalaya.
See last ROM from TofClock...
Good point made by Andrew. A new bluetooth headset driver or a fake one might do the trick. Cross your fingers guys.
The OS has evolved since Himalaya and HTC has restricted access to drivers by creating a locking mechanism and also the signing process is a hop to pass.
Guys, from my understanding and a poll I've run:
http://forum.xda-developers.com/viewtopic.php?t=40100&highlight=telephone+poll
it doesn't seem like many people have succeeded in recording calls, and those that have are generally using the Himalaya only. The gigabyte can, but it has custom hardware.
We've discussed spoofing the bluetooth audio path before by using a dummy driver and receiver, but mamaich has stated that the audio path for the bluetooth is in hardware only, and seperated from the interceptable paths in the OS.
Rain (for those who don't know, is one of the genii at http://teksoftco.com) - if you have any new ideas, may I ask you to PM me?
Odeean, Mamaich and I have had numerous discussions about this and I'd be interested to know how your research is going. I read that you guys have experience at low level audio driver work (great work on the speakerphone btw!), and I think that might be a good way to go. There is certainly some OS control of the audio path (speakerphone, mute, headset<>bluetooth etc), so I've thought about this way...
V

software audio during phone call

I hope someone can help... I write software for disabled users which runs on CE machines (mostly HTC) Some of our users do use the machine as a phone. We have a problem on the Athena however, unlike the other machines. Our users require auditory feedback due to their disabilities. On the Athena whenever a phone call is received all audio from software is blocked for several seconds or even a minute or two. This includes the system screen click. On the other HTC machines we have always been able to reenable audio output during phone calls so that users can use the machines.
So there is something different on the Athena. It makes no difference whether the system answers the call or whether I use TAPI (some of our users cannot cope with the system phone screen) I have fiddled with secondary gain, volume, and all the other things that we've used on the other machines. But it makes no difference, there is just no sound output at all from the machine for a while after the call is answered.
Can anyone help please? Is there any way to reenable audio from applications?
TIA
Stuart

I need some help with bluetooth, some pointers would be awesome.

Basic introduction:
Me and a team of two other fellows are trying to develop a cool android application for a school assignment. We are focusing on Android v2.2+, and all have either a Droid Incredible or the Evo 4G.
The guts:
We'll be dealing with a few bits of hardware on the android side: the bluetooth radio, the camera, and the microphone.
The glory:
Our objective is that we're trying to use a phone's bluetooth connection and a computer's bluetooth connection to create a pairing of the two devices, and then have Windows recognize the phone as being an input microphone and video camera.
The question:
So far we have an android application that turns on the phone's bluetooth and initiates a camera preview. However, at this point we're kinda at a fork in the road... I have never dealt with anything like bluetooth before, and I've never programmed for android before.
I'm asking for some pointers and / or a focus point here. Unfortunately for our program already being so basic, we already aren't exactly sure of where to go from here. I typically find the android documentation to be way over elaborate with techspeak and under par with examples.
You can view all of our current code on our google code page: http://code.google.com/p/red-dragon/ (the name of our team is a bit of an inside joke )
Thanks a bunch guys!

Sony MW600

For anyone who is interested i have a sony mw600 bluetooth headset which i have tried with different platforms on the HD2 with varying success.
However i now have wp7 mango installed and it works almost perfectly with the headset and is even showing the song titles.
Only issue i find is that sometimes when you use voice command it will call the number but not transfer the audio to the headset - but you can then transfer in call by just pressing the call button
mango seems to be running really well on the hd2 now.
many thanks to all the developers and everyone on this site
Hi redsufi!
In the matter of fact I am very interested that you have the MW600. Your timing also was perfect. I know it's a bit hassle but I wonder if you could help me with any of these things concerning the MW600?
GoogleBroughtMeHere said:
Hello!
To those of you with the MW600 here, I have a couple questions to you:
1) Can you use this as a microphone only device for let's say Skype and other voice communication programs (Ventrilo etc)? Meaning you wouldn't have any earbuds/headset plugged in the MW600 but only use its built in bluetooth microphone and listen through other (wireless) headphones that are plugged straight into the PC?
In other words: does the MW600 work as a microphone without having anything plugged into it? Could someone please test that? I would love to have a wireless mic on my shirt somewhere.
2) How good is the range inside a normal house? Does a single wall block almost all of it or can you wander around many rooms?
3) It was somewhat covered here but would you recommend it for its microphone quality or are there better ones around?
4) I realize this isn't under the Galaxy Tab section, but has anyone tried this device with that? How was it?
Thanks a lot in advance!
Click to expand...
Click to collapse
Hi there
I dont really use skype as its not available with windows phone 7 yet but with normal voice calls you can use the microphone wihtout the headphones attached so don't see that it would be a problem.
The range i think is 10metres and its fine through walls only when you get to the limit it just cuts off -
i find the quality of the mic and with listening to music is great
regarding the galaxy tab dont have one of these so you could try googling it
its a sony product so usually would only have full suppport of all the features with another sony product but all the functions work fine with wp7 on hd2 as well as wm6.5 - there were some issues wiht various android and nodo builds.
Alright, sounds good. Those helped a ton, thank you very much for the information!
Enjoy your MW600. I will soon probably too.
Works great with the Galaxy tab
Caller ID on WP7?
I have one(i.e. MW600)...It didn't display caller ID with WP7...rest is good ... does anybody know any fix or am I missing something.
I tried
DFT ,
elMInStER.blackSideSeven.1.12.7401,
BOYPPC-SHIFTPDA-Build 7.0.7392.0 -V5 , to name a few.

[DEV] Galaxy S Dual Mic Recording

Hi, I'm almost new here
Since this is my first post, I cannot post in the development section, I hope this do not cause problems.
A few days ago I got my first android phone and started to do some low-level development and I needed to record both the input from the headset mic and the internal mic at the same time. I searched a lot on the net and did not find anything useful for the Galaxy S (Vodafone european I9000), so I decided to add this feature to the wm8994 driver included in the samsung kernel source for the Galaxy S.
Since I've never worked with this kind of device, I do not know if this is the correct way to do it, but it seems to work great.
Basicly I've enabled both input at the same time and routed left adc channel output to left audio interface channel and right adc channe output to right audio interface channel. Everything else is on default settings (as configured by MAIN and SUB path, in fact I've just used the same code).
The code also adds a new enum entry for the capture path, called "DUAL", which now is after "MIC OFF", but its just an hack, I'll clean it up later. Using the command "amix" will dump all the mixer channel:
Code:
...
7 MIXER 0 0 0 1 rw ENUM Capture MIC Path { Main Mic=0, Hands Free Mic=1, BT Sco Mic=2, MIC OFF=3, Dual=4 }
...
It can be tested using the pcm_* and mixer_* routines taken from samsung's libaudio, you just need to call pcm_open without specifying PCM_MONO but just PCM_IN, since now both left and right channels will be populated. If you have access to Cyanogen Mod repository, just grab the arec.c source from there and remove the PCM_MONO flag. Beside this I suggest you to dump raw pcm audio and load it into something like Audacity, arec.c seems to produce a wrong riff header.
Now for the questions...
Any ideas on how to correctly setup the gain on both channels? Currently the gain of the headset mic is set to +15 dB on the input PGA and +0 dB on the adc channel while the gain of the internal mic is set to +10.5 dB on the input PGA and +0 dB on the adc channel. I also tried to use the same settings from Voodoo Sound high sensitivity path (with drc enabled), but no results so far... The default gain is far too low, I must talk very near to the headset mic.
Beside this, I've also noticed a strange behavior when recording from both mic. If they're very near, the audio recorded from the headset mic channel will be highly suppressed, if they're far apart, no suppression occurs. As far as I know, wm8994 do not perform noise cancellation on device, any clues on this? Anyway this is not a big deal, since the two microphones will be quite far during normal usage. By far the biggest problem is on the gain for the headset mic.
I hope someone might be interested on this extension to wm8994, this device is really powerful, it's a shame that samsung is using 1/10 of its power...
Attached to this post is the patch file, I've worked on the 2.6.35-12 (recently switched to -13) kernel from teamhacksung, you can get it on github (cannot post the link for the 8 post limit...), just apply the patch from the root kernel directory and rebuild the kernel image as usual.
Any help is highly appreciated
Thanks.
Bye!
EDIT: OPS I'm sorry but I forgot to mention that to enable dual mic recording, you have to activate its path of course through alsa_mixer, like this:
ctl = mixer_get_control(mixer, "Capture MIC Path", 0);
printf("ctl: %x\n", ctl);
if(ctl)
{
int r;
r = mixer_ctl_select(ctl, "Dual");
printf("res: %d\n", r);
}
Click to expand...
Click to collapse
forgive me
i think you should contact supercurio ( https://twitter.com/#!/supercurio )
he's a real badass when it comes to tweaking WM8994 driver
also you might want to check out his app called "voodoo control (plus)"
Welcome to xda! .... That's a great first post!
Sorry to not have any info to help you, but I hope you find what you are looking for and get this working how you want.
I agree that Supercurio is probably the most clued up on audio for these phones. But you probably already knew that since you mention Voodoo Sound (which is his work).
Good luck
Mike
Quake2 said:
Hi, I'm almost new here
Since this is my first post, I cannot post in the development section, I hope this do not cause problems.
A few days ago I got my first android phone and started to do some low-level development and I needed to record both the input from the headset mic and the internal mic at the same time. I searched a lot on the net and did not find anything useful for the Galaxy S (Vodafone european I9000), so I decided to add this feature to the wm8994 driver included in the samsung kernel source for the Galaxy S.
Since I've never worked with this kind of device, I do not know if this is the correct way to do it, but it seems to work great.
Basicly I've enabled both input at the same time and routed left adc channel output to left audio interface channel and right adc channe output to right audio interface channel. Everything else is on default settings (as configured by MAIN and SUB path, in fact I've just used the same code).
The code also adds a new enum entry for the capture path, called "DUAL", which now is after "MIC OFF", but its just an hack, I'll clean it up later. Using the command "amix" will dump all the mixer channel:
Code:
...
7 MIXER 0 0 0 1 rw ENUM Capture MIC Path { Main Mic=0, Hands Free Mic=1, BT Sco Mic=2, MIC OFF=3, Dual=4 }
...
It can be tested using the pcm_* and mixer_* routines taken from samsung's libaudio, you just need to call pcm_open without specifying PCM_MONO but just PCM_IN, since now both left and right channels will be populated. If you have access to Cyanogen Mod repository, just grab the arec.c source from there and remove the PCM_MONO flag. Beside this I suggest you to dump raw pcm audio and load it into something like Audacity, arec.c seems to produce a wrong riff header.
Now for the questions...
Any ideas on how to correctly setup the gain on both channels? Currently the gain of the headset mic is set to +15 dB on the input PGA and +0 dB on the adc channel while the gain of the internal mic is set to +10.5 dB on the input PGA and +0 dB on the adc channel. I also tried to use the same settings from Voodoo Sound high sensitivity path (with drc enabled), but no results so far... The default gain is far too low, I must talk very near to the headset mic.
Beside this, I've also noticed a strange behavior when recording from both mic. If they're very near, the audio recorded from the headset mic channel will be highly suppressed, if they're far apart, no suppression occurs. As far as I know, wm8994 do not perform noise cancellation on device, any clues on this? Anyway this is not a big deal, since the two microphones will be quite far during normal usage. By far the biggest problem is on the gain for the headset mic.
I hope someone might be interested on this extension to wm8994, this device is really powerful, it's a shame that samsung is using 1/10 of its power...
Attached to this post is the patch file, I've worked on the 2.6.35-12 (recently switched to -13) kernel from teamhacksung, you can get it on github (cannot post the link for the 8 post limit...), just apply the patch from the root kernel directory and rebuild the kernel image as usual.
Any help is highly appreciated
Thanks.
Bye!
EDIT: OPS I'm sorry but I forgot to mention that to enable dual mic recording, you have to activate its path of course through alsa_mixer, like this:
forgive me
Click to expand...
Click to collapse
@Quake2 : DO you have datasheet /pin diagram of wm8994
I would like to insert digital data on mic instead reading from analog input

Categories

Resources