Commit b7ef5ef
committed
fix(lva-peripheral): re-enable linger for UID 1000 at boot
Background: PipeWire's PulseAudio compat socket lives under /run/user/1000.
The LVA container bind-mounts that path so the audio thread inside the
container can record from the mic. /run/user/1000 is a session-scoped
tmpfs by default — only created while the user has an active session,
torn down and re-mounted with a new inode each time. When the LVA
container's bind-mount points at a stale inode, ``pactl info`` from
inside the container returns "Connection refused" and the audio thread
crashes with "Recording failed, stream is in status FAILED", which
surfaces in Home Assistant as "the voice assistant is unable to connect
to Home Assistant".
The pipewire stage (01-stage-picompose/03-install-pipewire-audio) already
addresses this by enabling linger for the ``pi`` user. But Pi Imager's
first-boot wizard normally renames ``pi`` to whatever username the user
supplied, which leaves the linger file orphaned under the old name and
the actual runtime user without linger.
Fix: ship a tiny oneshot systemd unit that runs at every boot (before
picompose.service), reads the username currently owning UID 1000, and
touches /var/lib/systemd/linger/$USER. Idempotent, covers both the
renamed and un-renamed cases, and makes the linger setting survive
re-flashes by being part of the image rather than something the
operator has to remember to enable.1 parent e9cca2d commit b7ef5ef
3 files changed
Lines changed: 57 additions & 1 deletion
File tree
- 03-stage-lva-2mic-peripheral/01-lva-peripheral
- files
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
63 | | - | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
64 | 78 | | |
65 | 79 | | |
66 | 80 | | |
| |||
74 | 88 | | |
75 | 89 | | |
76 | 90 | | |
| 91 | + | |
77 | 92 | | |
78 | 93 | | |
79 | 94 | | |
Lines changed: 13 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
Lines changed: 28 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
0 commit comments