Hi,
I'm writing an application on android, and for a long time I'm trying to get the lq(link quality) value of an existing bluetooth connection between two mobile phones. I've read on a forum about a method named getLinkQuality() included in
the Bluez API written in C, and I want to include it into my Java code. Does anyone have a similar problem-related example code, like getting RSSI value, any advice or any other idea to get the link quality level? I had troubles using Android NDK so I could really use some help.
Regards,
Peter
Related
I need to lower the microphone gain.
My audio codec is clipping becouse of incoming PCM samples saturated from
the mic. I don't need AGC becouse it doesn't work well with my app.
I just need to manipulate the mic gain via software.
Is there a way to do it? I'm using waveform audio api ti capture voice.
Actually the gain is too loud !!!
Thanks.
Anyone knows?
OK, I don't have the answer. But since no one is responding I'll try to give a few ideas that might help.
First, I have a hp6315 and an apache. Under settings, they both have a utility to enable/disable AGC. The ipaq's utility is labeled "ipaq audio" if you disable agc, you can then configure the microphone gain. This gain is stored in the registry. I think searching for gain or audio will find it. The apache doesn't have this. searching for audio, gain, wav, volume in the apache registry doesn't find anything that looks like microphone gain. I guess this is a "value added" thing from hp. But you could try searching anyway.
Then there's the mixer API. This is the way that user level apps are meant to control the audio. Works great on the desktop. Use mixerGetNumDevs() to find out how many devices you can control. On the h6315 mixerGetNumDevs returns 0. I haven't tried the apache, but I can remember a few years ago reading that many (most?) devices return 0. Oh well, hopefully you'll have better luck. However, there are two mixers that are implemented on the pocketPC the question is how to access them.
see this link for info on the mixers
http://blogs.msdn.com/medmedia/archive/2007/01/12/what-do-you-mean-by-mixer.aspx
Here's a link that shows the relationship between the mixer api and the other mixers, wavedev2 mixer, and software mixer.
http://msdn2.microsoft.com/en-us/library/ms923709.aspx
You'll notice that the the mixer api interacts with the mixer in the device driver not the software mixer in the WaveAPI.dll. You'll so notice that this section on audio drivers has pages for MDD/PDD drivers and Unified Audio Model (UAM) drivers. Platform Builder for WinCE 5.0 comes with a sample for each of these model drivers. Both models handle WAV_IOControl Messages. There are two types of messages, IOCTL_MIX_MESSAGE for the mixer, and IOCTL_WAV_MESSAGE for the rest of the driver. It looks like these IOCTL_MIX_MESSAGE are the way the mixer API controls the mixer. In the MDD/PPD sample they can be used to set WPDMX_MIC_VOL and WPDMX_LINEIN_VOL. In the UAM driver it's AC97_MIC_VOL and AC97_LINEIN_VOL. Perhaps sending the right IOCTL will solve the problem.
This blog entry
http://blogs.msdn.com/medmedia/archive/2007/01/03/windows-ce-audio-driver-samples.aspx
seems to say that a wavedev2 sample is available now. Also, while the WinCE 5.0 page above only metions two models the corresponding wince 6.0 also talks about wavedev2. I suspect if you got the current version of platform builder for WinCE 6.0 (trial version is free) you would have get the sample code for wavedev2, which is likely to be the best documentation of how this works. Amazingly, the drivers aren't that hard to read.
Both of the functions waveInMessage() and waveInSetProperty() are available to user apps. Hopefully both should be able to change the microphone gain if you can set the parameters properly. While most of these things are about windows CE, I think most (or all) apply to windows mobile 5.
Windows mobile 5, likely uses wavedev2 devices not MDD/PDD or UAM drivers.
Another interesting page about wavedev2 audio is here:
http://blogs.msdn.com/medmedia/archive/2007/01/04/the-wavedev2-gainclass-implementation.aspx
If your able to succeed or even learn more, be sure to post it back here.
I said a lot so I probably got something wrong. Anyone, please feel free to correct anything.
mixerGetNumDevs() returns 0 on my device
I can't find any registry entry which suggests microphone gain manipulation.
Perhaps i just need to send a waveInMessage properly.
I'm getting confused, should i implement a driver for this?
How do i know what kind of driver is running on my device and what messages
does it accept?
Thanks.
i think this may be what you need(?)
use a registry editor, (phm do a good free one)
hkey_local_machine/software/htc/audiogain (and audiogain 0 and 1 and 2)
try playing with the settings in there, soft reset to take effect
I don't have that keys on my HTC, should i create it?
Do you mean audiogain0 audiogain1 audiogain2?
Thanks.
see the attached screenshot, if you don't have those settings to adjust, a similar/same question was asked last night in a other thread, with different answers here
http://forum.xda-developers.com/showthread.php?t=306655
Looks like the cab file from the link provided by bbobeckyj just sets those audiogain registry settings. I don't have those settings on my apache. I don't think adding will help, but "you never know".
If you want to use waveInMessage() or waveInSetProperty() search for them at microsoft. You'll find there are a few parameters that you don't know. Read though the sample drivers that you can get with platform builder. See what values they expect, and which one cause them to change the microphone level. Try calling the function with values from the sample driver. While there is no guarantee that they use the same values, it's like that they do. I would start with the wavedev sample.
I don't know why microsoft doesn't seem to allow access to the source without agreeing to download all of platform builder, but it looks like that's the only way to get it. You can download the trial version for free. The source often helps if your trying to fingure out how something really works.
Uhmmm, i havn't found any download link about platform builder for windows CE 6.0. I've only found the 5.0.
Should't the trial be free?
Thanks.
I need to fix audio gain in my Itel Experience Phone (Windows Mobile 6.0 Pro)?
Please help.
I need to mute mic while on a call. Anyone has a idea of how may i do it?
Thanks
moved to the right forum, please post in the correct forums.
I currently have been trying to implement an application that supports advanced SMS features like compression (as spelled out in specification "Compression algorithm for text messaging services (Release 8)", 3GPP TS 23.042 V8.0.0). A quick search of the forum did not result in anything that supports this, so forgive me if this is a repeat.
Does anybody have an implementation of this specification that actually works? I would very much like to see the source code if so, but an application that I could compress an SMS using that protocol would be nice as well just to compare to what I am generating.
The problem is I have the GSM 7bit huffman tree, and it works fine for me, but it does not produce results that match the test vectors included with the specification above.
Any help would be greatly appreciated!
I did find an implementation that CLAIMS to be compliant, but I have to work through de-compilation of it... JAVA Class files... Also working up a driver for it to test out it's compression. If I can successfully de-compile the class files, and the driver works, then I might be done (short of converting it to C/C++). I'll post later on the success /failure of it.
Oh, it's called "Attention" and the JAR files are available at:
http://code.google.com/p/attention/
Got the SVN source tree for it (was added recently) and this is truly not ready for prime time. It is RIDDLED with errors and absolute paths' to files that don't exist as anything other than resources... I have tried going through and fixing most of them that has to do with the compression, but my hopes are not high. Plus, it's in JAVA...
Anyhow, I am still looking for a GOOD implementation of this. Any suggestions would be greatly appreciated.
Hello,
I have a lot of problems with omnia 7 due to app profile network of samsung haven´t got the profile of my operator. I can set it thanks to a post of here, but I think that it is a bit difficult and you need the computer to set it. As I have studied some of programming c#, I decided to make an app that set mms and internet. I have already done the screen and I´ve get to make that app create the file xml with the code in order to set mms and internet, but I haven´t found information about how execute/apply the file xml with the app. Where can I find about it?
PD: Sorry, I do not control English very well
Hi,
I guess it's a topic a bit complex, but can not someone help me with this?
You use an OEM COM interface, accessed from C# by using Microsoft.Phone.InteropServices.ComBridge. One easy way to see how this is done is to look at the source of an app that does it. If you can't get the source to DiagProvXML, you could always just decompile it (decompiling .NET code is pretty easy and there are several tools that can do it). There are several other apps that also use provxml; one or more of them may offer source access.
Hi,
Thank for your help and I can select the services that I have load, but I have a small problem that I hadn't taken into account. I know c# but my apps are a lot of more easy that diagprovxml, and I can´t find the part of program that I´m interested. I use "JustDecompile" to decompile the app. Could you tell me what class(or classes) is (are) what I'm looking for?
Thank you very much again
Hmm... it's not linked in my SIG because it's out-o-date, but you could try using Search to find my old DeployProvXml app. It includes a pretty straightforward example of using provxml.
Essentially, you need the following things:
The interopservices DLL (allows you to use the ComBridge class).
The OEM DLLs (DMXMLCOM.dll and such).
COM class and interface definitions for them in C# (this is the stuff with the [ComImport] attributes and the GUIDs).
ID_CAP_INTEROPSERVICES in your WMAppManifest.
WPInteropManifest.xml file in your project.
Use the ComBridge to register the COM interfaces, then create an instance of the COM class(es), cast to the appropriate interface type(s), and use a variable of the interface type like any other .NET object.
You can read a bit more about COM and native code in Heathcliff74's guide. It's aimed at making your own native libraries, so skip all the stuff about creating your own COM classes and writing native code. http://forum.xda-developers.com/showthread.php?t=1299134
Hi again, Does the method WP7RootToolsSDK.Environment.ProcessConfigXml allow to set the parameters that have a tipical xml file?
thank you again
I'm not sure what you mean by "set the parameters" but the Root Tools SDK does in fact allow you to consume ProvXML files now (I think it even supports the query provXML and returns the output, though I haven't tried).
Hi,
I need to supply stable energy to a NFC-powered chip card that doesn't send any data of any kind over the NFC field.
The problem is that, when NFC enabled, the Nexus S only provides a pulsating NFC field : every 0.1 second (or even less), the NFC field is turned off for 0.1 second before it restarts.
So the goal would be to build an application that goes deep enough in the phone's settings to modify that pulsation and provide a stable field (or at least longer pulses).
Do you think this might be possible in a non-rooted phone?
In a rooted phone? Maybe using CyanogenMod as mentionned in an Internet article called "Uncovered: The hidden NFC potential of the Google Nexus S and the Nokia C7"?
Or do you think this won't be possible unless we have access to the Samsung firmware?
Thanks,
Gildas35
I get further in my researches and I am now sure that I can't modify the NFC field pulse in neither SDK or NDK.
So I am now browsing the Android source code (on that website: grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android-apps/4.0.3_r1/com/android/nfc/NfcService.java?av=f) to find where should I modify it.
But more and more I believe that it should be in the C part of the source code, not in the Java part. Especially in the libnfc layer?
Do anyone knows where I could find such a file?
Thanks,
Gildas
Hello,
I am extremely lost here.
The RSSI (Received Signal Strength Index) for Wifi P2P in Android is not implemented. It is set to a constant 60 in the Java code. However, looking at the kernel, in p2p_supplicant.c, there is a pointer bss->level that contains the RSSI.
If I create a function in that file to get RSSI which just returns bss->level, how can I call that in Java?
I know that I will be creating a custom ROM, and I will read about doing that, but my question is how to connect the Java with the C?