Shared publicly  - 
 
FM Support for CM 9, 10.0 and 10.1

+Jerpelea Alin, along with +Giulio Cervera have submitted a bevy of commits that have just been merged. Theoretically, this means that FM support (using a headset as the antennae) should work on devices with Qcom/Broadcom wifi chips that have FM. Currently, Sony devices with these specs are confirmed functional. 

Note This has been tested on a handful of devices, however final support for your device will be up to compatibility of the chips, kernel and for the maintainer to enable. Currently, 8960 devices are showing some issues. 

Much of this comes from working with the folks at Sony and they are looking to push this support upstream to AOSP as well. 

Merged: http://review.cyanogenmod.org/#/q/owner:Jerpelea+status:merged+message:FM,n,z

Pending Review: http://review.cyanogenmod.org/#/q/owner:Jerpelea+status:open+message:FM,n,z
451
40
Andrew Wyman's profile photoStephen Ting's profile photoFredrik Holmberg's profile photoThiago Maia de Rezende's profile photo
96 comments
 
Gonna have to buy the Xperia Z now...
 
Woohoo that's!-.... Wait. Who cares? I guess my grandparents might...
 
Samsung can learn a thing or two from Sony's support for the devs
 
Look up which wifi chipset your phone has. If it's a Qcom or Broadcom, this might work. If it doesn't, it will not work.
 
+Lazarus Xavier while I don't use FM radio, this is one of the final steps towards getting a fully functional CM10 ROM. Besides it's good news to hear this will be merged into AOSP - we still have hope that an AOSP ROM will see the light of day for Xperia S.
 
Now I just need a method for cracking bootloader in my locked Xperia T
 
Support for the silicon labs chipset (Samsung devices)? Also thanks at Sony guys!! 
 
...I'm still trying to install cm10 -____-
 
Hope GS3 will soon be supported... and I can say good bye to Touchwiz
Ryan R.
+
1
2
1
 
FreeXperiaProject(FXP) rocks!
Hats off to the brilliant team.:)
 
Anyone know what Wifi chipset the Galaxy Nexus LTE (Toro) uses?
 
Maybe Samsung could learn something from the proper support that Sony is providing the CyanogenMod Team!
The substitute for my SGS2 is probably the Sony Xperia Z :-)
 
+Jacek Mrózek you can unlock the bootloader via Sony. They have a dedicated website for that. I unlocked my Xperia Arc via Sony.
 
Congrats on launching the cyanogen look on to your new Blackberry z10 phones. Congrats......ok ok they copied!
 
One more reason to think about sony as my next phone. 
 
I don't really like Sony's current phones, but kudos to the Sony devs for contributing. However, they'll have to release a phone I actually like before I'll buy one. Just supporting them by buying one for their contributions doesn't make sense if I don't actually like the phone itself. But maybe someday...
 
Great! I saw this in the changelog and look forward to trying it out. When I'm working on Saturday mornings I hate missing "This American Life." So, how do I know if my device supports this? I have a  Nexus 7 and Samsung Epic 4g running CM roms. Also, how to utilize need to download a tuner app? Any recommendations?
 
Awesome that you guys finally started supporting it though too late for me since I've shifted to the #nexus4! 
 
heres hoping it works on the lg p970 
 
would be nice for a cyanogenmod official for droid razr and razr maxx. 
 
I would totally do penny from the big bang theory :-D 
 
+Bhaskar Ramaiah +Andrew Wyman +Thiago Maia de Rezende
You guys are hilarious..... While Sony is trying' their trying is basically a meh! at best.
Guess you guys forgot Samsung gave S2 to CyanogenMod team while back so they can work their wonders.
Samsung is still the most open and easiest to mod.
 
+Atif Sheikh Samsung are all talk when it comes to supporting the development community, especially with Exynos devices. They release kernel source, but it's full of binary modules that don't work nicely with newer Android versions. They do have a public repository with some of the necessary source, but it seems to target some reference board that's quite different to any of the Exynos phones released so far. Not only that but parts of the code are hacked together or just plain broken.

Unless Samsung do much, much better with the Galaxy S4, there may not be many devs willing to work with it. The current CM Exynos devs are going half insane right now trying to the phones into a state that could warrant a "stable" CM release.
 
+İlker Eryılmaz my bootloader is not unlockable (due to operators lock - +Orange Polska infact) so need to wait if someone finally crack it. It's the only operator in Poland which locks bootloader in Sony's devices - wish I'd knew that before signing contract. :-(
 
my phone will be perfect when Bluetooth Low energy will be supported
 
"Much of this comes from working with the folks at Sony" <-- +1 for this part !
 
So exciting! I love it. how can I get APP?
 
fm will work on xperia u + cm9,cm10 ?
 
waiting for working on Nexus 4.
 
That's awesome. Thanks a lot. 
 
There's something I can do to help spread the support for fm radio in other devices like p990?
 
hey dude i am getting +CyanogenMod Nightly updates it would be nice for noobs like me know know what do we get in the updates and what bugs or improvement has been made it would be much appreciated thanks.  
 
+Volvic Ice in the update screen, there is a changelog that appears when you select a build. 
 
+CyanogenMod is that in ROM manager that's where I do my update from and one more thing sometimes I get 2 updates in one day don't get me wrong I love it but why does this happen? I am great fan of Cyabogen cannot ask for more hehehe or maybe I can lol keep up the hard work and thanks 
 
+Atif Sheikh At this point I think every manufacturer but HTC has donated devices to various CM maintainers (maybe they have too?  I know LG and Sony have).  Samsung is the only one that gave zero followon technical assistance or support, and then began working against developers by throwing grenades in our faces without warning like I9100 XWLPM.  The only thing special about Samsung's donation is that it was highly publicized - but that's what it was, nothing but a PR stunt.

Samsung showed their true colors with their handling of the Superbrick fiasco.  Every step of that mess was PR releases claiming they cared, but in terms of action, there was either no action or actions detrimental to the community.

As to Si4709 FM support for Samsungs - the infrastructure is there in theory.  As to whether anyone has the time or motivation to glue it all together by writing a new HAL for the functionality, who knows.
 
+Andrew Dodd Shouldn't ST-Ericsson be credited in this post too? They are the ones who wrote the FM framework we use.
 
+Björn Lundén Yeah.  I'm slightly confused...  It's called STE_FM, however, most of the devices supported are using Broadcom FM?  Don't know, you'd have to ask Kali and Jerpelea.

I have yet to find source for an example HAL - all of the existing HALs that implement the fmradio.h interface are blobs.  Not a huge deal other than at least one example HAL should exist.  e.g. which callbacks are required?  Which are optional?
 
I'm the dev of the Spirit FM radio app for custom ROMs and I'm very happy to hear this news. See my XDA thread for a free version and lots more info.

Spirit currently supports this API, and Spirit2 currently in development is based on this API alone. I've built an FM plugin for Samsung si470x FM chip devices like GS / GS2 / GS3 etc. I expect to release a free Spirit2 alpha soon with RDS support.

I don't care so much about "competition" for my paid / donor apps because I want to see a better "eco-system". There aren't enough hours in the day for me to continue writing every piece of low level code myself, and the proper place for low level audio code is in the audio libraries. More than 50% of my work is related to audio problems / conflicts, and I'll be very happy to be able to concentrate more on features and UI than low level headaches.

Thanks ! :)
 
+Mike Reid Good to hear.  I'm eventually going to try and write an Si470x HAL using this new API for N7000 including fixing up anything that may be missing in the Yamahell audio HAL, but you might beat me to it.  :)
 
+Andrew Dodd Yeah, I'm afraid I beat you to it, including the difficult task of cleaning up the RDS data to prevent lots of strange characters and funny looking RDS updates. AF might even work. :)

libfmradio.ssl_rx.so http://d-h.st/81l

ssl stands for "Samsung Silicon Labs", since it uses the non V4L Samsung specific driver for Silicon Labs si470x FM chips. I'm not sure I'll open source it though...

Don't forget the FM recording support in the audio libraries. GS2 and GS3 & Notes support FM recording, and even the old GS can be convinced to do so at the WM8994 register level.
 
Sony please be making the next nexus! Be a day one buy for me
 
+Atif Sheikh Samsung? Open? Dude, don't U follow Codeworrx or Andrew Dodd ? Do it and U will see their opinion towards Samsungs openness
 
+Jose M. Villar
No I don't follow them' though I do see codeworx time to time.
But thing is this post is blaming Samsung too much and praising Sony too much.
For an average user, he can get aosp / roms far easier on Samsung than anther brand, that's my point. Samsung still don't lock boot loaders while others ..... You know better.

 
+Pawit Pornkitprasan Yeah, I'm mainly looking for an example, any example, of an implementation of the new API to start from as a skeleton to put meat onto.  :)

Although I might just take a blob and feed it to ralekdev...
 
+Andrew Dodd
I found an ancient very basic driver for a CSR chip once I think. Went looking for it a few days ago and couldn't re-find.

So I just dove in and it didn't take too long. I had to figure out I needed a thread to do the callbacks though.

I posted the first alpha release of Spirit2 on my XDA thread early this AM. It's two APKs, one for the app UI and the other for a app level implementation of the API service and a general background service for FM and audio.

It's not "pretty" but there's a bunch of buttons to test various API functions. Feel free to use it for testing or poking around.
 
Guys the next nexus will be Motorola's , so don't panic
 
SO i can get FM radio on my Nexus4 using CM10? ... that would be awesome ;)
 
Don't see any fm option on my lg p990 Even thoug it should be merged acording to lavest bbq info
 
IMO, don't expect FM support on anything but a few Sony 2012-2013 devices anytime TOO soon

Now that the code is "merged" somebody needs to find or build FM plugins for the different FM chips. And modify the audio libraries as needed. And build an app or integrate whatever app Jerpelea has going.

IMO, don't expect that to be done anytime real soon, as these things are non-trivial and might take months at least. It would likely be faster to rebuild the CM7 FM app for JB.

AFAIK, the only existing pre-built FM plugins are from and for Sony devices. There's one for CG2900 chips, one for WCN3660 on Xperia T, and one that works with the Broadcom proprietary BT/FM stack, which doesn't exist on most CM ROMs and won't be integrated.

IMO any idea that a CM FM app is right around the corner for most non-Sony FreeXperia devices is mistaken. I haven't heard of any commitments, or signs of impending support. for CM FM on popular non-Sony devices yet.
 
Downloaded and installed Spirit2 alpha on my I9100. So far working fine. Looking forward to the final version. Thanks!
 
Using Spirit FM 2 on Galaxy S works quite good. One of my oldest desires was having my FM radio working on my GS, which was only possible with Stock Samsung Gingerbread. A pretty good work from +Mike Reid in the fm app, and +Pawit Pornkitprasan mantaing SGS alive. Congrats.
 
Spirit FM Unlocked has done most of the work. You should get him on board
 
Don't think there's any "on board" to get to.

I'm an "old dude" with kids and bills and at a point where my pension will afford me cat food instead of steak in my retirement. LOL.

So I'm avoiding donation models. Unless you know some company willing to sponsor without much interference.

I'd be interested to hear how the CM FM is coming along. Anything besides CG2900 Sony devices yet ? And how well does it work ? My Xperia P is still stock but I'll try the ROMs at some point.
 
I have Sony xperia U with CM9 when can we have build with FM radio support
 
Hi. Found this thread when googling my name, since i did some of the code this is built on has my name in copyright headers. Has changed work place and has not been working with Android for a year and a half but I did the vendor interface and most of the lower layer (JNI and below) and most of the CG2900 driver and might be able to help with some of the questions raising but please remember it is more than two years since I did the work so I might need time to fresh up. Also note the CG2900 driver is proprietary so I can't show or discuss any of its code (and I don't have access to it any way).

Regarding example to get started Marco Sinigaglia did an (sadly now abandoned) attempt to do a plain V4L2 driver which can be found on https://android-review.googlesource.com/#/c/23522/ Since V4L2 doesn't support things like scan etc he did that in software making it extremely slow but he got some of the basic to work, not sure about the RDS though but I can see there is code to implement it.

To get the driver started for RX you at least need to implement the following methods (see validation in androidFmRadioLoadFmLibrary fmradio/jni/android_fmradio.cpp)
rx_start
pause
resume
reset
and just set everything else to NULL. Now you can at least make the radio start and check that audio is routing correctly.

There is no need to implement callbacks from the vendor driver to make it work, although it might be nice to implement

on_playing_in_stereo_change

and

on_signal_strength_changed

to enable the app to detect these things without polling the lower layers.

Of course you would probably like to implement change and get of frequency, scan etc so these methods should also be fairly mandatory 

scan
set_frequency
get_frequency

although the framework does not enforce them, the JNI layer will just give a FMRADIO_UNSUPPORTED_OPERATION if higher layers try to use them.

If you just implement RDS Text then callback on_rds_data_found need to be called when new data has arrived. If AF and TA are to be implemented it gets more complicated. a callback on_automatic_switch need to be called when frequency is switch or is switched back after a TA is finished.
 
Hi Johan. Thanks for showing up. :)

I'd personally be interested in any opinions you could share about where this API is going. ST-Ericsson may not be doing anything further, the experimental code in AOSP seems broken and stalled again, and I'm not sure how committed Sony is to the API. The Xperia Z still uses this API, but I note Sony changed the audio code to use Qualcomm specific Intents.

I've seen no support from other vendors, including Qualcomm, Broadcom and Samsung. I can only hope there is movement coming from Google and/or perhaps from the NextRadio app developers in their US broadcasters deal (tentative ?) with Sprint and possibly other US carriers.

As far as code & documentation go, have you seen anything open source/publicly available outside of an ancient doc and the experimental AOSP code ?

And do you know of any plugins, other than these 3: ST-Ericssons' CG2900, and what I presume are Sonys' plugins for Iris/Qualcomm chips and Broadcoms's proprietary API ?

I absolutely understand you can't share any privileged info, but hope there might be general opinions you can share.
 
Well, I don't have any information regarding the status from other vendors. Samsung probably use whatever their platform deliverer gives them. There was at least work on a TI solution but I don't remember how far that one went.

Last action from ST-Ericsson seems to be about 5 month ago: https://android-review.googlesource.com/#/c/46100/ 

Google seemed to think the radio control part to be at least fairly ok after some rework but thought the problem was integration with the audio stack without specification what. In the original  submit https://android-review.googlesource.com/#/c/20507/ Jean-Baptiste Queru from Google (don't know his role) finally suggests to await next major release of Android, but that was 11 month ago...

Don't know if the real problem is Google lack of interrest of the fm radio use case since otherwise they should have implemented this long ago.
 
>about 5 month ago

Other than the automated "Patchset creates breakage in AOSP" messages, yes. Looks dead (again) to me, other than internal Sony usage.

Some CG2900 devices sold in Europe have their FM transmit antenna pin connected and can transmit. My Xperia P bought in Hong Kong doesn't seem to have the transmit pin connected. Do you think there's an easy jumper type fix ? I was going to open it, but hesitated once I found that nobody had turned those Torxes or whatever and posted about it.

Do you have any insights about what devices might have transmit connected, and how to tell from some ID ? I'm also curious if there are regulatory/FCC type issues when a transmit pin is left connected, but supplied software doesn't support it. I imagine it's well under the 100 milliwatts spec'd by FCC part 15. Usable FM transmit is very rare on Android; I've presumed that certification delays may be a major reason for that.

I got transmit working easily, on some "remote" Euro devices, but haven't explored the ALSA registers much. Is there an easy way to configure the ALSA to transmit all normal media audio ? Thanks !
 
I think they are just awaiting input from Google or others, especially regarding the audio stack. Until they get something it is no big idea to update unless they found some serious error in it but I think that part of the code has been used quite long and is well tested.

Regarding the CG2900 I'm only used them on development boards. Some of the boards were lacking the TX antenna so we just put a short (maybe 5 cm) electrical lead to its connection it and it was enough to make it work ok, probably harder to do in a consumer phone  where that particular pin on the IC isn't connected at all. Also note you need to check if the vendor driver is RX-only or RX and TX, otherwise it will not work even if you fix the hw unless you get a new version of vendor driver (if I remember correctly the vendor library loader check the name of the library to decide if it is has RX and/or TX enabled but check the code to be sure, it is part of this submit. Of course that is a framework check that is actually there to enable different drivers for RX and TX but a library marked as RX only is unlikely to have TX code as well since it would increase its size).

I never used TX on a real phone, only development boards so I don't have a clue which ones that really works. Quite likely that you are correct regarding certification reason for not using TX more, especially if phone is sold on multiple markets and you also need an extra (simple)antenna which add a small cost and complexity in production unless you somehow can use an already present antenna. There is intentionally no dedicated command for setting the output power of TX just to make sure a downloaded app doesn't invalidate certification by increasing the power, but it can be implemented using the send_extra_command() with vendor specific commands if you want to test an implementation.

I wasn't involved that much in audio routing part of this interface and has no deeper knowledge in the ALSA domain so I have to pass that question. Sorry.
 
Thanks. Yes, AFAIK, cg2900 plugin is the only one that supports Tx. I presume it's the original reference implementation.

There's Tx power control in a cg2900 V4L extension, &  I've tried it, but it only reduces power from the default max it appears. I was reading that FCC (at least) allowed power from 88-108 is "super tiny", not the 100 mW allowed elsewhere. I think this might help explain why it's almost useless for real world use. I have another phone with TX and I had to wrap Rx & Tx antennas together to get half decent quality.
 
is there a radio app for cm 10.1 on sensation XE?
 
SERIA FANTASTICO PARA EL GALAXY ACE S5830 L , CYANOGEN MOD 10.1 PRO FUNCIONA EXPECTACULAR SOLO HACE FALTA LA APLICACION DE RADIO POR DEFECTO , OJALA LO SOLUCIONES ,GRACIAS
Translate
ken leo
 
On the samsung Galaxy note 2 (7100) there is no FM frequency why is this and can i get it by installing a rom?!
ken leo
 
Can this be installed on samsung galaxy note 2 (GT N7100) international
 
Will Spirit/Spirit2 support Sony Xperia S on CM 11 ?
Add a comment...