yashsingh1/xdaforums huggingface dataset:
[Spirit FM] mikereidis:
As with everything, yes and no. :)

Secret documentation and lack of source code play a part in my decision to not support Mediatek.

But these same reasons haven't stopped me from reverse engineering the details of APIs for other chips and devices.

The biggest issue with Mediatek is that their chips are almost exclusively used in very inexpensive devices that are mostly sold in lower wage countries such as China.

If anyone can point to a Mediatek device sold by one of the top tier manufacturers that is readily available in "Western" countries, it will be an unusual exception. AFAIK, there is no such phone from Samsung, HTC, Motorola, LG or even Asus. Their chips can't compete, except on price alone.

People with these devices mostly do not buy apps and thus do not support me.

And if I DID support Mediatek, I think I'd be getting more than 30 debug log emails per day from China, instead of the mere 10 per day or so.
[Spirit FM] mustasusi:
I'm sorry about my lack of knowledge but what exactly are UART and HCI? If the majority of HTC One users have root, including users with stock ROMs, aren't they on the safe side?

What about CM/AOSP versions if such already available for One?

I keep experiencing the overload volume\distorted sound quite often and I can't figure out the cause for it. it's all fine when I turn the radio off then leave the device untouched, no incoming communication that time but still, I turn it on again after only several minutes and it's overloaded. Other times I leave the device untouched for several hours (e.g. when go to sleep) then turn up again and it still sounds fine. The overload distortion can be worked around though, either rebooting the device (not sure about soft reboot) fixes it but a simpler way is to make a fictive phone call, even to myself. Soon as I dialed the number I can immediately end call and its fixed.

Are you planning to raise the sample rate back to 44Khz? It sounds a bit fishy on 22...
[Spirit FM] mikereidis:
No need to apologize. They are just 2 low level ways I have to access the FM chip but they both need root.

To be clear, "users" mean paid users of Spirit, who are my main concern. Most of them are on AOSP ROMs, in part because there is no other FM app besides Spirit that works on AOSP.

The HTC stock app is fine for most people and continues to work and be supported by HTC.

The UART low level method of FM chip access will not work when Bluetooth is on, and even when off there may be interference issues. Some of my customers using stock, rooted ROMs use Spirit because it can do FM over BT.

So FM over BT will no longer work on stock.

The HTC One runs at 44.1 KHz with good sized buffers. This problem only affects those with Qualcomm FM chips and the HTC One uses Broadcom.

If Spirit has root, to reset the whole audio system when FM is turned off you can enable Menu-> Settings-> Debug-> Power Restart Media. This is a brute force approach, but works around many problems on many phones, and is a lot easier than rebooting or calling your own phone.

I will be continuing to look for and resolve problems at the audio level. Oftentimes I can just use a different audio "port" and interference issues from the system become resolved.
[Spirit FM] mikereidis:
Spirit1 December 5 Beta is on Play only. I'm not releasing a Free version at this time. The previous Sept 18 is still pretty golden.

Google Play Unlocked customers who signed up previously should all be approved now and be able to get it.

Otherwise Unlocked customers can access this as a beta release by signing up here and I guess waiting for me to approve the request: https://play.google.com/apps/testing/com.mikersmicros.fm_unlock

Same for Spirit Light: https://play.google.com/apps/testing/com.mikersmicros.fm_li

There is 1 fix: For digital audio mode on KitKat 4.4 with the ART runtime.

There are 3 additions:

- Support for stock MotoG. (For root support and digital audio, use Spirit2.)

- A few months old attempt to support a stock LG G2. It didn't work for that one person, but someone may find it works.

- Stock HTC One: Popup warning about HTC disabling 3rd party FM access on stock KitKat 4.4. (Confirmed on dev edition release anyway.)

The previous public Spirit1 release was on Sept 18. That release was "golden", meaning the combined bug fixes weren't creating new bugs. If this release looks good over a few days, it or a later build will be available for general update. I expect the general update will "roll", IE start at 5% day one, 10% day two etc...

No matter what, there are always people convinced that a Spirit update messed something up, so good to go slow.

I'm pleasantly surprised that the "world didn't come crashing down" on Spirit1 over the last 2.5 months... :)
[Spirit FM] 089man:
Here the same.... Error if I click the links from. Mike message.

Mike, I have spirit 1 pay version. Where on play I found update to beta?

Next question.... Have found spirit 2 on play... Why we not become this as free update from spirit 1 to 2?

Why must pay 9 euro again? Or why not become a special price for users that pay spirit 1 legal?

I9100 Tapatalk 4, Rom1 Pound Rom 4.4 Kitkat
[Spirit FM] mikereidis:
The beta pages are supposed to be hidden if you haven't purchased the app and logged into google with that purchase account.

And even then sometimes people have problems.

Or maybe you need to go here first, for Unlocked at least: https://plus.google.com/u/0/communities/118032870995675059664?cfem=1

I haven't really used the beta testing features in Play yet.
[Spirit FM] 089man:
Mike, thanks for your time and great answer. Respect for your words.

I like your spirit1 from begin on. Never I had issues and if I had a little problem I ask you and you give every time fast and great support. Spirit I have now also more than 1 one year. It's works on Android 4.2.2 / 4.3.1 and now in kitkat on my s2 perfectly.

Never I would come to you and would say 2 years later that I will money back. Never I will do that...

With your spirit I have every day much fun and good feel when I can hear fm Musik.

At this time I not need spirit2.im happy with spirit1,all works perfectly...

I9100 Tapatalk 4, Rom1 Pound Rom 4.4 Kitkat
[Spirit FM] cajunflavoredbob:
The Z1 is just giving us all kinds of issues. The new Spirit UL beta force reboots the Z1.

Logcat and last_kmsg are attached.
[Spirit FM] mikereidis:
It's crashing in the Qualcomm V4L IRIS FM driver. The only time I've seen that ever before is because the module part of the driver wasn't loaded.

But your logs seem to indicate at last 7 seconds of operation with RDS coming out during that time. Did you see that ?

There are no changes in Spirit1 that would explain it. Is it repeatable after a reboot ? Spirit2 could cause interference if it's been run, though I saw no evidence in your log.
[Spirit FM] cajunflavoredbob:
The app ran for about 4-5 seconds before freezing for a couple more seconds and rebooting. It did pick up a station during that brief window, but offered no sound. This happens every time I run the beta, even after clearing data and releasing the privacy restrictions, as usual.

The normal, non beta, Spirit UL still works perfectly without ever entering the settings menu.

Sent from my Purple Fetish Brick (Z1)
[Spirit FM] soraxx:
tuner and RDS works on Ace 2 but there is no audio on 4.3
[Spirit FM] mustasusi:
I haven't tried over Bluetooth yet. I guess we still need a wire pinned to the headphone jack for a chance to receive anything, which kinda breaks the wireless concept.

The "power restart media" doesn't help much as I keep facing overload distortions from time to time that only a phone call or reboot can fix. I must have Root because if I didn't - Spirit wouldn't operate at all here. Unless I have to mount specific partitions using Root Explorer and set permissions too.

In fact, Spirit1 is quite usable on my device despite the overload distortion that can be solved. You are just one step away to support this device since you have done most of the work long ago! I Spirit 2 has no room for adjustments on its early stage - no sound, just a continuous beep.

HTC Max is nothing but a combination of HTC X\S hardware settings and HTC one's audio, as much as I can see it.

Is 5th Dec version released? On Google it's listed as 4th.
[Spirit FM] LenAsh:
Try the right thread

http://xdaforums.com/showpost.php?p=48157548&postcount=151
[Spirit FM] MarcusAnthonius:
I want to buy Spirit Free but I have a question; when I use Spirit Free and I search for the Dutch radio channel Radio 2 (FM 92.6) I hear everything but not the channel I was searching for.

In the settings I saw that I was searching in the Channels for North America but i'm living in Europe and there was no option for Europe.

Now is my question when I'm buying these app is there a setting that I'm choosing for the radio channels in Europe?

Thanks for the answer!
[Spirit FM] Kess78:
There are good progressions thanks for this version !

I still have no sound and only RDS when i don't start the stock app before.

But now when I first start the stock app the RDS don't stop in your app and the RSSI is ok !

In fact your app now work perfectly if I first start the stock app to enable the audio path.

The volume still get very loud for few times when I change it.
[Spirit FM] cos68:
Thanks for the update!

Your prior version was working fine but I had to try the new version anyway :)

This new version is giving me problems powering down your application. If I start your application and then press the on screen power button, I get the message "Please wait for power transition to complete" but nothing else happens.

This is the same for both my HTC Desire and LG GT540 phones.

If I leave your program by pressing the back button and then bring it back to the front by starting it again, then I can press the power button and the same message as above appears, but this time the application is shutting down correctly.

Thanks,

Claus
[Spirit FM] mikereidis:
Thanks Claus ! It's fixed for the next release.

Another workaround is to change phone orientation (portrait/landscape) before pressing the power button.
[Spirit FM] mikereidis:
Great ! I'm confident we can get the audio working.

Your SE X10 Mini may be one of the few devices with a stock ROM my app will work on.

Have you tried starting my app and under Settings, selecting each Audio Method in sequence to see if audio can be controlled ?

For audio, your X10 has a /dev/msm_snd device. Normally the "msm7x30" Audio Method should work, but the values passed may be different than on HTC devices.

If you can run:

adb shell /data/data/com.mikersmicros.fm/files/ssd 1 0

we may get some useful information. If there is no error, lines with "FM" in them are very interesting.

If you get "Opening device /dev/msm_snd" then this might work:

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

On my phones this will enable audio on the headset:

adb shell /data/data/com.mikersmicros.fm/files/ssd 1 9

You may also have audio control via ALSA. For information try this:

adb shell /data/data/com.mikersmicros.fm/files/ssd 4 0

If we can't get any progress with these commands, the next step will be collecting logs and perhaps I can look closely at the SE FM APK.
[Spirit FM] mikereidis:
Thanks ! I think we are REALLY close now.

The numbers above are different than I've seen before. Now we want to try commands like:

adb shell /data/data/com.mikersmicros.fm/files/ssd 1 <NUMBER>

So for HEADSET_FM try:

adb shell /data/data/com.mikersmicros.fm/files/ssd 1 39

and for HEADPHONE_FM:

adb shell /data/data/com.mikersmicros.fm/files/ssd 1 43

The *_LINEIN values seem to imply the ability to digitise audio and record.

I don't know what FARFIELD means, but guess that OP and CL are Open and Closed. DHVH is also a mystery acronym.

It would be useful to know the effects of using all of the above numbers. (I hope you can use up-arrow to retrieve and edit last command line.)

I would also guess that any number not shown above (IE without "FM" in it), from 26 to 62, would turn off FM audio when used.
[Spirit FM] mikereidis:
After your PM I did a bit of searching regarding FM on the CDMA Desire (BravoC).

Like the Desire this phone has a Broadcom combo chip, but nobody has ever had it working properly.

Kali on the CyanogenMod forums seems knowledgable about the attempt to enable FM. At least one poster there claimed someone at HTC had said it was possible, but never enabled.

One poster claimed to have heard static, so I would think there may be a usable analog audio connection, although it might be disabled on the current CM ROMs.

So, if audio is possible that just leaves the possibility of power or antenna wires to the Broadcom chip needing enabling.

IF it's possible to do this in software, there MIGHT be an unused function in one of the HTC ROM libraries.

When I run this command on my HTC Legend with TI chip:

adb shell strings /system/lib/libbluedroid.so

I see two functions regarding an FM Transmit antenna:

set_fmtx_antenna

check_fmtx_antenna

It's possible there is some version of the HTC bluedroid library that might enable an antenna connection to the headset wire.

One poster here managed to successfully solder an antenna to a location on his PCB marked "Antenna". It's possible the BravoC has a similar unconnected solder pad.
[Spirit FM] Kess78:
I tried first the numbers you told me and then all the numbers but none of them does something...

Every number send back the list of commands i posted in my previous post.

If I have the sound every number stop it. :(
[Spirit FM] mikereidis:
:( That's disappointing, we seemed so close.

Yes, the utility does that, showing information for each command. I should change that.

It's possible the numbers are not reported correctly; one of my phones does that for one number at least. I find it strange that the numbers start at 26 instead of 1.

I could create a test function that just keeps going through the numbers.

It's possible some other function needs to be called before or after.

I googled some of the sound device names but only found a few hits from log output. So I think the audio library source code is not public.

So, if you could send me or point me to the manufacturer FM Radio APK(s) I could look.

Also, running "adb logcat" and capturing the full output while starting and running the manufacturer FM app may give us the answers we need.

I'll try to create a function to do this debug log gathering when I can, but for now it's manual.

Thanks !
[Spirit FM] tmihai20:
I really like this little gem of yours. I hope I will be able to use after the 7 trial days have passed.
[Spirit FM] Kess78:
Here is what you asked, hope it will help.

Logcat while starting the FM app :

I/ActivityManager( 1229): Starting activity: Intent { act=android.intent.action.
MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=com.sonyericsson.
fmradio/.FMRadioActivity bnds=[122,153][178,218] }
I/ActivityManager( 1229): Start proc com.sonyericsson.fmradio for activity com.s
onyericsson.fmradio/.FMRadioActivity: pid=2235 uid=10015 gids={}
I/dalvikvm( 2235): Debugger thread not active, ignoring DDM send (t=0x41504e4d l
=38)
W/ResourceType( 1229): Skipping entry 0x7f040007 in package table 0 because it i
s not complex!
W/ResourceType( 1229): Skipping entry 0x7f040008 in package table 0 because it i
s not complex!
I/dalvikvm( 2235): Debugger thread not active, ignoring DDM send (t=0x41504e4d l
=52)
I/ActivityManager( 1229): Process com.levelup.beautifulwidgets (pid 2227) has di
ed.
D/dalvikvm( 2235): GC freed 869 objects / 80680 bytes in 58ms
I/CustomizationProvider( 1384): No configuration file: /system/etc/customization
/settings/com/sonyericsson/fmradio/custom_settings.xml
W/FM_Radio( 2235): Unable to parse Customfile - IOException: java.io.FileNotFoun
dException
I/FmReceiver( 2235): Sending callback
I/bluedroid( 1229): Starting hciattach daemon
I/ActivityManager( 1229): Displayed activity com.sonyericsson.fmradio/.FMRadioAc
tivity: 5462 ms (total 5462 ms)
W/FM_Radio( 2235): Unexpected state when PHF was inserted:CHIP_DISABLED
I/AudioFlinger( 1125): FM Radio active: 1
I/FMRXService( 1229): no volume setting in intent
I/FMRXService( 1229): mVolume 8
I/FMRXService( 1229): StubFmRxService:setChannelSpacing(): -------- Waiting...
D/FMRXService( 1229): StubFmRxService:enableRds(): -------- Waiting...
I/FMRXService( 1229): StubFmRxService:setRfDependentMuteMode(): -------- Waiting
...
W/InputManagerService( 1229): Window already focused, ignoring focus gain of: co
m.android.internal.view.IInputMethodClient$Stub$Proxy@4591c770

While using the app there are only :

W/FM_Radio( 2235): Not allowed state to get frequency in state:TUNING , returnin

g: 89000 (for exemple)

and

W/FM_Radio( 2235): Not allowed state to get frequency in state:WAITING_FOR_UI ,

returning: 103700

Don't think this is very usefull.

While stopping :

I/AudioFlinger( 1125): FM Radio active: 0
I/ActivityManager( 1229): Starting activity: Intent { cmp=com.sonyericsson.fmrad
io/.PowerOffActivity }
I/ActivityManager( 1229): Displayed activity com.sonyericsson.fmradio/.PowerOffA
ctivity: 249 ms (total 249 ms)
W/InputManagerService( 1229): Starting input on non-focused client com.android.i
nternal.view.IInputMethodClient$Stub$Proxy@459d2fa0 (uid=10015 pid=2235)
I/AudioFlinger( 1125): FM Radio active: 0
W/ResourceType( 1229): Skipping entry 0x7f040006 in package table 0 because it i
s not complex!
W/ResourceType( 1229): Skipping entry 0x7f040005 in package table 0 because it i
s not complex!
I/bluedroid( 1229): Stopping hciattach deamon
I/bluedroid( 1229): Stopping hciattach deamon

Good day :)
[Spirit FM] mikereidis:
There's almost nothing in your logs, which is unusual compared to most other FM apps.

But I'd guess that starting my app doesn't result in the "FM Radio active: 1" line, which is likely what we want to see.

I'll look at the APKs, thanks !

EDIT: After a quick look at the service I see a call to AudioManager->SetParameters with "fm_radio_active=on". I'd guess this call results in the line above.

I'll put this in a new Audio Method and we can see what happens.

I did a Google on "fm_radio_active" and the only hit was this post: http://xdaforums.com/showpost.php?p=13137128&postcount=839

It seems others have been trying to reverse-engineer the SonyEricsson audio (for X8 in this case).

Hopefully at some point, SonyEricsson will support the Android FM API they are developing and such sleuthing won't be necessary.

In so many cases we can see that various parts of Android aren't as open as we'd been led to believe (due to manufacturers, not Google). Thankfully the Java portion of Android apps is easy to decompile, which makes me wonder if this was Google's intention.
[Spirit FM] mikereidis:
OK... Is it working for you ?

HTC HD2 Leo w/ CM7 ?

Thanks...
[Spirit FM] mikereidis:
Can you try the July 16 version now on the Market ?

It has a new SonyEricsson Audio Method that I hope will work. If not by itself, perhaps in combination with the SSD utility.

Thanks !
[Spirit FM] mikereidis:
v July 16 is now on the market: https://market.android.com/details?id=com.mikersmicros.fm

Differences from the July 14 version posted here only:

- Fixed power button issue.

- Orientation configuration support added in Settings allows locking to Portrait or Landscape mode.

- For Sony Ericsson, added "Sony Ericsson" Audio Method.

----------

I'm out of town for at least 3 days starting Sunday. I will try to respond to posts & email etc, but won't have all my development resources.

Please report any bugs seen, and success or failure on newly supported devices. Thanks !
[Spirit FM] Kess78:
It works I have the sound ! Good job and thanks a lot.

But the volume is very loud : the first level is almost the max level on the stock app and when I start it before volume is normal.

Also i think the radio doesn't stop properly because i still heard a noise in my headphones that I always heard when fm radio is on. This noise stops after some seconds in the stock app.

As a suggestion I think it could be nice if the radio can automaticly be mute when the headphones are unplugged, and if they are unplugged for at least 10 secondes for example, the app shut down. I don't know if it's hard to do.
[Spirit FM] tmihai20:
Yes, it is working on my HD2 Leo with Typhoon (CM7 nightly). I found at least 2 audio modes that are functional :) And Bluetooth is not enabled, like CM7 Radio or MIUI Radio does.
[Spirit FM] mikereidis:
Woohoo ! :) It's great to hear that a new device has been conquered (more or less), especially when it's on a stock ROM.

Some others have also reported a volume issue; I should be able to come up with 1 or 2 solutions.

Does the stock SE FM app support speaker output ? For now the speaker/headset button just switches "Headset" & "Headphone", whatever those mean.

Yes, I can and will create some options regarding the headset/antenna connection.

Regarding audio not stopping, I did not enable the audio disable function so that this test code was more likely to function. If you'd like to try, the following commands should allow you to customise the audio control and test:

adb shell mkdir /data/data/com.mikersmicros.fm/files/opt/

adb shell mkdir /data/data/com.mikersmicros.fm/files/opt/aud/

adb shell mkdir /data/data/com.mikersmicros.fm/files/opt/aud/disable/

adb shell touch /data/data/com.mikersmicros.fm/files/opt/aud/custom

adb shell touch /data/data/com.mikersmicros.fm/files/opt/aud/disable/custom

adb shell "echo -n fm_radio_active=off > /data/data/com.mikersmicros.fm/files/opt/aud/disable/params"

Once I enable this code in the app it would be best to delete this customisation with:

adb shell rm -rf /data/data/com.mikersmicros.fm/files/opt/aud/
[Spirit FM] mikereidis:
Great ! So this is also known as the "Touch HD2" ; the Win Mobile device ? And the CM ROM has the CM FM app ?

The default sfu_sdcs Audio Method is likely best, particularly on CM ROMs. I presume that's one Audio Method and the other is ?

Yes, on Broadcom devices the app can communicate directly with the HCI UART when Bluetooth is off. This saves power and can work on devices with the Broadcom proprietary Bluetooth stack.

If my app is started with Bliuetooth on, and the stack is the open source Bluez stack, then it uses the BT APIs. If it can't it will turn BT off and attempt to go straight to the UART.
[Spirit FM] mikereidis:
I suspect there is some master volume setting somewhere that could solve this. But...

I added a setting for Volume Scale:

http://www.mediafire.com/file/9ii8acy7iif12ml/Spirit_FM_Radio_v110717.apk

Besides a couple of new log messages, the Volume Scale feature is the only difference between this version and vJuly 16 on the Market.

Default value is 100 (full scale). Range is 0-100. 0 is silent. 1 is the quietest.

Once it is set, adjust hardware volume controls to set the new scale. This manual adjustment/trigger is not needed at next power-on.

On CyanogenMod ROMs with the CM FM app you will get some interference from the audio library that calls hcitool. The best solution for such ROMs is:

adb shell mv system/xbin/hcitool system/xbin/hcitoo

But this won't allow the CM FM app to work.