[Spirit FM] mikereidis:
Dell Streak: If you have one and can help with testing of the speaker/headset switching, please try these:

If you can't understand half of what I'm saying, it may be best to leave this testing to someone with more ability... Someone(s) please speak up and test and let us know the results...

-----------------

This describes the tests for the less desired method, involving changing fm_hcitool :

AFAIK, nobody has ever gotten speaker/headset switching working without a reboot at least. Theoretically it might be impossible due to a bad design which might have resulted in Dell not advertising/making FM available.

Initially, back around July I think, people running my app had speaker only. Sometime around Sept or Oct, the opposite was happening: headset only.

The default seems to be headset. My earlier apps forced speaker via fm_hcitool. I learned later that this fm_hcitool was modified so it only supported speaker output. The original (now embedded in my app) in theory could select speaker or headset.

The original "proper" fm_hcitool is in my recent app releases at /data/data/com.mikersmicros.fm/files/fm_hcitool. It has md5sum 923841dc45be4166beb54c5e4bce589b .

The bad one that forces speaker output has md5sum bf44d89eee9792234da69d9b5d6c3527 . It can be found here if you REALLY need it: http://www.mediafire.com/file/9klncj...nly_fm_hcitool (Rename to fm_hcitool if you do the below.)

First, in general you should set Audio Method to Dell Streak.

If you set "Use fm_hcitool" in my app, it will use that for startup, shutdown and speaker/headset switching. If it finds fm_hcitool in the normal shell path, it will use that one. If you put the bad one in system/bin for example, with "Use fm_hcitool" it should force speaker output.

If you ensure there is no bad fm_hcitool in the path, the internal good one should be used and that will output to headset I believe.

"Use fm_hcitool" results in a requirement for BT to be on. AFAIK, you should be able to use the bad one and rename back and forth between for example: /system/bin/fm_hcitool and /system/bin/bad_saved_fm_hcitool, and then reboot to see a change.

It would be nice if somebody could try the above and see if it works. I can't do all this work by myself, without a device...

But I want to remove this "Use fm_hcitool" feature because I think it shouldn't be needed, and things are much better without it.

The above may be less desired, but it's possible it will work and the preferred methods won't.

-----------------

Preferred methods for possible headset/speaker switching:

Now that I've put tons of time into reverse engineering the mysterious fm_hcitool utility, I want to be rid of it and it's hassles, and use my own code.

So for all the tests below, make sure "Use fm_hcitool" is disabled, and ensure fm_hcitool is not in the path. The one internal to my app can be ignored; it doesn't matter.

While the app is running in any of the steps below feel free to hit mute/unmute and speaker/headset to see if anything can change. But when going to the next step or test on a app or phone restart, it is important to put the app in the preferred headset/speaker state (of one is specified) for the next startup.

This is because some setup may be non reversible without a reboot.

(1)

Since the Streak default seems to be headset, I would think it would work by setting Audio Method to None and ie NOT checked.

After setting config as above, and setting the app to use headset (a speaker icon shows) reboot and start my app and find out if audio goes to headset. Try mute/unmute. Try volume control.

(2)

The next step is to ensure sound is set to headphone and set Audio Method to Dell Streak. Then try speaker/headset switch to see if audio switches. Set to speaker, restart the app and try again. Ensure it's set to speaker and reboot and try again.

(3)

The last step involves using ssd from a shell or via the Debug button in the middle. Select Debug -> Dell Streak and select one of the 5 options, or:

Here are the ssd parameters for the shell

2 7 = Start Voice

2 8 = Stop Voice

2 9 = SPKR_PHONE_STEREO

2 10 = FM Speaker

2 11 = FM Headset

For example, do "Start Voice" by running:

adb shell /data/data/com.mikersmicros.fm/files/ssd 2 7

or just select Start Voice in the Streak debug menu.

IF no switching was achieved in (1) or (2), a last ditch effort might be made by semi-randomly triggering these 5 functions. Don't select the 6th - 10th options starting with FM Hcitool Headset and ending with fmh spkr.

For some ideas, the good fm_hcitool does this at startup:

Stop Voice

Start Voice

FM Headset

or:

adb shell /data/data/com.mikersmicros.fm/files/ssd 2 8

adb shell /data/data/com.mikersmicros.fm/files/ssd 2 7

adb shell /data/data/com.mikersmicros.fm/files/ssd 2 11

The bad one is the same except the last is "FM Speaker" (ssd 2 10) instead of FM Headset"

The good fm_hcitool does this for headset (same as above except a new number 1 and 2 are added):

Stop Voice

SPKR_PHONE_STEREO

Stop Voice

Start Voice

FM Headset

or:

adb shell /data/data/com.mikersmicros.fm/files/ssd 2 8

adb shell /data/data/com.mikersmicros.fm/files/ssd 2 9

adb shell /data/data/com.mikersmicros.fm/files/ssd 2 8

adb shell /data/data/com.mikersmicros.fm/files/ssd 2 7

adb shell /data/data/com.mikersmicros.fm/files/ssd 2 11

And of course for speaker the above changes on the last line to "FM Speaker" (ssd 2 10).

I hope you Dell Streak owners can help me figure this out. Otherwise, we just have to live with it unless and until a breakthrough happens...