descriptionBABOOSHKA.TV old-school tv-box video player
last changeFri, 10 Jul 2020 01:30:07 +0000 (03:30 +0200) old-school tv-box video player

.This simple and lightweight package could turn your RPi into a video player. The package is designed primarily for your grandparents, for whom the use of a computer is a difficult task. You can upload your home kittens-kids videos or add videos from Youtube/Vimeo that you like.

The package is fully written in bash. RPi based prototype


Pi Zero IO Pinout

The yellow LED connected to +3,3v via 470R

GPIO 0  BCM17   LED green, booting  
GPIO 2  BCM27   LED red, video status

Lowering resistors are required for all diodes (Red LEDs normally brighter, so I would recommend ~470R for yellow and green and about 1K for red)

Infrared interface

GPIO 3  BCM22   IR TX  
GPIO 4  BCM23   IR RX  

    38kHz -- standard 

    +-----------------------+ 3
    |                       +---------------------o +3.3V
    |      ______________   |
    |     /                 |
    |    (                  | 2  
    |     \______________   +---------------------o GND
    |                       |
    |                       | 1
    |               data -> +---------------------o GPIO 4 (BCM23)

    950nm emitting diode (e.g. TSUS5400)

                     | |  51 Ohm (depending on MOSFET maybe not required)
                     \ / 
                     ---  IR LED
         ___      |---'
  o-----|___|-----|       MOSFET
         10K      |->--
    GPIO 3 (BCM22)     |
                    ----- GND

Analog Audio


RPi Zero Audio
Picture taken from here, thanks :)

Analog video pin

RPi TV out
Picture taken from here, thanks :)


Download, copy to microSD and install oficial Raspberry Pi OS Lite image

The procedure of adding a login and password for your access point, as well as the ssh configuration is omitted. It is assumed that you know how to do so :)
If you not sure, ddg it.

Further operations are performed on device.

ssh <your RPi device>

Update repository list and install dependencies

apt update  
apt install mc fbi omxplayer sox

Try to install freefonts (required by omxplayer)

apt install ttf-freefont

By some reason recently freefonts package has been removed from official RPi repository. So in case of unsuccess just copy included freefonts to /usr/share/fonts/truetype/...
do it with sudo

cp -r freefont /usr/share/fonts/truetype/freefont  
chown root:root /usr/share/fonts/truetype/freefont  
chown root:root /usr/share/fonts/truetype/freefont/*

IR interface setup

apt install lirc

edit /etc/lirc/hardware.conf

# Run "lircd --driver=help" for a list of supported drivers.  

# usually /dev/lirc0 is the correct setting for systems using udev  

edit /etc/lirc/lirc_options.conf NOTE! add new line in the end of the file !!!! known bug

driver        = default  
device        = /dev/lirc1

First try to find you device using

irdb-get find YOUR_DEVICE

If you did it, copy YOUR_DEVICE.conf to /etc/lirc/lircd.conf.d/ In case of unsiccess try to find and copy here: List of devices supported by Lirc 'from the box'. However, you always can record your own, see below...

Copy template lircd.conf

cp /etc/lirc/lircd.conf.dist /etc/lirc/lircd.conf

Make changes in /boot/config.txt to set up PAL video output and run appropriate kernel overlays for IR interface:


# disable_overscan=1


# enable PWM audio (add this line)

# uncomment for composite PAL

# uncomment if hdmi display is not detected and composite is being output
# hdmi_force_hotplug=1

# Uncomment this to enable the gpio-ir module

Make IR works as TX and RX simultanoiously

This part taken from this GitHub comment thank you @elmicha :)

Add these rules in /etc/udev/rules.d/71-lirc.rules to get stable /dev/lirc-rx and /dev/lirc-tx device names:

ACTION=="add", SUBSYSTEM=="lirc", DRIVERS=="gpio_ir_recv", SYMLINK+="lirc-rx"
ACTION=="add", SUBSYSTEM=="lirc", DRIVERS=="gpio-ir-tx", SYMLINK+="lirc-tx"
ACTION=="add", SUBSYSTEM=="lirc", DRIVERS=="pwm-ir-tx", SYMLINK+="lirc-tx"

Change the device and listening address in /etc/lirc/lirc_options.conf:

device        = /dev/lirc-rx
listen        =

Copy lircoptions.conf to lirctx_options.conf and edit these lines:

device        = /dev/lirc-tx
output        = /var/run/lirc/lircd-tx
pidfile      = /var/run/lirc/
listen        =
connect      =

Create /etc/systemd/system/lircd-tx.service (from the output of systemctl cat lircd) and edit it like this:

Description=Second lircd, the transmitter  
Wants=lircd-setup.service lircd-setup.service lircd.service  

ExecStart=/usr/sbin/lircd --nodaemon --options-file /etc/lirc/lirc_tx_options.conf  

Create /etc/systemd/system/lircd-tx.socket (from the output of systemctl cat lircd.socket) and edit it:  



Create /usr/local/bin/irsend and make it executable

#! /bin/sh  
exec /usr/bin/irsend --device=/var/run/lirc/lircd-tx "$@"
chmod +x /usr/local/bin/irsend

Start lircd-tx (with sudo)

systemctl daemon-reload
systemctl start lircd-tx
systemctl enable lircd-tx

Enable RX (with sudo) systemctl enable lircd.service systemctl enable lircd.socket

systemctl restart lircd

NOTE: there maybe the Warning of duplication of "begin remote .. end remote", it is fine. Ignore it.

Reboot and check status :)

systemctl reboot

systemctl status lircd.service
systemctl status lircd.socket

Test IR

Send some command. replace vendor and command with your


Read RX


Record your own (if you have no compatible remote control or incomplete config)

systemctl stop lircd.socket
systemctl stop lircd.service

record with own key names
irrecord --disable-namespace

systemctl start lircd.socket
systemctl start lircd.service

Force raw record mode (normally not required)

irrecord -f -d /dev/lirc0 ~/lirc.conf

IR remote setup and button assignment

If everything went fine and your remote reading by Raspbery, you have to choose buttons that you going to use for Babooshka control. Here is a list of current commands:

This is how they marked in

To assign comands you need to edit "ARRDOWN", "ARRUP" and so on in Change it for that you see in irw stdout when pressing buttons.


Main package installation

cd /home/pi/
git clone <this repo> (see above)

Make sure that all .sh files inside are executable (have x flag)

ls --all

if required make them chmod +x *.sh

Early stage systemd service (launching led driver and creating splash image)

Create /etc/systemd/system/splash.service file and add there




Activate the service

sudo systemctl enable splash.service

On boot launcher

Add this line to /etc/rc.local

sudo -H -u pi /home/pi/BABOOSHKA.TV/ > /dev/null &

reboot and test :)

systemctl reboot

if everything has been done properly, you will see the splash logo

Cosmetic polishing

Edit /boot/cmdline.txt. Make sure that you have console=tty3 quiet consoleblank=0 and logo.nologo, this is my cmdline:

console=serial0,115200 console=tty3 quiet consoleblank=0 loglevel=1 root=PARTUUID=6c586e13-02 rootfstype=ext4 elevator=deadline rootwait logo.nologo

Disable blinking cursor (probably not required)


Remove tty login service to eliminate blinking cursor

sudo systemctl disable getty@tty1

Additional software

If' you're going to watch videos from YouTube, Vimeo and so on, this packages would be required. Most porbably probably would beed to install youtube-dl globally. So do that with sudo -H .... It would be recommended wor futher compatibility.

apt install mkvtoolnix python-pip
pip install -U youtube-dl


converting video. Note -level 3.0 option! it is required for RPi HW codec. I've been breaking by brain until found that RPi HW codec can't play low profile (or maybe it is driver limitation). However here is some technical details, if you interested in.

ffmpeg -i FILEIN -vcodec libx264 -preset slow -level 3.0 -b 700k -s 720x404 FILEOUT

upload new video from local PC

scp <your_super_cool_kitten_flick.mp4>  <babooshka>:BABOOSHKA.TV/VIDEO/

download new video from youtube (on device)

youtube-dl -f 'bestvideo[vcodec=avc1][height<=720]+bestaudio/best[abr<=120]' --merge-output-format mp4 -o '%(playlist_index)s - %(title)s.%(ext)s' <youtube link>

click PLAY button and enjoy :)


tail -F /tmp/babooshka.log

Known bugs



Download this nice sticker and logo found enclosure and cool sticker


Babooshka tv, как самодельный видео-показатор сместил «точку сборки» моих пожилых родителей [, 15.07.2020, rus ]


Copyright © 2020 Dmitry Shalnov []

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this files except in compliance with the License. You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.


If you would like to contribute to a project, you can always help with a penny. See donation links on the main page.

2020-07-10 Dmitry ShalnoffREADME, minor corrections master
2020-07-09 Dmitry Shalnoffversion added
2020-07-09 Dmitry ShalnoffREADME cosmetic changes
2020-07-08 Dmitry ShalnoffInitial commit
14 months ago master
Contact me: dev (at) shalnoff (dot) com
PGP fingerprint: A6B8 3B23 6013 F18A 0C71 198B 83D8 C64D 917A 5717