Rockbox

This is the bug/patch tracker for Rockbox. Click here for more information.

Quick links: Bugs · Patches · Rockbox frontpage

| Tasklist |

FS#8151 - Signal strength meter for FM radio

Attached to Project: Rockbox
Opened by Przemysław Hołubowski (p.h.) - Tuesday, 13 November 2007, 21:28 GMT+2
Task Type Patches
Category FM Tuner
Status Unconfirmed
Assigned To No-one
Player Type All players
Severity Low
Priority Normal
Reported Version Daily build (which?)
Due in Version Undecided
Due Date Undecided
Percent Complete 0%
Private No

Details

The patch adds a line showing signal strength to a tuner's screen. The line looks like this: "Field strength: 54 dBu".

It's for players having TEA5767 or LV24020.

I've tested the patch on my H10. Unfortunately TEA5767 updates its field strength meter register only on station change. I don't know how LV24020 behaves.
   tuner_field_strength.patch (4.8 KiB)
 apps/lang/english.lang             |   17 +++++++++++++++++
 apps/lang/polski.lang              |   19 ++++++++++++++++++-
 apps/recorder/radio.c              |   16 ++++++++++++++++
 firmware/drivers/tuner/lv24020lp.c |    4 ++++
 firmware/drivers/tuner/tea5767.c   |    4 ++++
 firmware/export/lv24020lp.h        |    1 +
 firmware/export/tea5767.h          |    1 +
 firmware/export/tuner.h            |    2 +-
 8 files changed, 62 insertions(+), 2 deletions(-)

This task depends upon

Comment by Nikkhil (AceNik) - Tuesday, 04 December 2007, 18:27 GMT+2
synced to the rev15872
   tuner_field_strength_rev15872.patch (4.8 KiB)
 apps/lang/english.lang             |   17 +++++++++++++++++
 apps/lang/polski.lang              |   19 ++++++++++++++++++-
 apps/recorder/radio.c              |   16 ++++++++++++++++
 firmware/drivers/tuner/lv24020lp.c |    4 ++++
 firmware/drivers/tuner/tea5767.c   |    4 ++++
 firmware/export/lv24020lp.h        |    1 +
 firmware/export/tea5767.h          |    1 +
 firmware/export/tuner.h            |    2 +-
 8 files changed, 62 insertions(+), 2 deletions(-)

Comment by Przemysław Hołubowski (p.h.) - Wednesday, 05 December 2007, 00:32 GMT+2
The last version of the patch corrected a bit. Restored polish diacriticals and removed one unnecessary change (see polski.lang).
   tuner_field_strength_rev15872_mkII.patch (4.9 KiB)
 apps/lang/english.lang             |   17 +++++++++++++++++
 apps/lang/polski.lang              |   17 +++++++++++++++++
 apps/recorder/radio.c              |   16 ++++++++++++++++
 firmware/drivers/tuner/lv24020lp.c |    4 ++++
 firmware/drivers/tuner/tea5767.c   |    4 ++++
 firmware/export/lv24020lp.h        |    1 +
 firmware/export/tea5767.h          |    1 +
 firmware/export/tuner.h            |    2 +-
 8 files changed, 61 insertions(+), 1 deletion(-)

Comment by Lee Kang Hyuk (alwaysbluepop) - Friday, 14 December 2007, 05:54 GMT+2
interesting!
works fine on my x5,but poor TEA5767!
however this patch breaks the sim, so fix this.
   tuner_field_strength_rev15923.diff (4.7 KiB)
 apps/lang/english.lang             |   17 +++++++++++++++++
 apps/lang/polski.lang              |   17 +++++++++++++++++
 apps/recorder/radio.c              |   18 ++++++++++++++++++
 firmware/drivers/tuner/lv24020lp.c |    4 ++++
 firmware/drivers/tuner/tea5767.c   |    4 ++++
 firmware/export/lv24020lp.h        |    1 +
 firmware/export/tea5767.h          |    1 +
 firmware/export/tuner.h            |    2 +-
 8 files changed, 63 insertions(+), 1 deletion(-)

Comment by Joel Garske (gibbon_) - Thursday, 20 March 2008, 10:12 GMT+2
I used this patch to create a "Mute weak stations" patch (FS#8764), for anyone who likes the feature.
Comment by Przemysław Hołubowski (p.h.) - Thursday, 20 March 2008, 11:26 GMT+2
Please note that TEA5767 doesn't update it signal meter when it is read. It is updated when frequency is changed or you mute off.
Comment by Przemysław Hołubowski (p.h.) - Tuesday, 06 May 2008, 15:55 GMT+2
I've fixed a bug in LV24020LP field strength decoding. Tested on Sansa C250.
   tuner_field_strength_rev17396_v2.patch (5 KiB)
 apps/lang/english.lang             |   17 +++++++++++++++++
 apps/lang/polski.lang              |   17 +++++++++++++++++
 apps/recorder/radio.c              |   13 +++++++++++++
 firmware/drivers/tuner/lv24020lp.c |   10 ++++++++++
 firmware/drivers/tuner/tea5767.c   |    4 ++++
 firmware/export/lv24020lp.h        |    1 +
 firmware/export/tea5767.h          |    1 +
 firmware/export/tuner.h            |    2 +-
 8 files changed, 64 insertions(+), 1 deletion(-)

Comment by Przemysław Hołubowski (p.h.) - Tuesday, 27 May 2008, 15:39 GMT+2
This version of the patch does not break the sim. Synced to revision 17636.
   tuner_field_strength_v3.patch (5 KiB)
 apps/lang/english.lang             |   17 +++++++++++++++++
 apps/lang/polski.lang              |   17 +++++++++++++++++
 apps/recorder/radio.c              |   15 ++++++++++++++-
 firmware/drivers/tuner/lv24020lp.c |   10 ++++++++++
 firmware/drivers/tuner/tea5767.c   |    4 ++++
 firmware/export/lv24020lp.h        |    1 +
 firmware/export/tea5767.h          |    1 +
 firmware/export/tuner.h            |    2 +-
 8 files changed, 65 insertions(+), 2 deletions(-)

Comment by Nikkhil (AceNik) - Monday, 02 June 2008, 14:22 GMT+2
malformed patch at line 50
Comment by Nikkhil (AceNik) - Monday, 02 June 2008, 16:22 GMT+2
fixed silly mistake of malformed, error, you need to leave a line after each file is complete
   tuner_field_strength_v3.patch (5 KiB)
 apps/lang/english.lang             |   17 +++++++++++++++++
 apps/lang/polski.lang              |   17 +++++++++++++++++
 apps/recorder/radio.c              |   15 ++++++++++++++-
 firmware/drivers/tuner/lv24020lp.c |   10 ++++++++++
 firmware/drivers/tuner/tea5767.c   |    4 ++++
 firmware/export/lv24020lp.h        |    1 +
 firmware/export/tea5767.h          |    1 +
 firmware/export/tuner.h            |    2 +-
 8 files changed, 65 insertions(+), 2 deletions(-)

Comment by Przemysław Hołubowski (p.h.) - Monday, 02 June 2008, 20:55 GMT+2
Restored polish diacritical characters and synced to revision 17677.
   tuner_field_strength_v3_rev17677.patch (5 KiB)
 apps/lang/english.lang             |   17 +++++++++++++++++
 apps/lang/polski.lang              |   17 +++++++++++++++++
 apps/recorder/radio.c              |   15 +++++++++++++++
 firmware/drivers/tuner/lv24020lp.c |   10 ++++++++++
 firmware/drivers/tuner/tea5767.c   |    4 ++++
 firmware/export/lv24020lp.h        |    1 +
 firmware/export/tea5767.h          |    1 +
 firmware/export/tuner.h            |    2 +-
 8 files changed, 66 insertions(+), 1 deletion(-)

Comment by Bertrik Sikken (bertrik) - Friday, 19 February 2010, 15:27 GMT+2
Attached patch was synced to svn r24772, with the following changes:
* dropped the polish translation, it didn't sync properly anymore, and IMO we better do all translations at once
* fixed lv240x0 signal strength, I think the previous patch compared against the wrong values
Tested only on c200 which has a lv240x0 radio chip.

It looks like we're getting a "while-fm-screen" so this is a nice opportunity to revive this patch.
I'm thinking of having some kind of progressive icon that shows signal strength, similar to the volume icon (e.g. an antenna symbol with variable number of bars)

One thing I wonder about is in what unit the tuner driver should return the signal strength. Should we use dBuV like this patch, or maybe some kind of percentage?
   tuner_field_strength_v4_rev24772.patch (4.4 KiB)
 apps/lang/english.lang             |   17 +++++++++++++++++
 apps/recorder/radio.c              |   16 ++++++++++++++++
 firmware/drivers/tuner/lv24020lp.c |   10 ++++++++++
 firmware/drivers/tuner/tea5767.c   |    4 ++++
 firmware/export/lv24020lp.h        |    1 +
 firmware/export/tea5767.h          |    1 +
 firmware/export/tuner.h            |    1 +
 7 files changed, 50 insertions(+)

Comment by Przemysław Hołubowski (p.h.) - Saturday, 20 February 2010, 10:53 GMT+2
TEA5767 does not refresh signal strength register when you read it. It is refreshed when you for example set frequency or mute/unmute.
What about LV240x0? Do you get a new value on a new signal strength register read?

As to the signal strength presentation form - if we would have antenna symbol with bars then it would be nice to display dBu value too. In the way two user groups would benefit. Those who aren't familiar with dBu units would be informed how strong is signal with easy to understand bars and those who are familiar with dBu would be given more detailed information about signal strength. Furthermore I think that unfamiliar ones would quickly learn correlation between dBu value and symbolic bar level.
Comment by Bertrik Sikken (bertrik) - Wednesday, 24 February 2010, 16:25 GMT+2
The LV240x0 shows continuous updates.

The reason I asked about the unit is because I can imagine that different radio chips have different dBuV levels where they have "good" reception. I did have a look at the Si470x range of tuners and they also use 70 dBuV as maximum strength (it enables stereo at around 32 dBuV as far as I can tell), pretty similar to the LV240x0. Knowing this now, I think reporting the raw dBuV is fine.

Attached patch add support for the si470x tuner chips.
   tuner_field_strength_v5_rev24897.patch (5.2 KiB)
 apps/lang/english.lang             |   17 +++++++++++++++++
 apps/recorder/radio.c              |   16 ++++++++++++++++
 firmware/drivers/tuner/lv24020lp.c |   10 ++++++++++
 firmware/drivers/tuner/si4700.c    |    4 ++++
 firmware/drivers/tuner/tea5767.c   |    4 ++++
 firmware/export/lv24020lp.h        |    1 +
 firmware/export/si4700.h           |    1 +
 firmware/export/tea5767.h          |    1 +
 firmware/export/tuner.h            |    1 +
 9 files changed, 55 insertions(+)

Comment by Bertrik Sikken (bertrik) - Sunday, 18 April 2010, 17:09 GMT+2
Synchronised against svn r25670
   tuner_field_strength_v6_rev25670.patch (5.1 KiB)
 apps/lang/english.lang             |   17 +++++++++++++++++
 apps/recorder/radio.c              |   16 ++++++++++++++++
 firmware/drivers/tuner/lv24020lp.c |   10 ++++++++++
 firmware/drivers/tuner/si4700.c    |    4 ++++
 firmware/drivers/tuner/tea5767.c   |    4 ++++
 firmware/export/lv24020lp.h        |    1 +
 firmware/export/si4700.h           |    1 +
 firmware/export/tea5767.h          |    1 +
 firmware/export/tuner.h            |    1 +
 9 files changed, 55 insertions(+)

Comment by Bertrik Sikken (bertrik) - Saturday, 05 June 2010, 16:39 GMT+2
This patch has gone out of sync because some of the radio code has recently been refactored in more reasonably sized chunks. I still do like to have this feature in rockbox sometimes though.

Attached patch syncs to current SVN, but still misses the updates to radio/radio.c to show the strength actually on the screen.
   tuner_field_strength_v7_rev26579.patch (3.7 KiB)
 apps/lang/english.lang             |   17 +++++++++++++++++
 firmware/drivers/tuner/lv24020lp.c |   10 ++++++++++
 firmware/drivers/tuner/si4700.c    |    4 ++++
 firmware/drivers/tuner/tea5767.c   |    4 ++++
 firmware/export/lv24020lp.h        |    1 +
 firmware/export/si4700.h           |    1 +
 firmware/export/tea5767.h          |    1 +
 firmware/export/tuner.h            |    1 +
 8 files changed, 39 insertions(+)

Loading...