This is the bug/patch tracker for Rockbox. Click here for more information.
Quick links: Bugs · Patches · Rockbox frontpage
FS#5448 - FM Radio TEA5767: New Features
Attached to Project:
Rockbox
Opened by Matthias Larisch (Matze88m) - Sunday, 28 May 2006, 00:06 GMT+2
Last edited by Dominik Riebeling (bluebrother) - Saturday, 04 June 2011, 22:48 GMT+2
Opened by Matthias Larisch (Matze88m) - Sunday, 28 May 2006, 00:06 GMT+2
Last edited by Dominik Riebeling (bluebrother) - Saturday, 04 June 2011, 22:48 GMT+2
|
DetailsI spent a few hours on making FM Radio of my H300 fitting my optionion :)
This patch is coded not with much attention to the coding rules, so no use of langfiles and some other not very fine things. Features: Range from 1MHz to nearly 134MHz. Frequencyrange is selectable in radio menu. Frequencysteps: 8192, 32768, 50000, 100000, 500000 HZ for fast and for fine tuning (8192Hz is minimum step for tea5767) Highside/Lowsideinjection can be chosen via menu to remove noise of unwanted stations... mostly works for me :) (code works but effect is not always there) And finally the thing i coded first, some weeks ago and which is VERY unstable (not really unstable, but not really good working): signalstrength indicator with "Softwaremute". When strength drops below 1, volume is decreased by 0/10/15/20, if it raises above 2 volume is increased same value. Set it to 0 for off. I recommend the Off-setting because it doesnt really work and consumes some CPU power (->+ more noise because you hear every cpuactivity in the radio). The signalstrengthindicator is then also off. Why did I code this? a) the german "CB-Funk" around 27MHz works fine :) b) flight-radio, 108-133MHz is fine also ^^ Well, it is AM so you HAVE noise while listening, but it is okay. |
This task depends upon
Closed by Dominik Riebeling (bluebrother)
Saturday, 04 June 2011, 22:48 GMT+2
Reason for closing: Out of Date
Additional comments about closing: this is not going to get in in that state. Plus, no updates since years.
Saturday, 04 June 2011, 22:48 GMT+2
Reason for closing: Out of Date
Additional comments about closing: this is not going to get in in that state. Plus, no updates since years.
and it seems to be pretty much constant (per PLL setting) although the mono/stereo flag changes as I plug/unplug the antenna (i.e., headphones :)
--- manual diff ---
edit apps/debug_menu.c and add to dbg_fm_radio():
#include "tuner.h"
...
bool fm_detected
+unsigned long regs;
...
lcd_puts(0, 0, buf);
+regs = philips_get(RADIO_ALL);
+snprintf(buf, sizeof buf, "Tuner registers: %08lx", regs);
+lcd_puts(0, 1, buf);
lcd_update();
...
ADC value was only updated after some sending to the tunerchip... That is why I set force mono to false every time before the reading. Another aspect of a not-very-fine thing in the code :) But I think for the one who needs this indicator, it is a really good thing. Perhaps you could (or I could?) add an "everytimethere" Signalindicator with regularly updates only when the backlight is on (this would cause problems with the remote... but that is another point. as i dont have a remote i can't take this into account) to reduce noise and cpu power consumed. Maybe we could constantly put the cpu into idle mode while radio is on and backlight is off? That would further remove noise. And it should decrease power drain a bit. We could even put the whole thing into a "sleep"state after 1 minute of backlight off so rockbox does NOTHING than checking for keys about once a second... Shouldnt this increase battery life drastically? (->sleep mode for Ram, sleep mode for lcd controller, maybe even shutdown the hddcontroller?) It should be possible to listen to radio with about only 50mA (15 for tea5767, another 15 for soundmixer and amplifier and some... well... small amounts for cpu and powercontroller and so on), that would be 1300/50 -> >25 hours with original battery.
Well,I'm dreaming^^ sry
tuner_philips.c: In function `philips_set':
tuner_philips.c:57: error: `RADIO_HIGHSIDEINJECTION' undeclared (first use in this function)
tuner_philips.c:57: error: (Each undeclared identifier is reported only once
tuner_philips.c:57: error: for each function it appears in.)
tuner_philips.c: In function `philips_get':
tuner_philips.c:144: error: `RADIO_STRENGTH' undeclared (first use in this function)
I'm guessing this would also work on h100 and ondio as well, since they use the exact same chip?
Danke shon.
If you intend to tune into non-radio frequencies that's of course a different thing.
apps/recorder/radio.c:
Line 100-110:
Edit the preset u want to use later. DEEMPH_50 is correct for u. You can change Min-Freq, Max Freq and Freq_step. (All in Hz)
The Bandlimit is only used for searching the next station and is not relevant for the Frequencylimits used by rockbox (for now, maybe some day a new patch will implement reading the BandLimitReached-Flag of the tunerchip)
Thats all :)
Good luck,
Matze
1) Although I have changed /* Europe*/ to /* Ukraine */ in the radio.c when operating H320 tuner it still says Europe mode on the screen. How do I change that?
2) I have picked up a few stations on the 64-88MHz FM dial and was able to positively identify them using my other digital PLL radio. But the station that I need to pick up is looud and clear on that PLL FM radio but does not show up on the H320. There's just white noise. The signal is too weak (probably)? Although looking at http://www.rockbox.org/twiki/pub/Main/DataSheets/TEA5767HN_2.pdf I could tell that the sensitivity of the H320 tuner is pretty good. Has selectivity anything to do with it? What can be done?
I appreciate your time and help very much
Igor
The /* Europe */ is just a comment in the source. You have a LANG_EUROPE or something like this in the same line, thats the constant used for language. in your english.lang or whatever you're using u can change the specific one to your wishes.
The tuner itself does only work correct for upper frequencies, maybe down to 60-70MHz. I never got it receiving anything lower than that (although i wrote about CB-Funk (27MHz) in my first post. I dont know why i wrote that, now :) ) Maybe your wanted station is lower?
Tune a bit around, you never get it tuned? Maybe lower the frequency step size... that can be as low as 8192.
BTW: On the x5 putting the CPU in idle mode is a _cause_ of a lot of noise. I may look into allowing slowing of the i2c drivers when code requests as the only real noise left was when reading out the Stereo/Mono display which must be polled for.
- you can't tune lower than 76 MHz because of the mixer. See page 7, section 7.2 and others. Maybe you could trick that by using a different VCO frequency.
- you can write anything to the PLL you want, even 1MHz. If it's outside of the range of the mixer you'll get white noise.
Apart from that, the name displayed in the setting is in the lang file, not in the source itself.
To Michael Sevakis: Could you share with me some of those steps on improving selectability/reception? I am not a programmer but being an engineer in my blood I hope I can figure it out :-)
And God bless all of you guys working on the Rockbox, what an amazing gadget my H320 now is!
I'll do better. I'll give you the patch as it was at the time. Don't know if it will still apply cleanly.
For scanning and tuning:
*check high/low side injection for best signal strength
Next step for scanning:
*check tuned status, ADC level and IF counter, if in proper ranges, add station
Note that my algorithm deviates from the tea5767 app notes but gave me the same results or better. The scanning is better than the original firmware which misses a good number of stong local stations. My FM region is US/Canada BTW.
EDIT:
Added app notes to datasheets page. http://www.rockbox.org/twiki/pub/Main/DataSheets/application_note_tea5767-8.pdf
EDIT Again: Cleaner link :)
Thank you! I will have a look at it in the next days
It's not useful for everyone, so it should probably be in a separate screen, or enabled by a setting somewhere, but it doesn't seem completely useless. It might be outdated now though?