yashsingh1/xdaforums huggingface dataset:
[Spirit FM] :
I really like this app you made!

I just bought the unlock version after testing the free version for about half an hour.

A few bugs I have encountered so far, running Cyanogen Mod 7.1.0 on HTC Desire:

When i was listening to Spirit FM, and simultaneously started the built-in FM radio app from CM7 (which is in turn from miui actually) my phone blacked out, and after waiting several minutes I had to remove my battery to reboot the phone after there was no response to anything I did

after a reboot the app wasn't responding to changing media volume. After another reboot it just worked fine again.

In settings>audio method, if I change between the different methods I barely notice any differences, only when i selected 'all' the app stopped working entirely

Feature request:

I have just manually entered the frequencies for my 9 favorite radio stations, for the town where I live and also two other towns I visit frequently (since the frequencies in the Netherlands vary by province/town). Maybe you can build these frequencies in the app / make them downloadable for users from the same country / region?
[Spirit FM] flipper44:
Toshiba Thrive: Broadcom BCM4329 Low-Power 802.11n with Bluetooth 2.1 + EDR and FM (T

bought a Toshiba thrive, doubting its wired, but I did see in a tear down that it has bcm4329 broad com, is that a workable chip w ur app...its not crashing, but no noise
[Spirit FM] mikereidis:
After MANY hours digging into these issues today:

I agree. It shouldn't even matter what they are called if one is using the numeric device numbers in the Ioctl.

But first, the libaudio needs to have the right code to support FM audio routing.

I started with the Galaxy 5 Service Manual. It doesn't have complete schematics. The block diagram shows analog FM audio connected somewhere on the MSM7227 SOC, but doesn't specify the input.

BUT, I've come to the conclusion that many of the Qualcomm SOCs have only one set of stereo aux/line inputs suitable for FM. So I think that any libaudio that will work for MSM7227 and supports FM should enable FM audio on the Galaxy 5.

I searched for MSM7227 datasheets and found none. I DID find a nice MSM7225 document and AFAICT it is very similar to 7227; perhaps even identical in the Audio areas.

The doc is "MSM7225TM Mobile Station Modem Device Specification 80-VF815-1 Rev. E February 6, 2008".

Under "1.3.7 MSM7225 audio processing features" it says: "Supports summing of an external device’s stereo single-ended analog signal".

This summing means that the DACs can still output sound while FM is playing, as has been observed on just about all devices running my app.

These are the 4 chip connections:

Balls A4/A5: LINE_R_I_P / LINE_R_I_N

Balls B4/B5: LINE_L_I_P / LINE_L_I_N

Software-wise, I also found a 910 page PDF: "80-VA736-2-MSM7200-SoftwareInterface.pdf". It's a different chip, but all the ones I looked at seemed similar, including 7627. It seems the MSM7200 can only output line in (FM) to the earphone (speakerphone) though, while the others are switchable.

I noted this register can set the PGA gain (Programmable Gain Amplifier):

0x42 ADIE_CODEC_C7 CODEC control register 7

The default of 0 is maximum amplification which I think explains why some devices have much louder FM than others.

This register:

0x43 ADIE_CODEC_C7B CODEC control register 7B.

Can select the line in inputs for the AUX PGA.

This register:

0x46 ADIE_CODEC_C10 CODEC control register 10.

Can select the outputs.

These registers are for the MSM7200 and it's possible different ones are used on MSM7227.
[Spirit FM] mikereidis:
FM recording or signal processing:

Note that I'm just putting this here for information purposes. I don't think my app will support recording anytime soon, but who knows...

Looking at the MSM72xx documents today I got the impression that FM recording is indeed possible, using the analog outputs from the chip. (Another possible route is direct digital.)

It seems the line inputs usually used for FM can be routed to the input (TX) ADCs. From there they can be digitised and recorded, and likely even sent through the DSP where equalizations etc. can be done and then to speakers / headset.

The first downside though is that other inputs, such as microphones, can't be used simultaneously, at least not cleanly. So FM recording would have to stop during an active phone call.

The second downside is that this increases the number of Analog/Digital conversions. I believe the FM chips process audio digitally internally, after a conversion. So this would end up resulting in Analog -> Digital -> Analog -> Digital. And then another ->Analog on playback. It might not be too bad, or it might be awful, I don't know.

Direct digital would be better and would help solve analog audio routing issues. I hope that the poster who apparently has had this working releases his code soon, as he indicated.
[Spirit FM] mikereidis:
Great ! Thanks ! The HTC Desire is the most common phone running my app, and I think CyanogenMod the most common ROM.

- On CyanogenMod the default "sfu_sdcs" Audio Method is likely best as it's what the CM FM app uses, pretty much.

- The "All" Audio Method should probably be removed. It's original purpose was to try and ensure the sound will work on first app start, but that purpose has faded.

- Your reboot issues are unusual and unexpected. I'll try myself but in the past my app could co-exist with the CM FM app pretty well. Easiest solution I guess is to use just one app.

- If you don't use the CM FM app, you might consider renaming the hcitool utility. I usually rename it to "hcitoo" with the last "L" removed, and my app can still work with that.

My app doesn't need hcitool however, if you've given my app root/SU privelege. The HCI Socket/Daemon mode and Broadcom UART mode are more efficient. If you're wondering, my app uses the best method it can automatically.

Re: Feature request

You didn't specifically mention it, but I'd guess that AF (Alternate Frequency) support would be useful to you.

Yes I would very much like to add such a feature. There are some radio station databases on the Internet, but there would be challenges also.

One of my present challenges is deciding how to prioritise various feature additions, including revamping the User Interface, for existing supported devices, AND working to support new devices.

I NEED to support as many devices as I can to create a sufficient income stream to continue to work full-time+ on adding features. BUT I also need to produce new features as incentive to paying customers. So I have to do both and I appreciate all input.
[Spirit FM] mikereidis:
Yes it's workable. If you don't see a "Compatible FM chip not found" dialog when starting, that means the FM etc. chip is being controlled OK.

IF you were able to see decent RSSI signal strength numbers (and bars) when the wired headset is plugged in, that would confirm an antenna connection. Even better would be seeing RDS data.

In future I hope to support digital audio, so audio connections may not be a problem (but are right now).

The biggest issues then are:

- Are the proper chip pins powered ?

- Are the antenna pins connected somewhere useful, generally to the headset ?

I have become pessimistic about the prospects for enabling FM on devices that don't support an FM app on the stock ROMs. The Nexus 1 is the only such device I can think of.

The prospects are better on a device which is a variant of a device supporting FM. One poster managed to solder an antenna connection on a generic tablet that had that capability, but that is the exception. And sadly, we weren't able to coax analog audio out.
[Spirit FM] psyke83:
I saw it, thank you.

I'm not sure what endpoint numbers I should add. Is there any way in which we can query (rather than set) the current sound device? If so, I can run the proprietary radio app on froyo and then find out what endpoint/ioctl number it's using.
[Spirit FM] mikereidis:
For testing, I would just add all missing numbers, up to some limit like 32 or 64, and give them random names.

I don't recall any method to get the current sound device endpoint. In a somewhat different context I use getDeviceConnectionState, but those numbers are different and it's a bitmask allowing multiple devices.

The endpoint numbers might be in one of the logs though. Adb logcat should be examined. But on some devices, dmesg (/proc/kmsg) shows:

snd_set_device 9 1 1

Where 9 is the endpoint.
[Spirit FM] cos68:
Well I tried to execute these three statements, but I am afraid it didn't change anything. I still see the problem when I have chosen a country with 50 KHz steps.

However it is not a major problem, because I have yet to see a radio station here in Denmark, which uses frequencies like 93.55.

Best regards

Claus
[Spirit FM] denzel09:
Is it possible to add support for samsung s5570 mini? With CM7 there is not support for radio..

msm7x27 i think

thanks
[Spirit FM] denzel09:
Any news?
[Spirit FM] mikereidis:
Thanks ! That's good to know about no frequencies like 93.55. So far I think only Italy is confirmed (to my knowledge) to have such frequencies.

I'm continuing to work on this. It seems that both Broadcom BCM4325 and TI WL1273 chips ONLY seek by 100 KHz steps (but BCM4329 might be more flexible). Despite setting what appear to be the proper registers I can't change this.

BUT, if frequency starts at 93.55 for example, the seek will try 93.65, 93.75 etc.
[Spirit FM] mikereidis:
I'll find out what I can. Does the Mini support FM with the stock ROM ?

Have you tried my app ? What are the results ?

If you run the latest version here: http://www.mediafire.com/file/84bm0s6ptwed4jb/Spirit_FM_Radio_v110726.apk

you have an option under Menu to send me the debug logs and I can answer better.
[Spirit FM] denzel09:
Yes, mini support FM with stock rom.

Thanks buddy, i have this when i try your app:

Sorry, compatible FM chip not found!

I will try to send debug. Your app is the only hope ;)

Edit: debug info unavailable!

How solve?
[Spirit FM] denzel09:
Send you debug from last version, thanks man ;)
[Spirit FM] mikereidis:
Yuck. That message means the app isn't bound to it's service. At least it doesn't crash like it did previously.

The only theory I have for that error is that some very common system library is missing.

EDIT: Schematic shows a Broadcom BCM20780 Bluetooth/FM combo chip. (No WiFi unlike the common BCM4325). I think this chip should be compatible with my app, but clearly you are having some problem, and I've never yet been able to get Broadcom FM working on a Samsung device. Collecting debug information is our best bet at this point.

I just got your debug email but I don't see any debug log attached.

Are you capable of running "adb logcat" on a connected PC and sending me the output ? Also, "adb shell ls -l -R /dev" is useful.
[Spirit FM] denzel09:
I don't know the chipset, but i can ask to Tjstyle..
[Spirit FM] denzel09:
the chipset is bcm203x
[Spirit FM] _wyrm:
Hi,

You can find some hints on #htc-linux logs.

Please note that i wasn't able to get high quality audio yet. Only SCO like audio (8khz mono).

There is also an iOS hacker trying to get fm radio working on the ipad2. You are welcome to join, but please be open about your findings.
[Spirit FM] _wyrm:
AFAIK BCM203X(5?) doesn't have fmradio.
[Spirit FM] mikereidis:
If the RSSI just cycles through strange numbers, it won't work. If it goes high when tuned, then it likely works. RDS info should be visible if transmitted from reasonably strong stations.

Many a phone will never work with Spirit because enabling FM audio is usually an undocumented mystery. Most of my work the last few years is audio. Even if it works, weird things can happen.

Use Audio-> Method = None, Debug-> Silent Loop = Checked, and do whatever you have to do to route FM audio to headset or speakers.

Realtek is a mystery on Android AFAIK, at least on my International One X. If there's ALSA, send ALSA writes. Or use command line "ioctl" command if you know what to poke and what parameters to send.

There's an "ssd" utility in the Spirit /data/data/.../files dir. Use "ssd 4 0" to get ALSA info. Or Alsa Mixer on Play if you can get it to work.
[Spirit FM] mikereidis:
It's not Qualcomm's SOC. It's Qualcomms WCN3660/3680 or similar FM/BT/WiFi combo chip. I don't see why the M8's chip would be any worse. Maybe some unusual default setting or firmware.

But HTC might have messed up the antenna circuitry. Main thing I don't like about my One M7 is that the metal case blocks RF, so a wired headset antenna is mandatory.

Yeah, I don't recall any confirmation of Spirit running on M8 without root; with root at least one positive, some time ago. Most M8 interest in my email is for Verizon users with no stock FM app, and I direct them to the HTC app they can install.

I hope to get an M8; it seems VERY popular on XDA, much more so than the GS5 last I looked.
[Spirit FM] mikereidis:
Thanks. :)

If it's like CM11 on my very similar OneXL, this Jan 4 snapshot would be the last version with a usable FM driver in the kernel: https://download.cyanogenmod.org/get/jenkins/53854/cm-11-20140104-SNAPSHOT-M2-ville.zip

The CM dev disabled modules support in the kernel, and the Qualcomm FM driver relies on that. AFAICT, he is not interested in re-enabling modules support, and there are no alternative kernels I'm aware of that would work.

I've never tested this, but I wonder if the Jan 4 kernel could be used with the latest ROMs..
[Spirit FM] mikereidis:
What ROM ?

See my post above about CM11 on OneS.

Beyond that, I just tried the last free version on my OneXL and now remember that Spirit had a workaround in December for a "chmod" problem on /dev/snd/controlC0 .

If you can make these adb shell command work, it should work:

su
chmod 777 /dev/snd/controlC0

But it doesn't work as chmod effectively became broken.

The last free version was September 18, 2013, getting close to a year ago now, and MANY patches and workarounds for various ROM problems since then.

Email me if you want to try a newer version.
[Spirit FM] mikereidis:
Oooh... Post 8008... One of the first microprocessors: http://en.wikipedia.org/wiki/Intel_8008 :)

In honor,...

If you'd like to help support Spirit development, but think the price has been too high, please email me mikereidis@gmail.com and tell me what seems reasonable to you, and DO please consider the technical support burdens I face, above and beyond the difficulties of reverse engineering so much, and chasing the latest ROM changes....

I've been experimenting some with prices, usually best on the 1st of each month, and I'm happy to see at least temporary "reasonably nice surges" when price trends lower. I believe there are apps that let you catch app price drops too...
[Spirit FM] mikereidis:
I had a report that it works in June. Email me if you're a customer and I'll look up the particulars.
[Spirit FM] marcioafoliveira:
The ROM is CM10.2, I searched but I didnt find anything :/
[Spirit FM] siofont:
Mike, thanks for your post!

What a pity!

I'm using the latest snapshot: cm-11-20140609-SNAPSHOT-M7-ville.zip

My technical knowledge is limited and I don't feel sure about building a new rom with the old kernel. So I must consider 'downgrading' and installing that January rom if I want FM radio.

I'll try to investigate further about kernels, roms and FM radio. Maybe there's other roms with Android 4.4 and fm support.

Thank you!
[Spirit FM] cioby2012:
Hi Mike, i have a sony ericsson xperia neo v MT11i device running android 4.4 AOSPA and Spirit fm dows not work on it... Can support for this device be added to your program ?
[Spirit FM] mikereidis:
Last I checked, no, not for the OneS/XL/Evo 4G LTE.

ROM devs have left these devices behind now, and gone on to newer things.

Anyone who might build a new ROM is likely to start with the CM source anyways.
[Spirit FM] mikereidis:
No, if I haven't been able to support it in the almost 3 years since it came out, I'm unable to add support for it now.

Basically, I have no idea how to make it work, and have no resources to find out and support.
[Spirit FM] lelepelli:
Xperia Sola with CM11

Does it work on Xperia Sola with CM11?

Thanks!
[Spirit FM] mustasusi:
LG G Pro 2

Can anybody shed some light about this device?

http://www.gsmarena.com/lg_g_pro_2-6052.php

According to GSMarena it is stated to have a clear none, but I wouldn't count on it since the Galaxy Mega 6.3 is stated the same, surprisingly people report the international i9200 has and working, GSMarena didn't update their database accordingly.

There are 3 known variants for that gigantic LG:

D837 - intended for Europe but AFAICS isn't out yet and probably would never (too low demand?)

D838 - intended for Asia, reported to have no FM stock\out of the box but might be operable via 3rd party?

F350 - intended for Korea and most likely to have their dumb DMB receiver with pulled-up antenna instead of FM.

We may focus on D838 to be the best bet here. Looking at development section on XDA for this device lights up a very horrifying image, as it appears to be at the bottom of popularity\interest (disregard of course devices that have no section at all on XDA).
[Spirit FM] siofont:
Thank you for all your comments!

Maybe it's time to change my phone.

But seems unfair, because except for the FM radio and a shrinking battery time, my One S it's working satisfactorily.
[Spirit FM] jsugrumpy:
Hello Mike from Spain,

I'm very interested in SpiritFM since my new phone LG L70 w/ android kitkat 4.4 and stock Fm app doesn´'t support remote control from headset button. I've rooted my phone and tried Spirit FM free but can hear no sound, though the app seems working ok and fm signal is good. I have also installed AlsaMixer but don't really know how to use it...

Please, could you send me a newer test version to try out and maybe send you some logs???

Thanks! :good::good:
[Spirit FM] mikereidis:
Spirit1 on stock Sola, yes.

On CM11, No. :(
[Spirit FM] mikereidis:
OneS should be fine, with FM, if you don't need the latest ROMs.

If you want the latest ROMs, yes, OneS/XL etc. have "had their day".

But it's a lot harder to find a nice phone with FM now, if you want to run CM or other AOSP ROMs. None of my "I own one" FM supported devices came out in 2014 yet. 2013 is the latest, pretty much LG G2 and HTC One.
[Spirit FM] mikereidis:
Spirit1 Beta July 9

Spirit2 Beta July 9

Both are in the Beta channel on Play now.

The primary change, since June 28 Beta's, is due to Bluetooth breakage problems on some devices, including Nexus 4 (which can't work of course, but people try).

This was due to Spirit1 and Spirit2 both automatically installing a Bluedroid/BT Shim without prompting the user.

The shim allows faster startup on Broadcom devices, and allows operation with Bluetooth on, on Android 4.3+.

I guess this shim is not compatible with Nexus 4, and probably some other devices.

The solution is to limit automatic shim installation to HTC One M7 and LG G2, unless Spirit1 Debug-> HCI Access is explicitly set to "Bluedroid Shim".

If the shim is installed, it can be removed in Spirit1 with Menu-> Test-> BC-> Remove BT Shim. In Spirit2 it can be removed via Menu-> RBTS (only if One or G2 detected), or enter 46 as a frequency, if possible.

In Spirit2, it can be manually installed, if not already, with Menu-> IBTS (only if One or G2 detected).

As part of these changes, HTC One M7 and LG G2 detection has been improved. This also results in restoration of the "Unknown Device" error when the device can't be supported, which is much better than trying to start, hanging, and confusing people trying to run it on unsupported devices.
[Spirit FM] mikereidis:
I don;t think we'll get anywhere. but sure, email mikereidis@gmail.com referencing XDA.
[Spirit FM] mikereidis:
And that's why I haven't even remotely considered supporting the G Pro's and just about all LGs really.
[Spirit FM] lelepelli:
thanks!
[Spirit FM] mustasusi:
Let's keep on with SGN3

I wasn't too hopeful for LG, thought the LG G3 sounds more promising, but I'm going to have two Note 3 units from Sprint so I'd rather stick to Note3.

One is a Bad ESN and probably won't be in use neither domestic nor internationally and the other one is clean, activated and stated in advance to be GSM unlocked (and literally cost more) so I'm counting on this one more.

Look, if I was to donate you that bad ESN one, would you support this device?

Consider it as a gesture for generosity, you served me well for 3 devices now, be it officially, the latter coincidentally.

For rooting and testing its FM functionality a bad ESN should be enough for you.

I stupidly bought a bad ESN locked to Sprint, thinking it would be as easy as the S4 exercise to unlock. Than found the other one stated to be unlocked and seller is rated as high enough so I suppose I can trust him.

I wasn't able to test anything yet as I'm waiting it to arrive at my mailbox. Should be soon I guess.

I could either use\sell it for parts.

So, what do you think sir?
[Spirit FM] Jiangyi:
Hi Mike,

I've been bringing up OmniROM on the Xperia Z Ultra GPe and I'm interested in helping get Spirit FM going on the device, if possible. Currently, on the latest Spirit FM free release, it would just cease up after launch and would either force close or cause a system reboot. I've attached a log that I hope will be helpful: http://pastebin.com/pQh2vaGy

From what I saw, it reported valid RSSI numbers before it ceased up, so I don't think the FM pins are necessarily grounded. However, you're more experienced in this, so I hope you can take some time out of your busy schedule to take a look and help. Thanks in advance! :)

EDIT: Well, after trying a few more times, it would sometimes not crash and I would get audio on the right channel for a 1-2 seconds, then it'd cut out for a while, and then it'd be back for another 1-2 seconds, and repeat. I've attached a new log: http://pastebin.com/JRGT5LCH

Lemme know if I can do anything to help. Thanks again!
[Spirit FM] amtomio2004:
G2 D802 - Mahdi

Which s the correct confiuration fr G2/Mahdi?

It does ot work i my G2 :crying:
[Spirit FM] LenAsh:
Mahdi won't work because the kernel doesn't have the correct audio driver.
[Spirit FM] mikereidis:
Every Sony device in the last 3 years has FM antenna enabled, so that's not a concern.

Last Free version of Spirit1 was September 18. 10 months ago is "forever" in smartphone time. I may put out a new free version soon-ish.

Email me mikereidis@gmail.com and I'll send you latest test releases for Spirit1 and Spirit2.

Someone else was reporting similar audio problems on a Sony.

I see some Silent Loop issue in the logs. You can try enabling Menu-> Settings-> Debug-> Silent Loop Off (note the "Off" !!) and restart Spirit.

Send a debug log for more info. 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:
Mahdi dev dr87's opinion is that the Nexus 5 driver he is using now IS the correct audio driver. Stability wise, I can't disagree.

It just doesn't have FM support.

I'm trying to build a kernel now using that driver and re-adding FM support.