FORUMS
Remove All Ads from XDA

Spirit1, Spirit2 Real FM Radio General Thread

7,827 posts
Thanks Meter: 4,164
 
By mikereidis, Inactive Recognized Developer on 1st May 2011, 09:23 PM
Post Reply Email Thread
9th May 2011, 09:58 AM |#91  
OP Inactive Recognized Developer
Flag Ottawa/Gatineau, Canada
Thanks Meter: 4,164
 
Donate to Me
More
https://market.android.com/details?i...ikersmicros.fm

v2.0.9.

- Seeks at end of band should wrap around automatically.
- Fixed some seek problems. Seek (via long press of frequency up/down) may still occasionally hang. If so, press "Cancel" and retry.
 
 
9th May 2011, 10:20 AM |#92  
4silvertooth's Avatar
Senior Member
Android Hell
Thanks Meter: 138
 
More
https://github.com/mik9/android_packages_apps_FM
well if it helps here's repository of FM app which is running successfully on cm7 lgp500.
Note: Its not my work all credit to Mik for the work.

Sent from my LG-P500 using XDA Premium App
9th May 2011, 01:34 PM |#93  
CR5N's Avatar
Senior Member
Thanks Meter: 110
 
More
Hi, tried this on HD2 running Tytung2.7 GB2.3.4. If I put in a frequency for a known strong transmission, I see signal bars but no audio from headset or speaker.
9th May 2011, 05:28 PM |#94  
Senior Member
Flag Naples
Thanks Meter: 25
 
More
I tried it on my Wildfire but it doesn't work.
Bye!
! !
9th May 2011, 06:33 PM |#95  
Senior Member
Flag Los Angeles
Thanks Meter: 30
 
More
Quote:
Originally Posted by CR5N

Hi, tried this on HD2 running Tytung2.7 GB2.3.4. If I put in a frequency for a known strong transmission, I see signal bars but no audio from headset or speaker.

I'm having the same issue on my EVO no sound on any station I've tried.
9th May 2011, 06:50 PM |#96  
Member
Thanks Meter: 1
 
More
Not working on lgop1 cm7
Not working on my lg optimus one flashed with cm7..neither is shows signal strength...hats off to the innovative idea.will wait till it gets more stable & polished &
9th May 2011, 07:55 PM |#97  
Senior Member
Flag Colombo
Thanks Meter: 416
 
Donate to Me
More
Quote:
Originally Posted by mikereidis

EDIT:

If you are new to my app, you can now install the latest version from the Android Market: https://market.android.com/details?i...ikersmicros.fm

Since the initial release of v2.0.2 many bugs have been fixed and now RDS data is supported on both TI and Broadcom chips as of v2.0.9.

I hope to get this app working on phones with Silicon Labs FM chips as well, and stock or stock based ROMs, but there are challenges..

Skip to the end of this thread for latest info.


-----------------------
Version 2.0.2 of the "Spirit FM Radio" :

https://docs.google.com/uc?id=0B7UP2...download&hl=en

This is NOT a streaming app. It's for "REAL" tuned radio, usually from 88-108 MHz or so. Like the MIUI and CM FM apps, it is derived from the Code Aurora FM app. I believe I've made more extensive mods than the MIUI or CM apps though.

Spirit FM Radio is in beta testing now. Don't expect a flawless, polished app. If I waited for all bugs to be squashed, this app would never be released.

The app has support for starting and stopping audio when a phone call is initiated or answered. I've done almost no testing on this feature at this time however, and it does not appear fully functional. So please don't expect proper co-operation between phone and FM audio until this is fixed.

Spirit requires Android version 2.1 or greater. On unsupported phones it should go into an emulator mode to allow the UI to be explored. For trouble-shooting, "adb logcat" can be useful. Root/superuser privileges are not required, but there is still one place in the audio routing code that attempts to run a "su" command to chmod /dev/msm_snd. This is only needed on older CM ROMs that do not have an FM radio app. Otherwise, you can configure SuperUser to deny the privilege.

The app has RDS data support on TI FM chip based phones, and hopefully I will be able to add RDS support for Broadcom based devices soon.

At this time it's most likely to work on CyanogenMod 7 on devices/phones on which the CM FM app works. It may also work on MIUI ROMs that support a MIUI FM app. I intend to get this app working on as many devices and ROMs as is feasible. Please feel free to "vote" on what I should prioritise, as far as device or ROM support, bug fixes or new features.

I also have it working on the HTC Legend using the Blayo ROM, and it may work on the stock ROM for HTC TI FM chip based phones such as Legend or Click/Tattoo. This requires the use of a "btipsd_cli_ binary. Under some circumstances, the btipsd daemon may crash. Slower devices, or those which are using a lot of CPU due to other apps/daemons etc. may have timing issues.


Other than the btipsd_cli method explained above, Spirit requires a working "hcitool" executable to control and retrieve data from the radio. The CM7 and MIUI apps use the same method for FM radio access. Spirit is also able to read data from the radio. I think the CM7 app does not have this capability (certainly not for TI chips).

To verify hcitool compatability, turn on Bluetooth and from a terminal emulator type "hcitool cmd 4 1", or from a USB connected PC with adb, enter the following and see if the results roughly match mine. This command gets the Bluetooth etc. versions. The last line should have 12 bytes, perhaps some will be different for you:

adb shell hcitool cmd 4 1
< HCI Command: ogf 0x04, ocf 0x0001, plen 0
> HCI Event: 0x0e plen 12
01 01 10 00 04 00 00 04 0D 00 1F 1D


The following should be able to confirm support for a Broadcom based FM chip. Eg. HTC Desire etc. The seventh and last byte should be 0, or 1 if running an FM app, or 2 if RDS is also being used.

a hcitool cmd 3f 15 0 1 1
< HCI Command: ogf 0x3f, ocf 0x0015, plen 3
00 01 01
> HCI Event: 0x0e plen 7
01 15 FC 00 00 01 00


The following should be able to confirm support for a TI based FM chip. Eg. HTC Legend or Click/Tattoo. The fourth and last byte should be 0. If running an FM app at this time, the radio will stop:

adb shell hcitool cmd 3f 137 1 1
< HCI Command: ogf 0x3f, ocf 0x0137, plen 2
01 01
> HCI Event: 0x0e plen 4
01 37 FD 00


The app supports somewhat different layouts for portrait and landscape. This has been tested at the resolutions:
- 240x320 For HTC Click/Tattoo on emulator).
- 320x480 HTC Legend.
- 480x800 HTC Desire HD

At this time, when switching orientation, the audio will always switch to the analog headset, which can be annoying if you are using the speaker.

Unlike many other FM apps, the app does not enforce the insertion of a headset wire as an antenna. On my Legend I can pick up strong stations without an antenna. On my Desire HD, even moderately strong stations come in without antenna. For best audio and RDS the antenna is recommended.


TI FM chip support has been tested extensively on my HTC Legend and is relatively mature, providing features such as RSSI, seeking, RDS program ID, program type, program service and radio text.

Broadcom FM chip support has been added just recently and is tested on my HTC Desire HD. It supports RSSI and seeking, although the seeking is somewhat broken at this time.

On recent CM7 ROMs, the app and the CM audio framework will "fight" a bit over volume levels. You will likely hear louder volume briefly when adjusting volume using the hardware volume buttons.

Only analog speaker and headphones are supported for audio outputs. The app has some experimental support for recording but it's unlikely to work on any phone at present.


The user interface has 3 "Blocks":
- Station Info. At top in portrait or top right in landscape.
- Presets. Middle in portrait or bottom in landscape.
- Mute/Power. Bottom in portrait or top left in landscape.


"Mute / Power" are simple on / off toggles. Power should automatically be enabled at app
startup. Bluetooth should be enabled automatically if not already enabled, but it's best to pre-enable it manually.

"Station Info" controls frequency via direct entry or left/right buttons. Tap frequency to enter manually. Frequency 102.1 MHz can be entered as "102.1" (with decimal) or "1021" or even "10210". Outside the US, NTSC channel 6 audio can be received (with lower volume) at "8775".

Tap the left or right arrows to move up or down one channel. Channels are 0.2 MHz apart in North America, and may be different elsewhere. The settings menu allows entering country/region to set things such as this increment. North America is default.

Long press the left or right arrows to seek to the next strong channel. This is working well for TI chips, but the Broadcom support for this is mostly broken at present.

"Station Info" also shows such info as RSSI, stereo/mono signal, and the 4 types of RDS data supported at present.

Presets: The app supports unlimited presets and multiple preset lists. The top or left button should display "LIST-1". Tap to select a list, or add a new list. Long press to rename or delete the list.

Pressing a preset button showing a frequency tunes to that frequency. To create a preset, tune to the desired frequency and long press any unused preset button. If there is a preset for that button already, you can select "Tune", "Replace", "Rename" or "Delete".

Once 5 presets are set, the right arrow will be enabled which allows moving to the next "page" of 5 presets.

On my Desire HD the app seems to automatically switch between speaker and headphones when plugging/unplugging the headphone jack. This does not work on my Legend.


The standard android phone "Menu" button provides access to "Settings", an "Enable/Disable Speaker" button which switches between speaker and headphones, and a "Sleep" function. The "Scan" button is not currently functional. The recording buttons may produce a file on the SD card (or may cause a crash!) but the file is unlikely to contain any FM audio.

The "Settings" menu allows changing region, which should change frequency limits, channel spacing, odd/even frequencies, pre-emphasis and RDS/RBDS switching as appropriate. Audio output mode can switch between stereo and audio. Alternate frequency is not yet functional. Factory Defaults should return the config to original.


At this time, the app sends hcitool output to a "fm1" file, on the /sdcard if available, otherwise in the app private cache directory. I will likely remove this requirement to write regularly to the file-system at some point.


This more or less completes my intro to the Spirit FM Radio app. This post will be regularly edited to contain the latest info.

Hmm, I was really looking forward to an FM app that doesn't require headset but alas, this doesn't work on GT540 with stock 2.1.
9th May 2011, 08:14 PM |#98  
Quinny899's Avatar
Recognized Developer / Recognized Contributor
Flag Salford, Greater Manchester, UK
Thanks Meter: 6,654
 
Donate to Me
More
Quote:
Originally Posted by nibras_reeza

Hmm, I was really looking forward to an FM app that doesn't require headset but alas, this doesn't work on GT540 with stock 2.1.

You'd have found it doesn't get much signal anyway, my 2.3.4 GT540 doesn't.


Sent from my GT540 using XDA App
9th May 2011, 08:39 PM |#99  
OP Inactive Recognized Developer
Flag Ottawa/Gatineau, Canada
Thanks Meter: 4,164
 
Donate to Me
More
Quote:
Originally Posted by 4silvertooth

https://github.com/mik9/android_packages_apps_FM
well if it helps here's repository of FM app which is running successfully on cm7 lgp500.
Note: Its not my work all credit to Mik for the work.

Thanks ! I'll investigate further but first thing I see is "We're using hack in libaudiopolicy to fix crappy FM behavior.."

Can you refresh me on your issue ? I looked back but can't figure out if you are looking to record FM, or if my app isn't running on your phone. I've had at least one report of success on Optimus One/p500 with the unofficial CM port I guess.


------------------------------------------------------------------------------------------------------------
I had mutlii-quote working before but can't figure it out now, LOL.


CR5N and avalst :
>Hi, tried this on HD2 running Tytung2.7 GB2.3.4. If I put in a frequency for a known strong transmission, I see signal bars but no audio from headset or speaker.
>I'm having the same issue on my EVO no sound on any station I've tried.

Yes, I think you are close, but you've run into the dreaded "audio routing" issue. Do you have "adb shell" on a PC ? Here are some things you can try if so. If not, perhaps a terminal emulator for the phone, just remove "adb shell" from these commands:

adb shell "echo fm_headset > /sys/class/htc_accessory/fm/flag"

adb shell "echo fm_speaker > /sys/class/htc_accessory/fm/flag"

If that fails, you can try this:

adb shell "touch /sdcard/fm_su"

But then you have to have a SuperUser.apk or similar installed, and when it requests su access you have to respond in the affirmative. All it does is a chmod on /dev/msm_snd so it can use an "ioctl" to route audio,


------------------------------
lupoalberto12:
>I tried it on my Wildfire but it doesn't work.


Do you get any indication of signal strength when set to a strong frequency ?


-------------------------
gmpurohit:
>Not working on my lg optimus one flashed with cm7..neither is shows signal strength..

OK. I don't know why I had one report of success on Optimus One with CM and many reports of failure. I will likely buy this phone soon and I'm sure I'll figure it out...


----------------------
nibras_reeza:
>Hmm, I was really looking forward to an FM app that doesn't require headset but alas, this doesn't work on GT540 with stock 2.1.


Stock ROMs seem to have these nasty proprietary BT stacks that make life difficult.

I've started a dev thread about this and hope to find solutions: http://forum.xda-developers.com/show...php?p=13627988
9th May 2011, 08:47 PM |#100  
altroy2's Avatar
Senior Member
Thanks Meter: 45
 
More
Thumbs up
Very cool
9th May 2011, 09:12 PM |#101  
Member
Thanks Meter: 1
 
More
Thanks a lot for your work and updates on the app!

I also would love to see this working with the BT stack on the Gingerbread releases of MIUI... bit weird that they dropped FM-Radio support while they brought it to CM7!

You rock, keep on rollin'
Post Reply Subscribe to Thread

Tags
spirit fm radio receiver ota

Guest Quick Reply (no urls or BBcode)
Message:
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes