Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: Sendspin/sendspin-cpp-cli
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: v0.1.5
Choose a base ref
...
head repository: Sendspin/sendspin-cpp-cli
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: v0.1.6
Choose a head ref
  • 16 commits
  • 17 files changed
  • 1 contributor

Commits on Aug 30, 2026

  1. Wire AlsaAudioSink into SinkRecovery so a replugged device recovers

    AlsaAudioSink was the only sink with a real device not wired into
    SinkRecovery. recover_() handled -EINTR/-EAGAIN, -EPIPE and -ESTRPIPE and
    treated everything else -- -ENODEV among them -- as a failed write: it
    logged, returned false, and left pcm_ open on hardware that was gone.
    Nothing before the next stream retired the handle, so write() returned 0,
    the sync task re-presented the same buffer, and the unthrottled ERROR
    repeated once per retry until the process restarted.
    
    Every error the three transient branches cannot clear in place is now
    device loss. handle_device_loss_() closes the device and spends
    SinkRecovery's inline attempt without making it, which escalates to a new
    poll() override that reopens at last_format_ behind the existing delay and
    budget. Taking device loss as the residual rather than as a list of errnos
    is deliberate: an errno wrongly left out restores the forever-spin, while
    one wrongly taken in costs a close and a couple of seconds of discard
    before poll() reopens a device that was there all along.
    
    The inline attempt is spent rather than made because snd_pcm_open() cannot
    be bounded the way PULSE_RECOVERY_TIMEOUT_MS bounds a Pulse reconnect, and
    on a plugin PCM it parses config and waits on a daemon socket with no
    timeout at all. Making that call on the sync task's thread, under
    device_mutex_, would break the rule the sink's threading model rests on.
    
    The failed prepare() following an underrun and the failed prepare()
    following a suspend route to the same helper. Both are reachable and both
    stranded the handle: a device pulled while the ring drains is seen as
    -EPIPE first, with the -ENODEV only surfacing from the prepare() after it.
    
    Also here, as consequences rather than scope:
    
    - configure() sets last_format_ before anything can fail and calls reset()
      at both success exits, never in open_device_() -- poll() calls that
      between rescan_due() and rescan_done(), where a reset() would refill the
      budget from inside the attempt spending it. Restructuring the fast path
      so both exits share a tail means a fast-path reopen failure now sets
      failed_, which it did not before.
    - write()'s discard path takes its frame size from last_format_ once
      close_device_() has zeroed bytes_per_frame_, so a sub-frame buffer now
      returns 0 rather than length.
    
    No new policy and no new constants. The escalation sequence is exactly
    tests/sink_recovery_test.cpp's escalate() helper, already covered there;
    the ALSA wiring itself needs hardware, and is recorded in docs/ROADMAP.md
    as an owed hardware pass rather than claimed as verified.
    
    Closes #45
    chrisuthe committed Aug 30, 2026
    Configuration menu
    Copy the full SHA
    49b904d View commit details
    Browse the repository at this point in the history
  2. Correct the ROADMAP's account of the pre-fix ALSA behaviour

    The item 14 correction said a device pulled out mid-track "discarded audio
    and one ERROR per buffer". It discarded nothing: write() broke out of its
    loop and returned 0, so the sync task re-presented the same buffer against
    the dead handle and made no progress at all. Discarding is what the sink
    does now, and the distinction is the whole of the defect -- so getting it
    backwards in the one paragraph explaining it was worth fixing.
    
    The hardware pass likewise promised one ERROR for a powered-off DAC. An
    outage logs twice: recover_() names the device and the errno, and write()'s
    discard branch says what happens next, each latched once per outage. The
    property that matters is that neither repeats per buffer.
    
    Also records what holding device_mutex_ across poll()'s snd_pcm_open()
    costs -- a real pause in protocol handling, and a concurrent write()
    blocked on the mutex rather than honouring its timeout_ms -- along with why
    that is not a new risk: configure() already makes the same unbounded open
    on the main loop under the same mutex, on every stream rather than only on
    a lost device.
    chrisuthe committed Aug 30, 2026
    Configuration menu
    Copy the full SHA
    bb1186d View commit details
    Browse the repository at this point in the history
  3. Merge pull request #46 from Sendspin/chrisuthe/task/wire-alsaaudiosin…

    …k-into-sinkrecovery-so-a
    
    Wire AlsaAudioSink into SinkRecovery so a replugged device recovers
    chrisuthe authored Aug 30, 2026
    Configuration menu
    Copy the full SHA
    a3c39f8 View commit details
    Browse the repository at this point in the history
  4. Add a cross-compiled linux-armv7 leg to the CI matrix

    32-bit Raspberry Pi hardware had no release archive: `get_started_linux.sh`
    refused every 32-bit ARM userland and told the operator to reinstall a 64-bit
    OS. This adds a `linux-armv7` publishing leg so a Pi 2, Pi 3, Pi 4 or Pi Zero 2
    running a 32-bit Raspberry Pi OS has something to install, and so the tree is
    proven to still build for that target on every push.
    
    It is cross-compiled because nothing else can reach the target: GitHub offers no
    armv7 runner, and its arm64 runners are Neoverse N1 with no AArch32 at EL0.
    `scripts/build_arm32.sh` owns the cross configure -- a script rather than lines
    of YAML, following the precedent build.yml states for `build_macos_pkg.sh`, so
    it is reproducible without a runner and gated by ci.yml's shellcheck job. The
    suite is run rather than skipped: `qemu-user-static` through binfmt executes the
    ctest binaries and `smoke_test.sh` on the host, so the leg keeps the rule every
    other leg holds.
    
    The target flags go in `CMAKE_C_FLAGS`/`CMAKE_CXX_FLAGS` globally rather than on
    our own targets, because every dependency arrives through FetchContent in the
    one cmake invocation and a per-target flag would leave them compiling for the
    host default. A new step reads the linked binary's merged ELF build attributes
    back and fails the leg unless they say ARMv7, hard-float EABI -- the linker
    merges attributes across every object in the link, so that one read covers the
    whole dependency tree.
    
    Two steps gated on `runner.os == 'Linux'` rather than on a matrix key would have
    fired against a cross-built binary, so the matrix gains a `systemd:` key, spelled
    out on every leg beside `publish` and `avahi`, and an `arm32:` key naming the
    target. The arm32 leg installs the `:armhf` build dependencies instead of the
    runner's own, which is what leaves `find_library` nothing of the wrong
    architecture to answer with; its `expect_mdns` is anchored on the
    `arm-linux-gnueabihf` path so a host-tree `libdns_sd` fails the leg rather than
    satisfying the pattern the native legs use.
    
    ARMv6 is deliberately not here. Debian and Ubuntu armhf are an ARMv7-A port, and
    that is where the toolchain's own `crt1.o`, `crtbegin.o` and `libgcc.a` come
    from -- all ARMv7, all linked in -- so compiling our sources `-march=armv6` does
    not yield an ARMv6 archive, and the merged `Tag_CPU_arch` says so. It needs a
    Raspberry Pi OS sysroot. `build_arm32.sh` refuses `armv6` rather than building
    something that would trap on a Pi Zero, `get_started_linux.sh` refuses an
    `armv6l` host, and ROADMAP item 12 records what it would take.
    
    Downstream: both `for leg in ...` lists in release.yml and its notes prose, the
    installer's architecture mapping, README, ROADMAP item 12, four wiki pages and a
    Troubleshooting entry for the two ways a Pi install can fail to start.
    
    The archives need glibc 2.38 and so will not start on Raspberry Pi OS bookworm
    (2.36); they do on trixie (2.41), which is what Raspberry Pi OS ships. That floor
    is not introduced here -- the existing linux-x86_64 and linux-arm64 archives are
    built on the same image and carry it too -- but this is the leg that aims a Pi
    audience at it, so BUILD-INFO.txt now states it where that reader will meet it.
    
    Verified in containers: cross configure finds all six backends and resolves mDNS
    to the armhf path with both dns_sd probes Failed; the build is clean under
    -Werror on gcc 13; ctest is 426/426 and smoke_test.sh fully green under qemu;
    Package and the payload assertion pass unchanged, unit and sysusers fragment
    included. The new gates were checked in both directions -- the ELF assertion
    rejects an armv8 build, a soft-float build and a native host binary, and the
    anchored expect_mdns refuses a configure that resolved libdns_sd from the host
    tree. The native branch still builds and passes 426/426.
    chrisuthe committed Aug 30, 2026
    Configuration menu
    Copy the full SHA
    b095d32 View commit details
    Browse the repository at this point in the history
  5. Select the archive by userland, and build to the armhf FPU baseline

    Two ways the armv7 leg could hand somebody a binary their machine cannot run.
    
    `uname -m` names the kernel, not the userland, and on a Raspberry Pi the two
    routinely disagree: `arm_64bit` defaults to 1 on a Pi 4, a Pi 400 and a CM4, so a
    32-bit armhf install on one of those boots a 64-bit kernel and reports `aarch64`
    with no 64-bit library on the disk. `get_started_linux.sh` chose on that answer
    and installed `linux-arm64`, whose loader is not there. It now asks the userland
    -- `dpkg --print-architecture`, falling back to `getconf LONG_BIT` paired with
    the kernel's family -- and keeps `uname -m` only for the question the userland
    cannot answer: an ARMv6 board cannot run a 64-bit kernel, so `armv6l` there is
    the CPU speaking. A soft-float `armel` userland is refused rather than handed a
    hard-float archive, and an unknown architecture is refused rather than falling
    through to x86-64.
    
    The build targeted the Pi's FPU rather than the ABI's. `armv7l` guarantees
    neither NEON nor VFPv4 -- a Cortex-A8 or A9 is ARMv7-A with VFPv3 and optional
    NEON -- while the installer maps every ARMv7 host to this archive and the docs
    advertise generic Linux `armv7`. `-mfpu` is now the armhf baseline of
    `vfpv3-d16`, so the archive runs on what its name promises. The decoders are
    fixed-point, so the baseline costs nothing on the path that matters.
    
    Verified: the selection was driven through eleven host shapes, including the Pi 4
    32-bit-userland-on-64-bit-kernel case that was broken, armel, i386 and s390x. The
    rebuilt binary reports Tag_CPU_arch v7, Tag_FP_arch VFPv3-D16 and no
    Tag_Advanced_SIMD_arch at all, still passes the leg's ELF assertion, and is
    426/426 on ctest with the smoke test green under qemu.
    chrisuthe committed Aug 30, 2026
    Configuration menu
    Copy the full SHA
    3d7b2af View commit details
    Browse the repository at this point in the history
  6. Refuse a userland the fallback cannot identify, and guard the doc sni…

    …ppet
    
    Two more ways to reach an archive the machine cannot run.
    
    The `getconf` fallback passed `$MACHINE` through when it recognised neither the
    width nor the kernel, which is the mistake the whole block exists to prevent made
    a second time: a 32-bit x86 userland under an x86-64 kernel reports `x86_64`, and
    passing that on as the userland hands it the 64-bit archive. It now leaves the
    userland unset and refuses, so what cannot be positively identified is never
    guessed at -- which closes the class rather than the one instance of it.
    
    The manual-install snippet in the wiki carried its ARMv6 caveat as a trailing
    comment, and a comment does not stop a Pi Zero downloading the ARMv7 archive and
    meeting an illegal instruction. It now runs the same `uname -m` guard the script
    does, for the same reason the script keeps one: an ARMv6 board reports `armhf`
    like any other 32-bit ARM machine, and cannot run a 64-bit kernel, so `armv6l`
    there is the CPU speaking.
    
    Verified: the selection was driven through thirteen host shapes, the new x86 case
    and the ten from the previous commit included, with no regression; and the doc
    snippet was extracted from the page itself and run against six, refusing the Pi
    Zero and choosing correctly for the rest.
    chrisuthe committed Aug 30, 2026
    Configuration menu
    Copy the full SHA
    5e8e06f View commit details
    Browse the repository at this point in the history
  7. Merge pull request #47 from Sendspin/chrisuthe/task/cross-compile-arm…

    …v6-and-armv7-release-legs-into
    
    Add a cross-compiled linux-armv7 leg to the CI matrix
    chrisuthe authored Aug 30, 2026
    Configuration menu
    Copy the full SHA
    57e7819 View commit details
    Browse the repository at this point in the history
  8. Add a linux-armv6 release leg built in an emulated Raspbian container

    A Pi Zero, a Pi Zero W and an original Pi are ARM1176, and until now they had
    no archive at all: scripts/get_started_linux.sh refused them and the docs told
    them to build from source.
    
    ARMv6 cannot be reached the way linux-armv7 is. Debian and Ubuntu armhf are an
    ARMv7-A port, so a cross toolchain's own crt1.o, crtbegin.o and every member of
    libgcc.a are ARMv7 and are linked into the binary whatever -march said -- which
    is why scripts/build_arm32.sh refuses armv6 by name, and why that refusal
    stands. Raspbian's really are ARMv6, its gcc being configured --with-arch=armv6
    --with-float=hard, and Raspbian publishes no cross toolchain. So this leg is an
    ordinary native build run inside a digest-pinned Raspbian bookworm container
    under qemu-user, owned by scripts/build_armv6_container.sh for the reason
    build_arm32.sh is a script: the archive is the only build of this project a Pi
    Zero owner will ever run, and it has to be reproducible without a runner.
    
    Three things about that container are load-bearing and none of them are about
    the instruction set. Everything runs under QEMU_CPU=arm1176, because qemu-arm
    otherwise emulates a Cortex-A15-class core and would be more permissive than
    the hardware -- at configure time as well as in the suite, a cmake try_run
    probe asking what the CPU can do being answered for the wrong CPU. The
    container runs --init and builds as a non-root user, without which the smoke
    test reads an unreaped zombie as a player that outlived SIGTERM and three
    StateStore cases fail on a permission bit root ignores. And the link needs
    -latomic, ARMv6 having no LDREXD; it goes in CMAKE_CXX_STANDARD_LIBRARIES
    rather than CMAKE_EXE_LINKER_FLAGS, which places it ahead of the objects that
    reference it and leaves the linker to discard it.
    
    The leg is the one in the matrix without -DSENDSPIN_CLI_WERROR=ON, for the
    reason the pipewire-minimum job already documents: gcc 12.2.0's -Wrestrict
    false positive, at src/control_common.cpp:391 and :401 and additionally at
    tests/cli_test.cpp:1133. -Wno-restrict is not the narrower fix it looks like --
    CMAKE_CXX_FLAGS lands before the -Wall that target_compile_options adds, which
    turns the warning back on.
    
    The archive's glibc floor improves for free. It needs no more than GLIBC_2.34,
    where the others need 2.38, so it loads on Raspberry Pi OS bookworm as well as
    trixie -- which the linux-armv7 archive does not. Its BUILD-INFO.txt says so
    rather than inheriting the ARMv7 leg's bookworm caveat, which is inverted here.
    
    Verified by building: configure reports the same backend and mDNS lines the
    linux-x86_64 leg expects, the linked binary reads Tag_CPU_arch v6 with VFP
    registers and hard-float EABI and NEEDED libatomic.so.1, 426/426 ctest cases
    pass under arm1176, and scripts/smoke_test.sh reports every check passed.
    chrisuthe committed Aug 30, 2026
    Configuration menu
    Copy the full SHA
    3452f41 View commit details
    Browse the repository at this point in the history
  9. Say the ARMv6 archive exists everywhere the release speaks, and asser…

    …t its glibc floor
    
    The release notes still told every downloader that a Pi Zero, a Pi Zero W and an
    original Pi had no build and pointed them at a roadmap item that is now closed,
    which is the widest-audience place the claim appears. Five file counts across
    release.yml and README.md were left at the pre-armv6 arithmetic, and
    Getting-Started-on-Linux listed the architectures without armv6 in the line a Pi
    Zero owner reads first.
    
    The one claim the archive shipped that nothing checked was its glibc floor.
    BUILD-INFO.txt tells a Pi owner the binary loads on Raspberry Pi OS bookworm, and
    a container digest moved off bookworm would raise the floor silently and leave
    that text promising something the loader would refuse. The architecture assertion
    now reads the highest GLIBC_ symbol version off the binary and refuses anything
    above the 2.36 bookworm carries, and BUILD-INFO.txt states the measured value
    rather than a written-down one.
    
    build_armv6_container.sh was fail-open on its likeliest failure: `docker run`
    succeeds whether or not the kernel can execute what it started, so with no binfmt
    handler the container is gone before anything looks at it. It is proven now,
    where the message can name the cause. `stop` reports rather than refuses when
    there is nothing to remove, which is what lets build.yml run it with
    `if: always()` -- the step that makes the script's fourth verb reachable from the
    file documenting it.
    
    Three claims contradicted their own neighbours: build.yml, README.md and
    ROADMAP.md each said the ARMv7 leg is cross-compiled because "nothing else can
    build it" within a paragraph of describing the leg that does. The claim is that
    no runner builds it natively. The pipewire-minimum comment said -Werror was
    absent on the ARMv6 leg, where the matrix insists every leg spell the key out.
    ci.yml and get_started_linux.sh both still counted three scripts run on a build.
    chrisuthe committed Aug 30, 2026
    Configuration menu
    Copy the full SHA
    bc17788 View commit details
    Browse the repository at this point in the history
  10. Say why the job-level container: key is not the mechanism, and stop w…

    …riting the glibc floor down
    
    `build.yml` uses a real job-level `container:` on the pipewire-minimum job eighty
    lines below the ARMv6 leg's `matrix.container`, and never said why one starts
    Docker by hand. The answer is ordering: that key creates the container before the
    first step runs, and the emulator has to be registered on the host before an ARM
    container can execute anything, so there would be nowhere to put
    docker/setup-qemu-action. The script's own claim that YAML could not express
    `--init`, the uid or QEMU_CPU was overstated -- `container.options:` and
    `container.env:` take all three. What a workflow file cannot be is somewhere a
    developer runs, which is the argument that actually holds.
    
    Four places still wrote `GLIBC_2.34` down while the assertion added beside them
    deliberately does not: it bounds the floor at the 2.36 bookworm carries, so a
    drift to 2.35 would go green and silently make all four false. They now claim
    what is asserted, and the exact figure survives only where it is measured -- in
    the BUILD-INFO.txt the archive ships.
    
    The rest is rewrapping four comment and prose blocks that were edited in place
    without being reflowed.
    chrisuthe committed Aug 30, 2026
    Configuration menu
    Copy the full SHA
    efcfbd2 View commit details
    Browse the repository at this point in the history
  11. Build the ARMv6 leg with the cores the runner actually has

    The first CI run came in at 24m56s against a 30-minute timeout, where the plan
    expected six to nine minutes. The build is 16m59s of it, and it was running three
    ways parallel on a four-core image: `CMAKE_BUILD_PARALLEL_LEVEL: 3` at the top of
    this file is a floor, and what sets it is the three-core macOS image rather than
    anything about Linux.
    
    That costs nothing on the legs that compile natively, where the whole build is
    seconds. On this one every compile is emulated, so it is the difference between a
    leg with headroom and a leg that fits its timeout by five minutes. `nproc` reads
    the count off the runner rather than writing one down, so an image with more
    cores is a faster build instead of an edit nobody remembers to make.
    
    The timeout comment claimed the 30 minutes was well clear of the slowest leg,
    which the measurement did not support. It now says what the margin is really for.
    chrisuthe committed Aug 30, 2026
    Configuration menu
    Copy the full SHA
    d0834d4 View commit details
    Browse the repository at this point in the history
  12. Give the ARMv6 leg a timeout it is not about to trip over

    The leg measures 22m49s against the 30 minutes this job allowed, a margin of
    under a quarter. Hosted-runner variance is routinely that wide, so the first
    thing to go red would have been the weather rather than a defect -- and a leg
    that flakes teaches people to re-run it rather than to read it.
    
    40 is the measurement plus room for a slow runner. It costs the other legs
    nothing, all of which finish inside three minutes; the six-hour default is still
    the thing being guarded against, and a player that ignores SIGTERM still fails
    rather than holding a runner all day. The pipewire-minimum job keeps its own 30,
    being a two-minute native build with no emulation in it.
    chrisuthe committed Aug 30, 2026
    Configuration menu
    Copy the full SHA
    10eab8d View commit details
    Browse the repository at this point in the history
  13. Hold the warning line on the ARMv6 leg, refuse every pre-ARMv6 host, …

    …and pin the binfmt image
    
    Three things a review of the branch caught.
    
    `scripts/get_started_linux.sh` refused `armv5*` and bare `arm` but left an open
    fallback to `linux-armv7` beneath them, so `armv4l` -- and any other pre-v5
    spelling -- would have installed a binary that traps. It is reachable: the
    getconf branch maps every 32-bit `arm*` kernel to an armhf userland. Every pre-v6
    `uname` is named now, and the fallback is left to the machines it is for.
    
    Turning SENDSPIN_CLI_WERROR off suppressed every diagnostic on this leg to
    accommodate one that is wrong. `-Wno-error=restrict` demotes that one and leaves
    -Werror standing, so an ARMv6-only warning nobody has met yet still fails the
    leg. The earlier reasoning against a targeted flag held for `-Wno-restrict`,
    which a later `-Wall` re-enables, and does not hold for `-Wno-error=`: a later
    blanket -Werror does not re-promote a diagnostic already exempted. Verified on
    the real toolchain, whose compile line reads `-Wno-error=restrict -O3 -DNDEBUG
    -Wall -Wextra -Wpedantic -Werror` -- three -Wrestrict warnings, no errors,
    426/426 and the smoke test green. With every leg back on -Werror the `werror`
    matrix key says nothing, so it is gone.
    
    docker/setup-qemu-action was pinned by commit while its `image` input defaulted
    to the mutable `tonistiigi/binfmt:latest`, which it runs `--privileged` to edit
    the kernel's binfmt handlers. Pinning the action and not that image is pinning
    the wrong half. It also installed every emulator rather than the one handler
    anything here uses.
    
    Also: the `stop` usage line ended mid-sentence, and a rewrap had eaten four words
    out of the pipewire-minimum comment.
    chrisuthe committed Aug 30, 2026
    Configuration menu
    Copy the full SHA
    714ab0d View commit details
    Browse the repository at this point in the history
  14. Merge pull request #48 from Sendspin/chrisuthe/task/add-a-linux-armv6…

    …-release-leg-built-in-an
    
    Add a linux-armv6 release leg built in an emulated Raspbian container
    chrisuthe authored Aug 30, 2026
    Configuration menu
    Copy the full SHA
    e87b4b6 View commit details
    Browse the repository at this point in the history
  15. Bump the project version to 0.1.6

    release.yml's preflight refuses a tag that does not name the version this
    source reports -- `project(VERSION)` is hand-edited in a PR before the tag
    is pushed, deliberately not derived from git -- so v0.1.6 cannot be tagged
    until this line says 0.1.6.
    
    What 0.1.6 carries since v0.1.5: AlsaAudioSink wired into SinkRecovery, so a
    replugged ALSA device recovers mid-track instead of leaving the stream dead;
    a cross-compiled linux-armv7 release leg, with scripts/build_arm32.sh and
    archive-by-userland selection in scripts/get_started_linux.sh; and a
    linux-armv6 leg built natively inside an emulated Raspbian container, the
    only archive that loads on Raspberry Pi OS bookworm as well as trixie.
    chrisuthe committed Aug 30, 2026
    Configuration menu
    Copy the full SHA
    faa0d10 View commit details
    Browse the repository at this point in the history
  16. Merge pull request #49 from Sendspin/chrisuthe/task/cut-the-sendspin-…

    …cli-0-1-6-release
    
    Bump the project version to 0.1.6
    chrisuthe authored Aug 30, 2026
    Configuration menu
    Copy the full SHA
    6b20f85 View commit details
    Browse the repository at this point in the history
Loading