fixing daemon for cam
This commit is contained in:
parent
120424925b
commit
e7bff41c0c
@ -132,37 +132,31 @@ echo 333333 >"$F/streaming/uncompressed/u/f1/dwDefaultFrameInterval" # 30 fp
|
||||
echo 333333 >"$F/streaming/uncompressed/u/f1/dwFrameInterval"
|
||||
|
||||
# ── 3. REQUIRED HEADER LINKS ──────────────────────────────────────
|
||||
# NOTE: do *not* try to delete the kernel‑made “u1” place‑holder – the
|
||||
# easiest way is to wipe the whole gadget at the top of the script (you
|
||||
# already do that) and recreate everything cleanly.
|
||||
|
||||
# 3‑a Streaming‑interface header directory
|
||||
mkdir -p "$F/streaming/header/h"
|
||||
|
||||
# 3‑b Per‑speed “class” directories *must* exist before the links
|
||||
# 3‑a Link format #1 into the header *first*
|
||||
ln -sf ../../uncompressed/u "$F/streaming/header/h/1"
|
||||
echo 1 >"$F/streaming/header/h/bNumFormats"
|
||||
echo 0 >"$F/streaming/header/h/bmInfo"
|
||||
|
||||
# 3‑b Wait for the kernel to create the class/{fs,hs,ss} dirs (≤100 ms)
|
||||
for s in fs hs ss; do
|
||||
mkdir -p "$F/streaming/class/$s"
|
||||
for _ in {1..20}; do
|
||||
[ -d "$F/streaming/class/$s" ] && break
|
||||
sleep 0.005
|
||||
done
|
||||
ln -sf ../../header/h "$F/streaming/class/$s/h"
|
||||
done
|
||||
|
||||
# 3‑c 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"
|
||||
|
||||
# 3‑d Video‑CONTROL side needs the very same header
|
||||
# 3‑c CONTROL‑side header uses the same directory
|
||||
mkdir -p "$F/control/header/h"
|
||||
for s in fs hs ss; do
|
||||
mkdir -p "$F/control/class/$s"
|
||||
for _ in {1..20}; do
|
||||
[ -d "$F/control/class/$s" ] && break || sleep 0.005
|
||||
done
|
||||
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"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user