yashsingh1/xdaforums huggingface dataset:
[Spirit FM] mikereidis:
Thanks, but I've survived without device donations for 3.5 years now, and I don't expect that to change. I would feel more obligation to support a device even if it was very impractical.

When I officially support a device I'm committing to at least hundreds of hours of work, learning, flashing, fixing broken flashes (happens ALL the time), to say nothing of just supporting the device FM on various ROMs and their constant updates.

Multiply "hundreds of hours of work" times a decent wage and it should become clear that buying a phone is just a small fraction of the cost of officially supporting a device.

What do I do when a ROM update breaks FM on that device and it requires dozens of hours to fix, or MANY more ? Let's say I have 30 customers (and 120 pirates) with Sprint GN3 and this affects 10 of them. Let's say they bought Spirit at $10, so my take from 10 customers is $70. 70 bucks over 20 hours is $3.50 per hour, around 30% of the legal minimum wage here.

And this doesn't even consider the hundreds of hours of work to support a mere 30 customers in the first place, at around $1 per hour.

If you want, send me a debug log and I'll look again. Tap the frequency button, enter the number 7 and tap "OK". After 20 seconds or so, press Send from your email client.
[Spirit FM] mikereidis:
LG G2 Mahdi ROM and other FM unfriendly kernels:

I'm happy to report I have FM working now, using a modified Render kernel.

I'll test a bit, put together some patch files and hope dr87 and other G2 kernel devs incorporate them.

This is the first time I've built and used an Android kernel.

I am not in general going to put out my own kernels, except a test kernel or 2. That would require ongoing commitments for lots of extra work, and I have more than enough work to do at the app level. and related SU/root and low level stuff.
[Spirit FM] amtomio2004:
G2/Mahdi

Very well!! :good:

Do you put the kernel in this thread?
[Spirit FM] mikereidis:
Not yet, needs a mod or 2 and a bit more testing. Maybe in 12 hours.

AFAIK, "d802" is the main target, so I'll make one for d802 and one for my ls980.

If anyone is sure one of these works for FM, and I'm not sure yet, that would be good to know:

No D800 AT&T
No D801 T-Mobile & Wind Canada.
Yes D802 International.
? D803 Canada. Similar to D802 International ?
? D804 ????.
? D805 Latin America.
? D806 Argentina.
Yes F320 Korea F320i/s/l. Similar to D802 International ?
Yes LS980 Sprint CDMA/LTE.
No VS980 Verizon CDMA/LTE.
[Spirit FM] xdagee:
App cannot run on background

Hi OP, I have been searching this thread for quite sometime now.

I sent an email but had no replies.

I have a little issue with Spirit FM, or it might not be an issue self, it might be that it is somewhere around settings that am missing it out.

Anytime I run spirit on my device (DHD CM 11 Android 4.4.4), I want it to play at background, but it doesn't do it.

if am playing the radio and run into any other app or even hide it, the radio pauses and stops. Until I get back to resume or even close the whole app and relaunch. In short, the app cannot run on the background. I don't know if this has been fixed, but it has happened to me for a long time now.

Thank you
[Spirit FM] mikereidis:
Sorry if your email fell through the cracks; very few do, email me again.

Desire HD ? I'm running a 4.4.2 from May on mine, likely from the same dev.

Strange this is that I can't get any Spirit1 version working on it now; I'll have to update and try again.

DHD and the MANY similar HTC devices with AIC3254 DSP (as recent as OneV at least) all have the same problems, on custom ICS+ ROMs: When FM audio and some other audio happen at the same time, the HAL driver gets badly messed up, requiring a reboot or at least a mediaserver restart (which doesn't always fix everything).

Problem here is that the HAL doesn't know about FM. Spirit turns FM on and when a ring or notification happen, the non-FM audio breaks.

This is an issue for you because Spirit normally runs Debug-> Silent Loop, which means it constantly plays and repeats a silent audio file. When HALs don't know about FM, this is the only way to ensure volume works, and Spirit will get notified of an interruption.

But the AIC3254 problem means Silent Loop can't be used on DHD etc. Sometimes Debug-> ALSA PCM Open or Debug-> Play Audiotrack can be used as a workaround, but I never found it stable in my testing over 2 years ago.

This problem has persisted since Android 4.0 ICS (GB ROMs were usually derived from CM which supported FM as late and Android 2.3), so I don't expect any fix at this point.

There are theoretical solutions but they would take a lot of work, and it's just not feasible to spend a lot of time for such old phones, sorry.
[Spirit FM] mikereidis:
LG G2 Mahdi & FM friendly kernels, based on RenderBroken's very nice original kernel here: http://xdaforums.com/lg-g2/development/kernel-render-kernel-aosp-lg-roms-t2803929

For International D802 & Sprint LS980 only. I'm running mahdi-709 and this is based on Render code from about that date.

You'll have to accept "all risk" at this point. I'm pretty new to modifying Android kernels and am thus more prone to silly mistakes.

LS980 version worked well on my Sprint LS980. I don't have a D802 to test on, so caution and ROM backups are advised.

D802: http://d-h.st/sia

LS980: http://d-h.st/C6I

Sometimes flashing kernels, including prebuilt kernels, results in audio devices under /dev/snd/ disappearing. If all audio is broken, that's the issue. To fix this I generally re-flash Mahdi, reflash the device patch, then flash this kernel. Try it a second time if it doesn't work the first time.

If you haven't used Spirit before: (1) G2 may need reboot after first install, if BT was on. (2) Sometimes "non-digital" audio is better and in Spirit1 can be set with Menu-> Settings-> Audio-> Method = "LG G2 ALSA", at least in recent test releases.

Next post will explain and link to kernel patchfiles, that LG G2 ROM and kernel devs should be able to use to restore G2 FM capabilities. Supporting your favorite ROM and kernel devs with donations or whatever may help ease any pain. Thank you devs ! :)
[Spirit FM] mikereidis:
LG G2 FM friendly kernel patches:

This info and these kernel patchfiles, are for LG G2 ROM and kernel devs that wish to restore lost G2 FM capabilities. I don't have time to be a kernel dev, so I hope popular kernels will support FM, on devices that are hardware capable of FM.

Supporting your favorite ROM and kernel devs with donations or whatever may help ease any pain. Thank you devs ! :)

Tested on Sprint LS980 running mahdi-709 and based on Render kernel code from about that date. Patch also works on current Mahdi Simple kernel code.

LG G2 Variants with FM include International D802, Sprint LS980 and Korean models. Other US models have no FM, including Verizon & AT&T. Other variants aren't clear at this time. Canadian D803 may support FM. Disabled devices are in 2 ways: (1) FM antenna pin on Broadcom FM/BT/WiFi combo chip is not connected to wired headset jack, so no signal, and (2) Service manual schematics show an analog switch chip only on FM variants, that switches BT data lines to one part of the SOC or another part.

Code patch: lg_g2_fm_code.patch - 12.26 KB

defconfig mods for Render kernel: lg_g2_fm_defconfig_render.patch - 918 bytes

defconfig mods for Mahdi default Simple kernel: lg_g2_fm_defconfig_simple.patch - 926 bytes

I don't know why, but I couldn't get "CONFIG_SND_FM_RADIO=y" in the defconfig files to turn into "#define CONFIG_SND_FM_RADIO 1" in the .config file, LOL. And I'm lost at this time in "make menuconfig".

So I brute forced the "#define CONFIG_SND_FM_RADIO 1"by just jamming it into the source code files. So here is a patch with this atrocity, should anyone else benefit:

lg_g2_fm_code_fmdef.patch - 13.47 KB

Patch in the usual way, I guess:

cd kernel_dir

patch -p1 ~/Downloads/lg_g2_fm_*.patch

Comments welcome, ask any question (on my Spirit1 thread in my sig is more likely for me to notice), and please enlighten me anywhere there is darkness. :)
[Spirit FM] Rick O:
The links are the same for both variants. Is this correct? Thanks

They are different now...

Sent from my LG-D802
[Spirit FM] rob_yx:
ok, i bougth Spirit1 from google play.

According with Silicon Labs AN230 http://www.silabs.com/Support Documents/TechnicalDocs/AN230.pdf on page 33/34 the 0x0301 property sets the RSSI threshold for blend to full stereo reception.

The default is 50, in fact I get fully stereo reception only with RSSI>50 , with 31<RSSI<50 the reception is proportionally blended and with RSSI<31 the reception is mono.

I could have to set the 0x0300 (BLEND_MONO_RSSI) to "1" and 0x0301 (BLEND_STEREO_RSSI) to "5"(for example), it's right?

How i can this with ioctl utility?

It's possible to implement this option on Spirit1?
[Spirit FM] aky_style:
Spirit UI Settings for LG P500

Hello,

Thanks for your efforts in spirit.

Could you please share the settings for LG p500.

My phone shows FM not accessible. SU:2 Fm:BC2 SU:1 Bt:3 Ht:0 Mo:BCU

as per your comments in one of the forum, I changed the debug-> FM Chip -> old BCM

Thanks in advance.
[Spirit FM] jsugrumpy:
Spirit2 confirmed working wonderfully in my rooted kitkat LG L70 D320n with stock fm app!!! Love the extra features and superior sound!!

Probably also working with the rest of LG L III Series from 2014: L40, L65, L90...
[Spirit FM] mikereidis:
Re: LG G2 Render kernel for Mahdi.

You must be the one person who downloaded before I fixed it. :)

I put a "Fixed" edit just for you, then removed it figuring it would confuse everyone else.

D802: http://d-h.st/sia

LS980: http://d-h.st/C6I

Please report success or failure, especially for d802.
[Spirit FM] mikereidis:
Re: Samsung's w/ Silicon Labs si470x chips.

I can check better later, but sadly there is a disconnect between userland ioctl and the chip registers.

There is no direct way to access these registers, unless we modify the kernel driver, and I'm not going to do that.

We'd have to examine the proprietary Samsung Silicon Labs FM driver kernel code to see if those registers can be modified indirectly, using ioctl.
[Spirit FM] mikereidis:
ICS or higher AOSP ROM ? Which ROM ? A recent version of Spirit ?

LG P500 should work automatically, with default settings. I last tested mine earlier this year on some ICS or JB ROM I don't recall.

On AOSP Android 4.3+ with Bluetooth on, you should reboot the phone after first installing Spirit, because a BT shim has been installed.

If Spirit doesn't work with Bluetooth on, try BT off or vice versa.

If BT is off, you can force the more compatible UART method by setting Debug-> HCI Access to UART and restarting Spirit, though a reboot may be better.
[Spirit FM] Rick O:
Spirit2 working on LG G2 D802 with latest Mahdi ROM and modified Render kernel. April version of Spirit2. Recording works as well. Haven't tried 9 July beta.

Sent from my LG-D802
[Spirit FM] mikereidis:
Great ! Thanks for your report.

I can't say if or when G2 AOSP kernels might incorporate these patches.

But here's a new AOSP/Mahdi compatible 4.4.4 kernel that has FM support still built in: http://xdaforums.com/showpost.php?p=54079480&postcount=1224

I checked the Github source and found the FM stuff intact. I then tried the LS980 kernel and it worked with Spirit1 with Audio-> Method set to "LG G2 ALSA". Spirit2 or Spirit1 digital mode produces audio, but it's very messed up. I've tried tuning samplerate and buffer sizes but I haven't found any magic combination that works well yet.
[Spirit FM] Rick O:
How do I get the 9 July beta?; I thought I was signed up...
[Spirit FM] a66fm:
hi any chance that sony xperia z2 6503 will be supported?
[Spirit FM] LenAsh:
Try it. Qualcomm FM probably supported
[Spirit FM] mikereidis:
I'll post it here until I decide to delete. ;)

Spirit2: http://d-h.st/vky

Spirit1: http://d-h.st/de8

Try these links and see if you are invited to be a tester, or if you already are. I presume it should, but I haven't looked at it as a user in a long time. Of course you need to be logged in with the Play purchase account.

Spirit2 beta: https://play.google.com/apps/testing/fm.a2d.s2

Spirit1 beta: https://play.google.com/apps/testing/com.mikersmicros.fm_unlock
[Spirit FM] mikereidis:
Spirit1 should probably work.

I don't recall right now if digital audio/Spirit2 works.

I should probably get some kind of issue/bug tracker or similar that users can use to submit compatibility reports with various phones and ROMs.

For too long I've just maintained a now less used personal file with info and updated the list in the first few posts every once in a while.
[Spirit FM] LenAsh:
Quick update (for any FM fans)...

I sold the M8 on after just 2 days, small profit. I then bought a Z2 and the FM Radio is just like the Z I previously had and the ZL we still have. As in excellent.

In a slightly more scientific manner, and under the same conditions with the same headphones: The M8 found 6 stations and produced horrible static when walking. The M8 has virtually no stereo separation. The LG G2 found 6 stations and produces some static but is very listenable. The stereo separation is fairly good. The Sony Z2 found 15 stations. Really. The stereo separation is unbelievable. The phone handles poor signals completely differently to the other 2 - the phone hangs on to the signal very well and you tend to hear an increase in "hiss" (SNR degrades). This tends to mean the content remains audible for longer in poor signal areas.

The Z, ZL and Z2 all perform similarly on stock FM. Brilliantly.

The M8 and Z2 have the same chipset - so much for HTC's implementation.

For what it's worth.
[Spirit FM] rob_yx:
Ok, thank you for support.
[Spirit FM] mervluk:
Perhaps it's hardly surprising given Sony's pedigree in both radio and TV and that they do expressly try to transfer the technology into their phones. Not everyone can afford them though. Spirit2 is even more brilliant on the Sony Z series, especially if you're prepared to be patient and tweak about a bit with some of the more sophisticated audio mods. I suppose Mike's on the horns of a dilemma: FM for the masses or for the audiophiles? A pity if it can't be both (and a waste of FM). But sadly a reflection of the modern world, which doesn't do quality.
[Spirit FM] mustasusi:
Sprint GN3

I sent you an Email now. I wasn't able to even download from Play store, it doesn't show up although Spirit2 is there. I used my last backed up version but that should be quite recent. Spirit currently doesn't play, saying "No FM accessible" and Bluetooth occasionally turns on and off. Phone is rooted, running stock 4.4.2 version ends with NC5. Before rooting it complained about missing headphones (were plugged in all the time), this scenario looks familiar to me though I hoped to get slight luckier.

Any solution that won't require you too much obligation?
[Spirit FM] mikereidis:
Xperia Z Ultra C6806, slightly used; does $280-300 US dollars seem like a crazy low price ?

www.ebay.com/itm/UNLOCKED-Sony-XPERIA-Z-16GB-C6806-6-4-LTE-Bell-Rogers-AT-T-Telus-with-Warranty-/301237906513?pt=Cell_Phones&hash=item46232dac51

www.ebay.com/itm/Unlocked-Xperia-Z-Ultra-C6806-Cell-Phone-Rogers-Fido-Bell-Telus-Koodo-Warranty-/331253113414?pt=Cell_Phones&hash=item4d20396246

For some reason it appears that a lot of these got returned here in Canada, so this isn't the first time I've seen prices like this from a domestic source to me.

Any reason why this would not make a good representative of current Xperia Z* line devices ? I'd prefer not to have to buy 2 Sony's to support them at this time.

As I've said, buying and maintaining a phone for Spirit2+ is a long term commitment. If this phone, or the variant, was to give me lots of flashing hassles, I'd just pay more and buy and International model in the first place. At least this C6806 has a stock FM radio app, so I can be sure the hardware supports.

Right now I have XDA forum tabs open for Z, ZL, Z1, Z Ultra, and Tablet Z. What might be best for an FM app dev ? I ignored the Tablet Z2 because I heard there may be problems. A Tablet would be cool. Z Ultra is the only one with GPE ?

I pretty much gave up on trying to support "the masses" a few years ago. What matters is the mathematical product A x B, where...:

A = Number of owners of FM capable variants of the phone (or line of phones) that will flash AOSP ROMs that don't have an alternative free FM radio app. (MotoG has lots of AOSP flashers, but the dominant CM11 comes with an FM app, so...)

B = Fraction of A that will purchase Spirit.

B is maximised for Sony phones because Sony's are higher priced.

A I think has gotten to about the right point, I hope, since I'm now probably about to buy one, and thus likely commit to Sony's for the long term, assuming no major problems arise. I almost bought one before my eye injury, and now I'm facing another crazy tax deadline, LOL.

The bonus could be FM transmit. If all recent Sony's can transmit FM (as I suspect & hope), and I don't have to put TOO much effort into at, at least for now, then there will likely be a "Spirit (for Sony) FM Transmit" app on Play in the near future. Heck, my first thought is same price, but I'd bet such a unique app for "rich" Sony owners could fetch $20.
[Spirit FM] mikereidis:
With Spirit1 I spent TONS of time manually disabling thousands of devices I can't support in the Google Play developer console. Sadly, Google has never offered an option for "I only support these 200 device/variant names". Makes more money for Google when people with incompatible devices buy an app.

I did this partly to reduce bad reviews, but also to minimize refund request and tech support emails.

I never did that with Spirit2, mostly because it seems like a horrible waste of developer time, despite the added email load. It's amazing though how many people will never read an app description that specifically says only this list of devices is supported. And I'm talking about English speaking people, many in the US (partly due to no FM on many US phones.)

I'll respond to the rest later.
[Spirit FM] mikereidis:
Worth plenty, thanks ! :)

Besides Sony Z phones I've also been looking at the One M8.

The numbers of posts in XDA dev sections seems to indicate it's much more popular than GS5, in part because GS5 root was only just found a few days ago, but even so...

Big loud speakers on the M8 also mean audio fans, I think. (Not audiophiles, but people who like loud music.)

So I start searching for "radio" on the M8 forums, since "FM" is too short to search. And I'm finding very little mention of FM. I think Spirit (1 and/or 2) is working on rooted M8's, but not stock unrooted.

So now I'm thinking, for some reason, FM isn't very popular on M8. If M8 reception is bad, that could be one reason, as well as people buying more expensive phones using file players and streaming more.

Most of my M8 email is from US Verizon customers, who don't have a stock FM app. I've been pointing them to the downloadable HTC app, and it works and they're happy. I may not be able to support stock unrooted anyway, if HTC did the same to M8 as they did to KitKat+ on the M7.

So, if I count email and thread requests, I think there is more demand on recent flagship Sony's than on M8.
[Spirit FM] mervluk:
The Ultra has the biggest? screen, faster processor and weaker camera, if that matters. Maybe not as popular phone as Z was (but otherwise, I think, similar with slightly better performance across the baord) and latest and greatest Z2 is, reflected in the resale prices? Z is cheaper in the UK. Initially I'd say price is good. I think the good thing about Sony's is that their stock is effectively AOSP so that unless your work modifies the kernel, most stuff will work on the locked rooted via the Sony dual recovery as on the unlocked phones. (And plenty people don't unlock because of loosing DRM affecting Sony Bravia and Walkman, two of the benefits of Sony). For instance my Z runs with most of the Z2 audio libs, despite still being locked, but rooted. But perhaps beware, not all Sonys are unlockable bootloader - generally only those sold without being locked to any network, so you can be stuffed, I think, if they are unlocked from the original network but are still shown as locked originally on Sony's records. I assume you'd buy an already unlocked phone though! The weakness of the (water resistent) Sonys is their speakers: muffled because of the water protection as well as not having the amplification of HTCs!

Others will know better, I'm sure.
[Spirit FM] ffxx68:
Thanks Mike for the suggestions.

I get stable RSSI (between 30 and 40, for the stronger stations) and RDS info, when avaiable.

I guessed the audio section was the trickiest one... Will try to hack in something.

Meanwhile, ssd output is like below

Spirit FM Radio audio utility version 2014, Feb 14
Copyright (c) 2011-2014 Michael A. Reid. All rights reserved.
Mode: "4" (4)
Function: "0" (0)
Opening device /dev/snd/controlC0
snd_fd: 3
m4_do info
Version: 0x20006
card card: 0
card pad: 0
card id: emxxcodec
card driver:
card name: emxx-codec
card longname: sound codec (emxx mixer)
card reserved_:
card mixername: emxx mixer
card components:

ctll count: 11
name: DAC Volume numid: 001 access: rd,wr, (0x03) type: Integer (2) min: 0
max: 31 Values: 2 2
name: Headphone Volume numid: 002 access: rd,wr, (0x03) type: Integer (2) min: 0
max: 31 Values: 2 2
name: Speaker Volume numid: 003 access: rd,wr, (0x03) type: Integer (2) min: 0
max: 31 Values: 2 2
name: MIC1 Volume numid: 004 access: rd,wr, (0x03) type: Integer (2) min: 0
max: 31 Values: 2 2
name: MIC2 Volume numid: 005 access: rd,wr, (0x03) type: Integer (2) min: 0
max: 31 Values: 2 2
name: AUXIN Volume numid: 006 access: rd,wr, (0x03) type: Integer (2) min: 0
max: 31 Values: 2 2
name: AUXOUT Volume numid: 007 access: rd,wr, (0x03) type: Integer (2) min: 0
max: 31 Values: 2 2
name: Capture Switch numid: 008 access: rd,wr, (0x03) type: Enumerated (3)
Values: 0 items: 7 names: 'OFF' 'MIC_normal' 'MIC_ringtone' 'MIC_incall' 'Headset_normal' 'Headset_ringtone'
'Headset_incall'
name: Sampling Rate Switch numid: 009 access: rd,wr, (0x03) type: Enumerated (3)
Values: 10 items: 12 names: '7.35kHz' '8kHz' '11.025kHz' '12kHz' '14.7kHz' '16kHz' '22.05kHz' '24kHz' '29.4kH
z' '32kHz' '44.1kHz' '48kHz'
name: Playback Switch numid: 010 access: rd,wr, (0x03) type: Enumerated (3)
Values: 6 items: 9 names: 'OFF' 'Speaker_normal' 'Speaker_ringtone' 'Speaker_incall' 'Earpiece_ringtone' 'Ear
piece_incall' 'Headset_normal' 'Headset_ringtone' 'Headset_incall'
name: CODEC Power Switch numid: 011 access: rd,wr, (0x03) type: Boolean (1)
Values: 1
------------------------------------
m4_do ioctl success type: 0
[Spirit FM] aky_style:
Thanks for reply

Hi,

I am using kitkat (cynangmod 10.5 [not sure on version] ) on LG P500 and Spirit shows NOV16 on about window.

When I switch it on, it tries to recieve without bluetooth first and then switch bluetooth on and then try again.

So, thats not the issue.

THanks in advance for your help.

Regards,

Akshay
[Spirit FM] mp107:
Spirit FM works on Nokia N9 with NITdroid Alpha 6 ROM installed and bluteooth enabled.
[Spirit FM] mikereidis:
OK. Thanks for your report. :)

But I can't get too excited about a 2011 phone with a ported Android...
[Spirit FM] mikereidis:
OK, so you have a rather old version of Spirit.

If you're a customer, please email me mikereidis@gmail.com .

If not, sorry but I don't have time to dig into old notes, emails, etc. My P500 is in an "old phones" box now, and I'm not even sure where the battery is right now.
[Spirit FM] mikereidis:
Nothing there says "FM", but "AUXIN" was traditionally a common alternative name. I see AUXIN Volume, but no selection for AUX under "Playback Switch".

If you do "ssd 4 3 2 7" while some audio is playing, does it change headset volume ? If not, the ALSA driver could be a "fake" driver, and some other device like /dev/msm_snd is in use.