How to detect headset connection (Mortscript?)? - General Questions and Answers

I'm looking for a way to detect wire headset (maybe there is a general headset event?) connecting to a WM device (Omnia in my case).
I want to make script, which launch media player in fullscreen mode when headset are connected do the phone.
I can't find the answer on xdadev nor in google. Mortscript too haven't functions for this event.
The only solution I was found is to continuously checking in Mortscript script HKLM/System/State/Hardware/Headset value if it is changing. (http://forum.xda-developers.com/showthread.php?t=284446)
But I'm afraid about device performance impact of this continuously executed registry check.
Any clues?

G-Profile?
Have you looked into G-Profile yet?
Can't post a link to it from work, but go to Google to find it.

I'll try this, thanks

Related

HTC W100/R100 worst wired remote ever??

What a disappointment!!! NOT RECOMMENDED….UNLESS - You only use Windows media player, button functions do not work with other media players, even tried core player with the “wmp plugin adapter “ which allows core player to 'host' plugins that are originally designed for Windows Media Player 10 but alas that doesn’t work either.
Even if you don’t mind using windows media player you are still left with the problem that pressing a button on the w100 wired remote will turn your device screen on. This happens even if you have set a button in windows media player to turn the device screen off. If you lock your device screen then you can’t use the button you have set in windows media player to turn the device screen off because it is not possible to map the windows media player to a button on the remote. The screen will also not turn off automatically after a given period of time while windows media player is running.
So you might want to consider purchasing an extra battery if you decide to go with the w100. As for the headphones with the E100, don’t bother, you would have better sound quality from two tin cans connected by a piece of string, and less treble.
I also tried installing the latest audio drivers from HTC, first off they do not install and you get a message that you have the latest driver already installed. To install the driver you need to extract the files from the exe and install the cab file manually, still doesn’t help. If anyone has found a solution besides an rma or can recommend a wired remote that actually works satisfactorily feel free to post a reply.
Thanks for the feedback.
I was actually looking into buying their wired remote... thank god I read your post first!
He's right
He's right.
I got one.
It Sucks.
greetz,
Pfeffa-rah
Audio Manager
I have a HTC 6800 AKA Titan AKA Mogul AKA P4000
and ive updated my rom with a 2.16 custom version(the last untill now) that has HTC audio manager as a default player so when press play on the w100 it automaticaly starts HTC AUDIO MANAGER and not WMP but there is still that mute button that does nothing ... anyway what i wanted to say is that i'm sure that there is a solution for everyone .. we just have to wait till someone like colonel00 or anyone else buy that controller and hopefully find this value (.reg file)
For more info or testing just PM me
Wired remote works -found my problem!
I have had the same problem many have stated they have where the remote does not work with the Windows Media Player.
I talked to HTC's support as well as one of their product managers. The solutiuon for me was simple:
turn 'off' the little mute switch on the side of the control block. Mine was on and showed the RED paint. Turned it off and everything works . . . . .
Sprint Mogul e/w
Latest Sprint ROM
Spd Shell
Spd Pocket controller
PDA Net
Paulya Dialer
Delorme Street Atlas 2008
4G Micro SD
Problem partially solved!
I use DeviceLock by Matt Armstrong
You Can Found It Here:
http://forum.xda-developers.com/showthread.php?t=261277
And S2U2 by A_C
http://forum.xda-developers.com/showthread.php?t=381588
In S2U2 you must activate this settings
Autostart=1 (start S2U2 when the device is woke up)
IdleStart=0 (start S2U2 when the device's backlight is turned off)
OffLCD=5 (x seconds after the backlight is off, device will be turned off; minimum is 5 seconds
Then you must lock your device. After 3-5 sec backlight will be turned off, S2U2 will be started, AND then HTC AudioManager will run in background. All buttons work fine, my device - HTC 3300 Artemis (Rom: Artemis_Touch_4.02_full_withnocube)
With any questions please contact me or write here.
Sorry for my bad English...

Bluetooth A2DP

Hi there,
I don't know where to ask this, so it went to "General".
I've got a JasJar running WM6 and it happily runs stereo music on my Motorola HT820 bluetooth headset. I also have Sony BT2500 car stereo system which supports bluetooth phone as well as A2DP. with my HT820, I just turn the headset on and jasjar sees the headset and connects to it, but with the BT2500 only the phone part is automatically connected. if I want to listen to music I have to (on my jasjar) go to settings/connections/bluetooth and tap and hold on my xplod (my sony BT2500) and set it as wireless stereo.
is there any way to avoid this step (as I'm usually driving when i have to do this)? if not, is there an easy way to do it with one hand and no tap and hold ?
Cheers,
Shafa
Hey Shafa,
I've got the same problem with my Prophet and a Pioneer BTB200. So far i found no solution, so i most likely will have to write a program to connect to a BTdevice as wireless stereo, if it autoconnects as a handsfree device and is a2dp capable.
hey Lemmz,
I'm very interested to know what API you have to call to do this...
Cheers,
Shafa
HTC Faraday
Hello all,
Are there any resources here for the Cingular 2125 , I would like to port linux on the 2125. sorry if i have mis-posted.
thanks,
rvb
@shafa:
there is a Bt_api.h in the wm5 SDK which defines a function called RequestBluetoothNotifications; so far i found
RequestBluetoothNotifications
Handling Events from the Bluetooth Stack
Retrieving AVDTP Connection State
My idea would be to monitor all bluetooth connection events (most likely via a service), see which device (auto)connects and if it is a handsfree-device and supports wireless-stereo, initiate pairing for the latter.
i will try to do some coding later today. i'll keep you informed.
Cheers,
lemmz
Ok, so far i can recieve bt-related events. unfortunately i've found no info on how to initiate an a2dp connection microsoft-style. There's tons of code for AudioGateway stuff, but imho thats pretty useless.
Looking at the registry i found in HKLM\Software\Microsoft\Bluetooth\Services\0000110B-(...) reference to "Wireless Stereo" and bthutil.dll. looking at the WM6 SDK, bthutil.h, there are just two functions, BthGetMode and BthSetMode, for turning BT on and off.
I'm also looking at the sources for the (settings->connections->bluetooth)-Dialog, btenum.cxx and btmgmtui.cpp, maybe there is some info on this.
Edit:
btw, this 0000110B thing is referred to as AudioSinkServiceClass_UUID. But no luck on that either.
Soo, i think i'm quite close now...
DRVM_MAPPER_PREFERRED_SET -- with waveOutMessage you can switch soundoutput to different devices, unfortunately for a2dp it returns NOTSUPPORTED.
But within the a2dp driver i found some messages:
WODM_BT_SCO_AUDIO_CONTROL, WODM_OPEN_CLOSE_A2DP, WODM_PARAM_OPEN_A2DP
they seem to initiate a connection and set the preferred output device, just like the DRVM_MAPPER_PREFERRED_SET should. Tonight i'll experiment with it.
SUCCESS!!
It worked just as i though: a single command does all the work.
waveOutMessage((HWAVEOUT)devId, WODM_OPEN_CLOSE_A2DP, WODM_PARAM_OPEN_A2DP, NULL)
The device to connect to has to be paired and, of course, in range. I'm now going to clean up the code and build a litte configuration-tool.
Freeware tool
EDIT: Version 1.0.rc-2 uploaded . Find the download link below:
http://teksoftco.com/index.php?section=freeware
I've just uploaded version 1.0.rc-1 of the A2DP plugin. It can be downloaded and used as freeware (0 cost) from http://teksoftco.com/index.php?section=freeware , or find it below attached to this message, including a short usage guide.
New in this release (as many users requested):
-signal indicator
-3 modes for headset: OK, Off, Err
-settings panel added
-Handle Bluetooth option
-Execute File after start option
-applet added in start->settings->system to start settings
-a2dp.exe included in the package, that with parameters: a2dp.exe -bluetoothn|off -a2dpn|off or a2dp.exe -bluetooth:1|0 -a2dp:1|0
------------------
Actually devices that support A2DP (most wm6.0 bluetooth devices), come with 2 audio drivers installed:
1) The "Audio Output" Driver (supported since ppc 2002)
2) The "Bluetooth Advanced Audio Output" Driver, that is responsible of sending audio data over a L2CAP Bluetooth connection, as per A2DP protocol
When the user connects a Stereo A2DP headset, and selects the "Wireless Stereo" profile, the Bluetooth Adv. Audio Output becomes the nr. 1 audio output route, and is indexed as the First audio driver. Any application will output sound by using that driver.
The problem is that sometimes we are already listening to audio in the device's speaker's, and then suddenly we want to switch the output to our a2dp headsets - this is sometimes problematic, as the First audio driver changes from "Audio Output" to "Bluetooth Adv. Audio Output" and the applications currently playing audio need to be restarted.
For such issues, I have provided a tool, as freeware, that will install as a today plugin and provide the user with the possibility of instantly switching the audio between Device Speaker and A2DP Stereo Headset.
It is designed for WM6.0, Microsoft Bluetooth stack, please download it and let me know how it works for you. There are some more modifications that will be done, so this is only Beta-1
The CAB installer and instructions are in the ZIP attached.
(tested on ultimate 8150/wm6.0 and eten m600+/wm5.0, the gfx was made for vga but works on qvga too)
Hello Radhoo,
first times thank you, after such a thing I searched for a long time in vain.
tool functions on the Artemis with WM6 perfectly.
If the Tool were still developed further, I would be pleased genuinly, and would like to call hereby gladly my desires:
1. Bluetooth automatically switch on and off
2. Komandozeilensteuerung
3. Traybuttons without Todayplugin
4. Automatic start of a desired program after activation of A2DP (Mortplayer)
thanks Menkul
Hello menkul, Thanks for the feedback.
What is Komandozeilensteuerung?
Sorry Komandozeilensteuerung ist german.
I mean a Funktion a2pd.exe blueon A2DPon
a2dp.exe blueoff
or so.
Also a exe with startparameter
Menkul
Great idea
Any way to indicate bluetooth 1.2 or 2.0 status/line speed, signal strength, bandwidth?
bjrmd said:
Great idea
Any way to indicate bluetooth 1.2 or 2.0 status/line speed, signal strength, bandwidth?
Click to expand...
Click to collapse
Will try to
I have two spare days for research (wow!) so I'll try to come up with something.
lemmz
lemmz said:
SUCCESS!!
It worked just as i though: a single command does all the work.
waveOutMessage((HWAVEOUT)devId, WODM_OPEN_CLOSE_A2DP, WODM_PARAM_OPEN_A2DP, NULL)
The device to connect to has to be paired and, of course, in range. I'm now going to clean up the code and build a litte configuration-tool.
Click to expand...
Click to collapse
I am sorry I've "invaded" this thread, without first saying thanks to lemmz for his work, as I very well understand the effort needed to perform this kind of research.
While I wasn't aware of his findings (which are available in AK :
bt_ddi.h, WM520\PUBLIC\COMMON\OAK\INC\ ) I just wanted to give another free tool to the community, so I posted this in a few threads where users where requesting A2DP tools. I hope this is ok.
Dear Lemmz,
thanks a lot, i will take a look asap.
thanks again
Shafa
Hey Lemmz,
where do you get the devId from?
I'm thinking about writing the application, but I'm not a C++ guy (anymore atleast) I need to write it in C#...
Cheers,
Shafa
me again. should i use WAVE_MAPPER for device ID? if so, what is the value for it or even better, where can i find the whatever.h that has the value? is there an SDK i should download?
Cheers,
Shafa
menkul said:
Sorry Komandozeilensteuerung ist german.
I mean a Funktion a2pd.exe blueon A2DPon
a2dp.exe blueoff
or so.
Also a exe with startparameter
Menkul
Click to expand...
Click to collapse
Done, original post updated, download 1.0.rc-1
Signal indicator also added: it shows the bluetooth connection strength!
shafa said:
me again. should i use WAVE_MAPPER for device ID? if so, what is the value for it or even better, where can i find the whatever.h that has the value? is there an SDK i should download?
Cheers,
Shafa
Click to expand...
Click to collapse
You should use waveOutGetNumDevs() to get the number of wave devices.
Then you can use their index directly: 0 , 1 , eg.:
int idWAVE_BTAudio = 0; // or 1
waveOutMessage((HWAVEOUT)idWAVE_BTAudio ...
Where:
Code:
0. Audio Output
1. Bluetooth Advanced Audio Output
Be careful, the index changes when one device is selected, so you should check the WAVE devices each time you want to switch the audio.
Personally I've used waveOutGetNumDevs() then waveOutGetDevCaps to see what kind of device is each of the enumerated ones.
Hope this helps.

Best a2dp registry settings. Lets make an OEM/CAB

Hey, just wondering what are all the hacks that make a2dp work better and stay connected. We all know WM is not the best when it comes to car head units. I saw that schaps' ROM says "Best Bluetooth A2DP settings". I want to know what those best settings are. I wanted to compile all the hacks that make it more bearable, and then if possible make a CAB and/or OEM package with all the a2dp hacks. I can make a CAB but not an OEM. What do you think?
I'll start with one. Turn HFConnectOnCall from 1 to 0. Fixes the problem with a2dp losing a connection after a call.
Where is this setting? I can't find it when searching the registry.
Found it:
//HKLM/SOFTWARE/Microsoft/Bluetooth/AudioGateway/ConnectHFOnCall
However this did not resolve the issue for me. I started up some music. Made a call for 2min. then ended the call and the music came out the phone speaker.
Yep thats the one. That resolved the issue for me. After ending a call I used to have to power down then back up the headunit and sometimes even soft reset my tilt to get them to make a a2dp or even hf connection again. Any other suggestions and reg tweaks?

Automating bluetooth

Is there any way to automate the steps to go into the Bluetooth control panel and activating one of my Bluetooth devices to use for wireless stereo?
I have a Scosche BT box in my car so I can play audio through the car stereo. But every time I want to use it I have to switch to the BT panel, use the stylus to press and hold on the Scosche BT icon until the menu pops up then select Set as wireless stereo.
I believe the reason this does not work automatically is that I have multiple BT devices and only one of them will ever work automatically otherwise all your devices would be trying to get hold of the phones output.
Anyone have ideas on how to make this an easier process? Preferably one that would allow me to use Voice Command to activate it? An app specifically for this purpose or perhaps a macro recording app that hopefully would allow an icon for a specific set of commands to run rather than having to open the app then execute the macro?
TIA.
You can start with AutoA2DP, A2DP Toggle, several custom scripts on the MortScripts thread, but Auto ActiveSync will do this as well...
Friendly reminder... please use the Q&A forum for questions.

REQ: freeware Bluetooth-toggle at carkit power

I've seen the question (and the answers) several times here; But not for freeware versions.
The request is quite simple: Automatically turn on the Bluetooth when HD2 is placed in active carholder, so it recieves power. And BT off again, after removing from power.
Several paid programs can do it with profiles. But I don't need all the profiles, just one nifty little app to do the BT-toggle-at-power-toggle-trick. Bluepower should do the trick, but that doesn't work on HD2 sadly.
I allready placed a shortcut at the todayscreen, but it can be done automatically, so it should be done automatically. (you get the idea? It CAN be done, so it HAS to be done... )
Anyhow: does anyone know of a freeware app that does the trick, turning on BT at power-connected, and off again at power-disconnected?
Thanks in advance!
looking for this too!
fantastic idea, i see no reason for bluetooth to be disabled when connected to a power supply.if anyone can do it xda can!
google this
kixass bluepower
It worked for me , while I still had the Touch Diamond and Touch HD
Haven't tried it on HD2, but, hopefully it will work
I allready found kixass bluepower, but another thread here on XDA says it doesn't work on HD2 due to different Bluetooth methods:
http://xda-developers.mobi/viewPost.php?id=599980&PHPSESSID=b4f4cf54198fe7e540312d95fbb088aa
@SMS92: it's the other way around: connect to power = BT on, disconnect = BT off. (Hence power comes from the active carholder, but the audio-signal is connected via BT)
I'm not sure if i understand you correctly but don't you mean ?
Settings > All settings > System > Car kit mode > "Auto connect when in car kit mode" ??
greetz,
Plaspop
No, for that the bluetooth allready has to be on (Or am I mistaken? EDIT: YES!!!! I'm mistaken!!)
I'd like the BT to be off all day, except when I'm in the car. For that's the only place where I use BT. After getting out of the car the BT should be switched off again.
In order to do this automatically the phone needs to know whether I'm in the car. The easiest trigger for that is the power-connection, as I place the phone in an active phone holder (Brodit). This action could then trigger BT to switch on automatically, and removing the phone from the holder (and therefore from the power) should switch BT off again.
(The BT is used to connect to the built-in carkit in the Mazda 6), Power to the phone is supplied via the active carholder, which ONLY gives power, no audio-connection.
EDIT!!! OOOOW WAIT!!!!! YOU ARE RIGHT!!!!!!
WOW!!!! So simple.....
(Settings > All settings > System > Car kit mode > "Auto connect when in car kit mode")
So no special app needed, no profiles, no reg-changes, just a mere setting.
I LOVE HTC! Soooo much clever things in this HD2!
Just tested: BT off, connect to carpower: BT switched on automatically. Remove from power: BT switches off again. So this works!!!
(I didn't have time to test actually connecting to the car in this modus, but normally it works, so I assume this last bit works too.
You're my hero! (ok, that's a bit exegerated, but you get the idea) THANKS!
EDIT: see post below for last status.... sh*t.....
Ehr...... Sh*t.... My Brodit holder doesn't connect the right pins to trigger the carmode, and therefore the BT doesn't automatically switch on.
My desktop loader uses a converter cable, and that one DOES trigger the carmode
So.... sorry, no solution yet....
Found this in another thread. Could this help you ?
http://forum.xda-developers.com/showpost.php?p=3367344
Thanks, but no, that doesnt work on the HD2.
Has something to do with changed Bluetooth system in the HTC models after the touch?
A similar request thread has been started here: http://forum.xda-developers.com/showthread.php?t=667901&goto=newpost
Im following it too, and hope it will lead to development of a cab for this much wanted function.
I don't know how the carmode works, but issn't it possible to edit the registry to activate the carmode when the phone is on any kind of charger, instead of when some pin is connected? Then you would combine two functions witch are already on the phone.
Brodit activation of car kit mode
Has anyone succeeded in getting the Brodit car holder to automatically activate NaviPanel?? I see in other posts that if pin 4 of the micro USB is grounded it auto switches NaviPanel - has anyone else tried this yet?

Categories

Resources