Xrandr – turn off one of your multiple monitors

Xrandr is not just for setting up resolutions and multiple monitors, it will do all sorts of other stuff too, but one thing I need for my carpc project was to be able to programmatically turn off the screen on the netbook (carpc) once it was up and running on the main screen on the car dash. I couldn’t play with X because both screens were running from “one display”. Xrandr to the rescue:

xrandr -q

will give you the names of the screens you have running. Once you know this you can issue a command to turn off which ever screen you like:

xrandr –output LVDS1 –off

where LVDS1 is the name of my netbook display (there are two double hyphens in the above code!)

xrandr –output LVDS1 –auto or  xrandr –output LVDS1 –on will bring it back on

Prevent Screen Blanking on Xubuntu CLI / Slim / Openbox Install on Asus EB1012 nettop

Normally I am able to take care of screen blanking through the gui powersaving options in Xubuntu, however my command line install followed by installing openbox and using slim as a login manager presented me with real problems. teh screen would blank and half kill the x server, leaving a reboot as the only option. I found some xset options which I put into a script and added this to autostart.sh, which seemed to take care of X issues, but the terminal blanking was still going on. Using setterm I was able to stop terminal blanking but had to find a place to put it on startup. This turned out to be in /etc/profile (for all users). So now writing this post from my non blanking setup :)

Continue reading

PS2 Eyetoy Webcam on Xubuntu 10.10 Recording and Playback

More fun to be had with your PS2 eyetoy as webcam. This all was tested using the silver eyetoy, but I see no reason why the black one won’t function just the same.
(Remember this is without pulseaudio!)
(a copy of the post I made on Ubuntuforums)
Recording Sound:

Continue reading

Video Tearing Fixed – Xubuntu 9.10 – Nvidia ION

I use mplayer as my default video player, and have always had video tearing of some sort on my main PC. Having recently updated my PC to an Asus EB1012 net-top with the Nvidia ION graphics chip I found that enabling the vdpau options with mplayer gave me tear free playback. So I set out to resolve it for other file types (e.g. mp4 / avi)

I run Xubuntu by preference and normally use the Compositor to add transparency and shadows, and the default output plugin for mplayer is xv.

1. Turn off the compositor

2. This should produce tear free playback in totem and vlc

3. Open up nvidia-settings and ensure Sync to Vblank is ticked in  X Server XVideo Settings, and Sync to VBlank and Allow Flipping is ticked in Open GL Settings

4. edit the ~/.mplayer/config file

I grabbed the config file from GeexBox, as this served as a useful template to set up profiles for various file types.

For h264 / vdpau files (mkv) that use the GPU to process

[extension.mkv]
profile-desc=”Profile for Matroska files”
profile=lang
vo=vdpau
vc=ffh264vdpau

For HD Files (mp4)

[extension.mp4]
profile-desc=”Profile for HD mp4 files”
vo=gl
vfm=ffmpeg
lavdopts=lowres=0:fast=1:skiploopfilter=all
autosync=30
cache=32768

For “normal” (avi) files

[extension.avi]
profile-desc=”Profile for deinterlacing avi files”
vo=gl
vf=pp=lb/hb/vb/dr

The default section looks like this:

[default]
vo=vdpau,xv,gl
ontop=yes
double=yes
dr=yes
framedrop=yes
cache=8192
lirc=no
alang=en
slang=en

I have to make sure I check encoded options and rename the extension accordingly, but 95% of the time, this configuration works fine for me

Here is the entire ~/.mplayer/config file:

[deinterlace]
profile-desc=”Profile for picture de-interlacing”
vf-add=pp=fd

[dvd]
profile-desc=”Profile for DVD playback”
profile=deinterlace
dvd-speed=4
cache=8192

[lang]
profile-desc=”Profile for language”
alang=en

[protocol.dvd]
profile-desc=”Profile for dvd:// streams”
profile=dvd
profile=lang

[protocol.dvdnav]
profile-desc=”Profile for dvdnav:// streams”
profile=dvd
profile=lang
nocache=yes

[protocol.cdda]
profile-desc=”Profile for cdda:// streams”
cdda=speed=2

[protocol.tv]
profile-desc=”Profile for tv:// streams”
profile=deinterlace

[extension.mkv]
profile-desc=”Profile for Matroska files”
profile=lang
vo=vdpau
vc=ffh264vdpau

[extension.mp4]
profile-desc=”Profile for HD mp4 files”
vo=gl
vfm=ffmpeg
lavdopts=lowres=0:fast=1:skiploopfilter=all
autosync=30
cache=32768

[extension.avi]
profile-desc=”Profile for deinterlacing avi files”
vo=gl
vf=pp=lb/hb/vb/dr

[default]
vo=vdpau,xv,gl
ontop=yes
double=yes
dr=yes
framedrop=yes
cache=8192
lirc=no
alang=en
slang=en

Grub Menu not Visible after attaching new widescreen Monitor! Solved!

Was time to treat myself to an early Christmas present, so splashed out on the ridiculously cheap HannsG HH241 24″, 1980×1080 WUXGA monitor @ £140. Comes with a VGA-VGAcable abd a DVI-HDMI cable (monitor has an HDMI port)

Plugged it in, powered up.

Nvidia Geoforce 6200 Graphics card with DVI/VGA output
HannsG HH241 24″ widescreen 1980×1080 WUXGA, HDMI 1.3 compatible
Multibooting @ 5 OS’s

PC booted up fine with post/bios screen viewable, then a blank screen for a few seconds (where grub menu usually is, then usual starting up for Xubuntu 9.04 (the default OS in my grub menu (grub legacy)

Once X was running everything fine.

Tried all sorts, reinstalling grub to mbr, reconfiguring X, checked for settings in bios (none obvious), but nothing changed.

So switched to VGA-VGA cable, and grub menu was back. So I am kind of sorted, but wavy lines and distorted image during post and splash, and was getting a better picture and all round performance using the hdmi connection.

Previous monitor, an Iiyama 17″ LCD worked fine on a DVI-DVI cable.

Also, Xubuntu Progess screen during boot up was not centred, off to the right a bit.

After hours and hours and hours of googling, finally found a post about toshiba laptop owners not getting grub on a cold reboot. The recommendation was to install grub2
To install grub2 on Jaunty or below

sudo apt-get install grub2

Test it by loading grub2 as chainloader (this option is offered on installation)
You’ll need to “e” “e” and change root to uuid to get the chainloader to work

If you are happy run

sudo upgrade-from-grub-legacy

and grub2 will take over, And lo and behold, the grub menu is back! New things to learn in order to customise grub2 menu, and set up a splash image for it.  Xubuntu progress splash also nicely centred.

Best place to go for just about everything grub2 is here

GeeXBoX playback at fullscreen on LCD TV

This has been an issue for me for quite a while, but I have simply overcome it by using the menu to change the aspect ratio.

It all stems from the perplexing confusion of recording dvb tv for later playback. Watching live TV on the TV, the picture fills the screen. It’s a 16:9 42″ TV (720p). When I record dvb tv using my main pc in its raw .ts state it is 720×576 (16:9). If I play this back using the GeexBox, mplayer squeezes the picture to a display of something like Cinemascope, so a change of aspect ratio to 4:3 usually sorts this out. But it got me thinking, if the original video is 16:9 why doesn’t play as such? The Pc in use to run GeexBox has an nvidia 6200 and is connected to the TV using VGA (DVI/HDMI went “pop” a while ago on the TV!).

First off, I tried all sorts of encoding options, changing the aspect ratio and resolution using mencoder. I got some success if I encoded with aspect=4/3 as an option. but this still didn’t make sense; if I had a 16:9 aspect ratio TV, why the original video didn’t fit.

This is what I did to sort things out. I have a HDD install of GeexBox so can ftp in to edit files. If you use a live cd, then you will need to edit the files before you generate a custom iso.

Boot up the GeexBox

FTP in, and make doubly sure you get into the right place

/mnt/GeexBox-partition/GEEXBOX/etc

Open up tvout in that directory and change the Aspect Ratio line to this:

TVOUT_ASPECT=”16:9″

and save.
By just making this change alone, it squeezed my display horizontally to make a 4:3 image, so more to do

Browse to /mnt/Geexbox-partition/GEEXBOX/etc/mplayer and open up mplayer.conf
In the [default] section, add the following two lines:

monitoraspect=”16:9″

aspect=”16:9″

and save. It may be worth noting that I have vo=vidix,vesa in the default section of mplayer.conf

Log out of the ftp and reboot the GeexBox. The Main Menu and background.avi should be filling the screen.

Now try playing any recorded dvb tv or video that was previously letterboxed, even though it was 16:9 ratio or 720×576 resolution. You should see it playback in full screen.

Caveats: This may not work in your setup, and you may not need to make all the adjustments to get this to work, this is what worked for me.