yashsingh1/xdaforums huggingface dataset:
[Spirit FM] mikereidis:
Stereo indication was disabled because it was going on and off and annoying some people,

and I can understand that. I think I will implement a solution where it only updates once a minute or so, based on what the state was the majority of the time.

Perhaps a configuration option would be useful.
[Spirit FM] rollon76:
In what version do you have a stereo indication? I need it for testing.
[Spirit FM] fernandodistinto:
Hi, I own a motorola atrix wich has a BCM4329 802.11n Wi-Fi, Bluetooth 2.1, and FM tunner; but since I can't put CM on the phone, I would like to know if I can install manually all the bins/libs I need to make it work.

Thanks
[Spirit FM] mikereidis:
v2.0.4 : https://docs.google.com/leaf?id=0B7...lkZGMtZGQxZjQ2NzE5NGRl&hl=en&authkey=CKao-N4I

But be warned of several known bugs, including FM not being muted when a phone call or ringing is in progress,

To all:

Wow, suddenly the install rate for my app has gone way up. Perhaps my app was mentioned in an article/blog somewhere. It went from an almost constant 50 active installs per day the first week, to 150 Sunday and 400 Monday. Active means it wasn't removed. I'm getting bombarded with communications now, so I'll have to write a FAQ and be briefer with my responses.
[Spirit FM] mikereidis:
Hi. The main requirement for my app at this time is a working hcitool command. I you could run from adb shell or terminal emulator "hcitool cmd 4 1" and it gives you 12+ bytes of output on the last line, then it might work.

Manually trying to install different bluetooth components is a very difficult task probably best left to ROM "chefs". So far, my own attempts to do this have been unsuccesful.
[Spirit FM] CR5N:
Ran the command:

With Bluetooth off

$hcitool cmd 4 1

< HCI Command: ogf 0x04, ocf 0x0001, plen 0

Send failed: File descriptor in bad state

And then Bluetooth on

$ hcitool cmd 4 1

< HCI Command: ogf 0x04, ocf 0x0001, plen 0

> HCI Event: 0x0e plen 12

01 01 10 00 04 F0 02 04 0F 00 17 42

This mean it is only an audio routing issue as you stated earlier?
[Spirit FM] mikereidis:
Yes, from your previous posts we've already established that only an audio routing issue remains.

So we need to find some kind of "magic trick" that will enable the FM radio audio path. As a plus, finding this trick will likely solved the audio routing issues for a number of other devices using the same audio system.

So the HD2 is a Win Mobile phone with some unofficial Android ports. From my notes, the Leo/HD2 has an official CM port and it supports the CM radio. So if we look through the CM source. we will likely figure out this "trick".

On my Legend, the trick turned out to be sending an ioctl to /dev/msm_snd. Once I learned that, Aliba was able to integrate it into CM and, along with my TI FM chip findings, CM was able to support more devices with the CM FM app.

I created a small utility, "snd_set_device", named after the magic API, that was able to do this trick, before CM integrated it into their FM audio routing code. That's pretty much what the "fm_su" file enables. (And I see you discovered fm1, :) )

So, now that I know CM has the FM app working, I'm now confident that we can find the needed trick without too much trouble, I'm currently being pulled 6 ways from Sunday, but I'll try to look at this tonight.

EDIT: I'm looking at the CM7 source and the good stuff is in hardware/msm7k/libaudio-qsd8k/AudioHardware.cpp . There a device /dev/msm_audio_ctl that we have to send Ioctls to. I'll try to whip up a utility tonight to do that. Fortunately, my DHD has the same device so I should be able to test.
[Spirit FM] mikereidis:
For those with no audio, but you have root access and other things (signal strength, RDS) are working:

Here is a test utility that will hopefully enable audio on qsd8k / 8250 chips contained on such devices as the HTC HD2: https://docs.google.com/leaf?id=0B7...E1MzUtMzA4NmRkY2JlNzg2&hl=en&authkey=CJax0pQI

And in zip format: https://docs.google.com/leaf?id=0B7...E4ZDQtNDBhNmViYzA0MDI3&hl=en&authkey=CNuY9uoH

I tried this on my Desire HD but it didn't work as this phone has a different chip. The code is based on code in CyanogenMod.

Copy ssd somewhere you can run it, for example /system/bin :

adb remount

adb push ssd /system/bin/ssd

adb shell chmod 777 /system/bin/ssd

Or with some temp root:

adb push ssd /data/local/tmp/ssd

adb shell chmod 777 /data/local/tmp/ssd

Now run with a parameter from 1 to 6:

a ssd 1

OR

a /data/local/tmp/ssd 1

If you get "Error opening device" you MIGHT try adding another parameter with an alternative device name to the default /dev/msm_audio_ctl . Look in /dev directory for alternative device names. For example, on my DHD I tried (but it didn't work):

adb shell /data/local/tmp/ssd 1 /dev/msm_audio_dev_ctrl

Parameter choices:

1 = Start FM

2 = Stop FM

3 = Set mid volume

4 = FM Headset

5 = FM Speaker

6 = Headset mic input

I'm not sure exactly what commands might be needed or in what order. I would try:

ssd 1

ssd 5

ssd 3

6 is just for input and probably isn't needed. It DOES however offer the tantalising prospect of FM recording on some devices.

Any audio reconfiguration on the device, like a phone call or music app, will likely turn off the FM audio path, or may not and audio might be mixed.

If this works for anybody I can incorporate it into my app (root required) as I did for the Legend. Ultimately the best solution is one supported by the ROM.

I will look through the CM source for other tricks on other chips. Hopefully most of the "No audio but otherwise works" problems can be solved.
[Spirit FM] 4silvertooth:
I am in India and selected India as regional band. If i select north America I can't select my frequency as it would be in steps of 200 kHz. We have 100 kHz steps here.
[Spirit FM] mikereidis:
Hi 4silvertooth,

That shouldn't be a problem. With any band you can still manually enter any frequency the hardware support.

I'm set to North America and I can set 100 or even 100.001
[Spirit FM] prototype22:
They Fix it by only replacing the speaker

works fine now

Inviato dal mio GT-I9000 usando Tapatalk
[Spirit FM] mikereidis:
Thanks. I had concerns a chip may have overheated and been damaged.

Replacing a speaker should be much easier and less expensive.

Now why might it happen ? Too much volume or bass for the speaker might be an issue. Or there's this thing called a "DC servo" that might put a constant current through the speaker.

But the above would perhaps be a result of the WM8994 audio chip registers getting set to bad values by the MIUI audio library and/or kernel driver. This problem clearly doesn't happen on stock devices (AFAIK), and so far I don't think there are any such reports on CM.
[Spirit FM] mikereidis:
Thanks. The "logcat" part that is most useful was missing. Are you able to run commands from adb shell on a connected PC ? Or perhaps through a "terminal" app ? If so, you could do this:

cd /sdcard

logcat > lc

Then try to start the app, and 15 seconds after it fails you can type Control-C to stop the logcat. Then send me the "lc" file on the SDCard.

While you are at a command line, this may help:

chmod 666 /dev/ttyHS0

My app does this itself, but from your log it doesn't appear to work.

I can see you have the Broadcom BT stack (needed for the HTC FM app). So my app needs Bluetooth off.

If/when we get past the "Compatible chip" issue, we may have an audio issue, but it is likely fixable, or may work as is with the HTC audio method.
[Spirit FM] qriozum:
Thank you.

Mike, I sent you logcat from the console, and additionally logcat osttniej test version of the application of 01oct.

Regards

q.
[Spirit FM] alflying:
first of all thanks mike for the continuous development of a great app! finally i can listen to my beloved fm shows on my galaxys w/ miui rom(using the latest 1.9.30 rom).

i've discovered a bug though, and many in the miui forum are experiencing the same issue. after i close the spirit fm app and pick up a call, the other party can hear my voice but not the other way around, i can't hear anything.

i think this is something that you can fix, a proper shut down/channel reset? something along this idea i guess.
[Spirit FM] bigalfy:
FM Radio with Htc Hd2 (Nand V2.2.1)

Hello,

No way to find the FM chip on my Htc Hd2 with Nand Ext V2.2.1

Here is the Debug information :
[Spirit FM] icke:
Try qsd8250...working well on typhoon roms.;)
[Spirit FM] bigalfy:
FM Radio and BlueTooth

The only way to let the software work is to switch on BlueTooth !

On my HTC HD2, I have now FM Radio with Spirit FM Radio :D

Thanks...
[Spirit FM] mikereidis:
EDIT: Sent you a test version.

Thanks, I see the problem.

My main code sees a Broadcom device, but another part get's confused because of a TI firmware file.

If you had adb shell on a PC I'd advise these commands:

adb remount

adb shell mv /system/etc/firmware/fmc_init_1273.2.bts /system/etc/firmware/fmc_init_1273.2.bts.orig

Or if you could otherwise remount /system and don't need the file:

rm /system/etc/firmware/fmc_init_1273.2.bts

I'll find a code solution and let you know when a new version is ready. I think an option to force a chip type, and one for bluetooth behaviour would be good.

And yes, on your ROM this will only work with Bluetooth off.

BTW, your ROM has 2 Broadcom "Init" files:

/system/etc/firmware/BCM4329B1_002.002.023.0589.0632.hcd

and

/system/etc/firmware/BCM4329B1_002.002.023.0511.0538.hcd

It only needs one, I'm not sure which it's configured for. My app sees the first, because it's listed in the directory first, which is OK in this case as 589 is likely more recent and better than 511.
[Spirit FM] mikereidis:
Thanks for your report.

I'll be able to experiment and see if I can find a solution as soon as I can get a working baseband on my Galaxy S.

EDIT: I can get the KC1 or KG3 basebands I need to work with my Canadian GT-i9000m.

But I CAN'T get them to work on CM or MIUI. If anyone can guide me I posted a question at http://xdaforums.com/showthread.php?p=18077743

I DO seem to be seeing the same problem on the Darky ROM though, when a call comes in while the radio is playing. Perhaps if I can solve that...

Also, music doesn't work after FM ? So perhaps it's a general audio problem not specific to voice calls ? But a pause/play on the Music player restores it. Perhaps this would fix voice calls too.
[Spirit FM] mikereidis:
Thanks, I wonder if you have the same problem as qriozum...

I'd need to see your logs to help better though.

The Sept 30 and Oct 1 test versions allows sending logs through Menu -> Help -> EM Logs. Can you try that ?

------

Thanks icke, but we need to get rid of the "Compatible FM Chip not found" message before we get into Audio Methods.
[Spirit FM] mikereidis:
Good... But I hope we can do better and get it working for you with Bluetooth off.

Can you start it with Bluetooth off, and assuming it fails, send me the logs ?

With the latest version at: http://www.mediafire.com/file/7e6xml6bgerzlm3/Spirit_FM_Radio_v111001.apk

you can select Menu -> Help -> EM Logs and and wait a few seconds, then press Send in the email client and hopefully it will go through to me.
[Spirit FM] qriozum:
Great job Mike!

The application now runs on ROM Vision-RunnyMede :))))

I have two questions:

1.

If you pay for the full version of the application, then I can update it for new versions of the market? The point is whether this version of what just sent me a special, whether future versions of SpitiFMRadio posted in the store - will no longer work in this ROM?

Wait what wilt answer me, and then pays a paid version:)

2.

I do not know how to lower or increase the volume of sound in the headphones: (Adjust the volume button does not respond, and enter a value other than 100 in the settings of the application also does not make any difference. I'll have to read the whole thread on the forum:)

Thank you again for the work in enabling the application to the ROM Vision Runny-Mede :)

Regards

q.
[Spirit FM] gorast358:
I have the same bug on dell streak with stock rom . And after i close the spirit radio i loose volume control when i start app second time .
[Spirit FM] mikereidis:
Great ! I love success reports... :)

Yes, the version I sent you can be unlocked with the August 2nd unlocker, same as for any version on the Market or posted in this thread since Aug. 2.

Upgrading keeps the unlocked state. The only re-unlock needed is if the app is freshly installed, completely removed or the app data has been reset.

Don't worry about reading the whole thread. :D

When you adjust via the hardware volume buttons, does the Android "Media Volume" indicator appear on screen ? If it says "Ringer Volume", try pause/play and speaker/headset twice to see if it goes to "Media Volume".

There are lots of volume "tricks" to try in the latest versions. Let me know...
[Spirit FM] mikereidis:
I haven't forgotten the Streak... Been working on generic audio issues, but we may need some Streak specific fixes.

The underlying cause may be more or less the same on Streak and Galaxy S with MIUI.

For both, I have a way to turn on FM to speaker or headset (albeit with issues on Streak.) But on both I also have no way at present to turn off the FM audio path.

The ALSA driver on Galaxy S provides an FM off function in theory, but in practice it doesn't work. For Streak, fm_hcitool doesn't provide an off method either.

I'm thinking/hoping I can just find a way to reset the audio back to the boot-up state.
[Spirit FM] qriozum:
Yes, when you turn down the sound level keys, the system displays the rate and theoretically reduces the progress bar, but the sound remains at the same level (very loud).

Pressing the start / pause or headphone / speaker does not give any result.

Perhaps this restriction trial version?

I will be very grateful for the suggestions.

regards

q.
[Spirit FM] gouthamsn:
So end of road for Nexus S? :(
[Spirit FM] mikereidis:
Yes. End of road. Google cheaped out. Unless you're very handy modifying the hardware...

It's a dev phone and no dev has enabled FM likely because it's not possible.

My Galaxy S is almost identical (except it has an SL FM chip). I've tried to get FM out of the BCM4329 that the Nexus S shares.

I even got a direct to Bluetooth headset mode going that doesn't need a wired audio path. Nothing, not even FM static.

The RSSI registers do the same jumping as those other phones that likely have the FM power pins disconnected.
[Spirit FM] mikereidis:
No, absolutely not. I wouldn't restrict something like that and damage people's eardrums. :)

The easiest thing to try is to enable Settings -> Debug -> BCM 20780. This forces a mode that writes volume to a "F8" register. Restart the app after setting this.

EDIT: This likely won't help. Try my new version below and try using the "Volume Graphic" mode. Thanks....
[Spirit FM] mikereidis:
Here's a workaround: Set the output to speaker before you power FM off.

What I saw was that the phone audio tries to go to headset after FM is turned off. It does that even if the headset isn't plugged in at that time.

I'm trying to find a better solution but MIUI is a real challenge. I can pretty much reproduce the problems on CM, using the MIUI audio method.

But on CM it's easier to reset the audio by using the CM audio method or running the CM FM app. If CM does everything through ALSA, I guess I should be able to replicate what it does.
[Spirit FM] mikereidis:
Oct 4: http://www.mediafire.com/file/s45bgg7b0pdleu6/Spirit_FM_Radio_v111004.apk

- Some volume control adjustments on Broadcom chips.

- A new Menu option for "Volume Graphic" and "Frequency Graphic". This switches the mode of what is normally the graphic frequency selector/indicator to or from a "Volume" mode. Tap on 87.5 for 0 volume or 108 for 100% volume.

This isn't "clean" or free from visual defects, but provides an easy way to control volume if the volume buttons don't work, or if the ROM interferes.

- A workaround for Galaxy S MIUI ALSA that switches output to speaker and may allow hearing phone calls while on mute or after FM is off. Just a hack but it's working for me.
[Spirit FM] qriozum:
I installed the version from 04-10-2011 and here also was the problem with volume control: (

But the cleaned data applications (in management), ran i. ... appeared in volume control:)

After several restarts, again began to loudly play sound, so again, cleaned the data and then, as I changed some settings in the options - I did restart the application. And I realized that the reason for this was the inclusion of this option is: "BCM 20780".

Do not quite know how to use the "Volume graphic", despite the switch and pressing the "scroll" (next to the frequency) there is no volume control, scrolling is still only a band;)

But it's "pimple" ;)

BTW: once, in the store I bought unlocker to your application:)

Do you run a very good support and are communicative and solve problems "by hand".

greet

q.
[Spirit FM] gorast358:
And what solution for dell streak ? I can't switch to speaker .
[Spirit FM] mikereidis:
EDIT2: Now it's inexplicably working for this person. Whatever. :)

]EDIT: The turn off RDS workaround is confirmed to restore volume control. Now I have to find out why.

A helpful customer has reported lack of volume control on a Nexus One

with Miui 1.9.30. He "fixed" this by removing and re-installing the app, WITHOUT entering his unlock code.

Here's my response:

Problems that ONLY affect the unlocked app definitely get priority !

There's only one thing I can think of now that might cause this: RDS.

In the latest versions you can turn RDS off at Settings -> User Interface -> RDS.

It will only change if the app is unlocked. Restart the app after changing and if you can verify RDS is off, that's good.

The latest test version is here:

http://www.mediafire.com/file/s45bgg7b0pdleu6/Spirit_FM_Radio_v111004.apk

On this version you can select "Volume Graphic" and the graphic frequency indicator/control at top turns into a volume control, instead of frequency. This may help with testing.
[Spirit FM] mikereidis:
For volume issues, see my post above. Re-installing the app WITHOUT entering an unlock code (or turning off RDS) may be a solution.

For speaker control, I will spend today's just started work day combing through the Streak kernel code, the logs and responses I've gotten, and reverse engineer fm_hcitool as best as I can to try and figure this out.

Thanks !
[Spirit FM] mikereidis:
Sorry, it's a bit hard to understand you. Are you saying you got volume control working now ?

Yes, "BCM 20780" was very likely bad for you. And it might require an app restart or even a full phone reboot to clear the effects.

Don't understand "pimple". :)

The control is at the top. It has a light blue (cyan?) horizontal line and a red needle indicator. At left 90 and at right 105 (MHz).

Great ! :) I hope you won't have the unlocked volume control issue from my post above.
[Spirit FM] gorast358:
All stock roms for dell streak : http://xdaforums.com/wiki/index.php?title=Dell_Streak

I need speaker switch only because : " workaround: Set the output to speaker before you power FM off " . Bug with volume lost in call after i use spirit fm is very important for me !

I did try Re-installing the app WITHOUT entering an unlock code (or turning off RDS) but it didn't help .
[Spirit FM] mikereidis:
Speaker output is now confirmed to work again with CM7 on HTC Desire HD (and probably other devices). The "CyanogenModS" Audio Method is required on my Oct 1 or later releases.

Some of the CM7 audio libraries were changed to fix an FM related routing problem and that stopped speaker output in my app.

See:

http://review.cyanogenmod.com/#change,7511

http://review.cyanogenmod.com/#change,7522

I think these changes don't yet affect all "official CM" ROMs.
[Spirit FM] mikereidis:
Thanks, that's a good number of ROMs, plus all the custom ROMs.

I only have source for 3 stock kernels though: 112, 206 and 309, but I'd guess most are using the last. Also have coredog64 and DJSteve kernels.

I'm on it. Let's hope speaker and volume control fixes come in bunches. :)
[Spirit FM] hama2:
on market 3.1.5 (german) not new 01oct version found.

Only 26sep find.

Mike, the version 01oct works (Speaker) with cm7 on HTC Ace with settings

CyanogenMod and CyanogenmodS

greets
[Spirit FM] qriozum:
Thank you very much for clarifying how this mechanism works.

It's OK :))))

Thank you again for support and to address and resolve the problem with the operation of the ROM Runnymede.

regards

q.
[Spirit FM] mikereidis:
Greets. Thanks for your report.

Yes, I don't update the Market version until I feel the lastest test version will work OK on most devices.

Method CyanogenMod is better, a little faster and cleaner than the CyanogenmodS meant for Galaxy S. But the "S" version might fix any speaker problem.
[Spirit FM] mikereidis:
Oct 5: http://www.mediafire.com/file/kxks99s7tp09cd2/Spirit_FM_Radio_v111005.apk

Compared to Oct 4, this only contains changes to the "ssd" utility to test Dell Streak audio issues. It took a LOT of time to figure out what fm_hcitool is doing, but since even fm_hcitool doesn't work as we'd hoped, some experimentation will be needed.

Running these commands from a PC with adb shell available is best. A terminal app should work though by removing "adb shell" from the commands.

Install the Oct 5 version, and start it. It might be good to set Audio Method to something benign like "HTC". But "Dell Streak" might be better, or usable; I'm not sure.

The ssd utility takes 2 arguments. These are the 5 new ones to test Dell Streak:

2 7 # Start Voice

2 8 # Stop Voice

2 9 # Switch Device: SPKR_PHONE_STEREO

2 10 # Switch Device: FM Speaker

2 11 # Switch Device: FM Headset

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

Some info for reference:

#This is what "fm_hcitool 1" (Turn FM on) effectively does, after some Bluetooth and FM power stuff:

ssd 2 8 # Stop Voice

ssd 2 7 # Start Voice

sleep 1 # Pause 1 second

ssd 2 11 # Switch Device: FM Headset

#This is for "fm_hcitool 11" (Turn FM off):

ssd 2 8 # Stop Voice

sleep 1 # Pause 1 second

ssd 2 9 # Switch Device: SPKR_PHONE_STEREO

#This is "fm_hcitool 9 1" (Switch to FM Headset) (Same as off, followed by on above):

ssd 2 8 # Stop Voice

sleep 1 # Pause 1 second

ssd 2 9 # Switch Device: SPKR_PHONE_STEREO

ssd 2 8 # Stop Voice

ssd 2 7 # Start Voice

sleep 1 # Pause 1 second

ssd 2 11 # Switch Device: FM Headset

#This is "fm_hcitool 9 2" (Switch to FM Speaker) (Almost same as above except last switch):

ssd 2 8 # Stop Voice

sleep 1 # Pause 1 second

ssd 2 9 # Switch Device: SPKR_PHONE_STEREO

ssd 2 8 # Stop Voice

ssd 2 7 # Start Voice

sleep 1 # Pause 1 second

ssd 2 10 # Switch Device: FM Speaker

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

Now what to do ? The first thing I'd try is just the switch device commands. Here's the bare FM headset switch without all the other stuff:

(Everything after the # is just a comment. Don't copy or enter that, except on Linux etc. where it's benign.)

adb shell /data/data/com.mikersmicros.fm/files/ssd 2 11 # Switch Device: FM Headset

And for FM speaker:

adb shell /data/data/com.mikersmicros.fm/files/ssd 2 10 # Switch Device: FM Speaker

This may turn FM audio off, and allow switching with the above:

adb shell /data/data/com.mikersmicros.fm/files/ssd 2 9 # Switch Device: SPKR_PHONE_STEREO

Beyond this, you could try combinations of commands. I think "Start Voice" and "Stop Voice" refer to phone call audio support. The use of SPKR_PHONE_STEREO seems to be related and may be needed to allow normal phone call operation.

Please let me know... Thanks !
[Spirit FM] gorast358:
Nope . Didn't work . I did try combinations of commands . Also when i change orientation of the app

it loose volume control and sometimes stuck or fc .
[Spirit FM] mikereidis:
OK, thanks, I'm still at it. Maybe this new Oct 6 version will be "cleaner".