yashsingh1/xdaforums huggingface dataset:
[Spirit FM] mikereidis:
The only Audio Method that works on ICS for SGS is "GalaxyS ALSA".

BUT, there was a problem with some speakers being damaged, even when speaker mode was not used. So I disabled the "GalaxyS ALSA" audio method.

I estimated damage was happening to 1% of Galaxy S users, but if I further assume that only 20% of those users are running ICS, then that means 5% of ICS Galaxy S users have experienced damage. And most of that was likely within 1 month of use. And neither low volume, nor using only headset mode seem to lower the risk.

If you understand the risk and promise not to get angry or say bad things about my app or myself if your speaker is damaged, there is a workaround described here: http://xdaforums.com/showpost.php?p=23428950&postcount=2458
[Spirit FM] mikereidis:
You're right. :) Works OK on my Ice Cold Sandwich. Must have been one of the "small" bugs I found and fixed... I think the PCM open was being forced for all chips and APIs in the March 13 release.

What would be even more amazing is if phone calls can be received or made without problems. My DHD isn't SIM/network unlocked yet so I can't test the phone part.
[Spirit FM] mikereidis:
I'm happy to say that Spirit FM is now "FM API complete" for the forsee-able future.

There are still bugs to be fixed, and adjustments needed for many phones, but the basic API supports are there now.

Unfortunately excluded from the fun are obscure chips like MediaTek, the ZTE blade type of Silicon Labs driver, and Qualcomm Tavarua. Tavarua V4L support is there but doesn't work well. I will watch these and others for signs that they are worth my limited development time and budget.

Included are, I think, over 90% of the FM capable phones/chips/APIs available. (Outside of China at least.)

AFAICT, Spirit is the only single APK file FM app in the world that can work on and adjust to so many different devices, chips, APIs and ROMs: stock unrooted, and custom. Thus, a single purchased copy has a good chance of running on of all your Android FM capable devices, past, present and future. :)

The Android FM chip leader is Broadcom and support includes low level HCI and UART access as well as the Broadcom OEM APIs for devices from HTC, Samsung, LG, Motorola and likely a dozen+ less known OEMs.

The runner up used to be Texas Instruments (TI), but Samsungs' success with Galaxy S/S2/S3 class devices containing Silicon Labs si4709 chips may have won them second place now.

TI support includes low level HCI access as well as the TI OEM API or the Motorola specific OEM API for devices from HTC, Motorola and Sony Ericcson. Hopefully the Sony source code recently released will contain an easy solution for SE un-rooted devices.

Samsung Galaxy S/S2/S3 class devices with Silicon Labs si4709 chips are supported via the Samsung specific low level device driver API as well as the Samsung OEM higher level API.

Low level API support tends to be for rooted devices, especially with custom ROMs with no OEM frameworks and without proprietary Bluetooth stacks. Higher level OEM support tends to be for the vast majority of phones that are stock and un-rooted.

=============

I expect to take some "vacation time" over the next week, meaning I'll only be working about 30 hours or so, so that I have some time to enjoy the early spring with my family and get household tasks done.

After that there will be some time devoted to re-design (delayed from Christmas !), bug fixing, API adjustments, some new features, some UI enhancements, and probably most important: business improvements to ensure this project can continue to move forward indefinitely.

Thanks to all who help with bug reports, success reports, Market/Play reviews, word of mouth, constructive criticisms, information and perhaps most important to keeping me developing: purchases/financial support ! :) :D
[Spirit FM] geoka7:
I try all this but the same problem.
[Spirit FM] msgreenf:
Mike,

What should I try on my d2g running cm7 rom? I don't have any of the moto frameworks installed for FM.
[Spirit FM] m.ksy:
Yeeesssss! Radio works perfect! The problem with bad signal no more! Mike, thank you for your hard work!

p.s. Droid X CM7GB
[Spirit FM] pikachukaki:
Νο...hear a sound for a millisecond and then pouf restart...now i can change it to custom to use it the old way! :/

If you unistall it completly and make the quide again its working..but when you close the radio the phone restarts...
[Spirit FM] fulloflove:
this works greate

I'm using LG GT540 with CyanogenMod and this is far better than the default FM app
[Spirit FM] alonsosjumper:
Mike, how is the development of the recording on Galaxy S?
[Spirit FM] Marek89:
Xperia Mini PRo SK17i not work.
[Spirit FM] onesolo:
Yes!! So nice, the latest version fixes all the problems with sound
[Spirit FM] thermskin:
hi!

damn looks like there is still problem with sound. If you're listening radio and notification came radio immediately stops working and sound on device doesn't work anymore. only reboot helps!

I am using ice cold sandwich latest version on my dhd.

best regards

t.
[Spirit FM] mikereidis:
Are you doing it from the command line shell on the phone ? Or via adb shell from a USB connected PC ?
[Spirit FM] mikereidis:
Stock ROM unrooted ?
[Spirit FM] mikereidis:
Wonderful ! :)

Just to remind all the happy people of the most tangible method to show appreciation and encourage continued development: https://play.google.com/store/apps/details?id=com.mikersmicros.fm_unlock

:D
[Spirit FM] mikereidis:
OK.... Are you using qdsp5v2+ with a plus on the end ?

Perhaps I'll need further "encouragement" :)

With the new Market/Play statistics I can see which devices and Android versions are being used to download the apps on a daily basis...
[Spirit FM] thermskin:
yes that audio mode with +
[Spirit FM] ruvort:
Anyone have a mirror for the latest version?
[Spirit FM] mikereidis:
Mediafire used to work for just about everybody. No more ?

I'm always open to suggestions for a single site that everyone can access, that doesn't require a waiting period.

If you want you can send me an email at mikereidis AT gmail.com and I'll email it.
[Spirit FM] vurp0:
The Mediafire link is broken.
[Spirit FM] mikereidis:
Hmm, the "URL with filename" feature seems broken, but the base URL for March 16 still works: http://www.mediafire.com/?454ic5h3hc1thl4

But March 17 is available now anyway: http://www.mediafire.com/?4cp8t77pi6hqinb

This version may fix a few issues:

Audio Method: SonyEricsson2: May work on more SE devices.

Audio Method: qdsp5v2 Analog: May work on Huawei u8800 pro.

New Audio Method: LG2 may work on some LG devices.

Also added support for the MIUI implementation of the Motorola FM Radio Service.

I tested a number of Droid X ROMs, including:

Stock 4.5.602.MB810.Verizon.en.us

MIUI.us_Shadow_2012.3.6-Wizard0f0s-signed.zip

Pooka-CM4DX-GB-20120311.zip

VorteX_GB-RC1.zip

dxmiuiics225a.zip

CM9-DX-03142012.zip

All worked fine with the OEM API except CM9. The MIUI ICS with the MIUI FM Radio service was fine though.
[Spirit FM] vurp0:
My issue still occurs with today's version, don't know if you tried to fix it or not. Should I take a new logcat and send it?
[Spirit FM] pikachukaki:
Did you fix the auto restart after closing the radio on x5pro?thx
[Spirit FM] locomotive96:
Thanks for the Motorola API!, But...

If this works on MIUI ics for your DX, Would it work on MIUI 1.10.21 on my D2G? I got my earbuds to make sound and static, but still can't find any stations. Can you tell me how you set yours up?
[Spirit FM] mikereidis:
Yes, please send a new log immediately after you see the problem. I think you sent one: FMlogcat.txt and it just shows the PCM open error.

I presume you are back to having to mute/unmute to restart the audio ?

Are you not able to do Menu->Help->eml successfully ? It may help me to have the dmesg output I include with that. The important file should be at /sdcard/sprt_debug.txt .

I can try some tests tonight that thrash the RAM and CPU. AFIACT you're the only one reporting this issue recently, although I've had 1 or 2 similar reports in the past.
[Spirit FM] mikereidis:
You tell me. :) Probably not ? I don't have this phone, nor a similar one on which the problem happens, so it's difficult to analyse, never mind solve.

If the phone restarts, logs can't be obtained, unless someone is running logcat and perhaps dmesg from a USB connected PC via adb shell.
[Spirit FM] mikereidis:
Probably not, unless that MIUI had the MIUI FM app and it was working.

I'll do some investigation regarding FM in general on the D2G.
[Spirit FM] mikereidis:
Well that is VERY interesting. There are only 2 other devices that I know of on which recording has been confirmed: Galaxy Note international version and SonyEricsson X10 mini.

It's possible the FM audio is digital only, and not analog, so that's a clue. If a device can record FM, then there is most likely a way to play FM, even if that means playing back the file slightly delayed as it's recording.

But before trying a make an FM PVR, let's try to get audio working, without record for now.

My approach is to get the stock FM app, de-compile it and look for the audio enable code. I have looked already at several SonyEricsson FM apps, but the one for yours may be different. Can you point me to a ROM that contains the working stock app ? Or if no such ROM exists, perhaps I could get a dump of the /system directory on the device.
[Spirit FM] pikachukaki:
I don't know any of this im sorry...but with the previous version we have to restart manually to use other sounds (call messages) now it just restarts itself!
[Spirit FM] idkidk:
Hi mikereidis, My testing result:

service btld /system/bin/logwrapper /system/bin/btld -hb 3000000 -hp /dev/s3c2410_serial0 -lpm 1

It looks like Samsung doesn't use brcm_patchram_plus like most other devices with Broadcom proprietary stack. And their service is named "btld" instead of "hciattach" so they likely have a custom libbluedroid.so library, but that's not our concern here.

So for your bcfm file I'd recommend:

#!/system/bin/sh

/system/bin/bcprp -d --baudrate 3000000 --patchram /system/bin/BCM4329B1_002.002.023.0534.0590.hcd /dev/s3c2410_serial0

DONE

I'm assuming you have the standard /system/bin/sh shell binary. To confirm from a PC run:

adb shell

/system/bin/sh

exit

exit

NO error, like as expected

The "D/su" line is essential. You need something like SuperUser.apk that will ask for permission to use root priiveleges, and you need to answer Yes.

I've answered yes when su ask permission, and Spirit FM Radio is in the list of superuser.apk

/system/bin/bcprp

/system/bin/bcfm: the edited file

AND ensure they are both executable. The following should work:

adb push bcprp /system/bin/bcprp

adb shell chmod 777 /system/bin/bcprp

adb shell "echo \#\!/system/bin/sh > /system/bin/bcfm"

adb shell "echo /system/bin/BCM4329B1_002.002.023.0534.0590.hcd /dev/s3c2410_serial0 >> /system/bin/bcfm"

adb shell chmod 777 /system/bin/bcfm

i've done exactly like instruction.

The FMapp start, but FC.

in attach logcat and list of mount point (for sdcard, sgt have both internal and external sd)

TIA

Idk
[Spirit FM] s0epkip:
Yes it does, it works even better than the default app!!

I'm waiting for it to work on Gingerbread MIUI on the DZ, but CM7 works fine! (Stock/Sense rom does not (yet) seem to work)
[Spirit FM] mikereidis:
Sorry, it looks like a made a mistake in the second echo line. It should be:

adb shell "echo \#\!/system/bin/sh > /system/bin/bcfm"

adb shell "echo /system/bin/bcprp -d --baudrate 3000000 --patchram /system/bin/BCM4329B1_002.002.023.0534.0590.hcd /dev/s3c2410_serial0 >> /system/bin/bcfm"

adb shell chmod 777 /system/bin/bcfm

With this command:

adb shell cat /system/bin/bcfm

You should now have:

#!/system/bin/sh

/system/bin/bcprp -d --baudrate 3000000 --patchram /system/bin/BCM4329B1_002.002.023.0534.0590.hcd /dev/s3c2410_serial0

You should now be able to run:

adb shell bcfm

The command should run and stay running. In another window, check the adb logcat output and if bluetooth is off (which it must be), you should see something similar to what I get, but reflecting the values different for you:

D/bcprp (11295): bcprp direct bt mode and replacement for brcm_patchram_plus for FM HCI access daemon v2.0.12

D/bcprp (11295): Copyright (c) 2011 Michael A. Reid. All rights reserved.

D/bcprp (11295): bt_cmd btsock: 8

E/bcprp (11295): bt_cmd bind errno: No such device(19)

E/bcprp (11295): tmo_write write errno: File descriptor in bad state (77)

E/bcprp (11295): bt_cmd tmo_write error cmd_len: 4 written: 0

D/bcprp (11295): main uart mode rret: -1

D/bcprp (11295): default_bdaddr_set

D/bcprp (11295): default_bdaddr_set bdaddr: 5C:17:D3:E5:A8:6A

D/bcprp (11295): bdaddr_parse: 5C:17:D3:E5:A8:6A

D/bcprp (11295): cmdline_parse option: baudrate arg: 3000000

D/bcprp (11295): baudrate_parse: 3000000

D/bcprp (11295): cmdline_parse option: patchram arg: /system/bin/BCM4325D1_004.002.004.0218.0248.hcd

D/bcprp (11295): parse_patchram: /system/bin/BCM4325D1_004.002.004.0218.0248.hcd

D/bcprp (11295): cmdline_parse open port: /dev/ttyHS0

D/bcprp (11295): uart_init

D/bcprp (11295): port_baudrate_get termios_osp: 4109 termios_isp: 4109

D/bcprp (11295): port_baudrate_get baudrate: 3000000

E/bcprp (11295): baudrate_set baudrate: 115200

D/bcprp (11295): main (re)-init: 0

D/bcprp (11295): reset_start

D/bcprp (11295): patchram_set

D/bcprp (11295): hci_send remove_ret: 2

D/bcprp (11295): 34 31

D/bcprp (11295): baudrate_reset baudrate: 3000000

E/bcprp (11295): baudrate_set baudrate: 3000000

D/bcprp (11295): bdaddr_set

D/bcprp (11295): srv_len: 16 fam: 2 addr: 0x7f000001 port: 2112

You might still get a hang, crash or FC for some reason, but hopefully not.

I'm very much hoping we can get this working soon. I'm mostly concerned that the antenna might not be attached, but we can still try...

Thanks for your work....
[Spirit FM] mikereidis:
Thanks for your report s0epkip.

I'd like to add better self-trouble-shooting feedback because there are always reasons why it might not work, or might not seem to work. For example, a bug in my file handling code, or a bug in a specific version of a ROM could cause an app to fail when no SD card is present. And most of us have SD cards installed so don't notice the bug.

Re: MIUI, my impression is that some of the MIUI ROMs use the proprietary BT stack instead of stock Bluez for whatever reason. And those ROMs have no working MIUI FM app.

The best current option in these cases is the HCI UART mode that a few here are beta testing. At least one person besides myself has it working, at least first time after boot.

I'm still hoping a simpler solution can be found. I think the Linux kernel and the BT parts of Android have access to the HCI layer, so it MUST be possible for a root user to access that somehow.

I'm getting the impression that the "BT stack" is a very complex beast. There are parts in the kernel, and parts in "userspace" in various libraries and daemons. And then Android makes it a whole lot more complicated with their "bizarre security model" that can provide access to certain commands, and no access to other HCI commands, in addition to all the other BT services like A2DP, RFComm etc, etc.
[Spirit FM] s0epkip:
Mike, thanks for your work and your reply!

When you say you got "it" working using HCI commands, can I interpret "it" being FM radio (with broadcom chip) on MIUI or? :D

Good luck understanding the Bluetooth stacks, too bad that a lot of developers/manufacturers seem to use proprietary stacks!!
[Spirit FM] eckengucker:
unfortunately not working in germany on my GSM Desire with MiUI 1.5.20.
[Spirit FM] idkidk:
adb shell bcfm >> logcat in bcprp.txt (in attach)

bt off, earphone plugged, start Spirit FM - FC, start again NO FC, the app start!

But:

Set Italy for scan, NO AUDIO and the signal indicator show, for few frequency, one or two line, for most no signal. (probably antenna not attached?)

If i set North America for scan, i've one frequency (94.5) with full signal..... :confused:

Now the app won't start, only FC. (logcatapp.txt in attach)

TIA!

Idk
[Spirit FM] mikereidis:
You might have gotten lucky once.

From your bcprp.txt I can see where I need to improve the code. It makes assumptions that are usually true on my phone. It's possible the bcprp from v2.0.11 will work if you want to try.

I think we need to concentrate on getting bcprp working first, before the app that uses it. I'll post a better version ASAP.
[Spirit FM] mikereidis:
My app IS working on some MIUI ROMs, generally the ROMs that have a MIUI FM app. The MIUI app also uses hcitool.

Some of the more recent Gingerbread / Android 2.3 MIUI ROMs don't support the MIUI FM app, nor mine. That's because they went to the proprietary Broadcom BT stack for some reason.

Yes, it's too bad re: the prop BT stacks. But there DO seem to be some reasons behind this; I presume the MIUI devs used the BC one for 2.3 for a reason.

But despite this, once I get the HCI UART mode more stable, if you have root, my app should be able to work on most Android devices with a Broadcom FM chip, and eventually TI chips too.

The downside is that BT access becomes lost, although there are various tricks that might be usable to allow co-existence with the BT stack.
[Spirit FM] idkidk:
OOOk man!

I'll try the 2011 version and post result.... tomorrow :p

Thanks!

Idk
[Spirit FM] mikereidis:
Best to try the new version 2.0.14 :

https://docs.google.com/uc?id=0B7UP...GFh&export=download&authkey=CJu6m6oE&hl=en_US

OR

https://docs.google.com/leaf?id=0B7...WItMjJmMDM4MzYxZGFh&hl=en_US&authkey=CJu6m6oE

Pretty much fixes the known issues with regards to the daemon, AFAICT. I haven't spent much time testing but works for me.

Same instructions/setup as for 2.0.12 but hcitool doesn't have to be renamed any more. Now if both /system/bin/bcprp and /system/bin/bcfm exist, the daemon will be used. If BT is on and accessible via HCI sockets the daemon uses that, otherwise it will work over the HCI UART.
[Spirit FM] icke:
Thank U for your update...it's working fine for me.:)

1 Question: Is it possible to implement a full scann and not only search by clicking the two arrows?
[Spirit FM] m-p{3}:
Tried it with my Sanmsung Nexus S, and unfortunately it did not work. Thanks for the effort made for the other smartphones though :)
[Spirit FM] mikereidis:
Great ! First version to work again for you after the last Market version v2.0.9 ?

Yes, a scan that fills in a bank of presets is on my radar. The question becomes "How do I prioritise these things?".

On the one hand there are many obvious features to add or GUI improvements to make to the app. On the other hand there are many devices to add support for, whether to fix the common "no audio" problem, or find/fix another HCI access method, or to add support for Silicon Labs chips.

I'm one person (with some help from the "community") trying to do a task Google said they didn't have the manpower to tackle, LOL. And I have just two phones by which I'm trying to support many different device and ROM combinations.
[Spirit FM] mikereidis:
Yes, that is expected. The Nexus S uses a Silicon Labs chip I would desperately like to add to my supported chips list. Have you tried the FM TwoO app ?

The fastest way for me to add support is to use the library used by that app. I think I could do it in a day or less, possibly even "blind" without a compatible phone. But then I'd be inundated with even more bug reports and feature requests from Nexus S owners and support requests from users of other devices with Silicon Labs FM chips that won't work with that library as is, LOL. :)

I'm sorely tempted to take a day and add support, but there are several people patiently waiting on "no audio problem" fixes. "Stay tuned", I will add support as soon as I can.
[Spirit FM] icke:
No...v2012 was working too for me.:)
[Spirit FM] mikereidis:
OK. Just a warning to anyone considering the latest 2.0.14:

It seems to have problems after running in the daemon modes for some time. A lot of RDS activity may hasten this issue, particularly with the screen off or the app otherwise in the background. For now it's best to limit it's use to experimental.
[Spirit FM] Drew99:
It work fine! even without Bluetooth turn on and Bluetooth icon :)

(Tested on HD2 /Typhoon CM7 v3.3.1)
[Spirit FM] nepukadneza:
Hello, I can´t download the files from google.

Is there chance to make a mirrow?

Thanks, Nepukadneza
[Spirit FM] idkidk:
Hi,

2.014 start with no FC, (started the application several times) but, as expected, no sound and no signal. Logcat in attach.

TIA mikereidis, very good job!

Idk
[Spirit FM] mikereidis:
I have no answer about the restart.

With the Custom audio method, here's a new sprt2.zip file you can try: http://www.mediafire.com/?mpc0zksfur5bacg

Extract the contents to the root of the SD Card (/sdcard/).

Put the app into headset mode before you do that (The speaker icon will show).

If it restarts the phone, delete /sdcard/sprt_hdst and try speaker mode.

If it still restarts, delete /sdcard/sprt_spkr and see.

If it still restarts, delete /sdcard/sprt_mute and try again with just the headset or speaker file.

At least this will help us see what is causing the reboot.
[Spirit FM] mikereidis:
It seems that nobody has EVER gotten FM working on the Motorola Droid 2 Global.

This is the bad log line when trying to start the FM service that works on other Moto phones:

03-17 06:47:42.840 W/ActivityManager( 1693): Unable to start service Intent { act=com.motorola.android.fmradio.FMRADIO_SERVICE }: not found

Same error with my app (using OEM API) or one of Motorola's FM apps.

Using the low level HCI API my app seems to work, but RSSI is around -14 to 0 or so. This indicates the antenna connection is not active.

There are other Motorola devices (including some Droid X's, but not mine) that show the same antenna problem in low level mode, but something in the OEM API turns on an antenna switch and it then works.

Hypothetically, the Droid 2 Global may also have an antenna switch,

I think the only possibility of success will be if I can find and enable the antenna switch on other Motorola devices, and try that on the D2G and see if it works.

I suspect this is unlikely after years of no FM on the D2G, but it would be awfully nice and interesting...

So, the search for the elusive Motorola antenna switch continues... If I could find a device on EBay that's guaranteed to have the "antenna switch problem"... I might buy it for study.
[Spirit FM] pikachukaki:
Thanks i will try and i will inform you

With 3 files it dosn't restarts but i can switch to speakers only headphones..without the sprt_hdst i can't switch to headphones and when i press the pause button it stucks and the phone restarts..without the sprt_mute i can't switch again to headphones and strangly the mute works! :/ and no restart again..even with sprt_spkr in the sd speaker works only and pause still works...i try again the analog method you post last night i didn't have a restart this time but when i reopen the radio it stuck and then i had a restart! :/

where the eml saves cos when i press it it gives me an FC

The sprt_debug.txt will help you?

Now whatever i do i can't make it to work..Broadcom and qdsp5v2 Analog just keep frozing the app..ill try v16 again!

too many edits...no not even v16 works..just keep crashing...we have a hard to get phone!!