- Code: Select all
a2dp.exe -a2dp:1
Is this by intent? Can a third command-line option be added to do this?
Thanks!
Moderators: Teksoft, Sn0wflake
a2dp.exe -a2dp:1
Doodle wrote:I also suffer from a very high power consumption, which unfortunately makes the software useless. After disabling the software in Today the power consumption returns to normal

tazmanic2 wrote:It's a nice piece of software, however, i got one little problem:
I use car bluetooth and a sony headset.
Only the first device (in this situation car-BT)will connect as headset. To use the other device as headset, i have to switch the list in the bluetooth settingslist section.
In de second device:Stereo sound is ok! But incoming calls don't make contact with the headset anymore. I also use speakerphone and use mostly the autoanswer button in the middle, when i'm also using"toggle".

PiperD wrote:Hi - I've got Pocket Player set to start by A2DP. However I prefer using the command-line options to control a2dp.exe (with WM5NewMenu). Pocket Player isn't started when I issue thecommand, but it is started if I use the Today plug-in.
- Code: Select all
a2dp.exe -a2dp:1
Is this by intent? Can a third command-line option be added to do this?
Thanks!

joelcottrell wrote:Hi radhoo. Great work on your A2DP Toggle program; love it and keep up the good work. I have one question i hope you can answer or steer me in the direction to. I have a bluetooth headset that when I turn it on, I have to go to Settings/Bluetooth/ and select my headset and select wireless stereo. your program has solve this for me so i only have to hit play to start A2DP, but I was wondering if there was some sort of registry key/command/tool I can run to have the selection of "Wireless Stereo" constantly poll in the background so when I turn on my headset the phone can automatically start A2DP (since its constantly being selected in the background) instead of hitting play from your program? Battery drain is not a concern, Thanks!


radhoo wrote:Doodle wrote:I also suffer from a very high power consumption, which unfortunately makes the software useless. After disabling the software in Today the power consumption returns to normal
I see. It is not yet optimized, might use too much power.







a2dp.exe -a2dp:on a2dp.exe -a2dp:off a2dp.exe -a2dp:toggle 
This would be a great and very useful addition. Any plans to update radhoo?Codenix wrote:Hi There,
Thank you so much for this nice tool - it has certainly simplified my life, especially since I use several AD2P audio devices with my Dopod 838pro (WM6).
I have a suggestion as to a further enhancement however.
Would it be possible to add an additional command-line switch to 'toggle' the AD2P status?
I am aware that the today plugin does this, but for those who wish to map buttons to AD2P Toggle, they have to use two separate .lnk shortcuts - the first using theswitch to activate, and the second using the
- Code: Select all
a2dp.exe -a2dp:onswitch to deactivate AD2P.
- Code: Select all
a2dp.exe -a2dp:off
An additional switch such aswould first check the AD2P status, and if currently off, turn it on, or if currently on, turn it off. This would allow us to use one hardware button to simply 'toggle' our AD2P status, in much the same way as the Today Screen plugin does.
- Code: Select all
a2dp.exe -a2dp:toggle
I could achieve this using a mortscript, but this is a less elegant approach.
Thanks again for the nice tool.
Codenix.


Thanks for replying. Yes this could be easily accomplished with a mortscript or application that sets a flag when you run it as you describe. What Codenix was suggesting and what I would like is a toggle option that rather than just setting a flag, would detect whether or not a2dp is currently in use. If it detects a connection close it, and if there is no connection attempt to establish one.radhoo wrote:Yes, unfortunately too little time for all.
I'm also preparing for a holiday so it will have to wait until I return.
But the task itself should be easy, maybe someone volunteers to write a code (a2dp-tool.exe) that:
1. uses a registry flag , that initially is 0
2. when a user starts a2dp-tool.exe, the program looks for the flag.
if it's 0, it modifies the flag to 1, and starts a2dp.exe -a2dp:on
3. if the flag is 1, it changes it to 0, and starts a2dp.exe -a2dp:off
Radu


Thanks. I edited my post before I saw your reply. I would be happy to code this if you have other projects to work on. A quick tip on which function to use to check the status would be great.radhoo wrote:Hm, technical details, we'd better have this chat in the development section![]()
WODM_OPEN_CLOSE_A2DP goes to the a2dp audio driver, usually named "Bluetooth Advanced Audio Output"
This driver handles the message by starting a thread that opens the A2DP Connection. In a similar way it handles the opposite operation - closing the audio over bt.
This driver also has a status variable, I believe checking its status is what you actually need.
So I'll try to offer an interface to the A2DP Status, or at least implement this functionality in a2dp toggle.

#define AUDIO_DRIVER_NAME TEXT("Audio Output")
#define BLUETOOTH_AUDIO_DRIVER_NAME TEXT("Bluetooth Advanced Audio Output")
// Audio driver message for BT audio control
#define WODM_BT_SCO_AUDIO_CONTROL 500
#define WODM_OPEN_CLOSE_A2DP 517
#define WODM_PARAM_OPENASYNC_A2DP 2
#define WODM_PARAM_OPEN_A2DP 1
#define WODM_PARAM_CLOSE_A2DP 0
// WODM Messages
#define IOCTL_WAV_MESSAGE 0x1D000C
typedef struct
{
UINT uDeviceId;
UINT uMsg;
DWORD dwUser;
DWORD dwParam1; // Specifies the first message parameter. Dependent on message type.
DWORD dwParam2; // Specifies the second message parameter. Dependent on message type.
} MMDRV_MESSAGE_PARAMS;
class A2DP_Toggle
{
public:
int idWAVE_Audio;
int idWAVE_BTAudio;
A2DP_Toggle()
{
idWAVE_Audio = -1;
idWAVE_BTAudio = -1;
}
bool InitWaveDevice();
bool RouteA2DP(bool bEnabled);
};
bool A2DP_Toggle::InitWaveDevice()
{
WAVEOUTCAPS hWOC = {0};
// Get number of WAVE DEVICES
UINT nNumDevs = waveOutGetNumDevs();
// Check them!
if (nNumDevs == 0) return 0;
bool res = 0;
for(UINT devid = 0; devid < nNumDevs; devid++)
{
if (devid == nNumDevs)
// Error, no free devices found
{
res = 0;
break;
}
if (waveOutGetDevCaps(devid,&hWOC,sizeof(hWOC)) == MMSYSERR_NOERROR)
// Usable device found, stop searching
{
if (_tcscmp(hWOC.szPname, AUDIO_DRIVER_NAME) == 0)
{ idWAVE_Audio = devid; res = 1; }
if (_tcscmp(hWOC.szPname, BLUETOOTH_AUDIO_DRIVER_NAME) == 0)
{ idWAVE_BTAudio = devid; res = 1; }
}
}
return res;
}
bool A2DP_Toggle::RouteA2DP(bool bEnabled)
{
if (idWAVE_BTAudio == -1) return 0;
MMRESULT res = waveOutMessage((HWAVEOUT)idWAVE_BTAudio,
WODM_OPEN_CLOSE_A2DP,
bEnabled ? WODM_PARAM_OPEN_A2DP : WODM_PARAM_CLOSE_A2DP,
NULL);
return (res == MMSYSERR_NOERROR);
}

Thank you very much. I hope to have a working solution tonight (assuming I am able to get Visual Studio to cooperate; device emulator refuses to run, but I'll be doing all testing on my device anyway). Enjoy your holiday!radhoo wrote:I need more time then I currently have, for going deep in the A2DP Audio driver, but I will do it after my holidays.
Meanwhile, here is a little code I'm using in A2DP Toggle. Might prove useful to your tests:
- Code: Select all
#define AUDIO_DRIVER_NAME TEXT("Audio Output")
#define BLUETOOTH_AUDIO_DRIVER_NAME TEXT("Bluetooth Advanced Audio Output")
// Audio driver message for BT audio control
#define WODM_BT_SCO_AUDIO_CONTROL 500
#define WODM_OPEN_CLOSE_A2DP 517
#define WODM_PARAM_OPENASYNC_A2DP 2
#define WODM_PARAM_OPEN_A2DP 1
#define WODM_PARAM_CLOSE_A2DP 0
// WODM Messages
#define IOCTL_WAV_MESSAGE 0x1D000C
typedef struct
{
UINT uDeviceId;
UINT uMsg;
DWORD dwUser;
DWORD dwParam1; // Specifies the first message parameter. Dependent on message type.
DWORD dwParam2; // Specifies the second message parameter. Dependent on message type.
} MMDRV_MESSAGE_PARAMS;
class A2DP_Toggle
{
public:
int idWAVE_Audio;
int idWAVE_BTAudio;
A2DP_Toggle()
{
idWAVE_Audio = -1;
idWAVE_BTAudio = -1;
}
bool InitWaveDevice();
bool RouteA2DP(bool bEnabled);
};
bool A2DP_Toggle::InitWaveDevice()
{
WAVEOUTCAPS hWOC = {0};
// Get number of WAVE DEVICES
UINT nNumDevs = waveOutGetNumDevs();
// Check them!
if (nNumDevs == 0) return 0;
bool res = 0;
for(UINT devid = 0; devid < nNumDevs; devid++)
{
if (devid == nNumDevs)
// Error, no free devices found
{
res = 0;
break;
}
if (waveOutGetDevCaps(devid,&hWOC,sizeof(hWOC)) == MMSYSERR_NOERROR)
// Usable device found, stop searching
{
if (_tcscmp(hWOC.szPname, AUDIO_DRIVER_NAME) == 0)
{ idWAVE_Audio = devid; res = 1; }
if (_tcscmp(hWOC.szPname, BLUETOOTH_AUDIO_DRIVER_NAME) == 0)
{ idWAVE_BTAudio = devid; res = 1; }
}
}
return res;
}
bool A2DP_Toggle::RouteA2DP(bool bEnabled)
{
if (idWAVE_BTAudio == -1) return 0;
MMRESULT res = waveOutMessage((HWAVEOUT)idWAVE_BTAudio,
WODM_OPEN_CLOSE_A2DP,
bEnabled ? WODM_PARAM_OPEN_A2DP : WODM_PARAM_CLOSE_A2DP,
NULL);
return (res == MMSYSERR_NOERROR);
}

JKingGrim wrote:I just posted the app I wrote but it is being held for using forbidden words? I had the same problem trying to send a PM. Whats up with that? Anyway, when it gets approved, my app will show up. Thanks for the help.



JKingGrim wrote:Here is a link to the source:



george759 wrote:On August 14 I submitted a post, which was going to be held for "approval", and since then nothing. Any problem ??

george759 wrote:I own an HTC TYTN II, and I have installed your program which runs pretty
good, but I have two remarks.
One of them and which has been mentioned in quite a few posts, is the
problem with the battery ( discharges very fast when your program has been
activated). It was mentioned by Radhoo that it was going to be taken care
of, but probably not yet...
The second is that the buttons (the green arrow and the red square) cannot
be distinguished if they are "on" or "off" by just looking at the device.
What about, if you design them to appear as "shady" -when not active- and
the other one as "bright"- when active- and vice versa.
Kindly inform me of your plans.

macdo wrote:Hi I'm Martin from Chile.
Today I installed the A2DPToggle.signed.arm.cab version, but I can't see the plugin in my Today Screen despite I can and run the A2Dpt settings under System/settings...
Ive been reading all the threads and I'm affraid about the enegy drain, r u working on fixing it?
Thanks in advance.

Users browsing this forum: No registered users and 2 guests