yashsingh1/xdaforums huggingface dataset:
[Spirit FM] mikereidis:
Thanks. :)

If you or someone wants to go a little further, we could do a low level test. I hesitated to ask you because your phone is stock (but rooted) and for G2 a Bluetooth "shim" is installed that creates a real risk of booting problems, moreso if you don't have a custom recovery installed. If you don't have custom recovery, don't do it. But on a rooted phone only, the way to do it is set Debug-> FM API to Low Level and restart Spirit1. Best to have Bluetooth off, or must reboot after first run (shim is installed.) To remove shim, use Menu-> Test-> BC-> BT Shim Remove (near bottom).

What we saw was that the RSSI signal strength (at top left) in Spirit1 was jumping between values such as 111, -16, -17,... I've seen this many times in the past on older Broadcom chips that were FM disabled, using the low level API.

I don't recall ever seeing this with the Broadcom API, probably because the API a few years ago would just refuse to start at all. This was more an issue on BCM432x chips, not the modern 433x.

I've still never figured out why this pattern happened. Most other chips just show fixed RSSIs of 0 or -128, or low steady-ish values like -16. My guess is that grounding antenna pins, or using other methods of disabling FM would create some test pattern in the RSSI, perhaps for testing.
[Spirit FM] mikereidis:
Yeah, SDR Touch is one of the few apps I've bought, but I haven't used it in a long time. It's great as an SDR, but it's worst aspect is that it eats battery very fast, due to SDR of course.

A few years ago I bought a pair of si470x USB dongles and experimented.

I COULD get it working well (might work partly already, with kernel w/ USB version of si470x V4L driver) if I spent at least 20-40 hours on it, maybe 100 or more hours if I have to build custom kernels for just a few phones/tablets.

But my guess is I'd be lucky to have 100 related sales over a few years, so it's not worth all the work for development, support, and ongoing fixes I'd have to do. As it is right now, I'm limiting official Spirit support to a handful of the most popular FM capable phones among ROM'ers.

The dongle approach is mostly good for those installing a tablet (with no FM) in their cars. Even people "desperate" for FM in their FM incapable phones don't want to deal with a dongle hanging off.
[Spirit FM] mikereidis:
:)

So it's not just sales hyperbole when I call Spirit (2 at least) The "Best darn FM app" in the Play Store description ? ;)

I'll read your post better after I deal with my kids for a while.
[Spirit FM] stadros83:
Thanks for you answer :).

I want to use this in my car, so that's why I was looking at SDR Touch :).

But is not as user friendly as Spirit FM.

Anyway it seems possible to use the RTL2832U driver because there is another app on the store : Wavesink Trial DAB / FM Radio (https://play.google.com/store/apps/details?id=de.ses.wavesink).
[Spirit FM] mikereidis:
That's one heck of a procedure... :)

One downside to the Broadcom FM chips, unlike the Qualcomm chips, is that there's no standard way to connect it to the (usual) Qualcomm audio chip, in hardware or software.

That's why I don't know how to enable FM audio on Sprint Note3. (But we might get clue if you send me debug log / logcat from the time when the NextRadio app enables FM audio. I might also look at the NextRadio app code again.)

So, there is no Spirit "digital audio" possible, at this time.

The only possibility for record is via Digital-> Method = MediaRecorder. Try different values for Digital-> Source, from 8 - 12. You can record with Menu-> Test-> Record-> Start, or set up the wired headset media controls for record and you can stay in the settings screen to try different values, and look for non-zero length mp4 files.
[Spirit FM] mustasusi:
You god darn right! I hope your kids are FMists too as much as loyal customers of yours :p

I guess it's still too early to even bother trying Spirit2 on Note3...

I read you mentioned many times about BCM complexity and still was curious enough to take the risk and try out. My HTC Max has a Qualcomm chip and worked almost out of the box (only had to root it). It does everything I would expect. By the time I learnt the hard way how painful disadvantage a "sealed"\non-removable battery is - I started looking for alternatives and that's where the Note3 came in handy. I gave up on Samsung in advance because I had no Idea about this Sprint exception. It offers yet the highest end specs as of date, bigger internal storage (more records, yummy), IR blaster, removable battery and of course - FM support! If I knew it before - I'd buy Note3 over HTC.

I had mixed feelings about this move as your discussions about this model wasn't that encouraging. As I experimented deeply, it turned out the devil isn't that evil. I know, this procedure isn't the most convenient in the world, + you're vulnerable to crashes, FC and even hard reboots. But when it works - it is the best darn experience to have with radio, since Walkmen days. You saw my video - how long does it actually take - 2 minutes and only because I delayed too much with Next radio (switching to speaker was totally unnecessary as it works for both sources if you leave it to headphones. If you want speaker you just unplug them, leave the plug half in if you want optimal reception), I can make it much shorter, about half a minute less. In fact describing this process to details took me much longer.

Recording still no good news but I'm getting closer. By now the only way that actually generated a file is of "Sony JB422" but is MONO, although it records internally, no mic involved, "Stereo" is checked in. Result is still

Mono

.

I sent you another log, though I sent you before and you responded you got it. The more the better I guess.

Listen to this short record and find out:

http://www20.zippyshare.com/v/68226897/file.html

Note: Beware of notifications\low battery sounds and outgoing calls!!!
[Spirit FM] mikereidis:
Perhaps, but I think he is mistaken about the chip.

http://www.cpkb.org/wiki/Samsung_GT-S5570_Galaxy_Mini_service_manual

Schematic in Level 3 repair has an FM Radio section and block diagram on first page identifies it as a BCM20780 which is supposed to be SW compatible with BCM2048 and 2049.

And that source code file I found was for BCM2048.

The Galaxy 5 schematic shows the same BCM20780, and is reported to be working OK, although we don't have audio yet on the CM7 port.
[Spirit FM] denzel09:
Hi buddy, is there a possibility to fix the problem and so to have radio on mini?
[Spirit FM] mikereidis:
In theory, yes. Your phone has working FM stock provided by a Broadcom chip that should be compatible.

The Galaxy 5 appears to have the same chip and my app appears to run OK on the CM7 port for the 5.

EXCEPT, there is no audio at present on the Galaxy 5 and the CM FM app doesn't work for this reason also. I'm trying to help the person doing the CM7 port, but I'm not sure if/when that will be complete. We might have the same issue on your phone.

I'm not sure at this point why you can't get the app at least partly working, as it is on the Galaxy 5. If you are still getting "Debug Info Unavailable" that means we don't have some useful info, and there too I'm not sure why.

I got the adb logcat output from you via email, but there's absolutely no log messages from my app in there, nor any sign of an attempt to start the app.

So, if you can first install the latest July 30 version I just uploaded to the Market...

Then, if you can run "adb logcat > result.txt", start my app, wait 30 seconds, then terminate the logcat with Ctrl-C, and send me that result.txt file, hopefully we can find out more.
[Spirit FM] mikereidis:
v July 30

v July 30 is now on the Market.

Seeking should hopefully be fixed now, particularly in regions with 50 KHz offsets.

I also reduced the seek stop threshold. Please let me know if you see "nuisance stops" of the seek function. IE. If you seek from 101.1 and it stops at 101.3 just because of adjacent channel interference. There is a way to configure the threshold, but not in the Settings menu yet.

There were also a few rather minor fixes/changes made, as well as a modification of the unlock detection code that should hopefully fix things for anyone experiencing problems with the Unlocker.
[Spirit FM] mikereidis:
Thanks. Yeah I thought you were farther along with high quality audio.

I spent several hours the other day going over the latest public Texas Instruments FM code. Buried in the ton of code is stuff for FM over BT headsets, perhaps even A2 or A3dp, as well as HCI/SCO I think. It seems as if the less popular the chip, the more open the code or other info...

I spilled all the TI info I had at the time on this thread, but nobody else showed up, LOL. http://xdaforums.com/showthread.php?t=957323

Official Apple iPhone FM app rumours have swirled for years, but never born "fruit". IMO it would be a "holy grail" to get FM working on iPhone, but I'm pretty sure such an app would require jailbreak, and even if it didn't Apple would never allow such an app.

The theory seems to be that iTunes is more profitable than an Apple FM app, despite Apple holding patents on methods to monetize FM.
[Spirit FM] _wyrm:
You may find this pseudocode useful for bcm4329 fm over sco/headset.

r_01 = 0x20;
r_4d |= 0x80;

hcitool cmd 1 7 Y 0 e0 1 # Force SCO connection. Y = ACL handle
[Spirit FM] denzel09:
Send you logcat
[Spirit FM] mikereidis:
Thanks !

I can see the problem in the logcat:

W/ActivityManager( 890): Unable to start service Intent { cmp=com.mikersmicros.fm/.fm_srvc }: not found

Now I have to figure out WHY it's failing there and hopefully fix it.
[Spirit FM] denzel09:
Ok buddy, i hope in you
[Spirit FM] cos68:
Thank you very much.

Now seeking is working perfect also when region is set to Denmark being a 50 KHz offsets region. Great!

Also the new lower stop threshold seems to be working great for me. Now it stops at stations that it didn't find before. Even though these stations have low antenna signal they are strong enough to listen to. Thanks! It is perfect!
[Spirit FM] mikereidis:
Great ! THAT's what I like to hear. :)

Unfortunately most posts are about problems... Understandable but depressing sometimes...
[Spirit FM] zekesic:
It works flawlessly in my LG Optimus One with AmberHome ROM 1.1

Great for emergencies when i don't have my headphones ;)
[Spirit FM] denzel09:
Buddy, i have send you new logcat.

Finally no previous problem. But i don't hear sounds, nothing sounds. I don't know if problem is poor signal or other.

Great progress ;)
[Spirit FM] mikereidis:
Great ! My Broadcom test phone is Optimus One p500h. I usually run CM7 but have also tested devoid ROM.
[Spirit FM] mikereidis:
Good. Yes I can see the worst problem is gone now in your log.

I see it seems to work, more or less, at the start, but errors happen later.

I'll look more closely later, but I HAVE to attend to an UNLOCKER bug that at least 2 people are having now.

Of course it's completely unacceptable that unlocking the app should stop the app from working. That MIGHT explain some of the cancelled sales I've seen.
[Spirit FM] denzel09:
Ok;)

So it will be fixable?
[Spirit FM] mikereidis:
Maybe. ;)

My head is spinning right now, but if your phone has a stock FM app (It does?), I think it will be possible.

BUT, my luck has been bad with Samsung devices so far. The Galaxy 5 ALMOST works.
[Spirit FM] mikereidis:
Great thanks ! I'll try this. I suspect a few people will be at least a bit happy to get audio, even if lo-fi and mono.

I read the IRC logs with great interest. Perhaps a public rev eng effort is called for, as was done for the WiFi side of Broadcom chips.
[Spirit FM] mikereidis:
I uploaded a July 31 "Emergency Update" to the Market. It's also available here:

http://www.mediafire.com/file/lfzi49tlar9g254/Spirit_FM_Radio_v110731.apk

This version is completely unlocked due to the unacceptable problems at least 2 people have had with the Unlocker.

It will revert to locked again when I can find a bug free mechanism.

I hope those of you who purchased will understand that this is for you, despite that it appears people are getting a free unlocked version when you paid for yours. They are, but just for this version...

Please let me know of any problems, thanks !
[Spirit FM] denzel09:
Sure, it has stock FM app ;)
[Spirit FM] LenAsh:
Spirit 2 31/7 works with root on stock Z2 phone. Volume control more granular than Spirit 1 atm. Presumably not working on CM yet - bit of a fag to try if it's a definite no-go yet!

Not sure what's actually changed on Spirit 1 31/7.

(Incidentally, Nokia 630 WP 8.1 (£99 SIM Free) has a reasonably good stock FM radio).
[Spirit FM] mikereidis:
July 31 0731 releases of both Spirit1 and Spirit2 are on Play since about 04:00 EST.

Spirit1 WAS "20% rollout" (now 100%) and Spirit2 is fully rolled out.

Spirit2 July 31:

- Broadcom BT Shim installed only if One M7, G2, or Z2 and Bluetooth must be on at Spirit start.

Spirit2 July 30:

- Sony Xperia M antenna = "Internal/Headset", unlike most of recent Sony Qualcomm devices.

- Sony Xperia Z1 & Z2 support, fixes and adjustments.

- Lower excessive RSSI polling rate to 1 every 5 seconds.

Spirit1 July 31:

- Broadcom BT Shim installed only if One M7, G2, or Z2 and Bluetooth must be on at Spirit start.

- LG G2 Volume fix for Vanir ROM.

Spirit1 July 30:

- Sony Xperia M antenna = "Internal/Headset", unlike most of recent Sony Qualcomm devices.

- Sony Xperia Z1 & Z2 support, fixes and adjustments.

- MotoG stock audio method change for stock 4.4.4.

- android.hardware.fmradio -> qcom.fmradio: This may enable Spirit to work on recent

The last, "android.hardware.fmradio -> qcom.fmradio" may enable Spirit to work on recent Qualcomm FM/combo chip devices that are stock and unrooted; eg One M8 and LG G3.

It will also make Spirit stop working on older stock, unrooted Qualcomm devices, most notably HTC OneXL, OneS, Evo4g. I'm waiting to see if I get notable complaints; I think very few (if any) people are running Spirit1 on these stock and unrooted, and to fix it "right" requires the messiness of a bunch of new code, and at least 20 hours of work to implement and test.
[Spirit FM] mikereidis:
Good...

Yes I'm pretty sure there is no way Spirit works on AOSP Z2 yet, unless a stock audio blob is used and the stars are aligned.

Changes posted above.

Wanna say I'm not interested in Nokia, but... Is it a standard MS FM app, as seen on other phones, or Nokia FM app ? I know there were some issues with MS not supporting FM for a while, but don't know the latest. Same with Blackberry.

But the declining market share of both BB and WP make me pretty much indifferent to what's happening on those platforms.

Same with Android ported to BB devices. A few have tried Spirit, with no luck, and I hardly even want to look at any debug logs.
[Spirit FM] mervluk:
I assume the Sony buffer rate hasn't changed in the 31 July Spirit2? 5120 bytes in Spirit1 works perfectly. Spirit2 just distorts occasionally, though almost eliminated by raising min CPU speed, so it's now de minimus.
[Spirit FM] mikereidis:
No change.

Here's a test release of S2 that uses 5120 byte buffers for all Qualcomm devices except older HTCs OneXL/S/Evo 4G: http://d-h.st/afc

Unless problems become apparent, next public release will have this change.
[Spirit FM] mervluk:
Great! And works perfectly with Viper4Android on my XZ giving more vibrant audio than streaming, even at higher bit rates.
[Spirit FM] Lagkage:
After trying Spirit1 UL on my Xperia Z2, Bluetooth won't turn on and reboot doesn't fix it. Any Suggestions?
[Spirit FM] LenAsh:
Works OK for me on 314, Root denied. Don't get any weird interaction between BT and FM - unlike LG G2.

Not sure how it has permanently screwed BT - I would say uninstall the app and clear cache and dalvik - but you probably don't have custom recovery.

What ROM/build are you using...?
[Spirit FM] Fnord12:
Hwa? Sometimes it seems i'm the only one here that hasn't had any problems at all with the G2. Flashing? no problems with my monthly CM11 upgrades. Bluetooth and Spirit 2? Also zero issues once the reboot dance has been done after I upgrade.
[Spirit FM] LenAsh:
To be fair, I'm going back a few builds.
[Spirit FM] mikereidis:
Yes.

Turn Bluetooth off and start a recent version of Spirit2, such as this one: http://d-h.st/afc Tap the "Menu" button at bottom middle and select the right-most button, labeled "RBTS".

Alternately, with Spirit1, select Menu-> Test-> BC-> BT Shim Remove (near bottom).

These should completely remove the Bluetooth shim. Reboot and everything should be back to normal. But since you are having unexpected problems, it might not work. You can re-install the ROM; wiping is neither needed nor useful, it just has to replace the original /system/lib/libbt-hci.so file which you could do manually if so skilled (if libbt-hcio.so is about 25K, use mv libbt-hcio.so libbt-hci.so), but also remove /system/addon.d/99-spirit.sh .

Now if you start Spirit1 or Spirit2 with Bluetooth on, the shim will be re-installed. You can prevent this reinstall in Spirit1 by setting Debug-> HCI Access to UART. Spirit2 has no way to avoid except keeping BT off.

Now why the shim isn't working for you, I don't know. Maybe you're running a ROM it won't work on.

Latest July 31 Spirit1 & Spirit2 releases will now only automatically* install the shim on LG G2, HTC One M7 and Xperia Z2 and only when BT is on. *It can be forced in Spirit1 with Debug-> HCI Access = Bluedroid, or in Spirit2 with Menu-> IBTS.
[Spirit FM] mikereidis:
Root denied means Spirit doesn't have the opportunity to mess things up too bad, LOL.

Using Spirit1 (only) on stock Broadcom based devices, like LG G2 and Sony Z2, it can be useful to use the Broadcom OEM FM API for fewer problems, even when rooted. This allows FM to keep working even when BT is turned on or off, which is most useful when FM over BT is desired part of the time, and wired headset/speaker the rest of the time.

This isn't an option on HTC One M7 w/ KitKat sadly, since HTC "secured" access to the FM API.

The decision logic in Spirit1 about which API to use is subject to ongoing change, so the easiest way to ensure the OEM API is used (if possible) is to set Debug-> FM API to OEM Proprietary.
[Spirit FM] mikereidis:
The "Start Spirit, then Reboot" dance should not be needed anymore, as long as your phone has a /system/addon.d/ directory, and a recovery that supports that.

When installing the shim, Spirit creates a /system/addon.d/99-spirit.sh script that runs after a ROM is updated, and fixes things. This moves the new ROM libbt-hci.so file to libbt-hcio.so, then restores Spirit's file to libbt-hci.so .

That said, different recoveries can work differently, by design or error.

And,... there's a "billion" things that can go wrong in the world of software. I regularly get emails from people who are having strange problems, despite that they are using a VERY popular phone and ROM, such as CM11 nightlies on GT-I9300 or GT-I9100.

I test the heck out of these phones that I own on the latest CM11's. AND there are a HUGE number of people and customers running these phones on these ROMs, so if there are general problems, my email will be full of such reports.

Most of these cases seem to eventually resolve, weeks or months later. Many of them are found to be due to some app or mod that interferes, or just needing a new ROM or wipe.
[Spirit FM] Fnord12:
Neat, that'll be useful for this month's update. I do see that particular script there and i'll assume that TWRP supports it (though that reminds me, i've got to check for an update)
[Spirit FM] Lagkage:
Thanks Mike. It has been a while since I last posted in this thread, but your work is still amazing. I have updated my Z2 from 17.1.1.A.0.402 rooted with this method from DooMLoRD to 17.1.2.A.0.314 and that also fixed the Bluetooth problem. It is unrooted right now. [MENTION=3830277]LenAsh[/MENTION] may I ask what method you used to root?
[Spirit FM] LenAsh:
This method: http://xdaforums.com/showthread.php?t=2559009
[Spirit FM] mikereidis:
Yeah, I see 17.1.1.A.0.402 is ready for my Z2 tablet, but I guess rooting or installing the dual recovery results in me not getting the OTA.

I'm going to hold off right now with updating. Too much risk with relatively unknown reward.
[Spirit FM] mikereidis:
VACATION ANNOUNCEMENT :)

Details to be filled in later, but I BADLY need some time off again. It's a "long weekend", but here I still am after another of many 60-70 hour work weeks. I need to start saying "No" more often.

So I'll be taking time off (from Spirit at least, but need a few days of fun too)

And I'll be trying to direct email and other queries here, to search for the TONS of information present, and perhaps ask who-ever else might lend a hand. :)

Thanks. :)
[Spirit FM] mikereidis:
August 2 0802 production releases are on Play for both Spirit1 and Spirit2.

Hopefully the Spirit2 call/audio problems are resolved, and I can better enjoy some time off...

Spirit2:

- GS3/Note2 Fix phone call and other audio problems after using speaker mode. Speaker mode may not work on Note2, and may be no volume control on GS3, but that's better than silent phone calls needing a reboot.

- 5120 byte buffers for all Qualcomm devices besides old HTCs: OneXL/S/Evo 4g. Hopefully this will reduce or eliminate audio dropouts, and not produce bad audio on any.

Spirit1:

- Stock 4.3+ GS3/Note2 use SU for ssd needs, such as digital audio.

- Automatic audio method for GT-I8160 Ace 2 (GS3/Note/S2_ICS).
[Spirit FM] mikereidis:
HTC One M8: I have a healthy bid in for one on Ebay and expect to have one in my collection before long... :D

EDIT: darn, exceeded my $407 max bid with $412 Canadian... Can get new for $650 so I'll likely go that way.

Still thinking about a Sony Z; it's hard to support Z properly with closest being a Z1.
[Spirit FM] marduj5:
i8190 kitkat

Spirit fm working on cm10.1 on my s3 mini but it does not work on cm11 kitkat.Why?
[Spirit FM] ch3mn3y:
@up

Try using both spirit and spirit2. For me if i start spirit, close it and than start spirit2, s2 works fine on carbon kk (cm based)

Sent using C6833 - Carbon KitKat/Pimped Z1 Kernel
[Spirit FM] mikereidis:
On Z Ultra ?

Sounds like S1 is loading the FM driver OK, but S2 isn't.
[Spirit FM] mikereidis:
Does tuner work but no audio ?

Try Audio-> Method = "Galaxy S2/Note/S2_ICS".

If that doesn't work then CM may have moved away from audio library/HAL blob to open source driver.

In that case, I haven't a clue how to fix.
[Spirit FM] marduj5:
Yes I manage to tune stations but no sound at all.I tried everything.This app worked till now on every cm rom.I tried it on my old galaxy s i9000 on Mackay kitkat rom and it is working but on s3 mini kitkat doesn't work.
[Spirit FM] epivitor:
Hi guys, I have a Moto G and after the last update to 4.4.4 I have problems with both Spirit1 and Spirit2. The volume is very very low and the signal isnt that good too.

When I was with 4.4.2 everything used to work like charm.

Is there any known issue with 4.4.4? Should we wait for an update that fixes the problem?

Regards
[Spirit FM] mikereidis:
New Macław ROM ? : http://xdaforums.com/showthread.php?t=2521593

Yes, I've been warning for a while that CM might move to open source audio, which has no support for FM most likely.

I have no good knowledge of the underlying NovaThor audio and it's ALSA driver. I tried once or twice to enable it with no luck.

I even have an Xperia P with similar audio, and it's just not worth it for me to spend the time on it for Sony's.

I've actually been surprised to see how many GS3 mini customers I have in my sales stats. Then again, it's about same as GS5 in the last 6 months, and GS5 is impossible to support.

In the end, I don't think I'll be able to justify all the time it would take me to properly support the GS3 mini. They can be had for $210 or so now, but that's nothing compared to the minimum of 50-100 hours of work required.

Unless someone can figure out the magic to enable FM audio, the best answer may be using other ROMs using the Samsung blobs. Or a new phone...