yashsingh1/xdaforums huggingface dataset:
[Spirit FM] xmguy:
Those "burst of static" may be an issue with the audio decoder for the FM chip. The mixing of signals seems like a tuner chip issue. It could also be multi-pathing with the signal if it's weak and another station on the same frequency is near by they are fighting for reception. FM_launch and FM_Launch2 SHOULD work. Honestly Try going to stock install Spirit FM. I'm running the latest GB .602 STOCK and Spirit works perfectly. Also see if local music will play though the speaker.

The signal no signal sounds like a short in the IC (chip) for the BT/WIFI/FM module. Maybe shorting out causing connection loss in the chip to the audio out decoder. Does it happen during warm/hot weather? Can you test a colder environment to see if this resolves it. Could also be a short in the antenna/headphone jack. See if wiggling the headphone plug causes the issue.
[Spirit FM] mikereidis:
Thanks.

The problem is identical on 2 separate DroidX's, so I think it may be due to:

1 - Some minor hardware difference in some units, or

2 - Some hardware problem both of his units have, or

3 - Some software setting, or

4 - Something changing in the latest nightlies for CM7.

If anyone else sees this "half second OK, half second no audio and repeat" problem on CM7 please let me know.
[Spirit FM] alekos panagulis:
Hi, yesterday i installed your amazing app on my SGS with CM7 nightly.

Today i noticed some strange and scary crackling and rustling noise from the speaker, even when Spirit FM was off. After unistalling your app the problem is gone.

Anywway thanks for your work.
[Spirit FM] FadeFx:
Did this crackling sound occure also when you didnt run spirit-fm after a reboot? Atm spirit-fm is not realy usable on sgs cm7 because it breaks completely the audio routing and only thing you can do is reboot, but then it should be ok again till u start spirit-fm again.

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

tapatalked
[Spirit FM] alekos panagulis:
The crackling occured even after rebooting without running Fm spirit.
[Spirit FM] alspecial2007:
galaxy tab P1000 no redio?
[Spirit FM] FadeFx:
Which kernel do u use?

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

tapatalked
[Spirit FM] mikereidis:
Thanks for your report.

Rebooting should be as good as an uninstall.

My app does NOT set itself up in any way to start itself at boot time, and it shouldn't change anything that survives a reboot.

If it still crackled after a reboot I'd suspect a hardware problem (And I very much hope that isn't happening). But uninstalling wouldn't fix a hardware problem.

With the above said, in the worlds of hardware and software, sometime very strange things can happen. If the audio chip got hot for example, a reboot might not fix a problem. But by the second or 3rd reboot, or after some other pause, the chip might cool down enough to work normally.

So at this time, I'd advise not using the speaker mode on Galaxy S.
[Spirit FM] mikereidis:
No, not as far as I know. If there is no stock FM app from Samsung, it's very unlikely FM can work.

On page 2 of this thread is my compatibility list: http://xdaforums.com/showpost.php?p=13380058&postcount=2

The original Galaxy Tab exhibited the "Jumping RSSI" problem (-128, 0, 16, 55, etc). AFAICT the newer Tabs are the same.
[Spirit FM] mikereidis:
v September 2:

http://www.mediafire.com/file/36t8yyq6k8n2d5e/Spirit_FM_Radio_v110902.apk

- Power up will not work unless a headset is plugged in as an antenna, unless the new User Interface setting for Antenna is set to "Optional". The default is "Require". A dialog with this info is shown if no headset is plugged in at power up.

- Settings are now organised in Submenus for Tuner, Audio, User Interface and Debug.

- Remove "all" Audio Method. Not really useful and can cause problems.

- Broadcom Stereo should now automatically "blend" between mono and stereo. It's not a hard switch, but a gradual blending between the full mono and stereo states, depending on signal strength or SNR.

Blending takes place when Output Mode is set to stereo. Setting to mono still forces mono mode. I might make this an option; last night when signals were weaker I noted an inability to receive anything in noticeable stereo, despite some signals being just above the edge of stereo possibility.

I hope this will eliminate the need to be able to set Mono on individual stations. TI FM chips have always been set like this, with no option to turn it off.

- Remove Google ads (But not my own "nags"). IMO It's not worth annoying so many people for 10 cents a day, LOL. Perhaps when rates rise before Christmas.

Now checking out my new $79 Galaxy 550... :)
[Spirit FM] denzel09:
I hope in you my friend

Last not work function in cm7 for s5570, so ..

;)
[Spirit FM] xmguy:
Cool update Mike.

Found a glitch. If the headphones are plugged in while the radio is running the pop up appears. If I press the OK button it disappears but the static remains and I cannot access the menu to change the require. Might suggest to allow power button or have radio fully shutdown when headphones removed.

Also As I was typing this I was testing the radio app with headphones in and a call came in AS app was starting up. I unplugged headphones and answered the call a burst of static came through the (rear) speaker then stopped. No audio came through earpiece from the call. Once I ended call static burst came though speaker again and stopped and popped up message about the antenna.
[Spirit FM] alekos panagulis:
I didnt use your app on the speaker. Il try to investigate more deeply and i'll let you know.
[Spirit FM] a66fm:
you still get the nag popup even with a headset plugged in :(
[Spirit FM] mikereidis:
But you can turn it off by setting Antenna to Optional, right ?

Which phone and ROM are you using ?

If you are able, I'd be interested in the results of running this command, with headphone jack inserted and without:

adb shell cat /sys/class/switch/h2w/state

Usually the output is "0" with no headphone, and 1 or 129 with a headphone.

I figured that some devices would have this problem. And it might happen if you are using a headset with a 3 connection jack, instead of the 4 connection jack that may have been included with the device.

Some people aren't aware a headphone wire is needed as the FM antenna, and think my app doesn't work. So I added this feature for the sake of those people.

Every other FM app I've seen requires a jack inserted. But most of those apps are stock apps running on devices that the manufacturer tested with their supplied headphones.
[Spirit FM] mikereidis:
Great ! Thank you.... :)
[Spirit FM] mikereidis:
I don't understand how this could happen, because the check is only done in the app pwr_on() function. Even with Antenna set to Require you can plug and unplug the antenna/headset at will and no "Need Headset Antenna" dialog should appear.

If my app gets killed and doesn't go through the normal power down, the FM audio usually continues. Then "returning" to my app will kill the audio briefly before re-powering. In this case a new pwr_on() is done and the dialog might appear.

If you can reproduce this, please right down the steps in enough detail that I can exactly replicate it. Is Antenna set to Require ? Is the app on screen and started/running with headphone jack not inserted ? Thanks !

OK, thanks. I guess you "lucked" into one of the race conditions that don't get too much thought. I will try to replicate this.
[Spirit FM] a66fm:
yes i can :-)

i get 0 and 130 on my htc desire z rooted 2.3.3 incertcoin rom
[Spirit FM] xmguy:
I'm sorry. I said the first error wrong. If I start the app with the headphones in then remove them with the app still running radio goes to static but antenna message does not appear. If I press power button to turn app off then antenna message appears. I press ok. But STATIC still remains. ONLY way to fix is to plug the headphones back in and allow the app to get signal the shut the app down manually. If the code for the headphone detect command is set to turn the app off or allow the power button to be pressed to turn the app off. So the static doesn't continue until headphones are put back in. Kinda like most of the OEM apps. The Motorola and even the HTC (when I had an HTC PHONE) if headphones are removed when the app is running then the fm radio turns fully off. So maybe add a ok to continue or exit to quit radio should be added to pop up message.
[Spirit FM] Shawns13:
Samsung Galaxy Gio GT-S5660M WORKS!!

Hey Mike... great app!

You are providing hope for us with a Samsung Galaxy Gio GT-S5660M that came with no FM radio function :) Using your app I was able to get FM radio to work, but not flawlessly.

1) Audio Method has to be set to "All."

2) Every time you exit and reload the program you have to toggle between "Regional Bands" to reinstate sound.

3) There is no volume control, even though it shows you manipulating "FM volume."

4) You can't toggle between speaker and headphone listening... you only get headphone listening.

5) You do not get sound when a SIM card is inserted.

I know you have a lot of phone models to modify this app for, as well as other things to do, but if you get a chance to work on the GT-S5660M a lot of us will be grateful!!

Thanks
[Spirit FM] mikereidis:
That's great ! Thanks for figuring this out... :)

I bought a GT-I5500M yesterday to figure out and fix the No Audio issues on several Galaxy 5 series devices. Your Gio 5660 seems to have the same components: a BCM20780 BT/FM chip and a MAX8899 Audio and power mgmt chip.

The 5660 service manual schematic clearly identifies that the FM function is intentional. Does the M mean a Canadian model ? I think Bell is intentionally killing FM functions to raise their data plan revenues.

I think you may have found the clues that will hopefully lead to working audio on all the similar Samsung devices. Subpsyke, Sfortier and I have been struggling to get audio working for some time.

I will quote the info you provided on the other thread:

Just yesterday I removed the apparently un-useful "All" Audio Method, LOL, so the latest version on MediaFire doesn't have it.

BTW, normally new users with under 10 posts can't post in this section. Perhaps they changed that ?
[Spirit FM] mikereidis:
Thanks ! For anyone interested there's some info on this pseudo-file here: /sys/class/switch/h2w/state

Values of 128 or higher indicates "35MM_HEADSET".

1 or 129 also indicates "HEADSET"

2 or 130 also indicates "HEADSET_NO_MIC"

But in reality 1 and 2 seem interchangeable.
[Spirit FM] mikereidis:
As expected and designed.

Very UN-expected and I can't reproduce this. The only check for antenna happens at power ON in the pwr_on() function.

There is no such check in the pwr_off() function.

So how this could happen I have no idea. If you can reproduce it a log would be great. Thanks !

I have some protection against this but hypothetically, a VERY quick double click on the power button could send OFF, then ON again before the app terminates. I've also had issues in the past with multiple UI instances being present (usually via clicking in Notifications screen), and that could confuse things.
[Spirit FM] xmguy:
I can't seem to replicate it either. However I get alot of FCs with the app while testing. As I was turning the app on and off and plugging in and unplugging the headphones. So I wouldn't look to much into that. If the issue happens again. Will send logs. I'll send what I have now
[Spirit FM] mikereidis:
Thanks, the log didn't attach for some reason, perhaps because I switched to /data/local/tmp/sprt_debug.txt from /sdcard/sprt_debug.txt .

What device is this with ?

I recall some libaudio or kernel code (from HTC?) with comments about fixing a bug when fast insertions ./ removals take place.

But there's some somewhat risky code in my function that gets called when headset jack state changes. I think I'll change it to code that just reads the h2w/state sysfs file on power up.

I'm reminded of the slow speed when using the media buttons. IMO, the slow reaction speed is an Android issue, but it can mess things up if the buttons are pressed a lot or held down.

This, or unusual wiring or bad cabling (which is common on headset cables since they move a lot) could also produce the 1/2 second audio and 1/2 second silence issue repeated that someone reported. Mutes and unmutes get queued up.
[Spirit FM] mark78x:
Hi, i've try this app on my Galaxy S Cm7 but now i've a serious problem with speaker....

**EDIT**

I've uninstalled the App, reboot and now fortunatly the speaker work...
[Spirit FM] mikereidis:
Thanks for your report. What ROM are you running, and what was the speaker problem ? Were you using the speaker mode or just headset ?

At this time the Galaxy S support is "experimental".

I know on Galnet MIUI ROM there are strange effects that result in very fast music play after running my app. Also there are reports for CM7 that phone call audio doesn't work after my app.

In order to restore normal functionality, a reboot should be the only thing required. Un-install shouldn't be necessary. It's possible though that there might be a chip heating issue that could be resolved after a 5-10 minute cooling period.
[Spirit FM] mikereidis:
Thanks for your PM. I'll presume you don't mind me sharing it above.

So you have a stock ROM rooted. That is what I have for the GT-I5500M, with Android 2.1/Eclair.

I tried to replicate your method with many variations without success. :( There are several things that seem strange:

- Having a SIM installed or not shouldn't make any difference. Anything is possible though.

- Changing the Regional Band also shouldn't make any difference, but it's possible this somehow "kick-starts" some needed FM registers. Let's see what it does on Broadcom chips:

Write register 1 to set band (Also resets some mono/stereo stuff)

Write register 5 to set emphasis (Also resets some audio enables)

Write register 0 to turn off RDS

Write register 2 to set RDS/RBDS standard

Write register 0 to turn on RDS

Register 5 is the only one I think could kickstart audio. It is also written when pressing Mute/Unmute, so perhaps this would work instead of changing band.

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

Setting Audio Method to All is likely to increase the amount of time it takes to switch audio around. It would be nice if you could find another Audio Method or two that works. You should be able to select them in sequence, and without leaving the Settings screen, you should hear audio after switching to a working mode.

There are some commands sent to the chip that are likely to create timeouts of 5-10 seconds. If you go into the Debug Settings and check "Debug BC MR 1 Off" and "Debug BC MR 2 Off", that should help. They are UNchecked by default.

Attempting to change volume may also have this timeout issue. On these devices there is a special register to set volume that doesn't work on some similar Broadcom based devices.

I'm not surprised Speaker output doesn't work for you. I AM surprised that you have any audio.

Can you try to send me your debug logs ? Press Menu and then "Email Logs". On many devices though, the log file doesn't attach properly, but it can be manually retrieved as /data/local/tmp/sprt_debug.txt (or /sdcard/sprt_debug.txt).

Thanks !
[Spirit FM] Shawns13:
Hi Mike,

I uninstalled and reinstalled the app to see if things would change... they did.

I now am able to get sound via the "SamsungDarky" and the "All" Audio Methods. However, now when I attempt to change the "FM volume" (even though it doesn't affect the sound output) it results in a loss of signal (strength falls to -128).

To regain sound, I am still required to toggle between Regional Bands.

Hopefully the debug logs I sent will be helpful!
[Spirit FM] mark78x:
Hi, at the moment I'm using CyanogenMod 7 Nightly #104...the problem was identified as a scratchy and distorted sound when i've tried music player or other app that use speaker...With headset the App work perfectly, no in speaker mode...
[Spirit FM] mikereidis:
Thanks !

Please don't use speaker mode until this is sorted out. There's been some concern about possible damage.

I will likely disable the speaker support in the next release until this is sorted out.
[Spirit FM] mikereidis:
Version September 4: http://www.mediafire.com/file/wzw86h6z3qh4xtl/Spirit_FM_Radio_v110904.apk

- Disables speaker mode for Galaxy S using Audio Method "SamsungCM7".

- Audio Method All is reinstated for now.

- 2 new Audio Methods:

GT-I5500

GT-S5660

These may fix or improve audio on several Samsung devices that use the BCM20780 FM/BT chip.

On my GT-I5500, starting the app/FM with Bluetooth ON results in a hard hang. Leave BT off.

Starting with other Audio Methods (such as when re-installed and default sfu_sdcs is set) can result in longer delays when starting, stopping or changing Audio Method. Just be patient for 30-50 seconds, and switch to SamsungDarky, GT-I5500 or GT-S5660.
[Spirit FM] mikereidis:
Try not to use All, SamsungDarky is preferrable. Darky is for a Galaxy S ROM that's close to stock, so it makes sense it might work on other Samsung devices.

Please try the new version using the Darky, GT-I5500 or GT-S5660 methods.
[Spirit FM] denzel09:
Hi, for gt s5570?
[Spirit FM] Shawns13:
Hey Mike,

I've completed testing the new version, and, CONGRATS!! You made it work for the GT-S5660M!!! (At least my GT-S5660M).

Using the GT-S5660 Audio Method I get complete functionality:

1) Instant audio following program initiation, even following phone reboot (i.e. no toggling between Regional Band).

2) Ability to adjust FM volume (visually AND physically).

3) Ability to play sound through headphones AND speakerphone.

4) FM functions even with insertion of my SIM card (I don't know if this was my phone specific or not).

The Darky Audio Method allowed for the same functionality, minus 3) Ability to play sound through headphones AND speakerphone. Sound only plays through headphones.

As for the GT-I5500 Audio Method, I wasn't able to get any sound following all my usual tricks.

Excellent job!
[Spirit FM] mikereidis:
It's working for Shawns13 on his GT-S5660, so maybe. It's not working on my GT-I5500 though.

Please try it. That's the only way to know for sure.

- Install the latest Sept, 4 version. http://www.mediafire.com/file/wzw86h6z3qh4xtl/Spirit_FM_Radio_v110904.apk

- Set the Audio Method to GT-S5660.

- Full cold reboot the phone.

- Ensure Bluetooth is OFF.

- Make sure headphones are inserted.

- Start my app.

- Make sure you are tuned to a strong station.

- If no sound then switch to the GT-I5500 Audio Method.

- If still no sound then switch to the SamsungDarky Audio Method.

- If still no sound then switch back to the GT-S5660 Audio Method.

- If still no sound you can try all the other Audio Methods, but they are less likely to work.

Let me know how it goes. If I can get it working on my device or subpsyche or sfortier can get it running on other Galaxy 5 series devices, then it will be more likely to work on yours.

Thanks !
[Spirit FM] mikereidis:
Wonderful ! Success reports make my day... :)

I look forward to seeing your name in my Unlocker customer list:

https://market.android.com/details?id=com.mikersmicros.fm_unlock

:D
[Spirit FM] denzel09:
Hi buddy. Nothing :(

App works well, no slow, RDS works also but nothing sound. Only a strange rustle.

Thanks ;)
[Spirit FM] mikereidis:
A strange rustle... There are several reports of a static noise here: http://www.madteam.co/forum/development/spirit-fm-radio-request-for-testing/

I can't imagine that's radio static if you can see the other functions working, like RSSI and RDS.

The 3 Audio Methods I recommended are more likely to work on stock, or stock derived ROMs. That's what I have now and what the person reporting success on a S5660 has.

On CyanogenMod the default Audio Method "sfu_sdcs" is most likely to work, at least on most other phones. I believe psyke83 added the support needed for this.

The problem with "sfu_sdcs" is that it doesn't disable some commands sent to the chip which cause problems on the BCM20780. The 3 methods (SamsungDarky, GT-S5660 and GT-I5500) DO disable those commands.

So I quickly added a mod for this with a Sept 5 version at: http://www.mediafire.com/file/9512cjj53ka9kmx/Spirit_FM_Radio_v110905.apk . With this version, you can keep or set the sfu_sdcs Audio Method (or others) as long as you check/enable the Menu -> Settings -> Debug ->Debug BC VolPoke Off setting.

On first startup, the intro screen can hang for a while, say 20 seconds. Be patient and hit Disable to proceed the easiest. Then set the Menu -> Settings -> Debug ->Debug BC VolPoke Off setting and reboot. Reboot may not be necessary but sometimes the chip gets messed up when the "VolPoke" commands get sent.

Here are the full, modified instructions:

- Install the latest Sept, 5 version. http://www.mediafire.com/file/9512cjj53ka9kmx/Spirit_FM_Radio_v110905.apk

- On startup, if you have the Intro screen, wait 20 seconds and hit Disable.

- Check/enable Menu -> Settings -> Debug ->Debug BC VolPoke Off

- Full cold reboot the phone.

- Ensure Bluetooth is OFF.

- Make sure headphones are inserted.

- Start my app.

- Make sure you are tuned to a strong station.

- If not already set, set the Audio Method to sfu_sdcs. (Menu -> Settings -> Audio -> Audio Method -> sfu_sdcs)

- Based on reports, the Audio Methods below likely won't work. But toggling Speaker/Headset and Mute/Unmute might produce results.

- If no sound then switch to the GT-I5500 Audio Method.

- If still no sound then switch to the GT-S5660 Audio Method.

- If still no sound then switch to the SamsungDarky Audio Method.

- If still no sound you can try all the other Audio Methods, but they are less likely to work.

Thanks !
[Spirit FM] denzel09:
No sound my friend, only rustle ....:(
[Spirit FM] mikereidis:
From nunobcm on the other thread:

No, sorry, this is an unresolved issue. Some things were tried with no success.

But I have an idea about what might fix this. I just added this to the code now, so you can try my next release.

Thanks !
[Spirit FM] FadeFx:
Mike, can't u just root the audio to the media channel on mixer?

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

tapatalked
[Spirit FM] clem_ita:
Hello!

I'm testing this app on my LG Optimus One running CM7 unofficial port by mik_os. It works very good, and I'm thinking about buying the unlocker on the market.

However, I have to report a small (but annoying) bug regarding the volume keys located on the side of my device. I searched the thread for a similar bug and found no results, maybe other devices are not affected... (or maybe I did not searched properly?!?)

When the app is open I can control the volume via the hardware buttons correctly. The problem arises when the app is running in background.. in this latter situation the volume keys does not control the "mutimedia app volume" as they should, but they control the "ringtone volume".

Volume keys behaves in the correct way if I have Musick app or CM7 radio app running in the background. So probably the problem is related to SpiritFM and not to the device/ROM.
[Spirit FM] denzel09:
Incredible, works on all phone but not on the s5570, ,, :D it seems a destiny joke :D btw i will continue to hope ;)
[Spirit FM] Quinny899:
It's due to the phone killing the app, cutting off music control for it. But the radio itself is a superuser command on / off. To solve it, try the loopy smoothness tweak and add it to it (com.mikersmicros.spiritfmradio I think)
[Spirit FM] mikereidis:
Huh ? Loopy smoothness tweak ? LOL. :)
[Spirit FM] mikereidis:
Yes, continue. :)

It's not working yet on my I5500M, stock or CM7, and I'm the dev.

Except for shawns' success report on the s5660 it's not yet working on any Galaxy 5 series, or similar Samsung phone with BCM20780 and MAX8899.

I'm reasonably sure we'll figure this out, at least for CM and/or stock.