Automating Framebuffer Digital Photo Frame

dpf6We have seen in my previous post how I setup the DPF to work against the framebuffer. Now it was time to automate things a bit.

Task List:

  • Autologin on Startup
  • Start gnu screen on Boot
  • Uploading New Images
  • Screen On/Off Timer
  • Reboot Timer
  • Shutdown Timer
  • Unique names/shuffle for file list
  • Cycle Colour Change for Clock ?

Continue reading

Digital Picture Frame & Clock on the Framebuffer!

dpfBeen wanting to have a go at this for a long time, and finally found some time to sit down and hack my way through it. Everyone else on the web seems to have used X to do this, but encouraged by all the work done on the cli and framebuffer by KMandla I felt this could be done. Now I’ve done all the hard work, I am happy to share it with you!

Continue reading

Xubuntu – turn Compositor ON and OFF

A little script to add to a launcher or keyboard shortcut to quickly turn the compositor on and off. this is useful if you get screen tearing when playing video

More fun with xrandr

  • NB: double hyphens (with no space between!) are used for all options in xrandr

Sorting out my front screen display for my car pc has proven a bit of a nightmare, given its native resolution of 400 x 234/240. The vga converter I am using doesn’t offer 800×480.

So I looked to xrandr to help me out. The specific options for this are “- -mode”, “- -scale” and “– -pos

With “– -mode” I can set the resolution, in this case 800×600

With “– -pos” I can position the display offset, e.g. – -pos 10×10 would position the display 10pixels down and 10 pixels right. This is useful because the display doesn’t align centrally be default.

Continue reading

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

HTML Auto Slideshow using Javascript and php with dynamically generated array of Images

Another holy grail for me, to be able to just add images to a directory and have the slideshow automatically pick them up and display them withoput having to edit html /javascript code. Most scripts I had found for an html slideshow required the array created inside the script, this way you use php to generate the array and then the javascript runs with it. Only downside is you will need php up and running, but most web servers online have this by default now.

My blog is a bit broken at the moment so will have to link the files to Ubuntuforums

http://ubuntuforums.org/showpost.php?p=11339174&postcount=2

  1. Images will be shown at their actual size, so you may need to add some html code to the tag in the to restrict the images size.
  2. On your server, go to the place where you want the html file to be and upload the index.html file there, then create a sub-directory called pics and upload the getimages.php file to the pics directory.
  3. Next upload all your images to the pics directory.
  4. Done.

Acknowledgements to all the clever people who wrote the original scripts and files

Auto Web Page Changer using iframe

Oh I like this. In seeking to setup a rolling web browser display display at work, I came upon this small but very clever bit of javascript, which on a timer will change the web page being viewed inside an iframe. Just edit the defaults to you preferred pages and timings and away you go:

 <!DOCTYPE html PUBLIC “-//W3C//DTD XHTML 1.0 Strict//EN” “http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd”>
<html>
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″ />
<title>Changing Pages… Please Wait</title>
<script type=”text/javascript”>
var frames = Array(‘http://www.google.com/’, 15,
‘http://www.yahoo.com/’, 15,
‘http://www.ask.com/’, 15,
‘http://www.dogpile.com/’, 15);
var i = 0, len = frames.length;
function ChangeSrc()
{
if (i >= len) { i = 0; } // start over
document.getElementById(‘frame’).src = frames[i++];
setTimeout(‘ChangeSrc()’, (frames[i++]*1000));
}
window.onload = ChangeSrc;
</script>
</head>
<body>
<iframe src=”” name=”frame” id=”frame” width=”100%” height=”100%”></iframe>
</body>
</html>

Continue reading

Simple Linux Slideshows

For running in X:

Use feh

sudo apt-get install feh

Set up a directory with photos in it, e.g. ~/photos or ~/Pictures and then run this command:

feh -zZxF -D 10 ~/photos

(-z for random, -Z for autozoom, -x for borderless windows, -F for fullscreen, -D for time on screen)

You might try using unclutter to get rid of the mouse cursor, but on some setups this doesn’t work well with feh, alternatively just move the mouse down into a corner somewhere

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