[Spirit FM] mikereidis:
Spirit News Feb 21, 2015: The "Spirit FM Radio" project is now over 4 years old ! :)

Here is the thread where it was born: http://xdaforums.com/showthread.php?t=947581 and my 1st post #6 on that thread: http://xdaforums.com/showpost.php?p=11279004&postcount=6

I am happy to say that after 4 years I am pretty happy with the outcome, though my income is a fraction of what "normal" jobs in this field pay, and I have no cache of Google, CM Ine, or any other stock options to see me retiring anytime soon.

How far has Spirit come, and what is next ?

First, sometimes

things seem to take forever, but "1st things 1st":

I prefer to concentrate on

minimizing bugs

and taking care of the

millions of "under the cover" issues

before adding "eye candy" and non-essential features on top of an unstable base.

Now that I am reasonably

happy with the stability of Spirit2

, I have been able to add

many new settings and features

. Most of these

finally re-duplicate Spirit1 features

, but of course on top of the much better designed Spirit2 which is the clear "way forward".

Second, I'm really happy with the "new, improved" Analog mode in the Feb 21 Spirit2 beta. Spirit2 has re-entered the analog domain that Spirit1 and most stock FM apps were based on. Why, and what does this mean ?

Spirit2 was designed with "Digital Audio" as the method to move audio from the FM chip to our ears, instead of the analog (or not fully digital) audio architecture that pretty much every other FM app uses, even now in 2015.

This makes FM audio act like media player audio, instead of the "special" and restricted form of FM audio that FM was originally designed into smart-phones with. FM was a "tacked on" afterthought and had a special & external position in the audio chain. I believe this is a direct result of the fact that FM radio goes against the business interests of Google (as well as Apple and US carriers.)

FM audio could not (and usually still cannot using other FM apps) be equalized, bass-boosted, re-verbed and otherwise processed. It usually can not be send to Bluetooth headsets, nor recorded or visualized.

Spirit2's method of FM digital audio means you can equalize and process it, send it to Bluetooth devices, record it and visualize it. I don't think there is ANY other FM app that provides all of these features together (to say nothing of all the media button/AVRCP, notification shade, lockscreen, homescreen widget features and many settings, present now or soon.)

Spirit2's digital audio architecture was back-ported to Spirit1, but despite relative stability and a full year of fixes, was never made fully supported or default. That job went to Spirit2, which still had to compete for development time with Spirit1 throughout 2014.

But with the upsides of digital audio (including some invisible to most of you, but that make my work a bit easier), come downsides, and some of these are reasons to re-implement an analog mode in Spirit2:

-

Digital audio mode does not work well on some ROMs/devices.

Most of my testing is with CM11/12, and these tend to work well with Spirit, ut there are always some ROMs/devices that have issues.

Currently, many Sony (and some other) devices, especially on Lollipop, have horrible audio, due to microphone based pre-processing that kills audio quality for non-speech and non-microphone purposes. I am examining solutions for this, and analog audio is a quick fix/workaround.

-

Some semi-popular devices (like GS3 mini) are supported with Spirit1 analog audio mode, but not with digital mode, nor with Spirit2 at all

when it had only digital mode. Digital audio mode is impossible with most older devices, and even where possible would require too much investment of time and money to be worth it.

In the case of the GS3 mini (and some others), Spirit2 has tuner code for the FM chip, but no audio code. The analog mode allows me to add experimental audio methods for such phones from the Spirit1 code.

The

Spirit2 Free and Open source version

(which has 90% of the code of the full Spirit2) is hoped to

benefit from this

. I am creating an

audio plugin design

, like the existing FM tuner chip plugin design, that will allow

others to add support for phones

that I can't officially support for lack of time, etc. Plugins for analog mode should be easier than for digital.

-

Analog vs Digital "purity"

: In some cases, analog audio may sound better to some people. Xperia Z2 & Z3+ especially has a disappointing architecture here, for 2014-2015 devices. It, as well as the EXTREMELY popular GS3/GS2/GS1/Note2/Note1 devices (70% of Spirit sales) provide only analog outputs from the FM chip, AFTER processing the audio digitally, as ALL smartphone FM chips have done since the dawn of Android.

So on those devices, Spirit2 routes the analog audio from the FM chip to "ADC's" (analog to digital converters) on the audio chip. Then the digital audio is processed digitally, and usually (non-Bluetooth) sent out to DACs to convert the digital back to analog for wired headsets of the phone speaker. The result is one additional D-> A-> D pair of conversions. Each conversion loses some audio quality. Add them all up, and you may be surprised:

Singer/instrument professional analog microphones -> professional ADCs -> professional processing -> digital CD -> analog FM transmitter (at least 1 conversion) -> analog FM receiver -> FM chip ADCs -> FM chip processing -> FM chip analog outout -> audio chip ADCs -> Android processing -> audio chip DACs -> analog processing -> wired headset or speaker. Wow, long chain, and that's a minimum. Adding another pair of conversions is bad for audio quality, especially in the later and non-professional stages.

Note that many modern devices do not support a TRUE analog mode and I describe them as "non-digital", meaning "Not the digital audio mode in Spirit2". But they are digital underneath, with all the advantages of digital, but without the downside of having to first convert analog to digital and thus adding 2 new conversions to the chain.

The fully digital devices supported by Spirit2 are: HTC One M7, One M8 (and all other Qualcomm FM devices, including Xperia Z/Z1 class, MotoG and LG G3), LG G2.

The analog conversion devices are Xperia Z2/Z3+ and all Spirit2 supported Samsung flagships: GS1/GS2/GS3 and Note1/Note2.

-

What about reduced CPU and power consumption ?

No, analog audio mode provides no substantial savings at present, but this can be improved somewhat.