[CLOSED] Cyanogenmod, Legend, FM Radio & MONEY [MODS PLEASE CLOSE THREAD]

Status
Not open for further replies.
Search This thread

and313

Senior Member
Nov 2, 2010
2,196
722
Google Pixel 5
Hey guys,

I was just thinking about that nasty little problem with cyanogenmod and our legends and since there was no meaningfull advencment, we could put some money on it. I think from 5 to 10€ for each doner would be enough or what do you think? Of course the developer has to give us an account to send the money to.

I would just like to use the FM radio and since it is working on desire for some time now, why not on legend.

So who is ready to do it?
 
Last edited:

rajasyaitan

Senior Member
May 18, 2010
343
15
It is already stated waaaaaaaaaaayyyy before. The FM radio WILL NOT WORK on the Legend because of it's alien architecture. Don't ask me, I don't know ****. But if you're do want to make a donation then you can donate to Ali Ba which has been the sole reason CM is running on the Legend.
 

and313

Senior Member
Nov 2, 2010
2,196
722
Google Pixel 5
It is already stated waaaaaaaaaaayyyy before. The FM radio WILL NOT WORK on the Legend because of it's alien architecture. Don't ask me, I don't know ****. But if you're do want to make a donation then you can donate to Ali Ba which has been the sole reason CM is running on the Legend.
here on this link http://forum.cyanogenmod.com/topic/8260-fm-radio-support-for-legend/ ale baba himself says it is possible but that he hasn't got the time for it. So it is possible we just need someone who will do it. But first of all we need more people.
 

mikereidis

Inactive Recognized Developer
Jan 28, 2011
7,823
4,146
Ottawa/Gatineau, Canada
I'd consider doing development on this. I was wondering why there was no FM Radio app on CM7, LOL. :D

At the very least I can commit to finding all the info I can gather on this issue. I have no (satisfactory) employment at present and want to break into the Android specific field.

I have 14 years experience in embedded Linux development, including lots of low level kernel stuff. In a previous life (more decades ago than I dare admit) I did electronics engineering stuff, and I still love the low level nuts and bolts.

I'm pretty new to Android however, got my first cellphone (ever!) 17 days ago, first Android phone 15 days ago, and my Legend yesterday.

I think I can learn quick, I'm CM7 nightly, S-Off, new radio one day after getting it, LOL. :D


So my point is I, and this project, could use help in areas of Android specific knowledge.

Does anyone know if the normal FM radio app I've used before is proprietary Google code ?

Are there any generic FM radio apps that would work if standard drivers existed ?

My quick research on this is that only a driver might be needed. A V4L (video 4 linux) driver, which I have already had some experience with.

But there DOES seem to be a V4L driver already for Linux for the TI WL1273 chip apparently used in the Legend, and apparently a number of other phones. So in theory, this job might be as easy as integrating an already written driver in to the CM kernel, as a kernel module or 2. There MIGHT be some copyright issues with any chip firmware though.

Alas, some comments indicate using such a driver might interfere with Bluetooth functionality.

Interesting stuff about the 1273 chip is that it may support an FM transmitter, and it supposedly supports WiFi N. But who knows if needed hardware support might not be on the PCBs.
 
Last edited:
  • Like
Reactions: buddy1986

mikereidis

Inactive Recognized Developer
Jan 28, 2011
7,823
4,146
Ottawa/Gatineau, Canada
^ wow! where have you been all our android lives, bro? link on the post above yours answers some, if not of all, of your questions & covers a lot, i guess. cheers!

:) Cheers...

I've been reading that there IS an FM Radio app integrated into CM now. It comes from MIUI, a chinese group of some sort that also makes an Android ROM.

The app apparently uses /dev/radio* which is the standard V4L radio interface. I have these also on my Hauuppage PVR boards I used for HTPC before I went completely digital for movies, tv, etc.

So yes, what we need is integration of a driver into CM kernel, but coding may be needed to fix bluetooth driver interference etc. And of course who knows what else might be needed.

I'm reading that FM is much more important to those without data to stream. Not all of us live in wireless data dense cities and countries.

Would be interesting to see what frequency range can be received and maybe transmitted.


Would be MOST cool to stream from video camera to transmitter for local "pirate TV" type functionality, LOL. ;) :D Actually can't imagine ATSC or even NTSC (or PAL etc.) encoding possible, but wireless streaming will do the job...
 
  • Like
Reactions: buddy1986

ojessie

Senior Member
Jan 28, 2009
683
89
IBK
Lenovo P11
@mikereidis
Thanks for joining in, great highly appreciated. If there is any time left ;) it would be nice if you could look into the GPS problem with CM 7 it is currently not addressed.
Anyhow thanks for your participation and contribution.

BR, ojessie
 
Last edited:

qzem

Senior Member
Jun 23, 2010
1,594
1,030
@mikereidis

So are you going to try and port it?? If you will and you'll succeded then you will be the legend in Legend community:)!

Sent from my Legend using XDA App
 

mikereidis

Inactive Recognized Developer
Jan 28, 2011
7,823
4,146
Ottawa/Gatineau, Canada
@mikereidis
Thanks for joining in, great highly appreciated. If there is any time left ;) it would be nice if you could look into the GPS problem with CM 7 it is currently not addressed.
Anyhow thanks for your participation and contribution.

BR, ojessie

I can keep my eyes and ears open to GPS, but best to concentrate on one issue at a time.

What is the GPS issue ? I thought it didn't work on my phone after new ROM but within a few hours it was working OK for whatever reason. And now I see 2 metre accuracy compared to the minimum of 5 on my Optimus Chic. :)
 

mikereidis

Inactive Recognized Developer
Jan 28, 2011
7,823
4,146
Ottawa/Gatineau, Canada
@mikereidis

So are you going to try and port it??

I'll do whatever it takes.

The userspace FM Radio app shouldn't need any porting work AFAIK. It seems to already be in CM 6.1 ROMs for the Nexus One (any others?). So I'd guess installation would just need to be enabled for other phones.


The tricky part is getting a device driver working that creates a /dev/radio interface for the MUIU FM radio app to use. There IS already a Linux driver for the WL 1273 the Legend uses, but it might need some modifications to run on the Legend.

But there is some complicating factor regarding bluetooth drivers, so it may not be too straight forward. For initial testing at least the bluetooth drivers could be disabled.
 

ojessie

Senior Member
Jan 28, 2009
683
89
IBK
Lenovo P11
I can keep my eyes and ears open to GPS, but best to concentrate on one issue at a time.

What is the GPS issue ? I thought it didn't work on my phone after new ROM but within a few hours it was working OK for whatever reason. And now I see 2 metre accuracy compared to the minimum of 5 on my Optimus Chic. :)

Yeh, thats the problem. GPS is working on some devices and on others not and nobody knows why. As a matter of fact when I'm running CM 6.1 its working great. Flashing CM 7 no change to get it working. As mentioned others are reporting the same issue with CM 7 on some its working on others not.
 

mikereidis

Inactive Recognized Developer
Jan 28, 2011
7,823
4,146
Ottawa/Gatineau, Canada
Yeh, thats the problem. GPS is working on some devices and on others not and nobody knows why. As a matter of fact when I'm running CM 6.1 its working great. Flashing CM 7 no change to get it working. As mentioned others are reporting the same issue with CM 7 on some its working on others not.

When I get tired of Google maps seeming to take forever to figure out my GPS location, I've downloaded and run the "GPS Test" and "GPS Status" apps. I did so and for some time the status color on one of those showed yellow, meaning no GPS fix, but power on.

Anyway sometime later it was working. One of those apps downloaded data to make cold starts work faster and that may have helped. A few things to try for anyone interested anyway.
 

mikereidis

Inactive Recognized Developer
Jan 28, 2011
7,823
4,146
Ottawa/Gatineau, Canada
What about HTC's kernel source. As I told in cyanogenmod forum the drivers should already be in HTC's kernel source. If the code is there it should be easy to put it into CM7 kernel and use HTC's FM Radio app. Or what do you think?

The problem with running the HTC FM radio app on CM is that it, like many other HTC apps, uses the HTC framework with Sense UI. So CM can't run it, although stock or modded Sense ROMs should be able to.

IMO right now the MIUI app is the way to go, and it's open source so anyone can modify/fork it.


Yeah I think a /dev/radio is likely in HTC source, but it's possible it's something different and/or kind of proprietary.

The Chip manufacturer, TI, and their partners who make RF modules based on the chips, DO have android /dev/radio drivers. So they are definitely out there somewhere.

I think, as usual that "In Theory" this should be a simple matter, in reality there is usually some problems to solve. Otherwise we'd have FM already in CM.
 

ali ba

Retired Recognized Developer
May 30, 2010
576
258
Vienna
derhofbauer.at
A few pointers:

TI 1273 has a few interfaces for communication. One of them being a (standard) serial via bluetooth, the other one I2C.

HTC did not use I2C because they already had to use the serial interface for bluetooth and it's a lot cheaper that way (that's what all manufacturers do, by the way). The wl1273 driver in the Linux kernel does have support for the FM capabilities, but unfortunately via I2C only.


So basically we already have all the drivers we need in place (tiwlan_drv, sdio), no kernel stuff needed. What's missing is valid documentation about how to enable radio, route it to the headphones, seek/tune, etc.
You could reverse engineer /system/bin/btipsd, which does bluetooth and FM communication in original HTC releases.

Once you are able to control FM stuff (with bluetooth turned on) write a nice summary and I'll ask cyanogen how to implement it. Won't be that hard, given the fact that currently all supported devices use the serial interface via bluetooth.
 

mikereidis

Inactive Recognized Developer
Jan 28, 2011
7,823
4,146
Ottawa/Gatineau, Canada
The wl1273 driver in the Linux kernel does have support for the FM capabilities, but unfortunately via I2C only.


So basically we already have all the drivers we need in place (tiwlan_drv, sdio), no kernel stuff needed. What's missing is valid documentation about how to enable radio, route it to the headphones, seek/tune, etc.
You could reverse engineer /system/bin/btipsd, which does bluetooth and FM communication in original HTC releases.

Thanks ali ba ! Yes I know about cheap manus, I've worked for a few, LOL. Linux VOIP and security appliances mostly though.

By "The wl1273 driver in the Linux kernel" do you mean the TI provided W1273 driver in the CM7 ROM ? I had thought that driver was for WiFi only, or perhaps WiFi + Bluethooth. Or does my seeing an rfkill device mean FM radio is in there too ? Would it create a /dev/radio device ? There are some FM init BTS files that may enable FM.

My understanding is that the WL1273 WiFi driver in the mainline Linux kernel (not the Android kernel) is WiFi only. There's a guy from Nokia trying to get WL1273 FM radio only driver into main Linux kernel but not there yet. That driver will be separate from WiFi driver even though they may both have WL1273 in the name.

I've been finding some HCI commands usable with hcitool to do audio routing stuff at least. RevEng has been a specialty of mine, so I think if it can be done, I have a good chance.
 
Last edited:

mikereidis

Inactive Recognized Developer
Jan 28, 2011
7,823
4,146
Ottawa/Gatineau, Canada
Quickest route to a working FM radio on Legend is to find an existing app for another phone that works.

Phones with the WL1271/1273/1281/1283 chips include original Moto Droid, Droid 2, Droid X, Motorai, Nokia N800 (or N900?), N8 (?), B&N Nook Color.

There's a thread here on XDA about Droid 2 phones using the Droid X FM radio app with success. I tried that app but there seems to be some problem launching the fmradioserver.

I saw a logcat message that may indicate I need to "adb install" the APKs instead of just copying them to /system/app. I tried but got the error that indicates the UID does not match the signature. I guess that's not an issue on Droid 2 (or motorola phones in general?)

Does anyone know if/how to mod/repack an APK to avoid the UID signature issue ?
 

mikereidis

Inactive Recognized Developer
Jan 28, 2011
7,823
4,146
Ottawa/Gatineau, Canada
A few more of my findings for anyone interested. BTW should I or someone create a thread in the dev section at this point ?

As mentioned above a guy from Nokia is trying to get a V4L2/dev/radio driver for WL1273 into mainline Linux kernel. That driver could be integrated into our kernel, but it might take a bit of work. And as mentioned that driver is not in kernel yet and may have lots of changes still coming in the next several months at least.

But TI also has a driver, and it's meant for Android. I haven't been able to grab source code for that driver yet. I think TI driver references WL1283, the biggest baddest version with GPS too. But driver is supposed to work on all 4 variants, down to WL1271.


TI has a command line app for testing fm radio, I think called fmapp if memory serves. It's possible this test app could at least help with exploration.


Unlike the poor original Droid owners, we are lucky that we know our FM receive antenna is connected, since stock Legend has FM radio. But there seems to be a different pin for FM transmit so it's possible we will never be able to transmit FM more than a few inches. But Tx would just be a bonus, but a potentially wonderful bonus.

And, ya know, I'm not even sure if MIUI FM app works with /dev/radio. I was looking at some source and it seems to be hardcoded with Broadcom chip specific stuff.


Oh, and my understanding is that even if we ever managed to get Wireless N working (with a new or improved stack perhaps?), that it will likely kill batteries quickly enough to be effectively unusable. Would be interesting though.
 
Last edited:
Status
Not open for further replies.

Top Liked Posts

  • There are no posts matching your filters.
  • 4
    @mikereidis

    Hey man, I hope you didn't give up already:rolleyes:!

    :) Absolutely not ! Just may not post much when deep in "the machine".

    I KNOW this will work when the audio routing mystery is solved, so I've gone ahead and started on a radio app. It's minimal at present but it:

    - controls power on or off
    - changes and displays volume
    - changes and displays frequency
    - scans up or down
    - shows RSSI (signal level) as expected when a station is tuned in and the antenna is moved

    Sooner or later the audio routing will be solved, and I hope to have an app ready to go at that time. At present it requires a few kluges that require root access. The app development is giving me a nice break from racking my brains over audio routing.


    A few days ago I started a "monster" thread in the general Android development section documenting what I've learned about the TI FM Radio and asking for some technical assistance.

    So far not a single response to my 10 monster posts of technical info. But that's OK cause I'd prefer to clean up some of that before the thread gets too much notice. And please note, developer type posts only on that thread. I've seen several other threads for different devices using the TI FM Radio, so I think a cross-device thread is appropriate for devs to share info.

    And yes, I want my app to be usable on many other devices, whether they use a compatible TI chip, or the even more popular broadcom line.

    So far I haven't tried reverse engineering using one of the stock ROMs mostly because I have just the one phone and it's really handy to keep it in operating condition. I'm mostly been "forward engineering" searching for datasheets and assembling all the info I can find from various internet sources. But I also examine binaries on my CM7 ROM and those I can find on the internet.


    I also need to get some bluetooth devices. Some of the TI code indicates the FM radio may be capable of internally transferring audio to and from (for Tx!) bluetooth from and to the radio. So the audio data might never leave the chip, meaning that just standard chip commands might be able to do the routing.


    I'm putting over 12 hours per day, 7 days per week into this project. I hope to find a way to make at least a meager income from this over the next 3-6 months, so I can continue. Suggestions on that front are welcome, but I think it'd be via sales in the Android app marketplace(s).

    I DO feel I see massive benefits in making apps open source. It's one way I think the lone developer can stand a chance in a marketplace full of larger entities than a single person. Biggest question with open source, though, is how to make money.

    But I guess even with open source, one can still place a non-free App in the marketplace, and people might pay and download either because: (a) they want to support the project, (b) they want ad-free or (c) enhanced versions or (d) latest updates or (e) support or (f) they might not even know an APK is downloadable somewhere..


    Currently, the GUI of the app is built with Android App Inventor, a somewhat Visual Basic like visual development tool. Unfortunately AppInv has serious limitations at present, but so far I've managed to work around them with scripts and an extender. If the AppInv "Source" (really, a diagram, LOL) was made open I think it could be interesting to see what other people make from it. I could supply the scripts/API, documentation, investigation, support, etc.

    So, so far I REALLY like the easy GUI design and end-user (non dev) modifiability of App Inventor. But so far there are very few paid apps out there built with AppInv.
    3
    Well it sounds like you're making some awesome progress. I eagerly await. [=

    Sent from my Legend using XDA App

    :) Now I'M stoked ! 5.5 days from old AI app to new Java app, with credit due to CodeAurora and a few lines of code credited to MIUI and/or CM ;) Most of that time was spent learning more about the Android SDK and learning the Aurora code.

    Here's a "sneak peek" at version 2:

    Direct:
    https://docs.google.com/uc?id=0B7UP...Tg4YjYtYzkyODg2MDdiMDhj&export=download&hl=en

    Page:
    https://docs.google.com/leaf?id=0B7UP2cIqyQXGYTY3ZDQ2MDEtYzk4ZC00Yjc2LTg4YjYtYzkyODg2MDdiMDhj&hl=en


    It's "hot off the presses", so who knows what strange bugs it might have on your phone. But it seems to be working nicely on mine.

    It shouldn't need any of the previous files, but they shouldn't interfere. Due to the shared lineage with the CM app, it's possible there might be some conflict in naming or somesuch.

    As before, it requires a working hcitool. No "daemon mode", but I'll be investigating the dbus APIs for direct bluetooth access. But hcitool works fine for now. It will create a file named "cmdout" in the /sdcard directory; this is used to read FM registers.

    It needs SU (root) only to run the speaker/headset switching code, due to the bug in my older CM ROM.

    You MUST switch bluetooth on manually before starting. When it starts, it should power up, go to speaker and tune to 98.1.

    Note: The app has some code to handle muting during phone calls. I haven't tested to see if it works yet. If someone would like to test incoming/outgoing to see what happens, please let me know. I don't use this phone as a phone anymore, LOL. :)

    For some reason, this app doesn't show up in the "recent applications" list. It can be returned to by (re)launching via home screen or whatever.

    ------------------
    Instructions:
    Click on "98.1" and get a dialog to enter a new frequency. Click to left/right and go down/up one channel. Long press on either to seek to next channel with an RSSI of 24 or greater.

    Hardware volume control buttons should work. Turn up if you hear no sound. Hit speaker at lower left to mute, again to unmute. Power button should go off and on.

    Find a favourite station and long press one of the 5 preset buttons to set etc.

    Menu button gives some non-working options like scan. "Start recording" creates file(s) on the SD card, but I haven't seen if an actual recording can be made (it can't as of now I think). "Disable Speaker" switches audio to headset. "Enable Speaker" goes back to speaker.

    Under "Settings", the mono/stereo switch should work. The "Regional Band" may partly work for other areas, but I have some code fixed to North America at the moment. Revert to factory defaults should work.

    There should be multiple preset lists configurable but I haven't checked that much.

    The display should reconfigure between landscape and portrait.

    Please report back here...
    1
    I'd consider doing development on this. I was wondering why there was no FM Radio app on CM7, LOL. :D

    At the very least I can commit to finding all the info I can gather on this issue. I have no (satisfactory) employment at present and want to break into the Android specific field.

    I have 14 years experience in embedded Linux development, including lots of low level kernel stuff. In a previous life (more decades ago than I dare admit) I did electronics engineering stuff, and I still love the low level nuts and bolts.

    I'm pretty new to Android however, got my first cellphone (ever!) 17 days ago, first Android phone 15 days ago, and my Legend yesterday.

    I think I can learn quick, I'm CM7 nightly, S-Off, new radio one day after getting it, LOL. :D


    So my point is I, and this project, could use help in areas of Android specific knowledge.

    Does anyone know if the normal FM radio app I've used before is proprietary Google code ?

    Are there any generic FM radio apps that would work if standard drivers existed ?

    My quick research on this is that only a driver might be needed. A V4L (video 4 linux) driver, which I have already had some experience with.

    But there DOES seem to be a V4L driver already for Linux for the TI WL1273 chip apparently used in the Legend, and apparently a number of other phones. So in theory, this job might be as easy as integrating an already written driver in to the CM kernel, as a kernel module or 2. There MIGHT be some copyright issues with any chip firmware though.

    Alas, some comments indicate using such a driver might interfere with Bluetooth functionality.

    Interesting stuff about the 1273 chip is that it may support an FM transmitter, and it supposedly supports WiFi N. But who knows if needed hardware support might not be on the PCBs.
    1
    ^ wow! where have you been all our android lives, bro? link on the post above yours answers some, if not of all, of your questions & covers a lot, i guess. cheers!

    :) Cheers...

    I've been reading that there IS an FM Radio app integrated into CM now. It comes from MIUI, a chinese group of some sort that also makes an Android ROM.

    The app apparently uses /dev/radio* which is the standard V4L radio interface. I have these also on my Hauuppage PVR boards I used for HTPC before I went completely digital for movies, tv, etc.

    So yes, what we need is integration of a driver into CM kernel, but coding may be needed to fix bluetooth driver interference etc. And of course who knows what else might be needed.

    I'm reading that FM is much more important to those without data to stream. Not all of us live in wireless data dense cities and countries.

    Would be interesting to see what frequency range can be received and maybe transmitted.


    Would be MOST cool to stream from video camera to transmitter for local "pirate TV" type functionality, LOL. ;) :D Actually can't imagine ATSC or even NTSC (or PAL etc.) encoding possible, but wireless streaming will do the job...
    1
    Thanks. :)

    Please feel free to close this thread; it served it's purpose 4 years ago and there is probably nothing meaningful to say at this point, about FM on the now ancient HTC Legend.

    Sure.

    And good luck with android auto i saw you made some significant advancements :)