Sunday 16 September 2018

Using Desktop Raspbian with a second screen or projector

After various dalliances with Mint, Mate, Elementary and vanilla Ubuntu, we've decided to standardise on the Desktop version of Raspbian for the "club" laptops that we have available at CoderDojo Ham,

There's a couple of reasons for this. Firstly it installs easily and quickly, and runs well on old, low.  powered devices (most of our laptops are donated or re-furbished) . Secondly, it comes with loads of great educational software and editors installed be default, which saves time in preparing the machines for use.

An important part of our Dojo is the show-n-tell at the end, where the keen youngsters show off their amazing projects on the big screen. This is always hugely popular and we normally have a long queue of patient coders to get through.

One thong we hadn't thought about when selecting Desktop Raspbian as our operating system of choice was using the club machines with the AV desk and getting them to display on the Kingston University STEM centre's excellent big screens. The first time we connected the VGA cable to the port on one of the laptops, nothing appeared to happen, and none of the menu setting within Raspbian seemed to help. Obviously the look and feel of Raspbian is geared towards the Raspberry Pi, so using multiple displays is not a common configuration.

After some messing around we discovered that reboot the laptop allowed the projector to be detected, although the default setting seemed to be for 2 screens rather than having the second mirror the first.

This is OK, but rebooting takes up precious time (remember the big queue) and having two windows can be confusing for the youngsters.

So a bit a experimentation revealed a better, simpler command line solution.

  1. Connect the second display
  2. Open a Terminal Window 
  3. Type xrandr --auto

This should automatically detect the new output device and set-up mirroring.

Some other useful commands

xrandr --listmonitors 

(this lists all the detected monitors)

xrandr --output <laptop monitor name> --same-as <projector name> 

(this forces mirroring - you can also add in other parameters, for example if the aspect ratios of the two screens were very different).