yashsingh1/xdaforums huggingface dataset:
[Spirit FM] mikereidis:
Thanks ! As emailed:

Can you try, and send logs from the latest version here: http://www.mediafire.com/file/7cnuj12ul53uwzg/Spirit_FM_Radio_v120126.apk

Before installing and running the new version though, enable Settings->Debug->BC 20780/4330. This is needed on many newer phones with newer Broadcom chips.

There are some intriguing signs but don't get your hopes up much:

/system/bin/fmconfig

/system/lib/libfmradio_jni.so

/dev/msm_fm

And some controls in /dev/msm_audio_dev_ctrl and the ALSA driver. I'd love to find a phone where the :"fm_radio_tx" control is useful...
[Spirit FM] AAccount:
Thank you very much for your effort. As of now I am just waiting it out for CM9. I use FM all the time to listen to music. In your edit you mentioned you already have a solution?
[Spirit FM] mikereidis:
Yes, and <insert commercial message here>, "Please consider purchase support if you haven't already". :)

Jan 27 just for this issue: http://www.mediafire.com/file/82t5pxdm75id762/Spirit_FM_Radio_v120127.apk

It works OK on my Galaxy S with the Jan 16 "Team ICSSGS RC3.1", formerly known as OneCosmic ICS. Also on MIUI and other ROMs when using the Galaxy S ALSA audio method.

Known minor issues continue to include:

- Must pull no-mike headset cable to speak on phone. (Does this happen for streaming and media files also ?).

- Phone call mutes FM OK, but end of phone call does not unmute. Must manually select Mute/Unmute (also via lock screen or headphone cable button for Unlocked) or Speaker/Headset to restart FM.
[Spirit FM] cdshepherd:
When I downloaded new version it now says no FM found? I sent a debug log but I don't think there's much in it. I take it that is a bad sign?
[Spirit FM] mikereidis:
The new Jan 27 release enables Proprietary API support by default. You can work around this by going into Menu->Settings->Debug and checking/selecting all 4 "X Prop Disable" settings, where X is BC, TI, MO and SA. This will disable the Proprietary API support.

What is happening is that one of those Proprietary APIs is being detected, but it's not starting up properly. This is promising also, but since my code there is new and we don't have a log, it's hard to say.

It would be useful if we can find out which Proprietary API is being detected. You could re-enable each API one at a time and restart the app and see which one(s) prevent startup. Note that you enable by UN-checking, which is backwards from what you'd normally expect.

But it would be much better if we could get a log, and releases from January 20 have a bug that only affects stock Samsung devices. I'll fix this in Jan 28 release.

If you ever have trouble sending a log, you could try to manually retrieve and send it. The filename is sprt_debug.txt and in recent versions it's under one of these directories for free or Unlocked respectively:

/data/data/com.mikersmicros.fm/cache

/data/data/com.mikersmicros.fm_unlock/cache
[Spirit FM] mikereidis:
Jan 28:

http://www.mediafire.com/file/gb8o9na2pb7zhlz/Spirit_FM_Radio_v120128.apk ?

Mostly fixes problems with stock Samsung devices that have a /dbdata directory.
[Spirit FM] Quinny899:
Hey mike!

I've been tinkering in command prompt & adb using your ssd binary, on my Desire HD with ICS (IceColdSandwich)

Upon executing the attached commands, I get something that sounds like FM tuned to 88.5 or whatever the lowest frequency is. I noticed that I have multiple dev_id: 08 dev_cap: 0x00000011 dev_name:

!! FM Capability !!, the default is 8, but after tinkering I think I got it to 7, to get this output. Problem is, no station transmits at 88.5 here, so I either need to know how to change frequency via adb or for you to implement this into an update

Thanks
[Spirit FM] alonsosjumper:
Can you send me this unlocked version?

Thanks!
[Spirit FM] mikereidis:
Done.

So I guess this is the problem you had. I added code to handle the strange stock Samsung use of /dbdata... instead of /data/data and it didn't work right.
[Spirit FM] mikereidis:
If my app is running, and powered up the FM chip, it should tune automatically to whatever you set. If it doesn't then send me a log. I tried to dig up the HCI commands and can if you need, but really, the app should do that for you.

And if hcitool is present and works, you can deny my app SU (after a reboot), and that should force it to use the hcitool mode, and in the logs you can see what command lines are sent.

There's a more recent version of SSD in the latest releases but it might not help you. I think I fixed a bug that resulted in no device names shown, but you can still use the numbers.

These commands should enable or disable respectively device # 5:

ssd 3 1 5

ssd 3 2 5

Same for device # 6:

ssd 3 1 6

ssd 3 2 6

And device # 8 should be obvious.

Those are the devices with FM: 5, 6 and 8. I don't know if more than one can be enabled at the same time.

These should be the same as 2 of the above:

Enable and Disable:

ssd 3 1 fmradio_headset_rx

ssd 3 2 fmradio_headset_rx

ssd 3 1 fmradio_speaker_rx

ssd 3 2 fmradio_speaker_rx
[Spirit FM] alonsosjumper:
Not works me :S. It´s not sound anything and works slowly...
[Spirit FM] cdshepherd:
Alrighty Mike, i downloaded jan 28 version. fm did not start. so i followed your directions and after going through the list it appears the by disabling SA Prob the radio seems to turn on but still no actual "radio". I emailed a debug log but i dont think it went so ill email it the old fashion way. thanks again buddy, hopefully something good comes outta this. keep me posted friend!

EDIT: emailed debug log

EDIT: just noticed she FC's when I hit the volume up or down?
[Spirit FM] Henrique.:
Hello, this is my first time using your app, first of all I'd like to thanks for your work...

Second, here's my question: I just can't make it work on a Motorola Razr and a Milestone 3...i know someone maybe has asked this before, but it's 216 pages so far ( due your success on this project)...

Thanks
[Spirit FM] mikereidis:
AFAIK, the only Motorola's that have working FM are the Defy, Droid 2, Droid 3, Droid X, Bionic and I think the old Zeppelin.

Post 2 is my compatibility list. I'm trying to update it now every time a new device gets asked about: http://xdaforums.com/showpost.php?p=13380058&postcount=2

First, on some (most?) Motorola devices, my app has a reception problem, due to an as yet unfound antenna switch I think. Other than that, if rooted, my app will more or less work on Motorola devices on which FM is possible. Unrooted, it may not work. I'm trying to support the Motorola API but there are issues.

So it's important to know first FM is possible on the various Motorola devices. Some, like the Defy or Bionic have no stock FM app, but the stock app from other Motorola devices can work. If no Motorola app can be made to work on a Motorola device, I think no app can work. And for every Motorola device, people have tried.

AFAICT, the Razr can't support FM. The original Milestone 1 and 2 also can't support FM, and the Milestone 3 comes with no stock app and I've read of no success so I think it also won't work.
[Spirit FM] mikereidis:
"Radio seems to turn on" is because of the Broadcom combination chip that gets detected and used. But I think the FM won't work on that. It works on no other Galaxy S/S2 class device, and the Broadcom proprietary detection code says there is no FM radio API available.

One problem we have is that the Motorola proprietary support may be interfering. Both Motorola and Samsung unfortunately use a libfmradio_jni.so library file, but they are very different.

The Motorola startup attempt at least shows that there are "FmRadioController" and "FmRadioService" log entries, which is very encouraging.

So, I'd suggest setting Debug>FM Chip to "Si Labs (Gal S)". This likely won't work, but at least shouldn't give a false impression of working. Also, disable all Proprietary Supports except for "SA" for Samsung. So you'd see:

Checked/Enabled: BC Prop Disable

Checked/Enabled: TI Prop Disable

Checked/Enabled: MO Prop Disable

UNChecked/Disabled: SA Prop Disable

So only the Samsung Proprietary API will be attempted. I'm looking forward to hearing your results, and a log please. Thanks !
[Spirit FM] mikereidis:
Lot of email recently. :)

Proprietary and stock support is starting to open the floodgates of non custom-ROM-tinkerers.

Report of a stock LG Optimus 2x w/ Android 2.3/Gingerbread:

Great ! Please note this stock device support is very early and experimental and it will take a little while to iron out the details.

I should be able to look at the LG FM app to figure out the code needed to enable headset usage.
[Spirit FM] Henrique.:
In fact milestone 3(Brazilian) have a native FM app, but it's in the Connected Music Player( Native from Motorola, if is not this name is Music+)...but this module has a few bugs...so i found your app on the market and thought it could be an alternative for this dam app from motorola...
[Spirit FM] cdshepherd:
Hey Mike. I did as you suggested and I just now sent the dubug log over. Thanks brother
[Spirit FM] mikereidis:
Oh, right, yes. I looked at the CMP some time ago. Do you know if FM is working on the non-Brazilian versions ?

Have you tried the stock FM app from Droid 2, Droid 3 or X ?

If it's possible, I think my app will eventually support it, but if the stock Moto app from another phone works...
[Spirit FM] mikereidis:
Interesting...

The Samsung proprietary API initializes and even responds OK to a few commands.

It doesn't power up properly because it detects no headset is plugged in for an antenna. My own code detects that too. If you have a headset plugged in, try a different one. And reboot the phone before trying again.

It's starting to look like there might be a discovery here...
[Spirit FM] cdshepherd:
Hey Mike, I did not have headphones plugged in. I rebooted, plugged in headphones, started app and just sent debug log with headphones. Although nothing appeared any different within the app itself. :)
[Spirit FM] Henrique.:
Intersting, i don't know if others Milestone 3 has FM radio included, but i have the Fm apk from droid bionic, wich i got here on xda....i'll try it and give you an ansewer

Thanks for your attention
[Spirit FM] m.ksy:
Hi, Mike! The guys from rootzwiki has make the patch to fix stock FMRadio on Droid X, so can you crack the fmradioserver in this patch, to be available run the Spirit FM Radio?

patch: http://www.mediafire.com/?t0z8m9g04d7i5st
[Spirit FM] mikereidis:
Great, thanks !

So credit goes to SaurusX: http://rootzwiki.com/topic/10191-up...m-radio-added/page__view__findpost__p__430574

This is for CM4DX-GB1 and he says he "replaced libaudiopolicy with the updated one from the Defy. "

On MIUI for DroidX, my app had good reception only if it was started while the MIUI FM app was running. The MIUI app uses the Motorola proprietary API and I think this somehow enables the antenna.

Note that this was before I added proprietary support, but it seems broken so far anyway.

So my guess is that my app will run on CM with good reception, if started while the Motorola app is running.

And hopefully/presumably this will get my app working better eventually too.

It would be great if someone could run "hcidump -x" while the Motorola app starts up, in order to see if there are any special FM registers or values poked to enable the antenna.

Also, "strace fmradioserver" would be cool, but hopefully I'll get a used Droid X soon-ish anyway.
[Spirit FM] mikereidis:
Thanks.

This is disappointing. Here is the bad news log line:

01-29 10:03:48.880 I/FmRadioController( 322): FmRadioController_powerOn failed

So I think there is no hope.

For whatever reason, I think they left the FM API intact, but the hardware just isn't there.

My proprietary API support is new so I don't know yet how it responds on similar Galaxy S/S2 devices that have the FM removed.

If that were my phone, I'd probably try to add a few of the Samsung Galaxy S/S2 FM apps to see if they worked, but that's rather unlikely IMO.
[Spirit FM] cdshepherd:
Well it was worth a shot. Thanks for all your help and standing behind you product. Where can I find the galaxy FM apps. I looked in the market but didn't find anything. Thanks again.
[Spirit FM] mikereidis:
Sorry I don't have a handy list of download URLs. There are several threads scattered all over with links.

Technically there are copyright issues. Practically it's tolerated here and just about everywhere due to the hardware specific nature of the apps (You likely have a license, more or less, anyway).

But now that I think of it, you'd likely need to try several apps as there as slight incompatible differences between them.

This free Galaxy S widget might work in theory, but the notes indicate Galaxy S only: https://market.android.com/details?id=com.demboos.galaxy.radio.widget&feature=search_result And my app and it do roughty the same anyway.

Slightly more likely to work are the S2 app and perhaps the Note app.
[Spirit FM] Henrique.:
Hey mike, i promessed an ansewer about the droid bionic FM apk, it still the same crap that is the Milestone 3 native apk...So did you found any stuff to help me?

Thanks
[Spirit FM] mikereidis:
Well it must be from some other phone, because the Bionic does not have a stock FM app.

Brazilian or not, I think the RAZRs don't have FM.

What was the result when you ran my app ?

You can send me a log with Menu->Help->EM Logs and after a few seconds. enter "RAZR" in the email text and press send.

But I'm very doubtful it can work.
[Spirit FM] sebastjanb:
great app!

Works great on my HD2.

Maybe (not so new) idea for further developement...

Would it be possible to get TMC RDS info for navigation software like IGO Primo?

Like for Omnia:

http://xdaforums.com/showthread.php?t=512630

Keep up good work!

seba
[Spirit FM] mikereidis:
Very good... :) Which ROM are you running ?

I think I've only been asked about traffic data once or twice. I see at least one local station transmit it and it would be interesting to decode.

I read a bit about it, and the issues. I think that if you have traffic issues, you are much more likely to have access to cell data, and that there may be superior IP based solutions now and under development.

There is some irony there in regards to OTA versus streaming radio of course...

I'm also leery of someone trying to poke around on cell phone apps while driving in traffic. Yes, in theory, a big screen with a non-intrusive UI might manage the risks, but that's just theory, versus real people's lives.
[Spirit FM] sebastjanb:
idea?

Well I migrated from WinMo Energyrom to android now.

Now its [24.Jan.12][MAG/cLK]NDT MIUI 2.3.7 DEVELOPMENT V46.0 ROM.

Regarding TMC RDS info porting to IGO Primo app... I think many would appriciate it (?$?), since it is used widely across Europe.

Watch youtube video: TMC auf Touch HD ( im unable to attach hyperlink)

Regards from Slovenia!
[Spirit FM] jb789:
I can confirm this works on the Moto Droid 2 also. Well, it only delivers audio to the right ear, and the Loudspeaker toggle doesn't work, but I think that's always been the case for similar DX to D2 radio hacks. Hope that helps in development.
[Spirit FM] mikereidis:
Every bit helps. I'm trying to get a crash course on Motorola devices and FM now. I pretty much need to get something from Motorola for development.

I've been looking at the Droid 2 A955 partly because they are pretty cheap now. But the Droid X seems to have better ROM support, and has stock ROMs with the stock FM app. And Droid X is still most popular phone for the free app it appears...

Then there's the Droid X2 and Droid 3, but I think I'm leaning to the original Droid X, for price as much as X popularity. I guess the X2 has a stock app, but the Droid 3 doesn't, except for that strange CMP ?

Droid X was never sold in Canada though, so I'd have to go through the US...
[Spirit FM] Nomius:
Hello Mike,

Since I changed the audio method to "GalaxyS ALSA", I've been experiencing some issues:

1) The speaker lost quality... I have noise when listening to music with the speaker. Restart haven't fixed this, and it sounds kinda bad.

2) After listening to the radio, if I receive (or make) a call, I can't listen the one in the other side.

I'm running ICS (CM9 alpha): http://xdaforums.com/showthread.php?t=1363593

Thanks in advance,

Regards.
[Spirit FM] mikereidis:
Hi. The Jan 29 release here has a one line fix that I think should resolve most issues, including the no audio on a call issue, with the GalaxyS ALSA audio method: http://www.mediafire.com/file/q4yd86ttftt22zc/Spirit_FM_Radio_v120129.apk

However I think this fix may be too late for your speaker. I had a 4th report the other day via email and yours is the 5th. :(

The good news is that 2 of the first 4 were able to give repair results, and in both cases only the speaker needed to be replaced. No permanent damage to any chips or other PCB components was found.

I'm reasonably sure the recent fix I did will stop further occurrences, but can never be completely sure, so the warning will remain. But I'd better get this fix into the Market version ASAP.

For you or anyone wondering, this fix did not require writing 1 to a "Do not break speaker" control. It was simply to write 'FMR_FLAG_CLEAR' to the "Codec Status" control. Seems simple in retrospect, but not obvious.
[Spirit FM] Nomius:
How did they fix it?
[Spirit FM] cuchulain22:
Hi thanks a lot for this fix.
[Spirit FM] iDark|:
To clarify, does this mean that the current and future releases shouldn't cause the Galaxy S speaker to kill itself? This is the only reason why I'm not using this app at the moment, because I only use FM radio on speaker...
[Spirit FM] mikereidis:
I thought "...only the speaker needed to be replaced" made it clear.

They (or their repair person) removed the old, broken speaker and installed a new, good speaker.
[Spirit FM] mikereidis:
I think so yes. It's impossible to say for sure until, say, 1-6 months goes by with no new reports for the Jan 29+ releases.

My first support for the Galaxy S used this method before CM FM worked, and I got 2 reports within a month or so (late August). Then a 3rd another month later or so.

Then suddenly now I have 2 more reports. I can only guess it's due to the use of ICS ROMs where this method is needed, even on the CM and MIUI pre-releases.

I can say for sure that in my testing, the "glitchiness" of this method is gone. Phone calls seem OK, and the audio doesn't randomly not start when the app starts. And the BIG clicks in the speaker seem gone.

I think the BIG clicks may have been the result of a constant DC voltage on the speaker, which would tend to move the speaker cone all the way to one side. But I'm just guessing.

I'm not convinced speaker or headphone usage matters.
[Spirit FM] mikereidis:
Feb 1: http://www.mediafire.com/file/l3yjzhi9h2525a9/Spirit_FM_Radio_v120201.apk

This is close to a Market release.

- Many small changes, such as to Notification text, especially on ICS (in Unlocked)

- Reverted to "Proprietary Enable" Checkboxes. (Instead of confusing Disables).

Default for Broadcom (BC) is ON, but the better UART mode will be used if app has SU and Bluetooth is off.

Default for TI, Motorola and Samsung are OFF. Motorola likely still doesn't work well, and TI and Samsung are little changed.

- Debug button replaced by more useful for most Settings button. Debug functionality such as Record tests moved to Menu->Test.

- Recent improvements to "Email Logs" particularly for unrooted devices.
[Spirit FM] mikereidis:
HTC Desire HD w/ ICS:

Not a complete answer, but some thoughts/ideas:

I think you get "errno: 16" on the 2nd command because you are trying to enable the speaker path when the headset path is enabled.

But then on the 3rd command you "disable" the speaker OK, but the success may be fake.

In general I think it's better to disable the previous path before trying to enable a new path. So for example, to switch between the 3 outputs:

ssd 3 1 fmradio_headset_rx

ssd 3 2 fmradio_headset_rx

ssd 3 1 fmradio_speaker_rx

ssd 3 2 fmradio_speaker_rx

ssd 3 1 fmradio_handset_rx

ssd 3 2 fmradio_handset_rx

If something in addition to the above is needed, perhaps the CM source code can give some clues. But the above is pretty much what the qdsp5v2 audio method does and that works on many devices.

What might be needed is the setting of volume controls for these FM audio paths. The ALSA driver has controls that might help. Maximum is 42 but lets try 28 or about 67% volume:

ssd 4 2 fmradio_handset_rx 28

ssd 4 2 fmradio_headset_rx 28

ssd 4 2 fmradio_speaker_rx 28

I always thought the FM audio for Desire HD was analog, but read some code last night indicating it might be digital. If it's digital, there may be additional setup needed.
[Spirit FM] Quinny899:
Just tried your method on my dhd, no different, just clicking
[Spirit FM] krutoistudent:
does this work with CM9 B14 for SGS?
[Spirit FM] mikereidis:
Yes.

Use this: http://www.mediafire.com/file/q4yd86ttftt22zc/Spirit_FM_Radio_v120129.apk

Give SU when asked.

Set Menu->Settings->Audio->Method to "Galaxy S ALSA".

Read the dialog and make a choice. :)

Restart the app if there's any issue.
[Spirit FM] mikereidis:
Any problem that persists across a reboot is more than a crash.

My suspicion would be that the normal analog data path gets closed and won't re-open without removing standby power.

I can't make sense of the errors happening without a more in depth investigation.
[Spirit FM] varta:
hi pls is / will it be possible to tune custom frequencies out of normal radio range (f.e. 160.9 MHz or 74.0 Mhz, etc.)?

Thanks
[Spirit FM] ruvort:
Anyone have any luck using this on the Xoom? If needed what do i need to do/ provide to report the issues with it working on the xoom? As of now it goes to a black screen when opened.

Sent from my Droid Incredible 2
[Spirit FM] mikereidis:
Only with a hardware up or down converter, but I know little about available devices.

I can add app support for different ranges, for any chips for which this is possible.

But AFAICT, all the chips I support (basically all of them) can only handle 76 - 108 MHz. If you want 76 - 87.5/90 you need to select the Japan band.

There are other radio chips that can handle wider ranges, and different modulation schemes, but so far there seem to be no readily available Android devices with these chips. One minor exception is rare support for analog or digital TV tuners.

As for resolution, my app can do down to 1 KHz, if the chip supports it (like Broadcom does). Eg. 87.501 MHz.
[Spirit FM] mikereidis:
Besides some obscure Chinese models, the only Android tablets that support FM are the original Dell Streak 5" and the new Samsung Galaxy Note 5".
[Spirit FM] ruvort:
Dang. I know the xoom chipset has it, but its not all "hooked up" so to speak. I'm almost tempted to try and activate it.

Sent from my Droid Incredible 2
[Spirit FM] mikereidis:
OK, thank you, I'll try to find out what is happening when I have more time.

Yes, the button next to the power button is mute. It should show an X instead of "speaker sound waves" when muted.
[Spirit FM] CR5N:
Tried the recent package, but no good so far. PI shows -1 even on known good frequencies.

Couldn't see the two files in /dev/socket so guessing something not set up right. Got an exam tomorrow so not a lot of time today but will have a look in the next day or so.
[Spirit FM] mikereidis:
OK, thanks.

I can throw a switch in the code and use network sockets instead of Unix sockets. I did that previously to avoid some permissions problems.
[Spirit FM] error4o4:
Very cool, works great on my Evo running CM7.

Love how this one actually shows signal strength, station call name, song title, etc

Its like HD Radio :D Have one of those in my bedroom, but not in the car at all.
[Spirit FM] mikereidis:
Wonderful ! :) Thanks for your report..
[Spirit FM] icke:
Hm...thank U for the update, but now I get FC on startup.:(

Version 2.09 was working fine for me.

HD2 with TyphooN_CM7_v3.3.0-MAGLDR.
[Spirit FM] mikereidis:
Hi,

Thanks for trying. Try a full phone reboot please.

If that doesn't help I presume you can re-install 2.0.9 from Market.

CC via PM.