yashsingh1/xdaforums huggingface dataset:
[Sprint Samsung Galaxy S III] mikereidis:
That's right. The 10th FM API Spirit supports. Would be nice if there was 1 standard API, but in that mess is my opportunity. :)

"QC OEM" is what I call the "OEM Proprietary high level Java API" that manufacturers use from their stock FM apps. The Java class is named "android.hardware.fmradio", which seems to imply it's blessed by Google, but AFAIK it isn't.

OEM APIs generally don't require root, but are usually not available on custom ROMs (at least for GB).

There's an equivalent low level API that would show "Mo:V4D" which is the radio portion of the somewhat standard V4L2 Video For Linux driver API.

I'm happy to confirm the MSM8960 seems to support integrated GPS, WiFi, BT and FM in addition to the LTE, etc. Now if they just connected the antenna...
[Sprint Samsung Galaxy S III] jeffro23:
much appreciated for all the info in this thread. Im anxiously awaiting

fm confirmation on the S3 before purchase, otherwise its HOX
[Sprint Samsung Galaxy S III] kinwolf:
Lasalle's

Thanks for all the hard work! I sent a debug log from my Rogers SIII (sgh-i747m) hopefully that will help a bit. I tried the June 28th release but no sound and a negative number in the top corner just like it was reported above.

If there is anything else that can be done to help, I'll gladly try it.
[Sprint Samsung Galaxy S III] mikereidis:
If you MUST have both FM and LTE, I can confirm the AT&T (and likely others) HTC OneX(L) with Qualcomm Snapdragon FM works well, although root may be needed (it is needed for now at least).

June 30 test release and info are here: http://xdaforums.com/showpost.php?p=28091457&postcount=3907

At this point, only logs from rooted devices are of interest to me.

With June 30 you will probably have to set Debug->FM API to "OEM Proprietary" and it doesn't hurt to set Debug->FM Chip to "QC V4L".

BTW, what happens so far is that the "OEM Proprietary FM API" starts up OK, and it even looks like the "power on" function may indicate success, but the RSSI value is always -128 which is a bad sign.

I tried the "internal antenna" on my OneX(LTE) and it didn't work; signal went to nothing. In the June 30 release you can try this yourself with these:

Menu-> Test-> Qualcomm OEM-> setInternalAntenna true

&

Menu-> Test-> Qualcomm OEM-> setInternalAntenna false

They are the 2nd and 3rd items from the bottom in the "Qualcomm OEM" test menu.
[Sprint Samsung Galaxy S III] jamesbra:
Tried to install from my phone, can't seem to select install, all other areas are responsive though, cancel, show more etc. I'll try to adb install when I get home if no one has any ideas as to whats up
[Sprint Samsung Galaxy S III] jamesbra:
Tested and logs sent. If there is any other configs you'd like someone to try just say the word
[Sprint Samsung Galaxy S III] jrbaker624:
Found this. Any help at all?
[Sprint Samsung Galaxy S III] jrbaker624:
Bottom pic is 1 middle is 2 top is 3 sorry put it in wrong order
[Sprint Samsung Galaxy S III] mikereidis:
Thank you yes, I had just asked a few people who emailed for a copy. At first glance it's quite similar to the HTC OneX(L) LTE version.
[Sprint Samsung Galaxy S III] mikereidis:
I'm going to "waste" a post since the next one will start a new page.

Funny thing that there are files like "fmconfig" on a device that doesn't "support" FM. :)

I've seen plenty of these "vestigial" files before though.

But beyond that, it looks like almost everything needed is there, from a software perspective.

The biggest question will be: "Did they connect those darn FM antenna pin(s) anywhere useful ?"
[Sprint Samsung Galaxy S III] mikereidis:
Thanks to the 3 who have sent me logs. This is pretty much what I sent to you.

We need to load an FM device driver.

I've attached the /system/lib/modules/radio-iris-transport.ko file: http://d-h.st/ypi

You'd need to remount /system as read-write to install this.

With that driver available I can do this to load it:

su

setprop hw.fm.mode normal

setprop hw.fm.version 0

start fm_dl

Or you could just "insmod" or "modprobe" the driver, as the /system/etc/init.qcom.fm.sh file does:

su

insmod /system/lib/modules/radio-iris-transport.ko

With the driver loaded or available, there is an "fmconfig" command available via adb shell or a terminal app. I do this on my HTC One X:

su

fmconfig

And I see this output:

fmconfig - FM V4L2 device configuration application

Usage:

<command> <opts..>

enable Open and initialize FM Radio device

disable Close FM Radio device

setfreq <freq > Set Frequency ex. setfreq 93500

getconfig Get Current Configuration

seek <up/down> Seek <dir> ex. seek up

scan <up/down> Scan for list of stations ex. scan up

searchlist Search a list of stations

quit Quit application

>

Then I enter "enable":

>enable

Enabling FM ....

VIDIOC_QUERYCAP returns :0: version: 0

Driver Version(Same as ChipId): 0

qsoc_onpath = fm_qsoc_patches 0 0

init_success:1 after 0 seconds

emphasis :0

spacing :2

RDS system :1

Band :1

RdsOptions :17

Cmd Status .... 0

>

Then I enter, for my local 88.5 MHz station "setfreq 88500":

>setfreq 88500

Setfreq 88500

Setting frequency .... 88500

SetFrequency Receiver entry freq = 88500

Cmd Status .... 0

>Pid = 5694

Ptype = 5

PS name MACHINE

...

The end is RDS data. I can enter "getconfig" and see this:

>getconfig

Current Parameters ....

Station : 88500

Service Available : 1

Rssi : 182

Audio mode : 1

Rds sync : 1

Mute status : 0

All the above assumes you have a wired headset plugged in for what is VERY hopefully a good FM antenna connection.
[Sprint Samsung Galaxy S III] mikereidis:
My AT&T OneX LTE /system/etc/init.qcom.fm.sh file is slightly different. After this line:

insmod /system/lib/modules/radio-iris-transport.ko

It adds these 2 lines:

setprop hw.fm.init 1

exit 0

This prevents fm_qsoc_patches from being attempted, which prevents the script from returning an error, which may help.

fm_qsoc_patches seems to be for older Qualcomm FM chips, it's not on my stock device, nor on any of yours.

File: http://d-h.st/M0x

Contents:
[Sprint Samsung Galaxy S III] ickster:
Why disable it in the 1st place?

I'm curious as to peoples opinions on why the carriers disable the FM radios at all?

Tmo did the same thing with the G2x....LG put it in...Tmo disabled it. Seems to me that disabling something that comes stock would have costs associated with it, implieing a good reason to do it.

Sorry if this hijacks the thread.
[Sprint Samsung Galaxy S III] jrbaker624:
Mine wont enable unless im doing something wrong
[Sprint Samsung Galaxy S III] americasteam:
If you have free radio you won't use their radio service which requires using data. The less data you use the less profit the carriers make.
[Sprint Samsung Galaxy S III] rakeshchn:
Yeah they want us to use more data, then also limit the data and also charge more when you go above the limit. Awesome!
[Sprint Samsung Galaxy S III] DarkDroid0110:
Got the same error while trying to enable as well. Not enough posts to attach a picture yet :/
[Sprint Samsung Galaxy S III] Voltage Spike:
That seems like a very silly theory. Ruin everyone's legitimate data usage by forcing customers to bog down the network with unwanted usage? The goal is to get people to use less of the limited resource and pay the same, not use more.

Stranger things have happened, but I'm inclined to believe something like customer experience (why doesn't radio work with my Bluetooth headset) and radio qualification (i.e., the FCC fees might be slightly higher) combined with an almost complete absence of consumer demand.
[Sprint Samsung Galaxy S III] jamesbra:
I subscribe to the greedy corporation theory. L'audicite!
[Sprint Samsung Galaxy S III] mikereidis:
You can capture the "logcat" output to see what's happening.

Or do what "start fm_dl" does manually:

su

insmod /system/lib/modules/radio-iris-transport.ko
[Sprint Samsung Galaxy S III] mikereidis:
By their very nature, large/widely owned corporations are intentionally "profit focussed" aka "greedy".

They are also psychopathic, with no empathy: https://www.google.com/search?client=ubuntu&channel=fs&q=corporation+psychopath&ie=utf-8&oe=utf-8
[Sprint Samsung Galaxy S III] mikereidis:
Bog down ?

The carriers complain about this in order to justify their high and increasing fees and throttling measures. This, despite that Internet data traffic get's cheaper by the megabyte every year.

Do you hear them saying "please limit your data usage because it's a limited resource" ? No, as long as they make more, they want you to use as much as possible, especially over your limit when you pay per megabyte.

The tech industry (again, especially in the US) complains non-stop that they can't find enough engineers. The reality is that they complain in order to bring H1B foreign workers in at lower costs, while many local engineers are out of work. So, yes, "they can't find enough engineers,... BUT at the low wages they would prefer to pay."

Most people do not have FM in their smartphone buying checklist, especially in the US. But I hear every day from people who are disappointed and/or just assumed it was available.

Outside of the US, particularly in Europe, many more phones have FM in the "International" versions. And yet they pay much less for data. (And are more likely to pay full price for phones with no contracts, which is always cheaper in the long run.)
[Sprint Samsung Galaxy S III] aNYthing24:
Has anyone tried installing the FM Radio apk from the international version? Just saying...
[Sprint Samsung Galaxy S III] jamesbra:
I'm getting exec format error when I insmod manually
[Sprint Samsung Galaxy S III] jarnow94:
I tried that before anything else; it force closes. It's possible I could be doing something wrong with the installation, though.
[Sprint Samsung Galaxy S III] mikereidis:
I have one and it uses a TI FM/combo chip and the TI proprietary FM API. It has no hope of working.

There are other apps out there that might work, at least partly. But none will work without the FM driver loaded.
[Sprint Samsung Galaxy S III] mikereidis:
Thanks.

Device drivers are often Linux kernel version dependent. My OneX this driver is from seems to be on kernel 3.0.8. I use this command and get the shown output:

uname -a

Linux localhost 3.0.8-01111-g188cf26 #1 SMP PREEMPT Sat Apr 7 01:37:15 CST 2012 armv7l GNU/Linux

My OneX is on original stock AT&T 1.73 firmware though, and there are other firmwares and ROMs which may have a driver to match your kernel version.

A custom ROM or kernel dev should be able to create a matching kernel and driver. Kernel drivers are open sourced, especially from Qualcomm.
[Sprint Samsung Galaxy S III] kinwolf:
Kernel version on SGH-I747M

app_180@android:/ $ uname -a

Linux localhost 3.0.8-20120523.225040-user #1 SMP PREEMPT Wed May 23 23:01:02 KST 2012 armv7l GNU/Linux

app_180@android:/ $
[Sprint Samsung Galaxy S III] mikereidis:
So they may both be running kernel 3.0.8, but some of the kernel build options are likely different.

We can collect and try different drivers, from the various stock and soon to be custom ROMs I guess.

But the best bet, for testing at least, might be a custom kernel.

BTW, I've been referring to radio-iris-transport.ko as an "FM driver". It's actually just the "transport" driver that connects the actual FM driver to the Bluetooth core on the SOC.

I don't know yet if the actual FM driver is in your kernels. If not, a loadable (*.ko) driver might be needed for it too.

In theory, it looks as if the FM might be accessible via Bluetooth / HCI like the TI and Broadcom chips. But I tried this on my One XL and it didn't seem to work.

run this from adb shell or a terminal app:

cat /proc/kallsyms|grep -i iris

I get this, then a bunch of transport related stuff, and this indicates there is an FM driver in the kernel:

002ec54 t iris_radio_init

c002ec68 t iris_probe

c003de6c t iris_radio_exit

c0040930 t __initcall_iris_radio_init6

c045be40 t configure_iris_xo

c0541d68 t iris_vidioc_g_fmt_type_private

c0541d70 t iris_vidioc_queryctrl

c0541dd8 t iris_vidioc_g_frequency

c0541e18 t iris_vidioc_dqbuf

c0541f88 t iris_vidioc_querycap

c0541fd4 t iris_q_event

c0542034 t iris_q_evt_data

c0543690 t iris_search

c05438cc t iris_vidioc_s_hw_freq_seek

c05438f8 t iris_vidioc_g_tuner

c0543b44 t iris_vidioc_s_frequency

c0543e14 t iris_vidioc_s_tuner

c05449c4 t iris_vidioc_s_ctrl

c0545c44 t iris_vidioc_g_ctrl

c05463a0 t iris_vidioc_s_ext_ctrls

c0546a94 t iris_vidioc_g_ext_ctrls

c0783850 t iris_remove

c07e67c0 t iris_viddev_template

c07e6a10 t iris_fops

c07e6a38 t iris_ioctl_ops

c0c8fa0c d iris_vregs

c0cf01e4 d iris_driver

c0cf0234 d iris_v4l2_queryctrl

This:

cat /proc/kallsyms|grep -i hci_fm

Gets me this:

c0542d6c t hci_fm_srch_station_list_req

c0542d7c t hci_fm_srch_rds_stations_req

c0542d8c t hci_fm_search_stations_req

c0542d9c t hci_fm_get_ch_det_th

c0542dbc t hci_fm_disable_trans_req

c0542dcc t hci_fm_enable_trans_req

c0542ddc t hci_fm_get_station_dbg_param_req

c0542dec t hci_fm_get_feature_lists_req

c0542dfc t hci_fm_reset_req

c0542e0c t hci_fm_cancel_search_req

c0542e1c t hci_fm_get_af_list_req

c0542e2c t hci_fm_get_radio_text_req

c0542e3c t hci_fm_get_program_service_req

c0542e4c t hci_fm_get_sig_threshold_req

c0542e5c t hci_fm_get_station_param_req

c0542e7c t hci_fm_disable_recv_req

c0542e8c t hci_fm_enable_recv_req

c0543a1c t hci_fm_tune_station_req

c0543eec t hci_fm_set_cal_req_proc

c0543f1c t hci_fm_set_event_mask

c0543f38 t hci_fm_set_sig_threshold_req

c0543f54 t hci_fm_rds_grp_process_req

c0543f70 t hci_fm_rds_grps_process

c05442e4 t hci_fm_set_antenna_req

c0544884 t hci_fm_set_ch_det_th

c0544990 t hci_fm_tone_generator

c0545c28 t hci_fm_do_cal_req

c054617c t hci_fm_do_calibration_req

c0546198 T hci_fm_do_calibration
[Sprint Samsung Galaxy S III] kinwolf:
Both returns are empty. So it seems those iles aren't there :(
[Sprint Samsung Galaxy S III] americasteam:
Are you serious? They want you to go over your data limit or buy a higher priced plan. The carriers make more money when you do. The only reason they are throttling unlimited users is because they can't make any more money off them. The more apps they put on the phone that require data, the more data the average user will use. AT&T will gladly sell you as much data as you can use. ;)
[Sprint Samsung Galaxy S III] jamesbra:
My results

If that picture didn't come out out says broken pipe
[Sprint Samsung Galaxy S III] kinwolf:
Broken pipe means there is probably a typo mistake in the line you typed ;-)
[Sprint Samsung Galaxy S III] jrbaker624:
Grep not found

Mine also said broken pipe
[Sprint Samsung Galaxy S III] LLStarks:
(Try adding spaces around the bar. blahblah | grep blahblah)

So, are things looking encouraging?
[Sprint Samsung Galaxy S III] jrbaker624:
Same result grep not found and broken pipe
[Sprint Samsung Galaxy S III] kinwolf:
Dunno, here is the output on my phone. Seems there's nothing present

Edit: Same result if I'm in su mode also(screenshot doesn't reflect that, but I tried both)
[Sprint Samsung Galaxy S III] LLStarks:
I guess the stock rooted S3 needs a better busybox.
[Sprint Samsung Galaxy S III] mikereidis:
Yeah, grep just isn't there in "toolbox" or whatever. It's on my OneXL but not my OneX.

From a connected Linux PC you can do:

adb shell cat /proc/kallsyms | grep iris

or perhaps this from the phone:

cat /proc/kallsyms > /sdcard/out.txt and post the out.txt file or search through it for iris or whatever. On my OneXL it's a 3 megabyte file.

Anyway, with root anything is possible software-wise. We'd just need a device driver loadable module for both FM and the FM transport.

I really haven't done much Linux kernel stuff in over 10 years now, but I'm trying to get up to date on how to fool the kernel into accepting a different version driver, etc.

Linux "insmod" has a "-f" force option, and "modprobe" has "--force" but the Android versions I'm looking at don't seem to support it.
[Sprint Samsung Galaxy S III] oscarthegrouch:
Its called iheartradio and tune in radio
[Sprint Samsung Galaxy S III] jrbaker624:
Those use "data"
[Sprint Samsung Galaxy S III] Konmon:
But that will use up your data fast if you have no wifi around

I know when I am at work I listen to the radio 6 or 7+ hours a day, and I have no wifi in my building.
[Sprint Samsung Galaxy S III] mikereidis:
Post 63 may be a new record for someone to mention streaming in an OTA FM thread. Usually happens in the first 10 or 20.

Feel free to educate us in this newfangled streamy thing. :)

But seriously, streaming is off topic I think.
[Sprint Samsung Galaxy S III] DaRealestEver:
Who listens to radio anymore? This is not a deal breaker. I see people saying if it dont work they will consider another phone. Really? Over a radio app? Lol i dont even use radio in my car. Cant remember the last time i heard real radio. Sirius and internet radio is good for me. Just like people who complain about mkv files on a damn cell phone. The screen is already super small for watching movies which will make a regular avi look awesome anyway. People pick at anything. Nothing is perfect.
[Sprint Samsung Galaxy S III] kinwolf:
So, because you don't listen to radio the whole world don't need it? Let's remove all the apps in the play store you don't need then, because it's obvious no one needs 'em if you don't!
[Sprint Samsung Galaxy S III] GoldenTiger:
Outdated tech (FM radio) that few use, is not the same as apps that people don't like on current tech (android smartphones). Your logic != correct.
[Sprint Samsung Galaxy S III] ktrotter11:
His logic was correct. Am/fm is very current. Besides satellite radio still costs
[Sprint Samsung Galaxy S III] macdroid01:
FM is not outdated. Let's not debate the merits of FM. A lot of people want FM radio. This thread is about getting it working on S III thanks to the incredible work from Mike. Let's focus on that.

Any testers...get it to work yet?
[Sprint Samsung Galaxy S III] zmore:
There's only crap on the radio anymore, IMO, but FM still has two important uses:

1) Emergency news broadcasts

2) Gym TV audio

Looking forward to the dormant radio being awoken in any case. TIA.
[Sprint Samsung Galaxy S III] neh4pres:
Let's stop hijacking this thread. If your not a person who likes fm radio don't come in this thread and reply. XDA is not here for you and only you. So kindly STFU and go troll another thread.
[Sprint Samsung Galaxy S III] LLStarks:
We wasted an entire page on nonsense.

Let's get back to discussing loading the kernel module and the output.
[Sprint Samsung Galaxy S III] _Burst_:
http://www.youtube.com/watch?v=G5f_gbzo4Q0

:good:
[Sprint Samsung Galaxy S III] jarnow94:
I searched "iris" but got no matches. I might be doing something wrong.
[Sprint Samsung Galaxy S III] mikereidis:
The "iris" FM driver probably just isn't in your kernel then. Other US GS3's might have it.

At worst, it means we'd just need one more driver loaded. But where is the driver code ? When I google symbols like "iris_radio_init" I only see this thread.

"radio-tavarua" was used on previous Qualcomm FM chips, which I've assumed were more or less compatible, but I'm now thinking they may not be, except for having a V4L API at the low level and a more or less common Java API.

Are there any kernel source code releases yet for Snapdragon GS3's ? Or perhaps for LTE HTC OneX which is out longer...
[Sprint Samsung Galaxy S III] kinwolf:
Samsung did release the ics source code for the i747m sg3, dunno if all is in there though.

http://opensource.samsung.com/reception/receptionSub.do?method=about
[Sprint Samsung Galaxy S III] mikereidis:
Thanks.

I did manage to find the driver in radio-iris.c on the Code Aurora site for Qualcomm: https://www.codeaurora.org/gitweb/q...f;hb=4a8a4b1f27ccf01758c00e63451f1a69b32f2b36

So, if compiled as a module the file should be radio-iris.ko . But a Google on that turns up nothing, so unless someone can find that file somewhere, we'd need a kernel built with it enabled. But we might need that anyway.

I see now that radio-iris and the older radio-tavarua are distinct drivers. The good news is that the former seems backwards compatible with the latter, at the low level V4L API at least.
[Sprint Samsung Galaxy S III] dave1977nj:
looking forward to seeing if we can get am/fm radio on our GS3!
[Sprint Samsung Galaxy S III] mikereidis:
Forget about AM. I'm not aware of a single Android device with AM support in the hardware.

There are technical reasons for this, including lack of space for a low frequency antenna.

There are business reasons also, including lack of interest for most people.

We will be lucky to get FM receive on rooted devices only. FM record and FM transmit are even less likely.

Ordinarily, I'd say the chances for the FM antenna being connected somewhere useful would be around 1-5%.

BUT, I'm seeing a trend towards one hardware variant for many carriers, possibly including European LTE users who will want or even demand FM. But it would only take one small mod, like not installing a capacitor, to disable any FM antenna connection.

So I'm guess-timating the odds are 50/50 for LTE GS3 now. :)

Hmmm, are there any service manuals out for LTE GS3 yet ? It seems every Samsung device has one out sooner or later (Yay, Samsung!). The schematics are often detailed enough to tell if there is a usable FM antenna connection.
[Sprint Samsung Galaxy S III] dasistsparta:
Who needs fm nowayds anyways?! Unless you miss those crappy commercials going on every 30 mins or unless you are a grandfather. Tuneinradiopro gets the job done:)
[Sprint Samsung Galaxy S III] spydc:
Well I appreciate the support in the quest to unlock fm radio on the S3. I hope it happens. I hate that this phone does not have it enabled. The EVO 4G LTE has fm radio and it works great. That's one thing i miss.
[Sprint Samsung Galaxy S III] mikereidis:
Some people don't understand that over the air FM radio programming is not a "waste-land" everywhere in the world.

There are other countries and cultures and small college and university stations. Some people like to hear local news and events and traffic reports.

There are gyms with multiple TV's that transmit on FM and have sound turned off.

FM is probably the most prevalent form of mass communication in the world, particularly in the majority of the world that do not live at first world standards.

I've read several real stories from real people who were VERY happy to have radio during emergency situations when the phones and the Internet was not available.

Some people (Germany mostly) get emergency services in the Japan band, and enjoy listening to that.

And some devices may be able to transmit FM, which is a much desired feature for some people. When 1 million Android devices are activated every day, even interest from 0.1% means a thousand a day.

My FM specific app is earning me a half-decent "live-able" income now, and mostly from custom ROM users. And paid customers are probably only 10% or so, due to piracy and free version users.

There are so many things. Please don't feed the trolls, at least not directly. :)

-----------

Technical content:

The GT-i9300 service manual has been out for 5 1/2 weeks. LTE GS3 ?
[Sprint Samsung Galaxy S III] jarnow94:
Get out.
[Sprint Samsung Galaxy S III] LLStarks:
I want to listen to my local NPR on 93.9 MHz, not some stream that uses my data.

Real FM is important.
[Sprint Samsung Galaxy S III] macdroid01:
Best post evar.
[Sprint Samsung Galaxy S III] Iphony89:
Why would you waste your time opening the thread if your not interested in what's being dicussed...smh idk what's wrong with people these days. Hoping this works though
[Sprint Samsung Galaxy S III] Canoe Head:
Browsing my unrooted TELUS i747 I noticed that the init script for fm radio is still in place /system/etc/[something qcom fm :-) ]

1st thing it does is load the kernel driver radio-iris-transport.ko which is missing on my device /system/lib/modules/

2nd thing it does is load from or at /system/bin/fm

A browse of the samsung i747 kernel source shows that these files are present.

Q1. Has anyone with rooted phone tried complile/load of the samsung kernel prior to testing Mikes 5Jul Sprirt FM?

Q2. Does anyone have the driver radio-iris-transport.ko available for use with stock build IMM76di747mvlale8?