dev builds
themes manual
device status forums
mailing lists
IRC bugs
dev guide

Rockbox mail archive

Subject: [PATCH,RFC] avoid radio noise on sansa clipplus

[PATCH,RFC] avoid radio noise on sansa clipplus

From: Stefan Seyfried <>
Date: Wed, 07 Nov 2012 10:11:54 +0100

Hi all,

I'm new to rockbox development, so bear with me if I'm violating
the mailing list etiquette etc.

On my sansa clip+, there is a quiet, ticking noise on weak fm radio
I found out that this is probably due to the cpu being woken up to
update the display 5 times a second, even if the display is turned off.

This patch fixes the issue by not updating the display unless it is
turned on.

diff --git a/apps/radio/radio_skin.c b/apps/radio/radio_skin.c
index 521890c..0c05f33 100644
--- a/apps/radio/radio_skin.c
+++ b/apps/radio/radio_skin.c
_at__at_ -96,7 +96,13 _at__at_ void fms_fix_displays(enum fms_exiting toggle_state)
 int fms_do_button_loop(bool update_screen)
     int button = skin_wait_for_action(FM_SCREEN, CONTEXT_FM,
- update_screen ? TIMEOUT_NOBLOCK : HZ/5);
+ update_screen ? TIMEOUT_NOBLOCK :
+#if defined(HAVE_LCD_ENABLE) || defined(HAVE_LCD_SLEEP)
+ (lcd_active() ? HZ/5 : TIMEOUT_BLOCK)
+ HZ/5
+ );
     struct touchregion *region;
     int offset;

Unfortunately, if combined with the "backlight filters first
keypress: on" config option, this causes the display (including
RSSI) to also not be updated after it is woken up again, simply
because skin_wait_for_action() will not return if the keypress
was only turning on the backlight.
The following patch pushes a dummy event into the button queue
to work around that.

diff --git a/firmware/drivers/button.c b/firmware/drivers/button.c
index c165e8f..3e4e9e2 100644
--- a/firmware/drivers/button.c
+++ b/firmware/drivers/button.c
_at__at_ -316,7 +316,13 _at__at_ static void button_tick(void)
                             button_try_post(btn, data);
+ {
+#if defined(HAVE_LCD_ENABLE) || defined(HAVE_LCD_SLEEP)
+ /* propagate the backlight_on() up the queue with a dummy event */
+ button_try_post(BUTTON_NONE, 0);
                             skip_release = true;
+ }
 #else /* no backlight, nothing to skip */
                     button_try_post(btn, data);

I did test both patches and they work for me. However, I'm
not really sure that I understand all the implications to
other parts of the code, so comments are very welcome.
In case those patches are deemed acceptable for inclusion,
I'll produce a proper git patch that can be applied easily.

Best regards,

Stefan Seyfried
Linux Consultant & Developer -- GPG Key: 0x731B665B
B1 Systems GmbH
Osterfeldstra├če 7 / 85088 Vohburg /
GF: Ralph Dehner / Unternehmenssitz: Vohburg / AG: Ingolstadt,HRB 3537
Received on 2012-11-07

Page template was last modified "Tue Sep 7 00:00:02 2021" The Rockbox Crew -- Privacy Policy