Closed mtlynch closed 1 year ago
⏳ @jotaen4tinypilot please review this Pull Request
I stacked this on top of https://github.com/tiny-pilot/tinypilot/pull/1588 for the convenience of having bundles build on each commit, so I'll wait to merge until that PR goes in first.
Resolves #1549 Related https://github.com/tiny-pilot/tinypilot-pro/issues/972
Overview
ustreamer-launcher is our thin wrapper around the uStreamer binary. It reads settings from YAML files and then generates the appropriate command-line string to execute uStreamer with command-line flags that match the settings in the YAML files.
Previously, we installed ustreamer-launcher with Ansible. This change performs the install through Debian packaging, as part of our ongoing efforts to eliminate Ansible from our install.
Design changes
The Ansible-based installer had a lot of complexity around how it populated the base uStreamer config file at
/opt/ustreamer-launcher/configs.d/000-defaults.yml
.The Ansible-based installer wrote all of the non-null uStreamer settings to
000-defaults.yml
, but this is an artifact of when ustreamer-launcher was meant to be a general-purpose uStreamer tool rather than something TinyPilot specific. ustreamer-launcher was creating a000-defaults.yml
file that was open-ended because the client using the Ansible role could theoretically specify any Ansible vars.This change simplifies ustreamer-launcher to the TinyPilot use case. We are either specifying the unique defaults for the TC358743 scenario (e.g., Voyager) or the HDMI to USB dongle scenario (Hobbyist).
Now, instead of the installer dynamically writing arbitrary settings to
000-defaults.yml
, that file is a symlink that can point to one of two files.We have two static YAML files that are always installed on the filesystem: one for TC358743 and one for HDMI to USB. At install time,
tinypilot.postinst
ensures that000-defaults.yml
is a symlink that points to either the TC358743 settings or the HDMI to USB settings depending on whether TC358743 is enabled.Functional changes
This is mostly a non-functional refactoring, but for the sake of simplicity, we're now ignoring these YAML settings:
ustreamer_video_path
ustreamer_brightness
ustreamer_tcp_nodelay
Previously, it was possible for users to override these settings in
/home/tinypilot/settings.yml
and ustreamer-launcher would launch uStreamer with corresponding command-line flags. We never documented these settings in a customer-facing place, and I don't know of any users exercising them, so we can remove them.We are also changing the permissions on the files in
/opt/ustreamer-launcher
. Previously, the ownership was a mixture ofroot
andustreamer
. There isn't actually a need forustreamer
to be an owner, so we're simplifying toroot
owning everything.tinypilot
still owns its override file, so the app can dynamically make changes to settings.Manual tests
/boot/config.txt
/boot/config.txt
, and the video stream worked correctlyTo test this bundle, run: