View unanswered posts    View active topics

All times are UTC - 6 hours





Post new topic Reply to topic  [ 1 post ] 
Print view Previous topic   Next topic  
Author Message
Search for:
PostPosted: Thu Sep 08, 2005 3:05 pm 
Offline
Joined: Mon Feb 14, 2005 3:31 pm
Posts: 20
Hello, I made a small script that is working great so far, and I thought I'd share it with you. I really hope that I won't have any more shows ruined by static noise. Only time will tell if this works 100%. Feel free to improve.

Code:
#!/bin/sh

# v4l-changechannel.sh <ch>

# Script to change channel on a v4l-capable tv-tuner.
# Use in mythtv-setup as external channel change command.
#
# It solves two problems I had with my saa7134-based
# Pinnacle PCTV Stereo (via both line-in and over PCI):
#
# - Tuner falling back to PAL-DK, even if once set
#   to PAL-BG. This would sometimes cause a very loud
#   static noise throughout the recording.
#   
# - When changing channel in MythTv or doing v4lctl
#   operations (like setting back PAL-BG), a loud
#   scratching noise would play for about a second.
#   Every recording I had would begin with a horrible
#   scratch before settling down to normal sound.
#
# Since even setting attribute 'mute' causes a really
# loud scratch, a different method is used to silence
# the tuner while changing channel. For that to work
# a file ~mythtv/.aumixrc must be present containing
# what you get by running aumix in interactive mode:
#
#   aumix -d /dev/mixer<tunermixer_no> -I
#
# and if you got working sound, then save the settings.
# My .aumixrc looks like this.
#
#   line1:100:100:P
#   line2:100:100:P
#   video:100:100:R     <--- this is where the sound is
#
# /LeL 2005

TVMIX="/dev/mixer1"
VIDEO="/dev/video0"
MUTED="3"             # seconds muted

# change to record sound from line1, but nothing's there -- i.e. mute
aumix -d $TVMIX -1 R
aumix -1 R

# now set whatever attributes we wish without crackling noises
v4lctl -c $VIDEO setchannel $1

v4lctl -c $VIDEO setattr 'mute' off
v4lctl -c $VIDEO setattr 'volume' 4
v4lctl -c $VIDEO setattr 'bright' 128
v4lctl -c $VIDEO setattr 'contrast' 68
v4lctl -c $VIDEO setattr 'color' 64

v4lctl -c $VIDEO setnorm PAL-BG

# change to record sound from video again -- i.e. unmute
# (do that by loading .aumixrc-settings with R on video)
sleep $MUTED && aumix -d $TVMIX -L && aumix -c R &




...hope it helps someone


*EDIT*
My sound could still sometimes become echoing and tinny in the middle of a show. Instead of grabbing audio over PCI, I now use a loopcable to line in (actually it's an internal cable from the tv-card to a CD-connector on the motherboard, hence the -c last in the script... use -l if using normal line-in).
The script is updated to mute recording by switching line in for the sound card as well as for the tv-card.

I have yet not had any sound distortions after this change :-)


Top
 Profile  
 

Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 1 post ] 


All times are UTC - 6 hours




Who is online

Users browsing this forum: No registered users and 17 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Group

Theme Created By ceyhansuyu