yashsingh1/xdaforums huggingface dataset:
[Spirit FM] mikereidis:
I've been hard at work re-architecting Spirit2 for Android 5 for over 2 months now.

Have you tried the latest October 29 beta for Android 5 linked here ? : http://xdaforums.com/showpost.php?p=56376931&postcount=8571

There is also an older Oct 1 beta here: http://xdaforums.com/showpost.php?p=55771652&postcount=8499

I'm hoping to get a new beta release out soon, maybe tonight.

G3 Android 5 is pretty darn early. I haven't been able yet to test Spirit2 on an Android 5 device with real FM, but it seems to work as well as it can on Nexus 7 2013 and Nexus 9. (Both Nexus devices do not support FM, but only/mostly because the FM antenna pins are not connected. Other than this, they APPEAR to work, except for no signal or audio.)

As I stated in September, Spirit1 will not be updated for Android 5. The rationale is here: http://xdaforums.com/showthread.php?p=55733853#post55733853
[Spirit FM] mikereidis:
If you are running Spirit2 0920 (September 20) or earlier, then yes I know. It's the "much root app breakage" Chainfire has written about:https://plus.google.com/+Chainfire/posts/Lyhjzu1z9s1 (then follow the followup at bottom, and the followup to that).

Please see post above and let me know if the Spirit2 beta works.
[Spirit FM] :
Yep im blind :D thanks i'll try the betas . As you may have seen in your emails i bought your app tonight whilst running through the cotswolds hoping to get it before i got to the top of a 750ft hill but o well . Early is right ! the Root only came out today and im still in the middle of fixing issues with it including being able to actually download anything to it due to a memory bug. So just put on 10_29 and I can hear myself ! in a massive echo so maybe its selecting the wrong input..Anyway will stay tuned to the thread for the new beta.
[Spirit FM] :
Yea rds is still working so it's root deamon that is failing.
[Spirit FM] mikereidis:
Spirit2 Nov 12 beta: http://d-h.st/ZCuO

Also on Play for customers signed up for betas: https://play.google.com/apps/testing/fm.a2d.s2

- HUGE re-architecture needed for Android 5. Supports Android 4.1+. Android 4.0 ICS support is dropped.

- Pulling wired headset cable may result in feedback. Pushing might result in audio from microphone. Other than this let me know if you hear microphone.

- Many other issues still... Please report.
[Spirit FM] mikereidis:
If you have RDS or any tuner function, the root daemon IS working.

It's just that the small part of it to switch microphone and FM isn't functioning, for whatever reason.

Anyway, try the November 12 beta posted above. There have been a lot of changes again in the past 2 weeks.
[Spirit FM] :
That did the trick. Radio audio is on now. Still distorting like the previous betas but glad it works on Android L :D
[Spirit FM] mikereidis:
Good. :) My N7 2012, 2013 and N9 are all on Google Android 5 now.

But none of my FM capable devices is running Android 5 yet, so yours is the first... I see a few early ROMs I can try now though.

I suspect your G3 is sending microphone input through AGC, AEC, NS or some other voice tuned DSP processing. I had this problem on stock Xperia Z and wasn't able to figure out how to switch it off, until...

I found that Sony's (AOSP or stock) and MotoG were able to directly access FM input, without any "funny business" at root level, and thus in a much better way. These devices have Qualcomm FM, as does the G3.

The G3 may have the same capability. If the build.prop was edited to set ro.product.manufacturer to sony or motorola, Spirit2 beta 1112 will try to use the FM inputs first, before falling back on the microphone inputs.

Or next beta I could just try this setting when dealing with Qualcomm based LG devices.
[Spirit FM] DeadTed:
Hi Mike,

So I am attaching the output from the "adb shell ps" command you told me. Also, I knew an app called FmRxService that was running. I force closed it, but nothing changed. Wifi was turned off, and when denying Superuser the app just did not play any sound... I also tried the different regions, but the problem is similar with these as well.

And something more, it may be helpful: the app sometimes finds stations while seraching, but as I said the frequency shown with the actual one are different, and it also messes up the sound, which is the issue from the very first time. So, one good thing is that it actually now finds some stations (with region either Greece or Europe, and method SonyEricsson)

Thanks!
[Spirit FM] mikereidis:
I certainly hope so. They are becoming very popular, and I'm happy to see they release schematics and other tech info. Do you have one or are considering one ?

There seem to be 3 main categories of Samsung regarding FM:

- Higher end phones use Silicon Labs dedicated FM chips. These are well documented and I hope to get a Galaxy S end of line deal, or perhaps an S2 soon and add support.

- Broadcom devices with a stock FM app. I haven't gotten one of these confirmed working yet, for reasons unknown.

- Broadcom devices with no stock FM app, such as the Galaxy Tab or Tab2 or Google Nexus S. I don't think these have antenna or perhaps RF power connections, so I'm pessimistic about the prospects for these.
[Spirit FM] mikereidis:
So why would FmRxService be running ? I'd guess the CM porter was trying to get the stock app running, but there is no SE stock FM app there AFAICT.

Services will often restart themselves if they are killed, but I'll presume yours stayed dead after killing it.

I could make the audio work without root, but I presume you checked operation with no sound, and found that things like seek or RDS weren't working any better. I DID see decent RSSI levels on your tuned station.
[Spirit FM] DeadTed:
FmRxService did remain killed, and seemed to not affect my stock fm app from running normally.

As for the root, operation had indeed changed without Superuser rights; I could not seek stations between frequencies, as you said.

With Superuser allowed, I can tune to some stations in which I seem to receive multiple signals from different frequencies (nearby ones?) or a single signal with some weird sounds constantly interrupting it. Also, the different signals I hear mixed one after the other seem to be of good quality as I listen to some songs very clearly.
[Spirit FM] xmguy:
I have the Continuum, yes. It's rooted. Running a custom Froyo rom. :D

I know some phones have the multi chip. Like BT, FM and WiFi. But lot of the time the FM interface isn't enabled or as you stated the correct PCB contacts are not made for audio or antenna routing. It is a Galaxy S phone. But not as high end as the Fascinate.
[Spirit FM] sfortier:
Samsung Galaxy 5 - GT-i5500

Hi, mike!

Me and psyke83 get the correct audio routing to fm_speaker on G5 CM7.1 libaudio (see some post before) but we still get no audio.

We are thinking if samsung use some weird code to adjust the volume of fm radio.

Maybe we get audio, but with volume=0

What do you think?

Thanks.
[Spirit FM] mikereidis:
OH ! The "Samsung Continuum" is a phone ! A variant of the Galaxy S.

I thought you were asking about all Samsung phones, LOL. :)

Have you tried FM TwoO in the market ? It's for Galaxy S but very few people seem to have success with it. Strangely it's the creation of a Canadian federal government department, right here in my own city...
[Spirit FM] xmguy:
I tried it. No joy. :(
[Spirit FM] mikereidis:
Wow, you have a LOT of processes there, including MANY instances of kcryptd_io, kcryptd, kdmflush and loopX. I did a quick google and you aren't the only one with this issue. I can't imagine it's normal, but I don't know.

And I have no idea if it's related to FM problem, but I'd guess not.
[Spirit FM] mikereidis:
I doubt that. If I recall correctly the schematic more or less showed analog FM audio going straight to the MSM7227. And this is the same for a huge number of phones.

There are 3 volume controls total I think, so Samsung wouldn't need to add a 4th. The first is on the FM/combo chip, the 2nd a PGA in the 7227, and the 3rd the output volume control on the 7227.

But anything is possible. I'll look further.
[Spirit FM] mikereidis:
I use this as a reference for CM audio routing: https://github.com/CyanogenMod/android_hardware_msm7k/blob/gingerbread/libaudio/AudioHardware.cpp

For whatever reason, your code at https://github.com/psyke83/android_...5/blob/gingerbread/libaudio/AudioHardware.cpp seems to have a different lineage.

The main thing that strikes me is that you have code for FM_SPEAKER but not for FM_HEADSET. I'm not sure if adding such code would help, but I don't think the headset would work with FM with your current code.

------------

I spent most of today trying to find a way to poke the MSM7227 hardware directly, to no avail despite confidential documents on Asian websites, LOL.

Working from kernel source I can see this code path:

arch/arm/mach-msm/smd_rpcrouter.c etc. :

rpc_call() -> msm_rpc_call_reply() -> msm_rpc_write() -> smd_write()

I have no idea how the SMD / Shared Memory Driver sets up the audio routing, but it might be passing instructions via some RPC to another processor besides the apps proc. So no registers to easily poke.
[Spirit FM] DeadTed:
what kind of processes are these kcryptd_io, kcryptd, kdmflush and loopX? Indeed there are many processes running but my phone operates quite fine..!
[Spirit FM] mikereidis:
I have no idea, except something cryptographic, like for WiFi or BT security. Perhaps if you turned both BT and WiFi off they'd go away.

I don't recall if it was your log, but a few logs I've seen recently seem to have the TI WiFi drivers getting repeatedly restarted.
[Spirit FM] DeadTed:
as far as I know, x10 mini pro has a broadcom chip, so probably that was not me xD i mostly turn wifi on for a while and then turn it off immediately due to my short battery life. bt is rarely on, except when trying to use your app. but probably these kind of processes do whatever they want; my available memory changes by itself during the day from about 80 to even 20 mb with me doing nothing but killing the running useless apps :P
[Spirit FM] sfortier:
G5 board has no FM_HEADSET snd endpoint, but I can "merge" the reference driver and see what we get...

Thanks.
[Spirit FM] mikereidis:
I read something that said there was no way to enumerate the sound endpoints supported by the hardware/SMD/Rpc or whatever. So something earlier in the chain has to specify the endpoints.

FWIW, since my understanding is limited.
[Spirit FM] HD2MAX:
Not work for my LG Optimus 2x with CM7 any idea?

try all audio method but nothing, no sound, apparently works, and the RDS working, and also there signal, but no sound

thanks by this app
[Spirit FM] mikereidis:
If you have a Bluetooth headset and follow the instructions here, you might be able to get low quality audio: http://xdaforums.com/showpost.php?p=16203623&postcount=835

If you can select Menu -> Email Logs and send me your debug logs, that would be useful. But please try to note if the attachment is good. A lot of the debug emails I've been receiving are missing the attachment or sending it as 0 bytes, for some reason.

Thanks !
[Spirit FM] danstheman7:
Hope to see Atrix 4G support soon :D

Once that pops up, i'll definitely purchase this and recommend it to the large atrix fanbase!
[Spirit FM] mikereidis:
Post 2 in this thread has the stock FM apps for the 2X / P990: http://xdaforums.com/showthread.php?t=1043897

It's possible that the FMRadioWidget app might enable sound.

I looked at the Widget and FmRadio APK code and found the following AudioManager functions are called from FmAudioManager in the Radio app:

isFMRadioWiredHeadsetOn()

isFMRadioSpeakerOn()

setFMRadioSpeakerOn()

setFMRadioWiredHeadsetOn()

SetWiredHeadsetOff()

SetSpeakerOff()

Some of these are also called by the Widget. I doubt that these special, non-standard functions are implemented in the CyanogenMod port, but it's possible.

Beyond that we'll have to find a lower level method or hope/wait for the CM port to support FM.
[Spirit FM] :
I read that thee G3 is on a Broadcom BCM4339, a combo WiFi/BT/FM chip, Not sure if that helps . Anyway glad to be of help. If you need a tester for alphas or what ever send them my way and i'll test :D
[Spirit FM] mikereidis:
No, the G3 D855 (etc) uses a Qualcomm FM/combo chip.

Spirit1 has a bug that identifies it as Broadcom and then doesn't work, but manually setting it for Qualcomm makes it work.

The LG G2 uses Broadcom though.
[Spirit FM] :
Yea maybe that's the inactive D850/1 US versions. Anyway. Just got back on kitkat after deciding to wait for the likes of proper root in all apps and xposed and I notice today's beta does what the last one did on lollipop. As in I can hear myself and root deamon again.
[Spirit FM] RGold55:
Was working, not anymore

Hi, Mike:

Some months ago I bought myself a Spirit 1 license for my Galaxy S3 Mini(*). It worked like a charm, I was very satisfied with it. Kudos to you!

Having recently bought myself an S5 Mini(**), I tried installing Spirit 1 at the new device, but to no avail (correct frequency locking, albeit no audio). Then I bought myself a Spirit 2 license, although I supposed it wouldn't work. I was right. No Spirit 2 for you, S5 Mini.

Then I decided to go down the device lane, installing Spirit 2 at the S3 Mini (after uninstalling Spirit 1, of course). No can do.

Finally, I uninstalled Spirit 2 from S3 Mini, and reinstalled the once working Spirit 1. Now I get the attached error message, which I've never seen before, while messing around with my Minis and my Spirits:

(recap: this image refers to Spirit 1 at S3 Mini, a scenario that was working fine up till today)

Any hints? Thanks in advance.

(*) S3 Mini is rooted and busyboxed, running latest NovaFusion CM11.0 port (KK 4.4.4)

(**) S5 Mini is rooted and busyboxed, running latest Samsung stock firmware (KK 4.4.2)
[Spirit FM] mikereidis:
Hi, :)

Did something change ? IE, did you update Spirit or the ROMs just before the problem were seen ?

Does the GS5 mini does have a working stock FM app ?

Do you see RDS info on Spirit1 on S5 mini ? RSSI at top left goes up when tuned to a strong station, with a wired headset plugged in for antenna ?

I don't have a debug log from S5 mini yet. Can you send one from Spirit1 on S5 mini ? This works even if Spirit doesn't start; just hit Back or Cancel at the error to get to main screen. Tap the frequency button, enter the number 7 and tap "OK". After 20 seconds or so, press Send from your email client.

Spirit2 will not work on S3 mini. On S3 mini with Spirit1, try rebooting after toggling from your normal Bluetooth power state to the opposite. Send a debug log for the S3 mini too.
[Spirit FM] :
Just to note im now on Carbonrom ASOP so Spirit is the only FM app i can use :D
[Spirit FM] rahib172:
Please Confirm does it work with Lg Optimus G pro e980? stock kitkat rom! I'm rooted
[Spirit FM] rob_yx:
lg g3 support

Hi, is spirit1 work with lg g3 stock rooted? I have Spirit unlocked and set it to FM CHIP:QC V4L (HTC) but it doesn't work; the bluetooth service has force close when start spirit1
[Spirit FM] :
What's your model number. Only the D855 has a working fm on it and only Spirit 2 works on the G3.

For Mike... Just realised that modding mixer_paths_qcwcn.xml to increase the volume also increases the fm volume so it distorts. Makes sense now since its listening on a output. I changed lines 864 and 865
[Spirit FM] rob_yx:
Yes I have d855, stock fm app is only mono...there is a way to use spirit1? I want it because I love to listen in FORCE stereo( spirit2 doesn't have this option)
[Spirit FM] mikereidis:
I think it does not work

LG Optimus G Pro E980 uses a Broadcom chip and Spirit supports that.

But the method to enable FM audio is distinct to this model and I don't know what it is.
[Spirit FM] mikereidis:
I think it's been reported to work, when rooted, but I may be thinking of Spirit2 reports.

You can send me a debug log from Spirit1. Tap the frequency button, enter the number 7 and tap "OK". After 20 seconds or so, press Send from your email client.

And/or email me mikereidis@gmail.com and I'll send you the latest Spirit2 beta.
[Spirit FM] mikereidis:
The default stereo mode in Spirit2 is the same as "force" stereo in Spirit1.

It's not really possible to FORCE stereo like we can force mono.

We can request stereo from the chip.

But if the transmitter only sends mono (I see this in news reports) or if the signal is too weak to decode the multiplex signal, we will only get mono.
[Spirit FM] mikereidis:
Spirit2 beta November 18 / 141118:

Now on Play for customers signed up for betas: https://play.google.com/apps/testing/fm.a2d.s2

Or email me mikereidis@gmail.com if you want to try.

Tested reasonably well* with early Android Lollipop 5.0 ROMs for GS3, Note2, Xperia Z1, HTC One M7. *= At least as stable as these early ROMs themselves.

Broadcom devices Bluetooth must be off for now: HTC One M7, LG G2, Xperia Z2/Z3.

I'm not making this Spirit2 beta available for general download.

Christmas is coming and I usually see a sales boost at this time, but sadly my sales are down the last few months. I could very much use the support of those of you who are not yet customers. :)

Recent Spirit2 beta's result from a HUGE re-architecture that was needed to deal with the SELinux in Android Lollipop 5.0.

This took a LOT of work over the last 3-4 months and a good bit of fixing and tuning remain to be done. Regretfully most people will SEE no real change in the UI at this time. The code work underneath is invisible, except for the new bugs it brings, and a few old issues resolved.

Spirit2 supports Android 4.1+. Android 4.0 ICS support was dropped.
[Spirit FM] rob_yx:
Ok, spirit1 works on LG G3 D855 with these parameters:

-----SETTINGS -> AUDIO--------

AUDIO METHOD: Digital QCom ;

----------DEBUG-----------------

FM CHIP: QC V4L(HTC);

FM API: Low Level;

BC 4330/20780: Disable.

However 4 months ago I bought spirit1 on play store; can I convert the license to spirit2 or get a discount to buy spirit 2?
[Spirit FM] mikereidis:
Good. :)

The BC 4330 setting should not have an impact.

Yes, just email me at mikereidis@gmail.com with your order ID or [MENTION=5499064]gmail.com[/MENTION] email of purchase and I'll cancel the Spirit1 order.
[Spirit FM] Lord Kalma:
MTK Support (yes, again)

Mike;

I'm appealing to you about support on MTK chipsets. I read your arguments on this subject but I think there is a change on the situation. Here in the european market, more and more phones with MTK chips are showing up as an alternative to more expensive phones. And I'm not even talking about chinese companies. There are european companies using mtk chips on their devices (wich is my situation). I have a MTK phone from a spanish company (BQ [Aquaris E4]) and I did noticed that the native FM app sucks for real. I don't know if Android One project (being a project running on MTK devices) brought up anything usefull, but your app is amazing and I would love to is ported to my device.

Well, I'm only asking for you to reconsider it.

Best regards;

Rui O.
[Spirit FM] mikereidis:
:)

I am happy to reconsider anything on an ongoing basis.

I HAVE noted that some "1st world" OEMs have been selling a few inexpensive Mediatek based devices in the last 1 year or so.

Android One on Mediatek has also resulted in the open sourcing of a lot of Mediatek code that was previously closed, including drivers for their FM.

AFAIK, Google has not released source for the "Google Android One FM app". AFAIK, it's mostly or all built from code from Mediatek; Google is mostly repackaging it. AFAIK, the FM app only supports Mediatek and no expansion of chipset support is expected. AFAIK, Android One will never be sold in North America.

The almost 4 year old Spirit1 is now in "maintenance mode". No new features will be added, nor support for Android Lollipop, nor support for new FM chips or even new devices with supported FM chips.

That leaves Spirit2, which is limited in support to a small handful of the most popular rooted devices among Android enthusiasts. And even here there are some devices that I kind of regret supporting, based on the amount of work required versus income from those devices.

Just 2 phones are over 50% of Spirit sales: GS2 and GS3. Add GS1, Note1 and Note2 and we're looking at around 75%. If I was more money focused I would have just supported Samsung only. Heck, I've made a really surprising amount of money from GS4's and GS5's despite that FM is impossible on them.

MotoG is a good example of how little I can make on a cheaper phone, despite incredible popularity and development among Android enthusiasts. It's almost 1 year old now. On Spirit2 it has earned $161 and on Spirit1 $469, for a total of $630. Phone cost $230, for a "profit" of $400. I have put 100 - 200 hours of work into it. So that's $2-$4 per hour so far, in a country where minimum burger flipping wage is around $10 per hour.

Mediatek return on investment would be lower than that, I'm positive. Asking me to accept extremely sub-poverty wages would be rude and insulting, assuming you agree more or less with my estimates above.

Of course I assume your intentions are good in asking me, and I'm happy to answer and try to clarify. :)

I think the only chance for Mediatek support is if I open source at least part of Spirit2 and provide methods to integrate a new FM chip and FM audio to 3rd parties.

China has many VERY talented devs who can bypass almost any licensing protection software. I saw what they did to my own code and gave up trying. Perhaps they could turn their talents into adding chip support instead.

I don't see too much incentive to do this though, and it would surely result in even MORE emails from Chinese non-customers than I get already; at least a few every day, mostly debug logs from very old versions of Spirit1.
[Spirit FM] gendone:
I have LG Optimus 4X P880 using mahdirom.

Does it works?:D
[Spirit FM] mikereidis:
P880 Audio-> Method was working at least partly 6-12 months ago; I'm not sure now.

Email me mikereidis@gmail.com if you want to test.
[Spirit FM] mikereidis:
Spirit2 beta for Lollipop: November 20 / 141120:

Now on Play for customers signed up for betas: https://play.google.com/apps/testing/fm.a2d.s2

Or email me mikereidis@gmail.com if you want to try.

Changes relative to 1118 beta release: Stability improvements.
[Spirit FM] mikereidis:
Spirit1 beta November 20 / 141120:

Now on Play for customers signed up for betas: https://play.google.com/apps/testing/com.mikersmicros.fm_unlock

First beta/release since August 27 / 140827.

Changes relative to 0827 release:

- Messages informing no lollipop support for Spirit1.

- Qualcomm digital audio moved to port2. May avoid Google now hotword detection issues.

- Galaxy S Advance GT-I9070 Audio-> Method = "Galaxy S2/Note/S2_ICS" automatic, and "routing=2" for speaker mode.

- Miscellaneous small adjustments.
[Spirit FM] hashlikeageek:
gonna try it :P
[Spirit FM] nicesoni_ash:
Just a small query. Will spirit 1 will be updated to support lollipop in near future or we need to use spirit2 for i9300? Sorry, not following this thread for some time. I would happily use spirit2 anytime but no matter how many times I use it I always have to go back to spirit1, I find it more stable and working always for my s3 than spirit2.

_____________

Sent from my "GT-I9300/1+1" powered by Carbon Rom & Boeffla/ak Kernel

Fueled by 7000mAh ZeroLemon Battery