25th Jan, 2013, 10:27 AM
Hello!
I pretty newbi on linux, xbian and XBMC. But i'm learning .
My situation: i have raspi connected to composite monitor and HDMI projector. Unfortunatly this video outputs cannot be active both at same time.
Because it's not practical to switch on a projector just for select another music or radio station ob Raspi i use composite monitor for music manipulation and when i want watch video i turn on projector and switch video output on Raspi to HDMI.
I can switch between both with following scripts executing them from ssh session from remote computer...
HDMIon.sh
echo "Stop XBMC..."
sudo service xbmc stop
echo "Set resolution for composite output..."
sudo fbset -xres 1920 -yres 1080 -vxres 1920 -vyres 1080
echo "Turn on composite output..."
tvservice --explicit="CEA 16"
sudo service xbmc start
echo "XBMC started on HDMI output"
...and back to composite output...
COMPOSITEon
echo "Stop XBMC..."
sudo service xbmc stop
echo "Set resolution for composite output..."
sudo fbset -xres 480 -yres 400 -vxres 480 -vyres 400
echo "Turn on composite output..."
tvservice --sdtv="PAL 16:9"
sleep 3s
sudo service xbmc start
echo "XBMC started on composite output"
I have an idea to simplify this switching this way: when i exit from XBMC, i can test the state of HDMI by execute following command...
xbian@malinca:~# tvservice -s
state: HPD low|HDMI off|PAL mode|composite CP off (0x180001), 720x576 @ 50Hz, interlaced
...with bach script i can test the output of the command and depending on state of HDMI i would start appropriate script to restart XBMC on hdmi or composite output.
This way i could switch from one output to other and viceversa with a selecting XBMC exit (or reboot, or whatever in exit menu) without need for other computer and ssh session.
So please help me with suggestions and your knowledge. How start a script on exit or reboot XBMC or even better how to customize XBMC PowerOff menu to add in list new item like 'Switch VIDEO OUTPUT' (or change the action of existing item) and on selection exit from XBMC, chage video output of Raspi and then automaticaly again start XBMC.
Thanks!
I pretty newbi on linux, xbian and XBMC. But i'm learning .
My situation: i have raspi connected to composite monitor and HDMI projector. Unfortunatly this video outputs cannot be active both at same time.
Because it's not practical to switch on a projector just for select another music or radio station ob Raspi i use composite monitor for music manipulation and when i want watch video i turn on projector and switch video output on Raspi to HDMI.
I can switch between both with following scripts executing them from ssh session from remote computer...
HDMIon.sh
Terminal
echo "Stop XBMC..."
sudo service xbmc stop
echo "Set resolution for composite output..."
sudo fbset -xres 1920 -yres 1080 -vxres 1920 -vyres 1080
echo "Turn on composite output..."
tvservice --explicit="CEA 16"
sudo service xbmc start
echo "XBMC started on HDMI output"
...and back to composite output...
COMPOSITEon
Terminal
echo "Stop XBMC..."
sudo service xbmc stop
echo "Set resolution for composite output..."
sudo fbset -xres 480 -yres 400 -vxres 480 -vyres 400
echo "Turn on composite output..."
tvservice --sdtv="PAL 16:9"
sleep 3s
sudo service xbmc start
echo "XBMC started on composite output"
I have an idea to simplify this switching this way: when i exit from XBMC, i can test the state of HDMI by execute following command...
xbian@malinca:~# tvservice -s
state: HPD low|HDMI off|PAL mode|composite CP off (0x180001), 720x576 @ 50Hz, interlaced
...with bach script i can test the output of the command and depending on state of HDMI i would start appropriate script to restart XBMC on hdmi or composite output.
This way i could switch from one output to other and viceversa with a selecting XBMC exit (or reboot, or whatever in exit menu) without need for other computer and ssh session.
So please help me with suggestions and your knowledge. How start a script on exit or reboot XBMC or even better how to customize XBMC PowerOff menu to add in list new item like 'Switch VIDEO OUTPUT' (or change the action of existing item) and on selection exit from XBMC, chage video output of Raspi and then automaticaly again start XBMC.
Thanks!