This is a project I’m working on for quite some time. A few months ago I got my Raspberry Pi delivered. My initial thought was to use it as a multimedia PC connected to the TV in the living room. This has been working as a charm for quite some time. But then I decided to take it to the next level. What if I just want to listen to the music I still need to turn on the TV. So I’ve bought an LCD touchscreen from adafruit. That goes into the GPIO slot on raspi. This way I can have fully operational XBMC running withouth having to turn on the TV to controll it. What’s even more awesome I shouldn’t need a mouse or a keyboard to controll it because the LCD comes with a touchscreen so I can even take it with me if I want to and all I need is just the small box.
I had so much trouble getting the screen to work with any of the linux distros that have the XBMC already running. I didn’t want to install XBMC on top of a Raspbian because this distribution comes with so many stuff in it that it makes the CPU cry. I want something lightweight and fast. The idea is to have both screens (TV and LCD) to display the same image as a clone on a dual monitor setup.
The next issue I’ve had is that I found most of the setups pretty harsh to do while most of the solutions to get the driver working involved recompiling both the kernel and the XBMC. But with a little digging I found a perfect solution for me that’s quick and easy to do. What’s even better it can be teoreticaly done on any of the ditros with XBMC in it. I’m currently running Raspbmc but I want to try Xbian as well maybe Openelec whenever I find some time to do so.
UPDATE: For whatever reason this doesn’t work on Xbian 1.0 BETA 2 for now.
There is no complete tutorial for this I had to improvise a bit go get it running. So this is what I had to do.
- install raspbmc as instructed on the official page
- SSH into the system
- make a directory to work in
- jump inside it
- from the adafruit site download just the kernel and the driver. You can choose the released driver or the new beta driver with DMA (I will be using the new beta driver for this purpose). For the beta driver do:
wget http://adafruit-download.s3.amazonaws.com/raspberrypi-bootloader-adafruit-20140227-1.debor for the stable driver:
- next extract the downloaded .deb file
ar p raspberrypi-bootloader-adafruit-20140227-1.deb data.tar.gz | tar zx
- we need to remove the usr directory
rm -rf usr
- go into the boot directory and delete everything but the kernel.img
- now this is optional but I strongly recomend to do this. We need to rename the kernel.img file to something else so we can jump back to the original one if something goes wrong. So:
mv kernel.img kern_lcd.img
- go back to the working directory
- create a new tar file to use as an installation file for the new kernel and drivers
tar cvzf pitftkern.tgz lib bootyou can store this file somewhere outside of the pi if you want to to use it anytime you want to reinstall the pi completly
- copy the newly created file to the root directory
cp pitftkern.tgz /
- now extract the file
cd /; sudo tar xvzf pitftkern.tgz
- next thing we need to tell the pi to boot using the new kernel
sudo nano /boot/config.txt
- and change the line kernel=kernel.img to kernel=kern_lcd.img
- we are done with the kernel and driver installation so we just need to reboot
- after the PI starts ssh back to it
- now we can continue the installation as shown in the adafruit tutorial
sudo nano /etc/modules
- and add two lines:
- for the modprobe configuration do
sudo nano /etc/modprobe.d/adafruit.conf
- add this line: options fbtft_device name=adafruitts rotate=90 frequency=32000000
- Next I’m not sure if this is necessary because I don’t have the touchscreen working yet properly but anyhow:
sudo mkdir /etc/X11/xorg.conf.d; sudo nano /etc/X11/xorg.conf.d/99-calibration.conf
- add this to the file
Option "Calibration" "3800 200 200 3800"
Option "SwapAxes" "1"
- next we need to install a small tool called fbcp that is able to copy the main screen which is the HDMI output to the newly installed framebuffer that is the LCD display so we have a working double header. I have already a bin file made from this so you just need to download it.
cd ~; wget http://sernato.sk/?ddownload=5192
- extract the fbcp
tar xvf fbcp.tar
- we need to make the fbcp application to start after the xbmc starts so we can see the xbmc screen on the LCD for this there is a nice tool that can run shell commands from the xbmc called xbmc callbacks
- now we need to install these. For that go into the XBMC screen using the HDMI output for now. And install the plugin from the zip file we just downloaded: service.xbmc.callbacks-0.5.xip
- After it’s installed go to programs and settings for the XBMC callbacks program. You will see a screen showing a couple of callbacks that you can use to run commands. The one we are interested in is XBMC Starts.
- press enter on that setting and it will open a filemanager now navigate to your home folder and choose the fbcp file and confirm.
- after this everything is set and we can restart again.
- when the XBMC starts it should show up on the main HDMI screen as well as on the LCD screen.
As of now this is the most I’ve been able to achieve currently I’m looking for a solution to get the touchscreen working. It’s seems it’s not calibrated and I’m trying all the solutions I can find online but with no success so far. And I’m avoiding the once that involve any sort of compiling there has to be a solution for this and I WILL FIND IT 😉
Feel free to ask questions and I will try to help you out with your issues if I can.
Now this is a proof that It’s working for me.