fixing daemon for cam

This commit is contained in:
Brad Stein 2025-07-04 14:27:31 -05:00
parent 2088cdddec
commit 120424925b

View File

@ -132,26 +132,37 @@ echo 333333 >"$F/streaming/uncompressed/u/f1/dwDefaultFrameInterval" # 30fp
echo 333333 >"$F/streaming/uncompressed/u/f1/dwFrameInterval"
# ── 3. REQUIRED HEADER LINKS ──────────────────────────────────────
# 3a Streaminginterface header (directory, not symlink)
rm -rf "$F/streaming/uncompressed/u1"
mkdir -p "$F/streaming/header/h"
ln -sf ../../uncompressed/u "$F/streaming/header/h/1" # “format1” link
echo 1 >"$F/streaming/header/h/bNumFormats"
echo 0 >"$F/streaming/header/h/bmInfo"
# NOTE: do *not* try to delete the kernelmade “u1” placeholder the
# easiest way is to wipe the whole gadget at the top of the script (you
# already do that) and recreate everything cleanly.
# 3b “class” subdirs for FS / HS / SS (must preexist!)
# 3a Streaminginterface header directory
mkdir -p "$F/streaming/header/h"
# 3b Perspeed “class” directories *must* exist before the links
for s in fs hs ss; do
mkdir -p "$F/streaming/class/$s"
ln -sf ../../header/h "$F/streaming/class/$s/h"
ln -sf ../../header/h "$F/streaming/class/$s/h"
done
# 3c Videocontrol header (and class links)
# 3c Link format #1 (our YUY2 descriptor) into the header.
# Path is *relative* to header/h, hence ../../uncompressed/u
ln -sf ../../uncompressed/u "$F/streaming/header/h/1"
echo 1 >"$F/streaming/header/h/bNumFormats" # exactly one format
echo 0 >"$F/streaming/header/h/bmInfo"
# 3d VideoCONTROL side needs the very same header
mkdir -p "$F/control/header/h"
for s in fs hs ss; do
mkdir -p "$F/control/class/$s"
ln -sf ../../header/h "$F/control/class/$s/h"
ln -sf ../../header/h "$F/control/class/$s/h"
done
# Friendly string for entity (unchanged)
mkdir -p "$F/control/header/strings/0x409"
echo "Lesavka UVC" >"$F/control/header/strings/0x409/label"
# Friendly string for the camera entity
mkdir -p "$F/control/header/strings/0x409"
echo "Lesavka UVC" >"$F/control/header/strings/0x409/label"