yashsingh1/xdaforums huggingface dataset:
[Spirit FM] eng4r:
Ok,would i find any thing if i decompile the stock app

And you know , it works on galaxy grand running cm11 altuogh you didnt add oficcial suppurt for it

---------- Post added at 11:14 PM ---------- Previous post was at 10:42 PM ----------

Well , how do you [MENTION=3575078]mikereidis[/MENTION] add support for any Samsung device , lets say galaxy s 3 gti9300

And i will try to do it in my device
[Spirit FM] Rinoceros:
Hi Mike,

Thanks for your answer.

The HTC M9 is overpriced, I know.

Unfortunately Spirit 2 gives the error "Tuner API did not start or stop" on the QCV setting.

But as said before: don't bother on it. I still have the M8 and I am carrying both with me. So I do am able to listen to my favourite FM stations with your app.

Thank you very much for all your effort on this and I do understand why you are stopping with it. Hopefully you have a new project which I can buy :D
[Spirit FM] mikereidis:
:)

Android Auto Headunit app, the first of it's kind that can run on tablets, phones, and will run on some Chinese Headunits: http://xdaforums.com/android-auto/android-auto-general/developer-mode-aa-t3059481/page10

I've been reverse engineering AA and working on this app intensively for the last 2 months, since the first public APK release for AA.

I haven't said that I am "stopping" Spirit, though saying that new phones without Qualcomm FM chips will not be supported does indicate that my work on Spirit is "trailing off".

FM radio on mobile devices is pretty clearly dying, with the market leader Samsung only including it on a few budget phones, and same for Motorola.

Streaming is taking over, has been for years, and things like Android Auto will accelerate that IMO, in cars, which are one of the last bastions of FM radio listening.

Yes, FM will continue to "prosper" for many years on budget devices and in the less rich countries where apps are usually pirated. Most app customers own flagship phones, many with no FM, and they have the funds to pay for data plans, and tend to live in metro areas with good data coverage.

My Spirit income is now well below the legal minimum wage here, in a booming app market where good devs can make 5-10x that amount. Clearly I need additional income to keep working on Android apps as an independent developer.

Many people considered FM ancient when I started Spirit over 4 years ago. That has become much more obviously true with each year...
[Spirit FM] nick6901:
Hi Mike and thanks for the great app.

I used spirit1 in a rooted galaxy S3 and i change it for a xperia z3 lolipop non rooted.The app is not working any more(no sound at all) and i want to ask you if there is any free version of spirit1 for my case.

Thanks in advance.
[Spirit FM] supermaxkato:
boost mobile galaxy rush m830

I've got a rooted boost mobile galaxy rush m830.

I'm struggling to follow debug steps to see if it will work. The app turns on with no errors but also no sound. I noticed Mike said that some phones FM radios are hardware disabled because a pin was not grounded. Maybe thats true with this phone? Has anyone tried this phone or could someone guide me through debugging to see if its simply a setting change?
[Spirit FM] mikereidis:
Spirit2 should work if the Z3 is rooted.

Otherwise only the stock Sony FM app will work.
[Spirit FM] mikereidis:
If there is no stock Samsung app, then FM is unfixably and purposely disabled/broken, by grounding the antenna pin.

Only the cheapest Samsung phones have FM now, and even that could stop.
[Spirit FM] jassim007:
How to enable recording in the spirit1 fm UL? I don't have the recording button. I also tried spirit2 fm, but the recording doesn't work and also playing via speaker in spirit2 doesn't work. I'm running it on Galaxy S3 I9300 with omni 4.4. I mainly want to know how to enable recording in SPIRIT1FM, ?
[Spirit FM] mikereidis:
What version and date of Spirit2 ? Only the paid version records.

For the full paid Spirit1/Unlocked app, set Menu-> Settings> Audio> Method to Digital Auto.
[Spirit FM] jassim007:
Will try that out. The version of spirit 2fm that I was using is 2015_04_14. And yes both the spirtifm that I was using was the full and paid version.
[Spirit FM] zviki:
Hi.I tried Spirit transmitter (free version) app on my Sony Xperia Z phone (stock 4.4.4) but it didn't work. Do I need busybox installed?
[Spirit FM] DrNO[PL]:
For me it also does not work... See attachments
[Spirit FM] mikereidis:
No, but it needs to be rooted. Is it ?
[Spirit FM] mikereidis:
Is it rooted ?

I haven't looked at the free version in a while. The paid version is now based on Spirit2 and looks pretty much like it, and should work on Lollipop+.
[Spirit FM] DrNO[PL]:
Yes, it is. In fact I'm using THIS >> rom v5.
[Spirit FM] mikereidis:
Make sure you have a wired headset plugged in for the transmit antenna.

Try Spirit2 Free here: http://xdaforums.com/attachment.php?attachmentid=3215671&d=1426618705

Do Menu> Set> Tuner> Mode and set it to Transmit. Now restart Spirit.

Tune to a quiet channel on both Spirit and your FM radio.

Now start music playing on the phone running Spirit.
[Spirit FM] EpicEric33:
Hi, your App is great and working nicely but maybe you could change the design because I think a flat theme looks more modern. You don't have to, but if you want, you can take a look at my mockup :)

EDIT: Never mind, I did it myself ;)
[Spirit FM] DrNO[PL]:
Now it works! Thanks for the guide.
[Spirit FM] DS_katauri:
Hello everyone. I have LG Optimus L7 P713 with cyanogen 10.2 installed(without FM app,dev said it's impossible to make FM working). Neither on it or on cyanogen 11(where FM app exists but don't work) - i can't get sound in Spirit FM. In few audio output settings there actually were sounds but they were not look like FM channel but more like interference,and then Spirit2 app crushed. Maybe there are some magic to make FM working? Thanks already.
[Spirit FM] zviki:
[MENTION=3575078]mikereidis[/MENTION] Yes,it is rooted

---------- Post added at 04:19 PM ---------- Previous post was at 03:55 PM ----------

Yep,same as on mine phone.

P.S.

Ok. It's working on my phone too (Spirit 2)
[Spirit FM] Kess78:
Hi Mike,

I can't get the RadioText to work with the latest version of Spirit Transmit on play. I just got a brand new car which supports RT and it would be cool to have the name of the song directly on the car screen.

I tried to uninstall and install the app again but the pop up screen that asks me if I want to allow Spirit to access the notifications doesn't show up anymore. I know it used to work perfectly with one of the previous version... Also I don't have the sec on the PS, just SPIRITTX or nothing.

I'm on stock 4.4.4 Kitkat.

Thanks
[Spirit FM] mikereidis:
The magic is a mystery to me.
[Spirit FM] mikereidis:
Email me mikereidis and I can send some older versions if you want.

Was it stock Kitkat when you saw RT transmitting ?

The APIs to catch media info have been tricky and seem to have changed somewhat.
[Spirit FM] Kess78:
Yes is was on stock Kitkat, although maybe it was 4.4.2 and not 4.4.4.

I've sent you a mail so you can send me the previous version.
[Spirit FM] rodzwafu:
im new on this thread.. sorry for asking.. i need help.. is there anyone here using this radio app to ur samsung s2 lollipop????
[Spirit FM] mikereidis:
GT-I9100 is supported by Spirit2 on Lollipop ROMs.

9100g variant is different though. Spirit1 supports it to Kitkat, and a beta version (only) works on some Lollipop ROMs is SELinux is disabled.
[Spirit FM] JustArchi:
Hey Mike, long time no see, hope you're doing good :).

Is there any free Spirit release that works with SELinux yet? If I recall correctly, you found a way to overcome that annoying beast in some recent release, do you plan to put it in free version as well?

Cheers and thank you for your outstanding work on this.
[Spirit FM] mikereidis:
:)

The Spirit2 Free you've been putting in your ROMs "supports" SELinux, latest APK released is 150317: http://xdaforums.com/apps/spirit-fm/app-spirit2-free-source-real-fm-radio-t2951455

This was part of the major Spirit2 re-design specifically for SELinux on Android 5+.

By "supports" I mean that in my experience it work with SELinux set to enforcing. SU is used to launch a root daemon that does all the root related stuff. For the GT-I9300 this includes access to /dev/fmradio as well as /dev/snd/controlC0 and /dev/snd/pcmC0D0c .

Unless something has changed with SELinux rules very recently, this should still work.
[Spirit FM] JustArchi:
I had 2015_04_14 version :).

I think that I may know where the problem comes from. Could you see if you can run your app with enforcing SELinux when it's installed as system app?

In order to check this, you should uninstall your current Spirit2.apk from data, then put Spirit2 in /system/app/Spirit2 folder, along with proper base.apk and preextracted libs, like this, and reboot your device. If Spirit gets installed after reboot, it worked properly.

I'm not quite sure yet but I think that for some reason Spirit doesn't work when installed as system APK, even if it's installed with proper libraries included. If you could take a look, or add proper support for my custom setup, I'd be grateful, but by no means I'm requesting anything. Only spend your time on that if you're fine with it :).

I'll do some tests myself too, to make sure if my initial thoughts are right.

Thank you for your response and everything you're doing for us! :cowboy:
[Spirit FM] RBwai:
Is it possible to make Spirit for oneplus one?
[Spirit FM] CqN:
Hi Mike,

I read the entire thread above, but not clear; so possibly repeating a question:

1. On i9100 (intl) [Galaxy s2] running Cyanogenmod 11-NGHTLY (2015May various) does Spirit2 work?

Spirit1 free test version appear to work.

2. Do both Spirit1 and Spirit2 ask for root access and access to everything (#)? Is that normal? Unfortunately it instinctively raises a very red flag in my mind :(
[Spirit FM] mikereidis:
Spirit "works" on 1+1, but the FM antenna pin on the combo chip is grounded, so there is no signal, and will never be a signal. No hope...
[Spirit FM] mikereidis:
Spirit1 and Spirit2 both work fine on GT-I9100 with AOSP ROMs. I have 2 in my test fleet of phones.

Spirit1 can work fine without root on many older stock phones, using the OEM FM APIs.

AOSP ROMs almost universally have no FM API that can be accessed by a non-root or non-system app.

So root is needed for access to /dev/radio0, /dev/fmradio, /dev/ttyHS0, /dev/snd/* and sometimes others.

I've been working long, long hours on Spirit for over 4 years and it's essentially my only income. I would not jeopardize my developer reputation for anything inappropriate and Google would have disabled my account long ago if I did.

In Spirit1 all the root commands are logged to logcat. Spirit2 is trickier, with a root daemon, but 90% of the source code is open source and anyone with the skills can see what it does, minus the 10% for premium paid features like RDS, visualizer, etc.
[Spirit FM] mikereidis:
And thanks for your ROM, which usually runs my GT-I9300. :)

I never got around to experimenting with Spirit as a system app, I'll try to find some time...

Biggest issue to be aware of is hard-coded paths to /data/data/fm.a2d.sf/ or whatever, for libraries, settings and a few other things sometimes. There's a file or 2 created in a files subdir there also.
[Spirit FM] CqN:
Mike, Thank you.

There are references here to a free Sprit2 version. Cannot find a working link. Does that work on i9100 CM 11-nightly?
[Spirit FM] mikereidis:
Yes.

Follow the bottom link in my signature below.
[Spirit FM] CqN:
Well, I had clicked on the bottom link before. And the first one in that thread said you were closing that thread; so I did not pursue (at the end of the first post, there was similar link, which ended up circular). This time with your positive pointer I did look around, and see the source. Where is built app? Is it available for download somewhere? I assume most users would not be able to build an app; so I must be missing something. ??
[Spirit FM] dorfd1:
I experienced a strange glitch on spirit 2. I have a galaxy player 4.0 running kitkat. I had the device hooked up to speaker with the audio going to them I had powered spirit 2 on and off and the and the second or third time I turned it on, the app entered a weird state in which I could talk in my devices mic and it would come out the speakers but the weird part is my voice sounded it like it was being played slower.

I would like to know why I an fm radio receiver need access to your microphone.
[Spirit FM] mikereidis:
URL is at the bottom of the post I linked you to: http://xdaforums.com/attachment.php?attachmentid=3215671&d=1426618705
[Spirit FM] mikereidis:
This is the best solution I could come up with for the MAJOR re-design of Spirit2 for Lollipop+ SELinux restrictions, which took half a year of long hours, all told.

Previously Spirit just chmod'd (changed permissions on) the device nodes and could then access them from the normal non-root Java and JNI Android environment.

But this alone would not work on SELinux.

So the redesign involved Spirit2 doing normal non-root stuff from the Java and JNI code, namely: read audio from the microphone and write it to the audio output.

Meanwhile some tricky root running code in the new s2d daemon would switch from the mic input to a usable input for FM digital audio, and Android would be none-the-wiser.

Sometimes this breaks when for some reason the mic is switched back on. Pause/play usually fixes it.
[Spirit FM] rob_yx:
Hi Mike, in my g3 lollipop rooted stock, spirit2 in digital mode has a "low res" sound, even with acbd mod installed. I have selinux in permissive mode, if I install an old version of spirit2( that worked perfectly in kitkat stock) can I hear the perfect :) sound in digital like kitkat?
[Spirit FM] CqN:
Mike,

1. Thank you, I do see the .apk in this link in your msg. [ JFYI. I know you are very precise; though that problem is solved the links at the bottom of your tag line in each of your msg does not include this specific link, AFAIK. The history of all posts are still here.]

2. The Spirit2 beta looks great!! Audio quality, loudness, and possibly the sensitivity to weak fm signals appear much better. Is this where I should report problems/bugs during beta period? (I am new to this, I feel I missed a lot of the history).

A. Is there a detailed list of feature diffs between free and paid version?

B. Sometimes the station sets are maintained on restarts, sometimes they go away. ??

C. I cannot get phone speaker to work instead of the earplug, (of course both with earplugs plugged on). I tried various combos of spkr/headphne, stop/start/restart, but no luck.
[Spirit FM] mikereidis:
Does it sound like the low and/or high frequencies are gone ?

Before going back to older releases, try setting Menu> Set> Audio> Pseudo Source to 9, 10, then 11, each time restarting Spirit2 or at least Pause/Play. If one of these work this is the best solution.

Yes, Kitkat releases before the SELinux/Lollipop re-design should be OK if SELinux is permissive, as should the latest beta of Spirit1. Email me mikereidis@gmail.com if you need the best/latest of any of these.
[Spirit FM] mikereidis:
Feel free to report any problems you have here, but don't expect me to have much time to help free version users.

I don't think I ever wrote up a detailed list of differences. The big ones are: technical support, RDS, visualizer, EQ, recording and presets.

Free version presets disappear if you exit the app with Back. Switch to home or other apps without Back and they should remain until exit. This is intended to show the presets in operation without providing preset saving in the free version.

Switching to speaker is a problem on some devices/ROMs and Spirit tends to support AOSP ROMs like CM better than stock ROMs (where most people use the stock FM app instead of Spirit).

There are some switch to speaker tricks possible, like pulling the headset cable enough to switch to speaker or using an old headset plug with the end cut off.
[Spirit FM] rob_yx:
Thank you Mike, setting pseudo source to 6 (voice recognition) the sound became perfect. Now the only feature to make spirit2 "my perfect app" is the ability to set the tuner in qualcomm soc (and silicon labs for my I9000 :) ) to force stereo mode...but I know it's very hard.

Thank you again, Mike, now I can listen fm with equalizer.
[Spirit FM] mikereidis:
:D

You have a special version of brcm_patchram_plus.c I can't google. I don't suppose the binary is available anywhere public ?

So then, Super_Peek_Poke is:

hcitool cmd 3f a

Then 1 byte for Access_Type: (you called this opcode?)

ARM_Memory_Poke = 5

ARM_Memory_Peek = 4

Then 4 bytes for ARM_Memory_Address little endian.

Then, for Poke, 1 or 4 bytes for Value8 or Value32. I get the impression these are 1 byte values for these chips. Removing the last 3 bytes from the HCI command works the same.

I found a document referencing Broadcom BlueTool. It looks like a Windows program that can send various Broadcom proprietary HCI commands over serial port. At least one version seems downloadable from unofficial sources for study. AlltekBTMP.exe might also be interesting.

Hmm, "strings desirehd/stock/system/bin/btld| grep -i -e superpeekpoke -e super_peek_poke" shows BTLIF_FM_SET_VOLUME as well as FMTX functions...

So, the 2 "mystery commands" are solved and replaced with "mystery registers". I named them AR because I've presumed they are "Audio Routing".

BC AR 1: hcitool cmd 0x3f 0xa 0x5 0xc0 0x41 0xf 0 0x20 0 0 0

= Super_Peek_Poke (Poke, 0x000f41c0, 0x20);

BC AR 2: hcitool cmd 0x3f 0xa 0x5 0xe4 0x41 0xf 0 0x00 0 0 0

= Super_Peek_Poke (Poke, 0x000f41e4, 0x0);

BC Volume: hcitool cmd 0x3f 0xa 0x5 0xe0 0x41 0xf 0 "Volume"

= Super_Peek_Poke (Poke, 0x000f41e0, 0x0);

I don't suppose "BC AR 2" is actually the low 8 bits of a 16 bit volume value ?

I find it odd that these "pseudo-registers" are used for a common setting like volume, instead of normal FM registers like on TI chips.
[Spirit FM] mikereidis:
You get an error with the "BC AR 1" hcitool command ? IE "hcitool cmd 0x3f 0xa 0x5 0xc0 0x41 0xf 0 0x20 0 0 0" ?

The S5570 logs from denzel09 showed HCI error 3 (hardware malfunction?) for that command and every command after that, so he wasn't able to tune and get RDS like you have.

I don't think we have much developer level assistance available for S5570. CM Rom development is being done by tj_style, but he doesn't seem too active on his threads and I think he doesn't have a S5570 (any more) ?

I'm not even sure right now if we have conclusive evidence that the stock FM app uses analog audio. Hypothetically it could be digital ?

We can keep researching and trying things. The stock app/ROM will reveal it's secrets if we can look closely enough. It's easier if you have the hardware of course.
[Spirit FM] mikereidis:
OK, I'll presume you mean AFTER my app has been used. If you reboot the phone and don't start my app, audio should work as well as it did before my app was installed.

OK, you are using FM_launch or FM_launch2 ? That code was added relatively recently and I'm working blind as I don't have any Motorola phone.

After looking at the logs from the stock Motorola FM app I noted this on post 3 of this thread:

setParameters("FM_launch=on") may need to be done before setParameters("FM_routing=DEVICE_OUT_WIRED_HEADPHO NE")

I'll try to get this into the next release and we can see.
[Spirit FM] mikereidis:
Last I recall/noted you were saying: "Sound alternates between station and bursts of static at very regular intervals a few times per second."

If my app is now working for you, then that's great !

I'm not sure what you mean by "forgiving". Perhaps just related to sensitivity/ability to pick up RDS or give clean audio ?

And I'm not sure why you an xmguy both are reporting lower sensitivity than with the stock app. There is no TI register for "sensitivity" AFAIK.

There is a WL1273_HILO_SET register that can be set to "Hi Side", "Lo Side" or "Automatic" but I'm not sure that'd help.

There is also a WL1273_RX_ANTENNA_SELECT register, but I've never seen any effect on my HTC Legend by writing this.

There's a "FM TX antenna impedence" register, but AFAIK that's for transmit only.

It's possible there is some sort of software configurable switch connecting the headset jack to the antenna. I can only imagine this would be needed if connecting the chip antenna pin and associated components reduced audio quality. Unless the phone supported FM transmit, but AFAIK no Android phone has ever supported FM transmit.

There are occasionally reports like this. Hopefully at some point we might find some hidden antenna switch function. I'll give you some WL1273_RX_ANTENNA_SELECT register write ideas when I can devote some time to it.
[Spirit FM] denzel09:
The radio app in stock rom works flawlessy. Nothing audio problem..

So no one solution?
[Spirit FM] denzel09:
I have do others tests, w/ more signal. The app works very well but obviously no sound.
[Spirit FM] sfortier:
Hi, mike!

This is the result of hci commands...

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

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

< HCI Command: ogf 0x3f, ocf 0x000a, plen 9

05 C0 41 0F 00 20 00 00 00

Send failed: File descriptor in bad state

Digital audio can be the solution...
[Spirit FM] mikereidis:
Great !

Please be patient.

I am just one developer. Samsung and Broadcom and their various suppliers are huge companies.

Samsung built the phone and various companies built the chips. I did not.

They started working on this years ago. I started in February.

They have access to detailed schematics and technical documents that I can't get.

Right now I'm working at least 70-80 hours per week and making around $9 per day before expenses.

Google said they weren't developing an FM app due to lack of developer resources. How much bigger is Google than me ?

Are there any other developers with a non-stock FM app for this device ? Never mind supporting multiple devices and ROMs...

I hope you understand.
[Spirit FM] mikereidis:
This error usually means that Bluetooth is off.

Does my app work as well on your device if it's started with Bluetooth on ? If so, try that. You have to power down my app first before toggling Bluetooth power.
[Spirit FM] denzel09:
I understand, no problem buddy. When it will possible, it will be possible. Radio is last of problem.

Good work mik ;)

Let me know for possible soon tests :)

Ciao
[Spirit FM] mikereidis:
I stumbled upon some useful information on page 171 of the 259 page P990 Service/Engineering manual. Analog does seem connected so enabling audio might be a bit easier than thought.

Connections from WM8994 audio chip at left to BCM4329 FM/Combo chip at right:

GPIO9/ADCDAT3 -> FM_I2S_DOUT -> I2S_DI

GPIO8/DACDAT3 <- FM_I2S_DIN <- I2S_DO

GPIO11/BCLK3 <> FM_I2S_CLK <> I2S_CK

GPIO10/LRCLK3 <> FM_I2S_FSYNC <> I2S_WS

IN1RP <- FM_AUDIO_R <- AUDIO_OUT_R

IN1LP <- FM_AUDIO_L <- AUDIO_OUT_L