yashsingh1/xdaforums huggingface dataset:
[Spirit FM] mikereidis:
AFAICT, all Galaxy S or S2s that have the FM chip needed come with the Samsung FM app on the stock ROM. I'm not sure about this "Galaxy S II Skyrocket SGH-I727", it's a newer one right ?

If your stock ROM doesn't have the FM app, then your phone likely does not have the FM chip.

I haven't yet heard of a US market GS2 with FM, neither AT&T nor T-Mobile. AT&T initially advertised FM but corrected that later.

If you were misled by AT&T advertising, they may allow a return.
[Spirit FM] mikereidis:
I think likely some errors are filling the logs. Did you start with BT on or off ? Try the other way. You can send me debug logs with Menu->Help-> EM Logs.

But regardless, I think there is no hope for FM on your device. Those RSSI numbers mean the Broadcom FM is not wired to allow it to work.

The only Android "tablet" ever confirmed to have working FM is the original Dell Streak 5". And it was never shipped with an FM app even; It's rare for FM to work on a device unless there was a stock FM app.
[Spirit FM] oskaratk:
on its way

Thanks

Oskar
[Spirit FM] mikereidis:
Thanks ! Even if we can't get it working, there's good stuff to learn, for this and other phones.

I just read another log an hour ago for the new Galaxy Nexus, and it's showing the same error as yours, in the volume setting code that's been troublesome with new Broadcom chips:

hci_err: 3 Hardware Failure

I think the solution may be the same as I offered for the Nexus: Set the Menu->Settings->Debug->BCM 20780 checkbox to ON. I think the new BCM4330 is like the new 20780 in that it requires a different approach to setting volume, and the original approach makes the chip freak out.

Set that option, then it's best to reboot the phone.

If starting with BT on doesn't work, try starting with BT off or vice versa. It looks like you started with BT on.

There seem to be several new phones with this Broadcom 4330 now (Samsung Galaxy S2 class devices). Thus far I haven't heard of my app working on any of them, but when the S's and S2's have FM it's from a Silicon Labs FM chip. The part of the Broadcom combination chip for FM seems disabled.

Another discouraging sign though: The ALSA driver is showing many audio controls but it doesn't show anything related to FM. Some other Samsung products HAVE shown such controls, but they were "vestigial", IE leftovers from the variants that DID have the Silicon Labs FM chip.
[Spirit FM] shunsai:
hey mike,

it just dawned on me why so many japan orders have probably been cancelled. if you recall, i keep repeating in my posts that i don't trust google. that distrust stems from bad experiences i've had using google checkout to try and make online purchases. long story short- google seems to have something against accepting japanese credit cards. it's why i haven't actually been able to make any purchases from the android market. every time i try to buy an app, a short while later my order is cancelled and my money refunded. so it's not a cultural thing or a language barrier thing- it's a "google is stupid" thing.

it really shouldn't be rocket science to accept international credit cards (yup, i use a VISA, but it's a japanese VISA). i can't express enough just how much i detest google because of this. so basically, i can't legitimately acquire software for my android phone. anyway, my advice to you, if you'd like more income (or at the very least want to curb the japanese refund situation), throw up a link from your market site to a simple webpage, slap a Paypal Donate/Purchase logo on there, and let the yen come flooding in! :)

just my two cents. hope it helps!
[Spirit FM] mikereidis:
Yes, that's VERY helpful, thanks !

If I'd like more income ? You bet... LOL.

I've had people who had to try 3 times before an order would go through. Each time it appears cancelled, as if someone pushed the refund button.

My overall cancel rate seems to be a bit over 50% but I know at least several were from the same person. Perhaps the countries I thought had higher piracy rates, were just countries such as Japan where Google doesn't get along well with the credit card companies (technically or otherwise.)

And there's nothing I can do about this, except a big hassle dealing with multiple alternative markets. Google does not respond to small developers at all, despite over a year of well documented dev complaints.

All the more reason I guess to go with a sponsorship / donation model. Google does very little for their 30% I now feel, except to "insult" us with their "we don't talk to devs" policy.

And as for "piracy", I downloaded an app tonight that made it ALL to easy to get my Unlocker and countless other pay apps, with no credit card hassles. So, as always, there's very little that can be done to stop that and Google is little help there either.

And it was the same with digital music before iTunes. Even if you were willing to pay, it was easier AND possible, to download digital music off of the Internet.

And yes, the "warez" app I downloaded has been deleted, as much out of malware concerns as it's inappropriateness. At least Google isn't carrying that app. (Anymore? It turned up in the Market search, despite my never seeing it before.).
[Spirit FM] denzel09:
mike you have a new logcat like you asked me. Hoping this help.
[Spirit FM] edowar:
Hi Mike

Actually your app works stable when fm radio is playing, also works great on speaker out but when screen off then the sound sometime get off too :).

And my device always reboot itself when I quit the app. Temporary solution for me to avoid restart itself when quit app, I just use titanium backup and set freeze app spirit.

Many thanks Mike for support. I really enjoy your app :D

Hope next version will be better for huawei audio device specially with huawei x6 devices.
[Spirit FM] mikereidis:
Sorry I can't see it in my inbox.

For those with the 5660 problems, I have a report that:

"v111027 works great and I got radio again. just for the record it runs in my galaxy gio S5660M with gingerbread 2.3.4 and no custom ROM."

So I think this problem doesn't seem ROM related.

So if others find the Oct 27 version works, and Nov 3 previous Market version DOESN'T work, then the answer lies between those adjacent versions.

Unfortunately I don't see any code difference that explains this. It may be something obscure like the ordering of writing to chip registers or similar.

For those who can test, or perhaps want the last working version, Oct 27 is here: http://www.mediafire.com/file/jhb7pi3s5k5sw3s/Spirit_FM_Radio_v111027.apk[/url]

Edit: But then the reporter seemed to say the Nov 3 Market version work OK too... Hmmm...
[Spirit FM] denzel09:
I have send logcat to this mail ... but i will try to resend it ... peter
[Spirit FM] sir_earl:
Hi Mike,

As per the PM I sent you, I'd like to discuss some of the low level details around initializing the bluetooth chip (primarily Broadcom at this stage).

Just to recap for everyone's sake, I'm trying to use L2CAP sockets via bluez. This works fine on almost anything but Samsung and HTC phones by enabling bluetooth in the standard manner. For Samsung devices, I've made good progress by using brcm_patchram_plus - i.e.

# turn on

echo 1 > /sys/class/rfkill/rfkill0/state

# initialize

brcm_patchram_plus --enable_hci --enable_lpm --baudrate 3000000 --patchram BCMXXX.hcd /dev/ttyHS0 &

# bring up hci (send HCIDEVUP ioctl)

hciconfig hci0 up

Unfortunately this last step fails with a timeout (110) on HTC devices. I have also tried using hciattach.

I still don't fully understand how the proprietary broadcom stack works, or why bluez works with Samsung but not HTC. I assumed the stack is still using elements of bluez, but perhaps it's only working on Samsung devices because they didn't bother to remove and disable it? Still, HTC devices seem to fail on the ioctl HCIDEVUP call, which I thought was before the bluez layer?

I'm aware of btld, but my reverse engineering skills are limited and I've had very little luck finding anything useful there.

I guess you're not touching bluez, but I assume you're still starting up the hci interface in some way? Any chance you can describle this process in more detail, or provide any further insight?

Thanks!

Earl
[Spirit FM] sir_earl:
Yes, only stock roms using broadcom BT stack are causing issues.

This might come in handy when I attempt to add support for TI chips.

Right, but as far as I can tell, this seems to be required for some chips to work at all?

This sounds like a really promising lead. Looking at the AOSP source it appears to be responsible for enabling and disabling the chip, so assuming HTC have kept its purpose the same, I might be able to get at this functionality and bypass my hack for Samsung devices. I'll look into this when I get home!
[Spirit FM] mikereidis:
Yes, I think the patchram HCD file is more or less required on many Broadcom chips, if for no other reason than to patch older firmware. But I've been seeing logs lately that had no HCD file, perhaps on the newest BCM 4330 chips.

Yes, libbluedroid seems to be intended for vendor/OEM customisation. My favorite hidded functions are:

check_fmtx_antenna

set_fmtx_antenna

I wonder if some HTC devices have hidden FM transmit capability.
[Spirit FM] sir_earl:
Have you had any luck getting at the functionality in libbluedroid? Did you use dlopen and dlsym for this purpose?
[Spirit FM] mikereidis:
:)

The strongest local station identifies itself as "Adult Hits". Here's their playlist if you're curious: http://www.1053kissfm.com/onair/playlist.jsp

Homepage says "The Most Gaga", LOL. Also Rihanna and Usher.

I'm all for "...the freedom of music" but I personally can't stand it.
[Spirit FM] luca_v3r:
Thank's a lot for this application, but I'm not able to heard the sound, like you tell before...RDS and other features go well.

Edit: now I try this!

Thank's!
[Spirit FM] luca_v3r:
everything is ok.

but every time I reboot the phone I have to give the commands:

ssd 2

ssd 4

ssd 1.

before I could hear the radio, I'm doing something wrong?

Thank's!
[Spirit FM] Quinny899:
Not sure if it's this app, but since installing it, the microphone does not work for recording. Any reason why? (Using HiFiCorder Lite from the market) SwiftDroid 2.0 M4 CM7 Android 2.3.4

EDIT: IT ONLY HAPPENS WHEN THE APP HAS BEEN OPEN AND IT PLAYS A "SILENT" NOISE ALL THE TIME.
[Spirit FM] mikereidis:
No you are doing good.

SSD is a temporary fix, and at this point it's very experimental.

I'm hoping I can get this integrated into the app later this weekend.

Thanks !
[Spirit FM] mikereidis:
Yes, I suspect it's related to the app.

If you use the app power button, and turn the FM off. Does the problem still happen ?

And you're using a GT540 running CM7 ? The unofficial port by MUR4IK ?
[Spirit FM] Quinny899:
It still makes a noise, a different, quieter one this time. It may just be normal, the quieter one. Yes, I am using Mur4ik's CM7
[Spirit FM] 4silvertooth:
I confirm working it in India with RDS the signal strength was just one tower. Selected India as regional band. Only one channel had RDS I am gonna call other channels and ask if they are transmitting rds.

LGP500 Mik cm7.
[Spirit FM] mikereidis:
Great ! Thank you. Around here most stations reduce power at 1 AM and I can't get any useful RDS for testing, except CBC which doesn't change RDS data.

I usually need 2 bars of strength for RDS at least, and the antenna situated for best audio. And even then the logs show lots of errors.
[Spirit FM] mikereidis:
[B]FM Without BT and Audio Issues[/B]

FM Without BT and Audio Issues

I'm happy to report that since yesterday I've been able to communicate directly with the HCI UART, with BT off. I'm hoping this will help resolve issues with proprietary BT stacks, but for now it's only going to work if you don't need BT.

This will require root, and I'm only doing this for Broadcom chips to start. The work-around is a replacement for brcm_patchram_plus, which is the Broadcom alternative to hciattach.

As a plus, it should reduce power consumption since the BT RF stuff won't be on.

I hope to release this in experimental form later this weekend or early next week.

I will also try to release work-arounds for the no sound issue on ROMs which don't support FM audio routing. Unfortunately this might not work on all ROMs, even if the audio chipset is supported. My P500 and Legend have the same audio chipset, but the fix that works on the Legend won't work on the P500 with mik_os CM because the driver seems to be permanently "in use" by the ROM.

LG P500 / Optimus One:

- I'll have to withdraw my nomination of this phone as wonderful. Bad, painful flash attempts, tight batteries, screwdriver prying and sparks, LOL. Still running though.
[Spirit FM] 4silvertooth:
What's PI 61440.
[Spirit FM] rollon76:
Nice work, Mike.

Where we can download the version without BT, on market?
[Spirit FM] Victorino86:
Using a UK Desire Z, with CM7 Nightly 68 o 69 (not sure :p but is Android 2.3.4). Italy band: 87.5 MHz - 108.0 MHz , 50KHz steps.

"full" RDS working from 2 bars on, Scan is working too (goes on the next 2 or 3 bars station)
[Spirit FM] mikereidis:
That is the RDS Program Identification. It is supposed to uniquely identify the station, at least within your continent or country.

There are some databases on the net that may be able to give more information about a specific PI / PID. I might be able to have my app tap into them at some point.

In the US PIDs can usually be mapped directly to callsigns.
[Spirit FM] mikereidis:
I will announce here when the market version has been updated.

I may have to distribute other files needed for this seperately, so just updating the Market version may not be sufficient for this capability.
[Spirit FM] mikereidis:
Wonderful ! Thank you.

I'm concerned that this fix for my LG Optimus One/P500 might break seeking on other phones, so I'll have to create a configuration option for this.
[Spirit FM] 4silvertooth:
I have just marked one thing the higher the frequency the weaker the quality, like all station near 91mhz station are more clear than 101 MHz.
[Spirit FM] CR5N:
Seek doesn't work on HD2 (nexus one) rom. Just keeps going...
[Spirit FM] mikereidis:
OK, thanks ! That's very useful info. I suspect it may be broken on more Broadcom phones than are working. Would be nice if I could relate this to revision level or similar, but I will likely make this fix the default.
[Spirit FM] mikereidis:
Can I presume you don't see this with "normal" FM radios ? I don't recall if you have another FM app to test against.

If so, this would likely be a hardware issue, or perhaps related to the length of the "antenna". At 100 MHz a "half-wave" antenna would be 1.5 metres, and a 1/4 wave 75 centimetres.
[Spirit FM] mikereidis:
I tried set_fmtx_antenna() on my HTC Legend with a few different values for a single integer parameter.

They "worked" but I was never able to detect a carrier being transmitted from the TI FM chip, after I set the Tx registers properly AFAIK.

I'm sure dlopen would have worked, but I just used the library itself (or an archive?) to link statically against.

This code was never released. If it had been I would have used dlopen, but AFAICT just about every Android phone with Bluetooth has libbluedroid.
[Spirit FM] sir_earl:
Hmmm - calling bt_enable in libbluedroid.so results in the btld daemon starting, followed by screens of logcat output errors, followed by the device rebooting - presumably because some other initialization code is necessary. I think this is very similar to when I just start the btld daemon manually.

Regardless, btld seems to only spell trouble for access to bluez, or perhaps more likely the hci0 interface. When starting bluetooth normally on HTC or Samsung devices, the hciconfig utility doesn't even see the interface. Do you have any idea why that might be, or how the hci interface becomes available normally? (I understand you probably haven't done much with it given that you talk directly to the UART, but thought it might be worth asking).
[Spirit FM] mikereidis:
Gee, other than this, it's quiet here. Everybody Christmas shopping ? :)

You can find source code all over for brcm_patchram_plus.c.

At the end of main() there is this:

if (enable_hci) {

proc_enable_hci();

while (1) {

sleep(UINT_MAX);

}

}

So after proc_enable_hci(), patchram just sits in a sleep loop.

And:

proc_enable_hci()

{

int i = N_HCI;

int proto = HCI_UART_H4;

if (ioctl(uart_fd, TIOCSETD, &i) < 0) {

fprintf(stderr, "Can't set line discipline\n");

return;

}

if (ioctl(uart_fd, HCIUARTSETPROTO, proto) < 0) {

fprintf(stderr, "Can't set hci protocol\n");

return;

}

fprintf(stderr, "Done setting line discpline\n");

return;

}

I think that last ioctl tells the kernel/HCI UART driver that this is an HCI UART, and somehow this ends up completing the chain. I think hciattach does the same for TI chips, or for the Bluez stack on any chip.

Bluetooth is a strange mix of kernel and userspace code I haven't fully figured out, and the Bluez BT stack is very little documented AFAICT, despite being widely used and open source.

BTW, there is often a bttest (or bt_test?) utility that can do bt_enable() for you, if I recall. It can turn BT on at the Linux level, but then Android doesn't know BT is on.

That's all I can think of now that might help.
[Spirit FM] Tirofog:
Spirit on HTC Desire S

HI Mike, I got your free app but when I open the radio I get the message 'Error: no FM accessible Fm:BC Sh:1 Su:0 Bt:1 Ht:0 H2:0 Mo:BCU' (antenna connected).

I am willing to purchase the unlock feature if the radio would work or is this a more fundamental issue?

Thanks, Ash
[Spirit FM] mikereidis:
Hi,

Su:0 means your phone is not rooted or you haven't given the app SU/root privilege. My app often needs root, but not always.

Bt:1 means Bluetooth is on. This, with Mo:BCU usually means your device is stock and runs the Broadcom proprietary BT stack.

If you can root your phone and give my app SU it will probably work, with Bluetooth off at least.

Beyond that, I hope to eventually support the proprietary BT stack.
[Spirit FM] mikereidis:
Please don't PM me if your issue can be discussed here.

From PM:

The easiest is just to root the phone. I don't think you need a custom ROM, but you can do that later if you want.

This seems to be a good rooting guide for Desire: http://theunlockr.com/2010/09/20/how-to-root-the-htc-desire-unrevoked-method/

Read a few of the comments to see what problems some others have had.

There's a HUGE population of Desire owners so there's a lot of help available if you have any problems.

For (1), have the FM working and go to Menu->Settings->Audio->Method and select HTC. If you hear sound go to speaker and headset, you should be set.

If that doesn't work, try the methods at bottom: qsd8250 or qdsp5v2.

For (2), I think that setting Settings->Debug->Silent Loop should fix it.

There's an on screen volume control below the frequency graphic, if the hardware buttons don't work. Also, the unlocked app can use media buttons or lockscreen controls to adjust volume.
[Spirit FM] nonoheran:
hi all !!

great work ... so ... is anybody can tel me what is the chipset on assus transformer ? so .. is this app ( Can )work on it ?
[Spirit FM] mikereidis:
I will never understand why people won't just download it and try and let ME know... :)

It's free and only takes a minute or so. Report the line starting with "FM: ".
[Spirit FM] mikereidis:
From email:

I can't help with Streak radio problems.

If you mean my app, Spirit FM radio, the most likely cause is you are running a cracked version of my app. There's a tiny chance you got a debug version, but the cure is the same.

I advise removing the cracked/debug version, installing my latest free market version, and if it's working OK purchase the unlocker.

I accept Paypal and will even haggle if you insist. :)
[Spirit FM] qwerty12:
Hi,

When running the Nov 30 version of Spirit FM Radio on my Huawei U8800pro, after allowing it root access, it causes my phone to lock up and reboot. If I deny it root access, Spirit FM Radio starts, turns on my Bluetooth but says there's no FM accessible (Fm: SL Sh:1 Su:0 Bt:1 Ht:1 H2:0 Mo:SLS). The locking up and the FM not being accessible still occur even when I set the audio method to HuaweiTavarua. I'm using the stock ROM (Chinese), which does have a working FM radio application bundled with it (and which doesn't turn on the Bluetooth, FWIW). I would've liked to have given you a dmesg & logcat, but it's kinda hard to do so when the phone freezes...

If you're interested, I'd be happy to (try) and supply you with whatever you need.
[Spirit FM] esilviu:
Spirit_FM_Radio_v110930.apk (with audio mode All) and Spirit_FM_Radio_v111006.apk (with audio mode Cyanogenmod) are working with Samsung Galaxy Gio (S5660), on Cyanogenmod RC3.

The actual one from market doesn't properly start at all.

Just reporting
[Spirit FM] cdricm:
The volume control is now ok ! But when i leave spirit fm i have to kill your app (i use advanced task killer) because it still run in background and If i don't kill before restart it, the setup for volume control don't take effect. If you have a solution to solve this problem i will be very happy !

The switch between headphone and speaker don't work with the other qsd8250 or qdsp5v2.

I have buy spirit fm unlock. I like very much your app !

You say that you have an experimental option to use spirit fm with Bluetooth headphones. Can you

give me the way to do that.

Regards.
[Spirit FM] mikereidis:
Thanks for your report.

If you have adb installed on a PC connected to the phone with USB, then it's easier to run logcat and "cat /proc/kmsg" (instead of dmesg), via the PC, and when the phone freezes or reboots, the collection is done, but you still have the files.

Example: "adb shell logcat > logcat.txt"

There's also at least one good logcat app on the market; I'm not sure if it will write to "disk" often enough to catch enough detail.

I heard that the Huawei U8800pro does not use Qualcomm Tavarua, but that it uses the Broadcom FM chip. Perhaps that's wrong ?

"Mo:SLS" means the app detect a Silicon Labs chip using the Samsung driver, and I suspect that is wrong. In such cases you can force the FM chip type in Settings->Debug->FM Chip. Try "V4L" to start and if that doesn't work try "Broadcom".

Until we get a better startup, perhaps it's best to set Audio Method to the default CyanogenMod, or the last option: "None".
[Spirit FM] mikereidis:
Just reporting ? Or can you help by running some tests ?

This is a known problem, but at least one person (denzel09) with an s5660 doesn't have the problem. The very similar i5500 doesn't have the problem either, mine or others; It's my closest test device.

The only way the problem will get fixed is if I can find out exactly which version stopped working, but it's possible this is different for different people.

This post here has all versions from Sept 26 - Oct 6: http://xdaforums.com/showpost.php?p=19790990&postcount=1755

This post has Oct 17 and 27: http://xdaforums.com/showpost.php?p=19837851&postcount=1766

This post has a little bit of info: http://xdaforums.com/showpost.php?p=19905606&postcount=1785
[Spirit FM] mikereidis:
Great ! (Re: your HTC desire rooted, with stock ROM.)

You say "I leave spirit fm i have to kill your app". Do you mean you press the power button ? If not, try that because the app is designed to work in the background.

You can also send my logs with Menu->Email Logs when you start a second time (without killing it) and have the problem, and I can try to find the problem.

For headphone and speaker switching, did you try the HTC audio method ?

The Bluetooth headset support is "phone call quality" so very bad sounding. It can be enabled with Settings->Debug->BCM BT Headset and then power down and up the FM. Your headset needs to be paired AND connected.
[Spirit FM] cdricm:
Yes ! I press the power button....and restart spirit radio.I have send you the logs....

For headphone and speaker switching, i have tried qsd8250, qdsp5v2 and HTC audio method.