Mailing List archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[linux-dvb] PROC_FS patch and other stuff
Hi,
I have made a patch to add procfs support to the DVB HEAD drivers, which gives
you something like:
/proc/dvb/
/proc/dvb/adapter1
/proc/dvb/adapter1/frontend0
/proc/dvb/adapter1/frontend0/inversion
/proc/dvb/adapter1/frontend0/symbol_rate
/proc/dvb/adapter1/frontend0/modulation
/proc/dvb/adapter1/frontend0/pwm
/proc/dvb/adapter1/frontend0/ves1820
/proc/dvb/adapter1/frontend0/ber
/proc/dvb/adapter1/frontend0/uncorrected_blocks
/proc/dvb/adapter1/frontend0/signal_strength
/proc/dvb/adapter1/frontend0/SNR
/proc/dvb/adapter1/frontend0/status
/proc/dvb/adapter1/frontend0/caps
/proc/dvb/adapter1/frontend0/type
/proc/dvb/adapter1/frontend0/identify
/proc/dvb/adapter1/frontend0/frequency
/proc/dvb/adapter1/identify
/proc/dvb/adapter0
/proc/dvb/adapter0/frontend0
/proc/dvb/adapter0/frontend0/inversion
/proc/dvb/adapter0/frontend0/symbol_rate
/proc/dvb/adapter0/frontend0/modulation
/proc/dvb/adapter0/frontend0/pwm
/proc/dvb/adapter0/frontend0/ves1820
/proc/dvb/adapter0/frontend0/ber
/proc/dvb/adapter0/frontend0/uncorrected_blocks
/proc/dvb/adapter0/frontend0/signal_strength
/proc/dvb/adapter0/frontend0/SNR
/proc/dvb/adapter0/frontend0/status
/proc/dvb/adapter0/frontend0/caps
/proc/dvb/adapter0/frontend0/type
/proc/dvb/adapter0/frontend0/identify
/proc/dvb/adapter0/frontend0/frequency
/proc/dvb/adapter0/identify
Most items will look familiar, all of them output the current value, and the
relevant ones allow you to echo in a new value.
So you can tune a card by:
echo "162000000" > /proc/dvb/adapter0/frontend0/frequency
echo "QAM_64" > /proc/dvb/adapter0/frontend0/modulation
echo "6900000" > /proc/dvb/adapter0/frontend0/symbol_rate
(NOTE: only DVB-C supported right now! But the DVB-C related proc entries are
only created if you have a DVB-C card, so if you try this with DVB-S or -T
you'll just get fewer proc entries).
and do:
cat /proc/dvb/adapter0/frontend0/status
FE_HAS_SIGNAL
FE_HAS_CARRIER
FE_HAS_VITERBI
FE_HAS_SYNC
FE_HAS_LOCK
Now, while a lot of fun can be had with this, my initial reason to write this
was to allow easy changing of the ves1820 register values, and the cards PWM
value, without recompiling the driver. This in order to find more optimal
values, and to be able to do it with a bash script :-)
Hence:
vdr driver # cat /proc/dvb/adapter0/frontend0/ves1820
VES1820 Register settings
(QAM type, Register 1, Register 5, Register 8, Register 9)
QAM_16 140 164 162 145
QAM_32 140 120 116 150
QAM_64 106 70 67 106
QAM_128 106 54 52 126
QAM_256 92 38 35 107
And you can change these by for example:
echo "QAM_16 111 222 333 444" > ./ves1820
Also the /proc/dvb/adapterX/frontend0/pwm value can be changed like this.
After a lot of playing with the register values, I got slight improvements in
BER value, but not much, and still a lot of block errors. For QAM_64, BER is
like 10,000, but for QAM_128, it is usually 600,000.
The PWM value however, I changed from 52 (other card default is 21?), to 40,
("echo 40 > /proc/dvb/adapter0/frontend0/pwm") and now have a QAM_128 BER of
10,000, and no block errors! Massive improvement, since before I used to
always have problems watching QAM_128 channels. The 40 value was a random
number I pulled out of an unnamed place :)
Anyways, this patch is probably nowhere near clean enough to add to the
drivers, but I think a lot of good things can be done with proc filesystem
support, and will happily take pointers from more knowledgable people on this
list in order to improve and add on this.
For example to add support of per-card register and PWM values I had to
shuffle a few things around. Some proc related functions should also be in
their own file.
So this is basically for the people who are interested in playing with the
ves1820 register and PWM values to find the optimal values. You can now do so
without recompiling, and the first one to write a nice Perl script (BASH is
OK too :-) to scan for the best values gets a free beer!
Cheers,
Dennis
PS - There are a few additional printk's etc I have added over time to play
with, which are not really part of anything, and which I'll take out for the
"proper" patch.
PS2 - If you have PROC_FS enabled in your kernel, this patch will build with
PROC_FS automatically. If you disable this in dvb_procfs.h, you should get
the normal, clean HEAD driver.
-- This is where I put the patch last night, not as an attachment, but it
never went through anyway, probably too big? (35kb). Any suggestions where to
make it available? :-)
--
Info:
To unsubscribe send a mail to listar@linuxtv.org with "unsubscribe linux-dvb" as subject.
Home |
Main Index |
Thread Index