• Introducing XDA Computing: Discussion zones for Hardware, Software, and more!    Check it out!

[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,142
Ottawa/Gatineau, Canada
GPE 4.4.3 HTC One M7:

Bluetooth ON operation now works due to AOSP friendly BT setup. :)

So FM over BT is also working I'm happy to report.

The caveat: Visualizer tends to work just once on Spirit2; seems fine on Spirit1.
 
Last edited:
G

GuestK00114

Guest
Regarding FM antenna hardware connection

Hi Mike,
i hope your eye gets well again, soon. I would fully understand if you take a time out to recover instead of answering my question.
Also, i wish i could help out but i guess it would be a long ride from here to Canada.

So, my question:
I am still happy with Spirit2 on my i9000 and now thinking about some improvement for my habits.
FM reception in my area sometimes is tricky. I need a good antenna. Some of my headphones work better than others in
that case. So i think about some external antenna to connect to the headphone out.
Standard FM receivers had 240 Ohm symmetrical or 75 Ohm unsymmetrical inputs.
For a simple solution you just connected either the two ends of a 1 meter wire to the poles of the 240 Ohm inlet or one end of a 1 meter
wire to the "hot" / "inner" pole of the unsymmetrical input.

Now, on the cellphone we have that 3.5mm outlet containing 2 "hot" poles for the left and right audio and one "cold" for common/ground.

I would like to know how the FM receiver antenna input is connected to those audio outlets.
From that i could decide how to improve reception.

Next problem: With an antenna connected i would like to use the speaker audio output.
That works on my i9000 but i cannot control the volume.
I understand that this is a matter of digital audio control inside the software of the phone.
From my Linux experience i know that ALSA might have something to do with this.
I am familiar to the alsamixer app on my desktop pc and i also know that this is a low-level-command-line tool which in some
cases helps to enable/disable audio and determine gain and volume levels of different audio subdevices.

So, is there something inside my phone similar to this ? Or is possibly your new "Audio Trick" app a way to control speaker output volume?
Or does this lead to other problems?

Now, hopefully you have some information on this for me. But take your time, get well and be assured that many people out there wish you
all the best :cowboy:
 
Last edited:

mikereidis

Inactive Recognized Developer
Jan 28, 2011
7,823
4,142
Ottawa/Gatineau, Canada
:)

Doc said eye was better Thursday and hopefully better again today Friday.

Hi Mike,
i hope your eye gets well again, soon. I would fully understand if you take a time out to recover instead of answering my question.
Also, i wish i could help out but i guess it would be a long ride from here to Canada.

So, my question:
I am still happy with Spirit2 on my i9000 and now thinking about some improvement for my habits.
FM reception in my area sometimes is tricky. I need a good antenna. Some of my headphones work better than others in
that case. So i think about some external antenna to connect to the headphone out.
Standard FM receivers had 240 Ohm symmetrical or 75 Ohm unsymmetrical inputs.
For a simple solution you just connected either the two ends of a 1 meter wire to the poles of the 240 Ohm inlet or one end of a 1 meter
wire to the "hot" / "inner" pole of the unsymmetrical input.

Now, on the cellphone we have that 3.5mm outlet containing 2 "hot" poles for the left and right audio and one "cold" for common/ground.

I would like to know how the FM receiver antenna input is connected to those audio outlets.
From that i could decide how to improve reception.

Next problem: With an antenna connected i would like to use the speaker audio output.
That works on my i9000 but i cannot control the volume.
I understand that this is a matter of digital audio control inside the software of the phone.
From my Linux experience i know that ALSA might have something to do with this.
I am familiar to the alsamixer app on my desktop pc and i also know that this is a low-level-command-line tool which in some
cases helps to enable/disable audio and determine gain and volume levels of different audio subdevices.

So, is there something inside my phone similar to this ? Or is possibly your new "Audio Trick" app a way to control speaker output volume?
Or does this lead to other problems?

Now, hopefully you have some information on this for me. But take your time, get well and be assured that many people out there wish you
all the best :cowboy:

FM antenna pin is almost always connected to headset jack ground, through a cap, res and coil or 2. I think it's set up to accommodate a wide variety of effective impedances, but I have no idea where the peaks might be.

I think "the other side" of the antenna is the real ground, as opposed to the headset jack ground. I'd guess it's unbalanced.

The only Android optimized FM antenna I recall was by xmguy several years ago: http://www.droidforums.net/forum/droid-x-hacks/110166-droid-x-antenna-rig.html

I've never really found much of an improvement over stretching a good wired headset out. But I'm a rookie when it comes to RF.

Yes, my new app AudioTricks / VolumeTricks app is a wonderful hack that works in this case. Just tried it now on my CM 9000 and works fine with speaker. v140530 is latest and best, but requires a hack posted in that thread to reduce volume, instead of just boost. Older v140527 goes -60 dB to +60 dB but has problems installing on recent non-AOSP ROMs with SELinux stuff, like stock Samsung GS3/Note2.
 
  • Like
Reactions: nicesoni_ash
G

GuestK00114

Guest
Speaker volume adjustment

Mike,
glad to hear your eye is getting better.

Thanks for the info on the FM antenna topic.
It works! Antenna is really connected to ground of the headphone.

For my solution i use some defective line-out cable for now with one end open and isolated "hot" left/right audio wires.
Have to find the perfect length, think about 50cm is perfect since this is a quarter of the wavelength and the antenna
is a non-symmetrical single pole (Marconi-antenna).

And yes, your audio tricks work perfect and in addition my incall-volume problem is gone as well !!!

I will come back soon with some suggestions for the Spirit2 app and some question regarding the hidden features of the app
like that mysteriuos signs that sometimes appear on the grey background.

Have to hurry now for a family BBQ !

Best regards,
Frank
 

mikereidis

Inactive Recognized Developer
Jan 28, 2011
7,823
4,142
Ottawa/Gatineau, Canada
OT

Laying here in hospital. Might be the healthiest here LOL.

Doc2: many infections, small but could spread. Stop the strong drops every 2 hours and take these 2 different Super strong drops every half hour. Only 2 places in this million pop city to get this Super string stuff.

Stay up All night, every half hour. Come back 10 AM. Show me how you put drops in. No try this way. This isn't going to work. Can your wife do it ?

Me: No she's with my son in other hospital almost 24 hours due to diabetes discovery.

Doc2: what about daughter ?

Me: she's 8 yo ! What I'm sposed to keep her up all night too ?

Doc2: other relatives...

Me none local

Doc2 stay with wife at other hospital

Me so I'm sposed to drive half blind 40 minutes, keep her up all note, stay up myself then drive myself back 40 minutes ? Can't afford $70 taxis.

Doc2 take bus

Me yeah right, 2 hour bus trip each way, I don't know routes and every 30 minutes on bus 4 times each way I do drops when I've proven I can't do them and in a mirror on a non moving surface ?

Doc2 no reason to worry not a big deal

Me WaHAT. ?! Doc1 said I could lose eye. Now you say its worse and not to worry when you just told me to stay up all night with the Super ?!

Doc2 you're misinterpreting let me make some calls

OK you can stay.


Geez... There's plenty more like the meal I was assured of and the nurse turning 30 minutes into lazy 2 hours with complaint required for action. I dont understand how docs. Can be surprised at reflex. Of course my eye wants to shut itself when it sees something coming. Sorry but just instinct and to me Very hard to control.

Could be worse of course lucky to be here on Ontario side of river. My residence Quebec side can be a horror show sometimes.

And yet my sight is best in a week and can even keep both eyese open if not bright now
 
Last edited:

mervluk

Senior Member
Jan 30, 2013
272
79
Sorry to hear and best wishes Mike. But you have to laugh at the health services or you'd cry (if you could). I thought it was just the nationalised Brit NHS! They do a very good impression of making it up as they go along. "Carry on. . .". (that's a Brit joke). I had one colleague who was chastised for ingratitude for not feeling better when they couldn't diagnose her debilitating condition. Well that was before they started treating me for 4 things I didn't have. Oh and doubled the dose of the drug for the missed one I did, giving me symptoms I never had before. But your family are having it rough so let's hope life improves. It never rains but it pours they say, until the sun comes out.

But before I get chucked off the forum for irrelevance, I've cured all my Xperia audio niggles by slightly overclocking the minimum processor speed.

Sent from my C6603 using XDA Free mobile app
 
Last edited:
  • Like
Reactions: mikereidis

Niku_

New member
Jun 11, 2014
2
1
Porto Alegre
Hey @mikereidis, I wish you get better as soon as possible. You've made a great work with Spirit. I gonna buy it if it is compatible with my device.

Can anybody answer this: I just replaced my LG G2's Stock ROM for the Stock based Cloudy G Pro II and the D805's official FM app has gone. Will Spirit2 work flawlessly in this ROM? Maybe this is a stupid question, but I really don't know it.

Sorry about my bad english, I'm not native speaker. Thank you all.
 
  • Like
Reactions: mikereidis

Rick O

Senior Member
Jul 4, 2009
201
34
Stevenage
Hey @mikereidis, I wish you get better as soon as possible. You've made a great work with Spirit. I gonna buy it if it is compatible with my device.

Can anybody answer this: I just replaced my LG G2's Stock ROM for the Stock based Cloudy G Pro II and the D805's official FM app has gone. Will Spirit2 work flawlessly in this ROM? Maybe this is a stupid question, but I really don't know it.

Sorry about my bad english, I'm not native speaker. Thank you all.

It works on CM11 latest nightly.
 
  • Like
Reactions: mikereidis

Rinoceros

Senior Member
Jul 8, 2008
368
165
Hi @mikereidis,

Doctors and hospitals are everywhere the same:
they want to get as much money from you without doing anything to you.
They kick you out of the hospital too soon and let the relatives do the nursing. You are paying a lot of money for the health insurance so they have to keep you in the hospital. One of the doctors is lying if he say: you are not losing the eye. I think doctor 2 is too lazy to help you but only wants your money. You did the best thing to force them to keep in you in the hospital.

Get well soon, but be careful!

Cheers.
 
  • Like
Reactions: mikereidis

Rick O

Senior Member
Jul 4, 2009
201
34
Stevenage
Yes

Sent from my LG-D802 using XDA Premium 4 mobile app

---------- Post added at 03:24 PM ---------- Previous post was at 03:17 PM ----------

Sorry. I'm on 2014.06.8 but. 06 .11 should work

Sent from my LG-D802 using XDA Premium 4 mobile app
 
  • Like
Reactions: crombull

mikereidis

Inactive Recognized Developer
Jan 28, 2011
7,823
4,142
Ottawa/Gatineau, Canada
Hey @mikereidis, I wish you get better as soon as possible. You've made a great work with Spirit. I gonna buy it if it is compatible with my device.

Can anybody answer this: I just replaced my LG G2's Stock ROM for the Stock based Cloudy G Pro II and the D805's official FM app has gone. Will Spirit2 work flawlessly in this ROM? Maybe this is a stupid question, but I really don't know it.

Sorry about my bad english, I'm not native speaker. Thank you all.

I'm not sure either Spirit works flawlessly on any stock ROM, LOL. CM and similar AOSP ROMs where no other FM app works are it's main targets.

LG G2 stock has been particularly troublesome; I've never really had Spirit1 nor Spirit2 working well on them. There may be tweaks I can do for the latest stock ROMs, but I haven't got round to it yet.
 

mikereidis

Inactive Recognized Developer
Jan 28, 2011
7,823
4,142
Ottawa/Gatineau, Canada
Sorry to hear and best wishes Mike. But you have to laugh at the health services or you'd cry (if you could). I thought it was just the nationalised Brit NHS! They do a very good impression of making it up as they go along. "Carry on. . .". (that's a Brit joke). I had one colleague who was chastised for ingratitude for not feeling better when they couldn't diagnose her debilitating condition. Well that was before they started treating me for 4 things I didn't have. Oh and doubled the dose of the drug for the missed one I did, giving me symptoms I never had before. But your family are having it rough so let's hope life improves. It never rains but it pours they say, until the sun comes out.

But before I get chucked off the forum for irrelevance, I've cured all my Xperia audio niggles by slightly overclocking the minimum processor speed.

Sent from my C6603 using XDA Free mobile app

Thanks !

OT-ish:

No mod has ever appeared on my threads, so I consider them "my threads" and it's not REALLY off topic if I say it isn't. In this case my personal troubles have a real impact on my ability to post updates, fix bugs, help people etc, so I want people to know why I've "disappeared" and why my email is backed up 7 days now.

They "kicked me out"/discharged me from hospital Sunday, but I was ready to leave as long as nobody was claiming my situation was dire. A nice nurse taught me how to properly put in eye drops. Doc2 had tried, but docs are busy, impatient and largely unable to teach. I've been going back every 2 days and all is getting better now, but it's still VERY hard to read a computer screen very long.

And I don't know how long this will last. :(

Now my son is back in his normal "autism analysis" hospital, after a week at a normal hospital where he was treated for newly diagnosed diabetes type 1 (the worst kind). As I expected would happen soon, they called us tonight to report he stole a key and escaped. They found him within a few hours. He's a 10 year old Houdini now, and he can steal a phone and factory reset it in a minute, LOL.


Hi @mikereidis,

Doctors and hospitals are everywhere the same:
they want to get as much money from you without doing anything to you.
They kick you out of the hospital too soon and let the relatives do the nursing. You are paying a lot of money for the health insurance so they have to keep you in the hospital. One of the doctors is lying if he say: you are not losing the eye. I think doctor 2 is too lazy to help you but only wants your money. You did the best thing to force them to keep in you in the hospital.

Get well soon, but be careful!

Cheers.

Well, just like apples or cops, there's a few good ones in every bunch. ;)

Here in Canada we have a decent socialized medicine system, with extra billings now creeping in here and there. So the docs are more focused on what they can bill the gov't vs the patient. That means you have to go in for things; they won't do things over the phone most of the time because they can't bill unless a human body was present. We have one of the pretty good family docs thankfully, but are still dependent on dozens of others.

They said they NEVER get eye patients admitted into the hospital like I was. All outpatient. I asked "what about eye surgery". He says "We send them home same day". I find it hard to believe there aren't some horrific eye injuries that would stay.

I thought the eye docs might make $200K/year. My wife says 300, Wow... (But still a small fraction of top athletes in popular televised sports.) They move pretty darn fast when they get paid by procedure and not hourly or salary. Sometimes too fast.
 

comolik

Member
Jun 14, 2014
26
15
option to purchase outside google play store?

Is there an option to purchase the Spirit FM 2 app outside the google play store?

I'm trying hard to keep google stuff away from my device and so far succeeded by fetching all required apps from another place or by using googleplaydownloader[1], which apparently works only with free apps.

I'd be happy to pay for Spirit FM 2, just not at Google Play store :mad:

[1] codingteam.net/project/googleplaydownloader
 
  • Like
Reactions: mikereidis

mikereidis

Inactive Recognized Developer
Jan 28, 2011
7,823
4,142
Ottawa/Gatineau, Canada
Is there an option to purchase the Spirit FM 2 app outside the google play store?

I'm trying hard to keep google stuff away from my device and so far succeeded by fetching all required apps from another place or by using googleplaydownloader[1], which apparently works only with free apps.

I'd be happy to pay for Spirit FM 2, just not at Google Play store :mad:

[1] codingteam.net/project/googleplaydownloader

Yeah, sure, you can Paypal me at [email protected] .

I was saying no to Paypal for a while, but as long as infrequent manual email updates are OK, then it's viable I guess.

Spirit updates are becoming less frequent anyway, but the next version of Android may be around the corner, and may require a bunch of root app changes.
 

comolik

Member
Jun 14, 2014
26
15
Yeah, sure, you can Paypal me at [email protected] .

I was saying no to Paypal for a while, but as long as infrequent manual email updates are OK, then it's viable I guess.

Spirit updates are becoming less frequent anyway, but the next version of Android may be around the corner, and may require a bunch of root app changes.

Great, thanks a lot for that option. Just sent you the money. Thanks for your work on Spirit FM. Btw, did you receive my email?
 
  • Like
Reactions: mikereidis
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://forum.xda-developers.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://forum.xda-developers.com/showpost.php?p=57079402&postcount=795

    Android ONE = Google FM Radio ?? !! http://forum.xda-developers.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://forum.xda-developers.com/showpost.php?p=52304934&postcount=647

    HTC One M8 Verizon ! :) http://forum.xda-developers.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://forum.xda-developers.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://forum.xda-developers.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://forum.xda-developers.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: