[mythtv-users] Seperate video out with PVR-350?

Dan Wilga mythtv-users2 at dwilga-linux1.amherst.edu
Mon Jan 8 14:57:26 UTC 2007


At 7:10 AM -0500 1/6/07, mythtv-users at jaredharvey.com wrote:
>I  got  my PVR-350 working, now I would like to have a separate MythTV
>on  the  composite out, from the video out on the VGA. I'm not certain
>how to do this, I was thinking perhaps having two users, that login on
>two  separate  X  sessions. Perhaps so that alt f7 is the normal X and
>alt  f8  is  the mythtv, with composite out enabled. Any input will be
>welcomed.

It's theoretically possible to have two screens defined in X, one of 
which uses the 350's framebuffer and the other of which uses the VGA 
card, but I was never able to get this working. Instead, I did 
exactly what you suggest, and it works just fine.

The hardest part is that there are likely to be other settings in the 
database that need to be changed for the two setups. I accomplished 
this with a little script that is run by irexec. You press a certain 
key on the remote when you want to use the particular screen, and the 
script switches over to the correct virtual terminal, runs X if it 
needs to be, starts Myth if needed, and makes the database tweaks.

Setup:
- Create a symlink to your mythfrontend binary, in the same 
directory, called mythfrontend-tv2. This unique name allows the 
script to know if both copies are running.

- Create a second user account to run X with. In my case, I'm using 
"dwilga" and "tv".

- Create a separate "ServerLayout" section in your Xorg.conf file for 
the 350. Its name is referenced in the script. (My example uses 
"LayoutFB" and appears below.)

- Download and install "wmctrl": http://www.sweb.cz/tripie/utils/wmctrl/

- Modify the script to make any additional DB changes. Right now, I'm 
changing the audio output device, overscan settings, GUI position, 
and Qt/non-Qt drawing mode.

------------------------

#!/bin/sh

vt=8
prog=mythfrontend-tv2
disp=':1.0'
disp_short=':1'
user=dwilga
note=upstairs
dev=/dev/dsp
args='-layout LayoutFB -dpi 100'
vscan='0'
hscan='0'
yscan='0'
guioffsetx='34'
guiheight='464'
guiwidth='658'
painter='qt'

if [ "$1" != 'tv2' ] ; then
   vt=7
   prog=mythfrontend
   disp=':0.0'
   disp_short=':0'
   user=tv
   note=downstairs
   dev=ALSA:default
   args=''
   vscan='3'
   hscan='6'
   yscan='13'
   guioffsetx='0'
   guiheight='0'
   guiwidth='0'
   painter='opengl'
fi

# start X if not already running
gotx=`ps h -C X | grep " $disp_short "`
if [ "${gotx}X" = 'X' ] ; then
   echo -n 1 > /var/run/console/$user
   su -c -l - $user "startx -- $disp_short $args &"
   sleep 2
else
   # it's already running, so just switch the VT
   chvt $vt
fi

# start mythfrontend, or make it the topmost app
pid=`/sbin/pidof $prog`
export DISPLAY=$disp
export XAUTHORITY="/home/$user/.Xauthority"
if [ "${pid}X" = 'X' ] ; then
   echo "Starting frontend for $note TV"
   su -c -l - $user "exec gnome-terminal -e '$prog' &"
else
   # make it topmost
   wmctrl -a $prog
fi

# update the DB
echo \
"update settings set data='$guioffsetx' where value='GuiOffsetX';" \
"update settings set data='$guiheight' where value='GuiHeight';" \
"update settings set data='$guiwidth' where value='GuiWidth';" \
"update settings set data='$painter' where value='ThemePainter';" \
"update settings set data='$dev' where value='AudioOutputDevice';" \
| mysql --password=mythtv -u mythtv mythconverg

-----END------

Additions to xorg.conf:

Section "Device"
     Identifier     "Hauppauge PVR 350 iTVC15 Framebuffer"
     Driver         "ivtvdev"
# FIX ME TO MATCH YOUR SETUP
     Option         "fbdev" "/dev/fb1"
# FIX ME TO MATCH YOUR SETUP
     BusID          "PCI:2:05:00"
EndSection

Section "Monitor"
     Identifier     "NTSC Monitor PVR350"
     HorizSync       30.0 - 68.0
     VertRefresh     50.0 - 120.0
     ModeLine       "720x480" 34.6 720 752 840 928 480 484 488 504 -hsync -vsync
EndSection

Section "Screen"
     Identifier     "pvr350"
     Device         "Hauppauge PVR 350 iTVC15 Framebuffer"
     Monitor        "NTSC Monitor PVR350"
     DefaultDepth    24
     DefaultFbBPP    32
     SubSection     "Display"
     Depth       24
     FbBPP       32
     Modes      "720x480"
     EndSubSection
EndSection

Section "ServerLayout"
     Identifier     "LayoutFB"
     Screen         "pvr350" 0 0
     InputDevice    "Mouse1" "CorePointer"
     InputDevice    "Keyboard1" "CoreKeyboard"
EndSection

-- 
Dan Wilga                                                        "Ook."


More information about the mythtv-users mailing list