FS#2608 - FM menu for iriver models and simulators

Attached to Project: Rockbox
Opened by Toni (ahellmann) - Sunday, 31 July 2005, 20:43 GMT
Last edited by Toni (ahellmann) - Sunday, 21 August 2005, 14:07 GMT
Task Type Patches
Status Closed
Assigned To No-one
Operating System
Severity Low
Priority Normal
Reported Version
Due in Version Undecided
Due Date Undecided
Percent Complete 100%
Votes 0
Private No


FM menu for iriver models and simulators

!! Do not expect to get sound output from this patch !!

But it includes the following:
- simulate FM on iriver target and SW simulators
- dummy functions for fm_radio_i2c_read/write()
(SH7034 only)
- screen: centered text (independent of font size)
- screen: bounding box (iriver only)
- automatically adding stations on opening the preset
- extended radio menu (freeze mode / peekmeter on/off /
tuning method)
- button handling changed (left/right: tune prev/next
station + other changes)
- sound off after radio exit
- minor other changes
- slightly smaller codesize on archos

To be done
- use language strings
- clock update in FM screen on RTC targets

In addition this patch includes two bug fixes (and
hopefully does not introduce new ones):
1.radio_load_presets(): if preset list includes >32
stations the SW crashed
2.status_draw(): updated every 0.5 sec because 'struct
status_info info' was not 'static'

I zipped the patch file and added the modified files +
screen shot, because for me 'patch < patchfile' does not
work (cygwin version 2.5.8)

Enjoy :-)
This task depends upon

Closed by  Hristo Kovachev (bger)
Sunday, 26 March 2006, 13:08 GMT
Reason for closing:  Out of Date
Comment by Anonymous Submitter - Monday, 01 August 2005, 11:55 GMT

> patch < patchfile
try adding "-p0", so this becomes "patch -p0 < patchfile". HTH!
Comment by Jonas Häggqvist (rasher) - Wednesday, 17 August 2005, 05:01 GMT

Could you perhaps update this?

After FM is implemented on iriver, this patch is probably
more useful.

It's a bit unclear to me from your description how much this
touches radio on archos targets?

Also, what do you mean by "sound off after radio exit"? It
should still be possible to exit the radio screen without
shutting off radio (to allow running plugins, changing
settings etc.)
Comment by Anonymous Submitter - Wednesday, 17 August 2005, 05:21 GMT

OK, I will update this patch . I will modify in the way, that it is
more compatible to the current key bindings. Thanks for your
Comment by Jonas Häggqvist (rasher) - Wednesday, 17 August 2005, 06:40 GMT

Just dump the simulator fixes - Linus fixed that already.
Comment by Linus Nielsen Feltzing (linusnielsen) - Wednesday, 17 August 2005, 09:10 GMT

I have reviewed the patch, and I have some comments:

1) Why did you remove the possibility to keep playing when
you exit the FM screen?

2) Why did you remove the possibility to add a preset?

3) You can't use constant strings for the texts, you must
add them to the language file.

4) Why did you change the update rate to not use the peak
meter frame rate?

5) I personally don't like changing presets with left/right,
and I'm sure many Rockbox users wouldn't want the interface
to change like that.
Comment by Toni (ahellmann) - Wednesday, 17 August 2005, 17:40 GMT

Linus, thanks for your review!

Here my comments on your comments/questions:
1) "Keep playing" on exit removed
OK, I was wrong. Both "stop sound" and "keep playing"
should be supported.

2) "Add Preset" removed
With current handling up to 3 steps (on ondio) are necessary
to add a station, and there are no obvious keys on ondio and
iriver to perform this task with one key.
My solution automatically adds the station to the preset list
(if not already there). I did not think of the possibility that
people would like to use the "station select" menu when they
can zap from one to the next station with left/right key. So I
kind of misused the opening of preset station menu for "Add
to Presets" purpose.

3) Strings must go to the language file.
The patch was only ment as a first proposal. If it would have
the chance to make its way into cvs of cause I would move
the strings into the language file.

4) Why did you change the update rate to not use the peak
meter frame rate?
Because the peakmeter often disturbs the radio reception on
ondio and fm/recorder.
The less screen manipulation the less disturbance. (My
preference is: no peakmeter)
In my patch the screen is naturally 'quit' if peakmeter is
switched off (except time update).
No need for 'screen freeze' option anymore.

5) Changing presets with left/right?
Because I started rockbox with an Ondio, my very first private
patch changed the preset selection to left/right. OK on the
other devices it is easier to select. But this is one of the two
main features my patch has: preset selection and x-/y-
centered text. All other things can be discussed,
but these two I personally like very much.

For all readers: Please let me know your opinions on
following features:
- x-/y-centered text with respect to status- and button-bar
- preset selection with left/right for the lazy ones like me
(instead of manual scan)
- manual scan with a "ManualTuning" yes/no option
- "Peakmeter" yes/no option
- default station 'names' (ex. '100.2' - again for the lazy ones)
- remove "screen freeze" option (because already virtually
frozen in my patch, except time update)
- peakmeter off by default
- optional background image ('radio_bg.bmp', black bounding
box as a first step)
- if I get it to work: wav recording functionality on the iriver
record button
Comment by Linus Nielsen Feltzing (linusnielsen) - Thursday, 18 August 2005, 05:37 GMT

2) I understand that it might be better for Ondio users, but
I would like the original interface for the other models.

3) Sure. The problem is that it has less chance of making it
into CVS if it isn't complete.

4) I'm with you regarding the peak meter. I don't want it
either. The "screen freeze" is just a lame hack to test if
the lcd updates is the problem. However, there might be a
better solution, by slowing down the LCD transfers in the
LCD driver.

5) I can probably live with the left/right preset switching,
as long as the preset list is there as well. Then I can
leave it in manual tuning mode and select presets from the
list. This will probably not work on the Ondio, but that's life.

BTW, if we add your patch, we will also need your full name
for the credits.
Comment by Toni (ahellmann) - Saturday, 20 August 2005, 17:00 GMT

I updated the fmradio patch to support radio sound. The main
differences to current software are listed below:
- iriver: preset options support on play button
- iriver: exit with sound: on long press to off button
- 'add preset' handling modified (as preset list select option)
- freeze option removed
- philips tuner station detection slightly improved
- x-/y-centered text
- peak meter off by default
- preset selection with left/right or via menu
Comment by Toni (ahellmann) - Sunday, 21 August 2005, 07:43 GMT

Forgot, to check the upload button last time. :-)
Antonius Hellmann
Comment by Linus Nielsen Feltzing (linusnielsen) - Sunday, 21 August 2005, 08:01 GMT

I haven't had the time to review it yet, but using a long
OFF press to exit the FM screen with sound is a really bad
idea, since a long OFF is used to turn the iriver off.

I think it should use the same button as when leaving the
WPS (joystick push).

Again: I need your real name for the credits.
Comment by Toni (ahellmann) - Sunday, 21 August 2005, 10:03 GMT

Use "long play" instead of "long off" for radio exit with sound
Comment by Toni (ahellmann) - Sunday, 21 August 2005, 14:07 GMT

This update includes a bugfix in my code and code size
- load presets only once after power on
- code size optimizations