yashsingh1/xdaforums huggingface dataset:
[Spirit FM] Kess78:
Thanks i tested it it works fine and the visualizer looks responsive conpared to others :)

Digital audio is cool for this features but I find the sound quality is still not as good as it is with analog, at least with the Xperia...

Also I tested the Xperia Z app with the visualizer on my Sola and it's quite laggy but it works fine, maybe Spirit works on the Z :) But I really don't see how the visualizer is related to the sound, maybe this is just a kind of video...
[Spirit FM] mikereidis:
You mean you liked the sound quality better on the X10 ? I'm not sure there's any such thing as analog FM audio on the CG2900 devices. Spirit does nothing special to enable digital.

I've never had discerning ears. $100 speakers sound fine to me. And a generation raised on highly compressed MP3s might not care much either.

But note that every single Android FM chip built in the last several years ALL convert the RF into digital. All the I & Q and stereo processing and 50/75 uS de-emphasis and other forms of processing is done with DSPs. Digital signal processors. It's just easier that way. Then most of the older ones convert it back to analog. Thankfully some newer ones retain the digital format until it needs to go to speaker or headset.

I have no idea how many bits they use or how good the ADCs and DACs are. Maybe some of them use 24 bits with 96-192 KHz sampling. (I expect to analyze how many bits and sample rates I can get from different phones. Currently just using the lowest common denominator of 16 bits at 44.1 KHz stereo CD quality.)

Point is that it's all digital at some point(s) in the receiver, and several points in the recording and transmission phases. But some digital is better than others.

Thanks, I never thought of just trying the Z app. Most of the visualizers I've seen place average person "eye candy" factors higher than anything that accurately represents much of anything.

It's a pretty good chance that Spirit will work on any stock device Sony releases this year, that supports FM. That's the beauty of using an open, documented API that the OEM doesn't change too often.

But I have doubts about the potential for Spirit sales on Sony devices. Same situation as with the Motorola's. There's a free Motorola app that works on stock and most custom Motorola ROMs.

The Sony app works fine on stock ROMs, and the Free Xperia project has an FM app going for their version of CM. And that's part of the "downside", if you'd call it that, of an open, documented and stable API, at least for anyone trying to sell an alternative FM app. LOL, that's life, I'll just concentrate on where the current needs are.

Some will appreciate Spirits' features, but most will be quite happy with the alternative free or Sony FM apps. There's even a modded Sony app that doesn't insist on headset plugin.
[Spirit FM] mikereidis:
Updated on Play now.

I didn't expect to update, but a few people have had unusual problems trying to download from Play. I'm guessing this might be related to the bogus virus warnings.

I'd also guess that there are very few apps like Spirit that contain executable binaries within them, and that several that do have this are likely malware.

And ROMs with the same false positive problem don't go through Play. So there are likely few Play apps with this problem and Google probably doesn't care too much.

--------

Superuser:

There's a new Superuser implementation in the March 6 CM nightlies. You'll be asked for SU to be given just once, for 10 minutes or forever. If you take to long to select, Spirit could lose the SU function; just restart Spirit if so.

New implementations have a higher risk of problems. EDIT: here's one; in portrait mode you can't select the time option...

Spirit now declares the proposed "android.permission.ACCESS_SUPERUSER" permission, and hopefully being pro-active in this way won't cause any issues, but it may.

When SuperUser or SuperSU has problems on many or on popular phones, I get a LOT of email.
[Spirit FM] fcalvo2938:
Spirit FM apk for T-Mobile Samsung Galaxy S II SGH-T989

I want to know which is the Spirit FM apk version that I have to download to install on my T-Mobile Samsung Galaxy S II SGH-T989. My carrier is from Argentina (not from U.S.). Will this app run well on my phone?

Android versión 4.0.4

Kernel versión 3.0.8

Thanks, Fernando.
[Spirit FM] _kankea:
Spirit FM with working audio on Optimus 2x?

YES! \o/

http://xdaforums.com/showthread.php?t=2177766

EDIT:

Well, not quite there yet. But still: YES! \o/
[Spirit FM] Captain_Throwback:
Re: [APP] Spirit FM: Broadcom,Texas Instruments,Samsung Silicon Labs & Qualcomm FM ch

So I've finally gotten to try Spirit FM Unlocked on my EVO 4G LTE. The main thing I wanted it for is the ability to record. So, I tried it and it works! However, the record settings don't appear to do anything (besides the path option). Every recording comes out as a .wav file. Is there any way to record in a compressed format? I plan on using this to record a day's worth of information, so the uncompressed wave format will be a limitation. If you need a log, just let me know.

But the Digital Audio sounds crisp and clear. Very nice work :).
[Spirit FM] alonsosjumper:
A question, I changed my mobile phone for a Chinese model called Newman N2. It has Radio FM but i don´t get to work Spirit FM. It´s possible to work in this model?

http://android-sale.com/es/newman-n2.html

Thanks.
[Spirit FM] mikereidis:
FM is not possible on this phone for any app. It's disabled in hardware. :(
[Spirit FM] mikereidis:
Great ! :) I hope it will sound better when I'm able to achieve a higher sample rate than 22K, & I may be able to increase bits from 16 to 24...

On custom ROMs, where WAV files are produced, the only non-filename digital settings that work are sample rate and stereo.

Compressed sound files are available (& sometimes the only option) on stock ROMs that explicitly support FM recording, such as high end Galaxy's and some recent Sony devices.

I expect to support sound file compression on custom ROMs later this year, possibly only in Spirit2.

I've moved from the goal of bringing out Spirit2 early this year, to bringing it out later, and putting at least some of the planned digital audio and other features into the existing Spirit1 Unlocked.

Technically, WAV files are limited to 4 GB in size. But I've seen a 6 GB recording that was dealt with properly, by players that read the file size instead of an internal size.

On the HTC devices, 4 GB is 13.5 hours, but on the Samsung's it's 6.75 hours.

You can double the length possibly, by setting mono instead of stereo. Same again if sample rate is set to 11025. I think this might work on the HTCs but I'm not positive; don't recall right now.
[Spirit FM] mikereidis:
Sorry, but I can't support devices that I've never heard of before. :(
[Spirit FM] mikereidis:
Nice ! :)

P990 was actually the most popular LG device running paid versions of Spirit, so I'm happy to enable it if it works well.

I'll post on that thread.
[Spirit FM] alonsosjumper:
And is there any way to know the Radio FM chip which takes this device?
[Spirit FM] mikereidis:
Most Chinese devices use a Mediatek chipset. I don't support it and don't expect to.

If you're really curious send me a debug log with Menu-> Test-> Email-> Logs and wait 20 seconds. Put something in the email referencing XDA and press Send.
[Spirit FM] Kess78:
Yes I mean that. I don't know if you noticed but on the Xperia when the signal goes low the high frequency of the sound "disappear". You need to have a very high RSSI (sometimes more than 62) to have the full stereo and every audio frequency.
[Spirit FM] mikereidis:
I don't notice, but the frequency spectrum on the visualizer should. FM audio cuts off like a cliff at 15 KHz, which is a little bit into the last octave shown of 11-22 KHz.

Most FM chips blend the stereo channels together to reduce noise when the signal is low. I guess some may limit frequency response too, connected or not. I'll keep an eye open for any controls next time I look at the V4L driver. The alternative to highs is high noise but I guess different people might have different priorities.

With Sony's new API, Spirit RSSI should never go over 62.5 . The API spec says maximum is 1000, and Spirit divides by 16 to roughly match other FM chips/APIs.

I spent half an hour translating emails from someone who didn't like that it maxed at 62 for semi-strong signals and couldn't show stronger. He had seen the older V4L support which gave a larger RSSI range, but no audio. The early max annoys me too but I'm not too keen on working with V4L at the same time as the Sony FM API.
[Spirit FM] alonsosjumper:
I sent you the log.
[Spirit FM] itandy:
@mike, just want to report a minor issue. This problem is like this.

1. Use Spirit FM to listen to radio

2. Switch to another app

3. Return back to Spirit FM by clicking on the notification bar

4. Stop and exit Spirit FM

5. Spirit FM keeps trying to close but after a long time it just stay there without exiting. During the course it will turn on BT. Finally the app can only be closed forcefully or I have to reboot the phone.

If I stay in Spirit FM all the time then it can successfully close itself. I'm using Light version and automatic settings. I've been having this issue for a long time so it's not just the latest version.

If you need any more information, please let me know. Thanks!
[Spirit FM] mikereidis:
No. The FM Analog Audio is mixed into the audio stream after digital processing. Positives include lower power consumption.

At some point I might be able to enable a digital audio connection. At this point I'm not sure it's possible though.

A digital audio connection would work around some of the "no audio" problems, and would also enable recording, so I'm very interested in trying to get this work at some point.

----

Gee, lightning just took out my Cable Modem, and now I'm tethered to my phone. Cool ! :)
[Spirit FM] mikereidis:
Yes, scoppyxda reported that above. I guess people DO use this... My copied response:

Notification menu access to the app was just recently disabled. I wasn't sure that anyone actually used it; I normally switch back by long pressing the Home button.

I disabled this function due to a bug which brought up a second copy of the app. Once I fix this bug I will re-enable the feature.
[Spirit FM] mikereidis:
Great !

I think that "Audio Method" works different than you think.

What it does is select a switch that can then be used by the Mute/Unmute and Speaker/Headset buttons.

Once the switch has been set, for example to Headset, the switch remains in that position. Changing the Audio Method only changes the switch that the buttons control.

Once you select an Audio Method, the way to see if it's actually working is to try the Speaker/Headset button and see if it works.

This makes it a bit more difficult to test the methods. Perhaps if Mute is selected before changing ? I'll try this out.

Just for reference, "All" means all methods except the default sfu_sdcs.
[Spirit FM] bkmo:
It works great in my Aria running cm7. No changes had to be made. The ui still needs a LOT of work. I am always bringing up a text input box because the touch area of the digital freq.display is too close to the seek buttons. Also the data displayed on the top right is way too cramped and is always displaying cut off words....
[Spirit FM] maxibeginner:
When I tried it on MIUI 1.6.17, switching to qsd8250 resulted in immediate mute, switching to All to immediate sound - even without leaving settings dialog. I just tapped on every radiobutton from top to bottom and then back.

Now on MIUI 1.6.24 qsd8250 still mutes, but All doesn't switch it on. After returning to main window and pause/play there it looks like any method works fine.
[Spirit FM] CR5N:
Using latest market release on HD2. QSD audio method works the best but still have to pause/play after selecting spkr/hdst. Seek doesn't work as is but not tried your suggestions a few pages back as yet. Will update after more testing.
[Spirit FM] mikereidis:
That's great bkmo !

Yes, the RDS Program Service text at upper right is a known bug introduced in the last version due to the Audio debug text.

OK, I'm continuing to consider ways to improve the UI. I'm thinking I could make it easier for someone to customise the XML files that tend to define the size, placement etc of UI items. And I think I could also support a skinning image feature; someone sent me a mockup that I liked and perhaps he or I will post it here.
[Spirit FM] bkmo:
Thanks for the continuing support Mike. You definitely are moving along quickly toward a great finished fm app.
[Spirit FM] mikereidis:
Hi. As my sig says: "...and hopefully Silicon Labs soon."

Technically "Cyanogenmod support" is not required, but it will likely make my job a bit easier if the CM FM app is working.

Have you tried Fm TwoO recently ? It was recently updated, perhaps partly because Bell changed something that makes it require root now. I'd guess they just changed the permissions on /dev/fmradio, and this seems like further proof the carriers don't want us to have regular FM.

Does your phone have a device named /dev/fmradio or similar ? If not, it will likely be required, whether it's my app or any other.
[Spirit FM] mikereidis:
:)

Applications are NEVER finished, LOL. (All meant in good humor and not to correct you.)

There's always another feature to add or bug to fix.
[Spirit FM] bkmo:
I hear what you are saying. Now that I look back it seems I chose the wrong word. What I meant to say was polished instead of finished. Keep on keeping on. You are doing real well.
[Spirit FM] g4rb4g3:
I tried you app on my Desire Z running MIUI 1.6.24 and it doesn't work.

I can scan for radio stations and get RDS :) but I can't hear anything.:(

I tried it with every single audio method, the logcat is with made with all.

I noticed that get some errors about /dev/msm_snd and saw that it doesn't exist on my phone.

# ls -l | grep msm
crw-rw---- 1 system audio 10, 31 Jun 25 09:30 msm_acdb
crw-rw---- 1 system audio 10, 57 Jun 25 09:30 msm_audio_dev_ctrl
drwxr-xr-x 2 root root 100 Jun 25 09:30 msm_camera
crw-rw---- 1 system audio 10, 55 Jun 25 09:30 msm_mp3
crw-rw---- 1 system audio 251, 0 Jun 25 09:30 msm_mp3_lp
crw-rw---- 1 system audio 10, 54 Jun 25 09:30 msm_pcm_in
crw-rw---- 1 system audio 251, 1 Jun 25 09:30 msm_pcm_lp_dec
crw-rw---- 1 system audio 10, 56 Jun 25 09:30 msm_pcm_out
crw-rw---- 1 system graphics 249, 0 Jun 25 09:30 msm_rotator
crw-rw---- 1 system audio 247, 0 Jun 25 09:30 msm_vidc_dec
crw-rw---- 1 system audio 246, 0 Jun 25 09:30 msm_vidc_enc
crw-rw---- 1 system audio 248, 0 Jun 25 09:30 msm_vidc_reg

I've made a logcat for you: http://pastebin.com/dCfTZWAt

Does your app need bluetooth to be enabled like CM FM Radio? I tried it with BT enabled but it didn't change anything.
[Spirit FM] mikereidis:
OK, thanks.

No, with Broadcom FM/combo chips my app can control the chip either via Bluetooth (hcitool or BT sockets via daemon) or via direct communications with the HCI UART. The app is smart enough now to try each of several modes and toggle the BT power state if needed.

In any case, the logs show you are using the UART mode OK.

EDIT: Is there a source code repository for Miui you can point me to ?

The Desire Z is a msm7x30 device. The msm7x30 audio method may be able to handle it, but the code uses /dev/msm_snd. Perhaps this would enable it before you start the app:

adb shell ln /dev/msm_audio_dev_ctrl /dev/msm_snd

If it still doesn't work, we can try to determine if the mediaserver is keeping the device open exclusively by starting the app, raising the volume and running the following:

adb shell "killall mediaserver; /data/data/com.mikersmicros.fm/files/ssd 1 11"

Please let me know...
[Spirit FM] mikereidis:
v110625 on mediafire only:

http://www.mediafire.com/file/7ml5i585in46cdw/Spirit_FM_Radio_v110625.apk

It hasn't been tested TOO much.

- Ad space removed. Now ads will appear in the same space as RadioText,

- Free/locked app works exactly like pay/unlocked app for 7 days from first install of this version. No ads and all RDS and frequency touch features (FTF). After 7 days app still works but with ads and without RDS or FTF.

Just FYI, app does not need re-unlock if upgraded and won't unless/until I upgrade lock mechanism in some distant future.

- App should look pretty much the same at any device resolution. I'd like to try to support a simple image skin and this should allow a single image to work on any device (in a single orientation) since the whole thing is scaled proportionately.

This means tablets would get huge buttons, but there shouldn't be any undue squishing or stretching on any device, unless the screen was very far from a 3:2 ration or so.

I've started some work to support Themes and Styles.

- Program Service (upper right) should be fixed.

- Audio Method switching now mutes using old method before switching to new method. Should give more accurate impression of which modes work.

- Removed Frequency Up and Down buttons. Should be harder to accidentally hit frequency control in center. In theory, the thumbwheel should be an acceptable alternative but I'm not sure I like exactly how it's working. Feedback appreciated.

- Notification window selection brings up the app again, but re-creates the bug that's been there since the first v2 releases. If you select with the app on screen, or when the app is still on the "stack" (IE, when Back was not used to exit) a new window is opened over the old.

Hitting back at this point returns you to the now inactive window. I've only spent about 10 minutes looking into this issue and I don't have a fix yet.

- Media buttons fixed.
[Spirit FM] Quinny899:
For some reason the above version needs to have me select a different audio & then go back to the top one for it to work, even though it starts with that one. When I start up it says select audio system
[Spirit FM] g4rb4g3:
Cool that it works without enabling BT, I guess this saves some energy.

MIUI is based of CM but they don't provide "their" source :mad:, the kernel is a stock CM 2.6.32 one. The one pershoot compiles for CM works for MIUI too. I tried his kernel too but /dev/msm_snd still didn't show up.

I tried it with the latest version you posted here now.

I tried adb shell ln /dev/msm_audio_dev_ctrl /dev/msm_snd before starting it but it still doesn't work. Logcat: http://pastebin.com/z1nEQwZ5

msm7x30_snd_set_device open /dev/msm_snd errno: 13

before errno: was 2

But I don't know what that means :confused:

FM analog audio enable utility v11.06.12
Copyright (c) 2011 Michael A. Reid. All rights reserved.Mode: "1" (1)
Func: "1" (11)
Opening device /dev/msm_snd
snd_fd: 3
ioctl return: -1 errno: Invalid argument (22)

edit: With the version 11.06.23 logcat looks a bit different: http://pastebin.com/z2KZ0ae3
[Spirit FM] mikereidis:
OK, thanks.

So you have to go through that procedure to get audio ? And re-do that procedure every FM/app power up ?

On some devices it will say "Config Audio Method" even if the audio works.

Once you do the procedure does the app show "Hdst" or "Spkr" where "Config Audio Method" was previously shown ?
[Spirit FM] mikereidis:
The "errno: Invalid argument" which I presume is from "ssd" indicates that /dev/msm_audio_dev_ctrl doesn't respond like /dev/msm_snd . I'll try to find out how to control it.

http://www.barricane.com/c-error-codes-include-errno

Errno 13 is "Permission denied". The app tries to change permissions; I'm not sure why that wouldn't work. These are the permissions on my device which lets anybody read or write: (I only have both because I did a link, in the opposite direction from yours)

adb shell ls -l /dev/msm_snd /dev/msm_audio_dev_ctrl

crw-rw-rw- 2 system audio 10, 42 Jun 25 04:35 /dev/msm_audio_dev_ctrl

crw-rw-rw- 2 system audio 10, 42 Jun 25 04:35 /dev/msm_snd

Errno 2 is "No such file or directory".

EDIT: I'm getting the impression the Desire Z is NOT an msm7x30 device but is an msm8k device. The CyanogenMod source I referenced may just be treating it like a 7k device.

So, the qsd8250 audio method may work with the same sort of trick before you start the app:

adb shell ln /dev/msm_audio_dev_ctrl /dev/msm_audio_ctl

I'm not feeling too confident about this, but it's worth a try. If it still doesn't work, mediaserver may be keeping the device open exclusively, so start the app, raise the volume and run the following:

adb shell "killall mediaserver; /data/data/com.mikersmicros.fm/files/ssd 2 1; /data/data/com.mikersmicros.fm/files/ssd 2 4"

This may enable the Headset. All 3 commands are on one line because the ssd commands need to run before the mediaserver is restarted. Have the volume up and be listening to the headset when running the command. If it works you'll get a few seconds of audio before mediaserver restarts. At that point, at least we'd know it works and can try some other things.

EDIT2: I seem to be finding some msm7k drivers that also use /dev/msm_audio_dev_ctrl, so it might be 7k after all.

If you have a /dev/snd directory, with files such as controlC0, these are ALSA drivers that might be a good target for enabling FM, but I don't have any code for this yet.
[Spirit FM] Quinny899:
Every time, and it shows HDST
[Spirit FM] mikereidis:
OK. I think you should be able to achieve the same effect by just toggling mute. Edit: And perhaps toggling Speaker/Headset. If so you are the second person for which a mute or speaker/headset toggle fixes audio. I may modify the app so it does this automatically at power up.

I'm trying to find the underlying issue. I'll presume 110622 and 110623 and likely previous releases worked OK. Edit: 110623 and 110625 seem identical in audio handling except when re-configuring audio method. So I think it was a version earlier than 110623 that was working for you. (?)
[Spirit FM] mikereidis:
I don't know what it is.

It provides a V4L /dev/radio0 API.

It has a Broadcom BT/WiFi chip, so that may be used for FM also. But I've never seen Broadcom chips used via V4L before.

Other than that it looks a bit like a US Galaxy Note2 using Exynos.
[Spirit FM] mikereidis:
Thanks for your report.

Stuff that's been that way for a long time is hard to fix. And harder to fix without breaking other Phone & ROM combinations. Similar problems can happen at startup where you have to stay with Spirit until power up is complete. A large re-write of the app (ie Spirit2) is needed to clean this up.

Bluetooth issues similar to this, or that prevent working at all, has been an issue since ICS. And there are very recent changes to a new, half-broken BT stack in Android 4.2.2 / CM10.1.

Do you use Bluetooth ? Is it usually on when Spirit starts ? And does Spirit turn BT off when Spirit starts ? I think this is the only circumstance in which Spirit would turn BT on when it stops. It's restoring the original state.

In this case I don't know why Spirit couldn't run with BT on, it's usually running with BT "allegedly" off that causes most problems.

If you started Spirit with BT already off perhaps this won't happen ? Send me a debug log with Menu-> Test-> Email-> Logs and press Send after 20 seconds.

Setting Debug-> HCI Access to "UART" or "BT Socket" and restarting Spirit might help, or at least give some clues.
[Spirit FM] alonsosjumper:
Yes, it has the same processor of Galaxy S3, the Exynos 4412.

Would it possible to get work with Spirit FM for having a Broadcom chip?