Re: [vdr] pvrinput radio - need analogradio??

2007-02-13 Thread Simon Baxter
It looks like this plugin does something wrong with the analog radio on
the OEM PVR-150 card.

With channels.conf set to:
Radio 91ZM:90900:I999C0:C:0:0:300:305:A1:12003:1:1007:0

v4l2-ctl --all   looks like this:

Audio input : 0 (Tuner 1)
Frequency: 1454 (90.875000 MHz)
Video standard = 0x00ff
PAL-B/B1/G/H/I/D/D1/K
Tuner:
Capabilities : 62.5 kHz multi-standard
Frequency range  : 44.0 MHz - 958.0 MHz
Signal strength  : 0%
Current audio mode   : mono
Available subchannels:


Where ivtv-radio -f90   looks like this:

Audio input : 0 (Tuner 1)
Frequency: 1454400 (90.90 MHz)
Video standard = 0x00ff
PAL-B/B1/G/H/I/D/D1/K
Tuner:
Capabilities : 62.5 Hz stereo
Frequency range  : 65.0 MHz - 108.0 MHz
Signal strength  : 50%
Current audio mode   : stereo
Available subchannels: stereo


it appears pvrinput isn't setting the right audio mode/sub channels etc??


Any ideas?

PS.  It looks like analogradio  plugin is no longer supported?  Is also
doesn't support ALSA.

?

 I've asked this before, last year, but never had a response.

 How do I configure radio channels in VDR.

 My channels.conf has:

 Classic Hits:9:I999C0:C:0:0:300:305:A1:12003:1:1006:0

 But I think I'm picking up the wrong device, as I hear no audio.  I have a
 single PVR-150 with ivtv and the following devices:

 /dev/video0
 /dev/video24
 /dev/video32

 When I do a 'ivtv-radio -f9' I see:
 aplay -f dat  /dev/video24#which works

 Sowhat should my Parameters be??

   C0   - Input 0
   C12  - Input 1
   C23  - Input 2
   C34  - Input 3
   C45  - Input 4
   C56  - Input 5
   C67  - Input 6
   C78  - Input 7
   C89  - Input 8
   C999 - Input 9


 Thanks - in advance!



 ___
 vdr mailing list
 vdr@linuxtv.org
 http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr




___
vdr mailing list
vdr@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr


[vdr] xmltv2vdr speedup and modification

2007-02-13 Thread Morfsta

Hi,

I'm the original author of xml2vdr (for my sins!), thanks for working on it
and improving the performance.

If everyone is happy with this new code release and it really improves the
speed I'll wrap it up and make a formal release and get Klaus to add it to
the VDR FTP site.

As a lot of people seem to use xml2vdr, perhaps it would be good to
resurrect it and keep it formally updated?

Regards,

Morfsta



On 2/12/07, Sebastien Lucas [EMAIL PROTECTED] wrote:


Hi,

I recently worked on xmltv2vdr.pl (version 1.0.6) and checked why it
was so slow on my mighty Celeron 233. So I modified it a little to
avoid reading all the xmltv file for each channel defined in the
channels.conf. The result is good : I can process my 5Mo xmltv file in
less than 10 minutes whereas it took at least 1 hour with vanilla
1.0.6 release.

I also added support for sub-title in the xmltv file (I think someone
already posted about that in the list).

I only use it for one week so it can still be buggy. I'll be happy to
take care of any bug found.

Hope this helps those with old hardware like me.

Sebastien

___
vdr mailing list
vdr@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr



___
vdr mailing list
vdr@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr


Re: [vdr] xmltv2vdr speedup and modification

2007-02-13 Thread Sebastien Lucas

On 2/12/07, [EMAIL PROTECTED]
[EMAIL PROTECTED] wrote:

 I recently worked on xmltv2vdr.pl (version 1.0.6) and checked
 why it was so slow on my mighty Celeron 233. So I modified it
 a little to avoid reading all the xmltv file for each channel
 defined in the channels.conf. The result is good : I can process
 my 5Mo xmltv file in less than 10 minutes whereas it took at least
 1 hour with vanilla 1.0.6 release.

Something more what you can do (just by looking source you provided)..

--

Caching of xmltime2vdr, like

return $timecache{$xmltime}-{$skew} if defined 
$timecache{$xmltime}-{$skew}
$secs = Date::Manip::UnixDate($xmltime, %s) + $skew*60;
$timecache{$xmltime}-{$skew} = $secs
return secs;

But it depends on how much this function is called.. But hash lookup is probably
faster than running UnixDate from library. So it is a memory tradeoff.


I still haven't tested it but I doubt it'll help . I'll check later.


I see that there is still some basic Perl based optimizations for this.

For example there is browsing through @xmllines array, and every iteration
you recompile *ALL* regexp's. That is as many times as @xmllines has lines.
And if one recompile takes 1ms - you waste time @xmllines * 1ms just for
compiling and not doing anything usefull.

Perl switch o is recompile once flag, use that everywhere where it is
possible. Variable is not a problem unless variable changes in every iteration.


[]

I didn't know that (I'm not really a perl guru ... far from it). I'll
update my version. But it didn't help at all with my benchmark.



--

As there is many times $xmlline is matched with regexps etc. You should 
experiment
with study $xmlline; after chomp $xmlline. Study makes internal search tables
for string matches. So see which way the code is faster, with study or without
study. Use Unix shell's time-command for this. For extra boost with study you
probably would need to take away subroutine xmltvtranslate as for it $xmlline
is copied to subroutine's parameter space, and what is matched. And study would
not affect it. So instead of calling $xmlline=xmltvtranslate($xmlline); 
cutpaste
subroutines code here, and use $xmlline instead of $line.

foreach $xmlline (@xmllines)
{
chomp $xmlline;
study $xmlline;
$xmlline=~s/und uuml;/ü/go;
$xmlline...

This isn't pretty but could probably help a bit. You save time for @xmllines 
times calling
subroutine, and study would help you a lot as you use the same string all the 
time.



I'll check that later.



For constant string you could use ' ' instead of  .  causes string to be
evaluated for variables

if ( $chanCur eq  ) -- if ( $chanCur eq '' )

But this would be very minor effect..



I'll surely be too lazy to test that. sorry.



Split is heavy operation because of creating arrays, but you can limit it.

( $null, $xmlst, $null, $xmlet, @null ) = split(/\/, $xmlline);

= ( $null, $xmlst, $null, $xmlet, $null ) = split(/\/, $xmlline, 5);

or even using regexp for this. I don't know input line for this, but if it is
foo,something,something,...

($xmlst,$xmlet) = $xmlline =~ m:\(.*?)\,\(.*?)\:o;

or probably combine 2 regexp to a single

($xmlst,$xmlet,$channel) = $xmlline =~ 
m:\(.*?)\,\(.*?)\.*?channel=\(.*?)\:o;

--

Again something very weird:

if ( ($xmlline =~ /\title/ ) )
{
#print $xmlline . \n;
( $null, $tmp ) = split(/\/, $xmlline);
( $vdrtitle, @null ) = split(/\/, $tmp);

# Send VDR Title

SVDRPsend(T $vdrtitle);
}

Why not?

SVDRPsend(T $1) if $xmlline =~ m:\title\(.*?)\/title\:o;

Same for XML subtitle
SVDRPsend(T $1) if $xmlline =~ m:\sub-title\(.*?)\/sub-title\:o;


Yes I'll also prefer shorter code. I'll check further if something
like title lang=en is also allowed to adapt the regex. For
information that change has no impact on my bench.


Generally
   if ( ($xmlline =~ /\desc/ )  ( $desccount == $dc ))
{
( $null, $tmp ) = split(/\/, $xmlline);
( $vdrdesc, @null ) = split(/\/, $tmp);

this is not a clever way to parse XML data in Perl. Just us regexp's which
match strings with Boyer-Moore algorithm (same as Unix grep) and compile once.



Agree. I'll try to modify it.



Some logical errors

if ( ($xmlline =~ /\programme/ )  ( $xmlline !~ /clumpidx=\1\/2\/ )  ( 
$chanevent == 0 ) )

= if ( ( $chanevent == 0 )  ($xmlline =~ /\programme/ )  ( $xmlline !~ 
/clumpidx=\1\/2\/ ) )

so program execution can skip if $chanevent != 0 much faster.
So Regexp would not be ran. This is normal short circuit operation.



In fact the check $chanevent == 0 is only usefull if the xml is not
well formed so it doesn't change anything.


Then
elsif ( $chanCur ne $chan )
{
SVDRPsend(c);
SVDRPsend(.);
SVDRPreceive(250);

I think programmer wanted outout of . -command, and see if it's 

Re: [vdr] xmltv2vdr speedup and modification

2007-02-13 Thread Sebastien Lucas

On 2/13/07, Morfsta [EMAIL PROTECTED] wrote:

Hi,

I'm the original author of xml2vdr (for my sins!), thanks for working on it
and improving the performance.


I know and thanks for it.


 If everyone is happy with this new code release and it really improves the
speed I'll wrap it up and make a formal release and get Klaus to add it to
the VDR FTP site.


I'd be happy it goes that way.


As a lot of people seem to use xml2vdr, perhaps it would be good to
resurrect it and keep it formally updated?


Yes there also was some interesting post in this mailing list about xmltv2vdr.

Thanks for your post.

Sebastien

___
vdr mailing list
vdr@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr


RE: [vdr] xmltv2vdr speedup and modification

2007-02-13 Thread jori.hamalainen
 

 But it didn't help at all with my benchmark.
 ...
 For information that change has no impact on my bench.

Interesting, what version of Perl are you running if those
changes don't do anything?

---

Futher improvement is that now it is unnecessary to read whole
XML-file into memory, as the file is linearly scanned through. So no
need to waste 5MB of memory if you are short of it.

--
# Read all the XMLTV stuff into memory - quicker parsing
open(XMLTV, $xmltvfile) || die cannot open xmltv file;
@xmllines=XMLTV;
close(XMLTV);

sub ProcessEpg
# Find XML events

foreach $xmlline (@xmllines)

--

= 
open(XMLTV, $xmltvfile) || die cannot open xmltv file;

sub ProcessEpg

while($xmlline = XMLTV) 

___
vdr mailing list
vdr@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr


Re: [vdr] [ANNOUNCE] VDRAdmin-AM v3.5.3

2007-02-13 Thread Stone

On 1/26/07, Christian Wieninger [EMAIL PROTECTED] wrote:


Stone wrote:
 Is epgsearch 0.9.20 available or is there an intermediary patch for
0.9.19?

sorry, not yet. I hope to release it within the next days.




Thanks for the updates.

Has anyone noticed that the timeline page in vdradmin does not work with
the new IE7?  Anyone know of a workaround?

Best Regards.
___
vdr mailing list
vdr@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr


Re: [vdr] [ANNOUNCE] VDRAdmin-AM v3.5.3

2007-02-13 Thread Matthias Fechner
Hello Stone,

* Stone [EMAIL PROTECTED] [13-02-07 18:44]:
 Has anyone noticed that the timeline page in vdradmin does not work with
 the new IE7?  Anyone know of a workaround?

With Firefox is everything fine, so I think it is a bug in IE7. Easily
use Firefox and everthing is fine.


Best regards,
Matthias

-- 

Programming today is a race between software engineers striving to
build bigger and better idiot-proof programs, and the universe trying to
produce bigger and better idiots. So far, the universe is winning. --
Rich Cook

___
vdr mailing list
vdr@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr


Re: [vdr] pvrinput radio - need analogradio??

2007-02-13 Thread Simon Baxter
OK.

In order to get the correct info from a v4l2-ctl --all:
Format:
Type: VBI Capture
Sampling Rate   : 2700 Hz
Offset  : 248 samples (9.18519e-06 secs after leading edge)
Samples per Line: 1440
Sample Format   : GREY
Start 1st Field : 6
Count 1st Field : 18
Start 2nd Field : 318
Count 2nd Field : 18
Video input : 0 (Tuner 1)
Audio input : 0 (Tuner 1)
Frequency: 144 (90.00 MHz)
Video standard = 0x00ff
PAL-B/B1/G/H/I/D/D1/K
Tuner:
Capabilities : @@ -881,12 +881,19 @@
 bool cPvrDevice::Tune(int freq)
 {
struct v4l2_frequency vf;
+int freqaux = freq;

memset(vf, 0, sizeof(vf));
vf.tuner = 0;
-   vf.type = V4L2_TUNER_ANALOG_TV;
+if (freq  8800)
+vf.type = V4L2_TUNER_ANALOG_TV;
+else
+{
+   log(3, Changing to RADIO);
+vf.type = V4L2_TUNER_RADIO;
+freqaux = freq * 1000;
+}
vf.frequency = (int) ((double) freq * 16.0 / 1000.0 + 0.5);
-
if (IOCTL(video_fd, VIDIOC_S_FREQUENCY, vf) != 0)
{
log(0, Error tuning to %d: %s, freq, strerror(errno));
62.5 Hz stereo
Frequency range  : 65.0 MHz - 108.0 MHz
Signal strength  : 50%
Current audio mode   : stereo
Available subchannels: stereo



I patched as follows:



 Thanks Jose - that's a great help!

 El Martes, 13 de Febrero de 2007 12:16, Jose Alberto Reguero escribió:
 I use this modified code in device.c (pvrinput):

 bool cPvrDevice::Tune(int freq)
 {
 struct v4l2_frequency vf;
 int freqaux = freq;

 memset(vf, 0, sizeof(vf));
 vf.tuner = 0;
 if (freq  18)
 vf.type = V4L2_TUNER_ANALOG_TV;
 else
 {
 vf.type = V4L2_TUNER_RADIO;
 freqaux = freq * 1000;
 }
 vf.frequency = (int) ((double) freqaux * 16.0 / 1000.0 + 0.5);

 if (IOCTL(video_fd, VIDIOC_S_FREQUENCY, vf) != 0)
 {
 log(0, Error tuning to %d: %s, freq,
 strerror(errno));
 return false;
 }
 frequency = freq;
 return true;
 }

 But I have some problems with radio(pvrinput), and xineliboutput.

 The problem I have is that after a while sound is distorted an finally
 sound
 stop. There is not any messages in the log. I don't know if is pvrinput
 or
 xineliboutput fault.

 Jose Alberto


 Jose Alberto

 El Martes, 13 de Febrero de 2007 11:01, Simon Baxter escribió:
  It looks like this plugin does something wrong with the analog radio
 on
  the OEM PVR-150 card.
 
  With channels.conf set to:
  Radio 91ZM:90900:I999C0:C:0:0:300:305:A1:12003:1:1007:0
 
  v4l2-ctl --all   looks like this:
 
  Audio input : 0 (Tuner 1)
  Frequency: 1454 (90.875000 MHz)
  Video standard = 0x00ff
  PAL-B/B1/G/H/I/D/D1/K
  Tuner:
  Capabilities : 62.5 kHz multi-standard
  Frequency range  : 44.0 MHz - 958.0 MHz
  Signal strength  : 0%
  Current audio mode   : mono
  Available subchannels:
 
 
  Where ivtv-radio -f90   looks like this:
 
  Audio input : 0 (Tuner 1)
  Frequency: 1454400 (90.90 MHz)
  Video standard = 0x00ff
  PAL-B/B1/G/H/I/D/D1/K
  Tuner:
  Capabilities : 62.5 Hz stereo
  Frequency range  : 65.0 MHz - 108.0 MHz
  Signal strength  : 50%
  Current audio mode   : stereo
  Available subchannels: stereo
 
 
  it appears pvrinput isn't setting the right audio mode/sub channels
 etc??
 
 
  Any ideas?
 
  PS.  It looks like analogradio  plugin is no longer supported?  Is
 also
  doesn't support ALSA.
 
  ?
 
   I've asked this before, last year, but never had a response.
  
   How do I configure radio channels in VDR.
  
   My channels.conf has:
  
   Classic Hits:9:I999C0:C:0:0:300:305:A1:12003:1:1006:0
  
   But I think I'm picking up the wrong device, as I hear no audio.  I
   have a single PVR-150 with ivtv and the following devices:
  
   /dev/video0
   /dev/video24
   /dev/video32
  
   When I do a 'ivtv-radio -f9' I see:
   aplay -f dat  /dev/video24#which works
  
   Sowhat should my Parameters be??
  
 C0   - Input 0
 C12  - Input 1
 C23  - Input 2
 C34  - Input 3
 C45  - Input 4
 C56  - Input 5
 C67  - Input 6
 C78  - Input 7
 C89  - Input 8
 C999 - Input 9
  
  
   Thanks - in advance!
  
  
  
   ___
   vdr mailing list
   vdr@linuxtv.org
   http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr
 
  ___
  vdr mailing list
  vdr@linuxtv.org
  http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr

 ___
 vdr mailing list
 vdr@linuxtv.org
 

Re: [vdr] pvrinput radio - need analogradio??

2007-02-13 Thread Simon Baxter
OK.

In order to get the correct info from a v4l2-ctl --all:
Format:
Type: VBI Capture
Sampling Rate   : 2700 Hz
Offset  : 248 samples (9.18519e-06 secs after leading edge)
Samples per Line: 1440
Sample Format   : GREY
Start 1st Field : 6
Count 1st Field : 18
Start 2nd Field : 318
Count 2nd Field : 18
Video input : 0 (Tuner 1)
Audio input : 0 (Tuner 1)
Frequency: 144 (90.00 MHz)
Video standard = 0x00ff
PAL-B/B1/G/H/I/D/D1/K
Tuner:
Capabilities : @@ -881,12 +881,19 @@
 bool cPvrDevice::Tune(int freq)
 {
struct v4l2_frequency vf;
+int freqaux = freq;

memset(vf, 0, sizeof(vf));
vf.tuner = 0;
-   vf.type = V4L2_TUNER_ANALOG_TV;
+if (freq  8800)
+vf.type = V4L2_TUNER_ANALOG_TV;
+else
+{
+   log(3, Changing to RADIO);
+vf.type = V4L2_TUNER_RADIO;
+freqaux = freq * 1000;
+}
vf.frequency = (int) ((double) freq * 16.0 / 1000.0 + 0.5);
-
if (IOCTL(video_fd, VIDIOC_S_FREQUENCY, vf) != 0)
{
log(0, Error tuning to %d: %s, freq, strerror(errno));
62.5 Hz stereo
Frequency range  : 65.0 MHz - 108.0 MHz
Signal strength  : 50%
Current audio mode   : stereo
Available subchannels: stereo



I patched as follows:



 Thanks Jose - that's a great help!

 El Martes, 13 de Febrero de 2007 12:16, Jose Alberto Reguero escribió:
 I use this modified code in device.c (pvrinput):

 bool cPvrDevice::Tune(int freq)
 {
 struct v4l2_frequency vf;
 int freqaux = freq;

 memset(vf, 0, sizeof(vf));
 vf.tuner = 0;
 if (freq  18)
 vf.type = V4L2_TUNER_ANALOG_TV;
 else
 {
 vf.type = V4L2_TUNER_RADIO;
 freqaux = freq * 1000;
 }
 vf.frequency = (int) ((double) freqaux * 16.0 / 1000.0 + 0.5);

 if (IOCTL(video_fd, VIDIOC_S_FREQUENCY, vf) != 0)
 {
 log(0, Error tuning to %d: %s, freq,
 strerror(errno));
 return false;
 }
 frequency = freq;
 return true;
 }

 But I have some problems with radio(pvrinput), and xineliboutput.

 The problem I have is that after a while sound is distorted an finally
 sound
 stop. There is not any messages in the log. I don't know if is pvrinput
 or
 xineliboutput fault.

 Jose Alberto


 Jose Alberto

 El Martes, 13 de Febrero de 2007 11:01, Simon Baxter escribió:
  It looks like this plugin does something wrong with the analog radio
 on
  the OEM PVR-150 card.
 
  With channels.conf set to:
  Radio 91ZM:90900:I999C0:C:0:0:300:305:A1:12003:1:1007:0
 
  v4l2-ctl --all   looks like this:
 
  Audio input : 0 (Tuner 1)
  Frequency: 1454 (90.875000 MHz)
  Video standard = 0x00ff
  PAL-B/B1/G/H/I/D/D1/K
  Tuner:
  Capabilities : 62.5 kHz multi-standard
  Frequency range  : 44.0 MHz - 958.0 MHz
  Signal strength  : 0%
  Current audio mode   : mono
  Available subchannels:
 
 
  Where ivtv-radio -f90   looks like this:
 
  Audio input : 0 (Tuner 1)
  Frequency: 1454400 (90.90 MHz)
  Video standard = 0x00ff
  PAL-B/B1/G/H/I/D/D1/K
  Tuner:
  Capabilities : 62.5 Hz stereo
  Frequency range  : 65.0 MHz - 108.0 MHz
  Signal strength  : 50%
  Current audio mode   : stereo
  Available subchannels: stereo
 
 
  it appears pvrinput isn't setting the right audio mode/sub channels
 etc??
 
 
  Any ideas?
 
  PS.  It looks like analogradio  plugin is no longer supported?  Is
 also
  doesn't support ALSA.
 
  ?
 
   I've asked this before, last year, but never had a response.
  
   How do I configure radio channels in VDR.
  
   My channels.conf has:
  
   Classic Hits:9:I999C0:C:0:0:300:305:A1:12003:1:1006:0
  
   But I think I'm picking up the wrong device, as I hear no audio.  I
   have a single PVR-150 with ivtv and the following devices:
  
   /dev/video0
   /dev/video24
   /dev/video32
  
   When I do a 'ivtv-radio -f9' I see:
   aplay -f dat  /dev/video24#which works
  
   Sowhat should my Parameters be??
  
 C0   - Input 0
 C12  - Input 1
 C23  - Input 2
 C34  - Input 3
 C45  - Input 4
 C56  - Input 5
 C67  - Input 6
 C78  - Input 7
 C89  - Input 8
 C999 - Input 9
  
  
   Thanks - in advance!
  
  
  
   ___
   vdr mailing list
   vdr@linuxtv.org
   http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr
 
  ___
  vdr mailing list
  vdr@linuxtv.org
  http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr

 ___
 vdr mailing list
 vdr@linuxtv.org
 

Re: [vdr] pvrinput radio - need analogradio??

2007-02-13 Thread Jose Alberto Reguero
El Martes, 13 de Febrero de 2007, Simon Baxter escribió:
 OK.

 In order to get the correct info from a v4l2-ctl --all:
 Format:
 Type: VBI Capture
 Sampling Rate   : 2700 Hz
 Offset  : 248 samples (9.18519e-06 secs after leading edge)
 Samples per Line: 1440
 Sample Format   : GREY
 Start 1st Field : 6
 Count 1st Field : 18
 Start 2nd Field : 318
 Count 2nd Field : 18
 Video input : 0 (Tuner 1)
 Audio input : 0 (Tuner 1)
 Frequency: 144 (90.00 MHz)
 Video standard = 0x00ff
 PAL-B/B1/G/H/I/D/D1/K
 Tuner:
 Capabilities : @@ -881,12 +881,19 @@
  bool cPvrDevice::Tune(int freq)
  {
 struct v4l2_frequency vf;
 +int freqaux = freq;

 memset(vf, 0, sizeof(vf));
 vf.tuner = 0;
 -   vf.type = V4L2_TUNER_ANALOG_TV;
 +if (freq  8800)

I think this don't work. I use freq 18 because 18   is the max range 
for FM.
You can also use:

if (radio_fd = 0)
radio
else
tv

Jose Alberto

 +vf.type = V4L2_TUNER_ANALOG_TV;
 +else
 +{
 +   log(3, Changing to RADIO);
 +vf.type = V4L2_TUNER_RADIO;
 +freqaux = freq * 1000;
 +}
 vf.frequency = (int) ((double) freq * 16.0 / 1000.0 + 0.5);
 -
 if (IOCTL(video_fd, VIDIOC_S_FREQUENCY, vf) != 0)
 {
 log(0, Error tuning to %d: %s, freq, strerror(errno));
 62.5 Hz stereo
 Frequency range  : 65.0 MHz - 108.0 MHz
 Signal strength  : 50%
 Current audio mode   : stereo
 Available subchannels: stereo

 I patched as follows:
  Thanks Jose - that's a great help!
 
  El Martes, 13 de Febrero de 2007 12:16, Jose Alberto Reguero escribió:
  I use this modified code in device.c (pvrinput):
 
  bool cPvrDevice::Tune(int freq)
  {
  struct v4l2_frequency vf;
  int freqaux = freq;
 
  memset(vf, 0, sizeof(vf));
  vf.tuner = 0;
  if (freq  18)
  vf.type = V4L2_TUNER_ANALOG_TV;
  else
  {
  vf.type = V4L2_TUNER_RADIO;
  freqaux = freq * 1000;
  }
  vf.frequency = (int) ((double) freqaux * 16.0 / 1000.0 + 0.5);
 
  if (IOCTL(video_fd, VIDIOC_S_FREQUENCY, vf) != 0)
  {
  log(0, Error tuning to %d: %s, freq,
  strerror(errno));
  return false;
  }
  frequency = freq;
  return true;
  }
 
  But I have some problems with radio(pvrinput), and xineliboutput.
 
  The problem I have is that after a while sound is distorted an finally
  sound
  stop. There is not any messages in the log. I don't know if is pvrinput
  or
  xineliboutput fault.
 
  Jose Alberto
 
  Jose Alberto
 
  El Martes, 13 de Febrero de 2007 11:01, Simon Baxter escribió:
   It looks like this plugin does something wrong with the analog radio
 
  on
 
   the OEM PVR-150 card.
  
   With channels.conf set to:
   Radio 91ZM:90900:I999C0:C:0:0:300:305:A1:12003:1:1007:0
  
   v4l2-ctl --all   looks like this:
  
   Audio input : 0 (Tuner 1)
   Frequency: 1454 (90.875000 MHz)
   Video standard = 0x00ff
   PAL-B/B1/G/H/I/D/D1/K
   Tuner:
   Capabilities : 62.5 kHz multi-standard
   Frequency range  : 44.0 MHz - 958.0 MHz
   Signal strength  : 0%
   Current audio mode   : mono
   Available subchannels:
  
  
   Where ivtv-radio -f90   looks like this:
  
   Audio input : 0 (Tuner 1)
   Frequency: 1454400 (90.90 MHz)
   Video standard = 0x00ff
   PAL-B/B1/G/H/I/D/D1/K
   Tuner:
   Capabilities : 62.5 Hz stereo
   Frequency range  : 65.0 MHz - 108.0 MHz
   Signal strength  : 50%
   Current audio mode   : stereo
   Available subchannels: stereo
  
  
   it appears pvrinput isn't setting the right audio mode/sub channels
 
  etc??
 
   Any ideas?
  
   PS.  It looks like analogradio  plugin is no longer supported?  Is
 
  also
 
   doesn't support ALSA.
  
   ?
  
I've asked this before, last year, but never had a response.
   
How do I configure radio channels in VDR.
   
My channels.conf has:
   
Classic Hits:9:I999C0:C:0:0:300:305:A1:12003:1:1006:0
   
But I think I'm picking up the wrong device, as I hear no audio.  I
have a single PVR-150 with ivtv and the following devices:
   
/dev/video0
/dev/video24
/dev/video32
   
When I do a 'ivtv-radio -f9' I see:
aplay -f dat  /dev/video24#which works
   
Sowhat should my Parameters be??
   
  C0   - Input 0
  C12  - Input 1
  C23  - Input 2
  C34  - Input 3
  C45  - Input 4
  C56  - Input 5
  C67  - Input 6
  C78  - Input 7
  C89  - Input 8
  C999 - Input 9
   
   
Thanks - in advance!
   
   
   

Re: [vdr] pvrinput radio - need analogradio??

2007-02-13 Thread Simon Baxter
OK.

In order to get the right tuning values from v4l2-ctl --all:

Format:
Type: VBI Capture
Sampling Rate   : 2700 Hz
Offset  : 248 samples (9.18519e-06 secs after leading edge)
Samples per Line: 1440
Sample Format   : GREY
Start 1st Field : 6
Count 1st Field : 18
Start 2nd Field : 318
Count 2nd Field : 18
Video input : 0 (Tuner 1)
Audio input : 0 (Tuner 1)
Frequency: 144 (90.00 MHz)
Video standard = 0x00ff
PAL-B/B1/G/H/I/D/D1/K
Tuner:
Capabilities : 62.5 Hz stereo
Frequency range  : 65.0 MHz - 108.0 MHz
Signal strength  : 50%
Current audio mode   : stereo
Available subchannels: stereo


I patched as follows:

@@ -881,12 +881,19 @@
 bool cPvrDevice::Tune(int freq)
 {
struct v4l2_frequency vf;
+int freqaux = freq;

memset(vf, 0, sizeof(vf));
vf.tuner = 0;
-   vf.type = V4L2_TUNER_ANALOG_TV;
+if (freq  8800)
+vf.type = V4L2_TUNER_ANALOG_TV;
+else
+{
+   log(3, Changing to RADIO);
+vf.type = V4L2_TUNER_RADIO;
+freqaux = freq * 1000;
+}
vf.frequency = (int) ((double) freq * 16.0 / 1000.0 + 0.5);
-
if (IOCTL(video_fd, VIDIOC_S_FREQUENCY, vf) != 0)
{
log(0, Error tuning to %d: %s, freq, strerror(errno));


and my channels.conf looks like this:

Radio Classic Hits:9000:C0:C:0:0:300:305:A1:12003:1:1006:0


It's tuning ok now - but I still get no audio.

I'm struggling with this.  I somehow need the plugin/VDR to listen to
effectively tune and then do an equivalent of:
aplay -f dat  /dev/video24


how do I do this??




 Thanks Jose - that's a great help!

 El Martes, 13 de Febrero de 2007 12:16, Jose Alberto Reguero escribió:
 I use this modified code in device.c (pvrinput):

 bool cPvrDevice::Tune(int freq)
 {
 struct v4l2_frequency vf;
 int freqaux = freq;

 memset(vf, 0, sizeof(vf));
 vf.tuner = 0;
 if (freq  18)
 vf.type = V4L2_TUNER_ANALOG_TV;
 else
 {
 vf.type = V4L2_TUNER_RADIO;
 freqaux = freq * 1000;
 }
 vf.frequency = (int) ((double) freqaux * 16.0 / 1000.0 + 0.5);

 if (IOCTL(video_fd, VIDIOC_S_FREQUENCY, vf) != 0)
 {
 log(0, Error tuning to %d: %s, freq,
 strerror(errno));
 return false;
 }
 frequency = freq;
 return true;
 }

 But I have some problems with radio(pvrinput), and xineliboutput.

 The problem I have is that after a while sound is distorted an finally
 sound
 stop. There is not any messages in the log. I don't know if is pvrinput
 or
 xineliboutput fault.

 Jose Alberto


 Jose Alberto

 El Martes, 13 de Febrero de 2007 11:01, Simon Baxter escribió:
  It looks like this plugin does something wrong with the analog radio
 on
  the OEM PVR-150 card.
 
  With channels.conf set to:
  Radio 91ZM:90900:I999C0:C:0:0:300:305:A1:12003:1:1007:0
 
  v4l2-ctl --all   looks like this:
 
  Audio input : 0 (Tuner 1)
  Frequency: 1454 (90.875000 MHz)
  Video standard = 0x00ff
  PAL-B/B1/G/H/I/D/D1/K
  Tuner:
  Capabilities : 62.5 kHz multi-standard
  Frequency range  : 44.0 MHz - 958.0 MHz
  Signal strength  : 0%
  Current audio mode   : mono
  Available subchannels:
 
 
  Where ivtv-radio -f90   looks like this:
 
  Audio input : 0 (Tuner 1)
  Frequency: 1454400 (90.90 MHz)
  Video standard = 0x00ff
  PAL-B/B1/G/H/I/D/D1/K
  Tuner:
  Capabilities : 62.5 Hz stereo
  Frequency range  : 65.0 MHz - 108.0 MHz
  Signal strength  : 50%
  Current audio mode   : stereo
  Available subchannels: stereo
 
 
  it appears pvrinput isn't setting the right audio mode/sub channels
 etc??
 
 
  Any ideas?
 
  PS.  It looks like analogradio  plugin is no longer supported?  Is
 also
  doesn't support ALSA.
 
  ?
 
   I've asked this before, last year, but never had a response.
  
   How do I configure radio channels in VDR.
  
   My channels.conf has:
  
   Classic Hits:9:I999C0:C:0:0:300:305:A1:12003:1:1006:0
  
   But I think I'm picking up the wrong device, as I hear no audio.  I
   have a single PVR-150 with ivtv and the following devices:
  
   /dev/video0
   /dev/video24
   /dev/video32
  
   When I do a 'ivtv-radio -f9' I see:
   aplay -f dat  /dev/video24#which works
  
   Sowhat should my Parameters be??
  
 C0   - Input 0
 C12  - Input 1
 C23  - Input 2
 C34  - Input 3
 C45  - Input 4
 C56  - Input 5
 C67  - Input 6
 C78  - Input 7
 C89  - Input 8
 C999 - Input 9
  
  
   Thanks - in advance!
  
  
  
   ___
   vdr mailing list
   

Re: [vdr] pvrinput radio - need analogradio??

2007-02-13 Thread Simon Baxter
 In order to get the correct info from a v4l2-ctl --all:
 Format:
 Type: VBI Capture
 Sampling Rate   : 2700 Hz
 Offset  : 248 samples (9.18519e-06 secs after leading
 edge)
 Samples per Line: 1440
 Sample Format   : GREY
 Start 1st Field : 6
 Count 1st Field : 18
 Start 2nd Field : 318
 Count 2nd Field : 18
 Video input : 0 (Tuner 1)
 Audio input : 0 (Tuner 1)
 Frequency: 144 (90.00 MHz)
 Video standard = 0x00ff
 PAL-B/B1/G/H/I/D/D1/K
 Tuner:
 Capabilities : @@ -881,12 +881,19 @@
  bool cPvrDevice::Tune(int freq)
  {
 struct v4l2_frequency vf;
 +int freqaux = freq;

 memset(vf, 0, sizeof(vf));
 vf.tuner = 0;
 -   vf.type = V4L2_TUNER_ANALOG_TV;
 +if (freq  8800)

 I think this don't work. I use freq 18 because 18   is the max
 range
 for FM.
 You can also use:

 if (radio_fd = 0)
   radio
 else
   tv

 Jose Alberto

I've found some weird stuff.  When vf.tuner is set to V4L2_TUNER_RADIO the
freq seems to be a factor smaller.  In experimenting, I find if I set the
channels between 8800  10800 (for 88-108Mhz - looks like this is
set as Hz ???) monitoring what's been set on the PVR-150 with 'v4l2-ctl
--all', I see these values set the correct freq and I get a 50% or better
signal strength.  What's more, the 'v4l2-ctl --all' matches what's set
with a 'ivtv-radio -f90.0'.

Problem is, no audio is output!!  It looks like the v4l2 tuner is set to
radio, the tuner is set to 90.9Mhz, but it's trying to play the stream
from /dev/video0 rather than /dev/video24.  Does this make sense??


___
vdr mailing list
vdr@linuxtv.org
http://www.linuxtv.org/cgi-bin/mailman/listinfo/vdr