[2009.07.01 Updated] - AutoA2DP - The smallest A2DP Toggle application

Search This thread

xiaojin1985

Senior Member
Mar 15, 2009
658
0
Nanning
hi.baidu.com
Hi all.
I found that when we connect a paired Bluetooth Headset with WM it will set as Handsfree by default,but not A2DP Wireless Stereo,we have to set it manually,that is a little annoying work,so I write this small application to do this.

-WM5/WM6 Supported.
-No TSR(terminate-and-stay-resident),no Background running process
-Developed in C,fast execute speed and small file size(5KB with signature)

Learn About "AutoA2DP.ini"
AutoA2DP.ini is a text file which used to point out an application that AutoA2DP will launch after A2DP Mode toggled.

This file must local in \Windows folder,it is an one-line text,for example:

wmplayer.exe

Means that AutoA2DP will launch wmplayer.exe after BTH Headset paired.

You can edit this line with other application,for example,to launch TCPMP,you can replace words with this line:
\Storage Card\TCPMP\PLAYER.EXE

If you want launch nothing,you can delete AutoA2DP.ini


Update log:
The "Semi-Auto" version released.
Download AutoA2DP_with_Confirm.zip if you want to confirm manual(After 30 seconds it will quit as "Cancel" in silent).
The another version will set to A2DP mode automaticlly.
attachment.php


Installation:
1.Copy AutoA2DP.exe to \Windows folder
2.If you want it launch application automaticlly,edit text file "AutoA2DP.ini" to write your application file name(e.g,wmplayer.exe) and copy it to \Windows folder.
3.Run it,or run install.lnk instead,it will install in silent,NO MSG SHOW,after that you will find [HKEY_LOCAL_MACHINE\System\Notifications\AutoA2DP_by_xiaojin1985] entry in Registry.

attachment.php


Usage:
Open a paired Bluetooth Headset in range,it will toggle to A2DP mode automaticlly,you can see that musical icon appear in Titlebar.
attachment.php


Uninstallation:
Run AutoA2DP.exe with parameter "-u"(AutoA2DP.exe -u),or run uninstall.lnk instead.
attachment.php


Enjoy!:D

Donation:
Click my signature for buying me a beer,thank you for your good intentions.:D
 

Attachments

  • a2dp.jpg
    a2dp.jpg
    37.2 KB · Views: 8,786
  • inst.jpg
    inst.jpg
    35.6 KB · Views: 8,729
  • uninst.jpg
    uninst.jpg
    34.1 KB · Views: 8,615
  • AutoA2DP.zip
    3.9 KB · Views: 2,679
  • AutoA2DP_with_confirm.zip
    4 KB · Views: 1,027
  • AutoA2DP_conf.jpg
    AutoA2DP_conf.jpg
    69.3 KB · Views: 8,036
Last edited:

Oweida

Senior Member
Apr 28, 2007
720
587
Riyadh
:( it does'nt work

I copied the file to the windows directory and clicked on it ,, the registery showed up but it didn't work when I paired my BT headset with my PPC.

I use WM6.5 rom and regarding the music icon I do have another on in the same place for BT when I turn it on !!

plz help
 

xiaojin1985

Senior Member
Mar 15, 2009
658
0
Nanning
hi.baidu.com
I copied the file to the windows directory and clicked on it ,, the registery showed up but it didn't work when I paired my BT headset with my PPC.

I use WM6.5 rom and regarding the music icon I do have another on in the same place for BT when I turn it on !!

plz help
oops...I tested it with WM6.1,Cotulla's ROM,Magician.

Here are 2 debug app for you.

First pair your BTH headset and run CheckConnected.exe,a Message Box will show out to tell you current status,what it say?"Nothing"/"Handsfree Connected"/"A2DP Connected"?

Second,set your BTH headset as Wireless Stereo,run CheckConnected.exe again,what it say now?

Third,run ToggleA2DP.exe,can it switch your BTH headset between Wireless Stereo and Handsfree?

I don't have WM6.5 environment so I don't know whether the bth_sign is changed or not...
 

Attachments

  • Debug.zip
    4.7 KB · Views: 201

Oweida

Senior Member
Apr 28, 2007
720
587
Riyadh
thanx for the reply

it says handsfree connected !

how can I pair it to be wirless connected :confused:

Anyhow ,, I'm using BTaudio , it's a manual app to get stereo work !
But I need you to help me in making the sound voume loader i,e, how can I raise the sound volume for my BT headset ?!


thanx bro
 
Last edited:

bakuryu883

Member
Apr 14, 2009
48
1
Awesome!!!!!!!thank u so much!im so frust of the connect manual everytime use my BH-503.thanKs!!!!!!!u make HTC use life easier!
 

ecoli

Member
Sep 30, 2007
48
3
oops...I tested it with WM6.1,Cotulla's ROM,Magician.

Here are 2 debug app for you.

First pair your BTH headset and run CheckConnected.exe,a Message Box will show out to tell you current status,what it say?"Nothing"/"Handsfree Connected"/"A2DP Connected"?

Second,set your BTH headset as Wireless Stereo,run CheckConnected.exe again,what it say now?

Third,run ToggleA2DP.exe,can it switch your BTH headset between Wireless Stereo and Handsfree?

I don't have WM6.5 environment so I don't know whether the bth_sign is changed or not...

It doesn't work with HTC Touch 3G
 

Robrecht

Senior Member
Apr 5, 2005
320
25
Antwerpen
www.dropbox.com
I would advise, after installing, to manually connect your headset in stereo mode once. That made it work for me.

I have 2 stereo BT devices, a headset and a speakerbox. Could it be that the tool only connects to the last one you used?

Anyhow, great tool, thanks!! There used to be others around like this, but they all needed to run in the background, consuming battery etc...
 

xiaojin1985

Senior Member
Mar 15, 2009
658
0
Nanning
hi.baidu.com
it says handsfree connected !

how can I pair it to be wirless connected :confused:

Anyhow ,, I'm using BTaudio , it's a manual app to get stereo work !
But I need you to help me in making the sound voume loader i,e, how can I raise the sound volume for my BT headset ?!


thanx bro
Always on "Handsfree connected"?

After you set it as Stereo,run this app again it say "Handsfree" also?

Can ToggleA2DP.exe switch to A2DP mode?
 

xiaojin1985

Senior Member
Mar 15, 2009
658
0
Nanning
hi.baidu.com
I use this Notification to get status:

On WM6.1 when a stereo headset connected,system report a SN_BLUETOOTHSTATEHANDSFERECONTROL_BITMASK,and then system start my app and set it to A2DP and quit.

DWORD GetA2DPStatus()
{
DWORD lpStatus = 0;
HRESULT hr;
hr = RegistryGetDWORD(HKEY_LOCAL_MACHINE,
TEXT("System\\State\\Hardware"),
TEXT("Bluetooth"),
&lpStatus);
if(SUCCEEDED(hr))
{
if(lpStatus & SN_BLUETOOTHSTATEA2DPCONNECTED_BITMASK){
return SN_BLUETOOTHSTATEA2DPCONNECTED_BITMASK;
}else if(lpStatus & SN_BLUETOOTHSTATEHANDSFERECONTROL_BITMASK){
return SN_BLUETOOTHSTATEHANDSFERECONTROL_BITMASK;
}else{
return lpStatus;
}
}else{
return 0;
}
}

So I want to find out a more common way,can someone export the value "Handsfree" and "Bluetooth" under [HKEY_LOCAL_MACHINE\System\State\Hardware] when your device at Normal,Handsfree,Stereo mode?I want to know if people connect their headset with system,"Handsfree" will change or not,on my device it changed to 1.
 

xiaojin1985

Senior Member
Mar 15, 2009
658
0
Nanning
hi.baidu.com
I have a question suddenly...

What kind of BT headset you use?I found that BTAudio is a tool that make Mono BT headset output sound....Only Stereo BT headset support A2DP...
 

Oweida

Senior Member
Apr 28, 2007
720
587
Riyadh
Don't know really

But I think it has A2DP ,,,

It is Micro Smart MS-905i

Wanna ask you about yours ,, in BT settings ,, what options it gives ,, handsfree only or with another thing ?!


BTW,, on that Registery Headset and handsfree both are 0 when not pairing and when pairing handsfree is only 1
 
Last edited:

chavonbravo

Senior Member
Jul 15, 2006
408
3
Maybe that's the way it actually is, but just looking at it seems like it has a typo. Shouldn't SN_BLUETOOTHSTATEHANDSFERECONTROL_BITMASK be SN_BLUETOOTHSTATEHANDSFREECONTROL_BITMASK?
 

agentdr8

Senior Member
Mar 4, 2007
3,648
1,896
Cowtown, CA
Works great with my Fuze and NRG's 3.0 ROM! I was using Teksoft's A2DPToggle, but that appears to have some conflicts with 6.5 and frequently locks it up. With your AutoA2DP my BCK-08 BT clip works flawlessly. Thanks!
 

melvynadam

Senior Member
Jan 21, 2006
196
0
Semi-AutoA2DP?

Any chance of a "Semi-Auto" mode? I use my bluetooth stereo headphones with my Lenovo notebook and my WM6 device. Ideally, when your util detects the headphones I'd like to see a popup notification similar to:

"Stereo headphones detected. Pair?"

(with yes/no buttons)

Is this possible?