Posts

installed!

Image
Finally got the chance to install this system in its planned location, our house in San Diego.  As in every other case when I've deployed these klugy script-based video players on Linux systems, a considerable amount of twiddling around was required to make it work.  This is the opposite of trouble-free portability!  But oh well, it's all based on free software, and I didn't have to write any of the "hard" stuff.  Which is good, because the "easy" stuff is plenty annoying on its own. The basic overview: I had to install "fim" and "mpv", I had to install .config/mpv/input.conf and mpv.conf, I had to edit these config files, I had to (of course) install svp2.sh in /usr/local/bin, and I had to edit the IMG_CMD and VID_CMD variables in the script to pass the right options to fim and mpv. Then, I had to figure out how to change the Ubuntu system into console (text) mode instead of X Windows (this involves using "systemctl" comman...

photos of the control panel

Image
  So I built a little unit out of plywood for the control panel, which will mount on the wall.  I used microswitches cannibalized from a computer mouse.  Red and blue LED illumination, of course, behind a diffusion layer of parchment paper, through holes drilled in sheet aluminum (painted black), then plexiglass epoxied on top.  Looks pretty rough and home-made, but the "clicky" feel is just right. The USB keyboard interface is housed in the pill-bottle.  A regular-length USB cable connects this to the host computer.  Then, a long cable runs from the interface to the control panel (located next to Sheila's bed).  I found this nice 8-conductor 24-ga solid (not stranded) "CAT-1" cable at Lowe's, 100 feet for under $10.  I hooked up the full 100 feet to make sure there will be no problems with signal loss, crosstalk, ringing, etc.; I'll shorten the cable to the exact length needed (probably around 30 feet) when I install this system.

software (input.conf for MPV)

## ## MPlayer-style key bindings ## ## Save it as ~/.config/mpv/input.conf to use it. ## RIGHT seek +10 LEFT seek -10 DOWN seek -60 UP seek +60 PGUP seek 600 PGDWN seek -600 m cycle mute SHARP cycle audio           # switch audio streams + add audio-delay 0.100 = add audio-delay 0.100 - add audio-delay -0.100 [ multiply speed 0.9091    # scale playback speed ] multiply speed 1.1 { multiply speed 0.5 } multiply speed 2.0 BS set speed 1.0    # reset speed to normal q quit 1 quit 2 quit 3 quit ESC quit ENTER playlist-next force       # skip to next file p cycle pause . frame-step            # advance one frame and pause SPACE cycle pause HOME set playlist-pos 0 # not the same as MPlayer #END pt_up_step -1 > playlist-next             # skip to next file < playlist...

keyboard interface

Image
  I went to Good Will today, and found myself a suitable USB computer keyboard.  Upon taking it apart, I was pleased to find that it contained a nice, small control circuit board (as seen above) which was easily separable from the matrix of keyswitches. I'm using the first three number keys, '1', '2', and '3'.  Fortunately, these turned out to all share the same row scan-line in the matrix, with three different column lines.  So, a total of four wires are needed, a single "common" plus the three switch lines.  Closing any of the switch lines to common causes that corresponding character to be produced on the USB output.  I couldn't have built any smaller or simpler of an interface myself, with an Atmel MCU or similar, and all the work is already done here (other than tracing out the right contacts and soldering wires into place, a non-trivial and fairly delicate task, but now it's done). The control panel with the buttons which engage with ...

software (svp2.sh)

#!/bin/bash #  Notice, must be run explicitly as "/bin/bash", not "/bin/sh", #  because advanced bash features like arrays are used. #  svp2.sh #  Sheila Video Player # #  svp2:  This is the second version of the player, which now uses #  a few keys on a regular USB computer keyboard instead of the custom #  switches going into Raspberry Pi GPIO inputs.  The switch inputs can #  still be provided by custom hardware, but by exploiting a regular keyboard #  interface, the system can run on any Linux host, instead of requiring #  a Raspberry Pi or similar unit with available GPIO inputs. #  You can specify the BASEDIR on cmdline, which should contain the #  subdirectories videos and images (mainly for testing/development). #  Otherwise, /mnt is used (which is expected to be a user-supplied #  USB data stick; see example fstab).  There's no error handling if #  the directories or expected files don't e...

a simple video jukebox for Linux

Image
svp2 This project is the second version of my Linux "video jukebox". The first version specifically required a Raspberry Pi (or other Linux SBC), since it used the GPIO pins for the control buttons. In this version, I am eliminating that requirement by using the regular computer keyboard for the control inputs.  Thus, the software can run on any normal Linux host, as long as it has HDMI video. The finished unit will still have custom control buttons for the interface, just like the first version.  However, behind the scenes, the control switches will be connected to the "guts" of a regular USB computer keyboard, so that clicking one of the interface buttons is the same as hitting a certain key on the keyboard.  Development and testing can be done with a standard keyboard, no special hardware needed. The software is still a very janky bash shell script (yes, some bash-specific features are used).  It is a little bit tricky to get the button presses (keyboard events)...