yashsingh1/xdaforums huggingface dataset:
[Spirit FM] mikereidis:
Hi clem_ita. I also have an Optimus One P500h with the same CM7, although I haven't updated it recently.

Background, or screen off volume control usually works for me. But from time to time I've seen the same problem you have. I haven't figured out how to reproduce it though, it just seems random.

At one point I tried adding some code to explicitly set audio focus, but stopped because the problem seemed to resolve itself or the code wasn't working well.

I will try again with the latest CM7 release when I can, and see if I can reproduce the problem and fix it.

There is a setting I use in CM to disable a long press on volume keys from starting the media player. It was causing trouble for me; I prefer a long press translate to a volume key repeat. I'm not sure if this setting helped prevent the audio focus issue.

On the most recent test release(s) I changed Volume Control Stream from 3 (Music) to 10 (FM on some devices). You might want to try the Sept 4 or Sept 5 test releases: http://www.mediafire.com/file/wzw86h6z3qh4xtl/Spirit_FM_Radio_v110904.apk OR http://www.mediafire.com/file/9512cjj53ka9kmx/Spirit_FM_Radio_v110905.apk

On phones that support a 3 button media control, the Next and Previous button can also be used to control volume. My HTC Legend supports this, but the P500 doesn't seem to, even with the HTC earphones jacked in.
[Spirit FM] denzel09:
Ok, i will do it buddy ;)
[Spirit FM] mikereidis:
I'm not sure exactly what you mean.

The x10 mini has a /dev/msm_snd device that my app uses to route audio to headset. Several values were tried by someone with no success to speaker.

HEADSET_FM (39) works OK.

I think all the other values with FM in the name were tried:

m1_do SND_GET_ENDPOINT ioctl snd_endpoint.id: 32 name: FARFIELD_OP_FM

m1_do SND_GET_ENDPOINT ioctl snd_endpoint.id: 33 name: FARFIELD_CL_FM

m1_do SND_GET_ENDPOINT ioctl snd_endpoint.id: 34 name: FARFIELD_OP_FM_LINEIN

m1_do SND_GET_ENDPOINT ioctl snd_endpoint.id: 35 name: FARFIELD_CL_FM_LINEIN

...

m1_do SND_GET_ENDPOINT ioctl snd_endpoint.id: 41 name: POW_HEADSET_FM

...

m1_do SND_GET_ENDPOINT ioctl snd_endpoint.id: 43 name: HEADPHONE_FM

...

m1_do SND_GET_ENDPOINT ioctl snd_endpoint.id: 45 name: LINEOUT_FIXED_FM

...

m1_do SND_GET_ENDPOINT ioctl snd_endpoint.id: 47 name: DHVH_FM

On several devices, FM normally goes to the headset. You "force" speaker output with:

setForceUse (FOR_MEDIA, FORCE_SPEAKER);

and revert to headset output with:

setForceUse (FOR_MEDIA, FORCE_NONE);

This is what I added to the code for testing on next release.
[Spirit FM] Quinny899:
Loopy smoothness is a tweak that stops apparently from being killed as quickly in cm7 for quite low ram devices. I had it on my GT540 that had 250mb of ram and constantly killed apps. My Desire HD has 720mb of ram and doesn't have this problem.
[Spirit FM] mikereidis:
Thanks for teaching me something new. "Loopy smoothness" is a funny name. :)

Yes, it's possible for any Android app to get killed in low memory conditions.

My app contains a background "music" service portion, that should be among the last things that would be killed. But with very little free memory, it certainly can be killed.

Many people are surprised that FM audio usually keeps playing, even if the FM app is killed (stock apps may require an instant kill.) So it may not be apparent that my app has been killed, and with it the volume control.

I'll have to test my app better in low memory conditions. My test phones rarely see much app activity.
[Spirit FM] mobilis2009:
Bug!?!

Very happy that your latest version (beta? on 05sept) is working now on S5660M.

I want just to report that when I use my stereo Bluetooth headset (Plantronics BackSeat 903) the following error message popup:

Sorry! compatible FM chip not found....:(

Fm:BC Sh:1 Su:1 Bt:1 Ht:0 H2:0 Mo:BCU

May be you could fix that for the next official release

Many thanks
[Spirit FM] clem_ita:
Thank you for the support! ;-)

I'll do some more test on the current version to see if the problem is persistent or if it is random also for me. (Anyway it should be random since we have the same phone!)

Then I'll test also the latest betas and the Loopy smoothness hack. I'll report here how it goes.
[Spirit FM] sfortier:
GIO s5660m uses bluez on stock rom (included on samsung source; also glib and hcidump), maybe this make the diference...

Maybe subpsyke can use this sources on i5500 CM7 port.
[Spirit FM] mikereidis:
It may not be possible to "fix" this. (Unless and until I reverse engineer the proprietary Broadcom Bluetooth/FM code.)

Are you running a stock rooted ROM ? If not which ROM ? You can try to select Menu and then Email Logs for me to look in more detail.

Since your debug line contains "Ht:0", that indicates your device is not using the open source Bluez Bluetooth stack. You have the proprietary Broadcom stack.

The only way my app works with this stack is by taking over the Bluetooth "UART" and communicating directly with the chip. This will not work when Bluetooth is on.

Sorry....
[Spirit FM] mikereidis:
From the debug logs Shawns13 sent, and mobilis2009's post above, it looks like the Broadcom proprietary stack on S5660(M).

Unless there is a specific release that went Bluez ?

AFAICT, all stock Galaxy 5 series devices use proprietary.
[Spirit FM] mikereidis:
OK, thanks ! Please note if it only happens after certain apps are started, or when free RAM memory runs low.

If you have a headset with a media button, see if it can Mute/Unmute audio. If my app has been killed, then this button should also stop working.

You'd be surprised how often seemingly identical phones have slight differences. My Optimus One is a Canadian version: P500h and I think the audio section is somewhat different. And there are phones with different LCD screens due to shortages of AMOLED.
[Spirit FM] denzel09:
I not see the hour that your app work on galaxy mini and other series. Really wait that moment buddy ;)
[Spirit FM] mikereidis:
:)

I think we will solve this.

I think the Broadcom btld sends some "magic" commands to the chip, likely specific to BCM20780.

I am going to run the stock app on my device and try to use the strace utility to find out the magic commands.
[Spirit FM] mikereidis:
Please post instead of sending PM's so we all can participate & learn. If you are new and can't post here you can post on this thread: http://xdaforums.com/showthread.php?t=1166856&page=4

Via PM:

I'm not familar with HTC Touch Pro 2. I presume it's different than the "HTC Touch HD2 / Leo" ??

You should be able to send me debug logs by selecting Menu then Email Logs. Unfortunately often the file doesn't attach properly so you'd need to manually retrieve /data/local/tmp/sprt_debug.txt or /sdcard/sprt_debug.txt .

What ROM are you running ? What does the debug line say at startup ? It starts with "FM: ".

For no sound you should try the different Audio Methods. Make sure you are tuned to a strong station with headphones inserted. Press Menu, then Settings -> Audio -> Audio Method.

Try the "htcflag" method to start. If no audio you can try each method in sequence. Hopefully one will work. You don't need to leave the Settings screen for this.
[Spirit FM] mikereidis:
Two hours ago I once again got that WONDERFUL feeling I get anytime I hear music blasting from a new device via my app. :) :D

It's GREAT getting success reports, especially for devices I've never personally tried. But there's something special those first few seconds I hear the music...

Woohoo ! :) It's working on my GT-I5500M !... Volume is stuck at 100% though. Because it's 100%, try not to use speaker mode (or do so at your own risk). I'm not sure damage is likely, but at least earphones are easier to replace than internal speakers.

September 8: http://www.mediafire.com/file/0c2z9i94jidgqc9/Spirit_FM_Radio_v110908.apk

For Samsung devices with the BCM20780 ONLY (Galaxy 5 series etc.): The most important setting is to Check/Enable this: Menu -> Settings -> Debug -> Debug BC VolPoke Off.

It will hang for a while on first run if set to the default of Unchecked/Disabled. I don't yet have a reliable way of detecting this BCM20780. When I do I can automate this.

For CM use the default Settings -> Audio -> Audio Method: sfu_sdcs (or sfu_sdcs_bt to test BT headset...)

For Stock or Stock derived ROMs like Motafoca, use Settings -> Audio -> Audio Method: GT-I5500. (Or try SamsungDarky or GT-S5660).

Let me know if it works/doesn't work for you. If it doesn't work please post your phone type/model.

EDIT: Mediafire was broken. Try these if you have trouble:

https://docs.google.com/leaf?id=0B7...ZDBjMS00YjFmLWJhNzUtMjViZjFkNTU5Nzg0&hl=en_US

https://skydrive.live.com/redir.aspx?cid=55f5bd3bd01e3387&resid=55F5BD3BD01E3387!104
[Spirit FM] boran1:
Thanks for your quick reaction and your work for this app. It is amazing to see that nobody until your app spend attention to a FM app without a data connection. World is not same as USA or Canada :-) In the many countries you don’t have data connection (3G etc.) to listen internet radio

I appreciate your work very much.

HTC Touch Pro 2 is the product name of RHOD100 (version what I have T-Mobile)

I tried all of the Audio Methods but no one works.

ROM: FM BC Sh:1 Bt:1 Ht:0 H2:0 Mo:BCH SD Hv Ma:15 MC
[Spirit FM] mikereidis:
I was surprised too. But now that I see how much reverse engineering work is required, I'm not so surprised anymore. I'm pretty sure some of the carriers want us to use expensive data plans.

What ROM do you have ? Or is your phone stock ?

Can you send me your logs ? Menu -> Email Logs

Does your debug line have "SU: 0" or "SU: 1" ?
[Spirit FM] boran1:
Hi. I can't open and send Debug line .txt. You received from me an e-mail without a attachment. I can send pictures etc but not a .txt file.

Debugline: FM BC Sh:1 Su: 1 Bt:1 Ht:0 H2:0 Mo:BCH SD Hv:4 Ma:15 BC

According to android assistant I have HTC Rhodium 100 with ARMV6-COMPATIBLE PROCESSOR REV (V6l). I have FRX7 on HTC Micro SD (Haret) originally it works WM 6.5 Pro.

When I started the FM radio it started also bluetooth. And when I turned off Bluetooth then FM radio doesn't working more.

Grt.
[Spirit FM] denzel09:
:( no works for me.. all as previous, i have do all possible tries. I don't know. Really..:(
[Spirit FM] denzel09:
Other feed from s5570 owner. Doesnt work..
[Spirit FM] denzel09:
When app goes off, notify volume is 0, no sound from notify and the only choice is phone restart ;)
[Spirit FM] mikereidis:
Thanks for trying. I'm VERY disappointed to hear that.

Perhaps if we can get more people involved, we can make the breakthrough. Are there any discussion sites where there's a lot of activity for this device, or is the CM thread or dev section here a good place to reach people interested in FM ?

That's unexpected. I'd guess there might be one specific Audio Method that does this...
[Spirit FM] denzel09:
I think cm7 thread of tj porting is a good post ;)

Thanks
[Spirit FM] sfortier:
Maybe audio routing problems. May he can use our code of G5 CM...
[Spirit FM] mikereidis:
OK, thanks. As sfortier said, perhaps he can use the working G5 audio routing code. It seems to be the exact same circuitry.

You can try this new version though:

September 9: http://www.mediafire.com/file/cfve2y6z9215ufj/Spirit_FM_Radio_v110909.apk

Galaxy 5 Volume Control is fixed.

Seek not working yet. I think I know why.

Volume control moves gradually. I think that's by design in the chip. It results in a quick burst of full volume when you start. Maybe it's fixable maybe not. We'll see...
[Spirit FM] clem_ita:
Did some more testing yesterday and volume buttons always worked.. I did no modification since the first day, so probably it's random, or related to other apps asking for more memory. My favorite radio show begins next week, so I'll do more tests soon! :)

No buttons on the headset I use the most, I'm sorry.

(BTW, listening to the radio while walking downtown it's not very comfortable.. the signal is poor/unstable and I frequently have noise. When I have some spare time I'll do some test with the stock lg app to see if it's hardware related or software related.. but probably it's hardware related!)
[Spirit FM] denzel09:
Nothing ... ;)
[Spirit FM] tachita:
Is it working for Hero?..

really surprised to be able to post since is my first post here....

anyway..... i've got a htc hero and just tried your app

my BT is starting togheter with app .... but i dont hear a thing and dont get any RDS data or signal strength

i switch all tuner / country mode and audio data

if i choose SamsungCM7 i get weak audio like tuning radio noise

i also set volume scale to 200 / 300 / 400 (i read that volume is set to 100 - 1/4 by default)

i also try with or without antenna ..... and reading posts from this thread i seee something about sprt folder on sdcard - i dont have any, or maybe i get this wrong

Fm:TI Sh:1 Su:1 Bt:1 Ht:1 H2:0 Mo:TIH SD Hv:4 Ma:13TI

PS: dont know if help but on www i read that Hero has TI chipset BRF6350 and from specs i see that has fm module included in BT chips

i tried this with 3 or 4 latest versions including 09.09.2011 release
[Spirit FM] mikereidis:
Great ! Next time I see the problem I'll poke around to see if RAM is low and my service has been killed. Bugs are very hard to fix unless they can be reproduced. (And the bug, if any, could be in Android/the ROM where it's out of my hands.)

Yeah, I got used to streaming before getting my app working, and I was disappointed in the static I'd get in my house walking around, despite transmitters within a few kilometres and almost line of sight.

You might want to try setting the Audio to Mono. The FM chip should be automatically switching (or blending) to Mono when signal is weak, but manually setting it may help.

You could also try different earphones/cables since they are the antenna. It may work better if the cable is stretched out, rather than coiled in a pocket. And try holding different parts of the cable in your hand. Your body can act as part of the antenna too.

Please let me know your results, with these ideas or the stock FM app.
[Spirit FM] mikereidis:
If you've been registered here for a while, post counts don't matter.

I'm surprised, but I've had no reports yet on the HTC Hero. This is the device released in 2009 ? (I though I saw a reference to a newer Hero.)

No reports may mean no FM. Is there an FM app on the stock phone, or has anyone ever had FM working on this device ?

Don't worry about sprt folder.

SamsungCM7 plays a silent audio file and that's what you hear.

Yes, you have a Texas Instruments Bluetooth/FM combination chip. Bluetooth needs to be on for this. My app will start about 6 seconds faster if Bluetooth was already on.

Thanks for the logcat file. Are there any other files on the /sdcard like sprt_debug.txt ? That should be the main file, with all the info I need.

Are you able to use adb shell or a terminal app ? It would be nice to see if the /sys/class/htc_accessory/fm/flag file is there. A command like this will often enable FM to headset on HTC phones:

adb shell "echo fm_headset > /sys/class/htc_accessory/fm/flag"

What ROM are you running ?

Thanks !
[Spirit FM] tachita:
thanks for response

I am on Cronos rom

to clarify something, just noticed this: when I set freq in blind(no station ) I get 0 rf power and no graphic bars..... if I set freq to a radio station I get 102-105 and full rf reception......

....but no sound

about other file beside sprt_logcat... I'm pretty sure that at some point I see another file with similar name but I delete them both.....now I've got only this

I uninstall app and reinstall again including version from 31.08 (which let my phone without doubt until restart ).and I install also your latest two versions 08/09.09 .....all produce only one file

at home I have an old junk computer and in this moment I struggle to put advanced on him.... I didn't started computer from month and hope it will not die.... me or him

I better try with terminal emulator.... or if I can check physically in phone system at your pointed path?

I put another sprt log file after clean restart and install
[Spirit FM] xmguy:
Mike I'm getting the Motorola Bionic. Does your app work on it? It doesn't have a stock radio. But neither does the Droid 3 and it works.
[Spirit FM] tachita:
I've managed to obtain the debug file really don't know what was blocking.... probably the defective email sending report

The flag file is present in system to pointed path

...and no...no FM app by default...and yes, is the 2009 phone... don't know nothing about other hero -is only one hero ;)

I'm running Cronos Gingerbread on android 2.3.5

about rf signal strenght when positioning on a radio station or empty freq(from previous post ).... I think is a faulty indication based on used audio mode- at least in my case
[Spirit FM] mikereidis:
I don't know. New phone, so no reports.

Does it have a stock FM app ? I see nothing on the Motorola tech specs page at: http://www.motorola.com/Consumers/U...and-Services/Mobile-Phones/DROID-BIONIC-US-EN

If there is no stock FM app, then I'm pretty doubtful that an antenna and the audio would be connected to any combo chip that might be there.

Motorola tends to use Texas Instruments combo chips. They've also tended to use Bluez, or at least support the Bluez BT API, so that's potentially good.

Let me know if you have any info on FM on this model. If they aren't advertising FM, I'd have big doubts.

I'm liking Samsung these days. Galaxy S 2 seems a wonderful (but expensive) phone, but I have no idea when my app will be runnable on it. Different audio than original Galaxy S.
[Spirit FM] mikereidis:
Thanks !

Yes, the RSSI is reported as 102 or 103. That's MUCH higher than the normal highs around 60. The chip is returning hex 0x44 or 0x45 though.

I don't think we, or anyone else, will be able to get FM working on this device.

It requires that the manufacturer connect the FM chip power, antenna and audio pins to appropriate places. If HTC didn't intend this phone to have FM, it is very unlikely anyone could make it work.

Sorry...
[Spirit FM] xmguy:
I know Droid 3 supported the FM Radio app. The stock one. I'm hoping your app will work here too.
[Spirit FM] tachita:
reading this ... now i think that you could let me dream more :rolleyes:

anyway ... my old Hero is still a hero and probably will die so

thanks man ... and great work

cheers
[Spirit FM] nullington:
Hi!

Did you guys get it to work on the 2x?

Btw, Thanks for the great app!
[Spirit FM] mikereidis:
Not yet.

Once it's working nicer on the Galaxy S (with the same WM8994 audio chip), I'll try the Optimus 2x.
[Spirit FM] GiuSic:
Ok on my Lg Optimus Dual, very good.
[Spirit FM] sfortier:
Try this libaudio https://github.com/psyke83/android_device_samsung_galaxy5/tree/gingerbread/libaudio

G5 is very similar to tass/mini...
[Spirit FM] denzel09:
hi, i already tried that libaudio, but then phone hangs to boot logo android. So no lucky ;)

Thanks
[Spirit FM] xmguy:
Motorola Bionic HAS a FM Radio. Needs APP though. I know of one! ;)

https://supportforums.motorola.com/message/463550
[Spirit FM] mikereidis:
WooHoo ! :)

I presume the APK is the Motorola app from another phone. Perhaps from this thread: http://www.mydroidworld.com/forums/droid-bionic-discussions/9169-bionic-first-impressions-4.html

So it's likely a TI chip.

The fm_launch Audio Method will likely/hopefully work. If not I can examine the working app.

Motorola usually uses the Bluez BT stack, so hopefully the Bionic is the same.

You'll need BT on, unless/until I write a UART mode for TI. If they use a proprietary stack I'll be forced to create one. Or decipher the TI stack, but thankfully TI seems to be getting more open lately.
[Spirit FM] s0epkip:
Thanks a lot for your work and updates on the app!

I also would love to see this working with the BT stack on the Gingerbread releases of MIUI... bit weird that they dropped FM-Radio support while they brought it to CM7!

You rock, keep on rollin' :cool:
[Spirit FM] mikereidis:
Yes, I don't understand this. Did they switch from the Bluez BT stack to a proprietary one from Broadcom or TI ?

Can you tell if the phone runs hciattach daemon or btld or btipsd ? Hmm, I just checked the 'ps' output on my Desire HD w/ CM7 and don't see hciattach. Perhaps it's brcm_patchram_plus ... I've hardly looked at the system stuff in the 12 days I've had my DHD,.
[Spirit FM] CR5N:
Hi Mike, thanks for the suggestions. Tried both methods and granted su permission when requested but still no audio. I can see the signal strength change as i move my headset wire around so it is doing something! Will watch this thread for updates.

Edit: this was the fm1 file info.

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

13 01 01

> HCI Event: 0x0e plen 7

01 15 FC 00 13 01 00
[Spirit FM] embryo10:
Hi there,

This could be a very nice app when its finished. Even now is very usable. It works fine on my Nexus One with CM 6.1.1.

The main thing that's keeping me from using it over the CM one, is the processing power that needs.

When I use it, the CPU is constantly at 30-40%. This is a no go for me. But I will keep on checking, cause I like the potential...

Nexus send it ...
[Spirit FM] mikereidis:
OK, I'll see what I can find out...

If you had a working FM app (like stock) on that ROM, you'd likely be able to run my app and that app at the same time and the other app would enable the FM audio path.
[Spirit FM] mikereidis:
OK, have you ever tried v2.0.7 or earlier ? Those versions don't support RDS on Broadcom and may reduce your CPU usage. See this for download links for earlier versions: http://xdaforums.com/showpost.php?p=13601461&postcount=74

Beyond that I'm not sure what your high CPU usage is due to. Perhaps a ton of log messages or some other bug ?
[Spirit FM] matrix2004:
I hope it works on Xoom and Droid X soon.
[Spirit FM] kennyg7:
Tried the app on my DHD using the latest version of MIUI and the radio doesn't seem to work....

Does this work with MIUI?

Anyone else having problems?
[Spirit FM] 4silvertooth:
It works on my lg optimus one with cm7. Version beta 6.4.2 gingerbread 2.3.4. The sound is crystal clear with headset and weak signal without headset. The interesting thing which I have found is I get moderate signal with a piece of 24inch simple wire with the naked end just near the headset plug without any contact.
[Spirit FM] gmpurohit:
is Gingerbird 2.3.4 stable on lgo1.I have 2.3.3

probably app not working on it may be the reason
[Spirit FM] 4silvertooth:
Preety much.
[Spirit FM] mikereidis:
I can try MIUI.

But I'm new to MIUI and a bit confused. I hope we're talking about "Official MIUI" and not some derivative.

I went to http://www.miuiandroid.com/roms/ and downloaded Deodex "HTC Desire HD 1.5.6" : http://deodex.miuiandroid.com/miuiandroid_DHD-1.5.6.zip

But I also see http://en.miui.com/a-1.html and DHD http://en.miui.com/a-57.html which leads to http://bigota.d.miui.com/miui_DHD23_1.3.25_2.3.zip , It's downloading now very slowly.

Which one is the latest/best ? DHD-1.5.6 or DHD23_1.3.25_2.3 ?

I opened the first zip file and there is no MIUI FM app, nor is there an hcitool in the bin directory. As a possible plus, there is no btld (As on my stock DHD), but there IS a brcm_patchram_plus . I think the latter has a switch which may enable HCI.
[Spirit FM] lupoalberto12:
Sorry, I didn't read that it running only on CyanogenMod ROM.

I tried it on Wildfire with Froyo 2.2.1 stock no root (unfortunately).

However, the app didn't notice nothing.

Shall I make other tests?

I would like to use it.

Thank.

Bye!

! :) !