[pvrusb2] Channel-change script

Per Christian Henden perchrh at pvv.org
Sat Sep 10 18:42:39 CDT 2005


On Sunday 11 September 2005 01:14, Mike Isely wrote:
> With your permission I will add this to the pvrusb2 driver snapshot.
Sure, go ahead. 
I'm not using ctl_freq_table_channel and ctl_freq_table_value 
with this script, didn't notice them until after I sent the script to the 
list.

But if the frequencies file exists, 
then we can just do 

#!/bin/bash
i=0
freqlist=`cat ~perchrh/.tv/freqs|grep freq|cut -c 8-`
for freq in $freqlist
do
   echo $i > ctl_freq_table_channel/cur_val
   echo ${freq}000 > ctl_freq_table_value/cur_val
   let i++
done

to create the table.

I don't notice any difference in speed or anything when changing 
channels by setting the frequency in ctl_freq_table_value  
and by programming in the table and using ctl_channel. 
Is there a difference in what code gets executed by the driver?

-PER

> It also seems like it might be useful to script the creation of the
> mapping file as well...

Yes, definetely.

>   -Mike
>
> On Sat, 10 Sep 2005, Per Christian Henden wrote:
> > Hi,
> >
> > I made a script for changing channels (attached).
> > Consider this a preview release :)
> >
> > It assumes a file mapping channel names to frequencies exist.
> > The format is like this:
> >
> > [E5]
> > freq = 175250
> >
> > The file can be made combining output from scantv with frequencies
> > from /usr/local/share/xawtv/*.list
> >
> > I plan to automate the creation of this frequency file.
> >
> > It can be created like this:
> > #goes to xawtv frequency lists
> > cd /usr/local/share/xawtv
> > #shows me the files that are included
> > cat europe-west.list
> > #concatenates the files that are included
> > cat ccir-i-iii.list ccir-sl-sh.list  ccir-h.list uhf.list > ~/allids
> > #extracts channel ids from scantv output
> > cat ~/.tv/stations |grep "\["|cut -d "(" -f 2|cut -d")" -f 1 > myids
> > #combines channel ids with frequencies
> > (for id in `cat myids `; do grep -1 "\[$id\]" allids ;done) > freqs
> >
> > The placement of the file is given by the FREQUENCY_FILE variable in the
> > script, so make sure you change that to point to your frequency file.
> >
> > -PER


More information about the pvrusb2 mailing list