[mythtv-users] Query wrt using a pvr150/ivtv card in mythtv - tuner broken?

Stephen Worthington stephen_agent at jsw.gen.nz
Sun Aug 11 02:14:16 UTC 2013


On Sun, 11 Aug 2013 11:23:53 +1000, you wrote:

>I agree - the symptoms suggest something with the V4L drivers/API has changed,
>but the ivtv-utils package hasn't been updated in about 3 years and
>still works ; so
>if something -has- changed, I'm damned if I can figure out what. I
>also concur with
>your observations about the status of analog tv (it was recently
>turned off completely
>here in .au), and that was the reason I jumped to abandoning the
>PVR-150 altogether ;)
>
>Regarding the idea entering the data for UHF chan69 into the database
>manually, I
>tried that, but it doesn't work -- if you switch to that tuner input
>after setting it up manually
>like this, I get a blackscreen before it aborts (video failed to
>start, buffers failed to fill),
>so it would seem like the trouble with scanning channels (all channels
>locked but no
>signal) also squashes this approach...

I am sure it could be made to work by manual changes to the database.
But it would be much better to go over to using S-Video or composite
video.

>The satbox does have 2 video out ports, 1 x composite & 1 x S-VHS plus
>RCA sockets
>for audio ... so I'd need go the composite route (which still should
>be marginally better
>quality than doing the RF [de]modulator shuffle =), and yes... it was
>always hassles with
>audio input selection that stopped me from using that approach in the
>past and settle
>on the RF hookup  -- I'd be very interested in seeing your bash file &
>giving that a go here!
>
>Cheers!

Since the satbox has S-Video, that is your best option.  It will
produce an excellent picture, as long as you do not have any ground
loops causing 50 Hz bars over the picture.  I suffered from that for a
long time until I finally worked out it was caused by my amplifier and
isolated it.  The PVR-150 has S-Video inputs and normally also comes
with an S-Video to component adapter cable that plugs into the DIN
socket (third down from the top on the back of the board).  The DIN
socket is wired for standard S-Video pinout, so just get an S-Video
cable that has the right plug on each end and it should work.  The
audio goes into the red and white RCA sockets as expected.  Until you
get an S-Video cable you can use the yellow composite video RCA
socket, but you will find the S-Video option gives a much better
picture.

Here is the channel change script I use, with the call to the audio
channel fix at the end of it:

#!/bin/sh

REMOTE_NAME=Pace_RC-30
cmd="$1"

# If things work OK with sleep 1, try this for faster channel changes:
# sleep 0.3
sleep_amt=1.0

# See if this helps with missing digits at the start of a channel
change.
sleep 1.0

#echo Change channel: $cmd >>/tmp/irsend.txt

case $cmd in
    [0-9]*)
    # make sure we unmute by hitting vol up
    #/usr/bin/irsend SEND_ONCE $REMOTE_NAME Vol+
    #sleep $sleep_amt
    for digit in $(echo $1 | sed -e 's/./& /g'); do
            #echo irsend SEND_ONCE $REMOTE_NAME $digit
>>/tmp/irsend.txt
        /usr/bin/irsend SEND_ONCE $REMOTE_NAME $digit
        sleep $sleep_amt
    done
    ;;

    *)
        /usr/bin/irsend SEND_ONCE $REMOTE_NAME $cmd
        ;;
esac


# Workaround for bug which causes audio distortion on some recordings.
/usr/local/bin/ivtv_audio_fix.sh $video &


And here is the ivtv_audio_fix.sh file:

#!/bin/sh

# Workaround for bug which causes audio distortion on some recordings.
# From http://urlgrey.net/?p=231

sleep 3

if [ $# -eq 0 ]; then
    device=/dev/video0
else
    device=$1
fi

# First, set the audio input in turn to each of the unwanted audio
inputs.
# This only became necessary as of Mythbuntu 12.04.
v4l2-ctl -d$device --set-audio-input=2
v4l2-ctl -d$device --set-audio-input=0

# Next, also set the tuner frequency.  This also seems to be necessary
# since Mythbuntu 12.04 to suppress a slightly different audio
distortion.
v4l2-ctl -f 420

# Reset the audio input to source 1 (the wanted input).
v4l2-ctl -d$device --set-audio-input=1


Note that this is set up for my PVR-500 - you may possibly need to
adjust the audio-input numbers for a PVR-150.  The v4l2-ctl -f 420
line tunes the TV tuner to an empty frequency, so that it will not
produce audio that gets mixed with the wanted audio signal by the
driver bug.  You will need to select a frequency that is empty where
you are.  And remember that, some time in the future when it has all
been working nicely, if you suddenly get audio distortion again, then
something may have started transmitting on your chosen frequency.

When setting up the PVR-150 to use the S-Video or composite inputs,
you need to go into mythtv-setup and go to Input Connections.  You
will currently have an input connection set up on:

  [MPEG : /dev/video0] (Tuner)

and you need to change the connection to be on:

  [MPEG : /dev/video0] (S-Video)

or

  [MPEG : /dev/video0] (Composite)

Just copy the setup you currently have for (Tuner) and I think it
should work.


More information about the mythtv-users mailing list