-
Notifications
You must be signed in to change notification settings - Fork 495
Framebuffer use
This page list some ways to use the framebuffer drivers. All commands are issued from a SSH session.
Install framebuffer driver
sudo apt-get install xserver-xorg-video-fbdev
Create file: /usr/share/X11/xorg.conf.d/99-fbdev.conf
Section "Device"
Identifier "myfb"
Driver "fbdev"
Option "fbdev" "/dev/fb1"
EndSection
Start X server
startx
Source: blogpost
Alternative method
FRAMEBUFFER=/dev/fb1 startx
WIDTH is the display width.
scale is used because the movie is larger than most small displays. -3 means keep aspect ratio and calculate height.
apt-get install -y mplayer
wget http://fredrik.hubbe.net/plugger/test.mpg
mplayer -nolirc -vo fbdev2:/dev/fb1 -vf scale=WIDTH:-3 test.mpg
This does not work for jessie anymore. mplayer was replaced with mplayer2 missing fbdev support. Workaround for this is using SDL
sudo SDL_VIDEODRIVER=fbcon SDL_FBDEV=/dev/fb1 mplayer -vo sdl -framedrop test.mpg
apt-get -y install fbi
wget http://art110.wikispaces.com/file/view/Mystery-100x100.jpg/30649064/Mystery-100x100.jpg
fbi -d /dev/fb1 -T 1 -noverbose -a Mystery-100x100.jpg
Use display as the primary console.
If a keyboard is plugged in after power on, a reboot may be necessary.
# Map console 1 to framebuffer 1, login screen will show up on the display
con2fbmap 1 1
con2fbmap 1
console 1 is mapped to framebuffer 1
# Revert
con2fbmap 1 0
By mirroring /dev/fb0
onto /dev/fb1
, we can take advantage of the GPU for hardware accelerated video playback.
fbcp takes a snapshot of /dev/fb0, copies it to /dev/fb1 and waits 25ms before repeating.
Snapshotting takes ~10ms and with a 25ms delay it gives roughly 1000/(10+25) = 28fps
CPU usage: ~2%
Note: Snapshot and /dev/fb1 driver refresh is not synchronized.
Install fbcp
sudo apt-get install cmake
git clone https://github.com/tasanakorn/rpi-fbcp
cd rpi-fbcp/
mkdir build
cd build/
cmake ..
make
sudo install fbcp /usr/local/bin/fbcp
Load drivers and fbcp
sudo modprobe fbtft dma
sudo modprobe fbtft_device name=tinylcd35 rotate=90 speed=48000000 fps=50
# Start fb copying process in the background
fbcp &
Play video on /dev/fb0, which will also show up on /dev/fb1
omxplayer test_480_320.mpg
Stop framebuffer copy
killall fbcp
syslog output
$ tail /var/log/messages
Dec 15 17:38:07 raspberrypi fbcp[4836]: Primary display is 720 x 480
Dec 15 17:38:07 raspberrypi fbcp[4836]: Second display is 480 x 320 16bps
Links:
http://www.stuffaboutcode.com/2012/06/raspberry-pi-run-program-at-start-up.html
Using fbcp
Install
sudo apt-get install youtube-dl
# Do this twice
sudo youtube-dl -U
sudo youtube-dl -U
sudo apt-get install python-setuptools
sudo easy_install whitey
Play
yt --player omxplayer
Refs:
- https://pypi.python.org/pypi/whitey
- http://www.raspians.com/Knowledgebase/how-to-watch-youtube-on-the-raspberry-pi/
- /usr/local/lib/python2.7/dist-packages/whitey-0.4-py2.7.egg/yt/