yashsingh1/xdaforums huggingface dataset:
[Spirit FM] mikereidis:
I think "2 page marketing blurb" might be a better description for the "spec sheet" you describe.

Broadcom keeps their APIs and the chip info needed to program it as proprietary secrets. I've tried to get their info with no luck, I must work for one of their customers to get those documents and under NDA.

This is why reverse engineering is required. I don't know how much you know about reverse engineering, but it is VERY difficult and time consuming. It's not just about a bit of HW and Java knowledge; it includes Smali (reverse engineered Android Java), C/C++, assembly language sometimes, and the patience to seek out obscure sources and do experiments.

Unfortunately, much of what I say about low level details is to some extent guessing, based on experiments, intuition/common sense and what little info I've been able to find.

But I think the transmit antenna is a separate pin on these FM/combo chips. And my "educated guess" is that the pins are grounded, or the chips otherwise disabled for transmit via the PCB circuitry.

I think that makes business sense, as I believe that this makes FCC etc. certification easier, faster and less expensive. That's the best explanation I can think of since I'm sure that an FM transmit feature would sell more phones. Although I can't say if it would sell enough to be worth the cost of code, certification and the longer delay in getting product to a market where phone model sales lifetimes are now measured in months.

Transmit is actually one of my personally most interesting possibilities. I tried it on my TI chip based HTC Legend and couldn't detect any carrier, despite a few days spend fiddling with the registers. So I gave up.

I'd love to try it on Broadcom based devices, but even if I found I could make it work on one or a handful of phones, I don't think the time required would be worthwhile for the "benefits" I'd receive. Again, money.commercial concerns rears it's ugly head. :(

AFAIK, absolutely nobody has ever gotten FM transmit to work on a consumer Android device, besides a few Japan Sharp models. I will give whatever support I can to anyone who wishes to try.

I'd also love to get FM working on iPhones. Nobody has ever proved it is possible, AFAICT, despite years of rumors that continue to recent months. But IMO, if possible, it would require a jailbroken phone and Apple would never approve such an app,

But I only have so much time, and my project will die if I don't do everything I can to focus on the features most likely to allow it to continue (ie income.)

As it is now, I'm looking to get some contract work to keep things going. And when I'm doing that, I likely won't be able to do much on my own app. I'm not begging, just saying... :)
[Spirit FM] forza.stiinta:
After installing this on a Moto Defy, I cannot see and connect to any wireless network!!!! I unistalled it, still, nothing. No wifi networks are found, I cannot connect.

However, tethering works!

Please advise!
[Spirit FM] sapiokilias:
i have a ideos x5 if i buy the unlock version is possible to play good without reboots???
[Spirit FM] sharmy3:
Thank you Mike for responding.

Yes, I am a paid customer since I learned your app worked on my old HTC MyTouch 4G with CM7 on it. :) I gave that to my son when I got the HTC Sensation 4G. The app worked well on it using Mike1986's ARHD v3.8.6. I gave that to my wife when I got the HTC Amaze 4G last Friday. :)

It was obvious that I was very tired last night and I overlooked that small detail when copying the info off of the phone. :)

Error: No FM accessible

Fm:TI Sh:1 Su:1 Bt:1 Ht:0 H2:0 Mo:TIU

I am using Mike1986's ARHD v1.1.0 on it and yes, the FM radio works using its stock FM app.

Thanks again for your excellent work!

---Sharmy
[Spirit FM] mikereidis:
Hi.

That is REALLY weird. I've never even heard a hint of a problem like this in the last 10 months I've had an FM app out.

There is nothing in my code that I can imagine would cause any such problem under normal circumstances. My app doesn't touch or even read any system settings.

Removing my app should make no difference, but was certainly worth a try.

The TI chip used for FM is a combination chip that also supports WiFi and Bluetooth. The Bluetooth and FM share a "command path" but the WiFi has it's own command path.

I guess there is a hypothetical possibility that additional heat or whatever from the FM section of the chip could impact other parts of the chip, but I've never heard of such a thing and my app pretty much does what the stock apps do, except perhaps processing more RDS data and RSSI data.

What ROM are you running, and if stock is it rooted ? Was or is my app working otherwise ? Is there a stock or ROM FM app that works ? Can you tell if Bluetooth is working OK ?

I would be very interested in seeing your logs to see if there is any useful information. You could install a logcat app, collect the logs and send them to me, or run my app and select Menu->Help->EM Logs.

Thanks !
[Spirit FM] mikereidis:
Hi, as I emailed:

Sorry no, the Ideos support is very "experimental".

There should be virtually no difference in "quality" or phone support between the free and pay versions. The free version is more than sufficient for compatibility testing.

That said, I don't have one of these phones and consider it a "minor miracle" that I got them working as well as I have without a real device.

And I don't have a budget to buy one of these phones, so I'm not sure it will ever get beyond experimental.

Just an unfortunate reality, but a strong enough show of support from the "Ideos Community" might change my mind...
[Spirit FM] E:V:A:
Yes, Broadcom is really getting on every single developers nerves! It's just incredible to see how it is possible that essentially every single persons main communication device, contains some BCM product, but there is essentially none whatsoever information about their hardware, that is publicly available. I can't think other than that they are hiding something (!). I was working on some OpenWRT stuff and Broadcom was ALWAYS the problem, everything from Hardware to the firmware. Impossible to even get a pin-out schematic of their most popular wifi-router-chips. WTF! And for all those people who works for BCM, how can they just sit quiet on all this stuff for so long? (Management by fear?)
[Spirit FM] mikereidis:
Great ! October 5 I see. :)

I think many people haven't thought about the advantage of a multiple API FM app going forward. When you switch phones, hopefully the app will still be valuable to you.

And the standard Android license covers all phones running under the same Android Market account/default email address. And since it's not too hard to find hacked copies of my app, and I thus depend on honesty and good will, I will tend to look the other way if someone honest enough to buy a license bends the rules a bit.

That's not necessarily directed at you, but since you mentioned multiple phones and I've been meaning to bring this up, I took the opportunity.

-----

Can you send me logs with Menu->Email Logs ? (Or Menu->Help->EM Logs.) That saves the typing and gives me a lot more info.

I will see if I can try to add support for HTC TI based devices within the next month. Basic support might be possible to test in the next week or so if you'd like to try.

I was just reading about the HTC Amaze (codename Ruby) and see it apparently has a TI WL1283. This should be pretty much backward compatible with the older 1271 and 1273 chips. Since HTC is releasing new devices using TI chips, HTC TI support becomes more important to me again.

I've been hearing some good things about the Android Revolution ROMs. My guess is that it uses the HTC proprietary Bluetooth/FM stack and the FM app is the same proprietary HTC FM app found on the stock HTC ROM.

I'm curious, does the HTC FM app look better than previous versions ? The ones I've seen have a little bit of support for RDS, but not much. I'll have to download the ROM and poke around a bit.
[Spirit FM] mikereidis:
For anyone interested in FM transmit possibilities, I just re-stumbled upon this thread: http://xdaforums.com/showthread.php?t=1001117

The quick summary: I think nobody has ever been able to achieve FM transmit on consumer Android devices besides those Japan Sharp models designed for FM TX.

For the more detailed summary skip to the last page of that thread where I made several posts.
[Spirit FM] sharmy3:
Thanks for bringing it up. :) Your app stays with me within my Android Market account. My son and wife doesn't have your app on their phones because they have their own Google / Android Market accounts. My wife is deaf and doesn't use it. :) My son uses Pandora all the time.

Sure, I can work with you and test whatever you want me to do.

The Stock FM App on both the Sensation and Amaze looks almost identical. I can't remember about the MyTouch 4G because I rooted it the same day I got it and put on CM7. CM got me hooked when I had Nexus One back in the day :)

I will get back on the phone and run your FM app again and send off the logs to you. :)

Thanks Mike!

---Sharmy
[Spirit FM] korenisko:
Bought your great app :-) All is working at 1*

Only one problem with text color in notification bar. I have black background and black text...
[Spirit FM] mikereidis:
Yeah, I noticed this on my ICS ROM for Galaxy S.

I will try to create an option for this. I don't think it's possible to fix this without an option.
[Spirit FM] mikereidis:
Thanks for the log. According to it, the HTC Amaze has one of the newer BCM 4330 FM/combination chips. I'm not sure why yet, but my code is detecting a TI chip, which is wrong.

So first, go into Settings->Debug and set "FM Chip" to "Broadcom". In the same debug settings screen enable "BC 20780/4330".

Now, make sure Bluetooth is off and restart the app. Hopefully it will work at this point, although there may be no audio.

If it doesn't work, try rebooting the phone.

You may also be able to use the experimental Broadcom proprietary support. Enable Debug->BC Proprietary and restart the app. If that doesn't work try "HTC BC Proprietary" and restart.

Hopefully one of the above will work and we can try different Audio Methods if there is no sound.
[Spirit FM] sharmy3:
Ok, Done.

I restarted the app. It turned on the Bluetooth for about 10 seconds then turned off. Right after that, it came up with the error message saying "No FM accessible" along with the same codes I posted earlier. :(

I did that and got same result.

I did that and I noticed under Broadcom Proprietary - there's a list of stuff with buttons next to them. Do I need to select something? Or leave it unselected?

I restarted the app and rebooted the phone. Got same results on both methods. :( What should we do next?

---Sharmy
[Spirit FM] mikereidis:
I made it confusing, sorry. There are debug FUNCTIONS and there are debug SETTINGS.

Functions are accessed with the Debug button or with Menu->Debug.

Settings are accessed with Menu->Settings->Debug.

So go to Menu->Settings->Debug->BC Proprietary and enable the checkbox and restart the app.

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

For the normal mode with BC Proprietary disabled (UN-checked), the biggest problem we face is that my app isn't getting SU/root privilege.

Usually aftermarket ROMs like ARHD have SuperUser.apk package under /system/app and a utility at /usr/bin/su . The log you sent shows neither, and I can see my app doesn't have SU.

As a workaround, you can run a command that changes permissions on the Broadcom HCI/Bluetooth UART, from "adb shell" on a connected PC, or a terminal emulator app.

Assuming you have SU privilege, you can run the following, preceded by "adb shell" on a connected PC:

chmod 666 /dev/ttyO1

NOTE: The device name is "tty" followed by an upper case "O" (15th letter of the alphabet) followed by a "1" (one). If in doubt just do:

chmod 666 /dev/tty*

Then verify with:

ls -l /dev/ttyO1

and you should see the response for ttyO1 start with "crw-rw-rw-". You can't use the asterisk trick if you are running from a Linux PC unless you do something like:

adb shell "chmod 666 /dev/tty*"

adb shell "ls -l /dev/tty*"

At this point, ensure Bluetooth is off, and restart the app. I REALLY think it should work at this point, but I haven't gotten confirmation yet on a BCM 4330 device, except for Galaxy Nexus which doesn't support FM, likely due to lack of needed antenna connection.
[Spirit FM] sharmy3:
I did that and got the same error msg result.

Ok, I connected my phone to the laptop and used the ADB thing. Let me copy and paste the results on what I got on my end so you can see what is going on.

-----------

C:\Program Files (x86)\Android\android-sdk\platform-tools>adb shell

# su

su

# chmod 666 /dev/ttyO1

chmod 666 /dev/ttyO1

Unable to chmod /dev/ttyO1: No such file or directory

Looks like I don't have TTYO1 there so I wanted to see whats available:

# ls -l /dev/tty*

ls -l /dev/tty*

crw-rw-rw- root root 5, 0 2011-12-27 15:35 tty

crw------- bluetooth bluetooth 238, 0 2011-12-27 19:18 ttyHS0

crw------- root root 234, 1 2011-12-27 15:35 ttyHSL1

crw------- root root 234, 3 2011-12-27 15:35 ttyHSL3

crw------- system system 233, 0 2011-12-27 15:35 ttyHSUSB0

crw------- root root 233, 1 2011-12-27 15:35 ttyHSUSB1

crw------- root root 233, 2 2011-12-27 15:35 ttyHSUSB2

I went ahead and did this command:

# chmod 666 /dev/tty*

chmod 666 /dev/tty*

#

# ls -l /dev/tty*

ls -l /dev/tty*

crw-rw-rw- root root 5, 0 2011-12-27 15:35 tty

crw-rw-rw- bluetooth bluetooth 238, 0 2011-12-27 19:22 ttyHS0

crw-rw-rw- root root 234, 1 2011-12-27 15:35 ttyHSL1

crw-rw-rw- root root 234, 3 2011-12-27 15:35 ttyHSL3

crw-rw-rw- system system 233, 0 2011-12-27 15:35 ttyHSUSB0

crw-rw-rw- root root 233, 1 2011-12-27 15:35 ttyHSUSB1

crw-rw-rw- root root 233, 2 2011-12-27 15:35 ttyHSUSB2

#

Now read and write permissions are granted to these.

Then I tried the app again. Same results. Even with Debug/BC Proprietary or Debug/HTC BC Proprietary switches.

Does it means that the app isn't working because TTYO1 is missing?

---Sharmy
[Spirit FM] mikereidis:
No. Sorry, I mixed up your log with someone else's log.

You definitely have a TI FM/combination chip.

Maybe later tonight I can get something basic working on my HTC Legend and we can see if that works for you too.
[Spirit FM] sharmy3:
Oh ok.

---Sharmy
[Spirit FM] E:V:A:
Regarding Transmission.

If we are to believe anything that Broadcom produces, we should start with their block-diagram. There it clearly shows the FM device connection to both the Wifi and Bluetooth parts. This would make sense, since Wifi/BT channels need to be non-overlapping, and most likely the FM HW is controlled through the BT stack. (And if I recall right, I've seen other FM related code all contained within the BT code.) Also most of the I2S and I2C controls are directly connected to the BT block, and not to the Wifi block. In addition the diagram clearly shows ONE antenna connected, although the antenna is "outlined". Just like in any other transceiver, there is no reason to have a separate antenna for transmission and reception, it's all handled in the hardware.

Now for some hand-waving speculation. Broadcom developers are just as lazy as any other developers. This generally mean, that they would try to recycle code that is already produced and working for other devices, on their new ones. In fact, given their fast releases and quantities of "new" devices (chips), they'd simply HAVE to recycle the majority of the code they produce. Something that has been repeatedly seen in their wifi drivers. So if you do find anything related to FM transmission in any of their code base, it is quite likely it will be present in the new one, with slight modifications.

Finally, if people are able to reverse engineer both Skype, various wifi drivers and advanced viruses/malware, on a daily basis, I don't see why "someone" shouldn't be able to do the same with these drivers...
[Spirit FM] mikereidis:
Good news is I confirmed this API works on my HTC Legend on a stock derived ROM (blayo8.4) with the proprietary HTC/TI stack that works with the stock HTC FM app.

"Bad news" is it's not yet fit for testing, so will take at least another night.

Realistically though, I think this is pretty darn good progress for Christmas week. :)
[Spirit FM] haimn:
Hi, I have samsung galaxy mini (gt-S5570) with CM7, and I use your "spirit radio", It works well, but I keep hearing static noises (like SSSSSSSS) in the background even when the signal is good (and I hear the radio station).

(I did this: Use Settings -> Debug -> BCM 20780 and reboot)

I'm sorry for my English...

Thanks!
[Spirit FM] tufeijoe:
Hi Mike,

I post the question here.

My phone uses MSM7625+BCM4329.

1. I checked CM7 FM.apk source. I don't have /dev/radio0 but I have /dev/ttyHS0.

2. I checked java/jni part of CM7. Hci cmd to get/set native frequency works.

3. I checked libaudio which can switch to headset.

But, I cannot hear anything in the headset.

My question is where is the issue?

In my mind, the flow (my guess as I have no any reference info) should be UART/i2c to control FM device (through hci); then FM chip will output the PCM data into XXX device (what's the XXX device? And is it analog or digit?), then CM7 FM.apk will or has previously already route to Headset (I saw libaudio works).
[Spirit FM] mikereidis:
Let it be known that I DO continue to assist in open source (even if my own source is still closed for now), and that I prefer to discuss such issues publicly.

Summarised from PMs from tufeijoe who is working on a CM port for Huawei C8500S:

If you can seek only 2 channels then I'd guess the "big background noise" is RF static. My bet is that there is an antenna switch somewhere that needs to be set in software.

I have the same problem with the Droid X and have no solution yet, other than to use the Motorola proprietary libraries for FM (and I don't yet.) It might be part of the "H2W" (?) or

could be something proprietary. Reverse engineering the stock FM app, or even just examining the logs with the stock app may reveal the answer.

/dev/radio0 is only for V4L drivers, but CM "misuses" it as an alternative to /dev/fmradio with the Samsung proprietary Silicon Labs driver. Anyway, ignore it, it's not for the BCM4329 unless

you have a rare device that uses that rare V4L driver.

Yes, the BCM4329 can be controlled via Bluetooth HCI sockets (in CM usually via hcitool), or via /dev/ttyHS0. My app has a special "UART" mode that can be used with Bluetooth off.

It writes directly to the BT UART. I did this so my app can work on stock or stock derived devices with the Broadcom proprietary BT stack, which doesn't support hcitool or Bluez compatible HCI sockets.

I don't know what /dev/ttySrvChn0 is; I haven't seen it before.

The audio is a different issue than the FM programming. Usually it's analog and some snd_set_device() call or ioctl or similar can be sent to an audio driver.

The CM FM app uses setForceUse() and setDeviceConnectionState() and the ROM audioSystem library has to implement these. Generally these enable analog audio paths for FM to the speaker or headset.

These analog paths bypass most of the normal DSP processing, so recording or equalization etc, usually doesn't work. So usually there is no digital audio.

Some newer and/or more expensive phones can support digital FM audio, either direct, or via A->D conversion of the analog. My Galaxy S for example, has hardware that can digitize the FM, but I've never tried it, nor do I know if the software of stock or CM etc. ROMs will allow it.
[Spirit FM] mikereidis:
CM7 FM app uses hcitool, last I looked, which eventually goes to /dev/ttyHS0 via the Bluez BT stack.

The Broadcom chips have I2C ports dedicated to FM but very few devices connect them; Dell Streak is one. In most cases HCI/UART is used.

Some devices (newer and/or more expensive) can use the I2S for FM to send digital data. Most don't connect the pins and only support analog. I doubt Huawei supports digital FM unless you know otherwise. Hmm, on second thought I believe the Ideos X5 and/or X6 use digital audio, but that's with a Silicon Labs FM chip via V4L. Regardless, most phones support analog even if they also support digital.

Is my app switching headset and speaker for you ? I would guess not if you are using the default "CyanogenMod" method set in Settings->Audio->Method.

You can try each of the Audio Methods in sequence, while tuned to a good station, to see if one switches audio properly. You can stay in that Settings screen while testing.

I don't think I've gotten a log from you. I can help better if you send one with Menu->Help->EM Logs.

If you have /dev/msm_audio_dev_ctrl you can try qdsp5v2, for /dev/msm_snd try the msm7x30 methods, for /dev/msm_audio_ctl try qsd8250. If ALSA switches it, you may have to examine the controls.
[Spirit FM] mikereidis:
Hi. This is a known problem. I have the same on my i5500m.

For a hardware fix, I believe you can use a headset with a volume control, crank it down, and raise the volume in the FM app to maximum.

The audio amp for FM needs to have it's gain lowered. There are some audio driver functions for that, but the CM7 mediaserver on these devices keeps the audio driver open, so my app can't send those commands. It's possible there is some other way to do this, but I don't have time to investigate now.

So a software fix needs to come from the ROM dev, and AFAIK, FM audio enabling was one of the last things tjstyle did, and I think he did it blind, without a device, and won't be doing more updates.

And I don't think psyke83 will be fixing this for my i5500 either.

I think the best bet is to hope someone will make a ROM for ICS and we can ask them to include this function.
[Spirit FM] haimn:
Thanks! Here is port for galaxy mini for ICS (CM9) but the radio there don't work... http://xdaforums.com/showthread.php?t=1390423
[Spirit FM] sharmy3:
Awesome!

Ok, cool!

Yep. :)

---Sharmy
[Spirit FM] Quinny899:
You think you could do anything with my tablet?

Archos 80 G9
[Spirit FM] mikereidis:
Probably just need audio support.

http://xdaforums.com/showpost.php?p=20785572&postcount=357
[Spirit FM] mikereidis:
Probably not. No stock FM app, right ? Some of the older/smaller Archos devices support FM.

Search this thread for Archos and there are several posts for other models and not one success story yet.

Do you get any indication it might work, such as seek working or RSSI going up on known station frequencies ?

Send me a log...
[Spirit FM] Quinny899:
No stock. Just a thought. Sending logs now
[Spirit FM] mikereidis:
Thanks for the log.

My app sees a TI chip and more or less works it appears.

But RSSI is always exactly 0. If you had earphones plugged in during the test, then I think there is no antenna connection.

One person with a cheap Chinese tablet successfully soldered to a well marked FM Rx antenna point on the PCB and we saw good RSSIs. It's possible there is something like this in the Archos. (Sadly audio never worked in that case.)

It's interesting that the ALSA audio driver reports several settings for FM audio, but I've seen these "vestigial" settings before on related devices that support FM. But just being there provides some hope that audio connections might be there.