This is what I do. I hope it will help out or at least point you in the right direction.
In the mythtv-setup I go to #4, Input Connections. Find your HDPVR and enter it's setup. In the "External change channel command:" I have /home/mythtv/hdpvr.sh. The hdpvr.sh script looks like this"
Code:
#!/bin/bash
# Uncomment this for debugging
#set -vx
DEVICE=0
# controls:
BRIGHTNESS=134 # Picture brightness, actually the black level. [0 - 255]
HUE=128 # Hue or color balance. [0 - 255]
SATURATION=128 # Picture color saturation or chroma gain. [0 - 255]
CONTRAST=128 # Picture contrast or luma gain. [0 - 255]
SHARPNESS=128 # Sharpness picture control. [0 - 255]
AUDIO=4 # Control for audio encoding [3=AAC - 4=AC3]
VIDEO_BITRATE_MODE=1 # Control for video biterate mode [0=VBR - 1=CBR]
VIDEO_BITRATE=6500000 # Bitrate control over recordings in bits [1Mbit/s - 13.5Mbit/s]
VIDEO_PEAK_BITRATE=9000000 # Peak bitrate control in bits [1.1Mbit/s - 20.2Mbit/s]
CTL_OPTS="-d /dev/video$DEVICE"
echo ; echo Settings before:
/usr/bin/v4l2-ctl -d /dev/video$DEVICE --get-ctrl=brightness,hue,saturation,contrast,sharpness,audio_encoding
/usr/bin/v4l2-ctl $CTL_OPTS --set-ctrl brightness=$BRIGHTNESS >/dev/null
/usr/bin/v4l2-ctl $CTL_OPTS --set-ctrl hue=$HUE >/dev/null
/usr/bin/v4l2-ctl $CTL_OPTS --set-ctrl saturation=$SATURATION >/dev/null
/usr/bin/v4l2-ctl $CTL_OPTS --set-ctrl contrast=$CONTRAST >/dev/null
/usr/bin/v4l2-ctl $CTL_OPTS --set-ctrl sharpness=$SHARPNESS >/dev/null
/usr/bin/v4l2-ctl $CTL_OPTS --set-ctrl audio_encoding=$AUDIO >/dev/null
/usr/bin/v4l2-ctl $CTL_OPTS --set-ctrl video_bitrate_mode=$VIDEO_BITRATE_MODE >/dev/null
/usr/bin/v4l2-ctl $CTL_OPTS --set-ctrl video_bitrate=$VIDEO_BITRATE >/dev/null
/usr/bin/v4l2-ctl $CTL_OPTS --set-ctrl video_peak_bitrate=$VIDEO_PEAK_BITRATE >/dev/null
sleep 2
echo ; echo Settings after:
/usr/bin/v4l2-ctl -d /dev/video$DEVICE --get-ctrl=brightness,hue,saturation,contrast,sharpness,audio_encoding
I use it because everytime we have a power glitch, my hdpvr resets the audio to AAC and I prefer AC3. Now when ever I do a recording the hdpvr's setting are set to my personal preferences. The idea I had from the old days with a TJC script for fixing the tinny audio on the pvr-250 cards. If you are using a change channel script, you can modify that script to call this script or add it to a custom change change channel script. Enjoy!