yashsingh1/xdaforums huggingface dataset:
[Spirit FM] mikereidis:
Thanks.

I see the same on Motorola ROMs. The stock app works so people don't need mine in most cases. Most of my customers are on custom ROMs where no stock app will work. And most of those on ICS ROMs where there is no other FM app at all that will work.

As I emailed maybe in the next week or so I can look at how to load the CG2900 firmware, and perhaps see about the audio.

Yes, you are right the sound must be digital due to "time-lag between the sound from the phone and a normal radio". Any idea how much lag ? Just curious how much they buffer.

More evidence in the only ALSA controls that specifically contain "FM" show a choice between FM and Bluetooth SCO:

elid numid: 173

elid name: If0 Input Select

cei names: 'BT_SCO' 'FM_RX'

Values: 0

elid numid: 174

elid name: If1 Input Select

cei names: 'BT_SCO' 'FM_RX'

Values: 0

These "adb shell" commands would set both to FM_RX:

/data/data/com.mikersmicros.fm_unlock/files/ssd 4 3 173 1

/data/data/com.mikersmicros.fm_unlock/files/ssd 4 3 174 1

But there may be some process that needs to be started or something to make digital audio work for FM. Perhaps just make some API call to start a Bluetooth SCO connection.

And then there's the ever intriguing FM Transmit:

elid name: If0 Output Select

cei names: 'BT_SCO' 'FM_TX'

elid name: If1 Output Select

cei names: 'BT_SCO' 'FM_TX'

I MUST eventually find an Android device that can transmit FM. Just to do it if nothing else. :) I still have high hopes for Qualcomm, but have yet to try it. Someone pointed me to an app for an HTC Broadcom based device that "secretly" has FM transmit ability.

If CG2900 based phones can do it, especially with RDS, then I must sooner or later have a CG2900 device. Then heaven save me from all the people who want it on their stock Atrix etc., LOL.
[Spirit FM] bsd350:
I bought spirit ul in google play market. Verison 15 june 2012. So this app find russian station very good, but i hear nothing or low noise. cm9 rom (09.07.2012) gt-i9100g.

It's time to make new workable version.
[Spirit FM] Kess78:
I tried the commands and they both return :

Opening device /dev/snd/control0

snd_fd : 12

Integrer 1

SNDRV_CTL_I0CTL_ELEM_WRITE ioctl OK

m4_do ioctl succes type: 3

The buffer is around 0.2 second.

It would be awesome if you succed to enable fm transmit ! You could sale a lot a app :)
[Spirit FM] Ovidescu_SGS2:
Hi,

I am running Spirit FM Light latest available version from Google Play (I think the one from June 15) and so far I can only listen to radio on my headphones. Have tried different settings to try and get speakers to work but no luck.

I am running rooted Samsung Galaxy S2 with ICS 4.0.4 Resurrection ROM and Cyanogen kernel.

Any idea on how to get radio working on speakers pls?
[Spirit FM] halfvast:
I have same issue with AOKP 4.0.4 with Siyah kernel.
[Spirit FM] mikereidis:
Yes. :)

Thanks for your purchase.

I've had a lot of requests for GT-i9100G, but on non-stock ROMs the secrets to enabling the audio haven't been figured out yet.

Tonight perhaps I will put out a new test release, that might work.

I'm not sure if I can make it work, or how long it will take. I cancel any order on request at any time. Email me if you wish.
[Spirit FM] mikereidis:
Thanks for your purchase. :)

Speaker works on the latest test releases. The July 5 Free package is here: http://d-h.st/fYv

With a license file, the free versions can be "unlocked". Or email me for the Light or Unlocked test release.
[Spirit FM] mikereidis:
July 10 test: http://d-h.st/hRR

- Revert Galaxy S ICS audio method to apparently speaker safe May 11 code. Audio Glitches may be resolved, WITH risk to speaker by setting Debug-> Galaxy S to "Better".

- Possible GT-i9100g audio method. Went with the simple approach this time. Would be good to know if it works on stock ROMs.

Overall, not too well tested on different phones, but I want to get this code on Play ASAP to update for Galaxy S speaker issue.

So please try and let me know of any issues.

Thanks !

BTW, new devices en-route to me include:

- Galaxy S3 GT-i9300 International. To clear up various annoying issues.

- Galaxy Nexus 7 tablet. I'll see if it's hackable for FM.

- ADS Tech RDX-155 Instant FM USB 2.0 Radio Recorder Device. USB FM dongle that might enable FM on "USB OTG" devices, and might even fit inside a Nexus 7. :)

- Sony Smart Wireless Headset pro Bluetooth MP3 Radio Player Email SMS Android MW1. Apparent successor to the wonderful (and now $40) MW600 that supports FM within an A2DP stereo BT headset/receiver. Latest Android devices may support FM over BT and this is for testing.
[Spirit FM] gaetanolip:
Please,

support for galaxy s3 AOSP rom!!!!
[Spirit FM] mikereidis:
Send me a debug log with Menu-> Test-> Email-> Logs. After several seconds, press Send.

What happens ? It might be something simple, like the FM driver is missing or needs loading.

It's working, more or less, on stock and CM9 so it may just need minor adjustments for other ROMs.
[Spirit FM] tudorsirb:
Very nice app, works like charm on my LG P500 (CM7)
[Spirit FM] cos68:
Thank you for your efforts. I have tried it on both my Android phones.

My LG GT540 is working quite well. It is possible to tune into stations, but unfortunately no RDS is seen.

For my HTC Desire I can see the UI, but I cannot tune into any radio station, so I guess it is in test mode.

I am really looking forward to your next releases. Thanks!
[Spirit FM] mikereidis:
Just FYI I have now found out that it's possible that a software bug can mess up reception.

There is some code in the Desire HD CM ROM related to headset plug-in / plug-out that can enable or disable the antenna connection to the headset.

If anyone experiences no audio or bad reception, removing and re-installing the headset may help.

Once I fix this I will likely push out v2.0.4 to the Market.
[Spirit FM] mikereidis:
Thanks much for your investigation. Can I presume your battery monitor is a hardware DMM/meter ? Or is there some software accessible current meter ? I've never looked into this, but I'm thinking I can cut into a USB cable to insert a DMM and that would give me a better idea of current draw once the battery is full.

Instead of restarting your phone, you might try disabling everything that might use the Broadcom chip. So that's FM off (first perhaps), WiFi off, BT off, and continue turning things off to see if one of those drops the current demand.

Thanks ! :)
[Spirit FM] mikereidis:
Yeah, if recording doesn't start, that means the input device doesn't exist. I'm starting to think that a "loopback plug" for the USB port alone might possibly allow recording. Going inside the phone might even allow an internal connection.

But I'm also thinking that the ROM (CM) would have to specifically support the combination of FM analog audio output simultaneous with analog input to DAC(s) for recording. But if I could create a CM patch, there's a decent chance I could get that into future CM builds.

Yes, I've looked closely at the CM FM app hardware driver code and it seems quickly hacked together and now somewhat forgotten. Unless/until someone steps up to add features and fix some things.... But perhaps my app will effectively supplant it.

That said there's a few very nice features on the CM app I intend to "borrow" for my app, including the dragging/flinging to fine tune.
[Spirit FM] mikereidis:
I'm very pleasantly surprised. The CM ROM for P500 / Optimus One doesn't have the CM FM app does it ?

I had an LG Optimus Chic briefly before I got fed up with the lack of ROM options.

If the P500 runs CM7 and my app then I may just buy one for testing. It seems a wonderful phone for the price. Here it's $200 outright at Telus, but it appears Koodo has marked them down to $150.
[Spirit FM] mikereidis:
Wow, another LG phone ! Thanks in no small part to the CM and MIUI devs, my success rate on different phones is looking pretty good now. (Sigh of relief)

So if you set the frequency to a strong station you don't see any bars of signal strength in the upper left ? If not, then yes, the app isn't controlling the FM chip properly for some reason. If you saw bars I would say this is an audio routing problem.

Are you running CM7 on both phones ? If yes on the Desire, I presume the included CM FM app is working OK ?

With any other FM app running (although CM or MIUI is likely best), it generally should be possible to bring my app up and do things like tune, mute etc. This could help troubleshoot the issue.

I just tried on my Desire HD and it works. I bring up the CM app and hear audio, then switch to my app and can re-tune etc. I can even switch back and forth between apps. I'm hearing a few strange background noises (quick sequences of tones) but it might just be the song or something else, LOL.
[Spirit FM] skatt127:
I've no hardware instrumentation, just a program called battery monitor widget. It shows battery drain quit well. As for turning off IC circuits - I disabled BT but it's not a cure... a current is the same. As for WiFi - I didn't disable it as I use it everytime.

Thanks!
[Spirit FM] mikereidis:
OK, I'll check it out, thank you.

V2.0.4 is published to the Market.

It contains:

- The Greek translations courtesy of dancer_69.

- A fix for the CM volume fight issue. I adopted the same volume curves as CM so it's virtually un-noticable now.

- I fixed the re-init on re-orientation issue.

I had the audio inexplicably cut out on my Legend once, but haven't seen that happen again. Toggling the speaker enable or re-plugging the headset should fix that.

For those who haven't noticed, the volume can be controlled with the screen off. On my Legend volume buttons do not auto-repeat with the screen off, but with the Desire HD they DO auto-repeat.

For some reason, fast auto-repeats on the up volume have been seen to sometimes cause the CM Media Player to start. Pause/kill the media player and things are good again.

Google is reporting 42 installs so far, and 1 crash. :)
[Spirit FM] vura:
Jsut tried it on my HTC Tattoo works well 100% NO problems, though it could be better if it had a better GUI
[Spirit FM] mikereidis:
Great ! Thanks for the report.

I'm very interested in any feedback on the GUI. What would you like to see ? Describe or draw pictures or point out what you like on other apps.

I'm mostly avoiding colors at this time as I think color tastes are different from person to person, but they could be made configurable.

There are XML files in the app that anyone with Android GUI XML knowledge could modify to layout elements on the screen differently and create "Skins".
[Spirit FM] parthabhatta:
Not working on Xperia x10 mini with CM6 / cm7 customised ROM.
[Spirit FM] bbk:
Work fine on my DHD with CM7....
[Spirit FM] cos68:
Well, I was on the stock ROM for my Desire. I have just tried to change to CM7 and now it is working just as expected, thanks!

My observations until now are, that your application is working fine, if I enter the frequency directly. However automatic searching for a station is not working on either my HTC Desire nor my LG GT540. When I try to search, it ends up on a strange frequency eg. 107.696.

Signal bar in the top of the application seems to be working fine, however the stereo indicator is somewhat unstable. From time to time it is working fine but other times it is either not seen at all or it shows Mono on a station that is definitely Stereo and with a strong signal. It often helps with an update of the screen by turning the phone 90 degress. This is the same for both my phones.

Once again thanks for your time. I cannot wait for your application to have some RDS support for my devices :p
[Spirit FM] mikereidis:
OK, good...

Yes, the seeking is known broken on Broadcom chips at this time. I'll disable it until I get it fixed. The register controlling the channel offsets for seeking ends up with seemingly random values; I'll try to figure this out and fix this ASAP.

Yes, the stereo indication seems to be suffering from a register issue too. Will also fix asap.

To ALL: The next version should be posted soon; hopefully within 8 hours.

Among many other things, it mutes the radio during ringing or incoming or outgoing calls, and re-enables audio when the call finishes.
[Spirit FM] mikereidis:
Thanks for your report; I'm sory to hear that.. I was communicating with someone doing work on the X10 CM port (I think) and we couldn't figure it out at that time. I'll keep trying to find out the issue,
[Spirit FM] mikereidis:
v2.0.5 is published: https://market.android.com/details?id=com.mikersmicros.fm

With the ringing/on call mute working now, it should be much easier to use your phone as a phone as well as FM receiver somewhat simultaneously...

I'd guess this is a "must work" feature, so if anyone sees ANY issue in this area, please post or PM.

Enjoy ! :)

What's in this version:

1. Audio mutes ringing/call in progress.

2. Reduced permissions.

3. Low power mode screen off.

4. Fewer audio glitches.

5. Speaker/headset selection saved.

6. Record, Sleep, AF disabled.

7. Broadcom: seek broken -> 2 MHz. Stereo ind disabled.

8. Reduced 2 config files to 1 file. Old data can be removed with "Settings->Applications->Spirit...->Clear data" but this will also remove presets.

9. Please feel free to "vote" on the features or phone/ROM support you want prioritised. Thanks !!
[Spirit FM] mikereidis:
Wonderful ! Since I have a DHD I'd hope it runs as well for you as for me.

I'm happy to report I just found some source code for one of the Broadcom FM chips with their common command set.

The code includes RDS, so I'm hoping I might have RDS data working within a week. :D
[Spirit FM] imarkov:
It doesn't work on my ZTE Racer with custom ROM (2.3.3/CM7) :(

If it helps:

adb shell hcitool cmd 4 1

< HCI Command: ogf 0x04, ocf 0x0001, plen 0

> HCI Event: 0x0e plen 12

01 01 10 00 04 00 00 04 1D 00 C7 0D

adb shell hcitool cmd 3f 15 0 1 1

< HCI Command: ogf 0x3f, ocf 0x0015, plen 3

00 01 01

> HCI Event: 0x0e plen 4

01 FF FF 01

adb shell hcitool cmd 3f 137 1 1

< HCI Command: ogf 0x3f, ocf 0x0137, plen 2

01 01

> HCI Event: 0x0e plen 4

01 FF FF 01

It doesn't look like it should be, right? Is it because of the custom ROM or chip is incompatible?
[Spirit FM] yokonunz:
Continue with the devin! Thanks!! We need a good FM radio app also with RDS :D and better icons :D

CM Stock FM is crap!
[Spirit FM] mikereidis:
Here is the debug info provided in the v2.0.18 power up error dialog, or visible in the RDS RadioText area below the frequency numbers:

I'll start with an example of the best/most efficient mode:

Fm:BC Sh:1 Su:1 Bt:0 Ht:0 H2:1 Mo:BCH UA Hv:4 Ma:15 BC

The number 0=No and 1=Yes

Fm identifies the FM chip. ??=Unknown, BC=Broadcom, TI=Texas Instruments, EM=Emulator.

Sh indicates if shell command can be run. ("Sh:1" = Yes.)

Su indicates if SU capability is available.

Bt indicates if BT is on.

Ht indicates if hcitool is available.

H2 indicates if hcitoo is available.

Mo is operating mode:

BCH UA = Broadcom HCI UART App.

EMU = Emulator

TIB = TI BTIPSD

BCH UD = Broadcom HCI UART Daemon (sprtd)

BCH SD = Broadcom HCI BT Sockets Daemon (sprtd)

TID SD = Texas Instruments HCI BT Sockets Daemon (sprtd)

UNK D = Unknown Daemon (HCI available but FM chip unknown)

BCH HT = Broadcom HCI via hcitool/hcitoo

TIH HT = Texas Instruments HCI via hcitool/hcitoo

UNK HT = Unknown HCI via hcitool/hcitoo

BCU = Broadcom detected but HCI access unavailable

TIU = Texas Instruments detected but HCI access unavailable

UNK = Unknown with HCI access unavailable

Hv is HCI version. I always get 4 on my phones. I've seen logs for one device that shows 5.

Ma is Manufacturer code. 15=BC=Broadcom. 13=TI=Texas Instruments.
[Spirit FM] mikereidis:
For anyone with the "no audio" problem (but RSSI and RDS works), here is my post on how to experiment with the ssd utility:

http://xdaforums.com/showpost.php?p=14190154&postcount=320

I hope to expand the ssd utility so that it works on as many phones as possible.

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

Re: Samsung phones and Nexus S etc. using the Silicon Labs FM chips.

I've seen that work has begun in CyanogenMod to support these devices. I applaud their effort and expect that it will make my job easier to support devices with this family of FM chips.
[Spirit FM] ssserpentine:
where do I find this version?
[Spirit FM] mackux:
It's working now! with 2.0.18 but i had to put ssd in system/bin and put srt directory from v17 to sdcard

THANK you for your help mikereidis and for a gr8 app. Now I can listen to the radio again :)
[Spirit FM] idkidk:
Hi Mike,

this is tab settings:

Fm:BC (Broadcom)

Sh:1 (Shell Yes)

Su:1 (SU Yes)

Bt:0 (BT Off)

Ht:0 (Hcitool no)

H2:1 (Hcitoo Yes)

Mo:BCH UA (Broadcom HCI UART App.)

Hv:4 (HCI Version 4)

Ma: 15 BC (BC=Broadcom)

In attach 1st test: there is some (good?) news: RSSI have value from -90 to +36 but no audio and no RDS. (Negative value of RSSI mean...?)

Tia

Idk
[Spirit FM] idkidk:
Hi,

Try the 2018 version and post you result, any help is important :D

TIA

Idk
[Spirit FM] cos68:
Hi

Spirit v2.0.18 is working perfect on my Desire with Oxygen 2.1.3 custom ROM except for one issue.

If I select "Startup Audio Output" Speaker, then I hear the radio from the speaker next time I start it as expected.

If I select "Startup Audio Output" Headset, then I hear the radio from the headset next time I start it as expected.

But if I press the menu button and select speaker when in headset mode, then I hear no sound in neither headset nor speaker. The same if I start in speaker mode, then I cannot change to headset mode without restarting the Radio application.

Output during startup:

Fm:BC Sh:1 Su:1 Bt:0 Ht:1 H2:0 Mo:BCH UA Hv:4 Ma:15 BC

Thank you for all your work!
[Spirit FM] SubZero5:
I have found a bug...

I push the speaker button.

Then I press close the app button.

And then I rotate the screen.

Now both the app and the speaker is turned on...
[Spirit FM] mikereidis:
The debug info is pretty much exactly what I'd suspect for you. Was there a working hcitool on your Tab or did you copy one from elsewhere ?

At these frequencies you got:

93.75: 0, -5, -6

93.8: 36, -6

93.9: 0, -5, -6

102.5: -6, 10, 36, -93

102.55: 0

102.65: 10

102.7: -6

102.95: -6, -6

103.25: 0

103.35: 0

103.55: -92

103.85: -92

104.05: -6

104.15: 10

104.2: 10

104.15: -6

104.25: -6

104.35: 10, -6

104.4: 10

104.5: 10, 4

88.5: 36

....

88.6: 10, -92, 36, 36, 10, -6, -6, -92

I'm not sure what to make of these numbers. They seem to be clustered at values: -93, -6, 0, 36. It's as if the wrong register was being read.

I'm not sure the below will help, but I wrote it first, and will leave it in this post.

The RSSI function for Broadcom chips uses a formula that makes it pretty much match the values from the TI chip I originally supported. The TI chip reports RSSI values of around -4 to around 50 at maximum strength.

With rssi_reg meaning the value from the RSSI register (0-255), using rounded off integers the formula is:

rssi = ((rssi_reg - 144) x 2) / 3

The reverse is:

rssi_reg = ((rssi * 3) / 2) + 144

So your readings of around -93 mean the register was reading about 4-5. I'm not sure why, but I'd ignore these readings.

0 rssi means the register was reading 144.

10 rssi means around 159.

36 means around 198.

It seems the numbers were jumping all over the place. That's understandable if you were handling and moving the Tab. If it was just sitting stationary, I'd expect the numbers to be more consistent. And the numbers shouldn't be so clustered.
[Spirit FM] mikereidis:
Great, thanks...

I'll respond to the other posts later when I have some time...
[Spirit FM] mikereidis:
FYI, the Menu Speaker/Headset option and the Settings "Startup Audio Output" do exactly the same thing. They change the current state AND the state for next power-up.

Anyone else having audio switching issues should also try this if possible:

If you have a PC connected and can use adb shell, the following commands should mostly restore the original switching method. That method was derived from the method the CM FM app uses. If you can't copy from this post and paste to a command window, don't even try this. I think it'd be almost impossible to type all this without an error.

adb shell mkdir /sdcard/sprt

adb shell mkdir /sdcard/sprt/opt

adb shell mkdir /sdcard/sprt/opt/aud

adb shell mkdir /sdcard/sprt/opt/aud/speaker

adb shell mkdir /sdcard/sprt/opt/aud/headset

adb shell touch /sdcard/sprt/opt/aud/custom

adb shell touch /sdcard/sprt/opt/aud/headset/custom

adb shell touch /sdcard/sprt/opt/aud/speaker/custom

adb shell "echo 0 > /sdcard/sprt/opt/aud/headset/sfu_dev"

adb shell "echo 2048 > /sdcard/sprt/opt/aud/headset/scs_una"

adb shell "echo 2048 > /sdcard/sprt/opt/aud/headset/scs_ava"

adb shell "echo 1 > /sdcard/sprt/opt/aud/speaker/sfu_dev"

adb shell "echo 2048 > /sdcard/sprt/opt/aud/speaker/scs_una"

adb shell "echo 2048 > /sdcard/sprt/opt/aud/speaker/scs_ava"

Please let me know if this fixes the switching.
[Spirit FM] mikereidis:
Good catch, thanks !

I think this has nothing to do with the speaker, and I think the app has always had this behaviour and you are the first to notice and speak up. I've never thought to turn the phone with the power off.

This is a consequence of the way Android handles screen orientation, and the fact that my app always attempts to power up the radio when it is started.

Android handles screen orientation changes by default by terminating the app and restarting it.

There's a few different ways to prevent this and I'll give it some thought.

The easiest ways are (1) to not support landscape mode and (2) to prevent automatic power up. I think most people would prefer the bug to either alternative "fix" though.

If the power switch terminated the app entirely, as the stock HTC app does, we could also avoid this.

One workaround for now is to press the Back key after power down, as that terminates the app.
[Spirit FM] idkidk:
Hi Mike,

I've found hcitool by googling and, no this hcitool don' work :

/ # hcitool cmd 3f 15 0 1 1

hcitool cmd 3f 15 0 1 1

< HCI Command: ogf 0x3f, ocf 0x0015, plen 3

00 01 01

Send failed: File descriptor in bad state

/ #

where i download the correct hcitool?

for testing the signal i'm near the windows without moving the tab. For the RSSI value, the signal maybe in a logarithm scale ?

Tia

Idk
[Spirit FM] cos68:
Hi Mike

Yes, that fixed the problem switching between headset and speaker on my Desire. Thank you very much!
[Spirit FM] gelim:
Hi,

first of all Mike, a warm big thank you for the reverse work and making that public. The technical thread is very enlightening.

I'm a recent newcomer and discover the Legend/CM7 scene and one of my frustration was to discover the CM7 "stock" poor FM application wrt to the HTC one.

> I'm very interested in any feedback on the GUI. What would you like to see ?

I downloaded from the market today your Spirit FM Radio (2.0.9) and have the following comments (more functionnal than GUI actually) about it :

when powering down the application (power GUI button) bluetooth is kept on

when long pressing left or right arrows the autoscan may show the currently frequency being scrolled in order to know where you are when clicking cancel

related to the previous point, your S/N ratio threshold calculus seems a bit high and plenty of properly sounding radios are skipped while auto-scanning

the "right arrow" button for navigating in the memorized frequencies is awkward, you don't expect to click next one more time to loop back rather it should show a back arrow in my opinion

check if antenna is plugged on startup and display a warning message but do not enable tunning+loudspeaker, that'll only give an useless annoying white noise

The RDS feature is just priceless and make it valuable over the CM7 regular one. You should maybe be inspired for the design part by that application instead of reinventing something ?

Thanks for reading this,

Keep up the precious work !