[APP][4.1+] Spirit2: Real FM Radio for AOSP & root

What name would you prefer for this new FM app ?

  • Spirit2

    Votes: 441 81.4%
  • a2d.fm

    Votes: 23 4.2%
  • a2d

    Votes: 1 0.2%
  • A2D FM

    Votes: 51 9.4%
  • A2D

    Votes: 8 1.5%
  • Other: Please post

    Votes: 29 5.4%

  • Total voters
    542
Status
Not open for further replies.
Search This thread

mikereidis

Inactive Recognized Developer
Jan 28, 2011
7,823
4,146
Ottawa/Gatineau, Canada
Android ONE = Google FM Radio ?? !!

Android ONE = Google FM Radio ?? !!

Today may be the first time in 4 years that a Google executive put the words FM and Radio next to each other.

Android ONE may be under $100 and intended for "emerging markets".

And "emerging markets" pretty much demand FM radio since they don't have widespread connectivity and/or wealth for streaming via data. So it makes absolute sense to include FM or the phones will flop.

So,... Interesting... Maybe we'll see a real live Google built FM radio app soon. Maybe on Google Auto too.

I see no reason to believe that Google will start supporting FM in general, but if the source code is open and can be adapted to different FM/combo chips, then it could become more common on AOSP ROMs.

This may or may not impact Spirit and myself greatly. Regardless, it seems even more essential now to "have my toe in the water" regarding non-FM apps, such as the AudioTricks app in my sig in early development now.

EDIT: 5000 new APIs for preview tomorrow. Wouldn't be surprised to see FM? in there, though unusable on Nexus (unless there's a magic hidden switch, which would be great to discover.) http://www.androidpolice.com/2014/0...-apis-including-usb-audio-bt-4-1-burst-photo/
 
Last edited:

mikereidis

Inactive Recognized Developer
Jan 28, 2011
7,823
4,146
Ottawa/Gatineau, Canada
Hi,

I vote for having two threads. That people do not mention Phone and ROM is another problem. At that point we should be more
consequent. Or have an XDA rule to place this in the signature...

But having Spirit1 and 2 things mixed up in one thread makes it even more difficult to follow a topic for the drive-by-reader.

In the end it is your decision. Just my 2-cents.

Best,
Frank

Thanks for your thoughts. :)

The post above this about Android ONE and FM Radio is duplicated. Not really more work for me, but it splits any discussion between the two threads and the subject impacts both Spirits to some extent.

There is already confusion over where to post, especially comparing the 2. And I'll often ask Spirit2 users if it works on Spirit1.

And this subject, about combining the threads, is duplicated.
 
G

GuestK00114

Guest
Android ONE = Google FM Radio ?? !!

This may or may not impact Spirit and myself greatly. Regardless, it seems even more essential now to "have my toe in the water" regarding non-FM apps, such as the AudioTricks app in my sig in early development now.

EDIT: 5000 new APIs for preview tomorrow. Wouldn't be surprised to see FM? in there, though unusable on Nexus (unless there's a magic hidden switch, which would be great to discover.) http://www.androidpolice.com/2014/0...-apis-including-usb-audio-bt-4-1-burst-photo/

Sounds good to me.
Not to forget Bluetooth 4.1 for connecting cellphones to home and car stereo and USB audio where one could stream audio digitally.
:D
 

pedro5148

Senior Member
Mar 28, 2014
258
54
Goiânia
I think that the only Optimus G's that can do FM are the VERY small percentage that shipped with a stock FM app.

Spirit2 does not require phone/ROM configuration, and provides none.

Spirit1 USUALLY just works automatically these days.

If your Optimus G shipped with a stock FM app, tell me what happens when you try to run Spirit1 or Spirit2, and give me info on ROM and root status.

The version of my Optimus G in Brazil, has no FM hardware is the E977 version, the rom is the stock 4.1.2, however I can install another if necessary, and the device is already routed

I read in some post that it would be possible to listen to radio with Bluetooth turned on, how to configure?
 

mikereidis

Inactive Recognized Developer
Jan 28, 2011
7,823
4,146
Ottawa/Gatineau, Canada
The version of my Optimus G in Brazil, has no FM hardware is the E977 version, the rom is the stock 4.1.2, however I can install another if necessary, and the device is already routed

I read in some post that it would be possible to listen to radio with Bluetooth turned on, how to configure?

Unless you have heard someone got FM working on that variant, I'd say forget about it.

They ALL have FM hardware inside the Qualcomm FM/BT/WiFi combo chip. The only difference is whether or not the FM antenna pins on the chip are grounded to disable them, or connected through 1 cent worth of parts to the headset jack.

BT isn't an issue with the Qualcomm chips. If Spirit1 or Spirit2 don't work with all default settings, then you have one of the non-FM supporting models like the other 99+% of OGs.
 

pedro5148

Senior Member
Mar 28, 2014
258
54
Goiânia
Unless you have heard someone got FM working on that variant, I'd say forget about it.

They ALL have FM hardware inside the Qualcomm FM/BT/WiFi combo chip. The only difference is whether or not the FM antenna pins on the chip are grounded to disable them, or connected through 1 cent worth of parts to the headset jack.

BT isn't an issue with the Qualcomm chips. If Spirit1 or Spirit2 don't work with all default settings, then you have one of the non-FM supporting models like the other 99+% of OGs.

Okay then, thanks for the clarification and the attention

:crying:
 

mikereidis

Inactive Recognized Developer
Jan 28, 2011
7,823
4,146
Ottawa/Gatineau, Canada
This thread has been re-opened as of November 24, 2014. The 1st 10 posts of this Spirit2 thread are documentation and need to be updated.


Spirit2 RC2 beta for Lollipop: November 24 / 141124:

Now on Play for customers signed up for betas: https://play.google.com/apps/testing/fm.a2d.s2 , or email mikereidis@gmail.com for a test copy.

This is "Release Candidate 2" and I will likely "pull the switch" and activate it as the "production" version, in about 12 hours, after some sleep and checking messages to ensure that nothing has horribly broken in the new release.


I am also very happy to announce "Spirit2 Free: Open Source Real FM Radio for AOSP & Root".

I have taken the essential features of my commercial Spirit2 FM app: https://play.google.com/store/apps/details?id=fm.a2d.s2

And I've open sourced the result under GPLv3 AFFERO.

Please see this new thread for further information: http://xdaforums.com/apps/spirit-fm/app-spirit2-free-source-real-fm-radio-t2951455

20% Off the usual Spirit1 and Spirit2 Play store prices Monday-Friday only, in celebration of the 1st release of Spirit2 Free and "Dark November Week". An extra 10% for "Black Friday". :)

==============================================================================================================================================================================
Spirit is my full time job, but I'm sorry to say I still make less than half of my corporate salaries, and work about twice the hours, for the last almost 4 years, from early 2011.

I appreciate the financial support of people buying my apps, Spirit2: https://play.google.com/store/apps/details?id=fm.a2d.s2 and the older Spirit1: https://play.google.com/store/apps/details?id=com.mikersmicros.fm_unlock

I am also happy to accept Paypal "donations" to my mikereidis@gmail.com address : https://www.paypal.com/cgi-bin/webs...=PP-DonationsBF:btn_donateCC_LG.gif:NonHosted

The commercial Spirit2 has many features that are not in this Spirit2 Free app. As time goes by, I may move paid features to the free version. The closer I can get to a "normal" salary, the more willing I will be to do so.

Thanks ! :)
Mike Reid.
==============================================================================================================================================================================

"Regular" Spirit2 stuff can go in this thread, I guess. We'll figure it out. :)
 
Last edited:
  • Like
Reactions: PunchUp and jesus_c

HorstiG

Senior Member
Mar 14, 2013
4,844
2,735
Banja Luka RS
This thread has been re-opened as of November 24, 2014. The 1st 10 posts of this Spirit2 thread are documentation and need to be updated.


Spirit2 RC2 beta for Lollipop: November 24 / 141124:

Now on Play for customers signed up for betas: https://play.google.com/apps/testing/fm.a2d.s2 , or email mikereidis@gmail.com for a test copy.

This is "Release Candidate 2" and I will likely "pull the switch" and activate it as the "production" version, in about 12 hours, after some sleep and checking messages to ensure that nothing has horribly broken in the new release.


I am also very happy to announce "Spirit2 Free: Open Source Real FM Radio for AOSP & Root".

I have taken the essential features of my commercial Spirit2 FM app: https://play.google.com/store/apps/details?id=fm.a2d.s2

And I've open sourced the result under GPLv3 AFFERO.

Please see this new thread for further information: http://xdaforums.com/apps/spirit-fm/app-spirit2-free-source-real-fm-radio-t2951455

20% Off the usual Spirit1 and Spirit2 Play store prices Monday-Friday only, in celebration of the 1st release of Spirit2 Free and "Dark November Week". An extra 10% for "Black Friday". :)

==============================================================================================================================================================================
Spirit is my full time job, but I'm sorry to say I still make less than half of my corporate salaries, and work about twice the hours, for the last almost 4 years, from early 2011.

I appreciate the financial support of people buying my apps, Spirit2: https://play.google.com/store/apps/details?id=fm.a2d.s2 and the older Spirit1: https://play.google.com/store/apps/details?id=com.mikersmicros.fm_unlock

I am also happy to accept Paypal "donations" to my mikereidis@gmail.com address : https://www.paypal.com/cgi-bin/webs...=PP-DonationsBF:btn_donateCC_LG.gif:NonHosted

The commercial Spirit2 has many features that are not in this Spirit2 Free app. As time goes by, I may move paid features to the free version. The closer I can get to a "normal" salary, the more willing I will be to do so.

Thanks ! :)
Mike Reid.
==============================================================================================================================================================================

"Regular" Spirit2 stuff can go in this thread, I guess. We'll figure it out. :)

There is nothing better, not the app works with Galaxy S5. (G900F)

Can you do something? I bought Spirit 1 and 2 and miss it completely.
 
Last edited:

mikereidis

Inactive Recognized Developer
Jan 28, 2011
7,823
4,146
Ottawa/Gatineau, Canada
There is nothing better, not the app works with Galaxy S5. (G900F)

Can you do something? I bought Spirit 1 and 2 and miss it completely.

:)

No. :(

The only GS5 with FM is the very rare US Sprint variant.

I suggest a phone with FM (HTC, Sony) or a Sony BT headset with FM built in.

There is also SDR Touch for those who don't mind a USB dongle and high battery consumption.


I just did my sales stats so far for November. As usual GS3 GT-I9300 is still at top with 30% and GS2 at 14%.

These are "old" phones for Android enthusiasts now, and my income continues to trend downwards as a result.

Samsung removing FM from flagships starting with GS4 has had a major effect on me. :(
 

mikereidis

Inactive Recognized Developer
Jan 28, 2011
7,823
4,146
Ottawa/Gatineau, Canada
@mikereidis

how can i join the Beta group?

:)


Step 1: Buy Spirit1 or Spirit2 and go here to verify it shows as purchased and you are thus logged in as needed, for Spirit2: https://play.google.com/store/apps/details?id=fm.a2d.s2 or for Spirit1: https://play.google.com/store/apps/details?id=com.mikersmicros.fm_unlock

Step 2: Go here and click the "Become a tester" button, for Spirit2: https://play.google.com/apps/testing/fm.a2d.s2 or Spirit1: https://play.google.com/apps/testing/com.mikersmicros.fm_unlock

If you can't see a button, I think you'll need to sign up for Google+ and going here and joining the group might help, for Spirit2: https://plus.google.com/u/0/communities/109620957330193229286 or for Spirit1: https://plus.google.com/u/0/communities/118032870995675059664

Step 3: Wait for me to approve the request. I check once or twice a day and approve everyone who requests.


Please let me know how it goes, and whether or not you were already on Google+.

Previously, several people said they get a blank page or similar in Step 2. But now that I've been clued into the Google+ association, I think the above should work.


Or just email me mikereidis@gmail.com for the beta.

At this time the beta is functionally identical to the version the Play store will load onto Lollipop devices. This may remain true at least until CM12 and/or other L ROMs start regular OTAs. nightly or weekly.

IE, anyone running Lollipop at this time should expect plenty of issues unrelated to Spirit, so beta releases of Spirit make sense as well.
 

HorstiG

Senior Member
Mar 14, 2013
4,844
2,735
Banja Luka RS
:)

No. :(

The only GS5 with FM is the very rare US Sprint variant.

I suggest a phone with FM (HTC, Sony) or a Sony BT headset with FM built in.

There is also SDR Touch for those who don't mind a USB dongle and high battery consumption.


I just did my sales stats so far for November. As usual GS3 GT-I9300 is still at top with 30% and GS2 at 14%.

These are "old" phones for Android enthusiasts now, and my income continues to trend downwards as a result.

Samsung removing FM from flagships starting with GS4 has had a major effect on me. :(
Thanks for yor Answer and one off the best Apps in Store ever.
Goodbye Horst

HGT - Galaxy S3 - S5 - Tesla TTL7 any AOSP ROM
 

lbertking

Member
Apr 25, 2013
30
0
Ica
This thread has been re-opened as of November 24, 2014. The 1st 10 posts of this Spirit2 thread are documentation and need to be updated.


Spirit2 RC2 beta for Lollipop: November 24 / 141124:

Now on Play for customers signed up for betas: https://play.google.com/apps/testing/fm.a2d.s2 , or email mikereidis@gmail.com for a test copy.

This is "Release Candidate 2" and I will likely "pull the switch" and activate it as the "production" version, in about 12 hours, after some sleep and checking messages to ensure that nothing has horribly broken in the new release.


I am also very happy to announce "Spirit2 Free: Open Source Real FM Radio for AOSP & Root".

I have taken the essential features of my commercial Spirit2 FM app: https://play.google.com/store/apps/details?id=fm.a2d.s2

And I've open sourced the result under GPLv3 AFFERO.

Please see this new thread for further information: http://xdaforums.com/apps/spirit-fm/app-spirit2-free-source-real-fm-radio-t2951455

20% Off the usual Spirit1 and Spirit2 Play store prices Monday-Friday only, in celebration of the 1st release of Spirit2 Free and "Dark November Week". An extra 10% for "Black Friday". :)

==============================================================================================================================================================================
Spirit is my full time job, but I'm sorry to say I still make less than half of my corporate salaries, and work about twice the hours, for the last almost 4 years, from early 2011.

I appreciate the financial support of people buying my apps, Spirit2: https://play.google.com/store/apps/details?id=fm.a2d.s2 and the older Spirit1: https://play.google.com/store/apps/details?id=com.mikersmicros.fm_unlock

I am also happy to accept Paypal "donations" to my mikereidis@gmail.com address : https://www.paypal.com/cgi-bin/webs...=PP-DonationsBF:btn_donateCC_LG.gif:NonHosted

The commercial Spirit2 has many features that are not in this Spirit2 Free app. As time goes by, I may move paid features to the free version. The closer I can get to a "normal" salary, the more willing I will be to do so.

Thanks ! :)
Mike Reid.
==============================================================================================================================================================================

"Regular" Spirit2 stuff can go in this thread, I guess. We'll figure it out. :)
it works E970?
 
Status
Not open for further replies.

Top Liked Posts

  • There are no posts matching your filters.
  • 64
    Spirit2 is the successor to Spirit1 Unlocked and is the "Best Darn FM app"* in existence ! :)

    I'm closing this thread again in favor of the general Spirit1/Spirit2 thread: http://xdaforums.com/showthread.php?t=1059296&page=868#post57106533

    It's too confusing trying to figure out where to post what.

    I will update first 10 posts of this thread as documentation when I can.

    Spirit2 Beta releases on Play for customers, updated sign up info: http://xdaforums.com/showpost.php?p=57079402&postcount=795

    Android ONE = Google FM Radio ?? !! http://xdaforums.com/showpost.php?p=53677209&postcount=781

    Spirit2:
    Hi Mike, I am still enjoying Spirit 1, is there any reason to pay again for Spirit 2? : http://xdaforums.com/showpost.php?p=52304934&postcount=647

    HTC One M8 Verizon ! :) http://xdaforums.com/showthread.php?p=51904184

    Spirit2 is a real, tuned, over-the-air FM radio app for Android. It does not require Internet access.

    Requires AOSP !: If you don't know what AOSP means, Spirit2 is not for you. Spirit1 Unlocked works on numerous stock phones: http://xdaforums.com/showthread.php?t=1059296

    *"Best darn FM app": Yes, it has some bugs, and some device support issues, and may lack some of the "polish" of many stock FM apps, but it's the most functional and even the current RC1 has more settings than stock apps.

    The ONLY FM app supporting ALL this: Equalizer, Effects, Recording, BT A2DP and Visualizer.

    Spirit2 also supports multiple "remote" displays and controls: Home and lock-screen widget, lock-screen, notification shade, BT AVRCP and future Android remotes. AVRCP puts RDS and station info on the display of compatible BT headsets, and controls Pause/Play and preset selection. Was pretty cool the first time I saw that working. ;)


    Install Spirit2 RC2, March 26 Google Play: https://play.google.com/store/apps/details?id=fm.a2d.s2

    Spirit2 Beta group. Latest releases for Play customers: https://play.google.com/apps/testing/fm.a2d.s2


    March 25 New Info:


    "Upgrades" from Spirit1:


    If you've been happily using Spirit1 Unlocked for at least 3-6 months, please consider Spirit2 as a second purchase, for a next generation FM app. Help me give Spirit2 the 3+ year lifespan that Spirit1 has had so far. My income is still at the lowest end of "tolerable". Support me and I can support you.

    The price is a bit higher than Spirit1 Unlocked. It will be dropped a bit on the 1st day of each month.

    At Release Candidate #1 all known major bugs have been addressed. Please understand: software always has bugs, new ROMs can require new code and improvements are ongoing.

    Thanks ! :)
    Mike.
    13
    Spirit2 "Official Support"*: ONLY these phones running "Compatible AOSP"** ROMs:

    • Samsung GS3 GT-I9300
    • Samsung GS2 GT-I9100
    • Samsung GS1 GT-I9000
    • Samsung Note2 GT-N7100
    • Samsung Note1 GT-N7000
    • HTC One (GPE requires BT off)
    • HTC OneXL LTE, OneS, Evo 4G LTE (2013 CM11 only. 2014 kernels broke FM)
    • LG G2 D802 International and Sprint LS980 only. (Some stock, CM11 and Mahdi ROMs only as of March, 2014)
    • Motorola Moto G
    *"Official Support" means I own the phone and I can properly support it.


    **"Compatible AOSP" ROMs includes as many AOSP ROMs as I can reasonably support, that have the FM and audio kernel drivers needed to enable FM. CM11 is the most popular and best supported, except for the incompatible 2014 kernels for HTC OneXL LTE, OneS, and Evo 4G LTE. LG G2 is only supportable on CM11 and Mahdi ROMs as of March, 2014.


    Unofficial Support:

    The only other devices with a chance of working fully are those with Qualcomm WCN3660 or newer compatible FM/BT/WiFi chips as well as Qualcomm WDC9310 or newer compatible audio chips. This includes most late 2012+ Sony devices starting with Xperia T. These may or may not work well, and are not officially supported. With sufficient demand I will consider buying a "Z" device and officially supporting some Sony's.


    Stock ROMs:

    Spirit2 also works reasonably well on many stock or stock derived ROMs when rooted. But there are often problems, such as FM over BT issues on Samsung stock ROMs. Most of my customers are on AOSP/CM ROMs.

    Stock FM apps are available on stock ROMs, and few stock ROM users support Spirit financially, so I focus on AOSP. The Death of access to stock, unrooted OEM proprietary FM APIs has sharpened that focus: http://xdaforums.com/showthread.php?p=50954346


    Support for New Devices:

    Support for new devices will be considered IF all of these are true:

    • FM is possible. GS4, Note3 (except Sprint) and GS5 are not possible for anyone to ever support. See GS5: http://xdaforums.com/showpost.php?p=50600906&postcount=7541
    • Digital FM Audio is possible, the Spirit way. Most higher end 2013+ phones are capable, as well as some lower end, such as Moto G.
    • Popular among AOSP ROM users. Galaxy S and 5 inch Note class flagships are the vast majority of Spirit2 and current Spirit1 Unlocked sales.
    • Higher end ; Inexpensive phones are great, but most apps are sold on high end devices.
    • I need to be convinced that the costs of purchasing this phone, PLUS the much greater costs of supporting it will result in at least a liveable wage. Just learning how to and flashing various ROMs can add up to hundreds of hours. Add fixing soft-bricks, learning the HW & SW, investigating, reverse-engineering, coding, and doing ongoing updates, fixes, workarounds and support and you get a glimpse of why Spirit2 support is limited to a handful of the most popular devices.
    • Ideally, the non-International North American variants support FM, at least in hardware. LG G2 and all Samsungs are a great disappointment here.

    Every day I get MANY Spirit1 Unlocked debug logs in my email from pirates. Most of them come from less expensive devices, especially Mediatek devices from Huawei, ZTE, and much lesser known companies.

    I have little interest in supporting phones that might earn me $100 if I got lucky, and would drown my email with even more pirate debug logs.
    10
    Usage:

    Power control:

    • Status: Center of shiny frequency dial power icon is blue if on or grey if off.
    • Toggle: Tap center of shiny frequency dial where blue (if on) or grey (if off) power icon is.
    • On: Tap Play button at lower right or in widget.
    • Off: Tap square Stop button at lower left, in widget or in notification shade.
    • Auto on: Start app to automatically turn on FM.
    • Auto off: Start another music app and FM will automatically turn off.
    Tuning:

    • Dial: Big shiny frequency dial displays and can be used to set frequency.
    • Blue Digital: Tap numbers to manually enter frequency.
    • Seek: Previous and Next buttons to left and right of Blue Digital display seek down or up to next strong station. Same for widget, notification shade, lock-screen and other remote controls, but ONLY when there are less than 2 presets programmed.
    • -/+: Left and right buttons below seek buttons tune down or up to next valid channel, depending on Band setting.
    • Presets: There are 16 presets at bottom. Press or long press a "+" to set or reset the current frequency as a preset. RDS names are now supported.
    • Preset -/+: When 2 or more presets are programmed, they can be navigated with the Previous and Next buttons for the widget, notification shade, lock-screen and other remote controls. With 0-1 presets, these are seek controls.
    Mute/Unmute:

    • Status: Pause/Play button at lower right, in widget or in notification shade shows expected result of tapping it. Eg shows Pause if currently playing.
    • Toggle: Tap Pause/Play button to pause or play audio.
    Volume:

    • Status/Change: Tap speaker button at top right or use hardware or headset media buttons to display and change Music stream volume.
    Record:

    • Status: Red button at top left is brighter when recording.
    • Toggle: Tap red button to change recording state. Files at /sdcard/Music/fm.
    Equalizer:

    • AOSP compatible equalizers, such as CM DSP Manager, can be accessed in ROM Audio settings, or with the Spirit2 on app "Menu" key (not the old style phone Menu keys). This key has 3 horizontal lines and is at low center between Stop and Pause/Play.
    Settings:

    • Some settings are accessible by swiping from right to left to access a window to the right of the main window.
    • UI Visual: To replace the frequency dial with a waveform and spectrum analysis visualizer.
    • Band: Use "USA" in North America or "EU+" everywhere else.
    • Tuner Stereo: Stereo 2 channel when checked or Mono when unchecked.
    • Tuner AF: Alternate Frequency switching enabled when checked.
    • Audio Stereo: Distinct from Tuner Stereo and can lower CPU load and recording size.
    • Audio Speaker: Experimental Speaker mode works on some phones but may have volume control issues.


    Notes:

    • Other settings: none at this time.
    • Debug log sending is experimental.
    • Remote display and controls: for lock-screen, notification shade, widget, wired headset media buttons and remote controls and info display via BT AVRCP.
    • Speaker output experimental. Workaround: remove wired headset plug enough to switch to speaker, but still inserted enough for a good antenna connection.
    6
    About "Digital Audio":

    History:

    Before 2013, most FM radio audio on Android phones was "mostly analog"*. FM audio bypassed the digital audio chain and was injected in the final stages, after the final D->A conversions.

    FM audio was a special path that did not follow the same rules as every other source of audio on Android. Hundreds if times I've heard "... but it works fine with music players etc." and I explained how FM is different. Fm audio usually can not be equalized or modified with effects. It usually can not be recorded, visualized, or routed to BT headsets.


    AOSP Difficulties:

    Besides lacking these digital audio features, "non-digital"** FM audio is difficult to do on AOSP ROMs. AOSP usually does not use the stock audio libraries that contain support for FM. This has been a never ending source of grief and work for me; I spend at least 50% of my development time on audio issues as a result.

    Basically, Spirit will use SU/root low level functions to set up the audio hardware for FM, via kernel device driver commands for ALSA or earlier APIs. But the ROM audio library has no idea that FM is running. This can often result in conflicts that break audio, especially during audio notifications. On some popular older devices, such as HTC Desire HD, I had to create a hack that resets the entire audio system when FM is turned off. And users just have to live with the fact that audio notifications break audio, at least until FM is turned off or the device is rebooted.

    There were many other problems, including a need to continuously loop a silent audio file, to convince the audio libraries that music was playing. Otherwise, volume control was lost, among other things.

    This was rarely a problem on CM7 ROMs that included a CM FM app, because the audio libraries supported FM. But most CM9 ICS and later ROMs dropped support for FM. I considered making code contributions to CM and other ROMs to fix this problem the proper way, in the audio libraries. But I concluded this would take all of my time, may create personal conflicts and might never cover the majority of ROMs anyway.


    *"Mostly" analog: Surprisingly, just about every FM chip does internal signal processing digitally, after the initial A->D conversions, Frustratingly, virtually every 2012- phone did not use digital outputs, where they existed, but converted the Digital left and right audio back to analog.

    "Non-digital"**: I do not use this term to strictly mean "Analog". I use it to mean a method to enable FM audio that stock OEM FM apps use, and that Spirit1 uses, when not using one of the "Digital..." Audio-> Method settings. At the chip level, the audio may be digital, as is the case when using Qualcomm FM/combo chips with Qualcomm WCD9310 or compatible audio chips.


    Spirit's Digital Audio Solution:

    A digital solution to most of these problems was envisioned in late 2012, and resulted in the 1st prototype alpha releases of Spirit2 in early 2013. Spirit2 was digital only and this proved to be a much easier way to do FM audio, with few problems. When it became clear how much more work was needed to complete Spirit2, and given that Spirit1 continued to sell well enough to live, digital audio was "back ported" to Spirit1.

    Here's how it works: Instead of just sending a few commands to the audio drivers, Digital audio mode sends different commands to enable digital, then continuously reads the ALSA PCM channel. All audio data read is then written to the Android Audiotrack API, the same as most streaming apps do. A streaming app reads from the network; but Spirit reads from the FM/audio chip.

    The main disadvantage of this digital audio method is higher CPU and battery consumption. OTOH, "non-digital" audio on most AOSP ROMs required a constantly looping silent audio file anyway, so the difference is minimized.

    Another digital disadvantage is that some devices can experience brief audio drop-outs. This does not affect Samsung devices. Full and partial workarounds include modifying CPU frequency or kernel scheduler. Tuning and investigative work is ongoing.

    There are also challenges for speaker mode. The current support is experimental and does not work on all devices. But the current code is much cleaner and much more robust than Spirit1 non-digital audio, which can have issues during phone call interruptions. Volume control can also be unusual over speaker. The reason for these problems is that Android is designed to switch to speaker only when the wired headset is unplugged. But FM is unique: the wired headset is used for the antenna. A workaround for motion-less devices: remove the wired headset plug just enough to switch to speaker, but not enough to lose the antenna affect.

    But the advantages of this form of digital audio are HUGE, IMO. They have allowed me to provide all the audio features people had been asking for: recording, equalization, effects, A2DP BT headset and visualizers.

    AND it allowed me to minimize the MANY FM specific audio problems with much smaller, better designed and better written code, with a minimum of special cases. The Spirit1 audio (and other) code is a huge mess and can never be re-written IMO.

    Audio dropouts on non-Samsung devices made me consider non-digital audio methods in Spirit2, despite the work and complications that would create. But a variety of fixes and re-tuning has improved audio, workarounds have been identified and work is ongoing.

    The advantages of digital only are too great IMO to "pollute" Spirit2 code with non-digital audio. I've even removed previous non-official support for stock Sony devices in order to concentrate on digital audio that is as flawless as possible.


    Drop-out Workarounds:

    Samsung devices only rarely have audio drop-outs. I've only seen this on the oldest, now "vintage" original Galaxy S GT-I9000, and only when recording, at the same time that the equalizer, effects and the visualizer are all running. The old single core CPU gets close enough to it's processing limit that very occasional ticks may be heard, but the recording is usually fine.

    LG G2 and Moto G are working pretty well now. The worst affected are the HTC One and the HTC OneXL/S/Evo 4G LTE, or other Qualcomm FM+audio devices. Further tuning and investigation is ongoing, but these things can minimize the problem:

    • Don't record.
    • Turn screen off.
    • Disable visualizers or any other app or service that might be using CPU resources.
    • Disable equalizer or other audio effects. Bass-boost and EQ alone don't seem too bad.
    • Raise CPU minimum and/or maximum frequency (Only if you understand the risks of CPU burnout.)
    • Change CPU scheduler: Performance risks CPU failure; Interactive or Pegasusq may be better.
    6
    Troubleshooting:

    Does not start:

    • SU/root missing is the most common problem. Ensure Spirit has permission enabled in the SuperUser or SuperSU app, or with the ROM Super* settings.
    • Omni & many other ROMs require manually flashing SuperSU. After flashing, run SuperSU and respond Yes when prompted to allow SU reflash after ROM updates.
    • If your device is not officially supported, it will likely not work. Except for devices with both recent Qualcomm FM and Qualcomm audio, phone architectures for FM are very different from each other.
    Stops playing or hangs:

    • Workaround: Force stop or reboot. Fixes are ongoing.
    Audio Stops at Homescreen:

    • Disable Google Now Launcher: Homescreen Long Press-> Settings-> Voice-> "OK Google" hotword detection-> Off.
    Audio Dropouts:

    Odd frequencies only:

    • Set Band to "EU+" after swiping from right to left to reveal right side settings. Default is "EU+" unless ROM identifies location as North America.
    Where are recordings ?:

    • See /sdcard/Music/fm for WAV files named with parseable start time. Compression to MP3 files will be considered in future. Maximum of 4 GB results in 5-10 hour maximum time, depending on sample rate (22-48 K depending on phone).
    Speaker does not work:

    • Experimental at present. Workaround: remove wired headset plug enough to switch to speaker, but still inserted enough for a good antenna connection.
    Speaker volume control broken:

    • Experimental at present. Turn Screen off or use on app volume.
    Phone call problems:

    • Avoid speaker mode
    • Avoid removing or inserting wired headset while FM or phone call is active.
    Other: