[Spirit FM] mikereidis:
November 26: http://www.mediafire.com/file/2ew6hbcr9rzjsoq/Spirit_FM_Radio_v111126.apk

- Various small bug fixes, hopefully including one to address the "Crash on 2nd start" issue on Huawei u8800 and u9000 devices.

Nothing else yet for the Huawei's as I've concentrated on finishing AF, but soon.

- AF Alternate Frequency support. Hopefully it works much better now. Here's how it works:

The AF settings have moved from Debug to their own AF section.

First control is AF Mode. Default is Disabled. After changing this, power cycle the app. Every other parameter should be change-able on the fly, without a restart.

There is one very simple "Poor Mans" AF, using the Manual mode, which works without RDS and thus works with the free app. Set it, then scroll to bottom and set 2 frequencies manually": Alt Freq 1 and 2. Using this mode, when you are tuned to one of the frequencies, when the RSSI low detection is triggered, the frequency will be reset to the other. If both are low, it will switch back and forth endlessly.

The other 2 RDS modes, require RDS on, and keep RDS on, even when the screen is off. For "normal" AF select the "RDS" mode. For AF that includes "Regional Variants", select "RDS+Region". Regional variants are transmitters that may (or may not?) be carrying a different, regional program.

The next 3 parameters are part of the RSSI threshold detection. When RSSI goes below "AF RSSI Thresh" (default 16) for "AF Polls" (def 4) consecutive polls, spaced at "AF Period" (default 500) milliseconds apart, an AF switch will be triggered. This is true for Manual AF mode too.

So for AF switching to be initiated, by default, the RSSI must be less than 16 on 4 consecutive tests spaced half a second apart.

AF PI Mask set to the default of 65535 means that the PI of the new frequency, must be the same as the original frequency. A value of 0 disables PI checking completely. Might be useful if signals are not strong enough for RDS.

AF RSSI pause (Default 500 ms) is a delay after switching frequencies before RSSI is tested. Probably can be reduced to 100 or less.

AF PI timeout (default 4000 ms) is how long to wait for the PI after switching. My Galaxy S does this FAST in 200 ms ! I think the other chips have processors in them and have to do this with much slower software ! I'm disappointed: My HTC Legend only needs about 1.6 seconds or 1600 ms. My Broadcom devices sometimes need 4 seconds or so ! Another reason to disable PI checking. I'm thinking the trigger needs to be "tightened" if it's going to possibly result in long switching delays.

If you are tuned to a station with AF, you should see numbers at top right. "AF:9 R:7" means there are 9 AFs, and 7 of them are regional variants.

Press the "Deb" button (or Menu->Debug). Then select AF. You should now see a list of the AFs. "R:0" means "normal AF" and "R:1" means regional AF. If you are in normal "RDS" mode, the regional AFs will have their checkbox disabled. You can enable or disable any of the AFs.

None of the AF info is written to config at this time. It all disappears when you change frequencies (except via switching sometimes).

Press cancel to return to the app. Press "Switch" to test the switching. It sort of simulates a low RSSI condition.

Normally AF switching uses "Best Mode". That means it will test all AFs (and the original frequency) and will switch to the one with the highest RSSI, but ONLY if the RSSI exceeds the RSSI threshold that is also used to initiate switching, otherwise it returns to the original frequency.

Another mode is "First Mode". This will switch to the first AF that satisfies the minimum RSSI requirement. To enable this mode, set the RSSI threshold as desired, but with a negative number. For example, "-16" uses the default RSSI switching threshold of 16, but in this "First mode". If no AFs have an RSSI of at least 16 in this case, frequency switches back to the original frequency.

My app does not support this yet, but many radios that support AF also have a PI search feature. This feature is: When a preset is selected and the signal is low, it will automatically search for a transmitter with the stored PI for that frequency.

It may take a little while for AFs to show when a frequency is selected. This is due in part to the "confidence" algorithm that keeps bogus AFs out of the visible AF list, until they appear confirmed. There is also an aging mechanism that will remove stale AFs after a few minutes (but only if RDS is still working.)

The AF list is maintained across the switching, unless and until a new frequency is selected which has it's own AF list. Changing frequency manually or with presets, seek etc. clears the AF list.

That's all I can think of for now. The code is surprisingly complicated, and is likely to have bugs... to be realistic, it will always have bugs. Hopefully the main ones can be squashed soon.