yashsingh1/xdaforums huggingface dataset:
[Spirit FM] mikereidis:
Spirit1 and Spirit2 both support Qualcomm FM chips such as the older WCN2243.

Spirit also supports the newer Qualcomm audio chips, but there were some problems with the older ones.

You should try Spirit2 if your phone is rooted.

For Spirit1 try these Audio=> Method settings:

- Qualcomm ALSA

- Sony Z/QC Intent

- Sony T/QC Intent

- Digital QCom

My guess is that none of these will work, but it's worth a shot.
[Spirit FM] AnBro-ID:
Yes, you're right. None of these work on rooted stock 4.1/4.4.2/CM 11.
[Spirit FM] lossah:
Just need to say that the lollipop version, stock, of LG G3 works really, really good. :) Not a single bug. Definitely worth the money, and lots more tbh. Best app I'm using.

Thanks for a awesome job mikereidis! Time to try out AOSP lollipop soon, will probably work there also. :)
[Spirit FM] avilav:
I have a moto G (x1032)

My problem is that if I use spirit fm, after turning it off, I do not hear audio calls or sounds (including notifications) from the speaker.

It happens in kitkat based roms or lollipop based

If you need happy sent a catlog

PS: Sorry for my english
[Spirit FM] mikereidis:
Great ! :)

You are at least the 2nd or 3rd person to say Spirit2 works OK on stock, rooted LG G3. But 2 people were saying the Bass is too high.

G3 is "standard Qualcomm FM + Qualcomm Audio", which is supported on many phones (MotoG, Xperia Z/Z1, One M8), so it should work OK, but there can be some audio issues sometimes. Later Spirit2 releases will support different audio methods, like Spirit1, so hopefully those will resolve.

I posted upthread that I was looking to get a G3 and officially support it. But I am not too happy about locked bootloaders; my G2 has been a big pain; and my income is rapidly dwindling so I am having second thoughts, at least at pre-Christmas prices.
[Spirit FM] mikereidis:
Spirit1 or Spirit2 ? Paid or free version ?

I will test better on my XT1032 when I can. I also got another 1032 for my son for Christmas so I will be able to test on stock and with a usable SIM too.
[Spirit FM] avilav:
Spirit 2 (google play).
[Spirit FM] mikereidis:
I will presume you are running the 141128_kitkat version on Kitkat. If not, try it.

The 141216_beta and 141216_lollipop releases are the new lollipop architecture and may have different issues than *_kitkat releases.
[Spirit FM] egemet:
In my D855, what I hear is not coming from mike, I know that it's from the tuned station, but very short.
[Spirit FM] mikereidis:
I guess the FM kicks in, then something kicks it back out.

Disabling Google Now hotword detection fixes some issues; might be related.

Things to try include:

- Unplug wired headset.

- Re-Plug wired headset.

- Switch to Speaker and back to headset.
[Spirit FM] mervluk:
I'll be interested in the result. I have the dual sim version XT1033 (same firmware?), 4.4.2 unlocked and rooted, though, but still with stock firmware. Spirit 1 is good audio when it works (and Viper processes too), but has an issue at times with receiving any stations (just hiss), even with strong signals (45+) and RDS data working. Then it all comes back and stays for the duration, eventually. I have eliminated Viper as the cause. There is simply no audio though at all on Spirit 2 (beta) nor on the stock fm, although Spirit 2 gets RDS data fine.

I've also a locked carrier XT (4G) XT1039, which I got free with a contract renewal, though as it's on 4.4.4. it seems still unlockable and not capable of being rooted, so it's stock and Spirit 1 works fine on audio with full RDS data.

:confused: Perhaps it's the Moto chaos I got used to years ago with the Razr i.
[Spirit FM] tin2404:
On my Note 2 N7100 Can't switch to speaker !!

The app works fine with earpods but when I try to switch to speaker which I think is the speaker icon on the top right, I just get the volume change interface... I dont find any other option in the app which lets me switch to the phone speaker.So confusing indeed.
[Spirit FM] mikereidis:
So, your XT1033 is stock and rooted, but the stock Motorola FM app does not work ?

If the stock FM app does not work, then something is wrong and Spirit2 may not work. Maybe Viper or other audio mods are creating some problem.

But you are saying that Spirit1 DOES work on that phone, despite stock and Spirit2 not working ?

I have yet to figure out why some people can not get Spirit to work on some Moto G's, while I and others have success.

If I recall correctly, some people have reported the stock MotoG FM app only provides Mono sound, which is also strange.

A big difference is that MotoG is designed for FM and officially supports FM.

The Razr I hardware supports FM. Then Google bought Motorola and may have said "Disable FM in software".

Then people were running Spirit or the stock Motorola FM app on Razr I with Android 4.0 ICS.

And Google/Motorola/Verizon may have said "Kill FM better so the stock FM app doesn't work anymore". And so the 4.1 JB update killed FM even more, and there was no way to revert to 4.0 ICS, despite that some people would have preferred FM over the JB update.

In theory I could have bought a Razr I and spent at least dozens of hours reverse engineering the FM audio and allowing rooted devices to have usable FM.

In practice the number of rooted Razr I owners could not justify buying one, even ignoring the 100+ hours that would have been required to research, fix, and continue to maintain support for this.

Here's a "laugh": Some 400 people bought Spirit on Galaxy S5 phones, which are impossible for any app to ever support FM, AND did not cancel their orders themselves or by emailing me.

That blows away the number who have bought Spirit on Razr I, LG G2, HTC One M8, and many other phones that have FM, or that I own and provide official support for.

This is sad and unfortunate.
[Spirit FM] mikereidis:
Swipe from right to left and you will see some settings. Select Speaker.

The stock Samsung FM app uses a speaker icon at top right to bring up a volume slider. I copied a lot of the Spirit2 UI concepts from the Samsung app, including that, the record button, and the shiny frequency dial.
[Spirit FM] mikereidis:
Samsung is now disabling FM on the "Mini" version of their latest GS5 flagship. :(

This includes Galaxy S5 Mini SM-G800F and SM-G800H.

Both the GS3 Mini and GS4 Mini support FM and Spirit1 reportedly works on them, stock or AOSP (with stock audio HAL), as long as they are rooted. (Not sure unrooted.)

This seems to continue the rule that FM is not possible on Samsung's that do not have a stock FM app. I have never seen an exception to this rule, except that some Turkish variants may have a hidden and inaccessible stock FM app.

It may be that Samsung now has a strategy of disabling FM on lesser and lesser phones, instead of just the flagships.

All this bodes badly for the future of free FM radio on Samsung smartphones, and by extension Spirit.

The 2 most popular phones from which Spirit are bought so far this month (December 2014) remain GT-I9300 at 21% and GT-I9100 at 10%.

When the leading phones for an app are 2.5 and 3.5 years old, that's a huge red flag that the future of Spirit as a paid app is grim. Combine this with the continued slide of my income below tolerable and sustainable levels and the "writing is on the wall" as they say.

Oh well. There are other app categories that still hold promise...
[Spirit FM] mervluk:
Yep on the XT1033 Spirit 1 is absolutely perfect stereo with full RDS. It just has a bit of a problem with the initial tuning with just hiss, but once reception comes the audio is excellent and stays. Spirit 2 everything works, including the scanning without any delay and RDS data, apart from no audio whatsoever (just silence), but perhaps that could just be the Lollipop beta, as I'm running 4.4.2 which is necessary for the rooting? Viper slightly improves the audio everywhere, but before it was put on the phone there was no FM audio on Spirit2 and stock FM. EDIT: weird, the XT1039 (stock 4.4.4) is now unlocked and rooted, and Spirit 1 is fine and starts up straightaway, Spirit 2 is the same as on the other phone, all fine but no audio. Viper is fully processing in both.

I did put Spirit 2 on the phone once unlocked and rooted and tried it before I tried the stock FM app, though; then tried Spirit 1 and bingo! (I'm such a fan!).

On the XT1039 the stock app, which works (not rooted and locked), the stock FM app appears to be mono only (or low rate stereo). Of course Spirit 1 works too, with better audio quality IMO.

Both phones are still currently on stock roms until I sort out the niggles.

Yep I kept my Razr i on 4.0.4, and quite frankly didn't miss the upgrades much. The limitation was the hardware, the TI FM chip(?) was, I think, pretty horrid, and no firmware was going to cure that. So anyone who tried to work to restore FM functionality, and anyone who used it, would have been wasting their time.
[Spirit FM] -Jonny-:
The audio is working well on my HTC Sensation XE. I'm using qdsp5v2 setting (although Auto also worked 'out of the box'!). However, I don't get any RDS text. Can you point me in the right direction of which options to play with (as there are many!)? Thanks for your hard work as without this I wouldn't have any radio. My ROM is CyanogenMod 11 with 3.0.16 kernel
[Spirit FM] mikereidis:
Only the paid version of Spirit1 (or Spirit2) supports RDS.

There is only 1 setting that can disable RDS, under "UI", but by default it is enabled.

A reasonably strong signal is needed for RDS; adjust headset cable antenna for best audio for the best chances.

Some stations do not transmit RDS info, and sometimes the power may be lower at night. I see this with a few local stations and I think I broke RDS when testing until 06:00 AM arrives or I tune to one local station that maintains power during week nights.

If you have a paid version of Spirit1, send me a debug log while tuned to a strong station known to support RDS.

Tap the frequency button, enter the number 7 and tap "OK". After 20 seconds or so, press Send from your email client.
[Spirit FM] matin0611:
hi [MENTION=3575078]mikereidis[/MENTION]

thanks for your great app

i have questions

i used spirit 1 UL and working fine on samsung galaxy s3 stock rom

then i decide also use spirit 2 to see which one is better

as you say it's only for AOSP roms

i download it and when i trying to install it give me parse error

and then i think about something

i downloaded archidroid rom is also have spirit 2

so i decide to test that spirit 2 in archidroid in stock rom

and it's working fine

so i'm little confused to what happened

why that spirit 2 give me parse error and why this spirit2 install?

(Sorry if I have mistake in writing and grammar my english is not good)
[Spirit FM] nicesoni_ash:
Could be possible that you downloaded a version that's only meant for lollipop and that's why that error or a corrupted apk.

_____________

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

Fueled by 7000mAh ZeroLemon Battery
[Spirit FM] mikereidis:
:)

AOSP ROMs tend to be easier to support. But Spirit1 and Spirit2 both usually work on stock ROMs. Spirit2 requires root though.

You downloaded Spirit2 from where ?

A paid version of Spirit2 or a free version ?

Tap the "Menu" button at bottom middle, just above the presets and below the dial or visualizer. What does it say in blue, such as "Spirit2 2014_12_16_lollipop" ?

Archidroid ROM includes a free version of Spirit2 already installed.

If you are a customer, send me a debug log: 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:
Please post questions in this thread and not by PM.

I do not believe that Spirit has ever worked on Sony Xperia Arc, and it never will.
[Spirit FM] matin0611:
i think the version i downloaded and give parse error is for lollipop :)
[Spirit FM] arjun90:
Any love for the Note 4?
[Spirit FM] Fixo:
Does even Note 4 has FM Radio chip on its board?

I dont think so...
[Spirit FM] mikereidis:
I would love to love the Note 4, but it will not love me back.

Pretty much all Android phones contain an FM/Bluetooth/WiFi combination chip, usually from Broadcom or Qualcomm.

Most Android phones purposely disable FM permanently and unfix-ably in hardware by grounding the FM antenna pin(s) instead of connecting them to wired headset jack with 1 cent worth of parts.

Samsung does this on S4 and later flagships and even S5 mini now. No software can fix that.
[Spirit FM] sulexi:
Is there any version of spirit transmit working with xperia z2? Or any chance to get it work?

Wysłane z mojego C6903 przy użyciu Tapatalka
[Spirit FM] mikereidis:
Sadly, no chance. :(

Z2 and Z3 were the start of Sony moving away from 2 years of Qualcomm FM/combo chips and moving to Broadcom chips that do not have a transmit function.

I bought a Z2 tablet assuming that it was still Qualcomm and transmit capable. I was disappointed, though I love the tablet otherwise (except for an extra A->D->A conversion in Spirit2).

The positive is that the Z2 and Z3 and presumably some future Z devices can now be supported by Spirit2.
[Spirit FM] mikereidis:
:)

Someone else reported this and it's due to 2 missing C and 2 H files that need to be included from the Spirit1/Unlocked source code.

I have updated post #1 of the Spirit2 Free/Open thread with this ZIP file containing the missing files: http://xdaforums.com/attachment.php?attachmentid=3099802&d=1420483043

These files reportedly fix the build; it's easiest to put them under ../ul relative to the Spirit2 directory. Next release they will be in the same directory.
[Spirit FM] :
Hey.

I've seen the request on github - looks like the fdroid guys would like to build it for the repo.

Anyways, thanks a lot for the ZIP file. Now spirit2free builds without problems and works. I see it is stereo which is nice. One curious thing though: Spirit2Free activates my mic.

That means it channels all the sounds that are caught by the mic to the headphones. Is this intended?
[Spirit FM] profyler:
hi friend,

Is spirit FM working on LG optimus l7? i found out that some people manage to work (on optimus 4x hd and L7 aswell) with alsa mixer but dont know if its still working.

thank you
[Spirit FM] mikereidis:
Yes, I've had 3 requests now.

Good... :)

Yes, the microphone thing is part of the new Lollipop friendly architecture.

Old architecture was C/NDK code reading from /dev/snd/pcmC0D0c or similar after setting up ALSA via /dev/snd/controlC0 to send FM digital audio to that port.

But with some SELinux policies, pcmC0D0c was no longer accessible via Java, even though permissions were chmod'd as needed. There were also issues with Google Now hotword detection.

New architecture opens and reads audio from the "microphone" like a normal, no-root needed app. After that is started, Spirit2 for Lollipop "sneaks" in and writes to controlC0 to switch from microphone input to an FM audio input.

Sometimes this causes problems when Android switches it back to mic, such as when headset plug is yanked. Spirit2 has code to handle this, but in some cases it might not work. I will patch whatever issues I can.

Other issues might include mic pre-processing that is difficult to disable.

Many AOSP/custom ROMs have SELinux disabled now. If that continues, or if /dev/snd is exempt, I might provide an option to do things the old way.
[Spirit FM] mikereidis:
L7 requests are relatively rare, so I am not able to follow if Spirit1 works on latest ROMs.

Best to just try it. There is a free version of Spirit1 here: http://xdaforums.com/showpost.php?p=57261804&postcount=8695

For 4x someone gave me ALSA commands that worked, and I incorporated those into a Spirit1 audio-> method setting. But the audio may have some problems in some situations.
[Spirit FM] B2Pi:
Did you ever get these logs?

I hope I'm not flogging a dead horse, but I can provide logs if you have any interest. I was shuffling along with NextRadio on a Sprint Note 3, but with the move to CM 12, that option is gone. In any case my wife has an unmodified Note 3 (also on Sprint) from which I can get logs.

Do let me know.
[Spirit FM] mikereidis:
It's not dead, but it's in a vegetative coma. :(

There are much more popular phones that I don't have time to support.

There is a Spirit2 Free/Open source released, and anyone with the time and skills is welcome to try and figure it out.
[Spirit FM] :
I see. So in my case with the S4 Mini it is the way that I can listen to radio while at the same time the mic is forwarded to the headphones. This leads to some noise distortion when e.g. putting the phone in the pocket. In that way the mic catches and forwards a lot of unwanted noise - which of course reduces the listening experience.

So the question is: How to fix this? I could provide some logs to you if you want to have a look at that. Or maybe if fixing this would be too much of a hassle there might also the possibility to go back to the 'old way'?
[Spirit FM] mikereidis:
Which ROM ?

S4 Mini is a Qualcomm device for both audio and FM/combo. Several devices and ROMs have been good. Some (at least 1 Sony) had an issue with mic pre-processing that I couldn't find a way to turn off. Yet, anyway...

Some devices I can crank the gain down and it sounds much better. I'll make that a setting that can be configured.
[Spirit FM] :
Would be really nice. I use CM11. If you need logs I'd be happy to provide some and/or test the change you make.
[Spirit FM] mikereidis:
You can send me a debug log from Spirit. Tap the frequency button, enter the number 7 and tap "OK". After 20 seconds or so, press Send from your email client.
[Spirit FM] :
The debug procedure you mentioned leads to a fc after 20 seconds. Probably because I got no email client installed. But I got the log via logcat. Would this be enough logged information?
[Spirit FM] HD2MAX:
Hi I have no headset for test sorry, mm I tried the radio apks but will not let me install the radiowidget(I copied on system/app but no found in widgets menu), the radio app if but when open is only a 2secs and closed with tipical app crash...

Edit check the debuglog on email
[Spirit FM] denzel09:
Mik i have send you a new logcat, ..
[Spirit FM] psyke83:
Mike,

Thanks for your messages. Here's some logs from the I5500 Froyo ROM when using the native radio app. I scanned the channels, played a few stations and switched between the speakers and headphones.

Logcat: https://gist.github.com/96748fa5fb5ae56377dd

Dmesg: https://gist.github.com/a3827801ecba7f2e7c6a

The dmesg log indeed shows some relevant lines, such as:

<3>[ 222.685183] [snd.c:snd_ioctl] snd_set_extamp 27 29 0

Is there anything specific I can help you isolate that may be useful?
[Spirit FM] psyke83:
Samsung have indeed added some customizations to the kernel sound drivers that are not common to vanilla MSM7227 kernels.

This is a diff between a vanilla msm_audio.h from the 2.6.32 CodeAurora source (---) and the Samsung I5500 source (+++): http://pastebin.com/AdFbm6Us

For my port I need to set the "snd_set_main_mic" ioctl in libaudio in order for the correct mic to be selected (otherwise, the microphone embedded in the earpiece would be active during calls). It's possible that some other function needs to be called to enable the FM radio.
[Spirit FM] xmguy:
Got rid of the Incredible 2 phone. So I'm going back to what I originally had. Droid X. If I install CM7 on it will your app work? I think it's running a Ti chipset. I hope and pray so. The lack of a good FM Radio app on CM7 for the X is the reason I was running stock.
[Spirit FM] mikereidis:
Maybe. It's a TI based device, BTW, unlike the Incredible.

I've updated my compatibility list at post 2: http://xdaforums.com/showpost.php?p=13380058&postcount=2 And I've been trying to compile an "Ongoing Investigations" list.

SaurusX and I have been trying to find a way to fix the issues he's having on the Droid X. BUT, it appears there are a good number of people using it with the FM_Launch method with no problems.

In fact, the Motorola Droid X is the 3rd most popular identified phone running my app at 5.1% or 443 devices. So I think it must work OK for many.
[Spirit FM] mikereidis:
Thanks !

The schematic shows a Maxim MAX8899 power management IC (and external amplifier). I think the schematic might be misleading, with the block diagram showing analog FM audio going into the blue of the MSM7227. The audio might go into the MAX chip. There are no public specs for this chip but the block diagram shows it can be controlled with I2C.

So I guess snd_set_extamp means "Set External Amplifier".

The source code header file shows a SND_SET_EXTAMP Ioctl with 3 parameters: device, speaker_volume, headset_volume.

So "snd_set_extamp 27 29 0" sets FM_SPEAKER to have speaker volume 29 and headset 0. I think that 31 is the maximum volume. Perhaps speaker and headset can be simultaneous ?

Dmesg seems to show sets of 3 Ioctls:

snd_set_extamp 27 29 0

snd_set_device 27 0 1

snd_set_volume 34 0 6

Sometimes followed by:

snd_set_extamp 17 0 21

snd_set_device 17 0 1

snd_set_volume 34 0 6

If I can presume you are running the Samsung kernel, then hopefully these Ioctls will work for us.

There's also a SND_MAX8899_AMP_OFF Ioctl, but I'm not sure we'd need that. Dmesg shows "snd_max8899_amp_off 0" after:

snd_set_extamp 29 0 28

snd_set_device 29 1 1

snd_set_volume 34 0 6

So I guess one of us should try writing the code to send these Ioctls. AFAIR, the /dev/msm_snd device can't be opened by my app, so the code needs to be in the ROM. But I can try to help...

I presume you aren't using the Samsung libraries/library code though. On the stock ROM I can see the FmRadioPlayer functions setSoundPathFMRadio and setSoundPathFMRadioWithDelay call AudioManager->setParameters() with:

routing=8

routing=2

routing=10

fm_radio_volume=off

These values might be useful to get FM working on a stock ROM.
[Spirit FM] mikereidis:
Thanks !

So the "LG Optimus 2X / LG P990 Star / LG P990 Optimus Speed" uses a Tegra2.

I couldn't find much technical info on the Tegra(s) but there doesn't appear to be an analog audio input that would be commonly used for FM. And I couldn't see any drivers in your /dev that might help.

So there is likely some external audio chip that needs to be sent commands. This will require some research, into the CM code and the device hardware.

If there are any technical reference documents or schematics available for this, or a similar device, that could be quite useful.
[Spirit FM] mikereidis:
It appears that the HCI link goes bad after some "mystery functions" are called.

I can provide an option to disable these and we can see if we get improvement.

I'm just writing the below in the hope that someone, sometime might be able to shed light on the subject.

These "mystery functions" are from the CM set_volume_fm() function in AudioHardware.cpp for libaudio.

In hcitool format they are:

hcitool cmd 0x3f 0xa 0x5 0xc0 0x41 0xf 0 0x20 0 0 0

hcitool cmd 0x3f 0xa 0x5 0xe4 0x41 0xf 0 0x00 0 0 0

hcitool cmd 0x3f 0xa 0x5 0xe0 0x41 0xf 0

These aren't normal direct FM commands. My theory is that they set up audio routing. Someone with access to the confidential Broadcom documents might be able to illuminate this.

It's possible or perhaps even likely that removing these commands will disable FM audio. But if we can see if my app tunes your device OK, then we've at least made some progress.
[Spirit FM] HD2MAX:
Hi, Thanks Mike for all

More info, The 2X has the BCM4751 A-GPS radio stack from Broadcom

http://www.anandtech.com/show/4144/...gra-2-review-the-first-dual-core-smartphone/9

And maybe the lg open source can be found in something useful of the radio

http://xdaforums.com/showthread.php?t=1144954

http://www.lg.com/global/support/opensource/opensource.jsp