Posts

Showing posts from July, 2024

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)...