yashsingh1/xdaforums huggingface dataset:
[Spirit FM] mikereidis:
Can I presume you have reasonable technical skills with Android ? I saw some of your posts and got that impression.

Hmm, I would have thought you'd get a device open error, as your phone doesn't have a device /dev/msm_snd.

The new ssd in FMRadio_v2017.zip is better and gives better error messages. To download: http://www.mediafire.com/?qzpbd5iezfm167k

From your posts I guess you're running this MIUI 1.5.27: http://xdaforums.com/showthread.php?t=1060415

And I guess you're running one of these kernels ? : http://xdaforums.com/showthread.php?t=957267

If you could link me to the source code that would be great. Perhaps one of these: https://github.com/faux123/ I noted there is a movement towards a more recent AOSP/CM kernel.

The CM7 source pegs the Glacier/MyTouch 4G as "msm7x30". I'm guessing it uses qsd7k code as it's upward compatible with the qsd8k hardware.

But you seem to have a /dev/msm_audio_dev_ctrl device, which indicates use of code like this here: http://linux-qcm-msm.sourcearchive....-800.2/msm8k__audio__dev__ctrl_8c-source.html

For the HTC HD2, which is also qsd8k I recently added code to ssd which sends ioctls like AUDIO_START_FM or AUDIO_SWITCH_DEVICE with parameters FM_HEADSET or FM_SPKR.

By default, the qsd8k mode uses /dev/msm_audio_ctl as that's what's on the HTC HD2. But you could try it with a command line parameter:

!! Remember to use the new ssd from v2.0.17 and try these in sequence, once the app is running and tuned.

To start FM:

ssd 2 1 /dev/msm_audio_dev_ctrl

To set middle volume:

ssd 2 5 /dev/msm_audio_dev_ctrl

To send FM to speaker:

ssd 2 5 /dev/msm_audio_dev_ctrl

To send FM to headset:

ssd 2 4 /dev/msm_audio_dev_ctrl

If you get an error, try the kill mediaserver trick again:

killall mediaserver ; ssd 2 1 /dev/msm_audio_dev_ctrl ; ssd 2 5 /dev/msm_audio_dev_ctrl ; ssd 2 5 /dev/msm_audio_dev_ctrl

All on one line with semicolons so the commands happen before mediaserver restarts.

If it still doesn't work, then likely your audio driver won't support this. Perhaps one of the newer kernels will, particularly anything from CM7.

Hypothetically some low level kernel code could switch the FM output, but it's bad enough having to send ioctl's. Lower level stuff is even messier for an app to do.
[Spirit FM] mikereidis:
:) Thanks for your report !
[Spirit FM] VibrantOwnr:
I read that you were thinking of charging for your app or creating a paid version. I would be more than happy to party, but only if it was working. I would not pay for something that did not work. I don't know if everyone feels this way but I thought I would let you know how I felt about the subject.
[Spirit FM] mikereidis:
Of course.

There will always be a free version. And to continue my work at this pace, there must be a pay version that provides me with at least a meagre income. :)
[Spirit FM] mikereidis:
Hmm, there is one single audio control bit on Broadcom that enables I2S. I don't set it at present, but can do so to test.

If just setting that bit sends data over PCM then all we'd need to do is somehow get the Wolfson chip to send that data to speaker or headset. Since it comes over the same connection as a BT microphone. perhaps we could somehow fool it into thinking there is a BT mike, or simply switch an input with some utility; perhaps even the Voodoo control app.

BUT, I'd expect to see some registers where PCM bitrate etc. could be set. I have sparse info on the undocumented Broadcom FM command set, and there may be such registers, but I have no info.
[Spirit FM] SubZero5:
Thank you @CR5N and @mikereidis (and to those who helped).

The FM works with NexusHD2-Gingerbread V2.7 on 1024LEO with NO MODIFICATIONS...
[Spirit FM] Victorino86:
FYI installed the v.17 on a Huawei Ideos (U8150), just to try if its working.

I open the app (it requests the root permission), but i only get black screen and "spirit fm radio" written below the notification bar. Then FC.

Is that because it has a different radio chip or is the resolution (don't think so, if its working on wildfire) or something else?

Other FM app that is coming with the rom is working.
[Spirit FM] idkidk:
Hi Mike

Another HW info:

http://wenku.baidu.com/view/92e0efc79ec3d5bbfd0a74e3.html

(and in attach the doc "screencaptured"), is the hardware info of chip that have wifi,bt,fm toghether.

The BCM4329, and other chip is compliant to USI specification:

http://forum.eet-cn.com/thread!printPreview.jspa?threadID=1200100831&start=0

The only hope is that sammy have not documented the FM feature for marketing needs, and we have "only" discover how enable it.

I'll further investigate to get more technical info.

TIA Mike for your hard work, i'm waiting your new release to test! :D:D

Bye

Idk
[Spirit FM] mikereidis:
It's not resolution related. It is likely due to one of the initialisation routines hanging. I am working right now on making the chip identification and init code more robust and friendly.

Even with just one Broadcom based phone (LG P500h), I'm finding that the different ROMs have different sets of issues with my app.

Do you know which FM chip your phone uses ? And/or if it uses a TI or Broadcom BT/WiFi combo chip ? I did 10 minutes of googling but couldn't find a definitive answer but it appeared it might be the most common Broadcom chip.

If you are capable of sending me your logs, please do so. Or you could wait a week or so for me to build a friendlier, more robust and more informative init sequence.
[Spirit FM] mikereidis:
Thanks, I only looked at this document so far, and it's interesting, although not too useful. I've seen some other similar documents from Chinese companies that sell a module with a TI or Broadcom chip.

In the Change Sheet I see "..remove FM RX spec" and I see a blank page with TBD about FM. I'm guessing that Broadcom asked them to remove the info from public view.

Broadcom is funny about these combo chips. They've open sourced code for the Bluetooth and the WiFi portions. But they refuse to do so about the FM portion, which seems to be treated as an afterthought to the main BT/WiFi functions anyway.
[Spirit FM] Victorino86:
Is there a command or app or something to know the chip? 'Cause with a quick search couldn't find anything about the radio chipset of the ideos.

Also gonna read all the topic again so i can try all the various fixes, ATM just installed the .apk and not all the other things. Later tomorrow, after i fail an exam at university :D
[Spirit FM] mikereidis:
:) Yeah, feel free to go through. I need to do that myself and write a FAQ etc.

I've never seen an app that could even tell you the Bluetooth chip, which would help in identifying the FM.

So I guess my app will be the app to determine FM chip and accessibility, just as soon as I add some good detection code.
[Spirit FM] XYZ-Moscow:
2.0.17 work on Desire with MIUI 1.5.27 and kernel ManU-1.4-GB-SVS-128-CFS.

some bugs:

output target not switched on the fly with Speaker and HandsFree, only over Off button.

if i disconnect handsfree when FM is On, then volume not changed, and sound not transfered to speaker.
[Spirit FM] dadewy:
Just a quick heads up that 2016 works fine on a stock (rooted) froyo ROM and kernel on a tmo G2 (aka desire z without sense).

Switched back to stock since CM7 netflix support is sketchy on this phone atm, and sure did miss my radio!

Many thank for this.
[Spirit FM] mikereidis:
Great ! Thanks for your report.

I don't completely understand your bugs though. If anyone else sees similar, please report.

Does "handsfree" mean speaker or BT headset ?

If you could provide further detail, I would appreciate it and be better able to fix it.
[Spirit FM] mikereidis:
Wonderful, and thanks for your report ! It's very important to me that the app work on stock ROMs, even if they might require root for some modes.

By "stock" do you mean a slightly modified HTC ROM, but with SU/root ? Or is this a generic froyo ROM ? You say without Sense so I presume generic froyo ? The name of the ROM or a pointer to a thread would be nice...
[Spirit FM] sjod8998:
Hi Mike. With the May 25th update I have noticed a decline in the volume of the radio. Not in quality, only in the volume. For the rest no problem using Slim ICS 3.8 with semaphore 1.2.0s (of course with the radio module enabled kernel)
[Spirit FM] mikereidis:
Yes. :)

That's my workaround for the CM9 FM Volume Normalize bug in action.

FM volume is supposed to be comparable to media player volume.

I had to update my workaround because CM9 moved the bug from "wm8994" to "voodoo".

If you like super high volume, or if/when this CM9 bug is fixed, you'll want to enable the Debug->GalZ Normalize option to disable my workaround.

I don't think the CM9 dev(s) will really care about this bug unless and until they resurrect the CM7 FM app for CM9. Otherwise they'll just say "FM is not supported".
[Spirit FM] Nitemare_real:
Same issue for me, using Galaxy S with custom ICS ROM.

No problem with audio in incoming or outgoing calls after switching off Spirit FM Radio (Galaxy S ICS audio method)
[Spirit FM] mikereidis:
The louder volume was due to a bug in CM9.

Do you want the louder volume ?
[Spirit FM] Nitemare_real:
It isn't a problem for me.
[Spirit FM] mikereidis:
Patience, patience. :)

I'm rushed enough I bought a OneX thinking it had a different FM chip. That hasn't happened since my first Android, before Spirit, LOL.

My theory now is that the AT&T and soon Europe One XL w/ the Qualcomm Snapdragon S4 MSM8960 SOC have the Qualcomm FM chip, as does the One S.

I guess the Qualcomm SOC ties to the Qualcomm FM/BT/WiFi and the NVidia SOC ties to the TI FM/BT/WiFi combo chip.

Once I get this One X properly conquered, I might sell it and get a One XL. We'll see; enough sales means I'll keep it. :D

The good news is that I now have Spirit running on my stock unrooted One X with all features. The code was there already for stock TI based devices. I mostly had to update the TI FM API definitions.

From your log I see you have /dev/tifm. For non-stock ROMs I think we might be able to just install 1 or more of these 3 libraries from a stock ROM in /system/lib:

libfmchr.so

libfmradio.so

libfmstack.so

But there might be some dependencies in those libraries. But AFAIK, the source for those is available so it's not impossible.

And there seems to be an alternative way I can send HCI commands. If and when ROMs shift to a more Bluez compatible BT stack, the old existing access methods might work.
[Spirit FM] lrbpereira:
Hope your figure it out quickly ;) If you need someone to test your progress with a CM9 HOX build tell me, will be waiting for it ;)
[Spirit FM] mikereidis:
Emailed May 30 test.

Also a ZIP with the 3 library files. They need to go into /system/lib and I presume you know about "adb remount".

If it doesn't work on TripNRaVer's CM9 port, it might work on intrepresentation's port, or other ROMs, especially those close to stock.

Working or not, send me a debug log. Startup will probably take 15-20 seconds due to an unfixed timeout,

The "wrench" button used for settings is now an alternative to the Menu button. On the stock OneX no Menu button is available and Spirit doesn't yet support the ICS "no more Menu button" paradigm with action bars.
[Spirit FM] lrbpereira:
Hi Mike! Thanks a lot for this quick answer.

I pushed the 3 files with Root Explorer to system/lib. Rebooted.

But the app at start stuck´s on a black screen with the app´s tittle and icon on the top... and after a little bit it FC. The app doesn´t open even... It ask´s for root at the begging but after that nothing...
[Spirit FM] sjod8998:
Ok Mike, thanks for the feedback. My phone is Galaxy S ROM 3.8 Slim ICS whit semphore KERNEL 1.2.0S. Do you think that this bug is for the ROM, Kernel or the Voodoo app...? :confused:
[Spirit FM] coloxim:
Hi mike...I've bought the light version...

Is a small thing for say thanks for your work...

I hope you will fix speaker for s2...

Inviato dal mio GT-I9100 con Tapatalk 2
[Spirit FM] mikereidis:
:)

For you or anyone wondering, I haven't given up on the S2/Note speaker.

Within the last week I spent about 7 hours trying to find a solution.

I tried to send the "Intents" indicating headset unplugged with no luck.

I examined logcat and kernel messages, I read source code and tried a few tricks. If you look at Menu->Test->Audio you'll see a bunch of "routing=" commands I tried.

"Enable speaker" is just 2 words and seems so simple. Figuring out the 1-3 lines of code possibly needed to do it are the hard part.

And this is not a problem on stock or stock derived ROMs using the same "Galaxy S2/Note" audio method. So there is clearly some deficiency on non-stock ROMs.

And yet pulling the headset, or messing with background volume control when Silent Loop is off switches to the speaker. So it should be possible, somewhere in the tons of code we call software.
[Spirit FM] mikereidis:
You have it on Semaphore ? I haven't been looking for it except on CM9.

It's in the kernel. In the driver for the wonderful Wolfsson WM8994 audio codec chip.

The driver creates several virtual "pseudo files", including one of these (switched to the voodoo variant recently):

/sys/devices/virtual/misc/wm8994_sound/fm_radio_headset_normalize_gain

/sys/devices/virtual/misc/voodoo_sound/fm_radio_headset_normalize_gain

At powerup the value is "1" which should indicate "true" which should mean that the FM to headset volume is "normalized" or equalized to the volume for the media player and other non-FM volume.

Once again we see that the FM audio path is "special" and that's where half of the problems arise.

But the value seems backwards, so by default my code does this to restore normalization:

echo 0 > /sys/devices/virtual/misc/voodoo_sound/fm_radio_headset_normalize_gain

And it does this every time you switch to headset, or unmute on headset, because otherwise it can reset itself. And after the above, the below is done because that's been a problem in the past:

echo 1 > /sys/devices/virtual/misc/voodoo_sound/fm_radio_headset_restore_bass

echo 1 > /sys/devices/virtual/misc/voodoo_sound/fm_radio_headset_restore_highs

If semaphore and other kernels have this problem now, I guess the bug is in a common source. Perhaps it's in the AOSP kernel code, and the derived kernels share it, unless and until they fix it themselves or it's fixed in the "upstream" AOSP.

I try not to concern myself too much with where bugs come from. I try to take what I think is a pragmatic approach and just accommodate it the best I can.
[Spirit FM] stratosk:
Hello and congratulations for your marvelous work.

Just to clarify this a little:

Since version 1.2.0, Semaphore includes all the modules in the initramfs. When the phone boots it copies the modules to /system/lib/modules directory.

This is the reason that the radio_si4709_i2c.ko (and other modules) does not exist in zip file.

When you select the 'Radio FM' option in Semaphore app, it loads the radio_si4709_i2c.ko module and creates an init.d script which loads the module in every boot.

I hope this helps.
[Spirit FM] squall03456:
Hello,

I want to use the Radio with the Clean Blank Rom v2 for SGS2.

Unfortunately I get always the Error "No FM accessible". No changes if I change the settings. It doesn´t work.

Can anyone help me? Pls

Thanks
[Spirit FM] sjod8998:
Hi Mike. You're not going to believe, but happened again! Remember when I discuss some loss in sound quality, which was solved in two days? As it has happened again. Today, radio has regained its normal level, without changing anything in the configuration of the app, or kernel, or the ROM .... I promise not to comment any bug until we spend two days !!! ... hehehe .

Thanks Mike, as you say the price you pay for this app is insignificant compared to the juice is taken out, especially if you listen to the radio often.
[Spirit FM] beint:
My problem turned out to be a combination of kernel changes and ROM issues. Kernel changes is described above, and my ROM, Elite RC 1.2, doesn't come with the modules folder in system/lib. Upon manually creating the modules folder, the kernel was able to creating all the necessary drivers and voilla!! Spirit works again.
[Spirit FM] vispinet:
Hello Mike,

any news about the last Galaxy S speaker report? I was just about to try your app when I read the message. The thing is I need my phone for work and I don't want to risk the speakers. Moreover I've hear some people saying that after listening to FM radio the phone needs a reboot, as it keeps playing a silent loop. Any update on that? Thanks anyway, I know you're doing a great job.

EDIT: I just bought the unlocked version. I've been following the development for some time and I am sure you'll solve every issue :)
[Spirit FM] Kess78:
Hi Mike,

I've got a new device, it's the Sony Xperia Sola. Not rooted yed ( Root involves unlocking bootloader for the moment :( ) Spirit doesn't work when I start it it says FM not accessible : SU : 1 Fm : SL Su : 0 Bt : 3 Ht : 0 Mo : SLS

The phone has a ST-Ericsson processor and I think the FM chip is from STE too...

Reception quality is quite nice but at low signal a horrible audio filter appears and remove all high frequencies. It sound like a 16kbps MP3.... Hope you will be able to remove them :( TI is definitly better Lol.

I attached some lib and the stock app. Also I will send you log by mail.
[Spirit FM] beint:
I'm on Galaxy S, and there's no problem here. Semaphore 1.2.0s and Elite RC 1.2.

I guess Mike said before that there are sporadic occurrences with this issue. More and more seldom.

So I guess it's up to you if you want to try it.
[Spirit FM] lrbpereira:
Spirit FM Radio on HOX´s CM9

Mike,

Sented you an email log with the final problem that can make Spirit FM work on the CM9´s build´s!

Pushed the 4 lib files into system/lib, the app runnes, get even RDS radio station on screen but gives no sound! Changed to all the audio options, and strangly the ZTE Blade2 is the only one that put some sound out of the headphones! But it´s really low, can´t understand if it´s static or the radio :P

Please adress the log, think that now it´s a small step towards having radio fm on or HOX´s CM9 builds!

Thanks again you are the best! :p
[Spirit FM] mikereidis:
Yes, that helps a LOT, thank you very much.

I guess the biggest problem is what beint says: He had to manually create the modules folder.

I could do that in the app, but an app REALLY shouldn't be messing with /system and I don't want to have to remount the partition RW. AND I guess a reboot would be needed anyway.

I'd think that the kernel package, during the cwm flash should create /system/lib/modules.
[Spirit FM] mikereidis:
You most likely have the recent common "No FM Driver in your kernel" problem.

There may be an app, such as the Semaphore app, that allows you to enable the FM driver.

If not, then you need a kernel with an FM driver.

If you want, send me a debug log with Menu->Test->EMail->Logs and put "Clean Blank" in the email text.
[Spirit FM] mikereidis:
Hmmm... In the world of software, almost any bug is possible.

Let me know if it keeps happening or if you get any clue about how to trigger the problem, or the "fix".

If you're adventurous, you could try other kernels or ROMs to see the effect.
[Spirit FM] mikereidis:
Thanks for your detective work. :)

Between that, and the post by stratosk, I think we've started to see what's going on.
[Spirit FM] mikereidis:
Thanks for your purchase. :)

No particular news on the last report several days ago, using the last Play release May 25. Only that it didn't fix itself with a 10 minute battery pull or a few reboots.

I'm not aware of any Galaxy S problem requiring a reboot. If you can reproduce this, or can point me to a thread where it's being discussed, I can look into it.

Note that some people are definitely running older versions which are "pirate-able", and they may not necessarily admit to running an old version.

The last report could be a "fluke". I may resurrect the "safer" method that was recently pulled, especially if I get a second report within the next 2 weeks.

If you've run the app for a few days to a week, and have no speaker problem, I think the risk is minimal. The vast majority of reports came from people who had just started using the app.

That's why I think some hardware revisions are more susceptible. My first Galaxy S had the problem within a few days, but my 2nd is going strong for 8 months now.

But if you are worried/concerned, the only safe advice I have is to not run the app. Or to use stock or stock derived ROMs or CM7 or any other ROM that can use the "CyanogenMod7" audio method. As always I cancel/refund any purchases on request for any or no reason.
[Spirit FM] mikereidis:
Hi. Sony again ? ! :(

I can't properly support Sony. Their sales are low so I have to view them with the likes of ZTE, Huawei, etc. IE if it works, great, if I can make it work with a bit of work, that might be OK too.

But I don't expect to buy any Sony products, and I won't even take advantage of their otherwise very nice "loaner program". Even with a free loan of a phone, there will still be lots of work required, most likely, and on an ongoing basis too, which doesn't mesh well with loaned devices.

One technical reason I won't support Sony much is that it appears I can never get an FM app working on stock, un-rooted ROMs. Sony released their source code for 2011 but of course they didn't release their private app signing keys. And those keys are needed for a stock-like FM app, which is quite unusual.

Yes, ST-Ericsson has an FM/BT/WiFi combo chip or two. That's why they initiated their proposed Android FM API, to make it easier for phone manufacturers to support different chips, including theirs. But that API continues to seem to be going nowhere, AFAIK, despite the source being in AOSP Android now.

The "Fm : SL" seems to be indicating they used V4L (/dev/radio0) for their API. V4L is a reasonably good and standardized Linux API for TV and radio tuners, and I support it a bit for Qualcomm chips.

I'll look at your log and see what I can.
[Spirit FM] mikereidis:
Good......

On the stock ROM, the audio method is silently set to "HTC". Be sure to try that.

There's an ALSA driver on the phone that might enable FM audio. I can't access it even to look on my OneX because it's still un-rooted and I can't get temp root AFAICT. But your logs should show it.
[Spirit FM] lrbpereira:
Ok Mike, please, get a look into the log I sent you. The HTC audio mode didn't gave me any audio. Only the zte blade2 audio mode but very verly low and not audible even.

But the stations are tuned great, and rds is working ...
[Spirit FM] Nato154:
Thanks, works great on my n1 :D
[Spirit FM] vispinet:
I am indeed concerned. I'm using an AOKP based Rom. Don't take it as a lack of confidence in your work. I just don't want to risk my speakers. I guess I'll wait a bit longer and see if you can provide a higher degree of "safety" in the next weeks... I don't want to change rom, I love aokp. So having your app working on aokp would be perfect for me. Oh... I am using the last Midnight kernel. I hope it's compatible...
[Spirit FM] mikereidis:
No problem. :)

I try to be as informative and open as I can. There are no documents anywhere for what I do in the ALSA audio driver. All I can do is reverse engineer the best I can and experiment.

Right now I'm waiting to see if any further reports come in the next 2 weeks or so. That report could be a fluke or even a fake. The victim seemed much angrier at me than most, and at least was not a customer.

But I'll resurrect the "safer" mode too.
[Spirit FM] mikereidis:
I looked. Yes, it's the STE CG2900: http://www.stericsson.com/products/cg2900-gps.jsp . I've stumbled across it at least once before.

You're unrooted and permissions on the V4L /dev/radio0 device are closed.

The libraries actually seem to support a variant of the standardized FM API they proposed.

The FM app appears not to need systems permission, so it might be possible to write a 3rd party FM app.

But I can't see looking into this any further, at this time anyway.
[Spirit FM] lrbpereira:
Still no luck with the new test build... Something small is off... ;) sent you a log with te no sound output issue.

Thanks again!