From e2c8a03d5402a700fdf65c24b79a5f24b59a66f7 Mon Sep 17 00:00:00 2001 From: Sacha Korban Date: Fri, 27 Nov 2026 02:50:05 +1100 Subject: [PATCH 01/39] feat(streaming): add parallel ranges, playback signals and transport diagnostics Consolidate the release milestone ending at aac4e89cf022adf6d5c1bbdf3624bf1537c9e6af. Original starting snapshot: 116a82eee03f3f430d1df22d184896180c4cf94d. --- .github/workflows/build-artifacts.yml | 8 +- CMakeLists.txt | 21 +- README.md | 26 + docs/debug/lifecycle-diagnostics.md | 94 +++- docs/providers.md | 48 +- flake.lock | 9 +- flake.nix | 14 - mpv | 2 +- .../bundled/example.open-movies-1.1.2.szo | Bin 5222 -> 0 bytes .../bundled/example.open-movies-1.1.3.szo | Bin 0 -> 5339 bytes providers/bundled/spool.emby-0.1.10.szo | Bin 52778 -> 0 bytes providers/bundled/spool.emby-0.1.11.szo | Bin 0 -> 53146 bytes providers/bundled/spool.jellyfin-0.2.15.szo | Bin 44441 -> 0 bytes providers/bundled/spool.jellyfin-0.2.16.szo | Bin 0 -> 44796 bytes providers/bundled/spool.plex-0.2.1.szo | Bin 58022 -> 0 bytes providers/bundled/spool.plex-0.2.2.szo | Bin 0 -> 58317 bytes providers/bundled/spool.stremio-0.1.3.szo | Bin 12781 -> 0 bytes providers/bundled/spool.stremio-0.1.4.szo | Bin 0 -> 12992 bytes providers/lock.json | 30 +- sdk/README.md | 44 +- sdk/provider.d.ts | 17 +- src/app/ArtworkService.cpp | 28 ++ src/app/ArtworkService.h | 16 + src/app/SettingsController.cpp | 16 + src/app/SettingsSchema.cpp | 41 +- src/app/SettingsSchema.h | 4 + src/app/TrickplayService.cpp | 11 + src/app/TrickplayService.h | 9 + src/automation/LocalCommandServer.cpp | 15 +- src/automation/LocalControlProtocol.cpp | 115 +++++ src/automation/LocalControlProtocol.h | 7 + src/automation/RemoteDiscovery.sh | 105 ++++ src/automation/SpooletMain.cpp | 103 +++- src/main.cpp | 34 +- src/media/MediaTypes.h | 7 + src/player/MpvOptionProfile.cpp | 13 +- src/player/MpvOptionProfile.h | 5 +- src/player/PlayerController.cpp | 462 +++++++++++++++--- src/player/PlayerController.h | 40 +- src/provider/PlaybackSource.h | 6 +- src/provider/PortableProvider.cpp | 11 +- src/provider/ProviderRegistry.cpp | 57 +-- src/provider/ScriptRuntime.cpp | 79 ++- src/provider/SourceHub.cpp | 41 +- src/provider/SourceHub.h | 2 + src/provider/SpeedTest.cpp | 132 +++-- src/provider/SpeedTest.h | 17 +- src/providers/local/LocalProvider.cpp | 7 +- tests/TestRunner.cpp | 16 +- tests/app/SettingsControllerTest.cpp | 23 + tests/app/TrickplayTest.cpp | 7 + tests/automation/LocalControlProtocolTest.cpp | 164 +++++++ tests/cache/DatabaseManagerTest.cpp | 3 +- tests/platform/MobileTestFixtures.cpp | 17 +- tests/platform/MobileTestFixtures.h | 1 - tests/player/MpvOptionProfileTest.cpp | 2 + tests/player/PlayQueueControllerTest.cpp | 4 - tests/player/PlayerControllerTest.cpp | 34 +- tests/providers/ArtworkAuthenticationTest.cpp | 15 + tests/providers/ProviderRegistryTest.cpp | 8 - tests/providers/ScriptRuntimeNetworkTest.cpp | 6 - tests/providers/ScriptRuntimeTest.cpp | 92 +++- tests/providers/SourceHubSpeedTest.cpp | 38 +- tests/providers/fixtures/resolve-metadata.mjs | 5 + tools/android/build-apks.sh | 43 +- tools/profile-streaming.py | 172 ++++++- tools/webos/device-common.sh | 8 + tools/webos/diagnose.sh | 10 +- tools/windows/common.ps1 | 34 +- 69 files changed, 1958 insertions(+), 440 deletions(-) delete mode 100644 providers/bundled/example.open-movies-1.1.2.szo create mode 100644 providers/bundled/example.open-movies-1.1.3.szo delete mode 100644 providers/bundled/spool.emby-0.1.10.szo create mode 100644 providers/bundled/spool.emby-0.1.11.szo delete mode 100644 providers/bundled/spool.jellyfin-0.2.15.szo create mode 100644 providers/bundled/spool.jellyfin-0.2.16.szo delete mode 100644 providers/bundled/spool.plex-0.2.1.szo create mode 100644 providers/bundled/spool.plex-0.2.2.szo delete mode 100644 providers/bundled/spool.stremio-0.1.3.szo create mode 100644 providers/bundled/spool.stremio-0.1.4.szo create mode 100755 src/automation/RemoteDiscovery.sh create mode 100644 tests/providers/fixtures/resolve-metadata.mjs diff --git a/.github/workflows/build-artifacts.yml b/.github/workflows/build-artifacts.yml index a2dc4367..aa7677f9 100644 --- a/.github/workflows/build-artifacts.yml +++ b/.github/workflows/build-artifacts.yml @@ -92,7 +92,7 @@ env: # PRs consume public caches but never receive publishing credentials. SPOOL_CACHE_WRITE: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }} concurrency: - group: build-artifacts-${{ github.ref }}-${{ github.sha }} + group: build-artifacts-${{ github.ref }} cancel-in-progress: true jobs: @@ -1318,7 +1318,7 @@ jobs: SPOOL_ANDROID_KEYSTORE_STORE_PASS: ${{ env.SPOOL_CACHE_WRITE == 'true' && inputs.release && secrets.ANDROID_RELEASE_KEYSTORE_PASSWORD || '' }} SPOOL_ANDROID_KEYSTORE_KEY_PASS: ${{ env.SPOOL_CACHE_WRITE == 'true' && inputs.release && secrets.ANDROID_RELEASE_KEY_PASSWORD || '' }} run: | - nix develop .#android-packaging -c bash tools/android/build-universal-apk.sh \ + nix develop .#android -c bash tools/android/build-universal-apk.sh \ dist/android/spool-universal.apk \ dist/android/universal-inputs \ dist/android/spool-arm64-v8a.apk \ @@ -1330,7 +1330,7 @@ jobs: EXPECTED_CERT_SHA256: 0c9deff0513eed6d43521df31ad6d2d8e928c029b146d902f4bcc25a883c1fb8 run: | set -euo pipefail - nix develop .#android-packaging -c bash -c " + nix develop .#android -c bash -c " output=\"\$(\"\$ANDROID_HOME/build-tools/36.0.0/apksigner\" verify --verbose --print-certs dist/android/spool-universal.apk)\" printf '%s\n' \"\$output\" grep -Fq \"Signer #1 certificate SHA-256 digest: \$EXPECTED_CERT_SHA256\" <<<\"\$output\" @@ -1447,8 +1447,6 @@ jobs: - name: Build application shell: pwsh - env: - MSYS2_LOCATION: ${{ steps.msys2.outputs.msys2-location }} run: tools\windows\build.ps1 -Clean -CMakeArguments '-DSPOOL_TEST_RENDER_BACKEND=opengl' diff --git a/CMakeLists.txt b/CMakeLists.txt index dea63067..d2c4d162 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -393,14 +393,12 @@ qt_add_executable(spool src/app/GraphicsStartup.h ) -if(NOT SPOOL_WEBOS) - target_sources(spool PRIVATE - src/automation/LocalCommandServer.cpp - src/automation/LocalCommandServer.h - src/automation/LocalControlProtocol.cpp - src/automation/LocalControlProtocol.h - ) -endif() +target_sources(spool PRIVATE + src/automation/LocalCommandServer.cpp + src/automation/LocalCommandServer.h + src/automation/LocalControlProtocol.cpp + src/automation/LocalControlProtocol.h +) if(NOT ANDROID AND NOT SPOOL_WEBOS AND NOT SPOOL_APPLE_MOBILE) add_executable(spoolet src/automation/SpooletMain.cpp @@ -409,6 +407,8 @@ if(NOT ANDROID AND NOT SPOOL_WEBOS AND NOT SPOOL_APPLE_MOBILE) ) target_link_libraries(spoolet PRIVATE Qt6::Core Qt6::Network) target_include_directories(spoolet PRIVATE src) + qt_add_resources(spoolet remote_discovery PREFIX "/automation" + BASE src/automation FILES src/automation/RemoteDiscovery.sh) if(UNIX AND NOT APPLE) set_target_properties(spoolet PROPERTIES INSTALL_RPATH "$ORIGIN/../lib") endif() @@ -1055,6 +1055,8 @@ if(BUILD_TESTING AND NOT SPOOL_WEBOS) target_sources(spool-tests PRIVATE tests/automation/LocalControlProtocolTest.cpp tests/automation/LocalControlAdmissionTest.cpp src/automation/LocalControlProtocol.cpp src/automation/LocalCommandServer.cpp) + add_dependencies(spool-tests spoolet) + target_compile_definitions(spool-tests PRIVATE SPOOL_TEST_SPOOLET="$") endif() add_test(NAME traditional-native COMMAND spool-tests --run-all --results "${CMAKE_CURRENT_BINARY_DIR}/traditional-results.json") set_tests_properties(traditional-native PROPERTIES LABELS traditional ENVIRONMENT "${SPOOL_TEST_ENV}" TIMEOUT 0) @@ -1340,7 +1342,8 @@ if(BUILD_TESTING AND NOT SPOOL_WEBOS) add_test(NAME curl-transport COMMAND "${Python3_EXECUTABLE}" "${MPV_ACTIVE_SOURCE_DIR}/test/curl_transport.py" --libmpv "${SPOOL_CURL_TEST_MPV}" -v) - set_tests_properties(curl-transport PROPERTIES LABELS traditional TIMEOUT 180) + # The real-HTTP suite runs about 330 s of playback serially. + set_tests_properties(curl-transport PROPERTIES LABELS traditional TIMEOUT 600) endif() endif() if(SPOOL_SANITIZERS AND CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang") diff --git a/README.md b/README.md index 0efc9d26..889dec0b 100644 --- a/README.md +++ b/README.md @@ -72,6 +72,26 @@ Back restores the query, selection and scroll position. **Ctrl+F** searches Settings when that page owns input; text composition and modal editors keep their existing ownership. +Advanced **Streaming** settings include **Optimized streaming** (on by default). +Turning it off uses stock mpv networking (`curl-enabled=no`). While it is on, +**Maximum concurrent requests** sets the network-request limit from 1–16 +(default 4 on every platform), not the number of decoding threads or sockets. +Requests adapt up to that limit unless **Use fixed request count** is enabled +(off by default). Forced counts still require server support for +parallel range requests. All three settings apply to the next playback, +persist on this device, and sync only with device-setting opt-in. + +The maximum is a ceiling, not a target. Automatic selection prefers the fewest +requests within 15% of the best measured capacity, or enough for 1.75× playback +demand. Actual playback measurements override probe estimates at the same +concurrency; slower extra requests are not retained just because demand is high. + +**Log streaming performance** is an independent, device-local opt-in in advanced +Streaming settings. It logs once per second while playing, including with stock +networking: demuxer input rate, curl wire/capacity rates, buffer duration, process +and curl-worker CPU, and producer/consumer waits. CPU percentages use one core +as 100%; idle/full-cache time is not link capacity. Logs omit URLs and credentials. + Mouse scrolling and keyboard navigation can coexist. If the selected card is offscreen, the first direction selects the top-left usable visible card without scrolling back. That complete held gesture is consumed until physical release; @@ -194,6 +214,12 @@ and playback method. For example, a 3840×1608 edition is a 2160-class source despite its cropped pixel height; the CLI never reconstructs quality choices from the negotiated output or invents a source ladder. +For webOS, opt in to the loopback control server on launch and use the desktop +CLI's `--host root@TV` SSH transport; no separate TV executable or LAN listener +is needed. `speed-test` starts the normal idle probe, `speed-test status` exposes +its numeric lane curve, and `status` includes actual playback metrics. +See [remote spoolet setup and security](docs/debug/lifecycle-diagnostics.md#remote-spoolet-on-webos). + Preview inspection uses real window input, without seeking the video. For this latency-sensitive sequence, invoke the installed `spoolet` binary directly: the Nix wrapper can take about three seconds to start, enough for playback diff --git a/docs/debug/lifecycle-diagnostics.md b/docs/debug/lifecycle-diagnostics.md index 214d5050..8fe95700 100644 --- a/docs/debug/lifecycle-diagnostics.md +++ b/docs/debug/lifecycle-diagnostics.md @@ -18,8 +18,14 @@ Generated files: webOS helpers: -- `tools/webos/diagnose.sh root@tv.local` prints allowlisted instance metadata, - never raw logs, process command lines, or diagnostic paths. +- `tools/webos/diagnose.sh root@tv.local` discovers the running executable's + process environment and derives the current Qt app-data root + (`$XDG_DATA_HOME/spool/Spool`, or `$HOME/.local/share/spool/Spool`). + It honors the process's `SPOOL_DIAGNOSTICS_DIR`, reads only + `diagnostics/current-instance.json`, and prints allowlisted numeric/state + metadata, never raw logs, process command lines, environment, or paths. + A normal build without lifecycle diagnostics reports the running PID and + `metadataAvailable: false`; missing metadata is not a failed discovery. - `tools/webos/collect-diagnostics-bundle.sh root@tv.local` streams a read-only archive to the desktop. It contains `ps.txt` and a nested `logs.tar.gz`; no temporary directories or archives are created on the TV. Treat logs as private. @@ -32,6 +38,90 @@ noninteractive SSH with connection/keepalive limits and a per-command change app data ownership, or patch installed files. Do not run device helpers unless device diagnosis/deployment was explicitly requested. +### Remote spoolet on webOS + +The packaged app includes the authenticated control server, but webOS never +starts it by default. Explicitly opt in on a **fresh normal app launch**: + +```sh +ares-launch --device tv --params \ + '{"SPOOL_AUTOMATION_PORT":"0","SPOOL_AUTOMATION_INSTANCE":"streaming-measure"}' \ + com.sachk.spool +``` + +The equivalent application-manager launch payload is +`{"id":"com.sachk.spool","params":{"SPOOL_AUTOMATION_PORT":"0","SPOOL_AUTOMATION_INSTANCE":"streaming-measure"}}`. +If Spool is already running, close it normally first: this is a launch-only +opt-in, not a relaunch command handler. `SPOOL_AUTOMATION_PORT` accepts +`0..65535` (zero selects a free port); direct executable launches also accept +`--automation-port PORT` and `--instance ID`. An invalid explicit port or +instance fails startup rather than silently disabling the requested endpoint. +The listener always binds **127.0.0.1**, never a LAN address. Mobile/webOS +launches without the explicit port have no control listener. + +Run the desktop CLI; nothing needs to be installed separately on the TV: + +```sh +spoolet --host root@192.168.0.200 instances +spoolet --host root@192.168.0.200 --instance streaming-measure status +spoolet --host root@192.168.0.200 --instance streaming-measure items libraries +spoolet --host root@192.168.0.200 --instance streaming-measure library QUALIFIED_ID +spoolet --host root@192.168.0.200 --instance streaming-measure items browse +spoolet --host root@192.168.0.200 --instance streaming-measure play QUALIFIED_ITEM_ID +spoolet --host root@192.168.0.200 --instance streaming-measure settings set playback/threadedStreaming true +spoolet --host root@192.168.0.200 --instance streaming-measure settings set playback/maxStreamingThreads 4 +spoolet --host root@192.168.0.200 --instance streaming-measure settings set playback/forceStreamingThreads false +spoolet --host root@192.168.0.200 --instance streaming-measure settings set playback/logStreamingPerformance true +spoolet --host root@192.168.0.200 --instance streaming-measure stop +spoolet --host root@192.168.0.200 --instance streaming-measure speed-test +spoolet --host root@192.168.0.200 --instance streaming-measure speed-test status +``` + +Speed tests are asynchronous and defer while playback is active. Poll +`speed-test status` until each account has neither `pending` nor `running`. +The response exposes only provider module IDs, opaque account IDs, flags, a +numeric measured quality limit (`measuredMbps`, including the normal safety +margin), selected logical request counts, and the per-request throughput curve +(`laneMbps`, raw Mbps). It never returns account names, endpoint URLs, tokens, +headers, or provider configuration. Actual playback remains separate evidence: +poll `status` for playback progress and numeric network metrics. + +`tools/profile-streaming.py --spoolet PATH --instance ID --item QUALIFIED_ID +--output NEW_PRIVATE_DIR --request-counts 1,4,auto --repeats 5 --seconds 60 +--from-start` compares counts in paired repeat order; add `--host USER@HOST` +for a remote instance. It refuses existing playback and restores changed +streaming controls in `finally`. Schema-3 reports keep explicit bounded numeric +transport fields and protocol identities. Ordered/received rates omit intervals +whose endpoints are paused or seeking, but include full-cache idle time: +they are observed playback delivery rates, not isolated network capacity. +`countReached=false` invalidates a fixed-count comparison; it is not a slower +result for that count. HTTP/protocol and receive-window controls are only +available when their transport consumers ship. + +SSH must already have a trusted host key and noninteractive authentication. +The CLI uses `BatchMode=yes`, strict host-key checking, no SSH configuration or +connection sharing, and `ssh -W` encrypted stdio forwarding directly to the TV's +loopback port. It creates no local forwarding listener, remote temporary file, +or persistent tunnel. All child processes and response sizes are bounded; +timeouts kill and reap the SSH child. `--timeout MS` (100..30000, default +10000) bounds remote discovery, probing, and the command together. SSH stderr +is not copied into CLI output, and the capability is sent only through stdin, +never a process argument or printed descriptor. + +Discovery uses the same process-derived Qt root as `diagnose.sh`, under +`runtime/spool-control`. Descriptor directories must be owner-only (0700), +files must be owner-only (0600), regular and not symlinks. The directory and +file owners must match the packaged app process UID. Non-root SSH can discover +only its own UID; root SSH can read the app-owned private capability without +changing sandbox ownership. An explicit descriptor selected by root must +likewise have matching private directory/file owners. `--instance ID` selects one discovered instance; +without it a command requires exactly one reachable instance. With `--host`, +`--descriptor /absolute/path.json` means an explicit **remote** private +descriptor, not a downloaded local file. Without `--host`, it retains its +local meaning. `--descriptor` and `--instance` are mutually exclusive. +Do not print or copy descriptor contents. A normal restart without the launch +opt-in disables remote control; clean shutdown removes the descriptor. + ### Package and verification modes `./build-ipk.sh` and `./build-ipk.sh all` both run the complete pipeline: diff --git a/docs/providers.md b/docs/providers.md index b2daae94..f9dae04c 100644 --- a/docs/providers.md +++ b/docs/providers.md @@ -430,16 +430,44 @@ file when a server ignores Range. `SourceHub` probes enabled accounts one at a time after five idle seconds. Starting playback or other foreground loading cancels an in-flight probe; pending probes resume when idle. Account removal/restart discards its result. -Measurements are session-local. Failure leaves playback usable and keeps any -earlier successful measurement for that running account. - -The benchmark warms 512 KiB and compares 4 MiB transfers over one and two -connections, adding four when latency or dual-connection improvement warrants -it. It chooses the fewest connections within 85% of the best rate, then reserves -25% headroom on that connection count. The conservative ceiling and lane count -reach `resolve` as `measuredBitrate` and `parallelRequests`; the native player -uses the same lane count. Providers must let explicit quality choices override -the measurement. +Probe and playback evidence is persisted per origin and expires after 30 days. +Failure leaves playback usable and keeps earlier valid evidence. + +Native optimized playback installs its per-playback transport facts before loading +the media. Only a successful asynchronous configuration acknowledgement for the +current core, play request and epoch releases that load; stop/replacement discards +pending loads. Policy rejection reports a playback error rather than starting +with another session's facts. Trickplay and artwork HTTP activity jointly mark +capacity windows as contaminated; either source remaining active keeps that flag +set. Memory-cache artwork hits and local-file decoding do not set it. + +The benchmark warms 512 KiB and always measures one, two and four requests. +Generated endpoints use adaptive 4/8/16/32 MiB batches, preserving common server +buffer size classes; Range endpoints use 4 MiB batches. +Each operating point repeats until 400 ms or 64 MiB, with a 2.5-second cap inside +the shared 15-second operation deadline. Rates use actual received bytes and +elapsed wall time, including connection/setup costs. The quality ceiling is +75% of the best measured rate. + +Selection prefers the fewest requests within 15% of peak capacity, or providing +1.75× media demand when that requires less capacity. If no count meets demand, +it still chooses the near-fastest measured configuration, not a previously +slower high count. Fresh actual curl evidence overrides probe evidence at the +same concurrency. The complete curve and conservative ceiling reach native +playback; providers receive `measuredBitrate` and `parallelRequests`. +The player reselects within **Maximum concurrent requests** (default 4), using +the current file's bitrate. Forced counts bypass adaptation; disabling +**Optimized streaming** uses stock mpv networking. Explicit quality choices +still override the measurement. + +During playback, upward trials require a measured throughput gain, not merely +meeting demand; downward trials can recover from negative scaling even when +demand is unattainable. **Log streaming performance** optionally logs numeric +input/wire/capacity rates, buffers, CPU and waits once per second. Wire rates +include cache backpressure; capacity samples exclude it. Curl CPU is measured +worker CPU time, not elapsed network time. `ring-wait-seconds` sums producer +backpressure across streams; `consumer-wait-seconds` sums completed empty-ring +waits. These counters and actual throughput are available through spoolet. The player's Quality → Auto detail shows the active account's measured limit. Settings → Streaming → Connection speed shows each enabled account and offers diff --git a/flake.lock b/flake.lock index 605481b1..2e7fd75a 100644 --- a/flake.lock +++ b/flake.lock @@ -20,10 +20,11 @@ "mpv-src": { "flake": false, "locked": { - "lastModified": 1792661579, - "narHash": "sha256-9IwML0Hvvcy4q/Karfybb6UXCvfvAOQlAk5b9AyiweU=", - "rev": "95114ebccf43fd482aae620584f7fb6ace4d8095", - "revCount": 55868, + "lastModified": 1792780682, + "narHash": "sha256-d7JGskrqhdkVJ3i3UMYC66DCk1WpAWaKnA+rI4v6uKQ=", + "ref": "refs/heads/universal-sync", + "rev": "5b0231eb803df84e18669b560a2a5321f5fb2118", + "revCount": 55879, "type": "git", "url": "file:./mpv" }, diff --git a/flake.nix b/flake.nix index 3e826f82..76111190 100644 --- a/flake.nix +++ b/flake.nix @@ -823,20 +823,6 @@ SPOOL_ANDROID_QT_HOST = "${androidQtHost}"; shellHook = gitHooksShellHook; }; - - android-packaging = pkgs.mkShell { - packages = with pkgs; [ - android.sdk - bashInteractive - git - jdk17_headless - python3 - ]; - ANDROID_HOME = "${android.sdk}/libexec/android-sdk"; - ANDROID_SDK_ROOT = "${android.sdk}/libexec/android-sdk"; - JAVA_HOME = pkgs.jdk17_headless.home; - shellHook = gitHooksShellHook; - }; } // pkgs.lib.optionalAttrs pkgs.stdenv.hostPlatform.isLinux { windows-proton = pkgs.mkShell { packages = with pkgs; [ diff --git a/mpv b/mpv index 95114ebc..5b0231eb 160000 --- a/mpv +++ b/mpv @@ -1 +1 @@ -Subproject commit 95114ebccf43fd482aae620584f7fb6ace4d8095 +Subproject commit 5b0231eb803df84e18669b560a2a5321f5fb2118 diff --git a/providers/bundled/example.open-movies-1.1.2.szo b/providers/bundled/example.open-movies-1.1.2.szo deleted file mode 100644 index 92a73888434a0dc5eda00784c60e3a15bfc65b64..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 5222 zcmV-s6q)NNwJ-f-08hoD06L~DA3`u^h;zWez={T0=wM4hL4mR=I$?jyl)6Q(G#1(< zg%rc+V3pIg`@}z$S{U$)P%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xw+1#3+*$d zXv=gnAw6u*LeF;d$woEbh_^gRjw&lht*XaUX?j!#k-2=lDlkq)GytxO!~YwZ>Vu~Q z&wVoz@SNNMayB}xHNZ_AVw2k9|9NB;b z{irE02?I$Q@0<(>7U&3NsvhzbdqAZjkN~JKmiiMgEdu3nMs5~&YMN1zJr~fQjYz&^ z0&B!OCn)*dJ#=5_)>*1=u-#MEPMn|Z0mFu(l2;XBQ@9vx$W-Rj|k`;Kcle8Q32JZnp5aSf{>VcWupPxxyONqZVR@?XdH^#8{qChq z%L@k?2ODC0TTO$wE89U2%X2`slxMxQgwTxl(LQHCj1v`tuy6jR)kSRw{YH1!D36Psas6weoxYZ9r~&;{p# zAssp=bd<55TO^>n! zlDe2;vc=24O&@F!aY_=)?iA;oT?gmw$wCnf7ictyVP=bII?3()hPo?93OR4A>%%bB z90H~S8YWQa8j$^-=xctJW1u&p9MG_UZWS0g1|Pi$-j(42FjB5Wc>tAjfRK(dioYOK zHTX~gLu>MmCWkXwXyf>foM3|*zK7dQ!U{Xly%i<-&`NDEtJNX7wW6X@r$xe8+0TF_*o=S>lm*fDjJe5PUgZ|!t-mlRQJ gxI|m?r01ST7SNF`jh`TP;~hf+)YFBrB}<8Zec++}w*UYD diff --git a/providers/bundled/example.open-movies-1.1.3.szo b/providers/bundled/example.open-movies-1.1.3.szo new file mode 100644 index 0000000000000000000000000000000000000000..739eadda73daad6c1112b1856b043eb3f1fc6053 GIT binary patch literal 5339 zcmV<16eQ~?wJ-f(08fpk0J^B4A3iXPI0wMMzzSnnP#p#a25^9~`fbYy+agz}a>?eB zVoZl|oZ9Nzs$W6<*2hs*olq_Qd#Th}-lk+pLpf1C1On0l?g8MHqDFBj90>y*0aRw% z2P$*H&l_aQ0zqZK+fkPal{qmL!Ix`G!7QnuE)h&&3Y7t=7N+(RQ<_D4Fl8o_Nz*Xm zy&#o&Izteqs8}Q@70W}!S9;F1zx^+{`*}hEXRBtd;--Cc-(6qno|M?i-N}$|r9H(^ zf;79Asv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9fwY^V?IwqhRph3Wsf73X}=;~X%Sn@Q$53kQCnCt;NoZlh6244y3j z>7>6yHdL$}F{FAES|7d?-Vo3hsK7!-7yQ_7MqkUe92Rv01p^BG6XqfqW}urshgj^WJ}FH5u*5=3qP*cSdezD9r7sM8ce=3g6FhU3$$ tJ+Xtk`TKmslx*!>>rNI?>UW87<_XU|rYxYNE$}`GOh$D8`QoGtqhf`TOq&1z literal 0 HcmV?d00001 diff --git a/providers/bundled/spool.emby-0.1.10.szo b/providers/bundled/spool.emby-0.1.10.szo deleted file mode 100644 index cbaef29f1609d7c70f17846607bc5c3fde04ba55..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 52778 zcmV(jK=!{VwJ-go0Qdp`q;mjDL#PWQ09V^R-9+UyQBKp^a!KeH$crT?HWv{6e^|kf z>h=GR`>zqT0I&eB0NdJW7dP1a*Q}h4S;UgvG=x&IB9wC1FVqmVB99h}UGs^snIG_d zv$gb<+}c$&j(;vo1$Q}JS?>{c6Ge;x`%==0AIq`x6ep<2oXAnGw%D^=_O|3ga#gY= zNjUT3`^&_L zb->tLXUG>TgyW){Uq<`vyvNT>D#x)qZ~jkd|G7n%9FraOi_G$sCIx)d`zE%dmtq+4 zW6tf0qC0Osy8{*9yBs*Kc>4EP_2vnG6SZXaFHv|!Ginqj;rb(?r+sROW{ZyDn?1jF z7XS0e{<2j%ANXFeAZ<>`__| zY&T!~Z2>Q%ErZGEq|45MmE#Xt-fMwTr=O>H_Q!Q%D;{&6zm(PzqY?ZA}Ym2A@6W7NYy}~tRb#OOJ7JGFsiXU|s zy!o)l{FoFlqqY0?S+Z1D<*+}iZ29tQFFJ1_ZX&~o50n@?Ya>WRL|dP&L6cQEOSMkr z%qox@hx&A+)+ZT^o1w~7dt#D3gz*m^W(>3^MXM{Dr6L5irPc^lCxvmSqY7)NOe9H4 zQW*||Fc1t55Sq^FR9gL06T6U*DH#sOj1w@ykqJab0!b1i1xYID%uoRGLI*K0K;N@E z6xA|;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(RB(d|0OZ1?9U;MDp~F)-`OX;z(<F)X=P#cy*JTmE;ww_cEt<6*Dty2>>b|bE%gp{+NY<5H45;F=tNX zCTE$;_e6^O5IBuu_+k&G)eJ0B=?%Pm8x<_yT5H%}mfKHw2E;S$Xx*?57A&Pk*vIjka_qH01Hmg{2U>v501!1*Lfi4G*Y zpP%fu$_bH?q{i{7{8D&lu@pgfd@dHdL2+9k8dt?cOJzxdl-jzJ-Q?N;eLwJ?c8A5+ zyc>{K;jLMo+GQskznF>}0Loq+j`n1!Wn*oYrLc&?Zt=P~*+lAP3jnw?Z+pLW1dn54 zC4>oJ->KO8bq7FpRREvM(y3&7AX9zoN>PJ*eV#58z!>$1o$#i-Uon|(9&A&3;%u%G zw2vy+(P%E{Yykp|GUG-eA(0V0YFEvgq9?@~EY(%grr;da;+;7~{+Sd333&pNl=n1& zEkES%CnEu;XX%5ZILgZw8y=cM7Un3gFxE!_o`&B#VG-hPKauILjy0|FlQTG5r9613 zsx=mK6pI<@>;eAs{kYNRthBfv6H|k#$oi#(BJfDP?*Gj_YXd!>R>|)~2LWotVh=j} zaMpvtZaEU+OQA*Qlofq3qQu;IgVGA2+NX`6xXz&+^>{3g9{Hf8(OxwoQ>6XTq$3dG zQrU9230Bo<2nrZSYFnr}vNZ%BOUG;-gnK4r)tJ``z6oGHY|wXoVLH}Ms_hN{4{ER} zP^X4Mprwf|W1$0m4CNJi8}=}bxiWi9SkUa&DOTYJ3`8}{Jh(tU)Qi;o*eOidnW9Li b3B*HZl*u!cNlpYS!;6z98ar>!3TDy;s)SFg literal 0 HcmV?d00001 diff --git a/providers/bundled/spool.jellyfin-0.2.15.szo b/providers/bundled/spool.jellyfin-0.2.15.szo deleted file mode 100644 index 0a23e13b9e300ac5a70596891ba1ff301c84df6f..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 44441 zcmV(#K;*wDwJ-go03ZVZO#J{Vm<$>>U~AI>Fbu;m3`2sbE@rJYDU;Ana@8WWy_1w<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A~+QZ#OH5X9xPAF3!V^rn^YL3V?|V_6zSnKp>O8GZ5`lIOvt>ua{*Hd zUoUU;Cc2s{Pqpsj1Vd@PX|DN*`{#8{@`kJ&L+PbFVb6kdj(US3dh|AgyfX9$bEla+ z=zjwv=*?Hq<6xtew>qOuej diff --git a/providers/bundled/spool.jellyfin-0.2.16.szo b/providers/bundled/spool.jellyfin-0.2.16.szo new file mode 100644 index 0000000000000000000000000000000000000000..c337622ae60c6427b06234ac7653c2d600974750 GIT binary patch literal 44796 zcmV(tKl>GqOm;4zwU~AI>Fbu;m3`2sbE@rJYDU;Ana@8WWy_1w< zBM^$DcpPPgUaw>D?f?4SWYl!g!2ASoY(Yng0fYgO0nB_qRwEGZ4M~XD7}llByME_= zX^gC_<<$2rgRIcO;34xq52LkCe;?=eKjz9z&pvJaaj`f5QPTfq?NVEiBX+$a4`C9- zN31SGC9rPxMeDXLZcQ_4e_Z@^zSy*L{X|sSPOEw6*5u-beJ6gzaMwTl*oY={U&l|nO8coA{a%1vIVfJnd-LRkX1~+S<;%`>HIXm$Z7(`j zjpjCuHjZ~5NWgwuL?P-Y*S3%^NN>Zy)9WoI^teUGUYRm}xHW`@Vey@#FtS}33E5%H zheq~;Q1caoVT{>i!;HKa<7XA*q@ol86)~~oYkpq~x&M|iM>2L!l#uEib7%+vT;a!v1W=ivn3%8_h>(zw zn1}$N;nAUyvB43X&T-}+tEO;MwQIDtOr4}wU9=W8llo#AwNzr>$uO>?4}#!q@gFReNy|I0tUt}Gxf-rKKVBNGC8%j zkx8G)cR}8=4(0KYI9I=NaJ|-zR7)w=EVvpz2I`yK>#zJeZ-W4HQnV1NnpB~qo5noF z60`NkPQs6>rE?fcJ?^5|#j+}|CKOIJO1C|4YWo$^Sr=H;6Q3de)x5v`b!jJD+Cs>Z zidc3ZqO@USn7;CeNK7uyuBP5MY1B|FjsJE_3d`R9vI7w)E##TN)SM#>$&1%?w65El zJ*r~Tx&vB|l0kgi+uh?tnTP*4D%5TQdQfUT*@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7@5-x)F4T&hS>!pq7W}ywe(CJV@)c(i+}5 z?+Bp*)LD(Ki=5)SF_9;f8LTps#5X8Yjqr;1`@ zsh4du8cgda2h+oBj0bB0FsuJI)V68O+FU+C1=vs-j>y~6kmsqGI(t!)t?Po`Av`us zhvoLG#9`_rYv0xbs5O5>3Emtl0ckWbs!y_`z@31VZ+u8a*ON{Zs8#{xfh3q;8LV21 z0-UvU4-$mOI$hTz^g;jJhV(mv3b|ClVCAXdF2*x&+I;`%_~1zoH~eG*$SUsBs9s~E Prqh8bpkcuQ+J`Mu*8@fu diff --git a/providers/bundled/spool.plex-0.2.2.szo b/providers/bundled/spool.plex-0.2.2.szo new file mode 100644 index 0000000000000000000000000000000000000000..2239f6b936608232d79f25d92eb46a3391330947 GIT binary patch literal 58317 zcmV(rK<>XNwJ-gk0KfwPtaAWLL$C`Z@OIlR-9)7{QAYFIa>*3E<^18oXTfnCvoQKy zF<2ay32YGowE(XGuK?TnX%{ot{O7EkjoHJJ?exZEVnrzBuHQ{>s1UYoYO9xg{qDIVo?+9iw;6aszOupgFK1qP}PdMUsx82g<;7C+?H z7_0Sj=EmCh`Xpum_{yIEmjz&ekbr=IIk;#v8iWhLM2E&i#05rPS(F(?IP>DaOng`d zjJz z=XOQWpEsYKfr{^43>;TH{d=r>vxMK7AGKumFHLwwGinni;W{KYQ2VqH%@&=)H+z2l zEdJ*Z$QL64l6a(^g%JPkTCAT>k+XDmaK7GYH=>*di1zF(ThXt49m@`p;Kjic*`u@| z*lxb|+X5|v$>^lZ?tzu#|5)BjfzhX*r+4Pas0G9P72UXLuN@YRw=2UcLQyAw_TUEj zxiwg%#FcM>%6VHDeu@$MHf4^C8jpG#HI_cOq}V#vXI|wyJ1X(ULsen|!^~-T_Wc`~ z?D(X8(pQYzbWGwKRU}WZnJ@v2ko_U36hS2dg*;;<>#pmsYoyaUA1SQ7L+UW7{Fk6Ept8$iVpURn4 zAUBQre5BSV8H{_O%2az|l0Ag+4IW+yv?oQY)vk1wiW{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qaZ^f3(j!~{gif>=JX{O3S= zBr@rFod`_}uy$z^QQym1iDT5qGJDv>O=@k7a{gp&3prPqp{;P5GE3WM7t}I!U<#d& zix$$0&Xn~R6Y$$1L>JzCPWD0aMd`pB^6P8H?Id~L0(tJQ5mG;FNIg-@6%^MvzS)xp zhE&G^Fr^*c!dn-JVB`+iR#NA7LQ#Oejf(p%jl(|NDtoa;^U(xlV6?M)(ze_?M?7xd z{?k3hCwH&0Un;jisy#n55ucZH4<~^fhYn55PjZSX#8+(`$2L%QN zeb+>#zY&3&hsqpXpb1R583s=^su~bXMoySNeha7O&M{=L@i$tB(22W)Ouy)MMg@@~@zyM(k7 zE1~+Ndq*7_K+|d*Ss=yTUwAGy49`N`&JBrCI|Rr3DeGR;j_`>#>v7QeW9J8%Vs;Nc z{*+QSD!t4~Bg1n!X^>sh@e?ZT2A6HRwr#eLInASZ%D!E-M*b9RJlwGnTB`)^v~*As7S1 z0BjcJ?L2k~jDrhNQ${Ne!oJP;OjG{xy1po?$1J8!$scw4bqbH=l({Tr{UsceGhQd5 zTbK&p2q;pwUhhc2lFCLw)dJaGf0dnQ@y}`g;E}y58h4I8^qZ)g8ykU3bTP49BoS!r y;CD)^4kEMYDSaw;p$86)MzN#Hl?!*zAx1 literal 0 HcmV?d00001 diff --git a/providers/bundled/spool.stremio-0.1.3.szo b/providers/bundled/spool.stremio-0.1.3.szo deleted file mode 100644 index c1abfe8efb4a7f372c2e3cfbeb3ad706019bed59..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 12781 zcmVd0czvCDnbxTsB-`S004?W5dew+pa=jsj-Wh4TSnj(xf-R} zpCVRWo?p)^R_njtF~#@1zK`t}nPc7-+c=H>d~zZH03tXRt^%F{nF0|9SgGXTp{ zVJh8@Z{(*AYLXqMOZhq|;MZZ=_^zlC=}Ol$!Z#|M;^}mXL^d#Iud2MQA4fwp zOd2#vLxV!e^pQqB`@e+DDeK5F_8HdBQhcZN$Mh^IN%o&^=gz@*+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Hfq3vHb6<8T!NlhKn`|-!RO;_}xh&mVvc{a8Bf}xUlR+1`#(>w0b|n>5 zq?{H5z+ZeM5NDz>yxKS5egjnVc}K4U#kyU}sQUGhC&?(#rf0G#51mmb|^weFY0L}Kxubro3yIC-|s+f4&AQE zz(LZ}{1e|44Uc@$Q!yHP`98fUTXEK7pqqgl&8ZjNsGyYLU-Z`a=U&;X#h4uEPx(i^=IT8y6GgTSA) diff --git a/providers/bundled/spool.stremio-0.1.4.szo b/providers/bundled/spool.stremio-0.1.4.szo new file mode 100644 index 0000000000000000000000000000000000000000..45763d0b6b1929f156db08d13b5e193e2dbde206 GIT binary patch literal 12992 zcmV;xGC$2IwJ-f(0PnSx0s7!{DnlSisB-`e0Gt2^04ES&2q3u%jny?GQsiurE8|3# zq=@O5R{N=>cKf2O{kOmxeWRnv&<*G&6s+EI>$%7YBtpWA1*8I-0+Rxz7bD?@-W#S8 z-Uvy5+Nh?vVZxJeVqj#W%|p{76UY{6&jQ^a23Tv5d7S%$}F z;Jme0n}cZ*@dlCK6+Ag0kvt*`mVv3;L#dY5|y%oc$ z@ms&Cdj5OI?Ax1pUw;tfQp=#)|Fz>mZ+snriCiDte(T(yUCWP}R(xm=asKM(>H2N` z+<=MBA-6j^eSP1n)}PvWYpG_OpH>sjqT?EV-kn>F#SX&2z|gR;fjXQ84oP9zd@vpi zrvtj^beWIEv+m;4abPYSOhrahf#Fy_AWkO(x>!D#th0bJOn1?BG>%Q@LjlrUbeNBS zIvvPj@u0%8u}t{I0iBC;GL8&%!F)1}C3C@eI#1x!p>T{w!jjQAM#7?V5C`J`;~kF6 zuETIZ845=Npo}IXVX?S;FdL`nWHg>lrh=21xX@fUosXpg^Kn>!G7r4NWI!Ct$2A&@ zcbkkwbLlb@{^?kNE-XI5v3S*4DxbhiWE^xp9`7=a`B)x+C_0^EEI`PPY58w2*qJ^|7x;)Fl<}24(ApO;P$p8tXC?;(?j#AjJVYSz2<2$lI zm*@prBB$}>6sR>XBZ^2^|V_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pJO-Av?kh3gaVzblSqN$ z?rlH)iw*(K!efCQfka^j*p8!XqmT*cPB!ig&!;qUFR@u7w-E%A|0bv68RSgXrw;+7O=)E1MhUv# zCAm3dUXi{ASg(moG-Mj?`eKs9h44FyWeCAaEEvhS~mAv*KaER>9aiQ2PEa(Lh?@ z7WC=0lsr6THhjJQ+rU9a!eNT6|Df|O^{8`T?q C6z(ek literal 0 HcmV?d00001 diff --git a/providers/lock.json b/providers/lock.json index 86bca848..aaff7549 100644 --- a/providers/lock.json +++ b/providers/lock.json @@ -4,37 +4,37 @@ { "id": "spool.jellyfin", "appleAppStore": true, - "version": "0.2.15", - "archive": "bundled/spool.jellyfin-0.2.15.szo", - "sha256": "65efc71022a12f02caf19560c53f6404d2e49037c4b8bf29a6a73dcd233823a6" + "version": "0.2.16", + "archive": "bundled/spool.jellyfin-0.2.16.szo", + "sha256": "39b0d4363e1c9e72fec2e71ed04ffe91210066e8aa7545859899eb2d24461e0d" }, { "id": "spool.emby", "appleAppStore": true, - "version": "0.1.10", - "archive": "bundled/spool.emby-0.1.10.szo", - "sha256": "ee2ab45c03e1dd94011fcaefddae6030baf1c46e2554d2974a69f79227363a6b" + "version": "0.1.11", + "archive": "bundled/spool.emby-0.1.11.szo", + "sha256": "7d66f5ef22fb4639079915b8b8b9cad40d3952712113c47069dd910919c0357a" }, { "id": "spool.plex", "appleAppStore": true, - "version": "0.2.1", - "archive": "bundled/spool.plex-0.2.1.szo", - "sha256": "36a9712c8afdc3f9e9836df104676a55fe10854aeb57056af1aed7035870939e" + "version": "0.2.2", + "archive": "bundled/spool.plex-0.2.2.szo", + "sha256": "7ce4de12407c612cdceebb11980aa5814832c4713856a2d356f629cc4f30cad1" }, { "id": "spool.stremio", "appleAppStore": false, - "version": "0.1.3", - "archive": "bundled/spool.stremio-0.1.3.szo", - "sha256": "b438e9acb27690ab14cfb72baa40fc9cea299d7a4e12282ac78fdb430efc9351" + "version": "0.1.4", + "archive": "bundled/spool.stremio-0.1.4.szo", + "sha256": "1406a778b5d37de7e567515478ac2aa93335f9aedfcb52134f78f57816c660c8" }, { "id": "example.open-movies", "appleAppStore": true, - "version": "1.1.2", - "archive": "bundled/example.open-movies-1.1.2.szo", - "sha256": "e9d7f10328309c2810049c86aa8a4f0a70fd24bc91dcad666fe6a2d52f819c7f" + "version": "1.1.3", + "archive": "bundled/example.open-movies-1.1.3.szo", + "sha256": "f44bd1a2ccaa50b6c2dd5e5c88f74d703671ccb3df0806564430e74960243966" } ] } diff --git a/sdk/README.md b/sdk/README.md index 3e9fe730..629f736b 100644 --- a/sdk/README.md +++ b/sdk/README.md @@ -150,21 +150,25 @@ requests bypass HTTP caches. The measurement includes media-server storage and transport overhead, without starting playback or a transcoding session. Providers cannot supply their own `Range` or compression headers. -The worker warms 512 KiB, measures one/two connections with 4 MiB totals, and -tries four if warmup time-to-first-byte is at least 20 ms or two improve the -rate by at least 10%. It chooses the fewest lanes within 85% of the fastest, -returns that lane count's rate with 25% headroom, and clamps to 1–1000 Mbps. -The result is `{bitrate, parallelRequests}`. Bodies never reach JS; the probe -reserves the operation's HTTP slots and shares its 15-second deadline and -cancellation. `speedTest` exists only on the operation host, not the source host. - -Spool schedules probes while idle and passes each account's result back in -`PlaybackContext.measuredBitrate` (zero before measurement) and -`parallelRequests` (two before measurement). Use the measured ceiling only -when the viewer has not chosen a session or settings limit. Spool shows the -result under Quality → Auto and in Streaming settings. -An in-flight bounded probe finishes even if playback starts. New automatic -probes wait for idle; an explicit refresh may measure during playback. +The worker warms 512 KiB and always measures one, two and four connections. +Generated endpoints use power-of-two 4/8/16/32 MiB batches; Range endpoints use 4 MiB. +Each point repeats until 400 ms or 64 MiB, capped at 2.5 seconds within the shared +15-second operation deadline. Rates use actual bytes and elapsed wall time. +The result includes `{bitrate, parallelRequests}` plus the measured concurrency +curve. `bitrate` reserves 25% headroom from peak capacity; the lane count is the +minimum within 15% of that peak, or sufficient for 1.75× known media demand. +Bodies never reach JS. The probe reserves the operation's HTTP slots and shares +its cancellation. `speedTest` exists only on the operation host, not the source host. + +Spool schedules probes while idle and passes each account's conservative ceiling +in `PlaybackContext.measuredBitrate` (zero before measurement), and the learned +starting count in `parallelRequests` (one before measurement, integer 1–16). +Fresh actual playback evidence overrides probe evidence at matching concurrency. +The native player reselects for the current media demand and user request cap. +Use the measured ceiling only when the viewer has not chosen a session or settings +limit. Spool shows it under Quality → Auto and in Streaming settings. +Foreground playback cancels in-flight probes; pending probes and explicit +refreshes wait for idle. ## Quality policy @@ -189,6 +193,16 @@ Preserve an explicitly selected edition rather than silently substituting one. `Resolved.source` can supply fresh selected-edition bitrate and pixel dimensions from playback negotiation. Quality menus use this original analysis rather than a stale catalogue summary, a measured automatic limit, or transcoded output. +It may also carry the selected edition's `sizeBytes` and `runtimeTicks` (100 ns +units). `Resolved.delivery` describes the representation actually returned: +`bitrate` (bits/s, 0 unknown), `sizeBytes` and `runtimeTicks`. Direct play may +repeat the source values; remux and transcode must not assume the original +file's size, and a multipart item reports the resolved part, never one part's +bytes over the whole film's duration. Sizes and durations are positive integers +or unsigned decimal strings (for values beyond 2^53); omit what is unknown. +Spool rejects the resolve result if any of these is a boolean, fraction, +negative, null or malformed; a `pick` answer is checked on its follow-up resolve. +The player uses these facts as streaming demand priors only. `Resolved.timelineOriginTicks` identifies the source position represented by diff --git a/sdk/provider.d.ts b/sdk/provider.d.ts index 50fa886b..827d12a9 100644 --- a/sdk/provider.d.ts +++ b/sdk/provider.d.ts @@ -133,8 +133,8 @@ export interface OperationHost extends ProviderHost { * Same origin/TLS policy as http; no redirects or cookies. Cancelled with * this operation. Generated endpoints return exactly the requested bytes; * range endpoints must honor the native Range header and Content-Range. - * Warms 512 KiB, then compares 4 MiB totals over one, two and optionally - * four connections. Result reserves 25% headroom and is bounded to 1–1000 Mbps. + * Warms 512 KiB, then measures one, two and four connections with bounded + * repeated batches. Result reserves 25% headroom from peak capacity. */ speedTest(endpoint: SpeedTestEndpoint): Promise; } @@ -225,8 +225,8 @@ export interface PlaybackContext { videoCodecs: string[]; restrictVideoCodecs: boolean; /** This account's measured conservative ceiling; zero until a successful idle probe. */ measuredBitrate: number; - /** Native playback range-request budget selected by the probe; two before measurement. */ - parallelRequests: 1 | 2 | 4; + /** Learned starting range-request count, integer 1–16; one before measurement. The native player applies its own cap. */ + parallelRequests: number; /** Global seek-preview preference, default true. When false, omit preview descriptors and skip preview-only metadata requests/prefetch. */ videoPreviews: boolean; } @@ -239,7 +239,14 @@ export interface Resolved { */ timelineOriginTicks?: string; /** Fresh original-edition analysis, never the negotiated output or an automatic ceiling. */ - source?: { bitrate: number; width: number; height: number }; + source?: { bitrate: number; width: number; height: number; + /** Selected edition's file size, when known; positive integer or unsigned decimal string. */ + sizeBytes?: number | string; + /** Selected edition's duration in 100 ns ticks, when known. */ + runtimeTicks?: number | string }; + /** The representation actually resolved (not a quality ceiling). DirectPlay may repeat source; + * remux/transcode must not assume the original's size. Omit what is unknown; bitrate 0 is unknown. */ + delivery?: { bitrate?: number; sizeBytes?: number | string; runtimeTicks?: number | string }; streams?: Stream[]; segments?: Segment[]; /** Native preview loader fetches/caches sheets or one BIF sequence using this account's headers. */ trickplay?: { width: number; height: number; columns: number; rows: number; count: number; intervalMs: number; diff --git a/src/app/ArtworkService.cpp b/src/app/ArtworkService.cpp index 415d2f5f..ee88f865 100644 --- a/src/app/ArtworkService.cpp +++ b/src/app/ArtworkService.cpp @@ -345,6 +345,31 @@ class ArtworkFetchWorker final : public QObject { return request; } + void trackNetworkReply(QNetworkReply *reply) + { + const QString scheme = reply->url().scheme(); + if (scheme != QLatin1String("http") && scheme != QLatin1String("https")) + return; + if (++m_networkReplies == 1) + publishFetching(true); + connect(reply, &QNetworkReply::finished, this, [this] { + if (--m_networkReplies == 0) + publishFetching(false); + }); + } + + void publishFetching(bool active) + { + const QPointer service = m_service; + QMetaObject::invokeMethod( + m_service, + [service, active] { + if (service) + service->setFetching(active); + }, + Qt::QueuedConnection); + } + void drainRender() { ensureNetwork(); @@ -366,6 +391,7 @@ class ArtworkFetchWorker final : public QObject { peak = std::max(peak, origin.inFlight); const qint64 fetchStartedNs = monotonicNs(); QNetworkReply *reply = m_network->get(cachedRequest(request.url, request.headers)); + trackNetworkReply(reply); m_renderReplies.insert(request.requestId, reply); const QString key = request.key; auto firstByteNs = std::make_shared(-1); @@ -417,6 +443,7 @@ class ArtworkFetchWorker final : public QObject { const QUrl url = m_prefetchQueue.dequeue(); const QString key = cacheKeyForUrl(url); QNetworkReply *reply = m_network->get(cachedRequest(url)); + trackNetworkReply(reply); m_prefetchReplies.insert(reply); connect(reply, &QNetworkReply::finished, this, [this, reply, key]() { m_prefetchReplies.remove(reply); @@ -486,6 +513,7 @@ class ArtworkFetchWorker final : public QObject { QSet m_prefetchReplies; QHash m_origins; int m_fixedLimit = 0; + int m_networkReplies = 0; }; class ArtworkImageResponse final : public QQuickImageResponse { diff --git a/src/app/ArtworkService.h b/src/app/ArtworkService.h index a82902ae..2c5b0ed7 100644 --- a/src/app/ArtworkService.h +++ b/src/app/ArtworkService.h @@ -83,6 +83,12 @@ class ArtworkService final : public QObject, public ArtworkPrefetcher { // Zero means everything asked for has arrived, which is what "wait until // the pictures are there" means for an automated run. int outstandingRequests() const; + // Conservative: includes an HTTP request until Qt resolves its disk-cache + // status. Memory-cache hits and local-file decoding do not enter this state. + bool fetching() const + { + return m_fetching; + } // Cumulative decode work since the process started: how long decoding has // taken on the pool threads, and how many pixels came out of it. Both are // what a source size actually changes, and unlike wall-clock settle time @@ -101,6 +107,14 @@ class ArtworkService final : public QObject, public ArtworkPrefetcher { void handlePrefetched(QString key, QByteArray bytes); private: + friend class ArtworkFetchWorker; + void setFetching(bool active) + { + if (m_fetching == active) + return; + m_fetching = active; + emit fetchingChanged(active); + } struct Timing { bool memoryCache = false; bool diskCache = false; @@ -157,9 +171,11 @@ class ArtworkService final : public QObject, public ArtworkPrefetcher { int m_deliveredThisTick = 0; int m_nextRequestId = 1; QString m_downloadStatus; + bool m_fetching = false; signals: void downloadStatusChanged(); + void fetchingChanged(bool active); }; } // namespace Spool diff --git a/src/app/SettingsController.cpp b/src/app/SettingsController.cpp index 254ea8fa..2a61e298 100644 --- a/src/app/SettingsController.cpp +++ b/src/app/SettingsController.cpp @@ -833,6 +833,22 @@ void SettingsController::applySchemaValue(const SettingSpec& spec, const QVarian if (apply && m_player) m_player->setForwardCacheSizeMiB(m_forwardCacheSizeMiB); break; + case SettingTarget::ThreadedStreaming: + if (m_player && (apply || !m_localSettingsLoaded)) + m_player->setThreadedStreaming(value.toBool()); + break; + case SettingTarget::MaxStreamingThreads: + if (m_player && (apply || !m_localSettingsLoaded)) + m_player->setMaxStreamingThreads(value.toInt()); + break; + case SettingTarget::ForceStreamingThreads: + if (m_player && (apply || !m_localSettingsLoaded)) + m_player->setForceStreamingThreads(value.toBool()); + break; + case SettingTarget::LogStreamingPerformance: + if (m_player && (apply || !m_localSettingsLoaded)) + m_player->setLogStreamingPerformance(value.toBool()); + break; case SettingTarget::PlayerVolumeSlider: break; case SettingTarget::AudioDelay: diff --git a/src/app/SettingsSchema.cpp b/src/app/SettingsSchema.cpp index deb0eb88..bc3c66c2 100644 --- a/src/app/SettingsSchema.cpp +++ b/src/app/SettingsSchema.cpp @@ -349,8 +349,6 @@ const QVector& settingSpecs() .onDesktop(), sliderSpec("playback/controlFadeDelaySeconds", "Playback", "Hide player controls after", "", "4", 1, 10, 1, "s", SettingTarget::External), - toggleSpec("playback/seekPreviews", "Playback", "Seek previews", - "Thumbnails while seeking. Off hides them and stops downloading them", true, SettingTarget::External), toggleSpec("playback/accurateTrickplay", "Playback", "Accurate seek previews", "Uses a slower, accurate JPEG transform. Off uses the faster transform; both preserve encoded " "resolution", @@ -437,6 +435,30 @@ const QVector& settingSpecs() "Applies the next time something plays", "32", 16, 2048, 1, "MB", SettingTarget::ForwardCacheSize, SettingNormalizer::PowerOfTwoRange) .advanced(), + toggleSpec("playback/seekPreviews", "Streaming", "Seek previews", + "Thumbnails while seeking. Off hides them and stops downloading them", true, SettingTarget::External), + toggleSpec("playback/threadedStreaming", "Streaming", "Optimized streaming", + "Downloads with parallel range requests and adapts to the connection. Off uses standard mpv " + "networking. Applies to the next playback", + true, SettingTarget::ThreadedStreaming) + .advanced(), + sliderSpec("playback/maxStreamingThreads", "Streaming", "Maximum concurrent requests", + "Most network requests in flight at once; not decoding threads or sockets. Adapts up to this " + "limit. Applies to the next playback", + "4", 1, 16, 1, "", SettingTarget::MaxStreamingThreads) + .advanced() + .whenSetTo("playback/threadedStreaming", "true"), + toggleSpec("playback/forceStreamingThreads", "Streaming", "Use fixed request count", + "Always uses the maximum instead of adapting the count. Other safety and optimization still " + "apply. Applies to the next playback", + false, SettingTarget::ForceStreamingThreads) + .advanced() + .whenSetTo("playback/threadedStreaming", "true"), + toggleSpec("playback/logStreamingPerformance", "Streaming", "Log streaming performance", + "Log actual playback download speed, buffering and CPU usage once per second. " + "Off by default; does not log media URLs or credentials", + false, SettingTarget::LogStreamingPerformance) + .advanced(), selectSpec("subtitles/language", "Subtitles", "Preferred language", "Used when subtitles are picked for you", "", nullptr, 0, SettingTarget::SubtitleLanguage), @@ -643,13 +665,14 @@ const QVector& settingSpecs() QStringLiteral("playback/autoAdjustQuality"), QStringLiteral("playback/graphicsApi"), QStringLiteral("playback/hdrOutput"), QStringLiteral("playback/hdrPeakNits"), QStringLiteral("settings/audioOutputMode"), QStringLiteral("playback/forwardCacheSizeMiB"), - QStringLiteral("subtitles/hdrBrightnessPercent"), QStringLiteral("input/redButton"), - QStringLiteral("input/greenButton"), QStringLiteral("input/yellowButton"), - QStringLiteral("input/blueButton"), QStringLiteral("updates/automatic"), - QStringLiteral("providers/updates"), QStringLiteral("shell/diagnostics"), - QStringLiteral("settings/toneMappingVisualization"), QStringLiteral("shell/latencyGuard"), - QStringLiteral("shell/latencyOverlay"), QStringLiteral("theme/antialiasedText"), - QStringLiteral("theme/renderMode") }; + QStringLiteral("playback/threadedStreaming"), QStringLiteral("playback/maxStreamingThreads"), + QStringLiteral("playback/forceStreamingThreads"), QStringLiteral("subtitles/hdrBrightnessPercent"), + QStringLiteral("input/redButton"), QStringLiteral("input/greenButton"), + QStringLiteral("input/yellowButton"), QStringLiteral("input/blueButton"), + QStringLiteral("updates/automatic"), QStringLiteral("providers/updates"), + QStringLiteral("shell/diagnostics"), QStringLiteral("settings/toneMappingVisualization"), + QStringLiteral("shell/latencyGuard"), QStringLiteral("shell/latencyOverlay"), + QStringLiteral("theme/antialiasedText"), QStringLiteral("theme/renderMode") }; for (SettingSpec& spec : rows) { const QString key = QString::fromLatin1(spec.key); const QLatin1String group(spec.group); diff --git a/src/app/SettingsSchema.h b/src/app/SettingsSchema.h index 4714519c..2a69d296 100644 --- a/src/app/SettingsSchema.h +++ b/src/app/SettingsSchema.h @@ -45,6 +45,10 @@ enum class SettingTarget { UnlimitedLocalBitrate, PreferRemux, ForwardCacheSize, + ThreadedStreaming, + MaxStreamingThreads, + ForceStreamingThreads, + LogStreamingPerformance, PlayerVolumeSlider, AudioDelay, AudioOutput, diff --git a/src/app/TrickplayService.cpp b/src/app/TrickplayService.cpp index 60ed3a63..b1d4c8d9 100644 --- a/src/app/TrickplayService.cpp +++ b/src/app/TrickplayService.cpp @@ -376,6 +376,14 @@ void TrickplayService::request(int index, TrickplayImageResponse *response) startDecode(index); } +void TrickplayService::setFetching(bool active) +{ + if (m_fetching != active) { + m_fetching = active; + emit fetchingChanged(active); + } +} + void TrickplayService::abortFetch() { if (m_reply) { @@ -384,6 +392,7 @@ void TrickplayService::abortFetch() m_reply->deleteLater(); } m_reply.clear(); + setFetching(false); m_fetchIndex = -1; m_fetchBytes.clear(); m_fetchUrl.clear(); @@ -424,6 +433,7 @@ void TrickplayService::fetch(int index, bool speculative) m_fetchSpeculative = speculative; QNetworkReply *reply = m_network->get(request); m_reply = reply; + setFetching(true); connect(reply, &QNetworkReply::readyRead, this, [this, reply] { if (reply->bytesAvailable() > MaximumBytes - m_fetchBytes.size()) { reply->abort(); @@ -433,6 +443,7 @@ void TrickplayService::fetch(int index, bool speculative) }); connect(reply, &QNetworkReply::finished, this, [this, reply] { m_reply.clear(); + setFetching(false); const int index = std::exchange(m_fetchIndex, -1); const bool speculative = m_fetchSpeculative; QString error = reply->error() == QNetworkReply::NoError ? QString() : reply->errorString(); diff --git a/src/app/TrickplayService.h b/src/app/TrickplayService.h index 70b9e1ec..3d2a84e9 100644 --- a/src/app/TrickplayService.h +++ b/src/app/TrickplayService.h @@ -46,10 +46,17 @@ class TrickplayService final : public QObject { void setAccurateDecoding(bool accurate); void setEnabled(bool enabled); bool available() const; + bool fetching() const + { + return m_fetching; + } QVariantMap frame(double seconds); QQuickImageResponse *requestImageResponse(const QString& id); signals: void changed(); + // A preview request is (or stops being) on the network; it shares the + // playback origin's link, so the transport must not learn from it. + void fetchingChanged(bool active); private: friend class TrickplayImageResponse; @@ -69,6 +76,8 @@ class TrickplayService final : public QObject { const ArtworkSource *m_source; QNetworkAccessManager *m_network; QPointer m_reply; + bool m_fetching = false; + void setFetching(bool active); QThreadPool m_pool; TrickplayInfo m_info; BifSequence m_bif; diff --git a/src/automation/LocalCommandServer.cpp b/src/automation/LocalCommandServer.cpp index 49a6960e..43742940 100644 --- a/src/automation/LocalCommandServer.cpp +++ b/src/automation/LocalCommandServer.cpp @@ -40,7 +40,9 @@ namespace Spool { namespace { const QStringList SettingKeys { QStringLiteral("playback/seekPreviews"), QStringLiteral("playback/accurateTrickplay"), QStringLiteral("playback/trickplayPreviewScalePercent"), - QStringLiteral("appearance/uiScalePercent"), QStringLiteral("playback/renderQuality") }; + QStringLiteral("appearance/uiScalePercent"), QStringLiteral("playback/renderQuality"), + QStringLiteral("playback/threadedStreaming"), QStringLiteral("playback/maxStreamingThreads"), + QStringLiteral("playback/forceStreamingThreads"), QStringLiteral("playback/logStreamingPerformance") }; QCoro::Task itemStateTask(SourceHub *sources, QString itemId, QString field, QJsonValue value) { if (field == QStringLiteral("played")) @@ -557,6 +559,14 @@ void LocalCommandServer::dispatch(QIODevice *socket, const QJsonObject& request) return; } done(items(args)); + } else if (command == QStringLiteral("speed-test")) { + if (args.contains(QStringLiteral("refresh")) && !args.value(QStringLiteral("refresh")).isBool()) { + invalid(QStringLiteral("refresh must be a boolean")); + return; + } + if (args.value(QStringLiteral("refresh")).toBool()) + m_app->refreshConnectionSpeed(); + done(QJsonObject::fromVariantMap(m_sources->speedTestStatus())); } else if (command == QStringLiteral("downloads")) { const QString action = args.value(QStringLiteral("action")).toString(QStringLiteral("list")); if ((action == QStringLiteral("start") || action == QStringLiteral("retry")) && !m_downloads->enabled()) { @@ -751,8 +761,7 @@ void LocalCommandServer::dispatch(QIODevice *socket, const QJsonObject& request) } else if (command == QStringLiteral("settings-get") || command == QStringLiteral("settings-set")) { const QString key = args.value(QStringLiteral("key")).toString(); if (!key.isEmpty() && !SettingKeys.contains(key)) { - invalid(QStringLiteral( - "Only seek preview enable/quality/scale, UI scale and render quality settings are exposed")); + invalid(QStringLiteral("Only allowlisted playback and appearance settings are exposed")); return; } if (command == QStringLiteral("settings-get")) { diff --git a/src/automation/LocalControlProtocol.cpp b/src/automation/LocalControlProtocol.cpp index 36ff3160..706a7213 100644 --- a/src/automation/LocalControlProtocol.cpp +++ b/src/automation/LocalControlProtocol.cpp @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include @@ -64,12 +65,21 @@ QString directory(QString *error) return {}; } } else { +#ifdef SPOOL_WEBOS + base = QDir(QStandardPaths::writableLocation(QStandardPaths::AppDataLocation)) + .filePath(QStringLiteral("runtime")); + if (!QDir().mkpath(base)) { + *error = QStringLiteral("Cannot create the app runtime directory"); + return {}; + } +#else #if defined(SPOOL_ANDROID) || defined(SPOOL_APPLE_MOBILE) base = QStandardPaths::writableLocation(QStandardPaths::GenericCacheLocation); #elif defined(Q_OS_UNIX) base = QStandardPaths::writableLocation(QStandardPaths::RuntimeLocation); #else base = QStandardPaths::writableLocation(QStandardPaths::GenericDataLocation); +#endif #endif } return privateDirectory(base, error); @@ -169,6 +179,111 @@ QJsonObject readDescriptor(const QString& path) return result; } +bool validSshHost(const QString& host) +{ + static const QRegularExpression expression( + QStringLiteral("^(?:[A-Za-z0-9_][A-Za-z0-9_.-]*@)?[A-Za-z0-9][A-Za-z0-9_.-]{0,252}$")); + return expression.match(host).hasMatch(); +} + +QByteArray sshExchange(const QString& host, const QString& command, const QByteArray& input, int timeoutMs, + qsizetype maxBytes, QString *error, int forwardPort) +{ + if (!validSshHost(host)) { + *error = QStringLiteral("Invalid SSH host; use [USER@]HOST without options or shell syntax"); + return {}; + } + QElapsedTimer clock; + clock.start(); + const auto remaining = [&] { return qMax(0, timeoutMs - int(clock.elapsed())); }; + QProcess process; + process.setStandardErrorFile(QProcess::nullDevice()); + QStringList arguments { QStringLiteral("-F"), QStringLiteral("/dev/null"), QStringLiteral("-T"), + QStringLiteral("-o"), QStringLiteral("BatchMode=yes"), QStringLiteral("-o"), + QStringLiteral("StrictHostKeyChecking=yes"), QStringLiteral("-o"), QStringLiteral("ConnectTimeout=10"), + QStringLiteral("-o"), QStringLiteral("ConnectionAttempts=1"), QStringLiteral("-o"), + QStringLiteral("ServerAliveInterval=5"), QStringLiteral("-o"), QStringLiteral("ServerAliveCountMax=1"), + QStringLiteral("-o"), QStringLiteral("ClearAllForwardings=yes"), QStringLiteral("-o"), + QStringLiteral("ControlMaster=no"), QStringLiteral("-o"), QStringLiteral("ControlPath=none") }; + if (forwardPort > 0) + arguments << QStringLiteral("-W") << QStringLiteral("127.0.0.1:%1").arg(forwardPort); + arguments.append(host); + if (!command.isEmpty()) + arguments.append(command); + process.start(QStringLiteral("ssh"), arguments); + if (!process.waitForStarted(remaining())) { + *error = QStringLiteral("Cannot start SSH"); + } else if (process.write(input) != input.size()) { + *error = QStringLiteral("Cannot send SSH input"); + } else { + // Script execution needs EOF to finish reading the script. Forwarded + // requests must not half-close TCP while an async operation is pending. + bool inputClosed = forwardPort <= 0; + if (inputClosed) + process.closeWriteChannel(); + QByteArray output; + while (true) { + output += process.readAllStandardOutput(); + if (output.size() > maxBytes) { + *error = QStringLiteral("SSH response exceeds the size limit"); + break; + } + if (!inputClosed && output.contains('\n')) { + process.closeWriteChannel(); + inputClosed = true; + } + if (process.state() == QProcess::NotRunning) { + if (process.exitStatus() == QProcess::NormalExit && process.exitCode() == 0) + return output; + *error = QStringLiteral( + "SSH failed; check trusted host key, noninteractive authentication and forwarding"); + break; + } + if (remaining() <= 0) { + *error = QStringLiteral("SSH command timed out"); + break; + } + process.waitForReadyRead(remaining()); + } + } + if (process.state() != QProcess::NotRunning) { + process.kill(); + process.waitForFinished(1000); + } + return {}; +} + +QJsonObject requestSsh(const QString& host, const QJsonObject& descriptor, const QString& command, + const QJsonObject& arguments, int timeoutMs) +{ + const QString id = QUuid::createUuid().toString(QUuid::WithoutBraces); + const int port = descriptor.value(QStringLiteral("port")).toInt(); + if (descriptor.value(QStringLiteral("transport")).toString() != QStringLiteral("tcp") + || descriptor.value(QStringLiteral("endpoint")).toString() != QStringLiteral("127.0.0.1") || port < 1 + || port > 65535 || descriptor.value(QStringLiteral("token")).toString().size() != 64) + return failure( + id, QStringLiteral("invalid_descriptor"), QStringLiteral("Remote control requires loopback TCP")); + const QByteArray bytes + = QJsonDocument(QJsonObject { { QStringLiteral("id"), id }, { QStringLiteral("command"), command }, + { QStringLiteral("args"), arguments }, + { QStringLiteral("token"), descriptor.value(QStringLiteral("token")) } }) + .toJson(QJsonDocument::Compact) + + '\n'; + if (bytes.size() > MaxRequestBytes) + return failure(id, QStringLiteral("request_too_large"), QStringLiteral("Request exceeds 64 KiB")); + QString error; + const QByteArray reply = sshExchange(host, {}, bytes, timeoutMs, MaxResponseBytes, &error, port); + if (!error.isEmpty()) + return failure(id, QStringLiteral("ssh_failed"), error); + QJsonParseError parseError; + const QJsonObject result = QJsonDocument::fromJson(reply.trimmed(), &parseError).object(); + if (parseError.error != QJsonParseError::NoError || result.value(QStringLiteral("id")).toString() != id + || !result.value(QStringLiteral("ok")).isBool()) + return failure( + id, QStringLiteral("invalid_response"), QStringLiteral("Invalid response or mismatched request ID")); + return result; +} + QJsonObject failure(const QString& id, const QString& code, const QString& message) { return { { QStringLiteral("id"), id }, { QStringLiteral("ok"), false }, diff --git a/src/automation/LocalControlProtocol.h b/src/automation/LocalControlProtocol.h index 554c3714..c392245f 100644 --- a/src/automation/LocalControlProtocol.h +++ b/src/automation/LocalControlProtocol.h @@ -1,5 +1,6 @@ #pragma once +#include #include #include @@ -14,6 +15,12 @@ QString localEndpoint(const QString& registryDirectory, const QString& instance, bool validInstance(const QString& instance); bool privateFile(const QString& path); QJsonObject readDescriptor(const QString& path); +// SSH transports the capability over stdin only; no remote spoolet is required. +bool validSshHost(const QString& host); +QByteArray sshExchange(const QString& host, const QString& command, const QByteArray& input, int timeoutMs, + qsizetype maxBytes, QString *error, int forwardPort = 0); +QJsonObject requestSsh(const QString& host, const QJsonObject& descriptor, const QString& command, + const QJsonObject& arguments, int timeoutMs = RequestTimeoutMs); QJsonObject request(const QJsonObject& descriptor, const QString& command, const QJsonObject& arguments, int timeoutMs = RequestTimeoutMs); QJsonObject failure(const QString& id, const QString& code, const QString& message); diff --git a/src/automation/RemoteDiscovery.sh b/src/automation/RemoteDiscovery.sh new file mode 100755 index 00000000..1c2b18e8 --- /dev/null +++ b/src/automation/RemoteDiscovery.sh @@ -0,0 +1,105 @@ +#!/bin/sh +# Executed through SSH stdin; never print environment, paths, logs or credentials. +set -eu +mode=${1:-descriptors} +instance=${2:-} +explicit=${3:-} +app_id="${4:-com.sachk.spool}" +uid=$(id -u) +# Root may inspect the app sandbox's capability without changing its ownership. +# Discovery binds ownership to the matching process; explicit root selection +# accepts one private directory/file owner, never mismatched owners. +expected_owner=$uid +[ "$uid" != 0 ] || expected_owner='' +descriptor_owner='' +private_file() { + [ -f "$1" ] && [ ! -L "$1" ] || return 1 + info=$(stat -c '%u %a %s' "$1" 2>/dev/null) || return 1 + set -- $info + [ "$1" = "$descriptor_owner" ] && [ "$2" = 600 ] && [ "$3" -le 4096 ] +} +private_directory() { + [ -d "$1" ] && [ ! -L "$1" ] || return 1 + info=$(stat -c '%u %a' "$1" 2>/dev/null) || return 1 + set -- $info + [ "$2" = 700 ] || return 1 + [ -z "$expected_owner" ] || [ "$1" = "$expected_owner" ] || return 1 + descriptor_owner=$1 +} +emit_descriptor() { + private_directory "${1%/*}" && private_file "$1" || return 0 + cat "$1" + printf '\n' +} +if [ "$mode" = descriptors ] && [ -n "$explicit" ]; then + case "$explicit" in /*) emit_descriptor "$explicit" ;; *) exit 2 ;; esac + exit +fi +seen='' +first_pid='' +for process in /proc/[0-9]*; do + executable=$(readlink "$process/exe" 2>/dev/null) || continue + case "$executable" in + */usr/palm/applications/"$app_id"/bin/spool | */usr/palm/applications/"$app_id"/bin/spool.real) ;; + *) continue ;; + esac + [ -r "$process/environ" ] || continue + process_owner=$(stat -c %u "$process" 2>/dev/null) || continue + [ "$uid" = 0 ] || [ "$process_owner" = "$uid" ] || continue + expected_owner=$process_owner + [ -n "$first_pid" ] || first_pid=${process##*/} + value() { + tr '\000' '\n' < "$process/environ" | awk -v key="$1" 'index($0,key "=")==1 {print substr($0,length(key)+2); exit}' + } + home=$(value HOME) + data=$(value XDG_DATA_HOME) + [ -n "$data" ] || data="$home/.local/share" + case "$data" in /*) ;; *) continue ;; esac + root="$data/spool/Spool" + if [ "$mode" = diagnostics ]; then + diagnostics=$(value SPOOL_DIAGNOSTICS_DIR) + [ -n "$diagnostics" ] || diagnostics="$root/diagnostics" + case "$diagnostics" in /*) ;; *) continue ;; esac + metadata="$diagnostics/current-instance.json" + if [ -f "$metadata" ] && [ ! -L "$metadata" ]; then + size=$(stat -c %s "$metadata" 2>/dev/null) || continue + [ "$size" -le 65536 ] || continue + cat "$metadata" + exit + fi + elif [ "$mode" = descriptors ]; then + selected=$(value SPOOL_DATA_HOME) + if [ -n "$selected" ]; then + registry="$selected/runtime/spool-control" + else + registry="$root/runtime/spool-control" + fi + case "$registry" in /*) ;; *) continue ;; esac + case " +$seen +" in *" +$registry +"*) continue ;; esac + seen="$seen +$registry" + if [ -n "$instance" ]; then + emit_descriptor "$registry/$instance.json" + else + count=0 + for descriptor in "$registry"/*.json; do + count=$((count + 1)) + [ "$count" -le 64 ] || exit 3 + emit_descriptor "$descriptor" + done + fi + else + exit 2 + fi +done +if [ "$mode" = diagnostics ]; then + if [ -n "$first_pid" ]; then + printf '{"pid":%s,"running":true,"metadataAvailable":false}\n' "$first_pid" + else + printf '{"running":false,"metadataAvailable":false}\n' + fi +fi diff --git a/src/automation/SpooletMain.cpp b/src/automation/SpooletMain.cpp index 5bdf32b1..ac96f7bd 100644 --- a/src/automation/SpooletMain.cpp +++ b/src/automation/SpooletMain.cpp @@ -2,6 +2,7 @@ #include #include +#include #include #include #include @@ -25,9 +26,9 @@ QJsonObject help() { return { { QStringLiteral("ok"), true }, { QStringLiteral("result"), - QJsonObject { - { QStringLiteral("usage"), - QStringLiteral("spoolet [--instance ID | --descriptor FILE] [--timeout MS] COMMAND [ARGS]") }, + QJsonObject { { QStringLiteral("usage"), + QStringLiteral("spoolet [--host USER@HOST] [--instance ID | --descriptor FILE] " + "[--timeout MS] COMMAND [ARGS]") }, { QStringLiteral("commands"), QJsonArray { QStringLiteral("help | instances | status | state"), QStringLiteral( @@ -43,6 +44,7 @@ QJsonObject help() QStringLiteral( "downloads list | options ITEM_ID | start ITEM_ID INDEX | cancel|retry|remove|play JOB_ID"), QStringLiteral("settings get [KEY] | settings set KEY JSON_VALUE"), + QStringLiteral("speed-test [status] (start measurement, or read numeric progress and results)"), QStringLiteral("open browse|resume|next-up|context|similar INDEX (select like a person would)"), QStringLiteral("item-state QUALIFIED_ID [played|favorite true|false | position SECONDS] " "(writes through the provider, then reads the item back from the server)"), @@ -53,7 +55,11 @@ QJsonObject help() "All stdout is JSON. Commands are bounded and never prompt. When multiple instances run, " "--instance is required. Playback/navigation acceptance is not a promise that provider I/O has " "completed: poll status. Screenshot waits for a new Qt frame, then atomically writes PNG; " - "separate native video planes are reported as excluded.") } } } }; + "separate native video planes are reported as excluded. --host uses noninteractive SSH " + "with an already trusted host key and forwards stdin to remote IPv4 loopback; no TV CLI " + "or LAN listener is needed. With --host, --descriptor is an absolute REMOTE private " + "descriptor path; otherwise it is local. --instance selects a discovered instance on " + "the selected host. Tokens are never printed.") } } } }; } } @@ -64,22 +70,27 @@ int main(int argc, char **argv) QStringList arguments = app.arguments().mid(1); QString instance; QString descriptorPath; + QString host; int timeout = Spool::LocalControl::RequestTimeoutMs; while (!arguments.isEmpty() && arguments.first().startsWith(QStringLiteral("--"))) { const QString option = arguments.takeFirst(); if (option == QStringLiteral("--help")) return print(help()); if ((option != QStringLiteral("--instance") && option != QStringLiteral("--timeout") - && option != QStringLiteral("--descriptor")) + && option != QStringLiteral("--descriptor") && option != QStringLiteral("--host")) || arguments.isEmpty()) - return error(QStringLiteral("Expected --instance ID, --descriptor FILE or --timeout MS; see help")); + return error(QStringLiteral("Expected --host, --instance, --descriptor or --timeout; see help")); const QString value = arguments.takeFirst(); if (option == QStringLiteral("--instance")) { if (!Spool::LocalControl::validInstance(value)) return error(QStringLiteral("Invalid instance identifier")); instance = value; } else if (option == QStringLiteral("--descriptor")) { - descriptorPath = QFileInfo(value).absoluteFilePath(); + descriptorPath = value; + } else if (option == QStringLiteral("--host")) { + if (!Spool::LocalControl::validSshHost(value)) + return error(QStringLiteral("Invalid SSH host; use [USER@]HOST")); + host = value; } else { bool valid = false; timeout = value.toInt(&valid); @@ -89,12 +100,22 @@ int main(int argc, char **argv) } if (!instance.isEmpty() && !descriptorPath.isEmpty()) return error(QStringLiteral("--instance and --descriptor are mutually exclusive")); + if (!descriptorPath.isEmpty()) { + if (!host.isEmpty() && !QDir::isAbsolutePath(descriptorPath)) + return error(QStringLiteral("Remote descriptor path must be absolute")); + if (host.isEmpty()) + descriptorPath = QFileInfo(descriptorPath).absoluteFilePath(); + } if (arguments.isEmpty() || arguments == QStringList { QStringLiteral("help") }) return print(help()); QString command = arguments.takeFirst(); QJsonObject args; const auto count = [&](int low, int high) { return arguments.size() >= low && arguments.size() <= high; }; - if (command == QStringLiteral("navigate")) { + if (command == QStringLiteral("speed-test")) { + if (!arguments.isEmpty() && arguments != QStringList { QStringLiteral("status") }) + return error(QStringLiteral("Usage: speed-test [status]")); + args.insert(QStringLiteral("refresh"), arguments.isEmpty()); + } else if (command == QStringLiteral("navigate")) { if (!count(1, 2)) return error(QStringLiteral("Usage: navigate ROUTE [MODULE_ID|SETTING_KEY]")); const QString route = arguments.first(); @@ -117,9 +138,8 @@ int main(int argc, char **argv) : command == QStringLiteral("library") ? QStringLiteral("id") : QStringLiteral("path"); args.insert(key, - command == QStringLiteral("screenshot") && descriptorPath.isEmpty() - ? QFileInfo(arguments.first()).absoluteFilePath() - : arguments.first()); + command == QStringLiteral("screenshot") && host.isEmpty() ? QFileInfo(arguments.first()).absoluteFilePath() + : arguments.first()); } else if (command == QStringLiteral("text")) { if (!count(1, 1)) return error(QStringLiteral("Usage: text TEXT | text --stdin")); @@ -274,6 +294,67 @@ int main(int argc, char **argv) || !arguments.isEmpty()) { return error(QStringLiteral("Unknown command or extra arguments; see spoolet help")); } + if (!host.isEmpty()) { + if (command == QStringLiteral("instances") && !descriptorPath.isEmpty()) + return error(QStringLiteral("instances does not accept an explicit descriptor")); + QFile script(QStringLiteral(":/automation/RemoteDiscovery.sh")); + if (!script.open(QIODevice::ReadOnly)) + return error(QStringLiteral("Remote discovery script is unavailable")); + const auto quote = [](QString value) { + value.replace(QLatin1Char('\''), QStringLiteral("'\\''")); + return QLatin1Char('\'') + value + QLatin1Char('\''); + }; + QElapsedTimer clock; + clock.start(); + const auto remaining = [&] { return qMax(0, timeout - int(clock.elapsed())); }; + QString discoveryError; + const QByteArray output = Spool::LocalControl::sshExchange(host, + QStringLiteral("sh -s -- descriptors %1 %2").arg(quote(instance), quote(descriptorPath)), script.readAll(), + remaining(), 64 * 4097, &discoveryError); + if (!discoveryError.isEmpty()) + return error(discoveryError); + QList descriptors; + for (const QByteArray& line : output.split('\n')) { + if (line.trimmed().isEmpty()) + continue; + const QJsonObject row = QJsonDocument::fromJson(line).object(); + const int port = row.value(QStringLiteral("port")).toInt(); + const QString id = row.value(QStringLiteral("instance")).toString(); + if (line.size() > 4096 || !Spool::LocalControl::validInstance(id) || (!instance.isEmpty() && id != instance) + || row.value(QStringLiteral("transport")).toString() != QStringLiteral("tcp") + || row.value(QStringLiteral("endpoint")).toString() != QStringLiteral("127.0.0.1") || port < 1 + || port > 65535 || row.value(QStringLiteral("token")).toString().size() != 64) + return error(QStringLiteral("Remote discovery contains an invalid loopback descriptor")); + descriptors.append(row); + if (descriptors.size() > 64) + return error(QStringLiteral("Too many remote instances; use --instance")); + } + if (descriptors.isEmpty()) + return error(QStringLiteral("No private remote descriptors found; launch with SPOOL_AUTOMATION_PORT")); + QList live; + QJsonArray instances; + for (const QJsonObject& row : descriptors) { + if (remaining() <= 0) + return error(QStringLiteral("Remote discovery timed out")); + const QJsonObject reply + = Spool::LocalControl::requestSsh(host, row, QStringLiteral("status"), {}, remaining()); + if (reply.value(QStringLiteral("ok")).toBool()) { + live.append(row); + instances.append(reply.value(QStringLiteral("result"))); + } else if (!instance.isEmpty() || !descriptorPath.isEmpty()) { + return print(reply); + } + } + if (command == QStringLiteral("instances")) + return print({ { QStringLiteral("ok"), true }, + { QStringLiteral("result"), QJsonObject { { QStringLiteral("instances"), instances } } } }); + if (live.size() != 1) + return error(live.isEmpty() ? QStringLiteral("No reachable remote instances found") + : QStringLiteral("Multiple remote instances; use --instance ID")); + if (remaining() <= 0) + return error(QStringLiteral("Remote command timed out")); + return print(Spool::LocalControl::requestSsh(host, live.first(), command, args, remaining())); + } if (!descriptorPath.isEmpty()) { const QJsonObject descriptor = Spool::LocalControl::readDescriptor(descriptorPath); if (descriptor.isEmpty()) diff --git a/src/main.cpp b/src/main.cpp index f6de6997..ff230b36 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -3,6 +3,7 @@ #include "app/ArtworkService.h" #include "app/CollectionEditingController.h" #include "app/CpuTopology.h" +#include "app/DownloadManager.h" #include "app/GraphicsStartup.h" #include "app/GroupPlaybackController.h" #include "app/LocalizationManager.h" @@ -13,14 +14,11 @@ #include "app/TrickplayPreviewItem.h" #include "app/TrickplayService.h" #include "app/UserItemStateController.h" +#include "automation/LocalCommandServer.h" #include "cache/DatabaseManager.h" #include "common/AsyncTask.h" #include "common/LogRotation.h" #include "common/TlsTrust.h" -#if !defined(SPOOL_WEBOS) -#include "automation/LocalCommandServer.h" -#endif -#include "app/DownloadManager.h" #include "diagnostics/Diagnostics.h" #include "diagnostics/InputLatencyMonitor.h" #include "diagnostics/RenderBenchmark.h" @@ -492,9 +490,7 @@ int main(int argc, char **argv) g_startupTimer.start(); QElapsedTimer& startupTimer = g_startupTimer; bool launchTest = false; -#ifndef SPOOL_WEBOS int automationPort = -1; -#endif QString dataDirectory; for (int i = 1; i < argc; ++i) { if (strcmp(argv[i], "--version") == 0 || strcmp(argv[i], "-v") == 0) { @@ -507,10 +503,6 @@ int main(int argc, char **argv) Spool::setDiagnosticUrlsUnredacted(true); const QByteArray argument(argv[i]); if (argument == "--automation-port" || argument.startsWith("--automation-port=")) { -#ifdef SPOOL_WEBOS - std::fprintf(stderr, "Loopback automation is not supported on webOS\n"); - return 1; -#else QByteArray value; if (argument == "--automation-port") { if (++i >= argc) { @@ -528,7 +520,6 @@ int main(int argc, char **argv) return 1; } automationPort = int(port); -#endif } if (strcmp(argv[i], "--data-dir") == 0) { #if defined(SPOOL_WEBOS) || defined(SPOOL_ANDROID) || defined(SPOOL_APPLE_MOBILE) @@ -726,6 +717,17 @@ int main(int argc, char **argv) } } } + // Luna JSON launch parameters are applied above, after the early argv pass. + // Parse the opt-in here as well so a normal packaged webOS launch can use it. + if (automationPort < 0 && qEnvironmentVariableIsSet("SPOOL_AUTOMATION_PORT")) { + bool valid = false; + const uint port = qEnvironmentVariable("SPOOL_AUTOMATION_PORT").toUInt(&valid); + if (!valid || port > 65535) { + std::fprintf(stderr, "SPOOL_AUTOMATION_PORT requires a port in 0..65535\n"); + return 1; + } + automationPort = int(port); + } if (arguments.contains(QStringLiteral("--diagnose-and-exit")) || arguments.contains(QStringLiteral("--dump-diagnostics"))) { Spool::Diagnostics::dumpDiagnostics(QStringLiteral("command-line")); @@ -855,6 +857,9 @@ int main(int argc, char **argv) auto player = std::make_unique( &window, hub.playback(), &tlsTrust, Spool::bundledFontsPath(appRootPath)); player->setTrickplayService(&trickplay); + QObject::connect(artworkService.get(), &Spool::ArtworkService::fetchingChanged, player.get(), + &Spool::PlayerController::setBackgroundNetwork); + player->setBackgroundNetwork(artworkService->fetching()); player->setDemuxerBudget(memoryBudget.mpvDemuxerMaxBytes, memoryBudget.mpvDemuxerMaxBackBytes); Spool::ScreenSaverInhibitor screenSaverInhibitor; const auto updateScreenSaver = [&screenSaverInhibitor, player = player.get()] { @@ -1324,21 +1329,21 @@ int main(int argc, char **argv) QTimer::singleShot(1000, router.get(), [router = router.get()] { router->beginSession(false); }); QTimer::singleShot(15'000, &app, [cachePath] { QThreadPool::globalInstance()->start([cachePath] { pruneStaleQmlCaches(cachePath); }); }); -#if !defined(SPOOL_WEBOS) Spool::LocalCommandServer localCommands(controller.get(), router.get(), &window, &downloads, &hub); const bool controlDisabled = app.arguments().contains(QStringLiteral("--no-local-control")); if (automationPort >= 0 && controlDisabled) { std::fprintf(stderr, "--automation-port conflicts with --no-local-control\n"); return 1; } -#if defined(SPOOL_ANDROID) || defined(SPOOL_APPLE_MOBILE) +#if defined(SPOOL_WEBOS) || defined(SPOOL_ANDROID) || defined(SPOOL_APPLE_MOBILE) const bool startLocalControl = automationPort >= 0; #else const bool startLocalControl = !controlDisabled; #endif if (startLocalControl) { QString error; - const QString instance = optionValue(app.arguments(), QStringLiteral("--instance"), "SPOOL_INSTANCE"); + const QString instance = optionValue(app.arguments(), QStringLiteral("--instance"), "SPOOL_AUTOMATION_INSTANCE", + qEnvironmentVariable("SPOOL_INSTANCE")); const bool started = automationPort >= 0 ? localCommands.startTcp(instance, quint16(automationPort), &error) : localCommands.start(instance, &error); if (!started) { @@ -1351,7 +1356,6 @@ int main(int argc, char **argv) QObject::connect(&app, &QCoreApplication::aboutToQuit, &localCommands, &Spool::LocalCommandServer::stop); QObject::connect( &window, &Spool::NativeAppWindow::closeRequested, &localCommands, &Spool::LocalCommandServer::stop); -#endif QTimer::singleShot(0, &window, [&startupTimer]() { logLine("startup: first event-loop turn at %lld ms", static_cast(startupTimer.elapsed())); diff --git a/src/media/MediaTypes.h b/src/media/MediaTypes.h index 8c6d5036..1f23b435 100644 --- a/src/media/MediaTypes.h +++ b/src/media/MediaTypes.h @@ -425,6 +425,13 @@ struct PlaybackSession { qint64 sourceBitrate = 0; int sourceWidth = 0; int sourceHeight = 0; + // Selected original edition and the representation actually delivered; + // 0 is unknown. Delivered size/duration may differ under remux/transcode. + qint64 sourceSizeBytes = 0; + qint64 sourceRuntimeTicks = 0; + qint64 deliveryBitrate = 0; + qint64 deliverySizeBytes = 0; + qint64 deliveryRuntimeTicks = 0; qint64 runtimeTicks = 0; QList mediaStreams; std::vector segments; diff --git a/src/player/MpvOptionProfile.cpp b/src/player/MpvOptionProfile.cpp index ddd1a7f4..97dcc0c8 100644 --- a/src/player/MpvOptionProfile.cpp +++ b/src/player/MpvOptionProfile.cpp @@ -382,9 +382,9 @@ QByteArray MpvOptionProfile::preloadedSubtitleStreams(const PlaybackSession& ses MpvOptionProfile::NetworkProfile MpvOptionProfile::networkProfile(Platform platform, int parallelRequests) { - const int requests = std::clamp(parallelRequests, 1, 4); - return platform == Platform::WebOS ? NetworkProfile { 2 * 1024 * 1024, 512 * 1024, requests } - : NetworkProfile { 4 * 1024 * 1024, 1024 * 1024, requests }; + const int requests = std::clamp(parallelRequests, 1, 16); + return platform == Platform::WebOS ? NetworkProfile { 2 * 1024 * 1024, 512 * 1024, requests, 128 * 1024 } + : NetworkProfile { 4 * 1024 * 1024, 1024 * 1024, requests, 256 * 1024 }; } QByteArray MpvOptionProfile::loadFileOptions(const PlaybackSession& session) @@ -482,7 +482,7 @@ QByteArray MpvOptionProfile::systemCertificateBundle() std::vector MpvOptionProfile::applicationOptions(Platform platform, bool needsVideoSurface, const QString& audioOutputMode, const QByteArray& logPath, const QByteArray& demuxerMaxBytes, const QByteArray& demuxerMaxBackBytes, int parallelRequests, bool embeddedVideo, const QByteArray& shaderCachePath, - const QByteArray& certificateBundlePath, RenderQuality quality) + const QByteArray& certificateBundlePath, RenderQuality quality, bool threadedStreaming, bool forceStreamingThreads) { const bool webOS = platform == Platform::WebOS; const bool android = platform == Platform::Android; @@ -505,10 +505,13 @@ std::vector MpvOptionProfile::applicationOptions(Platform platform, b { "cache-pause", "no" }, { "demuxer-max-bytes", demuxerMaxBytes }, { "demuxer-max-back-bytes", demuxerMaxBackBytes }, - { "curl-enabled", "yes" }, + { "curl-enabled", threadedStreaming ? "yes" : "no" }, { "curl-buffer-size", QByteArray::number(network.ringBytes) }, { "curl-max-request-size", QByteArray::number(network.rangeBytes) }, + { "curl-read-size", QByteArray::number(network.readBytes) }, { "curl-parallel-requests", QByteArray::number(network.parallelRequests) }, + { "curl-adaptive", forceStreamingThreads ? "no" : "yes" }, + { "curl-initial-requests", forceStreamingThreads ? QByteArray::number(network.parallelRequests) : "1" }, // A connection that goes quiet without closing is retried after this // long rather than mpv's 60 s, which outlasts any demuxer cache. { "network-timeout", "15" }, diff --git a/src/player/MpvOptionProfile.h b/src/player/MpvOptionProfile.h index 23c527f1..d8709321 100644 --- a/src/player/MpvOptionProfile.h +++ b/src/player/MpvOptionProfile.h @@ -40,6 +40,8 @@ class MpvOptionProfile final { int ringBytes; int rangeBytes; int parallelRequests; + // libcurl receive buffer per transfer; each active request holds one. + int readBytes; }; static NetworkProfile networkProfile(Platform platform, int parallelRequests = 1); @@ -65,7 +67,8 @@ class MpvOptionProfile final { const QByteArray& demuxerMaxBytes = QByteArrayLiteral("64M"), const QByteArray& demuxerMaxBackBytes = QByteArrayLiteral("32M"), int parallelRequests = 1, bool embeddedVideo = false, const QByteArray& shaderCachePath = {}, - const QByteArray& certificateBundlePath = {}, RenderQuality quality = RenderQuality::Balanced); + const QByteArray& certificateBundlePath = {}, RenderQuality quality = RenderQuality::Balanced, + bool threadedStreaming = true, bool forceStreamingThreads = false); static std::vector subtitleOptions( const SubtitlePreferences& preferences, bool subtitlesEnabled, bool hdrPlayback = false); }; diff --git a/src/player/PlayerController.cpp b/src/player/PlayerController.cpp index 93af7ae8..d2745933 100644 --- a/src/player/PlayerController.cpp +++ b/src/player/PlayerController.cpp @@ -7,9 +7,11 @@ #include "../platform/MpvConfigPolicy.h" #include "../platform/NativeAppWindow.h" #include "../platform/PlatformPaths.h" +#include "../platform/PlatformPerformanceSampler.h" #include "../platform/PlatformPlaybackSurface.h" #include "../platform/PlatformSystemProbes.h" #include "../provider/PlaybackSource.h" +#include "../provider/SpeedTest.h" #include "MpvOptionProfile.h" #include "MpvVideoItem.h" #include "PlaybackFailurePolicy.h" @@ -30,6 +32,7 @@ extern "C" { #include #include #include +#include #include #include #include @@ -63,6 +66,51 @@ namespace { constexpr uint64_t kTimePosRefreshReply = 0x6a666e7074730001ULL; constexpr uint64_t kNetworkMetricsReply = 0x6375726c73746174ULL; + + constexpr uint64_t kTransportConfigureReply = 0x7463000000000000ULL; + constexpr uint64_t kTransportLoadReply = 0x746c000000000000ULL; + + // The acknowledgement, not submission order, authorizes the pending load. + int configureTransport(mpv_handle *handle, const PlaybackSession& session, qint64 epoch, uint64_t replyId) + { + char *keys[10]; + mpv_node values[10] {}; + int count = 0; + const auto integer = [&](const char *key, qint64 value) { + keys[count] = const_cast(key); + values[count].format = MPV_FORMAT_INT64; + values[count++].u.int64 = value; + }; + const auto number = [&](const char *key, double value) { + keys[count] = const_cast(key); + values[count].format = MPV_FORMAT_DOUBLE; + values[count++].u.double_ = value; + }; + integer("format", 2); + integer("op", 0); + integer("playback-epoch", epoch); + if (session.sourceBitrate > 0) + number("source-bitrate", static_cast(session.sourceBitrate)); + if (session.deliveryBitrate > 0) + number("delivery-bitrate", static_cast(session.deliveryBitrate)); + if (session.sourceSizeBytes > 0) + integer("source-size-bytes", session.sourceSizeBytes); + if (session.deliverySizeBytes > 0) + integer("delivery-size-bytes", session.deliverySizeBytes); + if (session.sourceRuntimeTicks > 0) + number("source-duration-seconds", session.sourceRuntimeTicks / 1e7); + if (session.deliveryRuntimeTicks > 0) + number("delivery-duration-seconds", session.deliveryRuntimeTicks / 1e7); + keys[count] = const_cast("direct-file"); + values[count].format = MPV_FORMAT_FLAG; + values[count++].u.flag = session.playMethod.compare(QStringLiteral("DirectPlay"), Qt::CaseInsensitive) == 0; + mpv_node_list list { count, values, keys }; + mpv_node control {}; + control.format = MPV_FORMAT_NODE_MAP; + control.u.list = &list; + return mpv_set_property_async(handle, replyId, "curl-transport-control", MPV_FORMAT_NODE, &control); + } + constexpr uint64_t kCacheSpeedReply = 0x6375726c73706565ULL; constexpr uint64_t kFullscreenSetReply = 0x6673000000000000ULL; constexpr uint64_t kFullscreenObservation = 0x666f000000000000ULL; constexpr uint64_t kFullscreenReplyMask = 0xffff000000000000ULL; @@ -167,8 +215,59 @@ namespace { return static_cast(seconds * 10000000.0); } - // Curl's public snapshot contains numeric counters and nested numeric sample - // maps. Never propagate string values into support/CLI diagnostics. + // Deliberate diagnostic schema: neither new numeric fields nor arbitrary + // strings from a future mpv build may silently enter CLI/support reports. + bool networkMetricKeyAllowed(const QString& key) + { + static const QSet keys { QStringLiteral("active-requests"), QStringLiteral("peak-active-requests"), + QStringLiteral("active-streams"), QStringLiteral("peak-active-streams"), + QStringLiteral("requests-per-stream"), QStringLiteral("range-bytes"), QStringLiteral("ring-bytes"), + QStringLiteral("started-requests"), QStringLiteral("finished-requests"), QStringLiteral("failed-requests"), + QStringLiteral("retry-attempts"), QStringLiteral("received-bytes"), + QStringLiteral("ordered-available-bytes"), QStringLiteral("consumer-delivered-bytes"), + QStringLiteral("readable-bytes"), QStringLiteral("retained-bytes"), QStringLiteral("reorder-bytes"), + QStringLiteral("prefix-publication-available"), QStringLiteral("copy-in-bytes"), + QStringLiteral("copy-out-bytes"), QStringLiteral("reorder-copy-bytes"), QStringLiteral("body-callbacks"), + QStringLiteral("worker-iterations"), QStringLiteral("coalesced-wakeups"), + QStringLiteral("head-of-line-events"), QStringLiteral("reorder-wait-seconds"), + QStringLiteral("oldest-gap-seconds"), QStringLiteral("perform-wall-seconds"), + QStringLiteral("dispatch-wall-seconds"), QStringLiteral("poll-wall-seconds"), + QStringLiteral("callback-time-included"), QStringLiteral("snapshot-truncated"), + QStringLiteral("average-received-bytes-per-second"), QStringLiteral("peak-received-bytes-per-second"), + QStringLiteral("current-received-bytes-per-second"), QStringLiteral("elapsed-seconds"), + QStringLiteral("curl-thread-cpu-seconds"), QStringLiteral("curl-thread-wall-seconds"), + QStringLiteral("consumer-thread-cpu-seconds"), QStringLiteral("consumer-thread-cpu-available"), + QStringLiteral("curl-thread-cpu-available"), QStringLiteral("ring-wait-seconds"), + QStringLiteral("consumer-wait-seconds"), QStringLiteral("head-of-line-seconds"), + QStringLiteral("peak-reorder-bytes"), QStringLiteral("physical-connections"), + QStringLiteral("streams-per-connection"), QStringLiteral("recent-scheduling-lateness-ms"), + QStringLiteral("peak-scheduling-lateness-ms"), QStringLiteral("open-sockets"), + QStringLiteral("scheduling-lateness-p50-ms"), QStringLiteral("scheduling-lateness-p99-ms"), + QStringLiteral("scheduling-lateness-available"), QStringLiteral("sockets-opened"), + QStringLiteral("tcp-rtt-min-ms"), QStringLiteral("tcp-rtt-max-ms"), + QStringLiteral("max-socket-receive-buffer-bytes"), QStringLiteral("host-rmem-max-bytes"), + QStringLiteral("host-receive-autotune-max-bytes"), QStringLiteral("hw-aes"), + QStringLiteral("playback-epoch"), QStringLiteral("stale-controls"), QStringLiteral("rejected-controls"), + QStringLiteral("background-network"), QStringLiteral("declared-bits-per-second"), + QStringLiteral("playback-state-updates"), QStringLiteral("playback-buffer-seconds"), + QStringLiteral("playback-demand-bits-per-second"), QStringLiteral("playback-user-paused"), + QStringLiteral("selected-requests"), QStringLiteral("ttfb-ms"), QStringLiteral("capacity-bytes-per-second"), + QStringLiteral("capacity-samples"), QStringLiteral("stream-id"), QStringLiteral("lane-samples"), + QStringLiteral("concurrency-samples"), QStringLiteral("streams"), QStringLiteral("connections"), + QStringLiteral("protocol-samples"), QStringLiteral("connection-id"), QStringLiteral("socket-generation"), + QStringLiteral("http-version"), QStringLiteral("transport"), QStringLiteral("socket-receive-buffer-bytes"), + QStringLiteral("socket-receive-buffer-available"), QStringLiteral("receive-window-bytes"), + QStringLiteral("receive-window-available"), QStringLiteral("tcp-rtt-ms"), + QStringLiteral("tcp-rtt-available"), QStringLiteral("cpu-ns-per-ordered-byte"), QStringLiteral("lane"), + QStringLiteral("active-seconds"), QStringLiteral("average-bytes-per-second"), + QStringLiteral("current-bytes-per-second"), QStringLiteral("peak-bytes-per-second"), + QStringLiteral("samples"), QStringLiteral("requests") }; + if (keys.contains(key)) + return true; + constexpr QLatin1String available("-available"); + return key.endsWith(available) && keys.contains(key.chopped(available.size())); + } + QVariant networkMetricValue(const mpv_node& node, int depth = 0) { if (depth > 4) @@ -184,9 +283,14 @@ namespace { QVariantMap result; if (node.u.list) { for (int i = 0; i < node.u.list->num; ++i) { + if (!node.u.list->keys[i]) + continue; + const QString key = QString::fromUtf8(node.u.list->keys[i]); + if (!networkMetricKeyAllowed(key)) + continue; const QVariant value = networkMetricValue(node.u.list->values[i], depth + 1); - if (value.isValid() && node.u.list->keys[i]) - result.insert(QString::fromUtf8(node.u.list->keys[i]), value); + if (value.isValid()) + result.insert(key, value); } } return result; @@ -194,8 +298,9 @@ namespace { case MPV_FORMAT_NODE_ARRAY: { QVariantList result; if (node.u.list) { - result.reserve(node.u.list->num); - for (int i = 0; i < node.u.list->num; ++i) + const int count = std::min(node.u.list->num, 64); + result.reserve(count); + for (int i = 0; i < count; ++i) result.append(networkMetricValue(node.u.list->values[i], depth + 1)); } return result; @@ -383,6 +488,7 @@ PlayerController::~PlayerController() void PlayerController::prepareForShutdown() { ++m_playGeneration; + m_pendingTransportLoads.clear(); m_idleMpvPreparationEnabled = false; m_idleMpvPreparationScheduled = false; m_mpvPreparationContinuation = {}; @@ -406,6 +512,7 @@ void PlayerController::teardownMpv(bool async) const quint64 generation = ++m_mpvTeardownGeneration; Diagnostics::Phase phase(QStringLiteral("shutdown"), QStringLiteral("player_teardown_mpv")); ++m_mpvEventGeneration; + m_pendingTransportLoads.clear(); m_idleMpvPreparationEnabled = false; m_idleMpvPreparationScheduled = false; m_mpvPreparationContinuation = {}; @@ -480,18 +587,19 @@ void PlayerController::prepareMpvAsync(bool needsVideoSurface, bool embeddedVide preparation->embeddedVideo = embeddedVideo; preparation->hardwareDecoding = m_hardwareDecoding; preparation->userConfig = usesUserMpvConfig(); - const int parallelRequests = m_api ? m_api->playbackParallelRequests() : 1; + const int parallelRequests = m_maxStreamingThreads; const auto network = MpvOptionProfile::networkProfile(preparation->platform, parallelRequests); qInfo().nospace() << "player: curl profile source=MpvOptionProfile platform=" << platformPlaybackBackendName(embeddedVideo) << " requestsPerStream=" << network.parallelRequests - << " rangeBytes=" << network.rangeBytes << " ringBytes=" << network.ringBytes; + << " rangeBytes=" << network.rangeBytes << " ringBytes=" << network.ringBytes + << " enabled=" << m_threadedStreaming << " forced=" << m_forceStreamingThreads; QByteArray certificateBundle = QFile::encodeName(writeTrustBundle()); if (certificateBundle.isEmpty()) certificateBundle = MpvOptionProfile::systemCertificateBundle(); preparation->options = MpvOptionProfile::preInitializeOptions(m_mpvConfigPolicy); auto applicationOptions = MpvOptionProfile::applicationOptions(preparation->platform, needsVideoSurface, m_audioOutputMode, {}, m_demuxerMaxBytes, m_demuxerMaxBackBytes, parallelRequests, embeddedVideo, - mpvShaderCachePath(), certificateBundle, m_renderQuality); + mpvShaderCachePath(), certificateBundle, m_renderQuality, m_threadedStreaming, m_forceStreamingThreads); applicationOptions.push_back({ "sub-fonts-dir", m_subtitleFontsPath }); applicationOptions.push_back({ "osd-fonts-dir", m_subtitleFontsPath }); applicationOptions.push_back({ "osd-font", QByteArrayLiteral("IBM Plex Sans Var") }); @@ -588,11 +696,11 @@ bool PlayerController::configureAndInitializeMpv(mpv_handle *handle, const MpvPr "--input-vo-keyboard=no", "--input-cursor=no", "--terminal=no", + "--osc=no", }; - char *embeddingArguments[std::size(embeddingOptions) + 5] {}; - size_t argumentCount = 0; + char *embeddingArguments[std::size(embeddingOptions) + 4] {}; for (size_t i = 0; i < std::size(embeddingOptions); ++i) - embeddingArguments[argumentCount++] = embeddingOptions[i]; + embeddingArguments[i] = embeddingOptions[i]; // --gpu-api picks one of mpv's own ra_ctx backends: a native context and // swapchain of its own. Video and idle handles use --vo=libmpv, while // audio uses --vo=null below. None owns a desktop surface. The embedded @@ -609,20 +717,17 @@ bool PlayerController::configureAndInitializeMpv(mpv_handle *handle, const MpvPr // nothing to constrain. The option stays at auto for both. QByteArray softwareDecodeOption = QByteArrayLiteral("--hwdec=no"); if (!preparation.hardwareDecoding) - embeddingArguments[argumentCount++] = softwareDecodeOption.data(); + embeddingArguments[std::size(embeddingOptions)] = softwareDecodeOption.data(); char audioVideoOutputOption[] = "--vo=null"; char audioVideoTrackOption[] = "--vid=no"; char audioDisplayOption[] = "--audio-display=no"; if (!preparation.needsVideoSurface) { embeddingArguments[0] = audioVideoOutputOption; - embeddingArguments[argumentCount++] = audioVideoTrackOption; - embeddingArguments[argumentCount++] = audioDisplayOption; - } - char oscOption[] = "--osc=no"; - // Builds without Lua (such as iOS and tvOS) omit the osc option entirely, - // and mpv_initialize_opts rejects unknown command-line options. - if (mpv_set_option_string(handle, "osc", "no") != MPV_ERROR_OPTION_NOT_FOUND) - embeddingArguments[argumentCount++] = oscOption; + // Keep the argument list contiguous when hardware decoding is enabled. + size_t index = std::size(embeddingOptions) + (preparation.hardwareDecoding ? 0 : 1); + embeddingArguments[index++] = audioVideoTrackOption; + embeddingArguments[index] = audioDisplayOption; + } if (preparation.userConfig) qInfo() << "player: user mpv config enabled; embedding overrides vo, gpu-api, gpu-context," " wid, force-window, idle, keep-open, input-vo-keyboard, input-cursor, terminal and osc"; @@ -1298,6 +1403,7 @@ void PlayerController::playLocalFiles(const QList& urls) void PlayerController::playSession(const PlaybackSession& session, bool startPaused, const QList& localFiles) { const quint64 generation = ++m_playGeneration; + m_pendingTransportLoads.clear(); m_mpvPreparationContinuation = {}; const bool needsVideoSurface = MpvOptionProfile::needsVideoSurface(session); const QString nextMediaKind = needsVideoSurface ? QStringLiteral("video") : QStringLiteral("audio"); @@ -1385,7 +1491,13 @@ void PlayerController::playSession(const PlaybackSession& session, bool startPau m_session = session; m_networkMetrics.clear(); + m_streamingPerformanceMetrics.clear(); m_networkQueryPending = false; + m_cacheSpeedQueryPending = false; + m_sessionThreadedStreaming = m_threadedStreaming; + m_streamingPerformanceSampler.reset(); + m_previousCurlCpuSeconds = -1; + m_previousCurlWallSeconds = -1; m_networkBufferSeconds = 0; m_networkVideoBitrate = 0; m_networkAudioBitrate = 0; @@ -1604,7 +1716,7 @@ void PlayerController::finishPlaySession( return; } QByteArray loadFileOptions = MpvOptionProfile::loadFileOptions(session); - if (m_api && !m_networkOrigin.isEmpty()) { + if (m_sessionThreadedStreaming && m_api && !m_networkOrigin.isEmpty()) { // Resolve seeds per file, not from whichever account was active when // the speculative core was initialized. const QVariantMap& profile = m_sessionNetworkProfile; @@ -1615,29 +1727,92 @@ void PlayerController::finishPlaySession( loadFileOptions += '='; loadFileOptions += value; }; - addOption("curl-adaptive", "yes"); - addOption("curl-parallel-requests", "4"); - addOption("curl-initial-requests", - QByteArray::number(std::clamp(profile.value(QStringLiteral("initial-requests"), 1).toInt(), 1, 4))); - addOption( - "curl-latency-ms", QByteArray::number(profile.value(QStringLiteral("latency-ms")).toDouble(), 'f', 3)); - addOption("curl-observed-bps", - QByteArray::number(profile.value(QStringLiteral("capacity-bytes-per-second")).toDouble(), 'f', 0)); + addOption("curl-adaptive", m_forceStreamingThreads ? "no" : "yes"); + addOption("curl-parallel-requests", QByteArray::number(m_maxStreamingThreads)); + const QVariantList samples = profile.value(QStringLiteral("concurrency-samples")).toList(); + const NetworkLaneSelection selection + = selectNetworkLanes(samples, networkMediaBitrate(), m_maxStreamingThreads); + const int initialRequests = m_forceStreamingThreads ? m_maxStreamingThreads : selection.requests; + double capacity = 0; + double latency = 0; + for (const QVariant& value : samples) { + const QVariantMap point = value.toMap(); + if (point.value(QStringLiteral("requests")).toInt() == initialRequests) { + capacity = point.value(QStringLiteral("capacity-bytes-per-second")).toDouble(); + latency = point.value(QStringLiteral("ttfb-ms")).toDouble(); + break; + } + } + addOption("curl-initial-requests", QByteArray::number(initialRequests)); + addOption("curl-ttfb-ms", QByteArray::number(latency, 'f', 3)); + addOption("curl-observed-bps", QByteArray::number(capacity, 'f', 0)); + qInfo().nospace() << "player: streaming selection selectedRequests=" << initialRequests + << " maxRequests=" << m_maxStreamingThreads << " forced=" << m_forceStreamingThreads + << " reason=" << (m_forceStreamingThreads ? 3 : selection.reason) + << " capacityMbps=" << capacity * 8 / 1e6 << " mediaMbps=" << networkMediaBitrate() / 1e6; addOption("curl-media-bitrate", QByteArray::number(networkMediaBitrate(), 'f', 0)); } - m_networkTimer.start(); - const char *loadCommand[] = { "loadfile", urlBytes.constData(), "replace", "-1", - loadFileOptions.isEmpty() ? nullptr : loadFileOptions.constData(), nullptr }; - if (mpv_command(handle, loadCommand) < 0) { - m_mpvLifecycle.cancelFileLoad(); - m_errorText = QStringLiteral("libmpv rejected the playback URL."); -#ifdef Q_OS_ANDROID - if (m_contentPlaybackFile.isOpen()) - scheduleMpvTeardown(); -#endif - stopProgressReporting(true); + if (m_sessionThreadedStreaming || m_logStreamingPerformance) + m_networkTimer.start(); + QByteArrayList loadCommand { QByteArrayLiteral("loadfile"), urlBytes, QByteArrayLiteral("replace"), + QByteArrayLiteral("-1") }; + if (!loadFileOptions.isEmpty()) + loadCommand.append(loadFileOptions); + configureTransportForLoad(std::move(loadCommand)); +} + +void PlayerController::configureTransportForLoad(QByteArrayList loadCommand) +{ + auto *handle = m_mpvLifecycle.handle(); + if (!handle) + return; + const quint64 serial = ++m_transportReplySerial; + Q_ASSERT((serial & kFullscreenReplyMask) == 0); + const qint64 epoch = m_sessionThreadedStreaming ? ++m_transportEpoch : 0; + m_pendingTransportLoads.insert(serial, { m_mpvEventGeneration, m_playGeneration, epoch, std::move(loadCommand) }); + if (!m_sessionThreadedStreaming) { + submitTransportLoad(serial); return; } + if (configureTransport(handle, m_session, epoch, kTransportConfigureReply | serial) < 0) { + m_pendingTransportLoads.remove(serial); + failTransportLoad(true); + } +} + +void PlayerController::submitTransportLoad(quint64 serial) +{ + auto pending = m_pendingTransportLoads.find(serial); + if (pending == m_pendingTransportLoads.end()) + return; + if (pending->coreGeneration != m_mpvEventGeneration || pending->playGeneration != m_playGeneration + || (pending->epoch && pending->epoch != m_transportEpoch)) { + m_pendingTransportLoads.erase(pending); + return; + } + QList args; + args.reserve(pending->command.size() + 1); + for (const QByteArray& arg : std::as_const(pending->command)) + args.append(arg.constData()); + args.append(nullptr); + const int error = mpv_command_async(m_mpvLifecycle.handle(), kTransportLoadReply | serial, args.data()); + pending->command.clear(); + if (error < 0) { + m_pendingTransportLoads.erase(pending); + failTransportLoad(false); + } +} + +void PlayerController::failTransportLoad(bool configuration) +{ + m_mpvLifecycle.cancelFileLoad(); + m_errorText = configuration ? QStringLiteral("libmpv rejected the streaming policy.") + : QStringLiteral("libmpv rejected the playback URL."); +#ifdef Q_OS_ANDROID + if (m_contentPlaybackFile.isOpen()) + scheduleMpvTeardown(); +#endif + stopProgressReporting(true); } bool PlayerController::loadLocalFiles(const QList& urls) @@ -2469,6 +2644,47 @@ void PlayerController::setForwardCacheSizeMiB(int sizeMiB) qInfo() << "player: forward cache size" << QString::number(sizeMiB) + QStringLiteral(" MiB"); discardPreparedMpvForOptionChange("forward cache size change"); } + +void PlayerController::setThreadedStreaming(bool enabled) +{ + if (m_threadedStreaming == enabled) + return; + m_threadedStreaming = enabled; + discardPreparedMpvForOptionChange("threaded streaming change"); +} + +void PlayerController::setMaxStreamingThreads(int threads) +{ + threads = std::clamp(threads, 1, 16); + if (m_maxStreamingThreads == threads) + return; + m_maxStreamingThreads = threads; + discardPreparedMpvForOptionChange("streaming thread limit change"); +} + +void PlayerController::setForceStreamingThreads(bool force) +{ + if (m_forceStreamingThreads == force) + return; + m_forceStreamingThreads = force; + discardPreparedMpvForOptionChange("forced streaming threads change"); +} + +void PlayerController::setLogStreamingPerformance(bool enabled) +{ + if (m_logStreamingPerformance == enabled) + return; + m_logStreamingPerformance = enabled; + m_streamingPerformanceSampler.reset(); + m_streamingPerformanceMetrics.clear(); + m_previousCurlCpuSeconds = -1; + m_previousCurlWallSeconds = -1; + if (m_sessionActive && enabled) + m_networkTimer.start(); + else if (!m_sessionThreadedStreaming) + m_networkTimer.stop(); +} + void PlayerController::setMpvConfigPolicy(const MpvConfigPolicy& policy) { if (!policy.valid || policy == m_mpvConfigPolicy) @@ -2491,30 +2707,67 @@ void PlayerController::updateNetworkTransport() auto *handle = m_mpvLifecycle.handle(); if (!handle || !m_sessionActive) return; - char bitrateKey[] = "media-bitrate"; - char bufferKey[] = "buffer-seconds"; - char pausedKey[] = "paused"; - char *keys[] = { bitrateKey, bufferKey, pausedKey }; - mpv_node values[3] {}; - values[0].format = MPV_FORMAT_DOUBLE; - values[0].u.double_ = networkMediaBitrate(); - values[1].format = MPV_FORMAT_DOUBLE; - values[1].u.double_ = m_networkBufferSeconds; - values[2].format = MPV_FORMAT_FLAG; - values[2].u.flag = m_paused || m_seeking; - mpv_node_list list { 3, values, keys }; - mpv_node control {}; - control.format = MPV_FORMAT_NODE_MAP; - control.u.list = &list; - // Async APIs copy their arguments. Neither operation waits for curl/the core - // while Qt needs the GUI thread for rendering. - mpv_set_property_async(handle, 0, "curl-transport-control", MPV_FORMAT_NODE, &control); + if (m_logStreamingPerformance && !m_cacheSpeedQueryPending) { + m_cacheSpeedQueryPending + = mpv_get_property_async(handle, kCacheSpeedReply, "cache-speed", MPV_FORMAT_INT64) >= 0; + } + if (!m_sessionThreadedStreaming) + return; + // mpv reports pause, buffer and demand to its transport itself; this only + // reads metrics, asynchronously, so Qt never waits on curl or the core. if (!m_networkQueryPending) { m_networkQueryPending = mpv_get_property_async(handle, kNetworkMetricsReply, "curl-transport-metrics", MPV_FORMAT_NODE) >= 0; } } +void PlayerController::logStreamingPerformance(qint64 inputBytesPerSecond) +{ + if (!m_logStreamingPerformance) + return; + if (!m_streamingPerformanceSampler) + m_streamingPerformanceSampler = std::make_unique(); + PlatformPerformanceSample cpu; + m_streamingPerformanceSampler->sample(-1, cpu); + const bool curlCpuAvailable = m_networkMetrics.value(QStringLiteral("curl-thread-cpu-available")).toBool(); + const double curlCpu = m_networkMetrics.value(QStringLiteral("curl-thread-cpu-seconds")).toDouble(); + const double curlWall = m_networkMetrics.value(QStringLiteral("curl-thread-wall-seconds")).toDouble(); + const double ringWait = m_networkMetrics.value(QStringLiteral("ring-wait-seconds")).toDouble(); + const double consumerWait = m_networkMetrics.value(QStringLiteral("consumer-wait-seconds")).toDouble(); + const bool intervalAvailable = m_previousCurlWallSeconds >= 0 && curlWall > m_previousCurlWallSeconds; + const bool cpuIntervalAvailable + = intervalAvailable && curlCpuAvailable && m_previousCurlCpuSeconds >= 0 && curlCpu >= m_previousCurlCpuSeconds; + const double curlCpuPercent = cpuIntervalAvailable + ? 100 * (curlCpu - m_previousCurlCpuSeconds) / (curlWall - m_previousCurlWallSeconds) + : 0; + const double ringWaitMs = intervalAvailable ? std::max(0.0, ringWait - m_previousRingWaitSeconds) * 1000 : 0; + const double consumerWaitMs + = intervalAvailable ? std::max(0.0, consumerWait - m_previousConsumerWaitSeconds) * 1000 : 0; + m_previousCurlCpuSeconds = curlCpuAvailable ? curlCpu : -1; + m_previousCurlWallSeconds = curlWall; + m_previousRingWaitSeconds = ringWait; + m_previousConsumerWaitSeconds = consumerWait; + m_streamingPerformanceMetrics.insert(QStringLiteral("input-bytes-per-second"), inputBytesPerSecond); + m_streamingPerformanceMetrics.insert(QStringLiteral("buffer-seconds"), m_networkBufferSeconds); + m_streamingPerformanceMetrics.insert(QStringLiteral("process-cpu-percent"), cpu.processCpuPercent); + m_streamingPerformanceMetrics.insert(QStringLiteral("process-cpu-available"), cpu.available); + m_streamingPerformanceMetrics.insert(QStringLiteral("mpv-cpu-percent"), cpu.mpvCpuPercent); + m_streamingPerformanceMetrics.insert(QStringLiteral("curl-thread-cpu-percent"), curlCpuPercent); + m_streamingPerformanceMetrics.insert(QStringLiteral("curl-thread-cpu-percent-available"), cpuIntervalAvailable); + qInfo().nospace() << "player: streaming performance threaded=" << m_sessionThreadedStreaming + << " selectedRequests=" << m_networkMetrics.value(QStringLiteral("selected-requests")).toInt() + << " inputMbps=" << (inputBytesPerSecond < 0 ? -1.0 : inputBytesPerSecond * 8.0 / 1e6) + << " wireMbps=" + << m_networkMetrics.value(QStringLiteral("current-received-bytes-per-second")).toDouble() * 8 + / 1e6 << " capacityMbps=" + << m_networkMetrics.value(QStringLiteral("capacity-bytes-per-second")).toDouble() * 8 / 1e6 + << " mediaMbps=" << networkMediaBitrate() / 1e6 << " bufferSeconds=" << m_networkBufferSeconds + << " paused=" << m_paused << " seeking=" << m_seeking << " cpuAvailable=" << cpu.available + << " processCpuPct=" << cpu.processCpuPercent << " mpvCpuPct=" << cpu.mpvCpuPercent + << " curlCpuAvailable=" << cpuIntervalAvailable << " curlCpuPct=" << curlCpuPercent + << " ringWaitMs=" << ringWaitMs << " consumerWaitMs=" << consumerWaitMs; +} + void PlayerController::startProgressReporting() { Diagnostics::logEvent(QStringLiteral("player"), QStringLiteral("progress_reporting_start"), @@ -2531,6 +2784,7 @@ void PlayerController::startProgressReporting() void PlayerController::stopProgressReporting(bool failed, bool reachedEnd, bool explicitStop) { + m_pendingTransportLoads.clear(); Diagnostics::Phase phase(QStringLiteral("player"), QStringLiteral("stop_progress_reporting"), { { QStringLiteral("failed"), failed }, { QStringLiteral("reachedEnd"), reachedEnd } }); if (!m_sessionActive && !m_progressTimer.isActive()) { @@ -2818,6 +3072,24 @@ void PlayerController::handleMpvEvent(mpv_event *event, quint64 generation, mpv_ }); break; case MPV_EVENT_SET_PROPERTY_REPLY: { + if ((event->reply_userdata & kFullscreenReplyMask) == kTransportConfigureReply) { + const quint64 serial = event->reply_userdata & kFullscreenSerialMask; + const int error = event->error; + postMpvEvent(generation, [this, serial, error] { + const auto pending = m_pendingTransportLoads.constFind(serial); + if (pending == m_pendingTransportLoads.cend() || pending->coreGeneration != m_mpvEventGeneration + || pending->playGeneration != m_playGeneration || pending->epoch != m_transportEpoch) + return; + if (error < 0) { + m_pendingTransportLoads.remove(serial); + failTransportLoad(true); + } else { + updateBackgroundNetwork(); + submitTransportLoad(serial); + } + }); + break; + } if ((event->reply_userdata & kFullscreenReplyMask) != kFullscreenSetReply) break; const uint64_t serial = event->reply_userdata & kFullscreenSerialMask; @@ -2838,7 +3110,37 @@ void PlayerController::handleMpvEvent(mpv_event *event, quint64 generation, mpv_ }); break; } + case MPV_EVENT_COMMAND_REPLY: { + if ((event->reply_userdata & kFullscreenReplyMask) != kTransportLoadReply) + break; + const quint64 serial = event->reply_userdata & kFullscreenSerialMask; + const int error = event->error; + postMpvEvent(generation, [this, serial, error] { + const auto pending = m_pendingTransportLoads.find(serial); + if (pending == m_pendingTransportLoads.end()) + return; + const bool current = pending->coreGeneration == m_mpvEventGeneration + && pending->playGeneration == m_playGeneration + && (!pending->epoch || pending->epoch == m_transportEpoch); + m_pendingTransportLoads.erase(pending); + if (current && error < 0) + failTransportLoad(false); + }); + break; + } case MPV_EVENT_GET_PROPERTY_REPLY: { + if (event->reply_userdata == kCacheSpeedReply) { + const auto *property = static_cast(event->data); + const qint64 bytesPerSecond + = event->error >= 0 && property && property->data && property->format == MPV_FORMAT_INT64 + ? *static_cast(property->data) + : -1; + postMpvEvent(generation, [this, bytesPerSecond] { + m_cacheSpeedQueryPending = false; + logStreamingPerformance(bytesPerSecond); + }); + break; + } if (event->reply_userdata == kNetworkMetricsReply) { const auto *property = static_cast(event->data); const QVariantMap metrics @@ -3340,11 +3642,51 @@ void PlayerController::skipActiveSegment() seek(activeSegmentEndSeconds()); } +void PlayerController::setBackgroundNetwork(bool active) +{ + m_backgroundNetwork = active; + updateBackgroundNetwork(); +} + +void PlayerController::updateBackgroundNetwork() +{ + auto *handle = m_mpvLifecycle.handle(); + if (!handle || !m_sessionThreadedStreaming || m_transportEpoch <= 0) + return; + char formatKey[] = "format"; + char opKey[] = "op"; + char epochKey[] = "playback-epoch"; + char backgroundKey[] = "background-network"; + char *keys[] = { formatKey, opKey, epochKey, backgroundKey }; + mpv_node values[4] {}; + values[0].format = values[1].format = values[2].format = MPV_FORMAT_INT64; + values[0].u.int64 = 2; + values[1].u.int64 = 1; + values[2].u.int64 = m_transportEpoch; + values[3].format = MPV_FORMAT_FLAG; + values[3].u.flag = m_backgroundNetwork || m_trickplayNetwork; + mpv_node_list list { 4, values, keys }; + mpv_node control {}; + control.format = MPV_FORMAT_NODE_MAP; + control.u.list = &list; + // An update for an older epoch is ignored by mpv, so a late signal is harmless. + mpv_set_property_async(handle, 0, "curl-transport-control", MPV_FORMAT_NODE, &control); +} + void PlayerController::setTrickplayService(TrickplayService *service) { + if (m_trickplay) + disconnect(m_trickplay, nullptr, this, nullptr); m_trickplay = service; - if (service) + m_trickplayNetwork = service && service->fetching(); + updateBackgroundNetwork(); + if (service) { connect(service, &TrickplayService::changed, this, &PlayerController::trickplayChanged); + connect(service, &TrickplayService::fetchingChanged, this, [this](bool active) { + m_trickplayNetwork = active; + updateBackgroundNetwork(); + }); + } } QVariantMap PlayerController::trickplayForSeconds(double seconds) const diff --git a/src/player/PlayerController.h b/src/player/PlayerController.h index b18de0f3..ea4dfe9a 100644 --- a/src/player/PlayerController.h +++ b/src/player/PlayerController.h @@ -38,6 +38,7 @@ class NativeAppWindow; class PlaybackSource; class TlsTrustController; class TrickplayService; +class PlatformPerformanceSampler; class PlayerController final : public QObject { Q_OBJECT @@ -124,7 +125,10 @@ class PlayerController final : public QObject { } QVariantMap networkMetrics() const { - return m_networkMetrics; + QVariantMap metrics = m_networkMetrics; + for (auto it = m_streamingPerformanceMetrics.cbegin(); it != m_streamingPerformanceMetrics.cend(); ++it) + metrics.insert(it.key(), it.value()); + return metrics; } bool subtitlesEnabled() const; QStringList subtitleTracks() const; @@ -155,6 +159,8 @@ class PlayerController final : public QObject { Q_INVOKABLE void skipActiveSegment(); Q_INVOKABLE QVariantMap trickplayForSeconds(double seconds) const; void setTrickplayService(TrickplayService *service); + // Tell the transport that the host is fetching other network data. + void setBackgroundNetwork(bool active); Q_INVOKABLE void play(const Spool::PlaybackSession& session, bool startPaused = false); void playLocalFiles(const QList& urls); @@ -247,6 +253,10 @@ class PlayerController final : public QObject { void previewSubtitlePreferences(const Spool::SubtitlePreferences& preferences); void setDemuxerBudget(const QByteArray& maxBytes, const QByteArray& maxBackBytes); void setForwardCacheSizeMiB(int sizeMiB); + void setThreadedStreaming(bool enabled); + void setMaxStreamingThreads(int threads); + void setForceStreamingThreads(bool force); + void setLogStreamingPerformance(bool enabled); void setMpvConfigPolicy(const MpvConfigPolicy& policy); signals: @@ -338,8 +348,13 @@ class PlayerController final : public QObject { void prepareMpvAsync(bool needsVideoSurface, bool embeddedVideo); static bool configureAndInitializeMpv(mpv_handle *handle, const MpvPreparation& preparation); void observeMpvProperties(mpv_handle *handle); + void configureTransportForLoad(QByteArrayList loadCommand); + void submitTransportLoad(quint64 serial); + void failTransportLoad(bool configuration); + void updateBackgroundNetwork(); void updateNetworkTransport(); double networkMediaBitrate() const; + void logStreamingPerformance(qint64 inputBytesPerSecond); void synchronizeWindowFullscreen(mpv_handle *handle); void scheduleMpvTeardown(); void handleMpvEvent(mpv_event *event, quint64 generation, mpv_handle *handle); @@ -417,14 +432,33 @@ class PlayerController final : public QObject { QTimer m_progressTimer; QTimer m_networkTimer; QVariantMap m_networkMetrics; + QVariantMap m_streamingPerformanceMetrics; QUrl m_networkOrigin; QByteArray m_sessionRequestHeaders; QVariantMap m_sessionNetworkProfile; QSslCertificate m_sessionTrustCertificate; bool m_networkQueryPending = false; double m_networkBufferSeconds = 0; + qint64 m_transportEpoch = 0; // curl-transport-control playback epoch, per load + struct PendingTransportLoad { + quint64 coreGeneration; + quint64 playGeneration; + qint64 epoch; + QByteArrayList command; + }; + QHash m_pendingTransportLoads; + quint64 m_transportReplySerial = 0; double m_networkVideoBitrate = 0; + bool m_backgroundNetwork = false; + bool m_trickplayNetwork = false; double m_networkAudioBitrate = 0; + bool m_cacheSpeedQueryPending = false; + bool m_sessionThreadedStreaming = true; + std::unique_ptr m_streamingPerformanceSampler; + double m_previousCurlCpuSeconds = -1; + double m_previousCurlWallSeconds = -1; + double m_previousRingWaitSeconds = 0; + double m_previousConsumerWaitSeconds = 0; QTimer m_backGuardTimer; QTimer m_uiPositionTimer; QTimer m_seekWatchdogTimer; @@ -456,6 +490,10 @@ class PlayerController final : public QObject { bool m_directVideoOutput = false; bool m_hardwareDecoding = true; QByteArray m_softwareRenderer; + bool m_threadedStreaming = true; + int m_maxStreamingThreads = 4; + bool m_forceStreamingThreads = false; + bool m_logStreamingPerformance = false; // The opening seconds are where a device that cannot keep up says so: // the picture is being scaled and tone-mapped from the first frame, and // nothing has warmed a cache yet. diff --git a/src/provider/PlaybackSource.h b/src/provider/PlaybackSource.h index 926ce372..dbe7d183 100644 --- a/src/provider/PlaybackSource.h +++ b/src/provider/PlaybackSource.h @@ -30,12 +30,10 @@ class PlaybackSource : public QObject { virtual QByteArray mediaRequestHeaders() const = 0; // The origin whose remembered TLS trust decision covers media URLs. virtual QUrl mediaOrigin() const = 0; - // Hard range-request cap; the learned initial count lives in the profile. - virtual int playbackParallelRequests() const = 0; // Native-only transport learning. Rates are bytes/s; media bitrate is bits/s. - // {initial-requests:1..4, latency-ms, capacity-bytes-per-second, + // {initial-requests:1..4, ttfb-ms, capacity-bytes-per-second, // measured-bitrate:bits/s, concurrency-samples:[{requests, capacity-bytes-per-second, - // latency-ms, updated-at-ms}]} contains only fresh observations. + // ttfb-ms, updated-at-ms}]} contains only fresh observations. // Feedback is curl-transport-metrics plus observed-at-ms (UTC epoch ms) // and media-bitrate (bits/s). Only non-cache-blocked concurrency samples // with increasing stream-id/capacity-samples are learned. diff --git a/src/provider/PortableProvider.cpp b/src/provider/PortableProvider.cpp index d6238f94..e1048d04 100644 --- a/src/provider/PortableProvider.cpp +++ b/src/provider/PortableProvider.cpp @@ -119,10 +119,6 @@ class PortableProvider::Playback final : public PlaybackSource { { return m_origin; } - int playbackParallelRequests() const override - { - return 4; - } QVariantMap playbackNetworkProfile() const override { return m_owner->m_registry->playbackNetworkProfile(m_owner->m_accountId, m_origin); @@ -180,6 +176,13 @@ class PortableProvider::Playback final : public PlaybackSource { session.sourceBitrate = source.value(QStringLiteral("bitrate")).toLongLong(); session.sourceWidth = source.value(QStringLiteral("width")).toInt(); session.sourceHeight = source.value(QStringLiteral("height")).toInt(); + // Admitted and normalized to whole numbers by the script runtime. + session.sourceSizeBytes = source.value(QStringLiteral("sizeBytes")).toLongLong(); + session.sourceRuntimeTicks = source.value(QStringLiteral("runtimeTicks")).toLongLong(); + const QVariantMap delivery = result.value(QStringLiteral("delivery")).toMap(); + session.deliveryBitrate = delivery.value(QStringLiteral("bitrate")).toLongLong(); + session.deliverySizeBytes = delivery.value(QStringLiteral("sizeBytes")).toLongLong(); + session.deliveryRuntimeTicks = delivery.value(QStringLiteral("runtimeTicks")).toLongLong(); // mpv lists a file's own tracks first and subtitle files after them, // in the order they are added, so the streams are kept in that order. // A subtitle file mpv cannot fetch is left out rather than shifting diff --git a/src/provider/ProviderRegistry.cpp b/src/provider/ProviderRegistry.cpp index e5d9fd40..bda5178c 100644 --- a/src/provider/ProviderRegistry.cpp +++ b/src/provider/ProviderRegistry.cpp @@ -7,11 +7,13 @@ #include "ProviderCapabilityContract.h" #include "ProviderExtensionData.h" #include "ProviderUiContext.h" +#include "SpeedTest.h" #include #include #include #include +#include #include #include #include @@ -982,52 +984,35 @@ QVariantMap ProviderRegistry::playbackNetworkProfile(const QString& accountId, c const QVariantMap sample = value.toMap(); const int requests = sample.value(QStringLiteral("requests")).toInt(); const double capacity = sample.value(QStringLiteral("capacity-bytes-per-second")).toDouble(); - if (requests >= 1 && requests <= 4 && networkRate(capacity) + if (requests >= 1 && requests <= 16 && networkRate(capacity) && freshNetworkSample(sample.value(QStringLiteral("updated-at-ms")).toLongLong(), now)) estimates.insert(requests, sample); } } - for (int requests : { 1, 2, 3, 4 }) { + for (int requests = 1; requests <= 16; ++requests) { if (estimates.contains(requests)) { const auto sample = estimates.value(requests); samples.append(sample); best = std::max(best, sample.value(QStringLiteral("capacity-bytes-per-second")).toDouble()); } } - int selected = 1; const bool recentPlayback = !samples.isEmpty() && freshNetworkSample(saved.value(QStringLiteral("playback-at-ms")).toLongLong(), now); const double mediaBitrate = recentPlayback ? saved.value(QStringLiteral("media-bitrate")).toDouble() : 0; - if (recentPlayback) - selected = saved.value(QStringLiteral("initial-requests"), 1).toInt(); - if (selected < 1 || selected > 4) - selected = 1; - if (mediaBitrate > 0) { - // Keep substantial headroom without rewarding more sockets for a tiny gain. - for (int requests : { 1, 2, 3, 4 }) { - const auto enough - = std::find_if(samples.cbegin(), samples.cend(), [requests, mediaBitrate](const QVariant& v) { - const auto sample = v.toMap(); - return sample.value(QStringLiteral("requests")).toInt() == requests - && sample.value(QStringLiteral("capacity-bytes-per-second")).toDouble() * 8 - >= mediaBitrate * 1.75; - }); - if (enough != samples.cend()) { - selected = requests; - break; - } - } - } + const auto selection = selectNetworkLanes(samples, mediaBitrate); + const int selected = selection.requests; + qInfo("streaming profile selection requests=%d reason=%d media_bitrate=%.0f best_capacity_bytes_per_second=%.0f", + selected, selection.reason, mediaBitrate, best); double capacity = 0; double latency = 0; for (const QVariant& value : samples) { const auto sample = value.toMap(); if (sample.value(QStringLiteral("requests")).toInt() == selected) { capacity = sample.value(QStringLiteral("capacity-bytes-per-second")).toDouble(); - latency = sample.value(QStringLiteral("latency-ms")).toDouble(); + latency = sample.value(QStringLiteral("ttfb-ms")).toDouble(); } } - return { { QStringLiteral("initial-requests"), selected }, { QStringLiteral("latency-ms"), latency }, + return { { QStringLiteral("initial-requests"), selected }, { QStringLiteral("ttfb-ms"), latency }, { QStringLiteral("capacity-bytes-per-second"), capacity }, { QStringLiteral("measured-bitrate"), qint64(best * 8 * 0.75) }, { QStringLiteral("concurrency-samples"), samples } }; @@ -1056,7 +1041,7 @@ bool ProviderRegistry::updatePlaybackNetworkProfile( const auto previous = m_networkFeedback.value(key); if (key.isEmpty() || !sourceRunning(accountId) || !accountOriginAllowed(accountId, origin) || observed <= 0 || observed > now + 5000 || now - observed > 5 * 60 * 1000 || !stream || !count || stream < previous.first - || (stream == previous.first && count <= previous.second) || requests < 1 || requests > 4) + || (stream == previous.first && count <= previous.second) || requests < 1 || requests > 16) return false; // Only curl's unthrottled capacity observations are accepted; lifetime // average/current rates include cache backpressure and must not enter here. @@ -1070,15 +1055,15 @@ bool ProviderRegistry::updatePlaybackNetworkProfile( auto seen = stream == previous.first ? m_networkPointSamples.value(key) : QHash(); bool changed = false; const QVariantList incoming = metrics.value(QStringLiteral("concurrency-samples")).toList(); - if (incoming.isEmpty() || incoming.size() > 4) + if (incoming.isEmpty() || incoming.size() > 16) return false; for (const QVariant& value : incoming) { const auto point = value.toMap(); const int lanes = point.value(QStringLiteral("requests")).toInt(); const double rate = point.value(QStringLiteral("capacity-bytes-per-second")).toDouble(); - const double latency = point.value(QStringLiteral("latency-ms")).toDouble(); + const double latency = point.value(QStringLiteral("ttfb-ms")).toDouble(); const quint64 samples = point.value(QStringLiteral("samples")).toULongLong(); - if (lanes < 1 || lanes > 4 || !networkRate(rate) || !std::isfinite(latency) || latency < 0 || latency > 60000 + if (lanes < 1 || lanes > 16 || !networkRate(rate) || !std::isfinite(latency) || latency < 0 || latency > 60000 || !samples) return false; if (samples <= seen.value(lanes)) @@ -1087,18 +1072,20 @@ bool ProviderRegistry::updatePlaybackNetworkProfile( points.insert(lanes, { { QStringLiteral("requests"), lanes }, { QStringLiteral("capacity-bytes-per-second"), networkRate(old) ? old * 0.5 + rate * 0.5 : rate }, - { QStringLiteral("latency-ms"), latency }, { QStringLiteral("updated-at-ms"), now } }); + { QStringLiteral("ttfb-ms"), latency }, { QStringLiteral("updated-at-ms"), now } }); seen.insert(lanes, samples); changed = true; + qInfo("streaming profile sample source=2 requests=%d capacity_bytes_per_second=%.0f ttfb_ms=%.3f samples=%llu", + lanes, points.value(lanes).value(QStringLiteral("capacity-bytes-per-second")).toDouble(), latency, + static_cast(samples)); } if (!changed) return false; QVariantList merged; - for (int lanes : { 1, 2, 3, 4 }) + for (int lanes = 1; lanes <= 16; ++lanes) if (points.contains(lanes)) merged.append(points.value(lanes)); saved.insert(QStringLiteral("concurrency-samples"), merged); - saved.insert(QStringLiteral("initial-requests"), requests); saved.insert(QStringLiteral("playback-at-ms"), now); const double bitrate = metrics.value(QStringLiteral("media-bitrate")).toDouble(); if (std::isfinite(bitrate) && bitrate > 0 && bitrate <= 800.0e9) @@ -1138,13 +1125,15 @@ bool ProviderRegistry::recordSpeedTest(const QString& accountId, const QVariantM for (const QVariant& value : input) { const auto sample = value.toMap(); const double rate = sample.value(QStringLiteral("capacity-bytes-per-second")).toDouble(); - const double latency = sample.value(QStringLiteral("latency-ms")).toDouble(); + const double latency = sample.value(QStringLiteral("ttfb-ms")).toDouble(); if (sample.value(QStringLiteral("requests")).toInt() != expected || !networkRate(rate) || !std::isfinite(latency) || latency < 0 || latency > 60000) return false; samples.append(QVariantMap { { QStringLiteral("requests"), expected }, - { QStringLiteral("capacity-bytes-per-second"), rate }, { QStringLiteral("latency-ms"), latency }, + { QStringLiteral("capacity-bytes-per-second"), rate }, { QStringLiteral("ttfb-ms"), latency }, { QStringLiteral("updated-at-ms"), now } }); + qInfo("streaming profile sample source=1 requests=%d capacity_bytes_per_second=%.0f ttfb_ms=%.3f", expected, + rate, latency); expected *= 2; } auto saved = m_networkProfiles.value(key).toMap(); diff --git a/src/provider/ScriptRuntime.cpp b/src/provider/ScriptRuntime.cpp index 6dfc5a62..5542ff84 100644 --- a/src/provider/ScriptRuntime.cpp +++ b/src/provider/ScriptRuntime.cpp @@ -10,12 +10,83 @@ #include #include +#include #include +#include #include #include namespace Spool { namespace { + + // A positive whole count of bytes or ticks: a safe-integer number (the + // script boundary already bounds numbers to 2^53) or an unsigned decimal + // string that fits qint64. Providers omit what they do not know. + std::optional positiveCount(const QVariant& value) + { + if (value.typeId() == QMetaType::Double) { + const double number = value.toDouble(); + if (number >= 1 && number == std::floor(number)) + return static_cast(number); + return std::nullopt; + } + if (value.typeId() != QMetaType::QString) + return std::nullopt; + const QString text = value.toString(); + if (text.isEmpty() || text.size() > 19 + || std::any_of(text.cbegin(), text.cend(), [](QChar c) { return c < u'0' || c > u'9'; })) + return std::nullopt; + bool valid = false; + const qint64 number = text.toLongLong(&valid); + return valid && number >= 1 ? std::optional(number) : std::nullopt; + } + + // Bitrates and dimensions keep their meaning: a whole number, 0 unknown. + std::optional wholeNumber(const QVariant& value, double maximum) + { + if (value.typeId() != QMetaType::Double) + return std::nullopt; + const double number = value.toDouble(); + if (!(number >= 0 && number <= maximum) || number != std::floor(number)) + return std::nullopt; + return static_cast(number); + } + + // Admit resolve's media facts before anything reads them leniently. A + // picker answer carries no media yet; its follow-up resolve is checked. + void admitResolvedMedia(QVariantMap& result) + { + if (result.contains(QStringLiteral("pick"))) + return; + struct Field { + const char *name; + double maximum; // < 0: positive count + }; + const auto admit = [&result](const char *key, std::initializer_list fields) { + const QString name = QLatin1String(key); + if (!result.contains(name)) + return; + const QVariant raw = result.value(name); + if (raw.typeId() != QMetaType::QVariantMap) + throw std::runtime_error("invalid_result"); + QVariantMap map = raw.toMap(); + for (const Field& field : fields) { + const QString fieldName = QLatin1String(field.name); + if (!map.contains(fieldName)) + continue; + const auto value = field.maximum < 0 ? positiveCount(map.value(fieldName)) + : wholeNumber(map.value(fieldName), field.maximum); + if (!value) + throw std::runtime_error("invalid_result"); + map.insert(fieldName, *value); + } + result.insert(name, map); + }; + admit("source", + { { "bitrate", 1e12 }, { "width", 2147483647.0 }, { "height", 2147483647.0 }, { "sizeBytes", -1 }, + { "runtimeTicks", -1 } }); + admit("delivery", { { "bitrate", 1e12 }, { "sizeBytes", -1 }, { "runtimeTicks", -1 } }); + } template void fail(const std::shared_ptr>& promise, const char *code) { promise->setException(std::make_exception_ptr(std::runtime_error(code))); @@ -643,16 +714,20 @@ void ScriptRuntime::cancelLanDiscovery(QString sourceId) QCoro::Task ScriptRuntime::call(QString sourceId, QString method, QVariantMap arguments, QString scope) { const bool data = method == QStringLiteral("dataRead"); + const bool resolve = method == QStringLiteral("resolve"); const bool strict = data || method == QStringLiteral("dataInfo") || method == QStringLiteral("dataWrite") || method == QStringLiteral("dataDelete") || method == QStringLiteral("preferencesRead") || method == QStringLiteral("preferencesWrite"); return d->submit(std::move(sourceId), std::move(method), std::move(arguments), std::move(scope), - [data, strict](const QJSValue& value) { + [data, strict, resolve](const QJSValue& value) { if (strict && (!value.isObject() || value.isArray() || value.isNull() || value.isDate() || value.isRegExp() || value.isError())) throw std::runtime_error("invalid_extension_result"); - return ownScriptValue(value, 50000, 4 * 1024 * 1024, data).toMap(); + QVariantMap result = ownScriptValue(value, 50000, 4 * 1024 * 1024, data).toMap(); + if (resolve) + admitResolvedMedia(result); + return result; }); } diff --git a/src/provider/SourceHub.cpp b/src/provider/SourceHub.cpp index 2ed85f1f..c730ac39 100644 --- a/src/provider/SourceHub.cpp +++ b/src/provider/SourceHub.cpp @@ -276,10 +276,6 @@ class SourceHub::Playback final : public PlaybackSource { { return active() ? active()->mediaOrigin() : QUrl(); } - int playbackParallelRequests() const override - { - return active() ? active()->playbackParallelRequests() : 4; - } QVariantMap playbackNetworkProfile() const override { return active() ? active()->playbackNetworkProfile() : QVariantMap(); @@ -1318,6 +1314,43 @@ QString SourceHub::speedTestDescription() const return descriptions.join(QLatin1Char('\n')); } +QVariantMap SourceHub::speedTestStatus() const +{ + QVariantList accounts; + for (Provider *provider : sources()) { + if (!provider->capabilities().testFlag(Provider::SpeedTest)) + continue; + const auto entry = m_entries.constFind(prefixOf(provider->id())); + if (entry == m_entries.cend()) + continue; + const QVariantMap profile = m_registry->playbackNetworkProfile(provider->id()); + QString moduleId; + for (const ProviderAccount& account : m_registry->accountList()) { + if (account.id == provider->id()) { + moduleId = account.module; + break; + } + } + QVariantList curve; + for (const QVariant& value : profile.value(QStringLiteral("concurrency-samples")).toList()) { + const QVariantMap sample = value.toMap(); + curve.append(QVariantMap { { QStringLiteral("requests"), sample.value(QStringLiteral("requests")).toInt() }, + { QStringLiteral("mbps"), + sample.value(QStringLiteral("capacity-bytes-per-second")).toDouble() * 8.0 / 1'000'000.0 } }); + } + accounts.append(QVariantMap { { QStringLiteral("index"), int(accounts.size()) }, + { QStringLiteral("measuredMbps"), + profile.value(QStringLiteral("measured-bitrate")).toDouble() / 1'000'000.0 }, + { QStringLiteral("accountId"), provider->id() }, { QStringLiteral("moduleId"), moduleId }, + { QStringLiteral("selectedRequests"), profile.value(QStringLiteral("initial-requests"), 1).toInt() }, + { QStringLiteral("laneMbps"), curve }, + { QStringLiteral("running"), entry->speedState == Entry::SpeedState::Running }, + { QStringLiteral("pending"), entry->speedState == Entry::SpeedState::Pending }, + { QStringLiteral("failed"), entry->speedState == Entry::SpeedState::Failed } }); + } + return { { QStringLiteral("pausedForPlayback"), m_playbackActive }, { QStringLiteral("accounts"), accounts } }; +} + QString SourceHub::autoDescription() const { const auto entry = m_entries.constFind(prefixOf(m_playbackAccount)); diff --git a/src/provider/SourceHub.h b/src/provider/SourceHub.h index e9bd97a1..7f81aa43 100644 --- a/src/provider/SourceHub.h +++ b/src/provider/SourceHub.h @@ -150,6 +150,8 @@ class SourceHub final : public Provider, void setPlaybackActive(bool active); void refreshSpeedTests(); QString speedTestDescription() const; + // Automation-safe numeric observations only; never account names or origins. + QVariantMap speedTestStatus() const; // Catalog bool signedIn() const override; diff --git a/src/provider/SpeedTest.cpp b/src/provider/SpeedTest.cpp index 8895a1b1..8246a51d 100644 --- a/src/provider/SpeedTest.cpp +++ b/src/provider/SpeedTest.cpp @@ -2,6 +2,7 @@ #include "ScriptBridge.h" +#include #include #include #include @@ -12,11 +13,55 @@ namespace Spool { +NetworkLaneSelection selectNetworkLanes(const QVariantList& samples, double mediaBitrate, int maxRequests) +{ + double best = 0; + maxRequests = std::clamp(maxRequests, 1, 16); + for (const QVariant& value : samples) { + const auto sample = value.toMap(); + const int requests = sample.value(QStringLiteral("requests")).toInt(); + const double capacity = sample.value(QStringLiteral("capacity-bytes-per-second")).toDouble(); + if (requests >= 1 && requests <= maxRequests && std::isfinite(capacity)) + best = std::max(best, capacity); + } + if (!(best > 0)) + return {}; + // Sub-15% gains are not evidence that another socket is useful, especially + // on fast links where scheduling and connection warmup dominate tiny tests. + double threshold = best * 0.85; + int reason = 1; + if (std::isfinite(mediaBitrate) && mediaBitrate > 0 && mediaBitrate * 1.75 / 8 <= threshold) { + threshold = mediaBitrate * 1.75 / 8; + reason = 2; + } + int selected = 17; + for (const QVariant& value : samples) { + const auto sample = value.toMap(); + const int requests = sample.value(QStringLiteral("requests")).toInt(); + if (requests >= 1 && requests <= maxRequests + && sample.value(QStringLiteral("capacity-bytes-per-second")).toDouble() >= threshold) + selected = std::min(selected, requests); + } + return { selected <= 16 ? selected : 1, reason }; +} + SpeedTest::SpeedTest(ScriptAccess *access, Completion completion, QObject *parent) : QObject(parent) , m_access(access) , m_completion(std::move(completion)) { + m_roundDeadline.setSingleShot(true); + connect(&m_roundDeadline, &QTimer::timeout, this, [this] { + qint64 received = m_round >= 0 ? m_received[m_round] : 0; + for (int i = 0; i < m_count; ++i) { + if (m_lanes[i].reply && !drain(i)) + return; + received += m_lanes[i].received; + } + if (received == 0) + return finish(QStringLiteral("network_error")); + completeRound(); + }); } SpeedTest::~SpeedTest() @@ -26,6 +71,7 @@ SpeedTest::~SpeedTest() void SpeedTest::abort() { + m_roundDeadline.stop(); for (Lane& lane : m_lanes) { if (!lane.reply) continue; @@ -36,7 +82,7 @@ void SpeedTest::abort() } } -void SpeedTest::finish(QString error, qint64 bitrate, int lanes) +void SpeedTest::finish(QString error, qint64 bitrate) { if (m_done) return; @@ -46,11 +92,19 @@ void SpeedTest::finish(QString error, qint64 bitrate, int lanes) QVariantMap result; if (error.isEmpty()) { QVariantList samples; - for (int i = 0; i < 3; ++i) + for (int i = 0; i < 3; ++i) { samples.append(QVariantMap { { QStringLiteral("requests"), 1 << i }, { QStringLiteral("capacity-bytes-per-second"), m_rates[i] / 8 }, - { QStringLiteral("latency-ms"), m_latencies[i] }, { QStringLiteral("elapsed-seconds"), m_durations[i] }, - { QStringLiteral("received-bytes"), 4 * 1024 * 1024 } }); + { QStringLiteral("ttfb-ms"), m_latencies[i] }, { QStringLiteral("elapsed-seconds"), m_durations[i] }, + { QStringLiteral("received-bytes"), m_received[i] } }); + qInfo("streaming probe sample requests=%d capacity_bytes_per_second=%.0f ttfb_ms=%.3f " + "elapsed_seconds=%.3f received_bytes=%lld", + 1 << i, m_rates[i] / 8, m_latencies[i], m_durations[i], static_cast(m_received[i])); + } + const auto selection = selectNetworkLanes(samples, m_targetBitrate); + const int lanes = selection.requests; + qInfo("streaming probe selection requests=%d reason=%d media_bitrate=%.0f", lanes, selection.reason, + m_targetBitrate); QUrl endpoint; endpoint.setScheme(m_request.url().scheme()); endpoint.setHost(m_request.url().host()); @@ -137,11 +191,17 @@ void SpeedTest::round(int lanes, qint64 totalBytes) m_remaining = lanes; m_expected = totalBytes / lanes; m_elapsed.start(); + if (m_round < 0 || m_received[m_round] == 0) + m_pointElapsed.start(); + // Each operating point gets at most 2.5 s (including repeated chunks), + // leaving room for warmup and JS completion inside the operation's 15 s. + m_roundDeadline.start(std::max(1, 2500 - int(m_pointElapsed.elapsed()))); + ++m_transfer; for (int i = 0; i < lanes; ++i) { QString address = m_template; address.replace(QStringLiteral("{bytes}"), QString::number(m_expected)); address.replace(QStringLiteral("{nonce}"), - m_nonce + QLatin1Char('-') + QString::number(m_round + 1) + QLatin1Char('-') + QString::number(i)); + m_nonce + QLatin1Char('-') + QString::number(m_transfer) + QLatin1Char('-') + QString::number(i)); const QUrl url(address, QUrl::StrictMode); if ((url.scheme() != QStringLiteral("http") && url.scheme() != QStringLiteral("https")) || !m_access->allows(url)) @@ -236,34 +296,46 @@ void SpeedTest::finished(int index) lane.reply = nullptr; if (--m_remaining != 0) return; - if (m_round >= 0) { - const qint64 nanoseconds = std::max(1, m_elapsed.nsecsElapsed()); - m_rates[m_round] = static_cast(m_expected * m_count) * 8.0e9 / nanoseconds; - m_durations[m_round] = nanoseconds / 1.0e9; - double latency = 0; - for (int i = 0; i < m_count; ++i) - latency += std::max(0, m_lanes[i].firstByteNs) / 1.0e6; - m_latencies[m_round] = latency / m_count; + completeRound(); +} + +void SpeedTest::completeRound() +{ + const qint64 nanoseconds = std::max(1, m_elapsed.nsecsElapsed()); + qint64 received = 0; + double latency = 0; + for (int i = 0; i < m_count; ++i) { + received += m_lanes[i].received; + latency += (m_lanes[i].firstByteNs >= 0 ? m_lanes[i].firstByteNs : nanoseconds) / 1.0e6; } - if (++m_round == 0) - return round(1, 4 * 1024 * 1024); - if (m_round == 1) - return round(2, 4 * 1024 * 1024); - // Always measure every operating point. The controller needs the complete - // curve to identify negative scaling, not just the winner of a race. - if (m_round == 2) - return round(4, 4 * 1024 * 1024); - int selected = 0; - if (m_targetBitrate > 0) { - while (selected < 2 && m_rates[selected] < m_targetBitrate * 1.75) - ++selected; - if (m_rates[selected] < m_targetBitrate * 1.75) - selected = 0; + abort(); + if (m_round >= 0) { + const double previousDuration = m_durations[m_round]; + m_received[m_round] += received; + m_durations[m_round] += nanoseconds / 1.0e9; + m_latencies[m_round] = (m_latencies[m_round] * previousDuration + latency / m_count * (nanoseconds / 1.0e9)) + / m_durations[m_round]; + m_rates[m_round] = m_received[m_round] * 8.0 / m_durations[m_round]; + // Short transfers get more wall time instead of rewarding a single + // millisecond-scale result. Bound both traffic and duration; Range + // probes repeat the minimum-size resource rather than reading past it. + if (m_durations[m_round] < 0.4 && m_received[m_round] < 64 * 1024 * 1024 && m_pointElapsed.elapsed() < 2500) + return round(m_count, std::min(m_chunkBytes, 64LL * 1024 * 1024 - m_received[m_round])); + } else { + const double predicted = received * 0.4e9 / nanoseconds; + // Power-of-two batches fit common server buffer size classes, while + // each lane still gets exactly the requested bounded payload. + m_chunkBytes = 4 * 1024 * 1024; + if (!m_range) { + while (m_chunkBytes < 32 * 1024 * 1024 && m_chunkBytes * 2 <= predicted) + m_chunkBytes *= 2; + } } - // Without playback demand, one lane is the neutral startup choice; the - // full measured curve is preserved for the adaptive controller. + // Always measure the complete curve, including negative scaling. + if (++m_round < 3) + return round(1 << m_round, m_chunkBytes); const qint64 bitrate = std::llround(*std::max_element(m_rates.cbegin(), m_rates.cend()) * 0.75); - finish({}, bitrate, 1 << selected); + finish({}, bitrate); } } // namespace Spool diff --git a/src/provider/SpeedTest.h b/src/provider/SpeedTest.h index 32b50f02..b8869ade 100644 --- a/src/provider/SpeedTest.h +++ b/src/provider/SpeedTest.h @@ -4,6 +4,7 @@ #include #include #include +#include #include #include @@ -15,6 +16,14 @@ namespace Spool { struct ScriptAccess; +// Minimum measured concurrency within 15% of peak capacity, or sufficient +// playback headroom. Reason: 0 = unmeasured, 1 = capacity, 2 = playback demand. +struct NetworkLaneSelection { + int requests = 1; + int reason = 0; +}; +NetworkLaneSelection selectNetworkLanes(const QVariantList& samples, double mediaBitrate, int maxRequests = 16); + // A worker-local benchmark. Destruction disconnects and aborts every lane; // the owning ScriptOperation supplies the shared 15-second deadline. class SpeedTest final : public QObject { @@ -35,7 +44,8 @@ class SpeedTest final : public QObject { bool drain(int lane); bool checkResponse(int lane); void finished(int lane); - void finish(QString error = {}, qint64 bitrate = 0, int lanes = 1); + void completeRound(); + void finish(QString error = {}, qint64 bitrate = 0); void abort(); ScriptAccess *m_access; @@ -47,12 +57,17 @@ class SpeedTest final : public QObject { std::array m_rates {}; std::array m_latencies {}; std::array m_durations {}; + std::array m_received {}; std::array m_buffer; QElapsedTimer m_elapsed; + QElapsedTimer m_pointElapsed; + QTimer m_roundDeadline; qint64 m_expected = 0; int m_count = 0; int m_remaining = 0; int m_round = -1; + int m_transfer = 0; + qint64 m_chunkBytes = 4 * 1024 * 1024; bool m_done = false; bool m_range = false; double m_targetBitrate = 0; diff --git a/src/providers/local/LocalProvider.cpp b/src/providers/local/LocalProvider.cpp index bc01fd67..e9d81cc3 100644 --- a/src/providers/local/LocalProvider.cpp +++ b/src/providers/local/LocalProvider.cpp @@ -63,10 +63,6 @@ class LocalProvider::Playback final : public PlaybackSource { { return {}; } - int playbackParallelRequests() const override - { - return 1; - } bool signedIn() const override { return true; @@ -513,6 +509,9 @@ PlaybackSession LocalProvider::playbackSession(const QString& itemId) const session.container = entry->item.mediaSources.front().container; session.startTimeTicks = entry->item.resumeTicks; session.runtimeTicks = entry->item.runtimeTicks; + // A local file is delivered as itself. + session.sourceSizeBytes = session.deliverySizeBytes = std::max(0, entry->item.mediaSources.front().size); + session.sourceRuntimeTicks = session.deliveryRuntimeTicks = std::max(0, entry->item.runtimeTicks); return session; } diff --git a/tests/TestRunner.cpp b/tests/TestRunner.cpp index 34502d95..087b5a04 100644 --- a/tests/TestRunner.cpp +++ b/tests/TestRunner.cpp @@ -60,9 +60,9 @@ int invoke(const char *name, int argc, char **argv) QString fixturePath(const char *relativePath) { #ifdef SPOOL_MOBILE_TEST_BUNDLE - const QDir root(mobileFixtureRoot()); + static const QDir root(mobileFixtureRoot()); #else - const QDir root(QStringLiteral(TEST_SOURCE_DIR)); + static const QDir root(QStringLiteral(TEST_SOURCE_DIR)); #endif return root.filePath(QString::fromUtf8(relativePath)); } @@ -306,12 +306,10 @@ void finishReceipt() { if (receiptPath.isEmpty()) return; - const QString targetPath = receiptPath; - receiptPath.clear(); #ifdef SPOOL_MOBILE_TEST_BUNDLE nativeStage("receipt-handler-entry"); #endif - const bool saved = save(targetPath, receipt); + const bool saved = save(receiptPath, receipt); #ifdef SPOOL_MOBILE_TEST_BUNDLE if (diagnosticLogReady) { std::fprintf(stderr, "native stage: receipt-handler-return saved=%d\n", int(saved)); @@ -682,10 +680,6 @@ int main(int argc, char **argv) receipt.insert(QStringLiteral("selectors"), selectors); receipt.insert(QStringLiteral("status"), QStringLiteral("passed")); receipt.insert(QStringLiteral("exitCode"), 0); - finishReceipt(); -#ifdef SPOOL_MOBILE_TEST_BUNDLE - SpoolTests::cleanupMobileFixtures(); -#endif return 0; } #ifdef SPOOL_MOBILE_TEST_BUNDLE @@ -756,9 +750,5 @@ int main(int argc, char **argv) nativeStage("status-assigned"); #endif } - finishReceipt(); -#ifdef SPOOL_MOBILE_TEST_BUNDLE - SpoolTests::cleanupMobileFixtures(); -#endif return result; } diff --git a/tests/app/SettingsControllerTest.cpp b/tests/app/SettingsControllerTest.cpp index aeefd72b..181990e5 100644 --- a/tests/app/SettingsControllerTest.cpp +++ b/tests/app/SettingsControllerTest.cpp @@ -85,6 +85,10 @@ SPOOL_TEST_MAIN("settings-controller") "fresh profile unexpectedly enabled unlimited local-network playback"); require(settings.value(QStringLiteral("playback/forwardCacheSizeMiB")).toInt() == 32, "fresh profile did not use the 32 MB forward cache default"); + require(settings.value(QStringLiteral("playback/threadedStreaming")).toBool() + && settings.value(QStringLiteral("playback/maxStreamingThreads")).toInt() == 4 + && !settings.value(QStringLiteral("playback/forceStreamingThreads")).toBool(), + "fresh profile did not preserve adaptive streaming with a four-request maximum"); require(settings.value(QStringLiteral("playback/rememberSeriesAudioTrack")).toBool(), "fresh profile did not remember per-series audio tracks by default"); require(settings.playerControlTooltipsEnabled(), "fresh profile unexpectedly hid player control tooltips"); @@ -97,6 +101,14 @@ SPOOL_TEST_MAIN("settings-controller") require(QCoro::waitFor(database.loadSettingAsync(QStringLiteral("playback/forwardCacheSizeMiB"))) == QStringLiteral("256"), "forward cache size was not persisted"); + // Hiding dependent controls must not discard their next-playback preferences. + QCoro::waitFor(settings.applyValues({ { QStringLiteral("playback/threadedStreaming"), false }, + { QStringLiteral("playback/maxStreamingThreads"), 99 }, + { QStringLiteral("playback/forceStreamingThreads"), true } }, + Spool::ChangeOrigin::User)); + require(QCoro::waitFor(database.loadSettingAsync(QStringLiteral("playback/maxStreamingThreads"))) + == QStringLiteral("16"), + "streaming request count was not clamped and persisted"); settings.setValue(QStringLiteral("playback/rememberSeriesAudioTrack"), false); require(!settings.value(QStringLiteral("playback/rememberSeriesAudioTrack")).toBool(), "series audio-track retention toggle was not updated"); @@ -193,6 +205,17 @@ SPOOL_TEST_MAIN("settings-controller") require(restored.audioDelayMs() == 120, "persisted global desktop audio delay was not restored"); require(restored.value(QStringLiteral("playback/forwardCacheSizeMiB")).toString() == QStringLiteral("256"), "persisted forward cache size was not restored"); + require(!restored.value(QStringLiteral("playback/threadedStreaming")).toBool() + && restored.value(QStringLiteral("playback/maxStreamingThreads")).toInt() == 16 + && restored.value(QStringLiteral("playback/forceStreamingThreads")).toBool(), + "disabled threaded streaming lost its persisted request preferences"); + QCoro::waitFor(restored.applyValues({ { QStringLiteral("playback/threadedStreaming"), true }, + { QStringLiteral("playback/maxStreamingThreads"), 0 } }, + Spool::ChangeOrigin::User)); + require(restored.value(QStringLiteral("playback/threadedStreaming")).toBool() + && restored.value(QStringLiteral("playback/maxStreamingThreads")).toInt() == 1 + && restored.value(QStringLiteral("playback/forceStreamingThreads")).toBool(), + "re-enabling threaded streaming lost force mode or failed to clamp the minimum request count"); require(!restored.value(QStringLiteral("playback/rememberSeriesAudioTrack")).toBool(), "series audio-track retention toggle was not restored"); require(!restored.remoteControlTargetEnabled(), "persisted remote target toggle was not restored"); diff --git a/tests/app/TrickplayTest.cpp b/tests/app/TrickplayTest.cpp index 138ba05c..f59e078a 100644 --- a/tests/app/TrickplayTest.cpp +++ b/tests/app/TrickplayTest.cpp @@ -368,6 +368,8 @@ SPOOL_TEST_MAIN("trickplay") }); info.thumbnailCount = 200; info.urlTemplate = QStringLiteral("http://127.0.0.1:%1/sheet/{index}.jpg").arg(server.serverPort()); + QList fetching; + QObject::connect(&service, &TrickplayService::fetchingChanged, [&](bool active) { fetching.append(active); }); service.setSession(info, 0); color(frame(service, 0), Qt::green); const QString delayedId = QUrl(service.frame(100).value("url").toString()).path().mid(1); @@ -375,11 +377,13 @@ SPOOL_TEST_MAIN("trickplay") bool interruptedFinished = false; QObject::connect(interrupted.get(), &QQuickImageResponse::finished, [&] { interruptedFinished = true; }); waitUntil([&] { return secondSheetRequests == 1; }); + require(!fetching.isEmpty() && fetching.last(), "an in-flight preview fetch is reported as network activity"); color(frame(service, 25), Qt::blue); // CPU-cached sheet, not a cached frame. waitUntil([&] { return interruptedFinished; }); require(!interrupted->errorString().isEmpty(), "returning to a cached sheet supersedes its pending fetch"); waitUntil([&] { return !delayed || delayed->state() == QAbstractSocket::UnconnectedState; }, "cached-sheet return must abort the stale HTTP transfer"); + require(!fetching.last(), "an aborted preview fetch ends its network activity"); color(frame(service, 100), Qt::red); color(frame(service, 26), Qt::green); // The encoded cache must not be poisoned. require(secondSheetRequests == 2, "cancelled sheet is fetched anew, never misfiled as another sheet"); @@ -403,6 +407,9 @@ SPOOL_TEST_MAIN("trickplay") serve(delayed, secondSheet); waitUntil([&] { return currentFinished; }); require(currentResponse->errorString().isEmpty(), "latest selection completes despite late provider delivery"); + require(!fetching.last(), "a completed preview fetch ends its network activity"); + for (qsizetype n = 1; n < fetching.size(); ++n) + require(fetching[n] != fetching[n - 1], "network activity is reported only on changes"); std::unique_ptr currentTexture(currentResponse->textureFactory()); require(bool(currentTexture), "latest selection delivers its texture"); color(currentTexture->image(), Qt::red); diff --git a/tests/automation/LocalControlProtocolTest.cpp b/tests/automation/LocalControlProtocolTest.cpp index 957fb5ef..3bee395d 100644 --- a/tests/automation/LocalControlProtocolTest.cpp +++ b/tests/automation/LocalControlProtocolTest.cpp @@ -11,6 +11,7 @@ #include #include #include +#include #include #include #include @@ -21,6 +22,8 @@ #include #include #ifdef Q_OS_UNIX +#include +#include #include #endif @@ -194,5 +197,166 @@ SPOOL_TEST_MAIN("spoolet-protocol") require(code(reply) == QStringLiteral("timeout") && duration < 1000, "silent peer cannot hang the CLI"); } } +#ifdef Q_OS_UNIX + // Exercise the same script used by remote CLI discovery and diagnose.sh. + const QString discoveryPath = temporary.filePath(QStringLiteral("remote.json")); + QFile discovery(discoveryPath); + const QByteArray discoveryBytes = QJsonDocument( + QJsonObject { { "instance", "remote-test" }, { "transport", "tcp" }, { "endpoint", "127.0.0.1" }, + { "port", 12345 }, { "token", QString(64, QLatin1Char('b')) } }) + .toJson(QJsonDocument::Compact); + require(discovery.open(QIODevice::WriteOnly) && discovery.write(discoveryBytes) == discoveryBytes.size(), + "create remote capability fixture"); + discovery.close(); + require(QFile::setPermissions(discoveryPath, QFileDevice::ReadOwner | QFileDevice::WriteOwner), + "remote capability is owner-only"); + const auto discover = [&](const QString& path) { + QProcess process; + process.start(QStringLiteral("sh"), + { QStringLiteral(TEST_SOURCE_DIR "/src/automation/RemoteDiscovery.sh"), QStringLiteral("descriptors"), + QString(), path }); + require(process.waitForFinished(2000) && process.exitCode() == 0, + "shared remote discovery is bounded and completes"); + return process.readAllStandardOutput().trimmed(); + }; + require(discover(discoveryPath) == discoveryBytes, "shared discovery reads the explicit private remote capability"); + require( + QFile::setPermissions(discoveryPath, QFileDevice::ReadOwner | QFileDevice::WriteOwner | QFileDevice::ReadOther), + "make remote capability publicly readable"); + require(discover(discoveryPath).isEmpty(), "remote discovery rejects publicly readable capabilities"); + require(QFile::setPermissions(discoveryPath, QFileDevice::ReadOwner | QFileDevice::WriteOwner), + "restore private remote capability"); + const QString remoteLink = temporary.filePath(QStringLiteral("remote-link.json")); + require(::symlink(QFile::encodeName(discoveryPath).constData(), QFile::encodeName(remoteLink).constData()) == 0, + "create remote descriptor symlink"); + require(discover(remoteLink).isEmpty(), "remote discovery rejects descriptor symlinks"); + if (::geteuid() == 0) { + const QString sandbox = temporary.filePath(QStringLiteral("app-sandbox")); + require(QDir().mkdir(sandbox) + && QFile::setPermissions( + sandbox, QFileDevice::ReadOwner | QFileDevice::WriteOwner | QFileDevice::ExeOwner), + "create private app-owned descriptor directory"); + const QString sandboxDescriptor = QDir(sandbox).filePath(QStringLiteral("app.json")); + QFile sandboxFile(sandboxDescriptor); + require(sandboxFile.open(QIODevice::WriteOnly) && sandboxFile.write(discoveryBytes) == discoveryBytes.size(), + "create app sandbox capability"); + sandboxFile.close(); + require(QFile::setPermissions(sandboxDescriptor, QFileDevice::ReadOwner | QFileDevice::WriteOwner) + && ::chown(QFile::encodeName(sandboxDescriptor).constData(), 65534, 65534) == 0 + && ::chown(QFile::encodeName(sandbox).constData(), 65534, 65534) == 0, + "stage the real root-to-app-UID ownership boundary"); + require(discover(sandboxDescriptor) == discoveryBytes, + "root can discover an app-owned private capability without changing ownership"); + require(::chown(QFile::encodeName(sandboxDescriptor).constData(), 65533, 65533) == 0, + "stage mismatched descriptor and registry owners"); + require(discover(sandboxDescriptor).isEmpty(), + "root discovery still rejects descriptor and registry owner mismatch"); + require(::chown(QFile::encodeName(sandboxDescriptor).constData(), 0, 0) == 0 + && ::chown(QFile::encodeName(sandbox).constData(), 0, 0) == 0, + "restore test-created sandbox ownership"); + } else { + std::cout << "SKIP subcase: root-to-app-UID discovery requires uid0\n"; + } + // Fake only the external SSH peer; production owns framing and child lifecycle. + const QString sshPath = temporary.filePath(QStringLiteral("ssh")); + QFile ssh(sshPath); + require(ssh.open(QIODevice::WriteOnly), "create external SSH transport fixture"); + const QByteArray fixture = R"PY(#!/usr/bin/env python3 +import json, os, select, sys, time +token = "b" * 64 +assert all(token not in argument for argument in sys.argv) +mode = os.environ.get("SPOOL_TEST_SSH_MODE", "") +if mode == "silent": + with open(os.environ["SPOOL_TEST_SSH_PID"], "w") as file: + file.write(str(os.getpid())) + time.sleep(20) +elif mode == "failure": + sys.stderr.write(token) + sys.exit(1) +elif "-W" not in sys.argv: + sys.stdin.buffer.read() + print(json.dumps(dict(instance="remote-test", transport="tcp", endpoint="127.0.0.1", port=12345, token=token))) +else: + assert sys.argv[sys.argv.index("-W") + 1] == "127.0.0.1:12345" + request = json.loads(sys.stdin.buffer.readline()) + assert request["token"] == token + if mode == "async": + # Like an asynchronous server operation, cancellation follows peer EOF. + readable, _, _ = select.select([sys.stdin.buffer], [], [], 0.15) + if readable and sys.stdin.buffer.read(1) == b"": + sys.exit(2) + print(json.dumps(dict(id="wrong" if mode == "wrong-id" else request["id"], ok=True, + result=dict(command=request["command"], args=request["args"], authenticated=True)))) +)PY"; + require(ssh.write(fixture) == fixture.size(), "write complete transport fixture"); + ssh.close(); + require(QFile::setPermissions(sshPath, QFileDevice::ReadOwner | QFileDevice::WriteOwner | QFileDevice::ExeOwner), + "external SSH fixture is executable"); + const QByteArray previousPath = qgetenv("PATH"); + qputenv("PATH", temporary.path().toUtf8() + ':' + previousPath); + QJsonObject remoteDescriptor { { "instance", "remote-test" }, { "transport", "tcp" }, { "endpoint", "127.0.0.1" }, + { "port", 12345 }, { "token", QString(64, QLatin1Char('b')) } }; + const auto remote = [&](int timeoutMs = 2000) { + return Spool::LocalControl::requestSsh( + QStringLiteral("root@device.test"), remoteDescriptor, QStringLiteral("status"), {}, timeoutMs); + }; + require(remote()["result"].toObject()["authenticated"].toBool(), + "SSH stdio framing authenticates using stdin, never argv"); + qputenv("SPOOL_TEST_SSH_MODE", "async"); + require(remote()["result"].toObject()["authenticated"].toBool(), + "forwarded request remains open until the asynchronous reply is complete"); + qputenv("SPOOL_TEST_SSH_MODE", "wrong-id"); + require(code(remote()) == QStringLiteral("invalid_response"), "SSH replies require matching request identity"); + qputenv("SPOOL_TEST_SSH_MODE", "failure"); + const auto failed = remote(); + require( + code(failed) == QStringLiteral("ssh_failed") && !QJsonDocument(failed).toJson().contains(QByteArray(64, 'b')), + "SSH stderr containing a capability is not exposed in errors"); + qunsetenv("SPOOL_TEST_SSH_MODE"); + for (const QString& host : { QStringLiteral("-oProxyCommand=bad"), QStringLiteral("root@host;bad"), + QStringLiteral("host\nbad"), QStringLiteral("root@host name") }) { + require(code(Spool::LocalControl::requestSsh(host, remoteDescriptor, QStringLiteral("status"), {}, 100)) + == QStringLiteral("ssh_failed"), + "SSH destination cannot inject shell syntax or options"); + } + const QString pidFile = temporary.filePath(QStringLiteral("ssh.pid")); + qputenv("SPOOL_TEST_SSH_PID", pidFile.toUtf8()); + qputenv("SPOOL_TEST_SSH_MODE", "silent"); + QElapsedTimer sshDeadline; + sshDeadline.start(); + require(code(remote(1000)) == QStringLiteral("ssh_failed") && sshDeadline.elapsed() < 2500, + "silent SSH transport has a bounded deadline"); + QFile pidInput(pidFile); + require(pidInput.open(QIODevice::ReadOnly), "timed-out SSH peer started"); + const int childPid = pidInput.readAll().trimmed().toInt(); + require(childPid > 0 && ::kill(childPid, 0) == -1 && errno == ESRCH, "timed-out SSH child is killed and reaped"); + qunsetenv("SPOOL_TEST_SSH_MODE"); + qunsetenv("SPOOL_TEST_SSH_PID"); + const auto cli = [&](QStringList arguments) { + QProcess process; + process.start(QStringLiteral(SPOOL_TEST_SPOOLET), arguments); + require(process.waitForFinished(5000), "remote CLI completes within its deadline"); + const QByteArray output = process.readAllStandardOutput(); + require(!output.contains(QByteArray(64, 'b')) && process.readAllStandardError().isEmpty(), + "remote CLI never prints the capability or SSH stderr"); + return QJsonDocument::fromJson(output).object(); + }; + const QStringList target { QStringLiteral("--host"), QStringLiteral("root@device.test"), + QStringLiteral("--instance"), QStringLiteral("remote-test") }; + const auto measured = cli(target + QStringList { QStringLiteral("speed-test") }); + require(measured["ok"].toBool() && measured["result"].toObject()["command"] == "speed-test" + && measured["result"].toObject()["args"].toObject()["refresh"].toBool(), + "remote speed-test starts measurement through the real CLI"); + const auto status = cli(target + QStringList { QStringLiteral("speed-test"), QStringLiteral("status") }); + require(status["ok"].toBool() && !status["result"].toObject()["args"].toObject()["refresh"].toBool(), + "remote speed-test status does not restart measurement"); + require(!cli({ "--host", "root@device.test", "--descriptor", "relative.json", "status" })["ok"].toBool(), + "remote explicit descriptor must be an absolute remote path"); + require(!cli({ "--host", "root@device.test", "--instance", "remote-test", "--descriptor", "/private/test.json", + "status" })["ok"] + .toBool(), + "instance and explicit remote descriptor remain mutually exclusive"); + qputenv("PATH", previousPath); +#endif return 0; } diff --git a/tests/cache/DatabaseManagerTest.cpp b/tests/cache/DatabaseManagerTest.cpp index 2f8fdbf1..0bef8999 100644 --- a/tests/cache/DatabaseManagerTest.cpp +++ b/tests/cache/DatabaseManagerTest.cpp @@ -149,7 +149,7 @@ SPOOL_TEST_MAIN("database-manager") message); }; requireLegacyAccount(database, "legacy sign-in should be readable with its token"); -#if !defined(Q_OS_WIN) && !defined(SPOOL_APPLE_MOBILE) +#ifndef Q_OS_WIN const QFileInfo credentialInfo(QDir(credentialPath).entryInfoList(QDir::Files).front()); require((credentialInfo.permissions() & (QFileDevice::ReadGroup | QFileDevice::WriteGroup | QFileDevice::ReadOther | QFileDevice::WriteOther)) @@ -290,7 +290,6 @@ SPOOL_TEST_MAIN("database-manager") readOnly.shutdown(); QFile::setPermissions(databasePath, QFileDevice::ReadOwner | QFileDevice::WriteOwner); QFile::setPermissions(statePath, QFileDevice::ReadOwner | QFileDevice::WriteOwner); - CredentialStore::remove(QStringLiteral("profile")); return 0; } diff --git a/tests/platform/MobileTestFixtures.cpp b/tests/platform/MobileTestFixtures.cpp index dba48ca2..4b5879a6 100644 --- a/tests/platform/MobileTestFixtures.cpp +++ b/tests/platform/MobileTestFixtures.cpp @@ -10,7 +10,6 @@ namespace SpoolTests { namespace { - QTemporaryDir *extractedDirectory = nullptr; QString extractedRoot; } @@ -23,9 +22,8 @@ const QString& mobileFixtureRoot() bool prepareMobileFixtures() { - if (!extractedDirectory) - extractedDirectory = new QTemporaryDir(QDir::tempPath() + QStringLiteral("/spool-test-fixtures-XXXXXX")); - if (!extractedDirectory->isValid()) { + static QTemporaryDir directory(QDir::tempPath() + QStringLiteral("/spool-test-fixtures-XXXXXX")); + if (!directory.isValid()) { std::fprintf(stderr, "mobile tests: cannot create isolated fixture directory\n"); return false; } @@ -33,21 +31,14 @@ bool prepareMobileFixtures() QDirIterator fixtures(prefix, QDir::Files, QDirIterator::Subdirectories); while (fixtures.hasNext()) { const QString source = fixtures.next(); - const QString destination = extractedDirectory->filePath(source.mid(prefix.size())); + const QString destination = directory.filePath(source.mid(prefix.size())); if (!QDir().mkpath(QFileInfo(destination).absolutePath()) || !QFile::copy(source, destination)) { std::fprintf(stderr, "mobile tests: cannot extract packaged fixture\n"); return false; } } - extractedRoot = extractedDirectory->path(); + extractedRoot = directory.path(); return true; } -void cleanupMobileFixtures() -{ - extractedRoot.clear(); - delete extractedDirectory; - extractedDirectory = nullptr; -} - } // namespace SpoolTests diff --git a/tests/platform/MobileTestFixtures.h b/tests/platform/MobileTestFixtures.h index c89773d6..8a143d83 100644 --- a/tests/platform/MobileTestFixtures.h +++ b/tests/platform/MobileTestFixtures.h @@ -7,7 +7,6 @@ namespace SpoolTests { // Materialize packaged fixtures before a selector constructs its application. // Tests use the same filesystem paths on desktop and in the mobile sandbox. bool prepareMobileFixtures(); -void cleanupMobileFixtures(); const QString& mobileFixtureRoot(); } // namespace SpoolTests diff --git a/tests/player/MpvOptionProfileTest.cpp b/tests/player/MpvOptionProfileTest.cpp index 787961ff..d91f138d 100644 --- a/tests/player/MpvOptionProfileTest.cpp +++ b/tests/player/MpvOptionProfileTest.cpp @@ -164,6 +164,7 @@ SPOOL_TEST_MAIN("mpv-option-profile") require(valueFor(desktop, "curl-enabled") == "yes", "desktop should use the libcurl stream backend"); require(valueFor(desktop, "curl-buffer-size") == "4194304", "desktop should use a 4 MiB network ring"); require(valueFor(desktop, "curl-max-request-size") == "1048576", "desktop should issue 1 MiB ranges"); + require(valueFor(desktop, "curl-read-size") == "262144", "desktop should read 256 KiB per curl callback"); require(valueFor(desktop, "curl-parallel-requests") == "1", "desktop should default to one range request"); require(valueFor(desktop, "network-timeout") == "15", "a silent connection should be retried after 15 s"); require( @@ -364,6 +365,7 @@ SPOOL_TEST_MAIN("mpv-option-profile") require(valueFor(webOSPcm, "curl-enabled") == "yes", "webOS should use the libcurl stream backend"); require(valueFor(webOSPcm, "curl-buffer-size") == "2097152", "webOS should use a 2 MiB network ring"); require(valueFor(webOSPcm, "curl-max-request-size") == "524288", "webOS should issue 512 KiB ranges"); + require(valueFor(webOSPcm, "curl-read-size") == "131072", "webOS should read 128 KiB per curl callback"); require(valueFor(webOSPcm, "curl-parallel-requests") == "1", "webOS should default to one range request"); require( valueFor(webOSPcm, "gpu-shader-cache-dir").isEmpty(), "webOS should not configure the desktop shader cache"); diff --git a/tests/player/PlayQueueControllerTest.cpp b/tests/player/PlayQueueControllerTest.cpp index dea20978..2dde4def 100644 --- a/tests/player/PlayQueueControllerTest.cpp +++ b/tests/player/PlayQueueControllerTest.cpp @@ -50,10 +50,6 @@ class EpisodeSource final : public PlaybackSource { { return {}; } - int playbackParallelRequests() const override - { - return 1; - } bool signedIn() const override { return true; diff --git a/tests/player/PlayerControllerTest.cpp b/tests/player/PlayerControllerTest.cpp index 4c3d3eb3..90ee6b75 100644 --- a/tests/player/PlayerControllerTest.cpp +++ b/tests/player/PlayerControllerTest.cpp @@ -106,10 +106,6 @@ class DelayedPlaybackSource final : public PlaybackSource { { return m_source->mediaOrigin(); } - int playbackParallelRequests() const override - { - return m_source->playbackParallelRequests(); - } bool signedIn() const override { return m_source->signedIn(); @@ -350,6 +346,35 @@ void watchedStopPolicy(const QString& directory, NativeAppWindow& window) } } +void transportLoadLifecycle(const QString& directory, NativeAppWindow& window) +{ + PlayerController player(&window, nullptr, nullptr, {}); + player.setMpvConfigPolicy({ MpvConfigPolicy::Mode::Custom, directory }); + PlaybackSession rejected = audioSession(directory, QStringLiteral("rejected-policy"), 8); + rejected.sourceBitrate = 1'000'000'000'001LL; + player.play(rejected); + waitUntil([&] { return !player.sessionActive() && !player.errorText().isEmpty(); }, + "a rejected transport configure ends the pending load"); + require(!player.fileLoaded() && player.errorText().contains(QStringLiteral("streaming policy")), + "failed policy installation cannot load a playable file"); + + const PlaybackSession replacement = audioSession(directory, QStringLiteral("replacement-policy"), 8); + player.play(rejected); + player.play(replacement); + waitUntil([&] { return player.fileLoaded() && player.positionSeconds() > 0.1; }, + "a current successful configure releases the replacement load"); + require(player.title() == replacement.title && player.errorText().isEmpty(), + "a superseded configure failure cannot reject a replacement playback"); + player.stop(); + + player.play(replacement); + player.stop(); + processFor(500); + require(!player.sessionActive() && !player.fileLoaded(), + "stopping a pending configure cannot be undone by its acknowledgement"); + player.teardownMpv(); +} + #if !defined(Q_OS_ANDROID) && !defined(SPOOL_APPLE_MOBILE) void localPlaylistLifecycle(const QString& directory, NativeAppWindow& window) { @@ -463,6 +488,7 @@ SPOOL_TEST_MAIN("player-controller") player.stop(); player.teardownMpv(); watchedStopPolicy(directory.path(), window); + transportLoadLifecycle(directory.path(), window); #if !defined(Q_OS_ANDROID) && !defined(SPOOL_APPLE_MOBILE) localPlaylistLifecycle(directory.path(), window); #endif diff --git a/tests/providers/ArtworkAuthenticationTest.cpp b/tests/providers/ArtworkAuthenticationTest.cpp index b1d678cb..51ee1cf1 100644 --- a/tests/providers/ArtworkAuthenticationTest.cpp +++ b/tests/providers/ArtworkAuthenticationTest.cpp @@ -179,6 +179,9 @@ export function createSource(config) { "preview URLs do not expose credentials to QML"); ArtworkService artwork(directory.filePath("artwork"), 1024 * 1024, 1024 * 1024, 1, nullptr); artwork.setSource(&hub); + QList fetchingTransitions; + QObject::connect( + &artwork, &ArtworkService::fetchingChanged, &app, [&](bool active) { fetchingTransitions.append(active); }); const auto fetch = [&](const QString& url, bool success) { std::unique_ptr response( artwork.requestImageResponse(QString::fromLatin1(QUrl::toPercentEncoding(url)), {})); @@ -203,6 +206,18 @@ export function createSource(config) { require(fetch(alice.second, true).pixelColor(8, 8) == QColor(Qt::green), "cached previews retain their account partition"); require(requests == 2 && unauthorized == 0, "valid previews carry headers and reuse their own memory cache"); + require(fetchingTransitions == QList { true, false, true, false } && !artwork.fetching(), + "network activity brackets real fetches but not a credential-partitioned memory-cache hit"); + { + QTcpServer stalled; + require(stalled.listen(QHostAddress::LocalHost), "stalled artwork origin listens"); + const QString root = QStringLiteral("http://127.0.0.1:%1/").arg(stalled.serverPort()); + artwork.prefetch({ root + "first.png", root + "second.png" }); + waitUntil([&] { return artwork.fetching() && stalled.hasPendingConnections(); }, + "prefetch network traffic is visible while responses are pending"); + artwork.cancelPrefetches(); + waitUntil([&] { return !artwork.fetching(); }, "aborting every prefetch releases network activity"); + } { std::unique_ptr cancelled( artwork.requestImageResponse(QString::fromLatin1(QUrl::toPercentEncoding(alice.second)), {})); diff --git a/tests/providers/ProviderRegistryTest.cpp b/tests/providers/ProviderRegistryTest.cpp index f934a1f0..f15d6125 100644 --- a/tests/providers/ProviderRegistryTest.cpp +++ b/tests/providers/ProviderRegistryTest.cpp @@ -664,13 +664,9 @@ export function createSource(config, sourceHost) { auto withoutStorage = enabledOffers; withoutStorage.remove("settingsStorage"); QCoro::waitFor(registry.callSource(extendedAlice, "offers", { { "capabilities", withoutStorage } })); - waitUntil([&] { return !registry.hasCapability(extendedAlice, "settingsStorage"); }, - "withdrawing settingsStorage reaches the registry before cache reset"); QCoro::waitFor(registry.callSource(extendedAlice, "dataFixture", { { "maximum", 32 }, { "conditional", true }, { "document", QVariantMap { { "found", false } } } })); QCoro::waitFor(registry.callSource(extendedAlice, "offers", { { "capabilities", enabledOffers } })); - waitUntil([&] { return registry.hasCapability(extendedAlice, "settingsStorage"); }, - "restoring settingsStorage reaches the registry before reading dataInfo"); require(QCoro::waitFor(registry.callSource(extendedAlice, "dataInfo")).value("maxBytes").toInt() == 32 && QCoro::waitFor(registry.callSource(extendedAlice, "dataFixture")).value("infoCalls").toInt() == 2, "capability loss invalidates the generation-owned storage metadata cache"); @@ -704,13 +700,9 @@ export function createSource(config, sourceHost) { == QLocale::languageToCode(QLocale::French, QLocale::ISO639Part2), "a supported writable preference survives a worker read/write/read cycle"); QCoro::waitFor(registry.callSource(extendedAlice, "offers", { { "capabilities", withoutStorage } })); - waitUntil([&] { return !registry.hasCapability(extendedAlice, "settingsStorage"); }, - "withdrawing settingsStorage reaches the registry before updating dataFixture limits"); QCoro::waitFor( registry.callSource(extendedAlice, "dataFixture", { { "maximum", 65536 }, { "conditional", false } })); QCoro::waitFor(registry.callSource(extendedAlice, "offers", { { "capabilities", enabledOffers } })); - waitUntil([&] { return registry.hasCapability(extendedAlice, "settingsStorage"); }, - "restoring settingsStorage reaches the registry before writing wideDocument"); QVariantList wideDocument; wideDocument.reserve(20000); for (int index = 0; index < 20000; ++index) diff --git a/tests/providers/ScriptRuntimeNetworkTest.cpp b/tests/providers/ScriptRuntimeNetworkTest.cpp index 212dbc88..21d90d08 100644 --- a/tests/providers/ScriptRuntimeNetworkTest.cpp +++ b/tests/providers/ScriptRuntimeNetworkTest.cpp @@ -390,16 +390,10 @@ SPOOL_TEST_MAIN("script-runtime-network") QCoro::waitFor(runtime.addSource("account", {}, {}, capabilities)); QCoro::waitFor(runtime.addSource("baseline", {}, { QUrl(origin) })); rejects(runtime.call("baseline", "discover", { { "port", 7359 }, { "timeout", 100 } }), "unsupported_capability"); -#if defined(SPOOL_APPLE_MOBILE) - rejects(runtime.call("draft", "discover", - { { "port", 7359 }, { "message", "spool-discovery-contract-test" }, { "timeout", 100 } }), - "discovery_unavailable"); -#else const auto udp = QCoro::waitFor(runtime.call( "draft", "discover", { { "port", 7359 }, { "message", "spool-discovery-contract-test" }, { "timeout", 100 } })); require( udp.value("array").toBool(), "UDP discovery publishes an ordinary JavaScript array usable by provider code"); -#endif const auto http = [&](QString source, QString path, QVariantMap options = {}) { return runtime.call(source, "http", { { "url", origin + path }, { "options", options } }); }; diff --git a/tests/providers/ScriptRuntimeTest.cpp b/tests/providers/ScriptRuntimeTest.cpp index 40d05181..a0a803ad 100644 --- a/tests/providers/ScriptRuntimeTest.cpp +++ b/tests/providers/ScriptRuntimeTest.cpp @@ -17,6 +17,7 @@ #include #include #include +#include namespace { void require(bool condition, const char *message) @@ -74,6 +75,44 @@ SPOOL_TEST_MAIN("script-runtime") require(events == QList { QVariantMap { { "capabilities", newOffer } } }, "queued capability events from a removed generation cannot change a replacement account"); } + { + // Resolve's media facts are admitted at the script boundary: whole + // numbers or unsigned decimal strings, normalized, never coerced. + ScriptRuntime runtime(SpoolTests::fixturePath("tests/providers/fixtures/resolve-metadata.mjs"), QVariantMap {}); + QCoro::waitFor(runtime.addSource("media", {}, {})); + const auto resolve = [&runtime](const QVariantMap& result) { + return runtime.call("media", "resolve", { { "result", result } }); + }; + const QVariantMap admitted = QCoro::waitFor(resolve({ { "url", "http://127.0.0.1/a.mkv" }, + { "source", + QVariantMap { { "bitrate", 80000000 }, { "width", 3840 }, { "height", 2160 }, + { "sizeBytes", "68719476736" }, { "runtimeTicks", 72000000000.0 } } }, + { "delivery", QVariantMap { { "bitrate", 0 }, { "sizeBytes", 5000000000.0 } } } })); + const QVariantMap source = admitted.value("source").toMap(); + const QVariantMap delivery = admitted.value("delivery").toMap(); + require(source.value("sizeBytes").typeId() == QMetaType::LongLong + && source.value("sizeBytes").toLongLong() == 68719476736LL + && source.value("runtimeTicks").toLongLong() == 72000000000LL + && source.value("bitrate").toLongLong() == 80000000 && delivery.value("bitrate").toLongLong() == 0 + && delivery.value("sizeBytes").toLongLong() == 5000000000LL, + "resolve normalizes sizes, durations and bitrates losslessly beyond 32 bits"); + for (const QVariant& bad : QVariantList { true, 1.5, 0, -5, "-5", "12a", "", "99999999999999999999", + QVariant::fromValue(nullptr), QVariantList { 1 } }) { + rejects(resolve({ { "url", "u" }, { "source", QVariantMap { { "sizeBytes", bad } } } }), + "a size must be a positive whole number or unsigned decimal string"); + rejects(resolve({ { "url", "u" }, { "delivery", QVariantMap { { "runtimeTicks", bad } } } }), + "a delivered duration must be a positive whole number or unsigned decimal string"); + } + rejects(resolve({ { "url", "u" }, { "delivery", QVariantMap { { "bitrate", 2e12 } } } }), + "a delivered bitrate above 1 Tbit/s is rejected"); + rejects(resolve({ { "url", "u" }, { "source", QVariantMap { { "width", 1.5 } } } }), + "dimensions stay whole numbers"); + rejects(resolve({ { "url", "u" }, { "delivery", "fast" } }), "delivery must be an object"); + rejects(resolve({ { "url", "u" }, { "source", QVariantList {} } }), "source must be an object"); + const QVariantMap picked + = QCoro::waitFor(resolve({ { "pick", QVariantMap { { "quality", "4k" } } }, { "source", "not yet" } })); + require(picked.contains("pick"), "a picker answer is admitted until its follow-up resolve"); + } QTcpServer server; require(server.listen(QHostAddress::LocalHost), "fixture server listens"); const QString origin = QStringLiteral("http://127.0.0.1:%1").arg(server.serverPort()); @@ -129,7 +168,7 @@ SPOOL_TEST_MAIN("script-runtime") if (target.path().startsWith(QStringLiteral("/speed"))) { const QUrlQuery query(target); const int bytes = query.queryItemValue(QStringLiteral("bytes")).toInt(); - require(bytes > 0 && bytes <= 4 * 1024 * 1024, "benchmark requests bounded samples"); + require(bytes > 0 && bytes <= 32 * 1024 * 1024, "benchmark requests bounded samples"); speedSizes.append(bytes); const QString nonce = query.queryItemValue(QStringLiteral("nonce")); const auto requireNonce = [&](bool condition, const char *message) { @@ -191,12 +230,17 @@ SPOOL_TEST_MAIN("script-runtime") socket->disconnectFromHost(); return; } - // First-byte warmup exceeds 20 ms; larger samples take longer, - // so simultaneous lanes have a real wall-clock benefit. - QTimer::singleShot(40 + bytes / (32 * 1024), socket, [socket, bytes] { - socket->write("HTTP/1.1 200 OK\r\nContent-Length: " + QByteArray::number(bytes) + // Generated endpoints may return a pooled size-class buffer + // instead of trimming the rented allocation to the request. + int responseBytes = 1; + while (responseBytes < bytes) + responseBytes *= 2; + // Warmup is quick enough to exercise adaptive larger batches; + // measured larger samples still have a real parallel benefit. + QTimer::singleShot(20 + bytes / (32 * 1024), socket, [socket, responseBytes] { + socket->write("HTTP/1.1 200 OK\r\nContent-Length: " + QByteArray::number(responseBytes) + "\r\nSet-Cookie: speed=private\r\nConnection: close\r\n\r\n"); - socket->write(QByteArray(bytes, 'x')); + socket->write(QByteArray(responseBytes, 'x')); socket->disconnectFromHost(); }); return; @@ -333,22 +377,40 @@ SPOOL_TEST_MAIN("script-runtime") speedResponsiveness.stop(); waitForSpeedAbort(); require(measurement.value("bitrate").toLongLong() > 0, "successful benchmark returns a usable streaming ceiling"); - require(measurement.value("parallelRequests").toInt() == 1, - "without playback demand a benchmark does not blindly select maximum throughput"); + const int selectedRequests = measurement.value("parallelRequests").toInt(); + double bestCapacity = 0; + double selectedCapacity = 0; const QVariantList curve = measurement.value("concurrency-samples").toList(); require(curve.size() == 3, "native result preserves every concurrency operating point"); for (int index = 0; index < 3; ++index) { const auto sample = curve[index].toMap(); const double seconds = sample.value("elapsed-seconds").toDouble(); const double rate = sample.value("capacity-bytes-per-second").toDouble(); - const double latencyMs = sample.value("latency-ms").toDouble(); - require(sample.value("requests").toInt() == (1 << index) - && sample.value("received-bytes").toLongLong() == 4194304 && seconds > 0 && latencyMs >= 35 - && latencyMs <= seconds * 1000 && std::abs(rate * seconds - 4194304.0) < 1, - "per-concurrency raw capacity divides actual payload by full measured wall time including TTFB"); + const double latencyMs = sample.value("ttfb-ms").toDouble(); + require(sample.value("requests").toInt() == (1 << index) && sample.value("received-bytes").toLongLong() > 0 + && sample.value("received-bytes").toLongLong() <= 64 * 1024 * 1024 && seconds > 0 && latencyMs >= 35 + && latencyMs <= seconds * 1000 + && std::abs(rate * seconds - sample.value("received-bytes").toDouble()) < 1, + "per-concurrency raw capacity accounts actual bounded payload and full wall time including TTFB"); + require(seconds >= 0.4 || sample.value("received-bytes").toLongLong() == 64 * 1024 * 1024, + "fast transfers accumulate a useful measurement duration rather than one noisy tiny sample"); + bestCapacity = std::max(bestCapacity, rate); + if (sample.value("requests").toInt() == selectedRequests) + selectedCapacity = rate; + } + require(selectedCapacity >= bestCapacity * 0.85, + "without demand startup uses measured capacity, not an unconditional single lane"); + for (const QVariant& value : curve) { + const auto sample = value.toMap(); + require(sample.value("requests").toInt() >= selectedRequests + || sample.value("capacity-bytes-per-second").toDouble() < bestCapacity * 0.85, + "additional lanes must improve capacity beyond the measurement noise band"); } - require(speedSizes == QList { 524288, 4194304, 2097152, 2097152, 1048576, 1048576, 1048576, 1048576 }, - "warmup and completed 1/2/4 lane rounds use the intended byte budgets"); + qint64 probeBytes = 0; + for (int bytes : std::as_const(speedSizes)) + probeBytes += bytes; + require(speedSizes.front() == 512 * 1024 && probeBytes <= 512 * 1024 + 3 * 64 * 1024 * 1024, + "warmup and adaptive complete-curve measurements have a bounded total byte budget"); require(speedMaximum == 4 && speedGuiTurns >= 5, "lane requests overlap without blocking GUI events"); require(received.back().contains("Authorization: a-token"), "benchmark passes source authentication headers"); const auto overlapping = QCoro::waitFor(runtime->call("a", "overlappingSpeedTests")); diff --git a/tests/providers/SourceHubSpeedTest.cpp b/tests/providers/SourceHubSpeedTest.cpp index f0ac335e..577da559 100644 --- a/tests/providers/SourceHubSpeedTest.cpp +++ b/tests/providers/SourceHubSpeedTest.cpp @@ -42,7 +42,7 @@ QVariantMap feedback(quint64 stream, double rate, int requests = 1) { "observed-at-ms", QDateTime::currentMSecsSinceEpoch() }, { "media-bitrate", 80'000'000 }, { "concurrency-samples", QVariantList { QVariantMap { { "requests", requests }, { "capacity-bytes-per-second", rate }, - { "latency-ms", 120.0 }, { "samples", 1 } } } } }; + { "ttfb-ms", 120.0 }, { "samples", 1 } } } } }; } } @@ -69,7 +69,7 @@ export function createSource(configuration) { return {bitrate:126000000, parallelRequests:1, origin:configuration.origin, 'concurrency-samples':[1,2,4].map(function(requests, index) { return {requests:requests, 'capacity-bytes-per-second':[10000000,20000000,21000000][index], - 'latency-ms':120, 'elapsed-seconds':0.4, 'received-bytes':4194304}; + 'ttfb-ms':120, 'elapsed-seconds':0.4, 'received-bytes':4194304}; })}; }); }, @@ -132,8 +132,8 @@ export function createSource(configuration) { resolve(melbourne); require(hub.playback()->playbackNetworkProfile().value("concurrency-samples").toList().size() == 3, "full benchmark curve reaches native playback without SDK changes"); - require(hub.playback()->playbackNetworkProfile().value("initial-requests").toInt() == 1, - "no demand starts conservatively instead of choosing the fastest probe"); + require(hub.playback()->playbackNetworkProfile().value("initial-requests").toInt() == 2, + "startup chooses minimum concurrency within the probe noise band instead of a tiny peak gain"); const QUrl melbourneOrigin = hub.playback()->mediaOrigin(); auto measured = feedback(1, 20'000'000, 2); hub.playback()->updatePlaybackNetworkProfile(melbourneOrigin, measured); @@ -160,7 +160,35 @@ export function createSource(configuration) { } resolve(nj); const QUrl njOrigin = hub.playback()->mediaOrigin(); - hub.playback()->updatePlaybackNetworkProfile(njOrigin, feedback(3, 40'000'000)); + const auto probe = [&](double singleRate) { + return registry.recordSpeedTest(nj, + { { "origin", njOrigin.toString() }, + { "concurrency-samples", + QVariantList { QVariantMap { { "requests", 1 }, { "capacity-bytes-per-second", singleRate }, + { "ttfb-ms", 5.0 } }, + QVariantMap { + { "requests", 2 }, { "capacity-bytes-per-second", 12'000'000.0 }, { "ttfb-ms", 5.0 } }, + QVariantMap { { "requests", 4 }, { "capacity-bytes-per-second", 10'000'000.0 }, + { "ttfb-ms", 5.0 } } } } }); + }; + require(probe(40'000'000), "negative-scaling probe records"); + auto impossibleDemand = feedback(3, 8'000'000, 4); + impossibleDemand["media-bitrate"] = 800'000'000; + hub.playback()->updatePlaybackNetworkProfile(njOrigin, impossibleDemand); + require(hub.playback()->playbackNetworkProfile().value("initial-requests").toInt() == 1, + "unreachable demand chooses the fast single lane, not the previous slower four lanes"); + auto actualSingle = feedback(4, 6'000'000); + actualSingle["media-bitrate"] = 800'000'000; + hub.playback()->updatePlaybackNetworkProfile(njOrigin, actualSingle); + require(hub.playback()->playbackNetworkProfile().value("initial-requests").toInt() == 2, + "actual single-lane playback overrides its faster Qt prior at the same concurrency"); + require(probe(90'000'000), "later probe refresh records"); + require(hub.playback()->playbackNetworkProfile().value("initial-requests").toInt() == 2, + "a newer Qt probe cannot replace fresh actual-playback evidence"); + hub.playback()->updatePlaybackNetworkProfile(njOrigin, feedback(5, 30'000'000, 16)); + require(hub.playback()->playbackNetworkProfile().value("initial-requests").toInt() == 16, + "forced sixteen-request playback supplies valid learning instead of being silently rejected"); + hub.playback()->updatePlaybackNetworkProfile(njOrigin, feedback(6, 40'000'000)); const auto learnedNj = hub.playback()->playbackNetworkProfile(); require(learnedNj.value("initial-requests").toInt() == 1 && learnedNj.value("capacity-bytes-per-second").toDouble() > 20'000'000, diff --git a/tests/providers/fixtures/resolve-metadata.mjs b/tests/providers/fixtures/resolve-metadata.mjs new file mode 100644 index 00000000..22032573 --- /dev/null +++ b/tests/providers/fixtures/resolve-metadata.mjs @@ -0,0 +1,5 @@ +// Echoes the resolve result a test supplies, so the runtime's admission of +// provider media metadata is exercised at the real script boundary. +export function createSource() { + return { resolve(args) { return args.result; } }; +} diff --git a/tools/android/build-apks.sh b/tools/android/build-apks.sh index 0e77f386..d31ca826 100755 --- a/tools/android/build-apks.sh +++ b/tools/android/build-apks.sh @@ -144,46 +144,7 @@ settings["qml-root-path"] = [sys.argv[2]] path.write_text(json.dumps(settings, indent=2) + "\n") PY done - local gradle_home="${GRADLE_USER_HOME:-$HOME/.gradle}" - mkdir -p "$gradle_home/init.d" - cat > "$gradle_home/init.d/spool-maven-mirror.gradle" <<'GRADLE' -allprojects { - buildscript { - repositories { - google() - maven { url = uri("https://maven-central.storage-download.googleapis.com/maven2/") } - } - } - repositories { - google() - maven { url = uri("https://maven-central.storage-download.googleapis.com/maven2/") } - } -} -GRADLE - local build_apk_target - build_apk_target() { - local apk_target="$1" - local attempt - for attempt in 1 2 3; do - if cmake --build "$build" --target "$apk_target" --parallel "$JOBS"; then - return 0 - fi - if [[ $attempt -lt 3 ]]; then - echo "Retrying $apk_target after transient Gradle/Maven failure (attempt $((attempt + 1))/3)..." >&2 - local gradlew - for gradlew in "$build"/android-build*/gradlew; do - if [[ -x "$gradlew" ]]; then - "$gradlew" --stop >/dev/null 2>&1 || true - fi - done - rm -rf "${GRADLE_USER_HOME:-$HOME/.gradle}/caches/modules-2/metadata-"* 2>/dev/null || true - sleep $((attempt * 15)) - fi - done - return 1 - } - - build_apk_target spool_make_apk + cmake --build "$build" --target spool_make_apk --parallel "$JOBS" local app_package="$build/android-build" if [[ "$developer" == ON ]]; then @@ -200,7 +161,7 @@ GRADLE # Never replace the signed non-debuggable release/universal inputs. cp -f "$apk" "$ROOT/dist/android/spool-e2e-app-${ABI}.apk" for target in spool-tests spool-e2e-tests; do - build_apk_target "${target}_make_apk" + cmake --build "$build" --target "${target}_make_apk" --parallel "$JOBS" apk="$build/android-build-${target}/${target}.apk" [[ -f "$apk" ]] || { echo "error: test APK was not generated at $apk" >&2 diff --git a/tools/profile-streaming.py b/tools/profile-streaming.py index 46a0bbd2..6f218f8c 100755 --- a/tools/profile-streaming.py +++ b/tools/profile-streaming.py @@ -4,6 +4,10 @@ Use the normal credential restoration path; this driver never handles media URLs, headers or account configuration. Playback updates normal server watch progress. The report contains only numeric source/transport data and account ID prefixes. + +--request-counts compares fixed request counts (forced) with automatic selection +on the same items; touched streaming settings are restored afterwards. --host +drives a remote instance (for example a TV) through spoolet's SSH transport. """ from __future__ import annotations @@ -26,15 +30,26 @@ def main() -> int: parser.add_argument("--repeats", type=int, default=3) parser.add_argument("--seconds", type=float, default=20, help="observed playback seconds after loading") parser.add_argument("--timeout", type=float, default=90, help="per-play startup deadline") + parser.add_argument("--host", help="USER@HOST of a remote instance, passed to spoolet --host") + parser.add_argument("--request-counts", default="auto", + help="comma list of fixed counts 1-16 and/or 'auto', e.g. 1,4,auto") + parser.add_argument("--from-start", action="store_true", help="play every run from the beginning") + parser.add_argument("--seek-seconds", type=float, help="seek to this position once loaded") args = parser.parse_args() if args.repeats < 1 or any(not math.isfinite(value) or value <= 0 for value in (args.seconds, args.timeout)): parser.error("counts and durations must be positive and finite") + if args.seek_seconds is not None and (not math.isfinite(args.seek_seconds) or args.seek_seconds < 0): + parser.error("--seek-seconds must be a finite position") + counts = [part.strip() for part in args.request_counts.split(",") if part.strip()] + if not counts or any(part != "auto" and not (part.isdigit() and 1 <= int(part) <= 16) for part in counts): + parser.error("--request-counts takes 1-16 and/or auto") cli = args.spoolet.resolve() if not cli.is_file() or not os.access(cli, os.X_OK): parser.error("--spoolet must be an executable") os.umask(0o077) args.output.mkdir(parents=True, exist_ok=False, mode=0o700) - report = {"schemaVersion": 1, "complete": False, "scope": "real-server-auto-playback", "samples": []} + report = {"schemaVersion": 3, "complete": False, "scope": "real-server-playback", "requestCounts": counts, + "samples": []} def save(): destination = args.output / "streaming.json" @@ -43,8 +58,9 @@ def save(): temporary.replace(destination) def call(command, *values): - result = subprocess.run([str(cli), "--instance", args.instance, command, *map(str, values)], - capture_output=True, text=True, timeout=15) + remote = ["--host", args.host] if args.host else [] + result = subprocess.run([str(cli), *remote, "--instance", args.instance, command, *map(str, values)], + capture_output=True, text=True, timeout=30 if args.host else 15) try: reply = json.loads(result.stdout) except (ValueError, TypeError): @@ -59,33 +75,85 @@ def transport(state): # The production snapshot is already credential-free. Keep this second # numeric allowlist so future diagnostics cannot expand report contents. keys = ("received-bytes", "current-received-bytes-per-second", "average-received-bytes-per-second", - "peak-received-bytes-per-second", "elapsed-seconds", "selected-requests", "latency-ms", + "peak-received-bytes-per-second", "elapsed-seconds", "selected-requests", "ttfb-ms", "capacity-bytes-per-second", "capacity-samples", "active-requests", "peak-active-requests", - "failed-requests", "retry-attempts", "stream-id", "range-bytes", "ring-bytes") - result = {key: raw[key] for key in keys if isinstance(raw.get(key), (int, float)) and not isinstance(raw[key], bool) - and math.isfinite(raw[key])} - for key in ("lane-samples", "concurrency-samples"): - result[key] = [{field: value for field, value in row.items() - if isinstance(value, (int, float)) and not isinstance(value, bool) and math.isfinite(value)} - for row in raw.get(key, []) if isinstance(row, dict)] + "failed-requests", "retry-attempts", "stream-id", "range-bytes", "ring-bytes", + "consumer-wait-seconds", "ring-wait-seconds", "head-of-line-seconds", "peak-reorder-bytes", + "physical-connections", "streams-per-connection", "curl-thread-cpu-seconds", "curl-thread-wall-seconds", + "consumer-thread-cpu-seconds", + "tcp-rtt-min-ms", "tcp-rtt-max-ms", "max-socket-receive-buffer-bytes", + "recent-scheduling-lateness-ms", "peak-scheduling-lateness-ms", + "scheduling-lateness-p50-ms", "scheduling-lateness-p99-ms", + "playback-buffer-seconds", "playback-demand-bits-per-second", "ordered-available-bytes", + "consumer-delivered-bytes", "readable-bytes", "retained-bytes", "reorder-bytes", "copy-in-bytes", + "copy-out-bytes", "reorder-copy-bytes", "body-callbacks", "worker-iterations", "coalesced-wakeups", + "head-of-line-events", "reorder-wait-seconds", "oldest-gap-seconds", + "perform-wall-seconds", "dispatch-wall-seconds", "poll-wall-seconds") + def numeric(fields, row): + return {field: row[field] for field in fields + if isinstance(row.get(field), (int, float)) and not isinstance(row[field], bool) + and math.isfinite(row[field])} + result = numeric(keys, raw) + for field in ("consumer-thread-cpu-available", "curl-thread-cpu-available", "scheduling-lateness-available"): + if isinstance(raw.get(field), bool): + result[field] = raw[field] + samples = { + "lane-samples": ("lane", "received-bytes", "active-seconds", "average-bytes-per-second", + "current-bytes-per-second", "peak-bytes-per-second", "capacity-bytes-per-second", "samples"), + "concurrency-samples": ("requests", "capacity-bytes-per-second", "ttfb-ms", "samples"), + "streams": ("stream-id", "readable-bytes", "retained-bytes", "reorder-bytes", + "prefix-publication-available"), + "connections": ("connection-id", "socket-generation", "http-version", "transport", "active-requests", + "socket-receive-buffer-bytes", "receive-window-bytes", "tcp-rtt-ms"), + "protocol-samples": ("http-version", "ordered-available-bytes", "cpu-ns-per-ordered-byte"), + } + for key, fields in samples.items(): + rows = raw.get(key, []) + if isinstance(rows, list): + result[key] = [] + for row in rows[:64]: + if not isinstance(row, dict): + continue + selected = numeric(fields, row) + if key == "streams" and isinstance(row.get("prefix-publication-available"), bool): + selected["prefix-publication-available"] = row["prefix-publication-available"] + result[key].append(selected) return result + touched = ("playback/threadedStreaming", "playback/maxStreamingThreads", "playback/forceStreamingThreads") + saved = {} + + def configure(count): + # Fixed counts force the request count; auto uses the saved ceiling. + call("settings", "set", "playback/threadedStreaming", "true") + if count == "auto": + call("settings", "set", "playback/forceStreamingThreads", "false") + call("settings", "set", "playback/maxStreamingThreads", + json.dumps(saved.get("playback/maxStreamingThreads") or 4)) + else: + call("settings", "set", "playback/forceStreamingThreads", "true") + call("settings", "set", "playback/maxStreamingThreads", count) + save() active = False try: initial = call("status") if initial.get("playback", {}).get("active"): raise RuntimeError("instance is already playing; refusing to interrupt it") - for item in args.item: + values = call("settings", "get").get("values", {}) + saved = {key: values[key] for key in touched if key in values} + runs = [(item, repeat) for item in args.item for repeat in range(args.repeats)] + for item, repeat in runs: account = item.split(":", 1)[0] - for repeat in range(args.repeats): + for count in counts: + configure(count) # Let deferred teardown finish: repeats include true core setup, # but intentionally retain learned per-server transport history. time.sleep(1.5) start = time.monotonic() - call("play", item) + call("play", item, *(["--from-start"] if args.from_start else [])) active = True - sample = {"account": account, "repeat": repeat + 1, "loadedMs": None, + sample = {"account": account, "requests": count, "repeat": repeat + 1, "loadedMs": None, "advancingMs": None, "bufferingSeconds": 0, "network": []} report["samples"].append(sample) last_tick = start @@ -110,11 +178,17 @@ def transport(state): source = state.get("source", {}) sample["source"] = {key: source[key] for key in ("bitrate", "width", "height", "qualityHeight") if isinstance(source.get(key), (int, float))} + if args.seek_seconds is not None: + call("seek", args.seek_seconds) + initial_position = args.seek_seconds if loaded is not None and sample["advancingMs"] is None: if playback.get("position", 0) > initial_position + 0.1 and not playback.get("paused"): sample["advancingMs"] = (now - start) * 1000 if now >= next_snapshot: - sample["network"].append({"atSeconds": now - start, **transport(state)}) + sample["network"].append({"atSeconds": now - start, + "eligible": bool(playback.get("loaded")) and not playback.get("paused") + and not playback.get("seeking"), + **transport(state)}) next_snapshot = now + 1 save() if loaded is None and now - start > args.timeout: @@ -128,26 +202,69 @@ def transport(state): time.sleep(0.05) call("stop") active = False + rows = sample["network"] + sample["peakPhysicalConnections"] = max((row.get("physical-connections", 0) for row in rows), default=0) + sample["peakActiveRequests"] = max((row.get("peak-active-requests", 0) for row in rows), default=0) + # A fixed count the transport could not reach is not that count. + sample["countReached"] = count == "auto" or sample["peakActiveRequests"] >= int(count) + eligible = [(before, after) for before, after in zip(rows, rows[1:]) + if before["eligible"] and after["eligible"] + and after["atSeconds"] > before["atSeconds"] + and before.get("stream-id") == after.get("stream-id")] + span = sum(after["atSeconds"] - before["atSeconds"] for before, after in eligible) + sample["eligibleSeconds"] = span + for field, output, scale in ( + ("ordered-available-bytes", "orderedMbps", 8e-6), + ("received-bytes", "receivedMbps", 8e-6), + ("consumer-wait-seconds", "consumerWaitFraction", 1), + ("head-of-line-seconds", "headOfLineFraction", 1), + ): + intervals = [(before, after) for before, after in eligible + if field in before and field in after and after[field] >= before[field]] + duration = sum(after["atSeconds"] - before["atSeconds"] for before, after in intervals) + if duration: + sample[output] = scale * sum(after[field] - before[field] + for before, after in intervals) / duration + sample["effectiveHttpVersions"] = sorted({connection["http-version"] + for row in rows for connection in row.get("connections", []) + if connection.get("http-version") in (10, 11, 20, 30)}) save() report["complete"] = True lines = ["# Real-server automatic streaming profile", "", "Observed on this client/network, not a TV or a guarantee of globally fastest startup.", "Startup includes provider negotiation, player setup, container probing and rendering.", "Repeats retain learned server history; playback updates normal watch progress.", "", - "| Account | Runs | Median loaded | Median advancing | Buffering total |", - "|---|---:|---:|---:|---:|"] - for account in dict.fromkeys(row["account"] for row in report["samples"]): - rows = [row for row in report["samples"] if row["account"] == account] - lines.append(f"| {account} | {len(rows)} | {statistics.median(row['loadedMs'] for row in rows):.0f} ms | " - f"{statistics.median(row['advancingMs'] for row in rows):.0f} ms | " - f"{sum(row['bufferingSeconds'] for row in rows):.2f} s |") + "Ordered/received rates exclude paused/seeking intervals but include full-cache idle time; " + "they are not isolated capacity estimates. Compare the same item and offset.", "", + "| Account | Requests | Runs | Median loaded | Median advancing | Buffering total | " + "Median ordered | Median received | Median consumer wait | Median head-of-line | Peak connections | Count reached |", + "|---|---|---:|---:|---:|---:|---:|---:|---:|---:|---:|---|"] + + def median(rows, key, scale=1.0): + values = [row[key] * scale for row in rows if isinstance(row.get(key), (int, float))] + return statistics.median(values) if values else float("nan") + + for account, count in dict.fromkeys((row["account"], row["requests"]) for row in report["samples"]): + rows = [row for row in report["samples"] if row["account"] == account and row["requests"] == count] + lines.append(f"| {account} | {count} | {len(rows)} | {median(rows, 'loadedMs'):.0f} ms | " + f"{median(rows, 'advancingMs'):.0f} ms | " + f"{sum(row['bufferingSeconds'] for row in rows):.2f} s | " + f"{median(rows, 'orderedMbps'):.1f} Mbps | " + f"{median(rows, 'receivedMbps'):.1f} Mbps | {median(rows, 'consumerWaitFraction', 100):.0f}% | " + f"{median(rows, 'headOfLineFraction', 100):.0f}% | " + f"{max(row['peakPhysicalConnections'] for row in rows)} | " + f"{'yes' if all(row['countReached'] for row in rows) else 'NO'} |") text = "\n".join(lines) + "\n" (args.output / "streaming.md").write_text(text) print(text, end="") return 0 except (OSError, ValueError, RuntimeError, subprocess.TimeoutExpired) as error: - report["failure"] = str(error) - print("streaming profile: " + str(error)) + category = ("control-timeout" if isinstance(error, subprocess.TimeoutExpired) + else "local-io" if isinstance(error, OSError) + else "invalid-control-data" if isinstance(error, ValueError) + else "playback-or-control-rejected") + report["failure"] = category + print("streaming profile: " + category) return 1 finally: if active: @@ -155,6 +272,11 @@ def transport(state): call("stop") except (OSError, RuntimeError, subprocess.TimeoutExpired): pass + for key, value in saved.items(): + try: + call("settings", "set", key, json.dumps(value)) + except (OSError, RuntimeError, subprocess.TimeoutExpired): + report.setdefault("restoreFailed", []).append(key) save() diff --git a/tools/webos/device-common.sh b/tools/webos/device-common.sh index 03dbaa0c..f096a338 100755 --- a/tools/webos/device-common.sh +++ b/tools/webos/device-common.sh @@ -40,3 +40,11 @@ webos_luna() { # though it exits 0, so give it one; luna-response.py skips tty chatter. webos_ssh -tt "$host" "$bin -n 1 $(webos_quote "$uri") $(webos_quote "$payload")" Date: Fri, 27 Nov 2026 02:50:05 +1100 Subject: [PATCH 02/39] feat(streaming): add per-source policy and pinned HTTP transport dependencies Consolidate the release milestone ending at 738ae12a6fa8332d8841aecfba39f40185fa4ddf. Original starting snapshot: aac4e89cf022adf6d5c1bbdf3624bf1537c9e6af. --- .github/workflows/build-artifacts.yml | 49 ++- .github/workflows/ios-review.yml | 28 +- CMakeLists.txt | 20 +- README.md | 15 + build-ipk.sh | 8 +- cmake/platform/AppleMobile.cmake | 33 ++ cmake/platform/IOS.cmake | 1 + cmake/platform/TVOS.cmake | 35 +- docs/providers.md | 26 +- flake.nix | 3 +- providers/bundled/spool.plex-0.2.2.szo | Bin 58317 -> 0 bytes providers/bundled/spool.plex-0.2.3.szo | Bin 0 -> 58368 bytes providers/lock.json | 6 +- qml/browse/RowStackView.qml | 95 ++-- qml/pages/AccountsPage.qml | 9 +- qml/pages/HomePage.qml | 109 ++++- qml/pages/LibraryGridPage.qml | 7 +- qml/pages/ProviderDetailsPage.qml | 25 +- qml/pages/SettingsPage.qml | 114 ++++- qml/primitives/MediaRow.qml | 19 +- qml/shell/AppShell.qml | 2 +- qml/shell/KeyRouter.qml | 6 +- qml/shell/RouteStack.qml | 2 + src/app/AppController.cpp | 24 +- src/app/AppController.h | 3 +- src/app/BrowseSessionController.cpp | 13 + src/app/BrowseSessionController.h | 1 + src/app/HomeModelController.cpp | 44 +- src/app/HomeModelController.h | 4 +- src/app/SettingsController.cpp | 180 ++++++++ src/app/SettingsController.h | 17 + src/app/SettingsSchema.cpp | 60 ++- src/app/SettingsSchema.h | 8 + src/automation/LocalCommandServer.cpp | 67 ++- src/automation/SpooletMain.cpp | 25 ++ src/main.cpp | 33 +- src/platform/PlatformStreamingMemory.cpp | 129 ++++++ src/platform/PlatformSystemProbes.h | 5 + src/player/MpvOptionProfile.cpp | 34 +- src/player/MpvOptionProfile.h | 24 +- src/player/PlayerController.cpp | 234 +++++++--- src/player/PlayerController.h | 20 + src/provider/PlaybackSource.h | 12 +- src/provider/PortableProvider.cpp | 3 - src/provider/ProviderRegistry.cpp | 404 ++++++++++++------ src/provider/ProviderRegistry.h | 3 +- src/provider/ScriptBridge.cpp | 8 +- src/provider/SourceHub.cpp | 52 ++- src/provider/SourceHub.h | 5 +- src/provider/SpeedTest.cpp | 50 +-- src/provider/SpeedTest.h | 9 - tests/app/SettingsControllerTest.cpp | 47 ++ tests/automation/LocalControlProtocolTest.cpp | 16 + tests/e2e/AppJourneyTest.cpp | 39 +- tests/e2e/JellyfinFixture.cpp | 28 +- tests/e2e/JellyfinFixture.h | 5 + tests/platform/MobileTestBundles.cmake | 16 +- tests/platform/ios/Info.plist.in | 19 + tests/player/MpvOptionProfileTest.cpp | 14 +- tests/providers/ProviderRegistryTest.cpp | 15 + tests/providers/ScriptRuntimeTest.cpp | 13 + tests/providers/SourceHubSpeedTest.cpp | 275 +++++++++--- tests/providers/SourceHubTest.cpp | 22 + tests/providers/fixtures/provider.mjs | 1 + tests/providers/fixtures/resolve-metadata.mjs | 14 +- tests/qml/tst_ExtensionIntegration.qml | 29 ++ tests/qml/tst_KeyRouter.qml | 37 ++ tests/qml/tst_MediaRow.qml | 24 ++ tests/qml/tst_RowStackView.qml | 60 +++ tests/tools/StreamingDependenciesTest.py | 128 ++++++ tests/transport/protocols.py | 182 ++++++++ tests/transport/reset_origin.py | 114 +++++ tools/android/build-dependencies.sh | 86 +--- tools/apple/build-dependencies.sh | 17 +- tools/apple/smoke-ios.sh | 5 + tools/apple/smoke-tvos.sh | 16 +- tools/build-ios.sh | 9 +- tools/check-streaming-dependencies.py | 31 ++ tools/cmake/StreamingDependencies.cmake | 53 +++ tools/lib/streaming-build.sh | 15 + tools/manifests/android-third-party.json | 10 - tools/manifests/mpv-native.json | 36 -- tools/manifests/streaming-third-party.json | 33 ++ tools/manifests/webos-third-party.json | 5 - .../patches/curl-apple-mobile-sectrust.patch | 16 + tools/prepare-streaming-sources.sh | 29 ++ tools/run-device-tests.py | 10 +- tools/streaming-fingerprint.py | 24 ++ tools/test-transport-netns.sh | 41 ++ tools/webos-native/build-curl.sh | 118 ++--- tools/webos-native/build-qt6-611.sh | 10 +- tools/webos-native/build-webos.sh | 1 + tools/windows/build-mpv.ps1 | 29 +- .../windows/build-streaming-dependencies.ps1 | 56 +++ tools/windows/common.ps1 | 5 +- tools/windows/install-build-tools.ps1 | 6 +- 96 files changed, 3090 insertions(+), 752 deletions(-) delete mode 100644 providers/bundled/spool.plex-0.2.2.szo create mode 100644 providers/bundled/spool.plex-0.2.3.szo create mode 100644 src/platform/PlatformStreamingMemory.cpp create mode 100644 tests/platform/ios/Info.plist.in create mode 100644 tests/tools/StreamingDependenciesTest.py create mode 100644 tests/transport/protocols.py create mode 100644 tests/transport/reset_origin.py create mode 100644 tools/apple/smoke-ios.sh create mode 100644 tools/check-streaming-dependencies.py create mode 100644 tools/cmake/StreamingDependencies.cmake create mode 100644 tools/lib/streaming-build.sh create mode 100644 tools/manifests/streaming-third-party.json create mode 100644 tools/patches/curl-apple-mobile-sectrust.patch create mode 100755 tools/prepare-streaming-sources.sh create mode 100644 tools/streaming-fingerprint.py create mode 100755 tools/test-transport-netns.sh create mode 100644 tools/windows/build-streaming-dependencies.ps1 diff --git a/.github/workflows/build-artifacts.yml b/.github/workflows/build-artifacts.yml index aa7677f9..3028db20 100644 --- a/.github/workflows/build-artifacts.yml +++ b/.github/workflows/build-artifacts.yml @@ -677,6 +677,9 @@ jobs: run: nix develop .#native --no-write-lock-file -c bash tools/build-macos.sh + - name: Run macOS traditional and real GUI e2e tests + run: nix develop .#native --no-write-lock-file -c python tools/run-tests.py --build-dir build/macos/app --workers 4 + - name: Lint compiled QML run: nix develop .#native --no-write-lock-file -c cmake --build build/macos/app --target spool_qmllint_strict @@ -847,7 +850,7 @@ jobs: build/apple/qt-${{ matrix.sdk }}-arm64 build/apple/${{ matrix.sdk }}-arm64 build/downloads - key: tvos-source1-${{ runner.os }}-${{ runner.arch }}-${{ matrix.sdk }}-16.0-${{ steps.apple-toolchain.outputs.key }}-${{ hashFiles('tools/manifests/toolchain.json', 'tools/manifests/android-third-party.json', 'tools/manifests/ffmpeg-capabilities.json', 'tools/apple/**', 'tools/build-tvos.sh', 'tools/ffmpeg-capabilities.py', 'tools/lib/manifest-sources.sh', 'tools/webos-native/patches/qtdeclarative-*-qmlimportscanner-exclude-subtrees.patch', 'third_party/**', 'mpv/meson.build', 'mpv/meson.options') }} + key: tvos-source1-${{ runner.os }}-${{ runner.arch }}-${{ matrix.sdk }}-16.0-${{ steps.apple-toolchain.outputs.key }}-${{ hashFiles('tools/manifests/streaming-third-party.json', 'tools/prepare-streaming-sources.sh', 'tools/streaming-fingerprint.py', 'tools/check-streaming-dependencies.py', 'tools/cmake/StreamingDependencies.cmake', 'tools/lib/streaming-build.sh', 'tools/patches/curl-*.patch', 'tools/windows/build-streaming-dependencies.ps1', 'tools/manifests/toolchain.json', 'tools/manifests/android-third-party.json', 'tools/manifests/ffmpeg-capabilities.json', 'tools/apple/**', 'tools/build-tvos.sh', 'tools/ffmpeg-capabilities.py', 'tools/lib/manifest-sources.sh', 'tools/webos-native/patches/qtdeclarative-*-qmlimportscanner-exclude-subtrees.patch', 'third_party/**', 'mpv/meson.build', 'mpv/meson.options') }} - name: Install matching macOS Qt host tools if: ${{ steps.tvos-source-cache.outputs.cache-hit != 'true' }} env: @@ -860,6 +863,14 @@ jobs: -m qtshadertools qttasktree qtwebsockets qtimageformats - name: Build actual source Qt, media closure, and tvOS app run: bash tools/build-tvos.sh + - name: Build native host controller for tvOS application journeys + if: matrix.sdk == 'appletvsimulator' + run: nix develop .#native -c env DEPLOY_APP=0 bash tools/build-macos.sh + + - name: Run tvOS traditional and real GPU GUI e2e tests + if: matrix.sdk == 'appletvsimulator' + run: bash tools/apple/smoke-tvos.sh build/tvos/appletvsimulator-arm64/install/Spool.app + - name: Package artifact-audited unsigned device IPA (no device runtime claim) if: ${{ matrix.sdk == 'appletvos' }} run: bash tools/package-tvos.sh build/tvos/appletvos-arm64/install/Spool.app dist/tvos @@ -938,7 +949,7 @@ jobs: build/third_party .ccache mpv/build/webos-libmpv - key: webos3-${{ runner.os }}-${{ hashFiles('flake.nix', 'flake.lock', 'mpv/meson.build', 'build-ipk.sh', 'tools/package-audit.py', 'tools/lib/*.sh', 'tools/manifests/ffmpeg-capabilities.json', 'tools/manifests/toolchain.json', 'tools/manifests/mpv-native.json', 'tools/manifests/qt-webos-6.11.json', 'tools/manifests/webos-third-party.json', 'tools/webos-native/**') }} + key: webos3-${{ runner.os }}-${{ hashFiles('tools/manifests/streaming-third-party.json', 'tools/prepare-streaming-sources.sh', 'tools/streaming-fingerprint.py', 'tools/check-streaming-dependencies.py', 'tools/cmake/StreamingDependencies.cmake', 'tools/lib/streaming-build.sh', 'tools/patches/curl-*.patch', 'tools/windows/build-streaming-dependencies.ps1', 'flake.nix', 'flake.lock', 'mpv/meson.build', 'build-ipk.sh', 'tools/package-audit.py', 'tools/lib/*.sh', 'tools/manifests/ffmpeg-capabilities.json', 'tools/manifests/toolchain.json', 'tools/manifests/mpv-native.json', 'tools/manifests/qt-webos-6.11.json', 'tools/manifests/webos-third-party.json', 'tools/webos-native/**') }} restore-keys: | webos3-${{ runner.os }}- webos2-${{ runner.os }}- @@ -1151,7 +1162,7 @@ jobs: build/android/qt build/android/deps build/android/qcoro - key: android6-${{ matrix.abi }}-${{ runner.os }}-${{ steps.cache-inputs.outputs.mpv }}-${{ steps.cache-inputs.outputs.toolchain }}-${{ hashFiles('tools/android/build-dependencies.sh', 'tools/android/build-qt6.sh', 'tools/android/patches/*.patch', 'tools/ffmpeg-capabilities.py', 'tools/lib/build-common.sh', 'tools/lib/manifest-sources.sh', 'tools/manifests/android-third-party.json', 'tools/manifests/ffmpeg-capabilities.json', 'tools/manifests/toolchain.json', 'tools/manifests/qt-android-6.11.json') }} + key: android6-${{ matrix.abi }}-${{ runner.os }}-${{ steps.cache-inputs.outputs.mpv }}-${{ steps.cache-inputs.outputs.toolchain }}-${{ hashFiles('tools/manifests/streaming-third-party.json', 'tools/prepare-streaming-sources.sh', 'tools/streaming-fingerprint.py', 'tools/check-streaming-dependencies.py', 'tools/cmake/StreamingDependencies.cmake', 'tools/lib/streaming-build.sh', 'tools/patches/curl-*.patch', 'tools/windows/build-streaming-dependencies.ps1', 'tools/android/build-dependencies.sh', 'tools/android/build-qt6.sh', 'tools/android/patches/*.patch', 'tools/ffmpeg-capabilities.py', 'tools/lib/build-common.sh', 'tools/lib/manifest-sources.sh', 'tools/manifests/android-third-party.json', 'tools/manifests/ffmpeg-capabilities.json', 'tools/manifests/toolchain.json', 'tools/manifests/qt-android-6.11.json') }} - name: Build cached Android toolchains if: ${{ steps.android-cache.outputs.cache-hit != 'true' }} @@ -1231,8 +1242,21 @@ jobs: key: ${{ steps.android-cache.outputs.cache-primary-key }} - # Hosted emulator runtime checks remain available through - # tools/android/emulator-launch-test.sh, but do not gate release artifacts. + - name: Build native host controller for Android application journeys + if: matrix.abi == 'x86_64' + run: nix develop .#native -c bash tools/build-linux-release.sh + + - name: Run Android phone traditional and real GPU GUI e2e tests + if: matrix.abi == 'x86_64' + env: + SPOOL_ANDROID_FORM_FACTOR: phone + run: nix develop .#android -c bash tools/android/emulator-launch-test.sh + + - name: Run Android TV traditional and real GPU GUI e2e tests + if: matrix.abi == 'x86_64' + env: + SPOOL_ANDROID_FORM_FACTOR: tv + run: nix develop .#android -c bash tools/android/emulator-launch-test.sh - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.0 with: @@ -1381,7 +1405,7 @@ jobs: with: msystem: MSYS path-type: inherit - install: make diffutils pkgconf + install: make diffutils pkgconf patch tar curl - name: Install build and packaging tools shell: pwsh @@ -1428,7 +1452,7 @@ jobs: uses: actions/cache/restore@caa296126883cff596d87d8935842f9db880ef25 # v5.0.3 with: path: build/windows-deps/mpv - key: windows-mpv-${{ runner.os }}-${{ steps.mpv-revision.outputs.revision }}-${{ hashFiles('tools/windows/build-mpv.ps1', 'tools/windows/build-ffmpeg.ps1', 'tools/windows/build-ffmpeg.sh', 'tools/windows/check-ffmpeg.py', 'tools/windows/build-shader-tools.ps1', 'tools/windows/common.ps1', 'tools/manifests/mpv-native.json', 'tools/manifests/ffmpeg-capabilities.json', 'tools/manifests/toolchain.json', 'tools/ffmpeg-capabilities.py') }} + key: windows-mpv-${{ runner.os }}-${{ steps.mpv-revision.outputs.revision }}-${{ hashFiles('tools/manifests/streaming-third-party.json', 'tools/prepare-streaming-sources.sh', 'tools/streaming-fingerprint.py', 'tools/check-streaming-dependencies.py', 'tools/cmake/StreamingDependencies.cmake', 'tools/lib/streaming-build.sh', 'tools/patches/curl-*.patch', 'tools/windows/build-streaming-dependencies.ps1', 'tools/windows/build-mpv.ps1', 'tools/windows/build-ffmpeg.ps1', 'tools/windows/build-ffmpeg.sh', 'tools/windows/check-ffmpeg.py', 'tools/windows/build-shader-tools.ps1', 'tools/windows/common.ps1', 'tools/manifests/mpv-native.json', 'tools/manifests/ffmpeg-capabilities.json', 'tools/manifests/toolchain.json', 'tools/ffmpeg-capabilities.py') }} - name: Build libmpv from the fork if: steps.mpv-cache.outputs.cache-hit != 'true' @@ -1443,7 +1467,7 @@ jobs: uses: actions/cache/save@caa296126883cff596d87d8935842f9db880ef25 # v5.0.3 with: path: build/windows-deps/mpv - key: windows-mpv-${{ runner.os }}-${{ steps.mpv-revision.outputs.revision }}-${{ hashFiles('tools/windows/build-mpv.ps1', 'tools/windows/build-ffmpeg.ps1', 'tools/windows/build-ffmpeg.sh', 'tools/windows/check-ffmpeg.py', 'tools/windows/build-shader-tools.ps1', 'tools/windows/common.ps1', 'tools/manifests/mpv-native.json', 'tools/manifests/ffmpeg-capabilities.json', 'tools/manifests/toolchain.json', 'tools/ffmpeg-capabilities.py') }} + key: windows-mpv-${{ runner.os }}-${{ steps.mpv-revision.outputs.revision }}-${{ hashFiles('tools/manifests/streaming-third-party.json', 'tools/prepare-streaming-sources.sh', 'tools/streaming-fingerprint.py', 'tools/check-streaming-dependencies.py', 'tools/cmake/StreamingDependencies.cmake', 'tools/lib/streaming-build.sh', 'tools/patches/curl-*.patch', 'tools/windows/build-streaming-dependencies.ps1', 'tools/windows/build-mpv.ps1', 'tools/windows/build-ffmpeg.ps1', 'tools/windows/build-ffmpeg.sh', 'tools/windows/check-ffmpeg.py', 'tools/windows/build-shader-tools.ps1', 'tools/windows/common.ps1', 'tools/manifests/mpv-native.json', 'tools/manifests/ffmpeg-capabilities.json', 'tools/manifests/toolchain.json', 'tools/ffmpeg-capabilities.py') }} - name: Build application shell: pwsh @@ -1451,8 +1475,13 @@ jobs: - # The strict Windows native suite remains available through - # tools/windows/test.ps1. Hosted OCR/runtime checks do not gate packaging. + - name: Install pinned Windows GPU and OCR test runtime + shell: pwsh + run: tools\windows\install-test-runtime.ps1 + + - name: Run Windows traditional and real OpenGL GUI e2e tests + shell: pwsh + run: tools\windows\test.ps1 - name: Stage and launch-test release payload shell: pwsh diff --git a/.github/workflows/ios-review.yml b/.github/workflows/ios-review.yml index 77ff63e2..f1f9f5f0 100644 --- a/.github/workflows/ios-review.yml +++ b/.github/workflows/ios-review.yml @@ -70,16 +70,30 @@ jobs: SPOOL_APPLE_APP_STORE: 'OFF' BUILD_JOBS: '4' run: bash tools/build-ios.sh - - name: Smoke native startup on simulator + - uses: ./.github/actions/install-nix + if: matrix.sdk == 'iphonesimulator' + with: + nix_conf: | + experimental-features = nix-command flakes + - uses: cachix/cachix-action@3ba601ff5bbb07c7220846facfa2cd81eeee15a1 + if: matrix.sdk == 'iphonesimulator' + with: + name: spool + skipPush: true + - name: Select supported Intel macOS native package channel if: matrix.sdk == 'iphonesimulator' shell: bash run: | - device="$(xcrun simctl list devices available --json | python3 -c 'import json,sys; print(next(d["udid"] for ds in json.load(sys.stdin)["devices"].values() for d in ds if d["name"].startswith("iPhone")))')" - xcrun simctl boot "$device" - xcrun simctl bootstatus "$device" -b - bundle="build/apple/iphonesimulator-x86_64/app/Release-iphonesimulator/Spool.app" - xcrun simctl install "$device" "$bundle" - xcrun simctl launch --console "$device" com.sachk.spool --launch-test + url="$(python3 -c 'import json; p=json.load(open("flake.lock"))["nodes"]["nixpkgs-x86-darwin"]["locked"]; print("github:"+p["owner"]+"/"+p["repo"]+"/"+p["rev"])')" + nix flake lock --override-input nixpkgs "$url" + - name: Build native host controller for iOS application journeys + if: matrix.sdk == 'iphonesimulator' + run: nix develop .#native -c env DEPLOY_APP=0 bash tools/build-macos.sh + - name: Run iOS traditional and real GPU GUI e2e tests + if: matrix.sdk == 'iphonesimulator' + env: + SPOOL_TVOS_TEST_BUILD_DIR: build/apple/iphonesimulator-x86_64/app + run: bash tools/apple/smoke-ios.sh build/apple/iphonesimulator-x86_64/install/Spool.app - name: Package audited unsigned device IPA if: matrix.sdk == 'iphoneos' shell: bash diff --git a/CMakeLists.txt b/CMakeLists.txt index d2c4d162..1288387f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -185,6 +185,7 @@ set(SPOOL_PLATFORM_SOURCES src/platform/PlatformSettingsPolicy.h src/platform/PlatformStartup.h src/platform/PlatformSystemProbes.h + src/platform/PlatformStreamingMemory.cpp src/platform/ScreenSaverInhibitor.h src/platform/common/NativeAppWindowCommon.cpp src/platform/common/PlatformDisplayOutput.cpp @@ -1028,6 +1029,9 @@ if(BUILD_TESTING AND NOT SPOOL_WEBOS) if(ANDROID) set(SPOOL_TEST_DEVICE_PLATFORM android) set(SPOOL_TEST_DEVICE_ARTIFACTS "${CMAKE_CURRENT_SOURCE_DIR}/build/android/launch-test") + elseif(IOS) + set(SPOOL_TEST_DEVICE_PLATFORM ios) + set(SPOOL_TEST_DEVICE_ARTIFACTS "${CMAKE_CURRENT_SOURCE_DIR}/build/ios/smoke") else() set(SPOOL_TEST_DEVICE_PLATFORM tvos) set(SPOOL_TEST_DEVICE_ARTIFACTS "${CMAKE_CURRENT_SOURCE_DIR}/build/tvos/smoke") @@ -1252,6 +1256,7 @@ if(BUILD_TESTING AND NOT SPOOL_WEBOS) PREFIX "/qt/qml/Spool" FILES tests/qml/tst_MediaRow.qml + tests/qml/tst_RowStackView.qml tests/qml/tst_SubtitleSettingsPanel.qml tests/qml/tst_RemoteControlPage.qml tests/qml/tst_ProviderInstallDialog.qml @@ -1273,7 +1278,7 @@ if(BUILD_TESTING AND NOT SPOOL_WEBOS) math(EXPR qml_source_index "${qml_index} + 1") list(GET SPOOL_QML_TESTS ${qml_index} qml_test_name) list(GET SPOOL_QML_TESTS ${qml_source_index} qml_test_source) - if(qml_test_name MATCHES "^(subtitle-settings-panel|remote-control-page|provider-install-dialog|provider-shell|player-seek-bar-hover|media-row|extension-integration|provider-forms|artwork-integration|library-scale-profile|option-picker-input)$") + if(qml_test_name MATCHES "^(subtitle-settings-panel|remote-control-page|provider-install-dialog|provider-shell|player-seek-bar-hover|media-row|row-stack-view|extension-integration|provider-forms|artwork-integration|library-scale-profile|option-picker-input)$") set(qml_input ":/qt/qml/Spool/${qml_test_source}") else() set(qml_input "${CMAKE_CURRENT_SOURCE_DIR}/${qml_test_source}") @@ -1344,6 +1349,19 @@ if(BUILD_TESTING AND NOT SPOOL_WEBOS) --libmpv "${SPOOL_CURL_TEST_MPV}" -v) # The real-HTTP suite runs about 330 s of playback serially. set_tests_properties(curl-transport PROPERTIES LABELS traditional TIMEOUT 600) + add_test(NAME streaming-dependencies COMMAND "${Python3_EXECUTABLE}" + "${CMAKE_CURRENT_SOURCE_DIR}/tests/tools/StreamingDependenciesTest.py") + set_tests_properties(streaming-dependencies PROPERTIES LABELS traditional TIMEOUT 120) + add_test(NAME transport-protocols COMMAND "${Python3_EXECUTABLE}" + "${CMAKE_CURRENT_SOURCE_DIR}/tests/transport/protocols.py" + --transport-helper "${MPV_ACTIVE_SOURCE_DIR}/test/curl_transport.py" + --libmpv "${SPOOL_CURL_TEST_MPV}") + set_tests_properties(transport-protocols PROPERTIES LABELS traditional TIMEOUT 300) + add_test(NAME transport-packet-performance COMMAND bash + "${CMAKE_CURRENT_SOURCE_DIR}/tools/test-transport-netns.sh" + --libmpv "${SPOOL_CURL_TEST_MPV}") + set_tests_properties(transport-packet-performance PROPERTIES LABELS performance + RUN_SERIAL TRUE RESOURCE_LOCK transport-network TIMEOUT 1200 SKIP_RETURN_CODE 77) endif() endif() if(SPOOL_SANITIZERS AND CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang") diff --git a/README.md b/README.md index 889dec0b..b0252b39 100644 --- a/README.md +++ b/README.md @@ -63,6 +63,11 @@ Search uses all enabled, authorized watching profiles regardless of the Home provider filter, never the combined permissions of an adult and child profile saved on the same server. +Home shows an initial loading state before its first content is available, then +**Loading more…** while additional accounts or shelves are pending. A late server's +libraries join the existing Home inventory. Connection failures remain visible +with a **Profiles & servers** action; other successful sources stay usable. + ### Settings and navigation Settings opens a category index with common controls and a direct **Zoom** @@ -97,6 +102,16 @@ offscreen, the first direction selects the top-left usable visible card without scrolling back. That complete held gesture is consumed until physical release; the next press navigates normally. **Move** is explicit in the library menu: moving keeps the library selected and the viewport stable until **Done**. +Library and Home shelf selections follow their identities through background +inventory reordering. Late shelves retain the selected card and its screen +position rather than resetting the existing rows. On webOS, +directional holds require the remote's repeat events; a lost release cannot +start synthetic scrolling. +Changing the input target or losing focus retires the previous directional hold. + +Background library refreshes retain the current catalogue and posters while +waiting for replacement rows. Explicit filter or library changes still replace +the listing. Home's provider chooser switches between **All providers** and one provider without changing enabled accounts, watching profiles or global search. The diff --git a/build-ipk.sh b/build-ipk.sh index b7fde36a..702b9f3d 100755 --- a/build-ipk.sh +++ b/build-ipk.sh @@ -324,11 +324,15 @@ FFMPEG_STAGED_LIBRARY="$(stage_elf_shared_library \ AVFORMAT_STAGED_LIBRARY="$(stage_elf_shared_library \ "$PREFIX/lib/libavformat.so.*" "$STAGE_LIB" "$READELF_BIN")" OPENSSL_STAGED_LIBRARY="$(stage_elf_shared_library \ - "$SYSROOT/usr/lib/libssl.so.*" "$STAGE_LIB" "$READELF_BIN")" + "$PREFIX/lib/libssl.so.*" "$STAGE_LIB" "$READELF_BIN")" OPENSSL_CRYPTO_STAGED_LIBRARY="$(stage_elf_shared_library \ - "$SYSROOT/usr/lib/libcrypto.so.*" "$STAGE_LIB" "$READELF_BIN")" + "$PREFIX/lib/libcrypto.so.*" "$STAGE_LIB" "$READELF_BIN")" for pattern in \ + "$PREFIX/lib/libnghttp2.so.*" \ + "$PREFIX/lib/libnghttp3.so.*" \ + "$PREFIX/lib/libngtcp2.so.*" \ + "$PREFIX/lib/libngtcp2_crypto_ossl.so.*" \ "$PREFIX/lib/libavfilter.so.*" \ "$PREFIX/lib/libavutil.so.*" \ "$PREFIX/lib/libswresample.so.*" \ diff --git a/cmake/platform/AppleMobile.cmake b/cmake/platform/AppleMobile.cmake index 0f1fad0a..5692f36d 100644 --- a/cmake/platform/AppleMobile.cmake +++ b/cmake/platform/AppleMobile.cmake @@ -35,3 +35,36 @@ function(spool_configure_apple_mobile_targets native_target core_target) set_source_files_properties(${fonts} PROPERTIES MACOSX_PACKAGE_LOCATION "Resources/fonts") target_sources(${native_target} PRIVATE ${fonts}) endfunction() + +# Both the production application and each isolated native test bundle need +# their own application identifier in the simulator's Keychain entitlement. +function(spool_configure_apple_simulator_entitlements) + string(TOLOWER "${CMAKE_OSX_SYSROOT}" tvos_sysroot) + if(tvos_sysroot MATCHES "(appletvsimulator|iphonesimulator)") + # Simulator application/Keychain entitlements belong in Mach-O sections, + # not the macOS code signature, where these are restricted entitlements. + foreach(target IN LISTS ARGN) + get_target_property(identifier ${target} MACOSX_BUNDLE_GUI_IDENTIFIER) + set(xml "${CMAKE_CURRENT_BINARY_DIR}/${target}-simulator.xcent") + set(der "${xml}.der") + file(CONFIGURE OUTPUT "${xml}" CONTENT +" + + +application-identifierSPOOLSMOKE.${identifier} +com.apple.developer.team-identifierSPOOLSMOKE +keychain-access-groupsSPOOLSMOKE.${identifier} + +") + add_custom_command(OUTPUT "${der}" + COMMAND xcrun derq query -f xml -i "${xml}" -o "${der}" --raw + DEPENDS "${xml}" + VERBATIM) + target_sources(${target} PRIVATE "${der}") + target_link_options(${target} PRIVATE + "LINKER:-sectcreate,__TEXT,__entitlements,${xml}" + "LINKER:-sectcreate,__TEXT,__ents_der,${der}") + set_property(TARGET ${target} APPEND PROPERTY LINK_DEPENDS "${xml}" "${der}") + endforeach() + endif() +endfunction() diff --git a/cmake/platform/IOS.cmake b/cmake/platform/IOS.cmake index 744cd1ed..b2f4db84 100644 --- a/cmake/platform/IOS.cmake +++ b/cmake/platform/IOS.cmake @@ -18,6 +18,7 @@ function(spool_configure_ios_targets native_target core_target) ) set_source_files_properties(app/ios/PrivacyInfo.xcprivacy PROPERTIES MACOSX_PACKAGE_LOCATION Resources) target_sources(${native_target} PRIVATE app/ios/PrivacyInfo.xcprivacy) + spool_configure_apple_simulator_entitlements(${native_target}) if(SPOOL_IOS_ASSETS) target_sources(${native_target} PRIVATE "${SPOOL_IOS_ASSETS}") endif() diff --git a/cmake/platform/TVOS.cmake b/cmake/platform/TVOS.cmake index 642c095e..e3bdc52f 100644 --- a/cmake/platform/TVOS.cmake +++ b/cmake/platform/TVOS.cmake @@ -27,38 +27,5 @@ function(spool_configure_tvos_targets native_target core_target) set_source_files_properties("${SPOOL_TVOS_ASSETS}" PROPERTIES MACOSX_PACKAGE_LOCATION Resources) target_sources(${native_target} PRIVATE "${SPOOL_TVOS_ASSETS}") endif() - spool_configure_tvos_simulator_entitlements(${native_target}) -endfunction() - -# Both the production application and each isolated native test bundle need -# their own application identifier in the simulator's Keychain entitlement. -function(spool_configure_tvos_simulator_entitlements) - string(TOLOWER "${CMAKE_OSX_SYSROOT}" tvos_sysroot) - if(tvos_sysroot MATCHES "appletvsimulator") - # Simulator application/Keychain entitlements belong in Mach-O sections, - # not the macOS code signature, where these are restricted entitlements. - foreach(target IN LISTS ARGN) - get_target_property(identifier ${target} MACOSX_BUNDLE_GUI_IDENTIFIER) - set(xml "${CMAKE_CURRENT_BINARY_DIR}/${target}-simulator.xcent") - set(der "${xml}.der") - file(CONFIGURE OUTPUT "${xml}" CONTENT -" - - -application-identifierSPOOLSMOKE.${identifier} -com.apple.developer.team-identifierSPOOLSMOKE -keychain-access-groupsSPOOLSMOKE.${identifier} - -") - add_custom_command(OUTPUT "${der}" - COMMAND xcrun derq query -f xml -i "${xml}" -o "${der}" --raw - DEPENDS "${xml}" - VERBATIM) - target_sources(${target} PRIVATE "${der}") - target_link_options(${target} PRIVATE - "LINKER:-sectcreate,__TEXT,__entitlements,${xml}" - "LINKER:-sectcreate,__TEXT,__ents_der,${der}") - set_property(TARGET ${target} APPEND PROPERTY LINK_DEPENDS "${xml}" "${der}") - endforeach() - endif() + spool_configure_apple_simulator_entitlements(${native_target}) endfunction() diff --git a/docs/providers.md b/docs/providers.md index f9dae04c..1ccf49ee 100644 --- a/docs/providers.md +++ b/docs/providers.md @@ -141,10 +141,13 @@ assistive technology. Compact login tiles retain their lock badge above the stam **Profiles & servers** shows each set with its server(s), its startup choice and Add profile, then one tile per person. Tiles carry one short state (Watching, -Opening…, PIN required, Couldn't open, Sign in again, Removing…). An actionable -failure appears once beside its profile as an accessible alert, never as a raw -provider code or duplicated toast. A pending switch can be cancelled with Back or -the remotely focusable Cancel button, leaving the +Opening…, PIN required, Connection issue, Sign in again, Removing…). Activation +failures appear beside their profile as an accessible alert. A failed operation +on a running account also warns on Home and emits a notification: a live provider +runtime does not establish server reachability or valid credentials. A successful +library request clears a connection failure; local configuration reads do not. +Authentication failures require signing in again. A pending switch can be +cancelled with Back or the remotely focusable Cancel button, leaving the current viewer unchanged. Every tile has a menu (Menu key, hold, right-click) with Remove, even while its activation is pending or has failed; removal cancels the pending activation and never requires a successful one. Selection returns Home only @@ -157,6 +160,21 @@ can be cancelled, retried or removed without waiting behind a login spinner. An incompatible catalogue update does not block signing in to an already installed, validated provider; the incompatible package itself still cannot be installed. +Startup schedules saved identity/settings restoration before loading the full +QML shell; disk and network work remain asynchronous. Home distinguishes its +initial loading state from partially available content and keeps a small +**Loading more…** indicator while another account or shelf is pending. When a +later inventory adds libraries, Home refreshes again rather than treating an +earlier partial inventory as complete. Surviving Home shelves keep their native +models, while row insertions and moves update the view in place and preserve the +focused card's viewport position. Existing library-grid rows and artwork remain +visible during background refreshes. + +Provider result objects omit properties whose JavaScript value is `undefined`, +including unknown optional playback facts such as source size or runtime. This +does not coerce explicit `null` into a valid media fact, change array entries, or +relax the bridge's node/byte limits. + Add profile and Sign in again carry the selected server into setup; the viewer does not re-enter its address. `beginSetup(moduleId, accountId, purpose)` validates that the selected account belongs to the provider. Login QML receives only diff --git a/flake.nix b/flake.nix index 76111190..b0a39d68 100644 --- a/flake.nix +++ b/flake.nix @@ -789,7 +789,8 @@ }; native = pkgs.mkShell { - packages = nativePackages pkgs; + packages = nativePackages pkgs ++ pkgs.lib.optionals pkgs.stdenv.hostPlatform.isLinux + (with pkgs; [ nginxStable iproute2 util-linux ethtool iputils python3Packages.h2 ]); shellHook = nativeShellHook pkgs; }; diff --git a/providers/bundled/spool.plex-0.2.2.szo b/providers/bundled/spool.plex-0.2.2.szo deleted file mode 100644 index 2239f6b936608232d79f25d92eb46a3391330947..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 58317 zcmV(rK<>XNwJ-gk0KfwPtaAWLL$C`Z@OIlR-9)7{QAYFIa>*3E<^18oXTfnCvoQKy zF<2ay32YGowE(XGuK?TnX%{ot{O7EkjoHJJ?exZEVnrzBuHQ{>s1UYoYO9xg{qDIVo?+9iw;6aszOupgFK1qP}PdMUsx82g<;7C+?H z7_0Sj=EmCh`Xpum_{yIEmjz&ekbr=IIk;#v8iWhLM2E&i#05rPS(F(?IP>DaOng`d zjJz z=XOQWpEsYKfr{^43>;TH{d=r>vxMK7AGKumFHLwwGinni;W{KYQ2VqH%@&=)H+z2l zEdJ*Z$QL64l6a(^g%JPkTCAT>k+XDmaK7GYH=>*di1zF(ThXt49m@`p;Kjic*`u@| z*lxb|+X5|v$>^lZ?tzu#|5)BjfzhX*r+4Pas0G9P72UXLuN@YRw=2UcLQyAw_TUEj zxiwg%#FcM>%6VHDeu@$MHf4^C8jpG#HI_cOq}V#vXI|wyJ1X(ULsen|!^~-T_Wc`~ z?D(X8(pQYzbWGwKRU}WZnJ@v2ko_U36hS2dg*;;<>#pmsYoyaUA1SQ7L+UW7{Fk6Ept8$iVpURn4 zAUBQre5BSV8H{_O%2az|l0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otd)(QH zLJOLE(dmEy7e)qaZ^f3(j!~{gif>=JX{O3S= zBr@rFod`_}uy$z^QQym1iDT5qGJDv>O=@k7a{gp&3prPqp{;P5GE3WM7t}I!U<#d& zix$$0&Xn~R6Y$$1L>JzCPWD0aMd`pB^6P8H?Id~L0(tJQ5mG;FNIg-@6%^MvzS)xp zhE&G^Fr^*c!dn-JVB`+iR#NA7LQ#Oejf(p%jl(|NDtoa;^U(xlV6?M)(ze_?M?7xd z{?k3hCwH&0Un;jisy#n55ucZH4<~^fhYn55PjZSX#8+(`$2L%QN zeb+>#zY&3&hsqpXpb1R583s=^su~bXMoySNeha7O&M{=L@i$tB(22W)Ouy)MMg@@~@zyM(k7 zE1~+Ndq*7_K+|d*Ss=yTUwAGy49`N`&JBrCI|Rr3DeGR;j_`>#>v7QeW9J8%Vs;Nc z{*+QSD!t4~Bg1n!X^>sh@e?ZT2A6HRwr#eLInASZ%D!E-M*b9RJlwGnTB`)^v~*As7S1 z0BjcJ?L2k~jDrhNQ${Ne!oJP;OjG{xy1po?$1J8!$scw4bqbH=l({Tr{UsceGhQd5 zTbK&p2q;pwUhhc2lFCLw)dJaGf0dnQ@y}`g;E}y58h4I8^qZ)g8ykU3bTP49BoS!r y;CD)^4kEMYDSaw;p$86)MzN#Hl?!*zAx1 diff --git a/providers/bundled/spool.plex-0.2.3.szo b/providers/bundled/spool.plex-0.2.3.szo new file mode 100644 index 0000000000000000000000000000000000000000..7a89bb76d02e2f499f90d150640c2b56f977b4bb GIT binary patch literal 58368 zcmV(rK<>XNwJ-gk0KfwPbaMduLYxaD09V^R-9+UyQBLQ#<&w}ZkQYl(Y%U=B|FFW& z>h=GR`-c&=0ImS70Ii>Paf8i&&dS-CMJ(A)XHY6ugi`MM&2)xZkw=TguK7e*%n$g! z*;@KaZtbcZ$3It7!Cg;R)_a8QMDb$4zLb38$8zjE#R)31CvudlE%q#zy)C&JxhmNb zGQ@9rTyLlAsU7Th)3KoEh4~~k742>&bMiR!n_zx2!)&X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SLFm7jx+I2jcg+;e;3 zSEhiiYBB|Ln$G#TbkDZ#2W3vsoO0a zith##omitf->{_BQKf77W?A~m4q^PKKYzr_w#~+!!I%erX+$rlMD8k6J8 z(q0Dw3qgPUoKUn328qRUJPbOf~Aqir_ xbECL`6pmaW_l5*f5I;$LSSOK5qbas literal 0 HcmV?d00001 diff --git a/providers/lock.json b/providers/lock.json index aaff7549..5377b8aa 100644 --- a/providers/lock.json +++ b/providers/lock.json @@ -18,9 +18,9 @@ { "id": "spool.plex", "appleAppStore": true, - "version": "0.2.2", - "archive": "bundled/spool.plex-0.2.2.szo", - "sha256": "7ce4de12407c612cdceebb11980aa5814832c4713856a2d356f629cc4f30cad1" + "version": "0.2.3", + "archive": "bundled/spool.plex-0.2.3.szo", + "sha256": "67dc4482d80114ba6a1c321bb3a8f5fab0d4194dee27b80ce5e68cd568d5e3da" }, { "id": "spool.stremio", diff --git a/qml/browse/RowStackView.qml b/qml/browse/RowStackView.qml index 7705ee5b..c8d3b9dd 100644 --- a/qml/browse/RowStackView.qml +++ b/qml/browse/RowStackView.qml @@ -61,7 +61,9 @@ FocusScope { readonly property alias contentY: sectionList.contentY readonly property int sectionCount: sections ? sections.length : 0 - property var sectionObjects: [] + ListModel { + id: sectionModel + } property bool sectionObjectsReady: false onSectionsChanged: if (sectionObjectsReady) updateSectionObjects() @@ -77,32 +79,75 @@ FocusScope { } } - // Re-publishing a card model is not replacing its section. Keep descriptor - // objects (and therefore row delegates) when the section topology is stable. + // Mutate the view's model in place: assigning a replacement JS array resets + // every row, even when its descriptor object was reused. function updateSectionObjects() { - // sectionsChanged precedes reevaluation of dependent bindings in some - // QML delivery orders. Reconcile the published payload, not sectionCount. const nextCount = sections ? sections.length : 0 - let sameSections = sectionObjects.length === nextCount - for (let index = 0; sameSections && index < nextCount; ++index) { - const previous = sectionObjects[index].descriptor - const next = sections[index] - sameSections = previous.key === next.key && previous.contextSource === next.contextSource + const selectedKey = currentSection >= 0 && currentSection < sectionModel.count ? String(sectionModel.get( + currentSection).sectionObject.descriptor.key) : + null + const selectedRow = currentRow() + const restoreFocus = selectedRow && activeFocus && Metrics.keyboardFocusActive && !pointerNavigationPending + const selectedIndex = selectedRow ? selectedRow.currentIndex : -1 + const screenY = restoreFocus ? selectedRow.mapToItem(sectionList, 0, 0).y : 0 + let structureChanged = false + let anchor = -1 + for (let index = 0; index < nextCount; ++index) { + const key = String(sections[index].key) + let existing = index + while (existing < sectionModel.count && String(sectionModel.get(existing).sectionObject.descriptor.key) + !== key) + ++existing + if (existing < sectionModel.count) { + if (existing !== index) { + sectionModel.move(existing, index, 1) + structureChanged = true + } + sectionModel.get(index).sectionObject.descriptor = sections[index] + } else { + const sectionObject = sectionObjectComponent.createObject(root, { + "descriptor": sections[index] + }) + sectionModel.insert(index, { + "sectionObject": sectionObject + }) + structureChanged = true + } + if (key === selectedKey) + anchor = index } - if (sameSections) { - for (let index = 0; index < nextCount; ++index) - sectionObjects[index].descriptor = sections[index] + while (sectionModel.count > nextCount) { + const removed = sectionModel.get(nextCount).sectionObject + sectionModel.remove(nextCount) + structureChanged = true + removed.destroy() + } + if (anchor >= 0) { + currentSection = anchor + // An insertion can push the focused row out of the zero-buffer view. + // Restore its card and screen position before the next frame. + if (restoreFocus && structureChanged) { + sectionList.positionViewAtIndex(anchor, ListView.Contain) + sectionList.forceLayout() + const row = currentRow() + if (row) { + row.currentIndex = selectedIndex + const desiredY = sectionList.contentY + row.mapToItem(sectionList, 0, 0).y - screenY + const lastY = Math.max(sectionList.originY, sectionList.originY + sectionList.contentHeight + - sectionList.height) + sectionList.contentY = Math.max(sectionList.originY, Math.min(lastY, desiredY)) + row.focusList() + } + } return } - const previousObjects = sectionObjects - const nextObjects = [] - for (let index = 0; index < nextCount; ++index) - nextObjects.push(sectionObjectComponent.createObject(root, { - "descriptor": sections[index] - })) - sectionObjects = nextObjects - for (let index = 0; index < previousObjects.length; ++index) - previousObjects[index].destroy() + const previousIndex = Math.min(currentSection, nextCount - 1) + let fallback = nextPopulated(previousIndex, 1) + if (fallback < 0) + fallback = nextPopulated(previousIndex, -1) + if (fallback < 0) + fallback = nextPopulated(0, 1) + currentSection = fallback } function sectionAt(index) { @@ -316,7 +361,7 @@ FocusScope { id: sectionList anchors.fill: parent - model: root.sectionObjects + model: sectionModel header: root.header footer: root.footer spacing: root.rowSpacing @@ -343,8 +388,8 @@ FocusScope { id: mediaRow required property int index - required property var modelData - readonly property var sectionDescriptor: modelData.descriptor + required property var sectionObject + readonly property var sectionDescriptor: sectionObject.descriptor width: sectionList.width title: String(sectionDescriptor.title || "") diff --git a/qml/pages/AccountsPage.qml b/qml/pages/AccountsPage.qml index 40c672c3..97c3caee 100644 --- a/qml/pages/AccountsPage.qml +++ b/qml/pages/AccountsPage.qml @@ -104,10 +104,10 @@ FocusScope { return "pending" if (rows.some(account => account.needsSignIn)) return "signIn" - if (rows.some(account => account.running && account.enabled)) - return "active" if (rows.some(account => account.connectionState === "failed")) return "failed" + if (rows.some(account => account.running && account.enabled)) + return "active" if (rows.some(account => account.locked)) return "locked" if (rows.some(account => account.connectionState === "choose")) @@ -128,7 +128,7 @@ FocusScope { case "signIn": return "Sign in again" case "failed": - return "Couldn't open" + return "Connection issue" case "locked": return "PIN required" case "starting": @@ -203,7 +203,8 @@ FocusScope { return } // Any of the person's servers will do: activation brings the rest along. - const account = entry.accounts.find(row => !row.needsSignIn) || entry.accounts[0] + const account = entry.accounts.find(row => row.connectionState === "failed" && !row.needsSignIn) + || entry.accounts.find(row => !row.needsSignIn) || entry.accounts[0] pendingAccountId = account.id Providers.useAccount(account.id) } diff --git a/qml/pages/HomePage.qml b/qml/pages/HomePage.qml index a7b3b241..2b19c5cf 100644 --- a/qml/pages/HomePage.qml +++ b/qml/pages/HomePage.qml @@ -13,9 +13,34 @@ FocusScope { property var shell property var uiTransitionToken: 0 readonly property bool directionRelease: rows.directionRelease + readonly property bool pendingContent: !Providers.restored || Home.loading || Providers.accounts.some(account + => account.enabled + && !account.removing + && !account.needsSignIn + && account.connectionState + === "starting") + readonly property bool hasHomeContent: homeLibraries.length > 0 || Home.resumeItems.count > 0 + || Home.nextUpItems.count > 0 || Home.latestLibraryRows.some(row + => row.model + && row.model.count + > 0) + readonly property bool initialLoading: pendingContent && !hasHomeContent + readonly property string connectionWarning: Providers.accounts.filter(account => account.enabled && ( + account.needsSignIn + || account.connectionState + === "failed")).map(account + => String( + account.detail + || account.providerName) + + ": " + String( + account.errorText + || (account.needsSignIn + ? "Sign in again to use this profile." : + "Couldn't reach this server."))).join( + "\n") // An all-hidden library row has management controls instead of cards. - readonly property bool contentReady: rows.firstRowReady || !Providers.hasAccounts || (homeLibraries.length === 0 && - !Home.loading) + readonly property bool contentReady: initialLoading || rows.firstRowReady || !Providers.hasAccounts || ( + homeLibraries.length === 0 && !pendingContent) property int libraryRevision: 0 readonly property var homeLibraries: { // Read the signals' properties so scoped identity/visibility changes @@ -112,7 +137,7 @@ FocusScope { const row = latest[index] const rowIndex = Number(row && row.rowIndex !== undefined ? row.rowIndex : index) sections.push({ - "key": "latestLibrary", + "key": "latestLibrary:" + String(row.libraryId), "title": row && row.title ? row.title : "Recently Added", "model": row && row.model ? row.model : null, "kind": row && row.kind ? row.kind : "poster", @@ -154,19 +179,20 @@ FocusScope { }, App, shell, section ? section.model : null, index) } - // With nothing on Home, or when Home providers are filtered, the only - // control above the rows is "Show all". + // Controls above the rows remain reachable even while the first load is pending. function edgeUp() { - if (allProvidersButton.visible) + if (accountsButton.visible) + InputKeys.focus(accountsButton) + else if (allProvidersButton.visible) InputKeys.focus(allProvidersButton) else if (root.shell) root.shell.focusNavBar() } function routeKey(key, phase, repeat) { - if (allProvidersButton.activeFocus) { + if (allProvidersButton.activeFocus || accountsButton.activeFocus) { if (phase === "press" && key === Qt.Key_Down) - return rows.focusPreferred("libraries") + return initialLoading || rows.focusPreferred("libraries") if (phase === "press" && key === Qt.Key_Up) { if (root.shell) root.shell.focusNavBar() @@ -174,6 +200,15 @@ FocusScope { } return InputKeys.isDirection(key) || InputKeys.isAccept(key) } + if (initialLoading && InputKeys.isDirection(key)) { + if (phase === "press") { + if (key === Qt.Key_Up && root.shell) + root.shell.focusNavBar() + else if (key === Qt.Key_Down) + edgeUp() + } + return true + } if (phase === "press" && InputKeys.isDirection(key) && (!rows.activeFocus || (homeLibraries.length === 0 && Home.resumeItems.count === 0 && Home.nextUpItems.count === 0 @@ -186,10 +221,17 @@ FocusScope { } function activate() { + if (accountsButton.activeFocus) { + if (shell) + shell.pushRoute("accounts") + return + } if (allProvidersButton.activeFocus) { Home.showAllProviders() return } + if (initialLoading) + return if (!rows.activeFocus) { edgeUp() return @@ -241,6 +283,21 @@ FocusScope { font.pixelSize: Metrics.titleSizePx Layout.fillWidth: true } + RowLayout { + visible: root.pendingContent && root.hasHomeContent + spacing: Metrics.scaled(8) + BusySpinner { + Layout.preferredWidth: Metrics.scaled(18) + Layout.preferredHeight: width + running: parent.visible + color: Theme.textMuted + } + SecondaryText { + text: "Loading more…" + color: Theme.textMuted + font.pixelSize: Metrics.metaSizePx + } + } ActionButton { id: allProvidersButton visible: Home.providerScopeMessage.length > 0 @@ -257,11 +314,47 @@ FocusScope { Accessible.role: Accessible.StaticText Accessible.name: text } + RowLayout { + Layout.fillWidth: true + visible: root.connectionWarning.length > 0 + spacing: Metrics.gapPx + SecondaryText { + Layout.fillWidth: true + text: root.connectionWarning + color: Theme.errorText + wrapMode: Text.WordWrap + } + ActionButton { + id: accountsButton + text: "Profiles & servers" + onClicked: if (root.shell) + root.shell.pushRoute("accounts") + } + } + } + + Column { + anchors.centerIn: parent + visible: root.initialLoading + spacing: Metrics.scaled(16) + BusySpinner { + anchors.horizontalCenter: parent.horizontalCenter + width: Metrics.scaled(40) + height: width + running: root.initialLoading + color: Theme.textMuted + } + SecondaryText { + text: "Loading your libraries…" + color: Theme.textMuted + font.pixelSize: Metrics.bodySizePx + } } RowStackView { id: rows + visible: !root.initialLoading anchors.left: parent.left anchors.right: parent.right anchors.top: homeHeader.bottom diff --git a/qml/pages/LibraryGridPage.qml b/qml/pages/LibraryGridPage.qml index ddc86cb3..0eb1e53a 100644 --- a/qml/pages/LibraryGridPage.qml +++ b/qml/pages/LibraryGridPage.qml @@ -824,10 +824,9 @@ FocusScope { // The preview controls stay resident. Only their bound item changes, so // title and synopsis update immediately while artwork decodes separately. readonly property var paneItem: { - const index = grid.currentIndex - if (!listMode || !Browse.items || index < 0 || index >= Browse.items.count) + if (!listMode || !grid.currentItem) return null - return Browse.items.get(index) + return grid.currentItem.item } onListModeChanged: { @@ -842,7 +841,7 @@ FocusScope { // Kodi-style media info for the focused item, formatted natively in one // call so scrolling never iterates stream lists from JS. readonly property var mediaInfo: { - if (grid.currentIndex < 0 || grid.count <= 0) + if (grid.currentIndex < 0 || !grid.currentItem || !grid.currentItem.item || !grid.currentItem.item.movieId) return null const smart = String(Settings.values["audio/trackMode"] || "Default") === "Smart" const language = Settings.values["audio/language"] || Settings.values["subtitles/language"] || "" diff --git a/qml/pages/ProviderDetailsPage.qml b/qml/pages/ProviderDetailsPage.qml index 5bb16160..ee68d5a1 100644 --- a/qml/pages/ProviderDetailsPage.qml +++ b/qml/pages/ProviderDetailsPage.qml @@ -258,9 +258,8 @@ FocusScope { Layout.fillWidth: true spacing: Metrics.scaled(8) function controls() { - return [settingsButton, openButton, homeButton, cancelButton, removeAccountButton].filter(item - => item.visible - && item.enabled) + return [settingsButton, playbackButton, openButton, homeButton, cancelButton, + removeAccountButton].filter(item => item.visible && item.enabled) } AppText { Layout.fillWidth: true @@ -282,6 +281,14 @@ FocusScope { part => part && part.length > 0).join(" · ") wrapMode: Text.WordWrap } + SecondaryText { + Layout.fillWidth: true + text: { + const overrides = Settings.serverOverrides + return Settings.serverPlaybackSummary(accountRow.modelData.id) + } + wrapMode: Text.WordWrap + } SecondaryText { Layout.fillWidth: true visible: !accountRow.modelData.hasSettings @@ -299,6 +306,18 @@ FocusScope { Flow { Layout.fillWidth: true spacing: Metrics.scaled(12) + ActionButton { + id: playbackButton + readonly property string focusKey: "playback:" + accountRow.modelData.id + text: "Playback settings" + enabled: !accountRow.modelData.removing + onClicked: { + root.focusControl(playbackButton) + root.shell.pushRoute("settings", { + "sourceId": accountRow.modelData.id + }) + } + } ActionButton { id: settingsButton readonly property string focusKey: "settings:" + accountRow.modelData.id diff --git a/qml/pages/SettingsPage.qml b/qml/pages/SettingsPage.qml index 432216c5..c7a65b20 100644 --- a/qml/pages/SettingsPage.qml +++ b/qml/pages/SettingsPage.qml @@ -8,6 +8,8 @@ import "SettingsNavigation.js" as SettingsNavigation FocusScope { id: root + property string sourceId: "" + readonly property bool serverSettings: sourceId.length > 0 property var shell property var uiTransitionToken: 0 property int currentIndex: -1 @@ -27,9 +29,9 @@ FocusScope { property var searchResultLocation: null property var categoryLocations: ({}) property string revealedRowKey: "" - readonly property string pageTitle: pageMode === "search" ? "Search settings" : pageMode === "category" - ? SettingsNavigation.categoryTitle(categoryId) : - "Settings" + readonly property string pageTitle: serverSettings ? "Playback settings" : pageMode === "search" + ? "Search settings" : pageMode === "category" + ? SettingsNavigation.categoryTitle(categoryId) : "Settings" readonly property bool modalVisible: certificateManagerVisible || choiceDialogVisible || diagnosticsExportVisible || mpvFolderDialogVisible || homeProvidersVisible property bool homeProvidersVisible: false @@ -40,6 +42,21 @@ FocusScope { refreshSettingsFilter(false) }) + function configureServer(id) { + finishRowEdit() + const changed = sourceId !== id + sourceId = id + if (changed) { + pageMode = id.length ? "category" : "index" + categoryId = id.length ? "streaming" : "" + searchQuery = "" + priorSearchLocation = null + searchResultLocation = null + expandedGroups = ({}) + buildSettingsRowsSource() + } + } + function inputCompositionActive() { const focused = root.Window.window ? root.Window.window.activeFocusItem : null return Boolean(focused && focused.inputMethodComposing) @@ -200,7 +217,8 @@ FocusScope { finishRowEdit() editingKey = row.key editingInitialValue = Settings.values[row.key] - SettingsSync.beginEdit(row.key) + if (!serverSettings) + SettingsSync.beginEdit(row.key) } function finishRowEdit() { @@ -208,7 +226,8 @@ FocusScope { return const key = editingKey editingKey = "" - SettingsSync.endEdit(key, Settings.values[key] !== editingInitialValue) + if (!serverSettings) + SettingsSync.endEdit(key, Settings.values[key] !== editingInitialValue) } ListModel { @@ -219,6 +238,8 @@ FocusScope { onDownloadsAvailableChanged: refreshSettingsFilter(false) function rowAvailable(row) { + if (row.resetKey) + return Settings.hasServerOverride(row.resetKey, sourceId) if (row.key === "providers/updates" && !Store.storeAvailable) return false if (row.key === "action/connectionSpeed" && !ProviderCapabilities.speedTest) @@ -312,6 +333,8 @@ FocusScope { for (let index = 0; index < allSettingsRows.length; ++index) { const entry = allSettingsRows[index] const row = rowsByKey[entry.rowKey] + if (row.resetKey && !rowAvailable(row)) + continue if (pageMode === "search") { if (SettingsNavigation.matchesSearch(row, searchQuery, rowOptions(row))) visibleRows.push(descriptor(row.key, entry.sourceIndex, false, false)) @@ -365,7 +388,14 @@ FocusScope { } } for (let index = 0; index < schema.length; ++index) { - const row = schema[index] + const original = schema[index] + if (serverSettings && !original.perServer) + continue + const row = serverSettings ? Object.assign({}, original) : original + if (serverSettings && row.type === "toggle") { + row.type = "select" + row.serverToggle = true + } rowMap[row.key] = row sourceRows.push({ "rowKey": row.key, @@ -373,6 +403,25 @@ FocusScope { "group": row.categoryId, "sourceIndex": index * 2 }) + if (serverSettings && row.type === "slider") { + const resetKey = "action/useDefault/" + row.key + rowMap[resetKey] = { + "key": resetKey, + "resetKey": row.key, + "title": "Use default", + "description": row.title, + "categoryId": row.categoryId, + "group": row.group, + "level": row.level, + "type": "action" + } + sourceRows.push({ + "rowKey": resetKey, + "detailLevel": SettingsNavigation.detailLevel(row), + "group": row.categoryId, + "sourceIndex": index * 2 + 1 + }) + } if (row.key === "action/accounts") sourceRows.push({ "rowKey": "action/settingsSync", @@ -491,6 +540,11 @@ FocusScope { } function settingsValue(row) { + if (serverSettings) { + const defaults = Settings.values + const overrides = Settings.serverOverrides + return Settings.effectiveValue(row.key, sourceId) + } switch (row.key) { case "subtitles/language": return Settings.subtitleLanguageIndex @@ -503,6 +557,21 @@ FocusScope { } function rowDescription(row) { + let capability = "" + if (row.key === "playback/streamingHttpVersion") { + const capabilities = Player.transportCapabilities + if (String(settingsValue(row)) === "http3" && capabilities && capabilities.http3 === false) + capability = " · This build uses HTTP/2 with HTTP/1.1 fallback" + if (capabilities && capabilities.http2 === false && String(settingsValue(row)) !== "http1") + capability = " · This build uses HTTP/1.1" + } + if (serverSettings && row.perServer) { + const overrides = Settings.serverOverrides + const reason = availabilityReason(row) + return (Settings.hasServerOverride(row.key, sourceId) ? "Custom" : "Default · Follows your settings") + ( + row.description ? " · " + row.description : "") + (reason.length ? " · " + reason : "") + + capability + } if (pageMode === "search") return SettingsNavigation.categoryTitle(row.categoryId) + " · " + row.group + (availabilityReason( row).length ? " · " @@ -539,7 +608,7 @@ FocusScope { const labels = rowOptions(row) return index >= 0 && index < labels.length ? labels[index] : row.description } - return row.description || "" + return (row.description || "") + capability } // Choice labels may carry a "%1" placeholder for the user's preferred @@ -604,6 +673,14 @@ FocusScope { } function rowOptions(row) { + if (serverSettings && row.perServer && row.type === "select") { + const defaults = Settings.values + const defaultValue = Settings.value(row.key) + const labels = row.serverToggle ? ["On", "Off"] : (row.choiceLabels || []) + const values = row.serverToggle ? [true, false] : (row.choiceValues || []) + const label = labels[valueIndex(values, defaultValue)] || String(defaultValue) + return ["Default (" + label + ")"].concat(labels) + } if (row.key === "i18n/locale") { const result = [] for (let index = 0; index < I18n.availableLocales.length; ++index) @@ -625,6 +702,8 @@ FocusScope { } function rowChoiceValues(row) { + if (serverSettings && row.perServer && row.type === "select") + return [null].concat(row.serverToggle ? [true, false] : (row.choiceValues || [])) if (row.key === "i18n/locale") return I18n.availableLocales if (row.key === "subtitles/language" || row.key === "audio/language") @@ -640,6 +719,11 @@ FocusScope { } function rowCurrentIndex(row) { + if (serverSettings && row.perServer && row.type === "select") { + const overrides = Settings.serverOverrides + return Settings.hasServerOverride(row.key, sourceId) ? valueIndex(rowChoiceValues(row), settingsValue(row)) : + 0 + } if (row.key === "subtitles/language") return Settings.subtitleLanguageIndex if (row.key === "audio/language") @@ -648,6 +732,13 @@ FocusScope { } function setRowValue(row, value, index) { + if (serverSettings) { + if (value === null) + Settings.resetServerValue(row.key, sourceId) + else + Settings.setServerValue(row.key, value, sourceId) + return + } switch (row.key) { case "subtitles/language": Settings.setSubtitleLanguageIndex(index) @@ -739,7 +830,9 @@ FocusScope { return } if (row.type === "action") { - if (row.key === "action/settingsSync" && shell) + if (row.resetKey) + Settings.resetServerValue(row.resetKey, sourceId) + else if (row.key === "action/settingsSync" && shell) shell.pushRoute("settingsSync") else if (row.key === "action/accounts" && shell) shell.pushRoute("accounts") @@ -887,7 +980,7 @@ FocusScope { restoreLocation(saved) return true } - if (pageMode === "category") { + if (pageMode === "category" && !serverSettings) { categoryLocations[categoryId] = location() const previousCategory = categoryId pageMode = "index" @@ -1112,6 +1205,9 @@ FocusScope { Connections { target: Settings + function onServerOverridesChanged() { + root.refreshSettingsFilter(false) + } function onSettingChanged(key) { // Value bindings update independently. Only availability changes // need to reconcile the rows and force another list layout. diff --git a/qml/primitives/MediaRow.qml b/qml/primitives/MediaRow.qml index d2fef089..eebf9101 100644 --- a/qml/primitives/MediaRow.qml +++ b/qml/primitives/MediaRow.qml @@ -92,15 +92,24 @@ FocusScope { return Array.isArray(value) ? "list" : value.rowCount !== undefined ? "item" : "other" } function bindModel() { + const selected = ModelAccess.at(listView.model, currentIndex) + const selectedLibraryId = cardKind === "library" ? String(selected.libraryId || "") : "" const kind = modelKind(root.model) if (kind === boundModelKind) { listView.model = root.model - return + } else { + boundModelKind = kind + listView.reuseItems = false + listView.model = root.model + listView.reuseItems = true + } + if (!publishingMove && selectedLibraryId.length > 0) { + const selectedIndex = libraryIndex(selectedLibraryId) + if (selectedIndex >= 0) + currentIndex = selectedIndex } - boundModelKind = kind - listView.reuseItems = false - listView.model = root.model - listView.reuseItems = true + syncViewCurrentIndex() + Qt.callLater(syncViewCurrentIndex) } Component.onCompleted: { diff --git a/qml/shell/AppShell.qml b/qml/shell/AppShell.qml index 70c2e875..b46ab2d9 100644 --- a/qml/shell/AppShell.qml +++ b/qml/shell/AppShell.qml @@ -160,7 +160,7 @@ KeyRouter { } focus: true backspaceNavigatesInTextInput: Platform.isTV - webOsScanCodes: Platform.isTV + webOsScanCodes: Platform.isWebOS tvOsRemote: Boolean(Platform.isTVOS) platformMayPairHolds: Platform.isAndroid && Platform.isTV diff --git a/qml/shell/KeyRouter.qml b/qml/shell/KeyRouter.qml index 94367124..f86601ba 100644 --- a/qml/shell/KeyRouter.qml +++ b/qml/shell/KeyRouter.qml @@ -88,6 +88,7 @@ FocusScope { focus: true onActiveTargetChanged: { flushHeldRelease() + stopSustaining() pressedDirectionKey = 0 } // A window that loses focus never sends the release for whatever was down @@ -95,6 +96,7 @@ FocusScope { onActiveFocusChanged: if (!activeFocus) { flushHeldRelease() stopSustaining() + pressedDirectionKey = 0 } Keys.priority: Keys.BeforeItem @@ -105,7 +107,9 @@ FocusScope { } function beginSustaining(key, modifiers) { - if (platformSendsRepeats) + // webOS already supplies native repeats. A lost physical release must + // not turn a single click into a timer-driven hold. + if (webOsScanCodes || platformSendsRepeats) return sustainedKey = key sustainedModifiers = modifiers diff --git a/qml/shell/RouteStack.qml b/qml/shell/RouteStack.qml index d38a3920..c41c0b7d 100644 --- a/qml/shell/RouteStack.qml +++ b/qml/shell/RouteStack.qml @@ -171,6 +171,8 @@ FocusScope { previous.visible = false } InputKeys.focus(item) + if (route === "settings" && root.shell) + item.configureServer(String((root.shell.routeArgs || {}).sourceId || "")) if (route === "subtitleSettings" && root.shell) { const args = root.shell.routeArgs || ({}) if (args.advanced && !item.advancedExpanded) { diff --git a/src/app/AppController.cpp b/src/app/AppController.cpp index 7f9b015a..5ac95e99 100644 --- a/src/app/AppController.cpp +++ b/src/app/AppController.cpp @@ -289,6 +289,7 @@ AppController::AppController( connect(m_provider, &Provider::errorOccurred, this, &AppController::setErrorText); connect(m_provider, &SourceHub::browseSourcesChanged, this, [this] { m_libraryListGeneration.invalidate(); + m_home->setLibrariesLoading(true); QSet accounts; for (Provider *source : m_provider->sources()) accounts.insert(source->id()); @@ -312,7 +313,9 @@ AppController::AppController( m_home->invalidate(); loadLibraries(); } - beginBrowse(); + const QString libraryId = m_browse->libraryId(); + const bool availableLibrary = !libraryId.isEmpty() && !m_libraries.libraryById(libraryId).id.isEmpty(); + beginBrowse(availableLibrary ? BrowseLoad::Refresh : BrowseLoad::Reset); }); connect(m_provider, &Provider::sessionStarted, this, [this]() { m_home->loadCachedPayload(); @@ -604,7 +607,8 @@ bool AppController::openLibraryById(const QString& libraryId) const QVariantMap defaultQuery = defaultLibraryQuery(library); m_browse->enterLibrary(library, defaultQuery); m_home->recordLibraryUse(library); - loadLibraryFilterOptions(beginBrowse(m_browse->query() == defaultQuery), library); + loadLibraryFilterOptions( + beginBrowse(m_browse->query() == defaultQuery ? BrowseLoad::UseCache : BrowseLoad::Reset), library); return true; } @@ -821,6 +825,7 @@ void AppController::playLocalFiles(const QList& urls, bool append) m_activePlaybackItem = {}; m_playingAccountId.clear(); m_playQueue->clear(); + m_settings->preparePlayback({}); m_player->playLocalFiles(urls); if (!m_player->sessionActive() && !m_player->errorText().isEmpty()) showToast(m_player->errorText()); @@ -1524,6 +1529,7 @@ QCoro::Task AppController::startPlayback(MovieItem playItem, bool startPau setBusy(false); if (!guard || !m_playbackLoadGeneration.isCurrent(generation)) co_return; + m_settings->preparePlayback(m_provider->accountOf(session.itemId)); m_player->play(session, startPaused); m_playingAccountId = m_provider->accountOf(session.itemId); if (!guard || !m_playbackLoadGeneration.isCurrent(generation)) @@ -1646,6 +1652,7 @@ void AppController::showToast(const QString& message) void AppController::loadLibraries() { m_prefetch->stop(); + m_home->setLibrariesLoading(true); const RequestGeneration::Token generation = m_libraryListGeneration.next(); Async::runLatest( this, m_catalog->fetchLibraries(), m_libraryListGeneration, generation, @@ -1653,9 +1660,11 @@ void AppController::loadLibraries() m_libraries.setLibraries(libraries); setBusy(false); refreshHomeRows(); + m_home->setLibrariesLoading(false); }, [this](const std::exception_ptr& error) { setBusy(false); + m_home->setLibrariesLoading(false); setErrorText(exceptionMessage(error)); }); } @@ -1697,7 +1706,7 @@ void AppController::showCurrentItemsPage(const PagedMovieItems& page, const QStr setBusy(false); } -RequestGeneration::Token AppController::beginBrowse(bool useWarmCache) +RequestGeneration::Token AppController::beginBrowse(BrowseLoad mode) { const BrowseDescriptor descriptor = m_browse->descriptor(); if (!descriptor.isValid() || !m_catalog->signedIn()) @@ -1713,11 +1722,14 @@ RequestGeneration::Token AppController::beginBrowse(bool useWarmCache) cacheKey = libraryCacheKey(library, query); } - m_browse->resetPaging(cacheKey); + if (mode == BrowseLoad::Refresh) + m_browse->beginRefresh(); + else + m_browse->resetPaging(cacheKey); m_prefetch->stop(); if (m_artwork) m_artwork->cancelPrefetches(); - if (useWarmCache) { + if (mode == BrowseLoad::UseCache) { const int cachedCount = m_browse->applyCachedPage(cacheKey); m_browse->setLoadingMore(true); if (cachedCount > 0) { @@ -1730,7 +1742,7 @@ RequestGeneration::Token AppController::beginBrowse(bool useWarmCache) } qInfo() << "library open: showing cached page while refreshing" << descriptor.name << cachedCount; } - } else { + } else if (mode == BrowseLoad::Reset) { m_browse->clear(); m_browse->setLoadingMore(true); } diff --git a/src/app/AppController.h b/src/app/AppController.h index e15e7f85..08b62343 100644 --- a/src/app/AppController.h +++ b/src/app/AppController.h @@ -217,7 +217,8 @@ class AppController final : public QObject { } void showCurrentItemsPage(const PagedMovieItems& page, const QString& cacheKey, bool append); void loadLibraryFilterOptions(RequestGeneration::Token generation, const LibraryItem& library); - RequestGeneration::Token beginBrowse(bool useWarmCache = false); + enum class BrowseLoad { Reset, UseCache, Refresh }; + RequestGeneration::Token beginBrowse(BrowseLoad mode = BrowseLoad::Reset); QCoro::Task startPlayback(MovieItem playItem, bool startPaused = false, bool forceTranscode = false, int audioStreamIndex = -2, int subtitleStreamIndex = -2, bool restartActive = false); // nullopt is an explicitly local internal operation. A user operation captures diff --git a/src/app/BrowseSessionController.cpp b/src/app/BrowseSessionController.cpp index 1ce620aa..5a5ffacb 100644 --- a/src/app/BrowseSessionController.cpp +++ b/src/app/BrowseSessionController.cpp @@ -177,6 +177,19 @@ void BrowseSessionController::resetPaging(const QString& cacheKey) emit pagingChanged(); } +void BrowseSessionController::beginRefresh() +{ + // The caller retires in-flight fetches, not the rows already on screen. + // Keep loaded blocks and the index, but free slots owned by those fetches. + m_blockTimer.stop(); + m_pendingBlocks.clear(); + m_abandonedBlocks.clear(); + m_wantedBlocks.clear(); + m_blockFailures.clear(); + cancelSeek(); + setLoadingMore(true); +} + void BrowseSessionController::resetSparseState() { m_blockTimer.stop(); diff --git a/src/app/BrowseSessionController.h b/src/app/BrowseSessionController.h index 4df42576..4db6340d 100644 --- a/src/app/BrowseSessionController.h +++ b/src/app/BrowseSessionController.h @@ -162,6 +162,7 @@ class BrowseSessionController final : public QObject { void clear(); void reset(); void resetPaging(const QString& cacheKey = {}); + void beginRefresh(); void setPage(const PagedMovieItems& page, const QString& cacheKey, bool append); void setLoadingMore(bool loading); // A requested block of a sparse listing arrived, or could not be had. diff --git a/src/app/HomeModelController.cpp b/src/app/HomeModelController.cpp index b34ddccc..14b97bc5 100644 --- a/src/app/HomeModelController.cpp +++ b/src/app/HomeModelController.cpp @@ -401,18 +401,37 @@ void HomeModelController::saveCachedPayload(const QJsonObject& payload) m_database->saveHomePayload(key, kHomePayloadSchemaVersion, payload); } +void HomeModelController::setLibrariesLoading(bool loading) +{ + if (m_librariesLoading == loading) + return; + m_librariesLoading = loading; + emit loadingChanged(); +} + void HomeModelController::refresh(const std::vector& libraries) { + const bool inventoryChanged = libraries.size() != m_allLibraries.size() + || !std::equal(libraries.begin(), libraries.end(), m_allLibraries.begin(), + [](const LibraryItem& next, const LibraryItem& current) { + return next.id == current.id && next.name == current.name + && next.collectionType == current.collectionType; + }); m_allLibraries = libraries; + if (!m_api || !m_api->signedIn()) + return; + if (m_loaded || m_refreshInFlight) { + if (!inventoryChanged) + return; + m_generation.invalidate(); + m_refreshInFlight = false; + m_loaded = false; + } std::vector selectedLibraries; for (const LibraryItem& library : libraries) { if (includesItem(library.id)) selectedLibraries.push_back(library); } - if (!m_api || !m_api->signedIn()) - return; - if (m_loaded || m_refreshInFlight) - return; const RequestGeneration::Token generation = m_generation.next(); m_refreshInFlight = true; @@ -841,6 +860,7 @@ void HomeModelController::reset() m_locallyPlayed.clear(); m_optimisticNextUp.clear(); m_refreshInFlight = false; + m_librariesLoading = false; m_loaded = false; m_networkResultsPublished = false; m_cacheGeneration.invalidate(); @@ -885,14 +905,20 @@ bool HomeModelController::updateLatestLibraryRows(std::vector nextSections; + nextSections.reserve(sections.size()); for (PendingLatestLibrarySection& pending : sections) { - auto model = std::make_unique(); - QQmlEngine::setObjectOwnership(model.get(), QQmlEngine::CppOwnership); + const auto existing = std::find_if(m_latestLibrarySections.begin(), m_latestLibrarySections.end(), + [&pending](const LatestLibrarySection& current) { return current.library.id == pending.library.id; }); + auto model = existing != m_latestLibrarySections.end() ? std::move(existing->model) : nullptr; + if (!model) { + model = std::make_unique(); + QQmlEngine::setObjectOwnership(model.get(), QQmlEngine::CppOwnership); + } model->setMovies(std::move(pending.items)); - m_latestLibrarySections.push_back({ pending.order, std::move(pending.library), std::move(model) }); + nextSections.push_back({ pending.order, std::move(pending.library), std::move(model) }); } + m_latestLibrarySections = std::move(nextSections); return true; } diff --git a/src/app/HomeModelController.h b/src/app/HomeModelController.h index dd031f2a..ee52fbf8 100644 --- a/src/app/HomeModelController.h +++ b/src/app/HomeModelController.h @@ -52,7 +52,7 @@ class HomeModelController final : public QObject { QVariantList latestLibraryRows() const; bool loading() const { - return m_refreshInFlight; + return m_refreshInFlight || m_librariesLoading; } QStringList hiddenProviderIds() const @@ -76,6 +76,7 @@ class HomeModelController final : public QObject { bool applyCachedPayload(const QJsonObject& payload); void loadCachedPayload(); void refresh(const std::vector& libraries); + void setLibrariesLoading(bool loading); void recordLibraryUse(const LibraryItem& library); void upsertResumeItem(MovieItem item, qint64 positionTicks); void updateResumeTicks(const QString& itemId, qint64 positionTicks); @@ -137,6 +138,7 @@ class HomeModelController final : public QObject { QSet m_locallyPlayed; QHash m_optimisticNextUp; bool m_refreshInFlight = false; + bool m_librariesLoading = false; bool m_loaded = false; bool m_networkResultsPublished = false; QStringList m_recentLibraryIds; diff --git a/src/app/SettingsController.cpp b/src/app/SettingsController.cpp index 2a61e298..37ada267 100644 --- a/src/app/SettingsController.cpp +++ b/src/app/SettingsController.cpp @@ -26,6 +26,7 @@ namespace Spool { namespace { + constexpr auto kServerOverridesKey = "playback/serverOverrides-v1"; constexpr auto kPlayerControlTooltipSessionsKey = "player/controlTooltipSessions"; constexpr int kPlayerControlTooltipSessionLimit = 3; @@ -219,6 +220,147 @@ QVariant SettingsController::value(const QString& key) const return {}; } +namespace { + QString serverKey(QString id) + { + // SourceHub scopes media with the first eight UUID hex digits. + return id.remove(QLatin1Char('-')).section(QLatin1Char(':'), 0, 0).left(8).toLower(); + } + QStringList overrideGroup(const QString& key) + { + if (key == QLatin1String("playback/manualStreamingBitrate") + || key == QLatin1String("playback/maxStreamingBitrateMbps")) + return { QStringLiteral("playback/manualStreamingBitrate"), + QStringLiteral("playback/maxStreamingBitrateMbps") }; + return { key }; + } +} + +QVariant SettingsController::effectiveValue(const QString& key, const QString& sourceId) const +{ + const auto rows = m_serverOverrides.value(serverKey(sourceId)).toMap(); + return rows.contains(key) ? rows.value(key) : value(key); +} + +bool SettingsController::hasServerOverride(const QString& key, const QString& sourceId) const +{ + return m_serverOverrides.value(serverKey(sourceId)).toMap().contains(key); +} + +void SettingsController::setServerValue(const QString& key, const QVariant& newValue, const QString& sourceId) +{ + const auto *spec = findSettingSpec(key); + const QString server = serverKey(sourceId); + if (server.size() != 8 || !spec || !spec->serverOverridable || !settingAcceptsValue(*spec, newValue)) + return; + auto rows = m_serverOverrides.value(server).toMap(); + for (const auto& member : overrideGroup(key)) + rows.insert(member, member == key ? normalizedSettingValue(*spec, newValue) : effectiveValue(member, sourceId)); + m_serverOverrides.insert(server, rows); + persistServerOverrides(); +} + +void SettingsController::resetServerValue(const QString& key, const QString& sourceId) +{ + const QString server = serverKey(sourceId); + auto rows = m_serverOverrides.value(server).toMap(); + for (const auto& member : overrideGroup(key)) + rows.remove(member); + if (rows.isEmpty()) + m_serverOverrides.remove(server); + else + m_serverOverrides.insert(server, rows); + persistServerOverrides(); +} + +void SettingsController::removeServerOverrides(const QString& sourceId) +{ + if (m_serverOverrides.remove(serverKey(sourceId))) + persistServerOverrides(); +} + +void SettingsController::retainServerOverrides(const QStringList& accountIds) +{ + QSet retained; + for (const auto& id : accountIds) + retained.insert(serverKey(id)); + bool changed = false; + for (auto it = m_serverOverrides.begin(); it != m_serverOverrides.end();) { + if (!retained.contains(it.key())) { + it = m_serverOverrides.erase(it); + changed = true; + } else + ++it; + } + if (changed) + persistServerOverrides(); +} + +void SettingsController::persistServerOverrides() +{ + if (m_database) + m_database->saveSetting(QString::fromLatin1(kServerOverridesKey), + QString::fromUtf8(QJsonDocument::fromVariant(m_serverOverrides).toJson(QJsonDocument::Compact))); + emit serverOverridesChanged(); +} + +QVariantMap SettingsController::playbackSnapshot(const QString& sourceId) const +{ + QVariantMap result; + for (const auto& spec : settingSpecs()) + if (spec.serverOverridable) + result.insert(keyString(spec), effectiveValue(keyString(spec), sourceId)); + return result; +} + +QString SettingsController::serverPlaybackSummary(const QString& sourceId) const +{ + const auto rows = m_serverOverrides.value(serverKey(sourceId)).toMap(); + if (rows.isEmpty()) + return QStringLiteral("Using your defaults"); + QStringList labels; + for (const auto& spec : settingSpecs()) { + const QString key = keyString(spec); + if (!rows.contains(key)) + continue; + const bool manual = effectiveValue(QStringLiteral("playback/manualStreamingBitrate"), sourceId).toBool(); + if ((key == QLatin1String("playback/maxStreamingBitrateMbps") && !manual) + || (key == QLatin1String("playback/manualStreamingBitrate") && manual)) + continue; + const QVariant current = rows.value(key); + QString label; + if (key == QLatin1String("playback/manualStreamingBitrate")) + label = QStringLiteral("Automatic bitrate limit"); + for (qsizetype i = 0; i < spec.choiceCount; ++i) + if (current.toString() == QLatin1String(spec.choices[i].value)) + label = QString::fromUtf8(spec.choices[i].label); + if (label.isEmpty()) + label = QString::fromUtf8(spec.title) + QStringLiteral(": ") + + (spec.type == SettingType::Toggle ? (current.toBool() ? QStringLiteral("On") : QStringLiteral("Off")) + : current.toString() + QLatin1String(spec.unit)); + labels.append(label); + if (labels.size() == 2) + break; + } + return labels.isEmpty() ? QStringLiteral("Custom playback settings") : labels.join(QStringLiteral(", ")); +} + +void SettingsController::preparePlayback(const QString& sourceId) +{ + if (!m_player) + return; + const auto get = [&](const char *key) { return effectiveValue(QString::fromLatin1(key), sourceId); }; + m_player->setForwardCacheSizeMiB(get("playback/forwardCacheSizeMiB").toInt()); + m_player->setThreadedStreaming(get("playback/threadedStreaming").toBool()); + m_player->setMaxStreamingThreads(get("playback/maxStreamingThreads").toInt()); + m_player->setForceStreamingThreads(get("playback/forceStreamingThreads").toBool()); + m_player->setStreamingExplore(get("playback/streamingExplore").toBool()); + m_player->setStreamingMemoryLoan(get("playback/streamingMemoryLoan").toBool()); + m_player->setMaxExtraStreamingMemoryMiB(get("playback/maxExtraStreamingMemoryMiB").toInt()); + m_player->setStreamingHttpVersion(get("playback/streamingHttpVersion").toString()); + m_player->setStreamingReceiveWindowMode(get("playback/streamingReceiveWindowMode").toString()); +} + QString SettingsController::audioDelayTargetLabel() const { return platformAudioRouteDisplayName(m_currentAudioOutput); @@ -237,6 +379,7 @@ QStringList SettingsController::localSettingKeys() keys.append(keyString(spec)); } keys.append(QString::fromLatin1(kPlayerControlTooltipSessionsKey)); + keys.append(QString::fromLatin1(kServerOverridesKey)); return keys; } @@ -275,6 +418,23 @@ QString SettingsController::stepDownRenderQuality() void SettingsController::applyLocalValues(const QVariantMap& storedValues) { + m_serverOverrides.clear(); + const auto storedOverrides + = QJsonDocument::fromJson(storedValues.value(QString::fromLatin1(kServerOverridesKey)).toByteArray()) + .object() + .toVariantMap(); + for (auto server = storedOverrides.cbegin(); server != storedOverrides.cend(); ++server) { + QVariantMap accepted; + const auto rows = server.value().toMap(); + for (auto row = rows.cbegin(); row != rows.cend(); ++row) { + const auto *spec = findSettingSpec(row.key()); + if (spec && spec->serverOverridable && settingAcceptsValue(*spec, row.value())) + accepted.insert(row.key(), normalizedSettingValue(*spec, row.value())); + } + if (!accepted.isEmpty()) + m_serverOverrides.insert(server.key(), accepted); + } + emit serverOverridesChanged(); for (const SettingSpec& spec : settingSpecs()) { if (!spec.persisted) @@ -845,6 +1005,26 @@ void SettingsController::applySchemaValue(const SettingSpec& spec, const QVarian if (m_player && (apply || !m_localSettingsLoaded)) m_player->setForceStreamingThreads(value.toBool()); break; + case SettingTarget::StreamingExplore: + if (m_player) + m_player->setStreamingExplore(value.toBool()); + break; + case SettingTarget::StreamingMemoryLoan: + if (m_player) + m_player->setStreamingMemoryLoan(value.toBool()); + break; + case SettingTarget::MaxExtraStreamingMemory: + if (m_player) + m_player->setMaxExtraStreamingMemoryMiB(value.toInt()); + break; + case SettingTarget::StreamingHttpVersion: + if (m_player) + m_player->setStreamingHttpVersion(value.toString()); + break; + case SettingTarget::StreamingReceiveWindowMode: + if (m_player) + m_player->setStreamingReceiveWindowMode(value.toString()); + break; case SettingTarget::LogStreamingPerformance: if (m_player && (apply || !m_localSettingsLoaded)) m_player->setLogStreamingPerformance(value.toBool()); diff --git a/src/app/SettingsController.h b/src/app/SettingsController.h index 33f49800..ae798204 100644 --- a/src/app/SettingsController.h +++ b/src/app/SettingsController.h @@ -44,6 +44,7 @@ class SettingsController final : public QObject { Q_PROPERTY(QStringList systemSubtitleFonts READ systemSubtitleFonts CONSTANT) Q_PROPERTY(QVariantList settingsSchema READ settingsSchema CONSTANT) Q_PROPERTY(QVariantMap values READ values NOTIFY settingsValuesChanged) + Q_PROPERTY(QVariantMap serverOverrides READ serverOverrides NOTIFY serverOverridesChanged) Q_PROPERTY( bool playerControlTooltipsEnabled READ playerControlTooltipsEnabled NOTIFY playerControlTooltipsEnabledChanged) Q_PROPERTY(bool remoteControlTargetEnabled READ remoteControlTargetEnabled NOTIFY remoteControlSettingsChanged) @@ -88,6 +89,19 @@ class SettingsController final : public QObject { // schema is built once, on that first read. QVariantMap values() const; Q_INVOKABLE QVariant value(const QString& key) const; + QVariantMap serverOverrides() const + { + return m_serverOverrides; + } + Q_INVOKABLE QVariant effectiveValue(const QString& key, const QString& sourceId = {}) const; + Q_INVOKABLE bool hasServerOverride(const QString& key, const QString& sourceId) const; + Q_INVOKABLE void setServerValue(const QString& key, const QVariant& value, const QString& sourceId); + Q_INVOKABLE void resetServerValue(const QString& key, const QString& sourceId); + Q_INVOKABLE void removeServerOverrides(const QString& sourceId); + Q_INVOKABLE QString serverPlaybackSummary(const QString& sourceId) const; + QVariantMap playbackSnapshot(const QString& sourceId) const; + void retainServerOverrides(const QStringList& accountIds); + void preparePlayback(const QString& sourceId); bool playerControlTooltipsEnabled() const { return m_playerControlTooltipSessions < 3; @@ -145,6 +159,7 @@ class SettingsController final : public QObject { void appearanceChanged(); void settingChanged(const QString& key); void settingsValuesChanged(); + void serverOverridesChanged(); void userValuesCommitted(QVariantMap values); void userValuesCommitFailed(); void settingsPersistenceFailed(QString message); @@ -153,6 +168,7 @@ class SettingsController final : public QObject { void errorOccurred(const QString& message); private: + void persistServerOverrides(); void submitValues(QVariantMap values, ChangeOrigin origin); void mirrorExternalValue(const QString& key, const QVariant& value); void applyExternalValue(const SettingSpec& spec, const QVariant& value); @@ -185,6 +201,7 @@ class SettingsController final : public QObject { int m_artworkWebpQuality = 75; int m_artworkJpegQuality = 82; QVariantMap m_values; + QVariantMap m_serverOverrides; bool m_nightModeEnabled = false; bool m_remoteControlTargetEnabled = true; bool m_toneMappingVisualizationEnabled = false; diff --git a/src/app/SettingsSchema.cpp b/src/app/SettingsSchema.cpp index bc3c66c2..4c798638 100644 --- a/src/app/SettingsSchema.cpp +++ b/src/app/SettingsSchema.cpp @@ -88,6 +88,11 @@ namespace { { "480", "480p" }, { "360", "360p" }, }; + constexpr SettingChoice kStreamingHttpChoices[] = { { "auto", "Automatic" }, + { "http3", "Prefer HTTP/3, with fallback" }, { "tcp", "TCP only (no HTTP/3)" }, { "http1", "HTTP/1.1 only" } }; + constexpr SettingChoice kReceiveWindowChoices[] + = { { "measured", "Measured" }, { "os-auto", "Let the system decide" }, { "4m", "4 MB (expert)" }, + { "8m", "8 MB (expert)" }, { "16m", "16 MB (expert)" } }; constexpr SettingChoice kMpvConfigModeChoices[] = { { "disabled", "Off" }, { "standard", "Standard mpv directory" }, { "custom", "Custom directory" } }; constexpr SettingChoice kSubtitleStylingChoices[] = { { "Auto", "Automatic" }, @@ -237,6 +242,13 @@ namespace { } // namespace +SettingSpec SettingSpec::perServer() const +{ + auto spec = *this; + spec.serverOverridable = true; + return spec; +} + SettingSpec SettingSpec::advanced() const { SettingSpec spec = *this; @@ -417,23 +429,29 @@ const QVector& settingSpecs() selectSpec("playback/maxStreamingHeight", "Streaming", "Resolution limit", "Anything larger is scaled down by the server", "0", kMaxStreamingHeightChoices, - SettingTarget::MaxStreamingHeight), + SettingTarget::MaxStreamingHeight) + .perServer(), toggleSpec("playback/manualStreamingBitrate", "Streaming", "Set my own bitrate limit", - "Otherwise the limit is measured for you", false, SettingTarget::ManualStreamingBitrate), + "Otherwise the limit is measured for you", false, SettingTarget::ManualStreamingBitrate) + .perServer(), pageSpec("action/connectionSpeed", "Streaming", "Connection speed", "", SettingType::Action), sliderSpec("playback/maxStreamingBitrateMbps", "Streaming", "Bitrate limit", "Anything higher is transcoded by the server", "120", 5, 1000, 5, "Mbps", SettingTarget::MaxStreamingBitrate) + .perServer() .whenSetTo("playback/manualStreamingBitrate", "true"), toggleSpec("playback/unlimitedLocalBitrate", "Streaming", "No limit on the local network", "Applies when the server sees you as local", false, SettingTarget::UnlimitedLocalBitrate) + .perServer() .advanced(), toggleSpec("playback/preferRemux", "Streaming", "Prefer remuxing", "Repackages instead of re-encoding where it can", true, SettingTarget::PreferRemux) + .perServer() .advanced(), sliderSpec("playback/forwardCacheSizeMiB", "Streaming", "Read-ahead buffer", "Applies the next time something plays", "32", 16, 2048, 1, "MB", SettingTarget::ForwardCacheSize, SettingNormalizer::PowerOfTwoRange) + .perServer() .advanced(), toggleSpec("playback/seekPreviews", "Streaming", "Seek previews", "Thumbnails while seeking. Off hides them and stops downloading them", true, SettingTarget::External), @@ -441,17 +459,51 @@ const QVector& settingSpecs() "Downloads with parallel range requests and adapts to the connection. Off uses standard mpv " "networking. Applies to the next playback", true, SettingTarget::ThreadedStreaming) + .perServer() .advanced(), sliderSpec("playback/maxStreamingThreads", "Streaming", "Maximum concurrent requests", "Most network requests in flight at once; not decoding threads or sockets. Adapts up to this " "limit. Applies to the next playback", "4", 1, 16, 1, "", SettingTarget::MaxStreamingThreads) + .perServer() .advanced() .whenSetTo("playback/threadedStreaming", "true"), toggleSpec("playback/forceStreamingThreads", "Streaming", "Use fixed request count", "Always uses the maximum instead of adapting the count. Other safety and optimization still " "apply. Applies to the next playback", false, SettingTarget::ForceStreamingThreads) + .perServer() + .advanced() + .whenSetTo("playback/threadedStreaming", "true"), + toggleSpec("playback/streamingExplore", "Streaming", "Keep learning the connection", + "Try measured request counts and ranges when playback has enough buffer", true, + SettingTarget::StreamingExplore) + .perServer() + .advanced() + .whenSetTo("playback/threadedStreaming", "true"), + toggleSpec("playback/streamingMemoryLoan", "Streaming", "Use spare memory for streaming", + "Temporarily borrow available memory without reducing the read-ahead buffer", true, + SettingTarget::StreamingMemoryLoan) + .perServer() + .advanced() + .whenSetTo("playback/threadedStreaming", "true"), + sliderSpec("playback/maxExtraStreamingMemoryMiB", "Streaming", "Extra streaming memory limit", + "Zero chooses a device-appropriate limit. Memory pressure reduces this automatically", "0", 0, 128, 8, + "MB", SettingTarget::MaxExtraStreamingMemory) + .perServer() + .advanced() + .whenSetTo("playback/threadedStreaming", "true"), + selectSpec("playback/streamingHttpVersion", "Streaming", "HTTP version", + "Uses a supported lower version if the server or this build cannot use your preference", "auto", + kStreamingHttpChoices, SettingTarget::StreamingHttpVersion) + .perServer() + .advanced() + .whenSetTo("playback/threadedStreaming", "true"), + selectSpec("playback/streamingReceiveWindowMode", "Streaming", "Receive window", + "Measured starts with system tuning. Fixed sizes are expert overrides and remain subject to system " + "limits", + "measured", kReceiveWindowChoices, SettingTarget::StreamingReceiveWindowMode) + .perServer() .advanced() .whenSetTo("playback/threadedStreaming", "true"), toggleSpec("playback/logStreamingPerformance", "Streaming", "Log streaming performance", @@ -704,7 +756,8 @@ const QVector& settingSpecs() spec.searchKeywords = "sources server login account provider"; if (portable.contains(key)) spec.syncPolicy = SettingSyncPolicy::PortableDefault; - else if (device.contains(key)) + else if (device.contains(key) || key.startsWith(QLatin1String("playback/streaming")) + || key == QLatin1String("playback/maxExtraStreamingMemoryMiB")) spec.syncPolicy = SettingSyncPolicy::DeviceOptIn; switch (spec.target) { case SettingTarget::AudioLanguage: @@ -865,6 +918,7 @@ QVariantList settingSchemaModel() { QStringLiteral("dependsOnKey"), QLatin1String(spec.dependsOnKey) }, { QStringLiteral("dependsOnValue"), QLatin1String(spec.dependsOnValue) }, { QStringLiteral("requiresHdrPlayback"), spec.requiresHdrPlayback }, + { QStringLiteral("perServer"), spec.serverOverridable }, { QStringLiteral("syncPolicy"), spec.syncPolicy == SettingSyncPolicy::PortableDefault ? QStringLiteral("portable") : spec.syncPolicy == SettingSyncPolicy::DeviceOptIn ? QStringLiteral("device") diff --git a/src/app/SettingsSchema.h b/src/app/SettingsSchema.h index 2a69d296..08de75ed 100644 --- a/src/app/SettingsSchema.h +++ b/src/app/SettingsSchema.h @@ -49,6 +49,11 @@ enum class SettingTarget { MaxStreamingThreads, ForceStreamingThreads, LogStreamingPerformance, + StreamingExplore, + StreamingMemoryLoan, + MaxExtraStreamingMemory, + StreamingReceiveWindowMode, + StreamingHttpVersion, PlayerVolumeSlider, AudioDelay, AudioOutput, @@ -150,8 +155,11 @@ struct SettingSpec { const char *destinationKey = ""; const char *destination = "category"; + bool serverOverridable = false; + // Declaration modifiers. Each returns a copy so specs read as one // expression: slider(...).advanced().onDesktop(). + SettingSpec perServer() const; SettingSpec advanced() const; SettingSpec expert() const; SettingSpec onDesktop() const; diff --git a/src/automation/LocalCommandServer.cpp b/src/automation/LocalCommandServer.cpp index 43742940..09097860 100644 --- a/src/automation/LocalCommandServer.cpp +++ b/src/automation/LocalCommandServer.cpp @@ -7,6 +7,7 @@ #include "common/AsyncTask.h" #include "platform/NativeAppWindow.h" #include "provider/SourceHub.h" +#include #include #include @@ -29,6 +30,7 @@ #include #include #include +#include #include #ifdef Q_OS_UNIX #include @@ -42,7 +44,10 @@ namespace { QStringLiteral("playback/accurateTrickplay"), QStringLiteral("playback/trickplayPreviewScalePercent"), QStringLiteral("appearance/uiScalePercent"), QStringLiteral("playback/renderQuality"), QStringLiteral("playback/threadedStreaming"), QStringLiteral("playback/maxStreamingThreads"), - QStringLiteral("playback/forceStreamingThreads"), QStringLiteral("playback/logStreamingPerformance") }; + QStringLiteral("playback/forceStreamingThreads"), QStringLiteral("playback/logStreamingPerformance"), + QStringLiteral("playback/streamingExplore"), QStringLiteral("playback/streamingMemoryLoan"), + QStringLiteral("playback/maxExtraStreamingMemoryMiB"), QStringLiteral("playback/streamingReceiveWindowMode"), + QStringLiteral("playback/streamingHttpVersion") }; QCoro::Task itemStateTask(SourceHub *sources, QString itemId, QString field, QJsonValue value) { if (field == QStringLiteral("played")) @@ -56,9 +61,21 @@ namespace { QJsonObject itemJson(const MovieItem& item, int index) { + QJsonArray sources; + for (const auto& source : item.mediaSources) { + int width = 0; + int height = 0; + for (const auto& stream : source.streams) { + width = qMax(width, stream.width); + height = qMax(height, stream.height); + } + sources.append(QJsonObject { { QStringLiteral("bitrate"), source.bitRate }, + { QStringLiteral("sizeBytes"), double(source.size) }, { QStringLiteral("width"), width }, + { QStringLiteral("height"), height } }); + } return { { QStringLiteral("index"), index }, { QStringLiteral("id"), item.id }, { QStringLiteral("title"), item.title }, { QStringLiteral("type"), item.itemType }, - { QStringLiteral("playable"), item.isPlayable() } }; + { QStringLiteral("playable"), item.isPlayable() }, { QStringLiteral("sources"), sources } }; } void closeSocket(QIODevice *socket, bool abort) { @@ -383,6 +400,8 @@ QJsonObject LocalCommandServer::items(const QJsonObject& args) const } return { { QStringLiteral("kind"), kind }, { QStringLiteral("offset"), offset }, { QStringLiteral("count"), count }, { QStringLiteral("items"), rows }, + { QStringLiteral("sortBy"), m_app->browse()->query().value(QStringLiteral("sortBy")).toString() }, + { QStringLiteral("sortOrder"), m_app->browse()->query().value(QStringLiteral("sortOrder")).toString() }, { QStringLiteral("hasMore"), kind == QStringLiteral("browse") && m_app->browse()->hasMore() } }; } @@ -559,6 +578,39 @@ void LocalCommandServer::dispatch(QIODevice *socket, const QJsonObject& request) return; } done(items(args)); + } else if (command == QStringLiteral("catalog")) { + const auto library = m_app->libraries()->libraryById(args.value(QStringLiteral("libraryId")).toString()); + const auto offsetValue = args.value(QStringLiteral("offset")); + const auto limitValue = args.value(QStringLiteral("limit")); + const double offset = offsetValue.isUndefined() ? 0 : offsetValue.toDouble(-1); + const double limit = limitValue.isUndefined() ? 100 : limitValue.toDouble(-1); + if (library.id.isEmpty() || offset < 0 || offset > INT_MAX || std::floor(offset) != offset || limit < 1 + || limit > 100 || std::floor(limit) != limit) { + invalid(QStringLiteral("Use a current library ID, integer offset >= 0 and limit 1..100")); + return; + } + auto *operation = new QObject(socket); + Async::runScoped( + operation, + m_sources->fetchBrowsePage(BrowseDescriptor::library(library.id, library.collectionType, library.name), + int(offset), int(limit), + { { QStringLiteral("sortBy"), QStringLiteral("SortName") }, + { QStringLiteral("sortOrder"), QStringLiteral("Ascending") } }, + std::nullopt), + [done, operation, limit](const PagedMovieItems& page) { + QJsonArray rows; + for (size_t index = 0; index < page.items.size() && index < size_t(limit); ++index) + rows.append(itemJson(page.items[index], page.startIndex + int(index))); + done({ { QStringLiteral("items"), rows }, { QStringLiteral("offset"), page.startIndex }, + { QStringLiteral("total"), page.totalRecordCount }, { QStringLiteral("exhausted"), page.exhausted }, + { QStringLiteral("seekable"), page.seekable } }); + operation->deleteLater(); + }, + [this, socket, id, operation](const std::exception_ptr&) { + reject(socket, id, QStringLiteral("provider_failed"), QStringLiteral("Catalog page could not be read")); + operation->deleteLater(); + }, + "local control catalog"); } else if (command == QStringLiteral("speed-test")) { if (args.contains(QStringLiteral("refresh")) && !args.value(QStringLiteral("refresh")).isBool()) { invalid(QStringLiteral("refresh must be a boolean")); @@ -866,6 +918,17 @@ void LocalCommandServer::dispatch(QIODevice *socket, const QJsonObject& request) m_router->push(QStringLiteral("libraryGrid"), { { QStringLiteral("libraryId"), args.value(QStringLiteral("id")).toString() } }); done(state()); + } else if (command == QStringLiteral("browse-sort")) { + const QString sortBy = args.value(QStringLiteral("sortBy")).toString(); + const QString sortOrder = args.value(QStringLiteral("sortOrder")).toString(); + if (m_app->browse()->libraryId().isEmpty() + || !QRegularExpression(QStringLiteral("^[A-Za-z][A-Za-z0-9]{0,63}$")).match(sortBy).hasMatch() + || (sortOrder != QStringLiteral("Ascending") && sortOrder != QStringLiteral("Descending"))) { + invalid(QStringLiteral("Open a library and supply a sort key with Ascending or Descending")); + return; + } + m_app->browse()->setSort(sortBy, sortOrder); + done(state()); } else if (command == QStringLiteral("load-more")) { m_app->browse()->prefetchNextPage(); done(state()); diff --git a/src/automation/SpooletMain.cpp b/src/automation/SpooletMain.cpp index ac96f7bd..332e8fc9 100644 --- a/src/automation/SpooletMain.cpp +++ b/src/automation/SpooletMain.cpp @@ -8,6 +8,7 @@ #include #include #include +#include #include #include #include @@ -36,6 +37,9 @@ QJsonObject help() QStringLiteral("navigate providerDetails MODULE_ID | navigate subtitleSettings [SETTING_KEY]"), QStringLiteral("items [browse|libraries|resume|next-up] [OFFSET] [LIMIT] | library " "QUALIFIED_ID | load-more"), + QStringLiteral("browse sort SORT_KEY [Ascending|Descending] (server-side library ordering)"), + QStringLiteral( + "catalog LIBRARY_ID [OFFSET] [LIMIT] (bounded provider page; preserves the view)"), QStringLiteral("play QUALIFIED_ID [--from-start] | pause | resume | stop | seek SECONDS"), QStringLiteral("preview SECONDS (actual timeline hover; key up first if controls are hidden)"), QStringLiteral("qualities | quality INDEX"), QStringLiteral("screenshot FILE.png"), @@ -185,6 +189,27 @@ int main(int argc, char **argv) return error(QStringLiteral("Pointer coordinates must be finite and nonnegative")); args.insert(index == 1 ? QStringLiteral("x") : QStringLiteral("y"), value); } + } else if (command == QStringLiteral("catalog")) { + if (!count(1, 3)) + return error(QStringLiteral("Usage: catalog LIBRARY_ID [OFFSET] [LIMIT]")); + args.insert(QStringLiteral("libraryId"), arguments.first()); + for (int index = 1; index < arguments.size(); ++index) { + bool valid = false; + const int value = arguments.at(index).toInt(&valid); + if (!valid || value < (index == 2 ? 1 : 0) || (index == 2 && value > 100)) + return error(QStringLiteral("Catalog offset must be nonnegative; limit must be 1..100")); + args.insert(index == 1 ? QStringLiteral("offset") : QStringLiteral("limit"), value); + } + } else if (command == QStringLiteral("browse")) { + if (!count(2, 3) || arguments.first() != QStringLiteral("sort") + || !QRegularExpression(QStringLiteral("^[A-Za-z][A-Za-z0-9]{0,63}$")).match(arguments.at(1)).hasMatch() + || (arguments.size() == 3 && arguments.last() != QStringLiteral("Ascending") + && arguments.last() != QStringLiteral("Descending"))) + return error(QStringLiteral("Usage: browse sort SORT_KEY [Ascending|Descending]")); + command = QStringLiteral("browse-sort"); + args.insert(QStringLiteral("sortBy"), arguments.at(1)); + args.insert( + QStringLiteral("sortOrder"), arguments.size() == 3 ? arguments.last() : QStringLiteral("Ascending")); } else if (command == QStringLiteral("items")) { if (!count(0, 3)) return error(QStringLiteral("Usage: items [KIND] [OFFSET] [LIMIT]")); diff --git a/src/main.cpp b/src/main.cpp index ff230b36..624d5b79 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -70,6 +70,8 @@ #if defined(SPOOL_WEBOS) #include "platform/webos/WebOSDeviceName.h" #endif +#include +#include #include #include #include @@ -916,6 +918,25 @@ int main(int argc, char **argv) [&settingsSync](Qt::ApplicationState state) { settingsSync.setForeground(state == Qt::ApplicationActive); }); QObject::connect(controller->settings(), &Spool::SettingsController::playbackPreferencesChanged, &hub, &Spool::SourceHub::setPlaybackPreferences); + hub.setPlaybackPreferenceResolver([settings = controller->settings()](const QString& account) { + const auto get = [&](const char *key) { return settings->effectiveValue(QString::fromLatin1(key), account); }; + return QVariantMap { { QStringLiteral("preferredMaxBitrate"), + get("playback/manualStreamingBitrate").toBool() + ? get("playback/maxStreamingBitrateMbps").toLongLong() * 1000000 + : qint64(0) }, + { QStringLiteral("unlimitedLocalNetwork"), get("playback/unlimitedLocalBitrate") }, + { QStringLiteral("preferRemux"), get("playback/preferRemux") }, + { QStringLiteral("preferredMaxHeight"), get("playback/maxStreamingHeight").toInt() } }; + }); + QObject::connect(controller->settings(), &Spool::SettingsController::serverOverridesChanged, &hub, + &Spool::SourceHub::refreshPlaybackPreferences); + QObject::connect(&providers, &Spool::ProviderRegistry::accountsChanged, controller->settings(), + [&providers, settings = controller->settings()] { + QStringList ids; + for (const auto& account : providers.accountList()) + ids.append(account.id); + settings->retainServerOverrides(ids); + }); QObject::connect( &providers, &Spool::ProviderRegistry::problem, controller.get(), &Spool::AppController::toastMessage); QObject::connect(&store, &Spool::ProviderStore::problem, controller.get(), &Spool::AppController::toastMessage); @@ -1024,11 +1045,12 @@ int main(int argc, char **argv) auto localization = std::make_unique(); localization->attachToEngine(window.engine()); controller->settings()->attachLocalization(localization.get()); - // Providers start once the device identity they present is known: in - // parallel, off the GUI thread, after the first frame is on its way. + // Start provider restoration as soon as the device identity is known, + // without waiting for the full QML shell to finish loading. QObject::connect(controller.get(), &Spool::AppController::deviceIdentityReady, &providers, [&providers, &store, &capabilities, &tlsTrust, loc = localization.get(), settings = controller->settings()]( const QString& deviceId) { + logLine("startup: restoring saved provider accounts"); providers.setRuntimeEnvironment( { { QStringLiteral("id"), deviceId }, { QStringLiteral("name"), capabilities.deviceName }, { QStringLiteral("app"), QStringLiteral("Spool") }, @@ -1051,6 +1073,7 @@ int main(int argc, char **argv) }); } }); + controller->initialize(); auto router = std::make_unique(QStringLiteral("home")); QTimer identityRouteReset; identityRouteReset.setSingleShot(true); @@ -1165,9 +1188,9 @@ int main(int argc, char **argv) qmlRegisterSingletonInstance("Spool", 1, 0, "Platform", platformInfo); qmlRegisterType("Spool", 1, 0, "MpvVideoItem"); qmlRegisterType("Spool", 1, 0, "TrickplayPreviewItem"); - // Start asynchronous device, settings, account, and discovery reads before - // QML construction. A sole saved account is resolved before routing begins. - controller->initialize(); + // Give completed identity/credential reads a chance to start provider HTTP + // work before compiling the full shell. Never wait on network or user input. + QCoreApplication::processEvents(QEventLoop::ExcludeUserInputEvents, QDeadlineTimer(5)); QObject::connect( &app, &QCoreApplication::aboutToQuit, router.get(), [router = router.get()] { router->markCleanShutdown(); }); diff --git a/src/platform/PlatformStreamingMemory.cpp b/src/platform/PlatformStreamingMemory.cpp new file mode 100644 index 00000000..e892eb5f --- /dev/null +++ b/src/platform/PlatformStreamingMemory.cpp @@ -0,0 +1,129 @@ +#include "PlatformSystemProbes.h" + +#include +#include +#include +#include + +#include +#include + +#if defined(Q_OS_WIN) +#include +#elif defined(Q_OS_DARWIN) +#include +#if TARGET_OS_IPHONE +#include +#else +#include +#endif +#endif + +namespace Spool { +namespace { +#if defined(Q_OS_LINUX) + QByteArray read(const QString& path) + { + QFile file(path); + return file.open(QIODevice::ReadOnly) ? file.readAll() : QByteArray(); + } + + QString mountPath(QByteArray value) + { + value.replace("\\040", " "); + value.replace("\\011", "\t"); + value.replace("\\134", "\\"); + return QString::fromLocal8Bit(value); + } + + void applyCgroupLimit(qint64& available) + { + const auto membership = read(QStringLiteral("/proc/self/cgroup")).split('\n'); + const auto mounts = read(QStringLiteral("/proc/self/mountinfo")).split('\n'); + for (const auto& member : membership) { + const auto fields = member.split(':'); + if (fields.size() != 3) + continue; + const bool unified = fields[0] == "0" && fields[1].isEmpty(); + if (!unified && !fields[1].split(',').contains("memory")) + continue; + for (const auto& mount : mounts) { + const auto halves = mount.split(' '); + const int separator = halves.indexOf("-"); + if (separator < 0 || halves.size() <= separator + 3 || halves.size() < 6) + continue; + const bool match = unified + ? halves[separator + 1] == "cgroup2" + : halves[separator + 1] == "cgroup" && halves[separator + 3].split(',').contains("memory"); + if (!match) + continue; + const QString root = mountPath(halves[3]); + const QString mountpoint = mountPath(halves[4]); + const QString group = QString::fromLocal8Bit(fields[2]); + if (root != QLatin1String("/") && group != root && !group.startsWith(root + QLatin1Char('/'))) + continue; + QString suffix = root == QLatin1String("/") ? group : group.mid(root.size()); + QString directory = QDir::cleanPath(mountpoint + QLatin1Char('/') + suffix); + // Every ancestor may impose a tighter limit than the leaf. + while (directory == mountpoint || directory.startsWith(mountpoint + QLatin1Char('/'))) { + bool limitOk = false, currentOk = false; + const qint64 limit = read(directory + + (unified ? QStringLiteral("/memory.max") : QStringLiteral("/memory.limit_in_bytes"))) + .trimmed() + .toLongLong(&limitOk); + const qint64 current = read(directory + + (unified ? QStringLiteral("/memory.current") : QStringLiteral("/memory.usage_in_bytes"))) + .trimmed() + .toLongLong(¤tOk); + if (limitOk && currentOk && limit > 0 && current >= 0 + && limit < std::numeric_limits::max() / 2) + available = std::min(available, std::max(qint64(0), limit - current)); + if (directory == mountpoint) + break; + directory = QFileInfo(directory).dir().absolutePath(); + } + } + } + } +#endif +} + +PlatformStreamingMemoryState platformStreamingMemoryState() +{ +#if defined(Q_OS_LINUX) + for (const auto& line : read(QStringLiteral("/proc/meminfo")).split('\n')) { + if (!line.startsWith("MemAvailable:")) + continue; + bool ok = false; + const auto fields = line.simplified().split(' '); + const qint64 kib = fields.size() >= 2 ? fields[1].toLongLong(&ok) : 0; + if (!ok || kib < 0 || kib > std::numeric_limits::max() / 1024) + return {}; + qint64 available = kib * 1024; + applyCgroupLimit(available); + return { available, true }; + } +#elif defined(Q_OS_WIN) + MEMORYSTATUSEX state {}; + state.dwLength = sizeof(state); + if (GlobalMemoryStatusEx(&state)) + return { qint64(std::min(state.ullAvailPhys, std::numeric_limits::max())), true }; +#elif defined(Q_OS_DARWIN) +#if TARGET_OS_IPHONE + if (__builtin_available(iOS 13.0, tvOS 13.0, *)) + return { qint64(os_proc_available_memory()), true }; +#else + vm_statistics64_data_t state {}; + mach_msg_type_number_t count = HOST_VM_INFO64_COUNT; + vm_size_t pageSize = 0; + const mach_port_t host = mach_host_self(); + const bool success = host_page_size(host, &pageSize) == KERN_SUCCESS + && host_statistics64(host, HOST_VM_INFO64, reinterpret_cast(&state), &count) == KERN_SUCCESS; + mach_port_deallocate(mach_task_self(), host); + if (success) + return { qint64(state.free_count + state.inactive_count) * pageSize, true }; +#endif +#endif + return {}; +} +} // namespace Spool diff --git a/src/platform/PlatformSystemProbes.h b/src/platform/PlatformSystemProbes.h index cbb827c3..99c78347 100644 --- a/src/platform/PlatformSystemProbes.h +++ b/src/platform/PlatformSystemProbes.h @@ -26,6 +26,11 @@ struct PlatformMemoryPolicy { qint64 lowMemoryBytes = 1536LL * 1024LL * 1024LL; }; +struct PlatformStreamingMemoryState { + qint64 availableBytes = 0; + bool available = false; +}; +PlatformStreamingMemoryState platformStreamingMemoryState(); PlatformCpuProbe platformCpuProbe(int logicalCpus); PlatformMemoryPolicy platformMemoryPolicy(); qint64 effectiveLinuxMemoryBytes( diff --git a/src/player/MpvOptionProfile.cpp b/src/player/MpvOptionProfile.cpp index 97dcc0c8..3594d67f 100644 --- a/src/player/MpvOptionProfile.cpp +++ b/src/player/MpvOptionProfile.cpp @@ -380,11 +380,10 @@ QByteArray MpvOptionProfile::preloadedSubtitleStreams(const PlaybackSession& ses return values.join(','); } -MpvOptionProfile::NetworkProfile MpvOptionProfile::networkProfile(Platform platform, int parallelRequests) +MpvOptionProfile::NetworkProfile MpvOptionProfile::networkProfile(Platform platform) { - const int requests = std::clamp(parallelRequests, 1, 16); - return platform == Platform::WebOS ? NetworkProfile { 2 * 1024 * 1024, 512 * 1024, requests, 128 * 1024 } - : NetworkProfile { 4 * 1024 * 1024, 1024 * 1024, requests, 256 * 1024 }; + return platform == Platform::WebOS ? NetworkProfile { 2 * 1024 * 1024, 512 * 1024, 128 * 1024 } + : NetworkProfile { 4 * 1024 * 1024, 1024 * 1024, 256 * 1024 }; } QByteArray MpvOptionProfile::loadFileOptions(const PlaybackSession& session) @@ -480,9 +479,9 @@ QByteArray MpvOptionProfile::systemCertificateBundle() } std::vector MpvOptionProfile::applicationOptions(Platform platform, bool needsVideoSurface, - const QString& audioOutputMode, const QByteArray& logPath, const QByteArray& demuxerMaxBytes, - const QByteArray& demuxerMaxBackBytes, int parallelRequests, bool embeddedVideo, const QByteArray& shaderCachePath, - const QByteArray& certificateBundlePath, RenderQuality quality, bool threadedStreaming, bool forceStreamingThreads) + const QString& audioOutputMode, const QByteArray& logPath, const StreamingOptions& streaming, + const QByteArray& demuxerMaxBytes, const QByteArray& demuxerMaxBackBytes, bool embeddedVideo, + const QByteArray& shaderCachePath, const QByteArray& certificateBundlePath, RenderQuality quality) { const bool webOS = platform == Platform::WebOS; const bool android = platform == Platform::Android; @@ -490,7 +489,7 @@ std::vector MpvOptionProfile::applicationOptions(Platform platform, b // graph everywhere and, on webOS, the software-decode path it reaches for // legacy codecs. It used to be clamped to webOS here because nowhere else // had a second option; Android does now. - const NetworkProfile network = networkProfile(platform, parallelRequests); + const NetworkProfile network = networkProfile(platform); const QString normalizedAudioOutput = webOS ? audioOutputMode : normalizedAudioOutputMode(audioOutputMode); const bool starfishAudio = webOS && !embeddedVideo && (audioOutputMode == QStringLiteral("starfish") || audioOutputMode == QStringLiteral("starfish-pcm")); @@ -505,13 +504,24 @@ std::vector MpvOptionProfile::applicationOptions(Platform platform, b { "cache-pause", "no" }, { "demuxer-max-bytes", demuxerMaxBytes }, { "demuxer-max-back-bytes", demuxerMaxBackBytes }, - { "curl-enabled", threadedStreaming ? "yes" : "no" }, + { "curl-enabled", streaming.enabled ? "yes" : "no" }, { "curl-buffer-size", QByteArray::number(network.ringBytes) }, { "curl-max-request-size", QByteArray::number(network.rangeBytes) }, { "curl-read-size", QByteArray::number(network.readBytes) }, - { "curl-parallel-requests", QByteArray::number(network.parallelRequests) }, - { "curl-adaptive", forceStreamingThreads ? "no" : "yes" }, - { "curl-initial-requests", forceStreamingThreads ? QByteArray::number(network.parallelRequests) : "1" }, + { "curl-parallel-requests", QByteArray::number(streaming.maxRequests) }, + { "curl-fixed-requests", QByteArray::number(streaming.fixedRequests) }, + { "curl-explore", streaming.explore ? "yes" : "no" }, + { "curl-receive-mode", + streaming.receiveMode == 2 ? "fixed" + : streaming.receiveMode == 0 ? "os-auto" + : "measured" }, + { "curl-receive-bytes", + QByteArray::number(streaming.receiveBytes > 0 ? streaming.receiveBytes : 4 * 1024 * 1024) }, + { "curl-http-mode", + streaming.httpMode == 3 ? "prefer-h3" + : streaming.httpMode == 2 ? "http1" + : streaming.httpMode == 1 ? "tcp" + : "auto" }, // A connection that goes quiet without closing is retried after this // long rather than mpv's 60 s, which outlasts any demuxer cache. { "network-timeout", "15" }, diff --git a/src/player/MpvOptionProfile.h b/src/player/MpvOptionProfile.h index d8709321..1f437cc4 100644 --- a/src/player/MpvOptionProfile.h +++ b/src/player/MpvOptionProfile.h @@ -39,12 +39,23 @@ class MpvOptionProfile final { struct NetworkProfile { int ringBytes; int rangeBytes; - int parallelRequests; // libcurl receive buffer per transfer; each active request holds one. int readBytes; }; - static NetworkProfile networkProfile(Platform platform, int parallelRequests = 1); + struct StreamingOptions { + bool enabled = true; + int maxRequests = 4; + int fixedRequests = 0; + bool explore = true; + bool allowExtraMemory = true; + qint64 maxExtraBytes = 0; + int receiveMode = 1; + qint64 receiveBytes = 0; + int httpMode = 0; + }; + + static NetworkProfile networkProfile(Platform platform); static bool applyRequestHeaders(mpv_handle *handle, QByteArray headers); static QByteArray renderQualityName(RenderQuality quality); static RenderQuality renderQualityFromName(const QString& name); @@ -63,12 +74,11 @@ class MpvOptionProfile final { static std::vector preInitializeOptions(const MpvConfigPolicy& policy); static std::vector applicationOptions(Platform platform, bool needsVideoSurface, - const QString& audioOutputMode, const QByteArray& logPath, + const QString& audioOutputMode, const QByteArray& logPath, const StreamingOptions& streaming, const QByteArray& demuxerMaxBytes = QByteArrayLiteral("64M"), - const QByteArray& demuxerMaxBackBytes = QByteArrayLiteral("32M"), int parallelRequests = 1, - bool embeddedVideo = false, const QByteArray& shaderCachePath = {}, - const QByteArray& certificateBundlePath = {}, RenderQuality quality = RenderQuality::Balanced, - bool threadedStreaming = true, bool forceStreamingThreads = false); + const QByteArray& demuxerMaxBackBytes = QByteArrayLiteral("32M"), bool embeddedVideo = false, + const QByteArray& shaderCachePath = {}, const QByteArray& certificateBundlePath = {}, + RenderQuality quality = RenderQuality::Balanced); static std::vector subtitleOptions( const SubtitlePreferences& preferences, bool subtitlesEnabled, bool hdrPlayback = false); }; diff --git a/src/player/PlayerController.cpp b/src/player/PlayerController.cpp index d2745933..25c0ca07 100644 --- a/src/player/PlayerController.cpp +++ b/src/player/PlayerController.cpp @@ -11,7 +11,6 @@ #include "../platform/PlatformPlaybackSurface.h" #include "../platform/PlatformSystemProbes.h" #include "../provider/PlaybackSource.h" -#include "../provider/SpeedTest.h" #include "MpvOptionProfile.h" #include "MpvVideoItem.h" #include "PlaybackFailurePolicy.h" @@ -38,6 +37,7 @@ extern "C" { #include #include +#include #include #include #include @@ -71,10 +71,12 @@ namespace { constexpr uint64_t kTransportLoadReply = 0x746c000000000000ULL; // The acknowledgement, not submission order, authorizes the pending load. - int configureTransport(mpv_handle *handle, const PlaybackSession& session, qint64 epoch, uint64_t replyId) + int configureTransport(mpv_handle *handle, const PlaybackSession& session, + const MpvOptionProfile::StreamingOptions& options, const QUrl& origin, const QVariantList& samples, + qint64 epoch, uint64_t replyId) { - char *keys[10]; - mpv_node values[10] {}; + char *keys[24]; + mpv_node values[24] {}; int count = 0; const auto integer = [&](const char *key, qint64 value) { keys[count] = const_cast(key); @@ -89,6 +91,59 @@ namespace { integer("format", 2); integer("op", 0); integer("playback-epoch", epoch); + integer("max-requests", options.maxRequests); + integer("fixed-requests", options.fixedRequests); + integer("receive-mode", options.receiveMode); + if (options.receiveMode == 2) + integer("receive-bytes", options.receiveBytes); + integer("http-mode", options.httpMode); + keys[count] = const_cast("explore"); + values[count].format = MPV_FORMAT_FLAG; + values[count++].u.flag = options.explore; + QUrl canonicalOrigin; + canonicalOrigin.setScheme(origin.scheme()); + canonicalOrigin.setHost(origin.host()); + canonicalOrigin.setPort(origin.port()); + const QByteArray originBytes = canonicalOrigin.toEncoded(); + if (!originBytes.isEmpty()) { + keys[count] = const_cast("primary-origin"); + values[count].format = MPV_FORMAT_STRING; + values[count++].u.string = const_cast(originBytes.constData()); + } + // The property call copies the complete node synchronously before returning. + struct Prior { + char *keys[10]; + mpv_node values[10] {}; + mpv_node_list list {}; + }; + std::array priors {}; + std::array rows {}; + const char *priorFields[] = { "requests", "http-version", "receive-profile", "receive-bytes", "range-bytes", + "ordered-bytes-per-second", "ttfb-ms", "updated-at-ms", "source", "samples" }; + int priorCount = 0; + for (const auto& entry : samples) { + if (priorCount == 64) + break; + const auto sample = entry.toMap(); + auto& prior = priors[priorCount]; + for (int field = 0; field < 10; ++field) { + prior.keys[field] = const_cast(priorFields[field]); + const auto value = sample.value(QString::fromLatin1(priorFields[field])); + const bool real = field == 5 || field == 6; + prior.values[field].format = real ? MPV_FORMAT_DOUBLE : MPV_FORMAT_INT64; + if (real) + prior.values[field].u.double_ = value.toDouble(); + else + prior.values[field].u.int64 = value.toLongLong(); + } + prior.list = { 10, prior.values, prior.keys }; + rows[priorCount].format = MPV_FORMAT_NODE_MAP; + rows[priorCount++].u.list = &prior.list; + } + mpv_node_list priorList { priorCount, rows.data(), nullptr }; + keys[count] = const_cast("transport-samples"); + values[count].format = MPV_FORMAT_NODE_ARRAY; + values[count++].u.list = &priorList; if (session.sourceBitrate > 0) number("source-bitrate", static_cast(session.sourceBitrate)); if (session.deliveryBitrate > 0) @@ -261,7 +316,17 @@ namespace { QStringLiteral("tcp-rtt-available"), QStringLiteral("cpu-ns-per-ordered-byte"), QStringLiteral("lane"), QStringLiteral("active-seconds"), QStringLiteral("average-bytes-per-second"), QStringLiteral("current-bytes-per-second"), QStringLiteral("peak-bytes-per-second"), - QStringLiteral("samples"), QStringLiteral("requests") }; + QStringLiteral("samples"), QStringLiteral("requests"), QStringLiteral("transport-samples"), + QStringLiteral("receive-profile"), QStringLiteral("receive-bytes"), QStringLiteral("range-bytes"), + QStringLiteral("ordered-bytes-per-second"), QStringLiteral("updated-at-ms"), QStringLiteral("source"), + QStringLiteral("effective-http-version"), QStringLiteral("http-fallbacks"), QStringLiteral("origins"), + QStringLiteral("primary-origin-match"), QStringLiteral("origin-id"), QStringLiteral("h2-state"), + QStringLiteral("h3-state"), QStringLiteral("cooldown-remaining-ms"), + QStringLiteral("receive-requested-bytes"), QStringLiteral("receive-effective-bytes"), + QStringLiteral("receive-status"), QStringLiteral("udp-rcvbuf-requested"), + QStringLiteral("udp-rcvbuf-effective"), QStringLiteral("udp-drops"), QStringLiteral("urgency"), + QStringLiteral("state"), QStringLiteral("last-reason"), QStringLiteral("joint-extra-grant-bytes"), + QStringLiteral("allocated-extra-bytes"), QStringLiteral("reserved-socket-bytes") }; if (keys.contains(key)) return true; constexpr QLatin1String available("-available"); @@ -587,10 +652,9 @@ void PlayerController::prepareMpvAsync(bool needsVideoSurface, bool embeddedVide preparation->embeddedVideo = embeddedVideo; preparation->hardwareDecoding = m_hardwareDecoding; preparation->userConfig = usesUserMpvConfig(); - const int parallelRequests = m_maxStreamingThreads; - const auto network = MpvOptionProfile::networkProfile(preparation->platform, parallelRequests); + const auto network = MpvOptionProfile::networkProfile(preparation->platform); qInfo().nospace() << "player: curl profile source=MpvOptionProfile platform=" - << platformPlaybackBackendName(embeddedVideo) << " requestsPerStream=" << network.parallelRequests + << platformPlaybackBackendName(embeddedVideo) << " maxRequests=" << m_maxStreamingThreads << " rangeBytes=" << network.rangeBytes << " ringBytes=" << network.ringBytes << " enabled=" << m_threadedStreaming << " forced=" << m_forceStreamingThreads; QByteArray certificateBundle = QFile::encodeName(writeTrustBundle()); @@ -598,8 +662,8 @@ void PlayerController::prepareMpvAsync(bool needsVideoSurface, bool embeddedVide certificateBundle = MpvOptionProfile::systemCertificateBundle(); preparation->options = MpvOptionProfile::preInitializeOptions(m_mpvConfigPolicy); auto applicationOptions = MpvOptionProfile::applicationOptions(preparation->platform, needsVideoSurface, - m_audioOutputMode, {}, m_demuxerMaxBytes, m_demuxerMaxBackBytes, parallelRequests, embeddedVideo, - mpvShaderCachePath(), certificateBundle, m_renderQuality, m_threadedStreaming, m_forceStreamingThreads); + m_audioOutputMode, {}, m_streamingOptions, m_demuxerMaxBytes, m_demuxerMaxBackBytes, embeddedVideo, + mpvShaderCachePath(), certificateBundle, m_renderQuality); applicationOptions.push_back({ "sub-fonts-dir", m_subtitleFontsPath }); applicationOptions.push_back({ "osd-fonts-dir", m_subtitleFontsPath }); applicationOptions.push_back({ "osd-font", QByteArrayLiteral("IBM Plex Sans Var") }); @@ -643,6 +707,7 @@ void PlayerController::prepareMpvAsync(bool needsVideoSurface, bool embeddedVide return; } m_idleMpvHandle = std::exchange(preparation->handle, nullptr); + refreshTransportCapabilities(m_idleMpvHandle); m_idleMpvNeedsVideoSurface = preparation->needsVideoSurface; m_idleMpvEmbeddedVideo = preparation->embeddedVideo; qInfo() << "player: idle-prepared mpv initialized in" << preparation->elapsedMs << "ms"; @@ -655,6 +720,37 @@ void PlayerController::prepareMpvAsync(bool needsVideoSurface, bool embeddedVide worker->start(QThread::LowPriority); } +void PlayerController::refreshTransportCapabilities(mpv_handle *handle) +{ + mpv_node node {}; + if (mpv_get_property(handle, "curl-transport-capabilities", MPV_FORMAT_NODE, &node) < 0) + return; + QVariantMap capabilities; + if (node.format == MPV_FORMAT_NODE_MAP && node.u.list) { + const QSet flags { QStringLiteral("http2"), QStringLiteral("http3"), QStringLiteral("alt-svc"), + QStringLiteral("quic-batching"), QStringLiteral("hw-aes") }; + for (int i = 0; i < node.u.list->num; ++i) { + const QString key = QString::fromUtf8(node.u.list->keys[i]); + const auto& value = node.u.list->values[i]; + if (flags.contains(key) && value.format == MPV_FORMAT_FLAG) + capabilities.insert(key, bool(value.u.flag)); + else if (key == QLatin1String("curl-version") && value.format == MPV_FORMAT_INT64) + capabilities.insert(key, qint64(value.u.int64)); + else if (key == QLatin1String("tls-backend") && value.format == MPV_FORMAT_STRING) { + const QString backend = QString::fromUtf8(value.u.string); + if (backend == QLatin1String("openssl") || backend == QLatin1String("schannel") + || backend == QLatin1String("securetransport") || backend == QLatin1String("other")) + capabilities.insert(key, backend); + } + } + } + mpv_free_node_contents(&node); + if (m_transportCapabilities != capabilities) { + m_transportCapabilities = capabilities; + emit transportCapabilitiesChanged(); + } +} + void PlayerController::destroyIdleMpv(const char *reason) { m_mpvPreparation.reset(); @@ -1495,6 +1591,12 @@ void PlayerController::playSession(const PlaybackSession& session, bool startPau m_networkQueryPending = false; m_cacheSpeedQueryPending = false; m_sessionThreadedStreaming = m_threadedStreaming; + m_sessionStreamingOptions = m_streamingOptions; + m_jointExtraGrantBytes = 0; + m_previousMemoryCandidate = 0; + m_streamingMemoryTimer.invalidate(); + updateStreamingMemoryGrant(); + m_streamingMemoryTimer.start(); m_streamingPerformanceSampler.reset(); m_previousCurlCpuSeconds = -1; m_previousCurlWallSeconds = -1; @@ -1716,42 +1818,6 @@ void PlayerController::finishPlaySession( return; } QByteArray loadFileOptions = MpvOptionProfile::loadFileOptions(session); - if (m_sessionThreadedStreaming && m_api && !m_networkOrigin.isEmpty()) { - // Resolve seeds per file, not from whichever account was active when - // the speculative core was initialized. - const QVariantMap& profile = m_sessionNetworkProfile; - const auto addOption = [&loadFileOptions](const char *name, const QByteArray& value) { - if (!loadFileOptions.isEmpty()) - loadFileOptions += ','; - loadFileOptions += name; - loadFileOptions += '='; - loadFileOptions += value; - }; - addOption("curl-adaptive", m_forceStreamingThreads ? "no" : "yes"); - addOption("curl-parallel-requests", QByteArray::number(m_maxStreamingThreads)); - const QVariantList samples = profile.value(QStringLiteral("concurrency-samples")).toList(); - const NetworkLaneSelection selection - = selectNetworkLanes(samples, networkMediaBitrate(), m_maxStreamingThreads); - const int initialRequests = m_forceStreamingThreads ? m_maxStreamingThreads : selection.requests; - double capacity = 0; - double latency = 0; - for (const QVariant& value : samples) { - const QVariantMap point = value.toMap(); - if (point.value(QStringLiteral("requests")).toInt() == initialRequests) { - capacity = point.value(QStringLiteral("capacity-bytes-per-second")).toDouble(); - latency = point.value(QStringLiteral("ttfb-ms")).toDouble(); - break; - } - } - addOption("curl-initial-requests", QByteArray::number(initialRequests)); - addOption("curl-ttfb-ms", QByteArray::number(latency, 'f', 3)); - addOption("curl-observed-bps", QByteArray::number(capacity, 'f', 0)); - qInfo().nospace() << "player: streaming selection selectedRequests=" << initialRequests - << " maxRequests=" << m_maxStreamingThreads << " forced=" << m_forceStreamingThreads - << " reason=" << (m_forceStreamingThreads ? 3 : selection.reason) - << " capacityMbps=" << capacity * 8 / 1e6 << " mediaMbps=" << networkMediaBitrate() / 1e6; - addOption("curl-media-bitrate", QByteArray::number(networkMediaBitrate(), 'f', 0)); - } if (m_sessionThreadedStreaming || m_logStreamingPerformance) m_networkTimer.start(); QByteArrayList loadCommand { QByteArrayLiteral("loadfile"), urlBytes, QByteArrayLiteral("replace"), @@ -1774,7 +1840,10 @@ void PlayerController::configureTransportForLoad(QByteArrayList loadCommand) submitTransportLoad(serial); return; } - if (configureTransport(handle, m_session, epoch, kTransportConfigureReply | serial) < 0) { + if (configureTransport(handle, m_session, m_sessionStreamingOptions, m_networkOrigin, + m_sessionNetworkProfile.value(QStringLiteral("transport-samples")).toList(), epoch, + kTransportConfigureReply | serial) + < 0) { m_pendingTransportLoads.remove(serial); failTransportLoad(true); } @@ -2650,6 +2719,7 @@ void PlayerController::setThreadedStreaming(bool enabled) if (m_threadedStreaming == enabled) return; m_threadedStreaming = enabled; + m_streamingOptions.enabled = enabled; discardPreparedMpvForOptionChange("threaded streaming change"); } @@ -2659,6 +2729,8 @@ void PlayerController::setMaxStreamingThreads(int threads) if (m_maxStreamingThreads == threads) return; m_maxStreamingThreads = threads; + m_streamingOptions.maxRequests = threads; + m_streamingOptions.fixedRequests = m_forceStreamingThreads ? threads : 0; discardPreparedMpvForOptionChange("streaming thread limit change"); } @@ -2667,9 +2739,42 @@ void PlayerController::setForceStreamingThreads(bool force) if (m_forceStreamingThreads == force) return; m_forceStreamingThreads = force; + m_streamingOptions.fixedRequests = force ? m_maxStreamingThreads : 0; discardPreparedMpvForOptionChange("forced streaming threads change"); } +void PlayerController::setStreamingExplore(bool enabled) +{ + m_streamingOptions.explore = enabled; +} + +void PlayerController::setStreamingMemoryLoan(bool enabled) +{ + m_streamingOptions.allowExtraMemory = enabled; +} + +void PlayerController::setMaxExtraStreamingMemoryMiB(int size) +{ + m_streamingOptions.maxExtraBytes = qBound(0, size, 128) * 1024LL * 1024; +} + +void PlayerController::setStreamingReceiveWindowMode(const QString& mode) +{ + m_streamingOptions.receiveMode = mode == QLatin1String("os-auto") ? 0 : mode == QLatin1String("measured") ? 1 : 2; + m_streamingOptions.receiveBytes = mode == QLatin1String("4m") ? 4LL * 1024 * 1024 + : mode == QLatin1String("8m") ? 8LL * 1024 * 1024 + : mode == QLatin1String("16m") ? 16LL * 1024 * 1024 + : 0; +} + +void PlayerController::setStreamingHttpVersion(const QString& mode) +{ + m_streamingOptions.httpMode = mode == QLatin1String("http3") ? 3 + : mode == QLatin1String("http1") ? 2 + : mode == QLatin1String("tcp") ? 1 + : 0; +} + void PlayerController::setLogStreamingPerformance(bool enabled) { if (m_logStreamingPerformance == enabled) @@ -2704,6 +2809,10 @@ double PlayerController::networkMediaBitrate() const void PlayerController::updateNetworkTransport() { + if (!m_streamingMemoryTimer.isValid() || m_streamingMemoryTimer.elapsed() >= 5000) { + updateStreamingMemoryGrant(); + m_streamingMemoryTimer.restart(); + } auto *handle = m_mpvLifecycle.handle(); if (!handle || !m_sessionActive) return; @@ -3642,6 +3751,28 @@ void PlayerController::skipActiveSegment() seek(activeSegmentEndSeconds()); } +void PlayerController::updateStreamingMemoryGrant() +{ + constexpr qint64 mib = 1024LL * 1024; + const auto memory = platformStreamingMemoryState(); + const auto policy = platformMemoryPolicy(); + const bool constrained = platformMpvOptionProfile() == MpvOptionProfile::Platform::WebOS + || (policy.totalBytes > 0 && policy.totalBytes < policy.lowMemoryBytes); + const qint64 reserve = (constrained ? 64 : 128) * mib; + const auto& options = m_sessionStreamingOptions; + const qint64 cap = options.maxExtraBytes > 0 ? options.maxExtraBytes : (constrained ? 32 : 64) * mib; + const qint64 desired = options.allowExtraMemory && memory.available + ? std::min(cap, std::max(qint64(0), memory.availableBytes - reserve) / 4) + : 0; + // Pressure shrinks admission immediately; growth needs two independent samples. + const qint64 grant = desired <= m_jointExtraGrantBytes ? desired : std::min(desired, m_previousMemoryCandidate); + m_previousMemoryCandidate = desired; + if (grant != m_jointExtraGrantBytes) { + m_jointExtraGrantBytes = grant; + updateBackgroundNetwork(); + } +} + void PlayerController::setBackgroundNetwork(bool active) { m_backgroundNetwork = active; @@ -3657,15 +3788,18 @@ void PlayerController::updateBackgroundNetwork() char opKey[] = "op"; char epochKey[] = "playback-epoch"; char backgroundKey[] = "background-network"; - char *keys[] = { formatKey, opKey, epochKey, backgroundKey }; - mpv_node values[4] {}; + char grantKey[] = "joint-extra-grant-bytes"; + char *keys[] = { formatKey, opKey, epochKey, backgroundKey, grantKey }; + mpv_node values[5] {}; values[0].format = values[1].format = values[2].format = MPV_FORMAT_INT64; values[0].u.int64 = 2; values[1].u.int64 = 1; values[2].u.int64 = m_transportEpoch; values[3].format = MPV_FORMAT_FLAG; values[3].u.flag = m_backgroundNetwork || m_trickplayNetwork; - mpv_node_list list { 4, values, keys }; + values[4].format = MPV_FORMAT_INT64; + values[4].u.int64 = m_jointExtraGrantBytes; + mpv_node_list list { 5, values, keys }; mpv_node control {}; control.format = MPV_FORMAT_NODE_MAP; control.u.list = &list; diff --git a/src/player/PlayerController.h b/src/player/PlayerController.h index ea4dfe9a..b7bb3270 100644 --- a/src/player/PlayerController.h +++ b/src/player/PlayerController.h @@ -12,6 +12,7 @@ #include #include +#include #include #include #include @@ -43,6 +44,7 @@ class PlatformPerformanceSampler; class PlayerController final : public QObject { Q_OBJECT Q_PROPERTY(bool visible READ visible NOTIFY visibleChanged) + Q_PROPERTY(QVariantMap transportCapabilities READ transportCapabilities NOTIFY transportCapabilitiesChanged) Q_PROPERTY(bool sessionActive READ sessionActive NOTIFY sessionActiveChanged) Q_PROPERTY(bool fileLoaded READ fileLoaded NOTIFY playbackStateChanged) Q_PROPERTY(bool hdrPlayback READ hdrPlayback NOTIFY hdrPlaybackChanged) @@ -123,6 +125,10 @@ class PlayerController final : public QObject { { return m_containerFps; } + QVariantMap transportCapabilities() const + { + return m_transportCapabilities; + } QVariantMap networkMetrics() const { QVariantMap metrics = m_networkMetrics; @@ -257,6 +263,11 @@ class PlayerController final : public QObject { void setMaxStreamingThreads(int threads); void setForceStreamingThreads(bool force); void setLogStreamingPerformance(bool enabled); + void setStreamingExplore(bool enabled); + void setStreamingMemoryLoan(bool enabled); + void setMaxExtraStreamingMemoryMiB(int size); + void setStreamingReceiveWindowMode(const QString& mode); + void setStreamingHttpVersion(const QString& mode); void setMpvConfigPolicy(const MpvConfigPolicy& policy); signals: @@ -286,6 +297,7 @@ class PlayerController final : public QObject { bool retryableCodecFailure, int audioStreamIndex, int subtitleStreamIndex); void streamSelectionChanged(int audioStreamIndex, int subtitleStreamIndex); void nightModeEnabledChanged(); + void transportCapabilitiesChanged(); void toneMappingVisualizationEnabledChanged(); void audioDelayMsChanged(); void fileAudioDelayMsChanged(); @@ -432,6 +444,8 @@ class PlayerController final : public QObject { QTimer m_progressTimer; QTimer m_networkTimer; QVariantMap m_networkMetrics; + QVariantMap m_transportCapabilities; + void refreshTransportCapabilities(mpv_handle *handle); QVariantMap m_streamingPerformanceMetrics; QUrl m_networkOrigin; QByteArray m_sessionRequestHeaders; @@ -494,6 +508,12 @@ class PlayerController final : public QObject { int m_maxStreamingThreads = 4; bool m_forceStreamingThreads = false; bool m_logStreamingPerformance = false; + MpvOptionProfile::StreamingOptions m_streamingOptions; + MpvOptionProfile::StreamingOptions m_sessionStreamingOptions; + qint64 m_jointExtraGrantBytes = 0; + qint64 m_previousMemoryCandidate = 0; + QElapsedTimer m_streamingMemoryTimer; + void updateStreamingMemoryGrant(); // The opening seconds are where a device that cannot keep up says so: // the picture is being scaled and tone-mapped from the first frame, and // nothing has warmed a cache yet. diff --git a/src/provider/PlaybackSource.h b/src/provider/PlaybackSource.h index dbe7d183..114d569d 100644 --- a/src/provider/PlaybackSource.h +++ b/src/provider/PlaybackSource.h @@ -30,13 +30,11 @@ class PlaybackSource : public QObject { virtual QByteArray mediaRequestHeaders() const = 0; // The origin whose remembered TLS trust decision covers media URLs. virtual QUrl mediaOrigin() const = 0; - // Native-only transport learning. Rates are bytes/s; media bitrate is bits/s. - // {initial-requests:1..4, ttfb-ms, capacity-bytes-per-second, - // measured-bitrate:bits/s, concurrency-samples:[{requests, capacity-bytes-per-second, - // ttfb-ms, updated-at-ms}]} contains only fresh observations. - // Feedback is curl-transport-metrics plus observed-at-ms (UTC epoch ms) - // and media-bitrate (bits/s). Only non-cache-blocked concurrency samples - // with increasing stream-id/capacity-samples are learned. + // Native-only transport priors: format=2, measured-bitrate (bits/s), and + // transport-samples with request/protocol/receive/range identity, ordered + // bytes/s, latency and observation time. The transport chooses its profile. + // Feedback carries curl-transport-metrics plus observed-at-ms (UTC epoch ms). + // Only fresh, valid observations with increasing stream/sample IDs persist. virtual QVariantMap playbackNetworkProfile() const { return {}; diff --git a/src/provider/PortableProvider.cpp b/src/provider/PortableProvider.cpp index e1048d04..a93c3c5b 100644 --- a/src/provider/PortableProvider.cpp +++ b/src/provider/PortableProvider.cpp @@ -318,10 +318,7 @@ class PortableProvider::Playback final : public PlaybackSource { void PortableProvider::setPlaybackContext(QVariantMap context) { - const int previous = m_playbackContext.value(QStringLiteral("parallelRequests"), 1).toInt(); m_playbackContext = std::move(context); - if (previous != m_playbackContext.value(QStringLiteral("parallelRequests"), 1).toInt()) - emit m_playback->playbackNetworkProfileChanged(); } void PortableProvider::setPlaybackQueueContext(QVariantMap snapshot, int index) diff --git a/src/provider/ProviderRegistry.cpp b/src/provider/ProviderRegistry.cpp index bda5178c..7a86a1d8 100644 --- a/src/provider/ProviderRegistry.cpp +++ b/src/provider/ProviderRegistry.cpp @@ -7,7 +7,6 @@ #include "ProviderCapabilityContract.h" #include "ProviderExtensionData.h" #include "ProviderUiContext.h" -#include "SpeedTest.h" #include #include @@ -27,6 +26,7 @@ #include #include #include +#include #include namespace Spool { @@ -58,12 +58,137 @@ namespace { { return timestamp > 0 && timestamp <= now + 5000 && now - timestamp <= kNetworkMaxAge; } + + bool networkNumber(const QVariant& value) + { + switch (value.metaType().id()) { + case QMetaType::Int: + case QMetaType::UInt: + case QMetaType::LongLong: + case QMetaType::ULongLong: + case QMetaType::Float: + case QMetaType::Double: + return std::isfinite(value.toDouble()); + default: + return false; + } + } + + bool networkInteger(const QVariant& value, qint64 minimum, qint64 maximum) + { + if (!networkNumber(value)) + return false; + const double number = value.toDouble(); + // A double at 2^63 cannot be represented by a signed wire integer. + if (number >= 9223372036854775808.0 || std::trunc(number) != number) + return false; + bool valid = false; + const qint64 integer = value.toLongLong(&valid); + return valid && integer >= minimum && integer <= maximum; + } + + QString networkProfileKey(const QVariantMap& point) + { + return QStringLiteral("%1/%2/%3/%4/%5") + .arg(point.value(QStringLiteral("requests")).toInt()) + .arg(point.value(QStringLiteral("http-version")).toInt()) + .arg(point.value(QStringLiteral("receive-profile")).toInt()) + .arg(point.value(QStringLiteral("receive-bytes")).toLongLong()) + .arg(point.value(QStringLiteral("range-bytes")).toLongLong()); + } + + QVariantMap networkSample(const QVariant& value, qint64 now) + { + if (value.metaType().id() != QMetaType::QVariantMap) + return {}; + const QVariantMap point = value.toMap(); + const auto integer = [&](const char *field, qint64 minimum, qint64 maximum) { + return networkInteger(point.value(QLatin1String(field)), minimum, maximum); + }; + const int http = point.value(QStringLiteral("http-version")).toInt(); + const double rate = point.value(QStringLiteral("ordered-bytes-per-second")).toDouble(); + const double ttfb = point.value(QStringLiteral("ttfb-ms")).toDouble(); + if (!integer("requests", 1, 16) || !integer("http-version", 0, 30) + || (http != 0 && http != 11 && http != 20 && http != 30) || !integer("receive-profile", 0, 1) + || !integer("receive-bytes", 0, 16 * 1024 * 1024) || !integer("range-bytes", 0, 16 * 1024 * 1024) + || !integer("updated-at-ms", 1, now + 5000) + || !freshNetworkSample(point.value(QStringLiteral("updated-at-ms")).toLongLong(), now) + || !integer("source", 1, 2) || !integer("samples", 1, std::numeric_limits::max()) + || !networkNumber(point.value(QStringLiteral("ordered-bytes-per-second"))) || !networkRate(rate) + || !networkNumber(point.value(QStringLiteral("ttfb-ms"))) || ttfb < 0 || ttfb > 60000) + return {}; + const bool manual = point.value(QStringLiteral("receive-profile")).toInt() == 1; + const qint64 receive = point.value(QStringLiteral("receive-bytes")).toLongLong(); + if ((manual && receive < 1024 * 1024) || (!manual && receive != 0)) + return {}; + // Copy only the wire contract: provider data and transport diagnostics + // must never introduce private fields into the persistent history. + QVariantMap sample; + for (const char *field : { "requests", "http-version", "receive-profile", "receive-bytes", "range-bytes", + "updated-at-ms", "source", "samples" }) + sample.insert(QLatin1String(field), point.value(QLatin1String(field)).toLongLong()); + sample.insert(QStringLiteral("ordered-bytes-per-second"), rate); + sample.insert(QStringLiteral("ttfb-ms"), ttfb); + return sample; + } + + using NetworkPoints = QMap; + + void mergeNetworkPoint(NetworkPoints& points, const QVariantMap& sample) + { + const QString key = networkProfileKey(sample); + // A probe can replace only another probe of this exact profile. + if (points.value(key).value(QStringLiteral("source")).toInt() <= sample.value(QStringLiteral("source")).toInt()) + points.insert(key, sample); + } + + void boundNetworkPoints(NetworkPoints& points) + { + while (points.size() > 64) { + auto oldest = points.begin(); + for (auto it = points.begin(); it != points.end(); ++it) + if (it.value().value(QStringLiteral("updated-at-ms")).toLongLong() + < oldest.value().value(QStringLiteral("updated-at-ms")).toLongLong()) + oldest = it; + points.erase(oldest); + } + } + + NetworkPoints networkPoints(const QVariantMap& saved, qint64 now) + { + NetworkPoints points; + if (!networkInteger(saved.value(QStringLiteral("format")), 2, 2)) + return points; + for (const QVariant& value : saved.value(QStringLiteral("transport-samples")).toList()) { + const QVariantMap point = networkSample(value, now); + if (!point.isEmpty()) + mergeNetworkPoint(points, point); + } + boundNetworkPoints(points); + return points; + } + + QVariantList networkSamples(const NetworkPoints& points) + { + QVariantList samples; + for (const auto& point : points) + samples.append(point); + return samples; + } + bool requiresSignIn(const std::exception& error) { const std::string_view code(error.what()); return code == "http_401" || code == "invalid_config" || code == "auth_required" || code == "invalid_token"; } + bool connectionFailure(const std::exception& error) + { + const std::string_view code(error.what()); + return code == "network_error" || code == "operation_timeout" || code == "server_unreachable" + || code.starts_with("http_5"); + } + // One sentence for the profile that failed to open; provider codes are // grouped by what the viewer can do about them, never shown verbatim. QString activationError(const std::exception& error) @@ -75,7 +200,7 @@ namespace { return QStringLiteral("That PIN wasn't accepted. Try again."); if (code == "permission_denied") return QStringLiteral("This profile doesn't have access to this server."); - if (code == "network_error" || code == "operation_timeout" || code == "server_unreachable") + if (connectionFailure(error)) return QStringLiteral("Couldn't reach the server. Check the connection and try again."); return QStringLiteral("Couldn't open this profile. Try again."); } @@ -335,6 +460,21 @@ QCoro::Task ProviderRegistry::restore() m_startupChoices = root.value(QStringLiteral("startup")).toObject().toVariantMap(); m_networkProfiles = root.value(QStringLiteral("networkProfiles")).toObject().toVariantMap(); m_networkEndpoints = root.value(QStringLiteral("networkEndpoints")).toObject().toVariantMap(); + // The account envelope remains format 2; only incompatible learned rows + // are reset, leaving account metadata and credential restoration intact. + const qsizetype savedProfiles = m_networkProfiles.size(); + for (auto it = m_networkProfiles.begin(); it != m_networkProfiles.end();) { + if (!networkInteger(it.value().toMap().value(QStringLiteral("format")), 2, 2)) + it = m_networkProfiles.erase(it); + else + ++it; + } + if (m_networkProfiles.size() > 64) { + const QString key = m_networkProfiles.firstKey(); + storeNetworkProfile(key, m_networkProfiles.value(key).toMap()); + } + if (m_networkProfiles.size() != savedProfiles) + m_networkSaveTimer.start(); m_lanApprovedModules = root.value(QStringLiteral("lanApproved")).toVariant().toStringList(); std::vector accounts; for (const QJsonValue& row : root.value(QStringLiteral("accounts")).toArray()) { @@ -974,48 +1114,17 @@ QVariantMap ProviderRegistry::playbackNetworkProfile(const QString& accountId, c const QString key = origin.isEmpty() ? m_networkEndpoints.value(accountId).toString() : endpointKey(origin); const QVariantMap saved = m_networkProfiles.value(key).toMap(); const qint64 now = QDateTime::currentMSecsSinceEpoch(); - QVariantList samples; + const NetworkPoints points = networkPoints(saved, now); double best = 0; - QHash estimates; - // Qt's generated-byte test is a prior, never a replacement for actual - // media delivery measured by curl at the same concurrency. - for (const QString& field : { QStringLiteral("probe-samples"), QStringLiteral("concurrency-samples") }) { - for (const QVariant& value : saved.value(field).toList()) { - const QVariantMap sample = value.toMap(); - const int requests = sample.value(QStringLiteral("requests")).toInt(); - const double capacity = sample.value(QStringLiteral("capacity-bytes-per-second")).toDouble(); - if (requests >= 1 && requests <= 16 && networkRate(capacity) - && freshNetworkSample(sample.value(QStringLiteral("updated-at-ms")).toLongLong(), now)) - estimates.insert(requests, sample); - } - } - for (int requests = 1; requests <= 16; ++requests) { - if (estimates.contains(requests)) { - const auto sample = estimates.value(requests); - samples.append(sample); - best = std::max(best, sample.value(QStringLiteral("capacity-bytes-per-second")).toDouble()); - } - } - const bool recentPlayback - = !samples.isEmpty() && freshNetworkSample(saved.value(QStringLiteral("playback-at-ms")).toLongLong(), now); - const double mediaBitrate = recentPlayback ? saved.value(QStringLiteral("media-bitrate")).toDouble() : 0; - const auto selection = selectNetworkLanes(samples, mediaBitrate); - const int selected = selection.requests; - qInfo("streaming profile selection requests=%d reason=%d media_bitrate=%.0f best_capacity_bytes_per_second=%.0f", - selected, selection.reason, mediaBitrate, best); - double capacity = 0; - double latency = 0; - for (const QVariant& value : samples) { - const auto sample = value.toMap(); - if (sample.value(QStringLiteral("requests")).toInt() == selected) { - capacity = sample.value(QStringLiteral("capacity-bytes-per-second")).toDouble(); - latency = sample.value(QStringLiteral("ttfb-ms")).toDouble(); - } - } - return { { QStringLiteral("initial-requests"), selected }, { QStringLiteral("ttfb-ms"), latency }, - { QStringLiteral("capacity-bytes-per-second"), capacity }, + for (const auto& point : points) + best = std::max(best, point.value(QStringLiteral("ordered-bytes-per-second")).toDouble()); + const QVariant selected = saved.value(QStringLiteral("last-selected-requests")); + const bool recent + = !points.isEmpty() && freshNetworkSample(saved.value(QStringLiteral("updated-at-ms")).toLongLong(), now); + return { { QStringLiteral("format"), 2 }, + { QStringLiteral("last-selected-requests"), recent && networkInteger(selected, 1, 16) ? selected.toInt() : 1 }, { QStringLiteral("measured-bitrate"), qint64(best * 8 * 0.75) }, - { QStringLiteral("concurrency-samples"), samples } }; + { QStringLiteral("transport-samples"), networkSamples(points) } }; } void ProviderRegistry::rememberPlaybackOrigin(const QString& accountId, const QUrl& origin) @@ -1029,6 +1138,24 @@ void ProviderRegistry::rememberPlaybackOrigin(const QString& accountId, const QU } } +void ProviderRegistry::storeNetworkProfile(const QString& key, QVariantMap profile) +{ + m_networkProfiles.insert(key, std::move(profile)); + while (m_networkProfiles.size() > 64) { + auto oldest = m_networkProfiles.begin(); + if (oldest.key() == key) + ++oldest; + for (auto it = m_networkProfiles.begin(); it != m_networkProfiles.end(); ++it) + if (it.key() != key + && it.value().toMap().value(QStringLiteral("updated-at-ms")).toLongLong() + < oldest.value().toMap().value(QStringLiteral("updated-at-ms")).toLongLong()) + oldest = it; + m_networkFeedback.remove(oldest.key()); + m_networkPointSamples.remove(oldest.key()); + m_networkProfiles.erase(oldest); + } +} + bool ProviderRegistry::updatePlaybackNetworkProfile( const QString& accountId, const QUrl& origin, const QVariantMap& metrics) { @@ -1039,72 +1166,63 @@ bool ProviderRegistry::updatePlaybackNetworkProfile( const quint64 count = metrics.value(QStringLiteral("capacity-samples")).toULongLong(); const int requests = metrics.value(QStringLiteral("selected-requests")).toInt(); const auto previous = m_networkFeedback.value(key); - if (key.isEmpty() || !sourceRunning(accountId) || !accountOriginAllowed(accountId, origin) || observed <= 0 - || observed > now + 5000 || now - observed > 5 * 60 * 1000 || !stream || !count || stream < previous.first - || (stream == previous.first && count <= previous.second) || requests < 1 || requests > 16) + if (key.isEmpty() || !sourceRunning(accountId) || !accountOriginAllowed(accountId, origin) + || metrics.value(QStringLiteral("primary-origin-match")).metaType().id() != QMetaType::Bool + || !metrics.value(QStringLiteral("primary-origin-match")).toBool() + || !networkInteger(metrics.value(QStringLiteral("observed-at-ms")), now - 5 * 60 * 1000, now + 5000) + || !networkInteger(metrics.value(QStringLiteral("stream-id")), 1, std::numeric_limits::max()) + || !networkInteger(metrics.value(QStringLiteral("capacity-samples")), 1, std::numeric_limits::max()) + || stream < previous.first || (stream == previous.first && count <= previous.second) + || !networkInteger(metrics.value(QStringLiteral("selected-requests")), 1, 16)) + return false; + // Only the primary origin's unthrottled capacity observations enter here; + // lifetime/current rates include cache backpressure and are not priors. + const QVariant input = metrics.value(QStringLiteral("transport-samples")); + const QVariantList incoming = input.toList(); + if (input.metaType().id() != QMetaType::QVariantList || incoming.isEmpty() || incoming.size() > 64) return false; - // Only curl's unthrottled capacity observations are accepted; lifetime - // average/current rates include cache backpressure and must not enter here. QVariantMap saved = m_networkProfiles.value(key).toMap(); - QHash points; - for (const QVariant& value : saved.value(QStringLiteral("concurrency-samples")).toList()) { - const auto point = value.toMap(); - if (freshNetworkSample(point.value(QStringLiteral("updated-at-ms")).toLongLong(), now)) - points.insert(point.value(QStringLiteral("requests")).toInt(), point); - } - auto seen = stream == previous.first ? m_networkPointSamples.value(key) : QHash(); + NetworkPoints points = networkPoints(saved, now); + auto seen = stream == previous.first ? m_networkPointSamples.value(key) : QHash(); + QSet incomingKeys; bool changed = false; - const QVariantList incoming = metrics.value(QStringLiteral("concurrency-samples")).toList(); - if (incoming.isEmpty() || incoming.size() > 16) - return false; for (const QVariant& value : incoming) { - const auto point = value.toMap(); - const int lanes = point.value(QStringLiteral("requests")).toInt(); - const double rate = point.value(QStringLiteral("capacity-bytes-per-second")).toDouble(); - const double latency = point.value(QStringLiteral("ttfb-ms")).toDouble(); - const quint64 samples = point.value(QStringLiteral("samples")).toULongLong(); - if (lanes < 1 || lanes > 16 || !networkRate(rate) || !std::isfinite(latency) || latency < 0 || latency > 60000 - || !samples) + QVariantMap point = networkSample(value, now); + if (point.isEmpty() || point.value(QStringLiteral("source")).toInt() != 2 + || point.value(QStringLiteral("updated-at-ms")).toLongLong() > observed + 5000) + return false; + const QString identity = networkProfileKey(point); + if (incomingKeys.contains(identity)) return false; - if (samples <= seen.value(lanes)) + incomingKeys.insert(identity); + const quint64 samples = point.value(QStringLiteral("samples")).toULongLong(); + if (samples <= seen.value(identity)) continue; - const double old = points.value(lanes).value(QStringLiteral("capacity-bytes-per-second")).toDouble(); - points.insert(lanes, - { { QStringLiteral("requests"), lanes }, - { QStringLiteral("capacity-bytes-per-second"), networkRate(old) ? old * 0.5 + rate * 0.5 : rate }, - { QStringLiteral("ttfb-ms"), latency }, { QStringLiteral("updated-at-ms"), now } }); - seen.insert(lanes, samples); + const auto old = points.value(identity); + if (old.value(QStringLiteral("source")).toInt() == 2) { + const double rate = point.value(QStringLiteral("ordered-bytes-per-second")).toDouble(); + point.insert(QStringLiteral("ordered-bytes-per-second"), + old.value(QStringLiteral("ordered-bytes-per-second")).toDouble() * 0.5 + rate * 0.5); + } + mergeNetworkPoint(points, point); + seen.insert(identity, samples); changed = true; - qInfo("streaming profile sample source=2 requests=%d capacity_bytes_per_second=%.0f ttfb_ms=%.3f samples=%llu", - lanes, points.value(lanes).value(QStringLiteral("capacity-bytes-per-second")).toDouble(), latency, - static_cast(samples)); } if (!changed) return false; - QVariantList merged; - for (int lanes = 1; lanes <= 16; ++lanes) - if (points.contains(lanes)) - merged.append(points.value(lanes)); - saved.insert(QStringLiteral("concurrency-samples"), merged); - saved.insert(QStringLiteral("playback-at-ms"), now); - const double bitrate = metrics.value(QStringLiteral("media-bitrate")).toDouble(); - if (std::isfinite(bitrate) && bitrate > 0 && bitrate <= 800.0e9) - saved.insert(QStringLiteral("media-bitrate"), bitrate); - m_networkProfiles.insert(key, saved); + boundNetworkPoints(points); + for (auto it = seen.begin(); it != seen.end();) { + if (!points.contains(it.key())) + it = seen.erase(it); + else + ++it; + } + saved = { { QStringLiteral("format"), 2 }, { QStringLiteral("last-selected-requests"), requests }, + { QStringLiteral("updated-at-ms"), now }, { QStringLiteral("transport-samples"), networkSamples(points) } }; + storeNetworkProfile(key, saved); m_networkFeedback.insert(key, { stream, count }); m_networkPointSamples.insert(key, seen); rememberPlaybackOrigin(accountId, origin); - // Bound the persistent history even when a provider resolves many mirrors. - while (m_networkProfiles.size() > 64) { - auto oldest = m_networkProfiles.begin(); - for (auto it = m_networkProfiles.begin(); it != m_networkProfiles.end(); ++it) - if (it.value().toMap().value(QStringLiteral("playback-at-ms")).toLongLong() - < oldest.value().toMap().value(QStringLiteral("playback-at-ms")).toLongLong()) - oldest = it; - m_networkFeedback.remove(oldest.key()); - m_networkPointSamples.remove(oldest.key()); - m_networkProfiles.erase(oldest); - } if (!m_networkSaveTimer.isActive()) m_networkSaveTimer.start(); return true; @@ -1114,39 +1232,44 @@ bool ProviderRegistry::recordSpeedTest(const QString& accountId, const QVariantM { const QUrl origin(result.value(QStringLiteral("origin")).toString()); const QString key = endpointKey(origin); - if (key.isEmpty() || !accountOriginAllowed(accountId, origin)) + if (key.isEmpty() || !sourceRunning(accountId) || !accountOriginAllowed(accountId, origin)) return false; const QVariantList input = result.value(QStringLiteral("concurrency-samples")).toList(); if (input.size() != 3) return false; + const qint64 now = QDateTime::currentMSecsSinceEpoch(); QVariantList samples; int expected = 1; - const qint64 now = QDateTime::currentMSecsSinceEpoch(); for (const QVariant& value : input) { const auto sample = value.toMap(); const double rate = sample.value(QStringLiteral("capacity-bytes-per-second")).toDouble(); - const double latency = sample.value(QStringLiteral("ttfb-ms")).toDouble(); - if (sample.value(QStringLiteral("requests")).toInt() != expected || !networkRate(rate) - || !std::isfinite(latency) || latency < 0 || latency > 60000) + const double ttfb = sample.value(QStringLiteral("ttfb-ms")).toDouble(); + if (!networkInteger(sample.value(QStringLiteral("requests")), expected, expected) + || !networkNumber(sample.value(QStringLiteral("capacity-bytes-per-second"))) || !networkRate(rate) + || !networkNumber(sample.value(QStringLiteral("ttfb-ms"))) || ttfb < 0 || ttfb > 60000) return false; - samples.append(QVariantMap { { QStringLiteral("requests"), expected }, - { QStringLiteral("capacity-bytes-per-second"), rate }, { QStringLiteral("ttfb-ms"), latency }, - { QStringLiteral("updated-at-ms"), now } }); - qInfo("streaming profile sample source=1 requests=%d capacity_bytes_per_second=%.0f ttfb_ms=%.3f", expected, - rate, latency); + samples.append(QVariantMap { { QStringLiteral("requests"), expected }, { QStringLiteral("http-version"), 0 }, + { QStringLiteral("receive-profile"), 0 }, { QStringLiteral("receive-bytes"), 0 }, + { QStringLiteral("range-bytes"), 0 }, { QStringLiteral("ordered-bytes-per-second"), rate }, + { QStringLiteral("ttfb-ms"), ttfb }, { QStringLiteral("updated-at-ms"), now }, + { QStringLiteral("source"), 1 }, { QStringLiteral("samples"), 1 } }); expected *= 2; } - auto saved = m_networkProfiles.value(key).toMap(); - saved.insert(QStringLiteral("probe-samples"), samples); - m_networkProfiles.insert(key, saved); - while (m_networkProfiles.size() > 64) { - auto victim = m_networkProfiles.begin(); - if (victim.key() == key) - ++victim; - m_networkFeedback.remove(victim.key()); - m_networkPointSamples.remove(victim.key()); - m_networkProfiles.erase(victim); - } + QVariantMap saved = m_networkProfiles.value(key).toMap(); + NetworkPoints points = networkPoints(saved, now); + bool playback = false; + for (const auto& point : points) + playback |= point.value(QStringLiteral("source")).toInt() == 2; + for (const auto& sample : samples) + mergeNetworkPoint(points, sample.toMap()); + boundNetworkPoints(points); + const QVariant selected = result.value(QStringLiteral("parallelRequests")); + const int last = playback ? saved.value(QStringLiteral("last-selected-requests"), 1).toInt() + : networkInteger(selected, 1, 16) ? selected.toInt() + : 1; + saved = { { QStringLiteral("format"), 2 }, { QStringLiteral("last-selected-requests"), last }, + { QStringLiteral("updated-at-ms"), now }, { QStringLiteral("transport-samples"), networkSamples(points) } }; + storeNetworkProfile(key, saved); if (!m_networkEndpoints.contains(accountId)) rememberPlaybackOrigin(accountId, origin); persist(false); @@ -1271,14 +1394,24 @@ QCoro::Task ProviderRegistry::guarded(QString sourceId, Call call, QString ca try { result = co_await call(runtime, runtimeId); } catch (const std::exception& error) { - // The server no longer accepts this account's credentials: say so - // once, and let the accounts page offer to sign in again. - if (guard && m_running.value(sourceId).generation == generation && requiresSignIn(error) - && !m_expired.contains(sourceId)) { - m_expired.insert(sourceId); - if (const ProviderAccount *entry = account(sourceId)) - emit problem(QStringLiteral("Sign in to %1 again").arg(entry->label)); - emit accountsChanged(); + // A live runtime is not proof that its server is reachable or still + // accepts these credentials. Surface each failure until recovery. + if (guard && m_running.value(sourceId).generation == generation) { + if (requiresSignIn(error) && !m_expired.contains(sourceId)) { + m_expired.insert(sourceId); + m_accountErrors.insert(sourceId, activationError(error)); + if (const ProviderAccount *entry = account(sourceId)) + emit problem(QStringLiteral("Sign in to %1 again").arg(entry->label)); + emit accountsChanged(); + } else if (connectionFailure(error) && !m_failedAccounts.contains(sourceId)) { + m_failedAccounts.insert(sourceId); + const QString message = activationError(error); + m_accountErrors.insert(sourceId, message); + if (const ProviderAccount *entry = account(sourceId)) + emit problem( + QStringLiteral("%1: %2").arg(entry->detail.isEmpty() ? entry->label : entry->detail, message)); + emit accountsChanged(); + } } throw; } @@ -1345,6 +1478,11 @@ QCoro::Task ProviderRegistry::callSource( }, capability, scope); requireCurrent(); + if (operation == QStringLiteral("libraries") && !m_expired.contains(sourceId) + && m_failedAccounts.remove(sourceId)) { + m_accountErrors.remove(sourceId); + emit accountsChanged(); + } if (preferences) result = ProviderExtensionData::preferenceResult(operation, result); else if (storage) { @@ -1660,13 +1798,15 @@ QVariantList ProviderRegistry::accounts() const { QStringLiteral("pendingEnabled"), m_preparing.contains(account.id) && m_running.value(m_preparing.value(account.id)).enableOnCommit }, { QStringLiteral("connectionState"), - m_running.value(account.id).provider ? QStringLiteral("active") - : m_preparing.contains(account.id) ? QStringLiteral("starting") - : m_lockedAccounts.contains(account.id) ? QStringLiteral("locked") - : m_failedAccounts.contains(account.id) || (owner && owner->failed) ? QStringLiteral("failed") - : awaiting ? QStringLiteral("choose") - : account.enabled ? QStringLiteral("starting") - : QStringLiteral("locked") }, + m_preparing.contains(account.id) ? QStringLiteral("starting") + : m_expired.contains(account.id) || m_unavailableConfigurations.contains(account.id) + || m_failedAccounts.contains(account.id) || (owner && owner->failed) + ? QStringLiteral("failed") + : m_running.value(account.id).provider ? QStringLiteral("active") + : m_lockedAccounts.contains(account.id) ? QStringLiteral("locked") + : awaiting ? QStringLiteral("choose") + : account.enabled ? QStringLiteral("starting") + : QStringLiteral("locked") }, { QStringLiteral("capabilities"), capabilities(account.id) }, { QStringLiteral("needsSignIn"), m_expired.contains(account.id) || m_unavailableConfigurations.contains(account.id) }, @@ -2094,7 +2234,7 @@ void ProviderRegistry::useAccount(const QString& accountId) emit accountSelectionFinished(accountId, false); return; } - if (m_running.value(accountId).provider) { + if (m_running.value(accountId).provider && !m_failedAccounts.contains(accountId)) { ProviderAccount selected = *chosen; selected.enabled = true; selected.lastUsed = QDateTime::currentMSecsSinceEpoch(); diff --git a/src/provider/ProviderRegistry.h b/src/provider/ProviderRegistry.h index 39856810..d5a133c7 100644 --- a/src/provider/ProviderRegistry.h +++ b/src/provider/ProviderRegistry.h @@ -278,6 +278,7 @@ class ProviderRegistry final : public QObject { void updateCapabilities(const QString& sourceId, QVariantMap offers); QCoro::Task requestNetworkConsent(QString sourceId, QString scope, QString kind, QUrl origin = {}); void cancelNetworkConsent(const QString& sourceId, const QString& scope = {}); + void storeNetworkProfile(const QString& key, QVariantMap profile); QPointer m_database; QString m_installDirectory; @@ -310,7 +311,7 @@ class ProviderRegistry final : public QObject { // sign-in with the same provider is not asked again. QStringList m_lanApprovedModules; QHash> m_networkFeedback; - QHash> m_networkPointSamples; + QHash> m_networkPointSamples; QTimer m_networkSaveTimer; QSet m_removingAccounts; std::shared_ptr> m_consentPromise; diff --git a/src/provider/ScriptBridge.cpp b/src/provider/ScriptBridge.cpp index bbf0a5f6..60448b18 100644 --- a/src/provider/ScriptBridge.cpp +++ b/src/provider/ScriptBridge.cpp @@ -23,6 +23,7 @@ #include #include #include +#include #ifdef Q_OS_WIN #include @@ -307,8 +308,11 @@ namespace { while (iterator.hasNext()) { iterator.next(); bytes += iterator.name().size() * sizeof(QChar); - map.insert( - iterator.name(), own(iterator.value(), nodes, bytes, maximumNodes, maximumBytes, depth + 1, jsonData)); + // Omit undefined object properties, but still charge their traversal + // against the node/byte limits. Null remains a present value. + QVariant property = own(iterator.value(), nodes, bytes, maximumNodes, maximumBytes, depth + 1, jsonData); + if (property.isValid()) + map.insert(iterator.name(), std::move(property)); } return map; } diff --git a/src/provider/SourceHub.cpp b/src/provider/SourceHub.cpp index c730ac39..e0ce2ecc 100644 --- a/src/provider/SourceHub.cpp +++ b/src/provider/SourceHub.cpp @@ -537,7 +537,6 @@ void SourceHub::addSource(Provider *provider) const auto profile = m_registry->playbackNetworkProfile(accountId); auto& restored = m_entries[prefixOf(accountId)]; restored.measuredBitrate = profile.value(QStringLiteral("measured-bitrate")).toLongLong(); - restored.parallelRequests = profile.value(QStringLiteral("initial-requests"), 1).toInt(); if (restored.measuredBitrate > 0) restored.speedState = Entry::SpeedState::Complete; connect(provider, &Provider::capabilitiesChanged, this, [this, accountId, provider] { @@ -548,7 +547,6 @@ void SourceHub::addSource(Provider *provider) if (entry != m_entries.end()) { entry->speedState = Entry::SpeedState::Pending; entry->measuredBitrate = 0; - entry->parallelRequests = 1; } pushPlaybackContext(); } @@ -1114,6 +1112,18 @@ void SourceHub::setPlaybackPreferences( emit streamingQualityChanged(); } +void SourceHub::setPlaybackPreferenceResolver(std::function resolver) +{ + m_playbackPreferenceResolver = std::move(resolver); + pushPlaybackContext(); +} + +void SourceHub::refreshPlaybackPreferences() +{ + pushPlaybackContext(); + emit streamingQualityChanged(); +} + void SourceHub::setOverride(qint64 bitrate, int height) { m_bitrate = bitrate; @@ -1188,17 +1198,21 @@ void SourceHub::setVideoPreviewsEnabled(bool enabled) void SourceHub::pushPlaybackContext() { // The viewer's pick in the player wins over the standing preference. - QVariantMap context = m_preferences; - context.insert(QStringLiteral("maxBitrate"), m_bitrate); - context.insert(QStringLiteral("maxHeight"), m_height); - context.insert(QStringLiteral("videoCodecs"), m_videoCodecs); - context.insert(QStringLiteral("restrictVideoCodecs"), m_restrictVideoCodecs); - context.insert(QStringLiteral("videoPreviews"), m_videoPreviewsEnabled); + QVariantMap base = m_preferences; + base.insert(QStringLiteral("maxBitrate"), m_bitrate); + base.insert(QStringLiteral("maxHeight"), m_height); + base.insert(QStringLiteral("videoCodecs"), m_videoCodecs); + base.insert(QStringLiteral("restrictVideoCodecs"), m_restrictVideoCodecs); + base.insert(QStringLiteral("videoPreviews"), m_videoPreviewsEnabled); for (const Entry& entry : std::as_const(m_entries)) { if (auto *portable = qobject_cast(entry.provider.data())) { + QVariantMap context = base; + const auto preferences + = m_playbackPreferenceResolver ? m_playbackPreferenceResolver(entry.accountId) : m_preferences; + for (auto it = preferences.cbegin(); it != preferences.cend(); ++it) + context.insert(it.key(), it.value()); const auto learned = m_registry->playbackNetworkProfile(entry.accountId); context.insert(QStringLiteral("measuredBitrate"), learned.value(QStringLiteral("measured-bitrate"))); - context.insert(QStringLiteral("parallelRequests"), learned.value(QStringLiteral("initial-requests"), 1)); portable->setPlaybackContext(context); portable->setPlaybackQueueContext( m_queueSnapshots.value(entry.accountId), m_queueIndexes.value(entry.accountId, -1)); @@ -1268,7 +1282,6 @@ void SourceHub::startNextSpeedTest() entry->speedState = valid ? Entry::SpeedState::Complete : Entry::SpeedState::Failed; if (valid) { entry->measuredBitrate = profile.value(QStringLiteral("measured-bitrate")).toLongLong(); - entry->parallelRequests = profile.value(QStringLiteral("initial-requests"), 1).toInt(); pushPlaybackContext(); } } @@ -1287,9 +1300,7 @@ QString SourceHub::speedDescription(const Entry& entry) const { QString detail; if (entry.measuredBitrate > 0) - detail = QStringLiteral("Measured limit: %1 · %2 connection(s)") - .arg(formatBitrate(entry.measuredBitrate)) - .arg(entry.parallelRequests); + detail = QStringLiteral("Measured limit: %1").arg(formatBitrate(entry.measuredBitrate)); if (entry.speedState == Entry::SpeedState::Running) return detail.isEmpty() ? QStringLiteral("Measuring connection speed…") : detail + QStringLiteral(" · Measuring…"); @@ -1332,17 +1343,22 @@ QVariantMap SourceHub::speedTestStatus() const } } QVariantList curve; - for (const QVariant& value : profile.value(QStringLiteral("concurrency-samples")).toList()) { + for (const QVariant& value : profile.value(QStringLiteral("transport-samples")).toList()) { const QVariantMap sample = value.toMap(); curve.append(QVariantMap { { QStringLiteral("requests"), sample.value(QStringLiteral("requests")).toInt() }, + { QStringLiteral("httpVersion"), sample.value(QStringLiteral("http-version")).toInt() }, + { QStringLiteral("receiveProfile"), sample.value(QStringLiteral("receive-profile")).toInt() }, + { QStringLiteral("receiveBytes"), sample.value(QStringLiteral("receive-bytes")).toLongLong() }, + { QStringLiteral("rangeBytes"), sample.value(QStringLiteral("range-bytes")).toLongLong() }, + { QStringLiteral("source"), sample.value(QStringLiteral("source")).toInt() }, { QStringLiteral("mbps"), - sample.value(QStringLiteral("capacity-bytes-per-second")).toDouble() * 8.0 / 1'000'000.0 } }); + sample.value(QStringLiteral("ordered-bytes-per-second")).toDouble() * 8.0 / 1'000'000.0 } }); } accounts.append(QVariantMap { { QStringLiteral("index"), int(accounts.size()) }, { QStringLiteral("measuredMbps"), profile.value(QStringLiteral("measured-bitrate")).toDouble() / 1'000'000.0 }, { QStringLiteral("accountId"), provider->id() }, { QStringLiteral("moduleId"), moduleId }, - { QStringLiteral("selectedRequests"), profile.value(QStringLiteral("initial-requests"), 1).toInt() }, + { QStringLiteral("selectedRequests"), profile.value(QStringLiteral("last-selected-requests"), 1).toInt() }, { QStringLiteral("laneMbps"), curve }, { QStringLiteral("running"), entry->speedState == Entry::SpeedState::Running }, { QStringLiteral("pending"), entry->speedState == Entry::SpeedState::Pending }, @@ -1355,7 +1371,9 @@ QString SourceHub::autoDescription() const { const auto entry = m_entries.constFind(prefixOf(m_playbackAccount)); QStringList details; - const qint64 preferred = m_preferences.value(QStringLiteral("preferredMaxBitrate")).toLongLong(); + const auto preferences + = m_playbackPreferenceResolver ? m_playbackPreferenceResolver(m_playbackAccount) : m_preferences; + const qint64 preferred = preferences.value(QStringLiteral("preferredMaxBitrate")).toLongLong(); if (preferred > 0) details.append(QStringLiteral("Settings limit: %1").arg(formatBitrate(preferred))); if (entry != m_entries.cend() && entry->provider && entry->provider->capabilities().testFlag(Provider::SpeedTest)) diff --git a/src/provider/SourceHub.h b/src/provider/SourceHub.h index 7f81aa43..0ab9f71a 100644 --- a/src/provider/SourceHub.h +++ b/src/provider/SourceHub.h @@ -14,6 +14,7 @@ #include #include +#include #include #include #include @@ -139,6 +140,8 @@ class SourceHub final : public Provider, QVariantMap remoteQueueRow(const MovieItem& item) const; // The viewer's standing streaming limits from settings. void setPlaybackPreferences(qint64 manualMaxBitrate, bool unlimitedLocalNetwork, bool preferRemux, int maxHeight); + void setPlaybackPreferenceResolver(std::function resolver); + void refreshPlaybackPreferences(); struct ReportingQueueEntry { QString itemId; QString entryId; @@ -230,7 +233,6 @@ class SourceHub final : public Provider, enum class SpeedState { Pending, Running, Complete, Failed }; SpeedState speedState = SpeedState::Pending; qint64 measuredBitrate = 0; - int parallelRequests = 1; struct RemotePreview { QString urlTemplate; QByteArray headers; @@ -274,6 +276,7 @@ class SourceHub final : public Provider, QStringList m_videoCodecs; bool m_restrictVideoCodecs = false; QVariantMap m_preferences; + std::function m_playbackPreferenceResolver; std::vector m_reportingQueue; QHash m_queueSnapshots; std::vector> m_queueLocations; diff --git a/src/provider/SpeedTest.cpp b/src/provider/SpeedTest.cpp index 8246a51d..697e1c33 100644 --- a/src/provider/SpeedTest.cpp +++ b/src/provider/SpeedTest.cpp @@ -13,38 +13,6 @@ namespace Spool { -NetworkLaneSelection selectNetworkLanes(const QVariantList& samples, double mediaBitrate, int maxRequests) -{ - double best = 0; - maxRequests = std::clamp(maxRequests, 1, 16); - for (const QVariant& value : samples) { - const auto sample = value.toMap(); - const int requests = sample.value(QStringLiteral("requests")).toInt(); - const double capacity = sample.value(QStringLiteral("capacity-bytes-per-second")).toDouble(); - if (requests >= 1 && requests <= maxRequests && std::isfinite(capacity)) - best = std::max(best, capacity); - } - if (!(best > 0)) - return {}; - // Sub-15% gains are not evidence that another socket is useful, especially - // on fast links where scheduling and connection warmup dominate tiny tests. - double threshold = best * 0.85; - int reason = 1; - if (std::isfinite(mediaBitrate) && mediaBitrate > 0 && mediaBitrate * 1.75 / 8 <= threshold) { - threshold = mediaBitrate * 1.75 / 8; - reason = 2; - } - int selected = 17; - for (const QVariant& value : samples) { - const auto sample = value.toMap(); - const int requests = sample.value(QStringLiteral("requests")).toInt(); - if (requests >= 1 && requests <= maxRequests - && sample.value(QStringLiteral("capacity-bytes-per-second")).toDouble() >= threshold) - selected = std::min(selected, requests); - } - return { selected <= 16 ? selected : 1, reason }; -} - SpeedTest::SpeedTest(ScriptAccess *access, Completion completion, QObject *parent) : QObject(parent) , m_access(access) @@ -101,10 +69,17 @@ void SpeedTest::finish(QString error, qint64 bitrate) "elapsed_seconds=%.3f received_bytes=%lld", 1 << i, m_rates[i] / 8, m_latencies[i], m_durations[i], static_cast(m_received[i])); } - const auto selection = selectNetworkLanes(samples, m_targetBitrate); - const int lanes = selection.requests; - qInfo("streaming probe selection requests=%d reason=%d media_bitrate=%.0f", lanes, selection.reason, - m_targetBitrate); + // This count describes the offline probe only; native playback chooses + // its own profile from the complete measured curve. + const double threshold = *std::max_element(m_rates.cbegin(), m_rates.cend()) * 0.85; + int lanes = 1; + for (int i = 0; i < 3; ++i) { + if (m_rates[i] >= threshold) { + lanes = 1 << i; + break; + } + } + qInfo("streaming probe selection requests=%d", lanes); QUrl endpoint; endpoint.setScheme(m_request.url().scheme()); endpoint.setHost(m_request.url().host()); @@ -117,9 +92,6 @@ void SpeedTest::finish(QString error, qint64 bitrate) void SpeedTest::start(const QVariantMap& options) { - const double target = options.value(QStringLiteral("mediaBitrate")).toDouble(); - if (std::isfinite(target) && target > 0 && target <= 800.0e9) - m_targetBitrate = target; const QVariant address = options.value(QStringLiteral("url")); if (address.metaType().id() != QMetaType::QString) return finish(QStringLiteral("request_denied")); diff --git a/src/provider/SpeedTest.h b/src/provider/SpeedTest.h index b8869ade..1282efaf 100644 --- a/src/provider/SpeedTest.h +++ b/src/provider/SpeedTest.h @@ -16,14 +16,6 @@ namespace Spool { struct ScriptAccess; -// Minimum measured concurrency within 15% of peak capacity, or sufficient -// playback headroom. Reason: 0 = unmeasured, 1 = capacity, 2 = playback demand. -struct NetworkLaneSelection { - int requests = 1; - int reason = 0; -}; -NetworkLaneSelection selectNetworkLanes(const QVariantList& samples, double mediaBitrate, int maxRequests = 16); - // A worker-local benchmark. Destruction disconnects and aborts every lane; // the owning ScriptOperation supplies the shared 15-second deadline. class SpeedTest final : public QObject { @@ -70,7 +62,6 @@ class SpeedTest final : public QObject { qint64 m_chunkBytes = 4 * 1024 * 1024; bool m_done = false; bool m_range = false; - double m_targetBitrate = 0; }; } // namespace Spool diff --git a/tests/app/SettingsControllerTest.cpp b/tests/app/SettingsControllerTest.cpp index 181990e5..9abb9e71 100644 --- a/tests/app/SettingsControllerTest.cpp +++ b/tests/app/SettingsControllerTest.cpp @@ -89,6 +89,53 @@ SPOOL_TEST_MAIN("settings-controller") && settings.value(QStringLiteral("playback/maxStreamingThreads")).toInt() == 4 && !settings.value(QStringLiteral("playback/forceStreamingThreads")).toBool(), "fresh profile did not preserve adaptive streaming with a four-request maximum"); + // Per-account overrides cross the real persistence boundary, remain local, + // and keep the bitrate toggle/value together when reverting to defaults. + { + const QString first = QStringLiteral("12345678-aaaa-bbbb-cccc-dddddddddddd"); + const QString second = QStringLiteral("87654321-aaaa-bbbb-cccc-dddddddddddd"); + const QString http = QStringLiteral("playback/streamingHttpVersion"); + settings.setServerValue(http, QStringLiteral("http1"), first); + require(settings.effectiveValue(http, first).toString() == QLatin1String("http1") + && settings.effectiveValue(http, second).toString() == QLatin1String("auto") + && settings.value(http).toString() == QLatin1String("auto"), + "a server HTTP restriction must not affect global defaults or another server"); + require(settings.effectiveValue(http, QStringLiteral("12345678:item")).toString() == QLatin1String("http1"), + "scoped item IDs must resolve the same account override"); + QCoro::waitFor(settings.applyValues({ { http, QStringLiteral("tcp") } }, Spool::ChangeOrigin::User)); + require(settings.effectiveValue(http, first).toString() == QLatin1String("http1") + && settings.effectiveValue(http, second).toString() == QLatin1String("tcp"), + "following defaults must update live while a custom server remains unchanged"); + QCoro::waitFor(settings.applyValues({ { http, QStringLiteral("auto") } }, Spool::ChangeOrigin::User)); + settings.setServerValue(http, QStringLiteral("invalid"), first); + settings.setServerValue(QStringLiteral("appearance/uiScalePercent"), 180, first); + require(settings.effectiveValue(http, first).toString() == QLatin1String("http1") + && !settings.hasServerOverride(QStringLiteral("appearance/uiScalePercent"), first), + "invalid or non-playback server edits must be rejected atomically"); + settings.setServerValue(QStringLiteral("playback/manualStreamingBitrate"), true, first); + require(settings.hasServerOverride(QStringLiteral("playback/maxStreamingBitrateMbps"), first), + "manual bitrate and its value must become one server override"); + settings.setServerValue(QStringLiteral("playback/maxStreamingBitrateMbps"), 200, first); + SettingsController restored(&database, nullptr, &artwork); + QCoro::waitFor(restored.loadLocalAsync()); + require(restored.effectiveValue(http, first).toString() == QLatin1String("http1") + && restored.effectiveValue(QStringLiteral("playback/maxStreamingBitrateMbps"), first).toInt() == 200, + "server playback overrides must survive a settings-controller reload"); + require(!restored.values().contains(QStringLiteral("playback/serverOverrides-v1")), + "device account overrides must never enter the global syncable value map"); + settings.resetServerValue(QStringLiteral("playback/maxStreamingBitrateMbps"), first); + require(!settings.hasServerOverride(QStringLiteral("playback/manualStreamingBitrate"), first) + && !settings.hasServerOverride(QStringLiteral("playback/maxStreamingBitrateMbps"), first), + "Use default must reset the entire manual bitrate override"); + settings.setServerValue(http, QStringLiteral("tcp"), second); + settings.retainServerOverrides({ second }); + require(!settings.hasServerOverride(http, first) && settings.hasServerOverride(http, second), + "removing an account must delete only that account's playback overrides"); + settings.removeServerOverrides(second); + require(settings.serverOverrides().isEmpty() + && settings.serverPlaybackSummary(first) == QLatin1String("Using your defaults"), + "an account without overrides must return to following defaults"); + } require(settings.value(QStringLiteral("playback/rememberSeriesAudioTrack")).toBool(), "fresh profile did not remember per-series audio tracks by default"); require(settings.playerControlTooltipsEnabled(), "fresh profile unexpectedly hid player control tooltips"); diff --git a/tests/automation/LocalControlProtocolTest.cpp b/tests/automation/LocalControlProtocolTest.cpp index 3bee395d..dd4fb6bd 100644 --- a/tests/automation/LocalControlProtocolTest.cpp +++ b/tests/automation/LocalControlProtocolTest.cpp @@ -350,6 +350,22 @@ elif "-W" not in sys.argv: const auto status = cli(target + QStringList { QStringLiteral("speed-test"), QStringLiteral("status") }); require(status["ok"].toBool() && !status["result"].toObject()["args"].toObject()["refresh"].toBool(), "remote speed-test status does not restart measurement"); + const auto sorted = cli(target + QStringList { "browse", "sort", "Bitrate", "Descending" }); + require(sorted["ok"].toBool() && sorted["result"].toObject()["command"] == "browse-sort" + && sorted["result"].toObject()["args"].toObject()["sortBy"] == "Bitrate" + && sorted["result"].toObject()["args"].toObject()["sortOrder"] == "Descending", + "CLI forwards server-side sort and direction without loading library pages"); + const auto catalog = cli(target + QStringList { "catalog", "12345678:section:1", "200", "100" }); + require(catalog["ok"].toBool() && catalog["result"].toObject()["command"] == "catalog" + && catalog["result"].toObject()["args"].toObject()["offset"].toInt() == 200 + && catalog["result"].toObject()["args"].toObject()["limit"].toInt() == 100, + "CLI forwards direct bounded catalog paging without moving the view"); + for (const QStringList& invalidCatalog : { QStringList { "catalog", "12345678:section:1", "-1" }, + QStringList { "catalog", "12345678:section:1", "0", "101" }, QStringList { "catalog" } }) + require(!cli(target + invalidCatalog)["ok"].toBool(), "CLI rejects unbounded or malformed catalog pages"); + for (const QStringList& invalidSort : { QStringList { "browse", "sort", "Bitrate", "backwards" }, + QStringList { "browse", "sort", "Bitrate&token=secret" }, QStringList { "browse", "sort" } }) + require(!cli(target + invalidSort)["ok"].toBool(), "CLI rejects malformed server sort arguments"); require(!cli({ "--host", "root@device.test", "--descriptor", "relative.json", "status" })["ok"].toBool(), "remote explicit descriptor must be an absolute remote path"); require(!cli({ "--host", "root@device.test", "--instance", "remote-test", "--descriptor", "/private/test.json", diff --git a/tests/e2e/AppJourneyTest.cpp b/tests/e2e/AppJourneyTest.cpp index 74766d42..22b235f1 100644 --- a/tests/e2e/AppJourneyTest.cpp +++ b/tests/e2e/AppJourneyTest.cpp @@ -110,14 +110,14 @@ class DeviceSession final { ownership("prepare", { { "reversePort", reversePort } }); remoteScreenshot = "/data/user/0/" + bundle + "/cache/journey-frame.png"; } else { - require(this->kind == "tvos", "unknown mobile journey device"); + require(this->kind == "tvos" || this->kind == "ios", "unknown mobile journey device"); device = qEnvironmentVariable("SPOOL_TVOS_DEVICE"); - require(!device.isEmpty(), "tvOS journey requires an explicit private simulator UUID"); + require(!device.isEmpty(), "Apple journey requires an explicit private simulator UUID"); tool = executable("SPOOL_E2E_XCRUN", QStandardPaths::findExecutable("xcrun")); bundle = qEnvironmentVariable("SPOOL_E2E_TVOS_BUNDLE", "com.sachk.spool"); container = QString::fromUtf8(runTool({ "get_app_container", device, bundle, "data" })).trimmed(); require(QDir::isAbsolutePath(container) && QDir(container).exists(), - "installed actual tvOS app data container is unavailable"); + "installed actual Apple app data container is unavailable"); remoteScreenshot = container + "/Library/Caches/journey-frame.png"; ownership("prepare"); } @@ -1072,7 +1072,8 @@ SPOOL_TEST_MAIN("app-journey") if (arguments[index] == "--device") { require(index + 1 < arguments.size(), "--device requires android or tvos"); deviceKind = arguments[++index]; - require(deviceKind == "android" || deviceKind == "tvos", "--device requires android or tvos"); + require(deviceKind == "android" || deviceKind == "tvos" || deviceKind == "ios", + "--device requires android, tvos or ios"); } } if (deviceKind.isEmpty()) { @@ -1196,6 +1197,30 @@ SPOOL_TEST_MAIN("app-journey") require(itemId != "journey-movie" && (*episodeRow).toObject()["id"].toString() != "journey-episode", "provider items lost account scoping"); + const auto libraryRows = journey.command({ "items", "libraries" })["items"].toArray(); + const auto selectedLibrary = std::find_if(libraryRows.cbegin(), libraryRows.cend(), + [](const QJsonValue& row) { return row.toObject()["title"] == "Journey Library"; }); + require(selectedLibrary != libraryRows.cend(), "selected library missing from the catalog inventory"); + const auto catalogPage = journey.command({ "catalog", selectedLibrary->toObject()["id"].toString(), "0", "1" }); + require(catalogPage["items"].toArray().size() == 1 + && catalogPage["items"].toArray().first().toObject()["id"].toString() == itemId, + "direct catalog page did not preserve scoped provider identity or its row limit"); + require(journey.command({ "items", "browse" })["count"].toInt(-1) == 2, + "catalog inspection changed the visible browse model"); + + fixturePhase = QStringLiteral("library-background-refresh"); + const int browseBeforeRefresh = fixture.authenticatedBrowse; + fixture.setLibraryBrowseHeld(true); + journey.await([&] { return fixture.sendLibraryChanged(); }, "library event socket did not connect"); + journey.await([&] { return fixture.authenticatedBrowse > browseBeforeRefresh; }, + "library change did not request a refreshed listing"); + require(journey.command({ "items", "browse" })["count"].toInt(-1) == 2, + "background refresh cleared the visible catalogue while awaiting the server"); + require(posterVisible(journey.capture()), "background refresh blanked the existing library posters"); + fixture.setLibraryBrowseHeld(false); + journey.await( + [&] { return !journey.state()["browseLoading"].toBool(); }, "background library refresh did not finish"); + fixturePhase = QStringLiteral("filter-empty-recovery"); const int filtersBefore = fixture.playedFilterRequests; journey.click("Filter"); @@ -1296,7 +1321,10 @@ SPOOL_TEST_MAIN("app-journey") journey.command({ "navigate", "settings" }); journey.label("Appearance"); - journey.click("Playback"); + journey.click("Search settings", true); + journey.text("playback/seekPreviews"); + journey.command({ "key", "ok" }); + journey.click("Seek previews", true); const bool originalPreview = journey.command({ "settings", "get", "playback/seekPreviews" })["values"] .toObject()["playback/seekPreviews"] .toBool(); @@ -1310,6 +1338,7 @@ SPOOL_TEST_MAIN("app-journey") }, "settings UI toggle did not commit its public value"); journey.command({ "key", "back" }); + journey.command({ "key", "back" }); journey.label("Appearance"); journey.click("Downloads"); journey.click("Play saved files offline", true); diff --git a/tests/e2e/JellyfinFixture.cpp b/tests/e2e/JellyfinFixture.cpp index 9d137e5f..2b88a7d8 100644 --- a/tests/e2e/JellyfinFixture.cpp +++ b/tests/e2e/JellyfinFixture.cpp @@ -107,12 +107,32 @@ void JellyfinFixture::setEpisodeDetailsHeld(bool held) ++episodeDetailResponses; } } +void JellyfinFixture::setLibraryBrowseHeld(bool held) +{ + libraryBrowseHeld = held; + if (!held) { + for (const auto& [socket, snapshot] : std::exchange(pendingBrowse, decltype(pendingBrowse) {})) { + if (socket) { + socket->setProperty("heldBrowse", false); + respond(socket, 200, snapshot); + } + } + } +} +bool JellyfinFixture::sendLibraryChanged() +{ + return sendEvent({ { "MessageType", "LibraryChanged" }, { "Data", QJsonObject {} } }); +} bool JellyfinFixture::sendRemotePlay(qint64 positionTicks) { const QJsonObject message { { "MessageType", "Play" }, { "Data", QJsonObject { { "ItemIds", QJsonArray { episodeId } }, { "StartIndex", 0 }, { "StartPositionTicks", positionTicks }, { "PlayCommand", "PlayNow" } } } }; + return sendEvent(message); +} +bool JellyfinFixture::sendEvent(const QJsonObject& message) +{ const QString encoded = QString::fromUtf8(QJsonDocument(message).toJson(QJsonDocument::Compact)); bool sent = false; for (const auto& socket : std::as_const(eventSockets)) { @@ -332,7 +352,13 @@ void JellyfinFixture::handle(QTcpSocket *socket, const QByteArray& header, const items.append(movie()); if (!playedOnly && (ids.isEmpty() || ids.contains(episodeId))) items.append(episode()); - json(QJsonObject { { "Items", items }, { "TotalRecordCount", items.size() } }); + const QJsonObject result { { "Items", items }, { "TotalRecordCount", items.size() } }; + if (libraryBrowse && libraryBrowseHeld) { + socket->setProperty("heldBrowse", true); + pendingBrowse.append({ socket, QJsonDocument(result).toJson(QJsonDocument::Compact) }); + } else { + json(result); + } } else if (method == "GET" && (path == "/Users/" + userId + "/Items/" + movieId || path == "/Users/" + userId + "/Items/" + episodeId)) { ++detailRequests; diff --git a/tests/e2e/JellyfinFixture.h b/tests/e2e/JellyfinFixture.h index 0d45b97a..08cce997 100644 --- a/tests/e2e/JellyfinFixture.h +++ b/tests/e2e/JellyfinFixture.h @@ -42,6 +42,8 @@ class JellyfinFixture final { int episodeDetailResponses = 0; void setEpisodeDetailsHeld(bool held); bool sendRemotePlay(qint64 positionTicks); + void setLibraryBrowseHeld(bool held); + bool sendLibraryChanged(); // Existing idle event transport survives; every new authenticated request is rejected. void setNewRequestsAvailable(bool available) { @@ -56,6 +58,7 @@ class JellyfinFixture final { QJsonObject source() const; QJsonObject movie() const; QJsonObject episode() const; + bool sendEvent(const QJsonObject& message); void accept(); bool upgradeWebSocket(QTcpSocket *socket); void handle(QTcpSocket *socket, const QByteArray& header, const QByteArray& body); @@ -66,6 +69,8 @@ class JellyfinFixture final { QMap documents; bool newRequestsAvailable = true; bool episodeDetailsHeld = false; + bool libraryBrowseHeld = false; + QList, QByteArray>> pendingBrowse; QList, QByteArray>> pendingDetails; QList> eventSockets; }; diff --git a/tests/platform/MobileTestBundles.cmake b/tests/platform/MobileTestBundles.cmake index a726b625..0f400f8a 100644 --- a/tests/platform/MobileTestBundles.cmake +++ b/tests/platform/MobileTestBundles.cmake @@ -2,7 +2,7 @@ # supervisor launches a fresh instance of the same phase bundle per selector; # it never executes a desktop substitute or relies on an app launch exit code. function(spool_add_mobile_test_bundles) - if(NOT BUILD_TESTING OR NOT (ANDROID OR CMAKE_SYSTEM_NAME STREQUAL "tvOS")) + if(NOT BUILD_TESTING OR NOT (ANDROID OR SPOOL_APPLE_MOBILE)) return() endif() if(ANDROID) @@ -132,15 +132,23 @@ function(spool_add_mobile_test_bundles) else() set(identifier "com.sachk.spool.e2e-tests") endif() + if(IOS) + set(test_plist "${CMAKE_CURRENT_SOURCE_DIR}/tests/platform/ios/Info.plist.in") + set(test_family "1,2") + target_compile_definitions(${target} PRIVATE TOUCHSCREEN) + else() + set(test_plist "${CMAKE_CURRENT_SOURCE_DIR}/tests/platform/tvos/Info.plist.in") + set(test_family "3") + endif() set_target_properties(${target} PROPERTIES MACOSX_BUNDLE TRUE - MACOSX_BUNDLE_INFO_PLIST "${CMAKE_CURRENT_SOURCE_DIR}/tests/platform/tvos/Info.plist.in" + MACOSX_BUNDLE_INFO_PLIST "${test_plist}" MACOSX_BUNDLE_GUI_IDENTIFIER "${identifier}" MACOSX_BUNDLE_BUNDLE_NAME "${target}" MACOSX_BUNDLE_BUNDLE_VERSION "${PROJECT_VERSION}" MACOSX_BUNDLE_SHORT_VERSION_STRING "${PROJECT_VERSION}" - XCODE_ATTRIBUTE_TARGETED_DEVICE_FAMILY "3") - spool_configure_tvos_simulator_entitlements(${target}) + XCODE_ATTRIBUTE_TARGETED_DEVICE_FAMILY "${test_family}") + spool_configure_apple_simulator_entitlements(${target}) install(TARGETS ${target} BUNDLE DESTINATION tests COMPONENT NativeTests) endif() endforeach() diff --git a/tests/platform/ios/Info.plist.in b/tests/platform/ios/Info.plist.in new file mode 100644 index 00000000..fbe59d1e --- /dev/null +++ b/tests/platform/ios/Info.plist.in @@ -0,0 +1,19 @@ + + + +CFBundleExecutable${MACOSX_BUNDLE_EXECUTABLE_NAME} +CFBundleIdentifier${MACOSX_BUNDLE_GUI_IDENTIFIER} +CFBundleName${MACOSX_BUNDLE_BUNDLE_NAME} +CFBundleDisplayName${MACOSX_BUNDLE_BUNDLE_NAME} +CFBundlePackageTypeAPPL +CFBundleVersion${MACOSX_BUNDLE_BUNDLE_VERSION} +CFBundleShortVersionString${MACOSX_BUNDLE_SHORT_VERSION_STRING} +LSRequiresIPhoneOS +UIDeviceFamily12 +UIRequiresFullScreen +UILaunchScreen +UIBackgroundModesaudio +NSLocalNetworkUsageDescriptionNative Spool tests exercise local media server connections. +NSAppTransportSecurityNSAllowsLocalNetworkingNSAllowsArbitraryLoads +ITSAppUsesNonExemptEncryption + diff --git a/tests/player/MpvOptionProfileTest.cpp b/tests/player/MpvOptionProfileTest.cpp index d91f138d..f0037a3b 100644 --- a/tests/player/MpvOptionProfileTest.cpp +++ b/tests/player/MpvOptionProfileTest.cpp @@ -43,8 +43,10 @@ std::vector profileOptions(const MpvConfigPolicy& policy, MpvOptionPr bool embeddedVideo = false, const QByteArray& shaderCachePath = QByteArrayLiteral("/tmp/mpv-shaders")) { std::vector options = MpvOptionProfile::preInitializeOptions(policy); + MpvOptionProfile::StreamingOptions streaming; + streaming.maxRequests = parallelRequests; std::vector applicationOptions = MpvOptionProfile::applicationOptions(platform, true, audioOutputMode, - logPath, demuxerMaxBytes, demuxerMaxBackBytes, parallelRequests, embeddedVideo, shaderCachePath); + logPath, streaming, demuxerMaxBytes, demuxerMaxBackBytes, embeddedVideo, shaderCachePath); options.insert(options.end(), applicationOptions.cbegin(), applicationOptions.cend()); return options; } @@ -133,8 +135,8 @@ SPOOL_TEST_MAIN("mpv-option-profile") "no candidate leaves the bundle unset rather than pointing at nothing"); const std::vector options = MpvOptionProfile::applicationOptions(MpvOptionProfile::Platform::Desktop, - true, QStringLiteral("auto"), QByteArrayLiteral("/tmp/mpv.log"), QByteArrayLiteral("64M"), - QByteArrayLiteral("32M"), 1, false, QByteArrayLiteral("/tmp/shaders"), QFile::encodeName(bundle)); + true, QStringLiteral("auto"), QByteArrayLiteral("/tmp/mpv.log"), {}, QByteArrayLiteral("64M"), + QByteArrayLiteral("32M"), false, QByteArrayLiteral("/tmp/shaders"), QFile::encodeName(bundle)); require(valueFor(options, "tls-ca-file") == QFile::encodeName(bundle), "a resolved certificate bundle must reach mpv as tls-ca-file"); require(valueFor(profileOptions(MpvConfigPolicy {}, MpvOptionProfile::Platform::Desktop, QStringLiteral("auto"), @@ -147,7 +149,6 @@ SPOOL_TEST_MAIN("mpv-option-profile") const auto desktopNetwork = MpvOptionProfile::networkProfile(MpvOptionProfile::Platform::Desktop); require(desktopNetwork.ringBytes == 4 * 1024 * 1024, "desktop curl ring profile changed"); require(desktopNetwork.rangeBytes == 1024 * 1024, "desktop curl range profile changed"); - require(desktopNetwork.parallelRequests == 1, "desktop curl should default to one request"); const auto desktop = profileOptions(MpvConfigPolicy {}, MpvOptionProfile::Platform::Desktop, QStringLiteral("alsa"), QByteArrayLiteral("/tmp/mpv.log")); @@ -212,7 +213,7 @@ SPOOL_TEST_MAIN("mpv-option-profile") require(!MpvOptionProfile::needsVideoSurface(music), "an audio item's attached picture must not request a video surface"); const auto musicOptions = MpvOptionProfile::applicationOptions(MpvOptionProfile::Platform::Android, - MpvOptionProfile::needsVideoSurface(music), QStringLiteral("auto"), QByteArrayLiteral("/tmp/mpv.log")); + MpvOptionProfile::needsVideoSurface(music), QStringLiteral("auto"), QByteArrayLiteral("/tmp/mpv.log"), {}); require(valueFor(musicOptions, "vo") == "null" && valueFor(musicOptions, "vid") == "no" && valueFor(musicOptions, "audio-display") == "no", "audio playback must neither select cover art nor create a surface-dependent video output"); @@ -225,7 +226,7 @@ SPOOL_TEST_MAIN("mpv-option-profile") music.mediaStreams = { picture, audio }; require(MpvOptionProfile::needsVideoSurface(music), "music videos must retain their video output"); const auto videoOptions = MpvOptionProfile::applicationOptions(MpvOptionProfile::Platform::Android, - MpvOptionProfile::needsVideoSurface(music), QStringLiteral("auto"), QByteArrayLiteral("/tmp/mpv.log")); + MpvOptionProfile::needsVideoSurface(music), QStringLiteral("auto"), QByteArrayLiteral("/tmp/mpv.log"), {}); require(valueFor(videoOptions, "vo") == "mediacodec_embed" && valueFor(videoOptions, "vid") != "no", "a video session after audio must restore direct output and video track selection"); } @@ -353,7 +354,6 @@ SPOOL_TEST_MAIN("mpv-option-profile") const auto webOSNetwork = MpvOptionProfile::networkProfile(MpvOptionProfile::Platform::WebOS); require(webOSNetwork.ringBytes == 2 * 1024 * 1024, "webOS curl ring profile changed"); require(webOSNetwork.rangeBytes == 512 * 1024, "webOS curl range profile changed"); - require(webOSNetwork.parallelRequests == 1, "webOS curl should default to one request"); const auto webOSPcm = profileOptions(MpvConfigPolicy {}, MpvOptionProfile::Platform::WebOS, QStringLiteral("starfish-pcm"), QByteArrayLiteral("/tmp/mpv.log")); diff --git a/tests/providers/ProviderRegistryTest.cpp b/tests/providers/ProviderRegistryTest.cpp index f15d6125..32992e75 100644 --- a/tests/providers/ProviderRegistryTest.cpp +++ b/tests/providers/ProviderRegistryTest.cpp @@ -461,6 +461,21 @@ SPOOL_TEST_MAIN("provider-registry") require(failure(registry.callSource(carol, QStringLiteral("throws"))) == QStringLiteral("provider_error"), "provider error text never reaches the app"); + const int warningsBeforeFailure = problems.size(); + require(failure(registry.callSource(carol, QStringLiteral("unreachable"))) == QStringLiteral("network_error"), + "a running provider delivers a connection failure"); + require(row(registry, carol).value(QStringLiteral("connectionState")) == QStringLiteral("failed") + && row(registry, carol).value(QStringLiteral("running")).toBool() + && !row(registry, carol).value(QStringLiteral("errorText")).toString().isEmpty() + && problems.size() == warningsBeforeFailure + 1, + "a live runtime is not reported as a healthy account after a failed connection"); + QCoro::waitFor(registry.callSource(carol, QStringLiteral("configuration"))); + require(row(registry, carol).value(QStringLiteral("connectionState")) == QStringLiteral("failed"), + "local provider work cannot erase a connection failure"); + QCoro::waitFor(registry.callSource(carol, QStringLiteral("libraries"))); + require(row(registry, carol).value(QStringLiteral("connectionState")) == QStringLiteral("active") + && row(registry, carol).value(QStringLiteral("errorText")).toString().isEmpty(), + "a successful library request clears the connection failure"); require(failure(registry.callSource(carol, QStringLiteral("expired"))) == QStringLiteral("http_401"), "stable error codes pass through"); bool needsSignIn = false; diff --git a/tests/providers/ScriptRuntimeTest.cpp b/tests/providers/ScriptRuntimeTest.cpp index a0a803ad..8504d382 100644 --- a/tests/providers/ScriptRuntimeTest.cpp +++ b/tests/providers/ScriptRuntimeTest.cpp @@ -112,6 +112,19 @@ SPOOL_TEST_MAIN("script-runtime") const QVariantMap picked = QCoro::waitFor(resolve({ { "pick", QVariantMap { { "quality", "4k" } } }, { "source", "not yet" } })); require(picked.contains("pick"), "a picker answer is admitted until its follow-up resolve"); + // Providers build JS objects with undefined optional facts. Admit these + // as omissions without losing known facts or accepting explicit null. + const QVariantMap literal = QCoro::waitFor(runtime.call("media", "resolve", { { "literal", true } })); + const QVariantMap literalSource = literal.value("source").toMap(); + require(literalSource.value("bitrate").typeId() == QMetaType::LongLong + && literalSource.value("bitrate").toLongLong() == 1500000 + && literalSource.value("width").toInt() == 3840 && literalSource.value("height").toInt() == 2160, + "known media facts survive undefined siblings"); + require(!literalSource.contains("sizeBytes") && !literalSource.contains("runtimeTicks"), + "explicit undefined media facts are admitted as omissions, not invalid_result"); + require(!literal.contains("delivery"), "an undefined sibling is admitted as an omission"); + rejects(runtime.call("media", "resolve", { { "nullish", true } }), + "null is not undefined: an explicit null size stays rejected"); } QTcpServer server; require(server.listen(QHostAddress::LocalHost), "fixture server listens"); diff --git a/tests/providers/SourceHubSpeedTest.cpp b/tests/providers/SourceHubSpeedTest.cpp index 577da559..8cb6674f 100644 --- a/tests/providers/SourceHubSpeedTest.cpp +++ b/tests/providers/SourceHubSpeedTest.cpp @@ -36,13 +36,31 @@ void waitUntil(const std::function& condition, const char *message) } require(condition(), message); } +QVariantMap transportSample( + double rate, int requests = 1, int http = 11, qint64 receive = 0, qint64 range = 512 * 1024, quint64 samples = 1) +{ + return { { "requests", requests }, { "http-version", http }, { "receive-profile", receive ? 1 : 0 }, + { "receive-bytes", receive }, { "range-bytes", range }, { "ordered-bytes-per-second", rate }, + { "ttfb-ms", 120.0 }, { "updated-at-ms", QDateTime::currentMSecsSinceEpoch() }, { "source", 2 }, + { "samples", samples } }; +} QVariantMap feedback(quint64 stream, double rate, int requests = 1) { return { { "stream-id", stream }, { "capacity-samples", 1 }, { "selected-requests", requests }, - { "observed-at-ms", QDateTime::currentMSecsSinceEpoch() }, { "media-bitrate", 80'000'000 }, - { "concurrency-samples", - QVariantList { QVariantMap { { "requests", requests }, { "capacity-bytes-per-second", rate }, - { "ttfb-ms", 120.0 }, { "samples", 1 } } } } }; + { "observed-at-ms", QDateTime::currentMSecsSinceEpoch() }, { "primary-origin-match", true }, + { "transport-samples", QVariantList { transportSample(rate, requests) } } }; +} +QVariantMap sampleFor(const QVariantMap& profile, int requests, int http, qint64 receive, qint64 range) +{ + for (const QVariant& value : profile.value("transport-samples").toList()) { + const auto sample = value.toMap(); + if (sample.value("requests").toInt() == requests && sample.value("http-version").toInt() == http + && sample.value("receive-profile").toInt() == (receive ? 1 : 0) + && sample.value("receive-bytes").toLongLong() == receive + && sample.value("range-bytes").toLongLong() == range) + return sample; + } + return {}; } } @@ -73,7 +91,13 @@ export function createSource(configuration) { })}; }); }, - resolve() { return {url:configuration.origin + '/movie?token=private-token', variantId:'v'}; } + resolve(args, host) { + host.emit('resolvedPreferences', { + bitrate: args.preferredMaxBitrate, height: args.preferredMaxHeight, + local: args.unlimitedLocalNetwork, remux: args.preferRemux + }); + return {url:configuration.origin + '/movie?token=private-token', variantId:'v'}; + } }; } )JS"; @@ -84,6 +108,7 @@ export function createSource(configuration) { QString nj; QString local; QVariantMap learnedMelbourne; + QString melbourneEndpoint; { DatabaseManager database; require(database.initialize(databasePath), "database opens"); @@ -107,15 +132,19 @@ export function createSource(configuration) { int started = 0; int finished = 0; int active = 0; - QObject::connect(&hub, &SourceHub::accountEvent, [&](const QString&, const QString& type, const QVariantMap&) { - if (type == "probeStarted") { - ++started; - require(++active == 1, "probes never benchmark against another account"); - } else if (type == "probeFinished") { - ++finished; - --active; - } - }); + QHash resolvedPreferences; + QObject::connect(&hub, &SourceHub::accountEvent, + [&](const QString& account, const QString& type, const QVariantMap& payload) { + if (type == "probeStarted") { + ++started; + require(++active == 1, "probes never benchmark against another account"); + } else if (type == "probeFinished") { + ++finished; + --active; + } else if (type == "resolvedPreferences") { + resolvedPreferences.insert(account, payload); + } + }); hub.refreshSpeedTests(); QCoreApplication::processEvents(); require(started == 0, "explicit refresh cannot compete with active playback"); @@ -129,18 +158,88 @@ export function createSource(configuration) { item.id = hub.scoped(account, "movie"); return QCoro::waitFor(hub.playback()->resolvePlayback(item, false)); }; + hub.setPlaybackPreferences(90'000'000, false, true, 2160); + bool custom = true; + hub.setPlaybackPreferenceResolver([&](const QString& account) { + return account == melbourne && custom ? QVariantMap { { "preferredMaxBitrate", qint64(20'000'000) }, + { "preferredMaxHeight", 1080 }, { "unlimitedLocalNetwork", true }, { "preferRemux", false } } + : QVariantMap {}; + }); resolve(melbourne); - require(hub.playback()->playbackNetworkProfile().value("concurrency-samples").toList().size() == 3, - "full benchmark curve reaches native playback without SDK changes"); - require(hub.playback()->playbackNetworkProfile().value("initial-requests").toInt() == 2, - "startup chooses minimum concurrency within the probe noise band instead of a tiny peak gain"); + resolve(nj); + require(resolvedPreferences.value(melbourne).value("bitrate").toLongLong() == 20'000'000 + && resolvedPreferences.value(melbourne).value("height").toInt() == 1080 + && resolvedPreferences.value(melbourne).value("local").toBool() + && !resolvedPreferences.value(melbourne).value("remux").toBool() + && resolvedPreferences.value(nj).value("bitrate").toLongLong() == 90'000'000 + && resolvedPreferences.value(nj).value("height").toInt() == 2160 + && !resolvedPreferences.value(nj).value("local").toBool() + && resolvedPreferences.value(nj).value("remux").toBool(), + "actual script resolve calls receive only their account's quality preferences"); + custom = false; + hub.refreshPlaybackPreferences(); + resolve(melbourne); + require(resolvedPreferences.value(melbourne).value("bitrate").toLongLong() == 90'000'000 + && resolvedPreferences.value(melbourne).value("height").toInt() == 2160, + "clearing a server override restores the global quality preferences at resolve"); + hub.setPlaybackPreferenceResolver({}); + const auto initial = hub.playback()->playbackNetworkProfile(); + require(initial.value("format").toInt() == 2 && initial.value("transport-samples").toList().size() == 3, + "the complete probe curve reaches native playback as format-2 priors"); + require(initial.value("last-selected-requests").toInt() == 1, + "the last observed probe count is information, not an app startup decision"); + const auto probePrior = sampleFor(initial, 2, 0, 0, 0); + require(probePrior.value("source").toInt() == 1 && probePrior.value("samples").toInt() == 1 + && probePrior.value("ordered-bytes-per-second").toDouble() == 20'000'000, + "probe priors carry unknown protocol/range identity and explicit provenance"); const QUrl melbourneOrigin = hub.playback()->mediaOrigin(); auto measured = feedback(1, 20'000'000, 2); + auto privatePoint = transportSample(20'000'000, 2); + privatePoint["unexpected-private-field"] = "must-not-persist"; + measured["transport-samples"] = QVariantList { privatePoint }; hub.playback()->updatePlaybackNetworkProfile(melbourneOrigin, measured); + require(!sampleFor(hub.playback()->playbackNetworkProfile(), 2, 11, 0, 512 * 1024) + .contains("unexpected-private-field"), + "learning retains only the numeric transport profile contract"); + auto partitioned = feedback(1, 21'000'000, 2); + partitioned["capacity-samples"] = 2; + partitioned["transport-samples"] = QVariantList { transportSample(21'000'000, 2, 20), + transportSample(22'000'000, 2, 30), transportSample(23'000'000, 2, 11, 4 * 1024 * 1024), + transportSample(24'000'000, 2, 11, 8 * 1024 * 1024), transportSample(25'000'000, 2, 11, 0, 1024 * 1024), + transportSample(26'000'000, 16) }; + hub.playback()->updatePlaybackNetworkProfile(melbourneOrigin, partitioned); + auto repeated = feedback(1, 30'000'000, 2); + repeated["capacity-samples"] = 3; + repeated["transport-samples"] = QVariantList { transportSample(30'000'000, 2, 11, 0, 512 * 1024, 2) }; + hub.playback()->updatePlaybackNetworkProfile(melbourneOrigin, repeated); learnedMelbourne = hub.playback()->playbackNetworkProfile(); - require(learnedMelbourne.value("initial-requests").toInt() == 2, - "startup chooses the minimum measured configuration with playback headroom"); - for (int invalid = 0; invalid < 5; ++invalid) { + require(learnedMelbourne.value("transport-samples").toList().size() == 10 + && learnedMelbourne.value("last-selected-requests").toInt() == 2, + "equal sample counters on distinct profiles remain independent"); + const auto tcp = sampleFor(learnedMelbourne, 2, 11, 0, 512 * 1024); + require(tcp.value("ordered-bytes-per-second").toDouble() == 25'000'000 && tcp.value("samples").toInt() == 2 + && tcp.value("source").toInt() == 2 && tcp.value("ttfb-ms").toDouble() == 120 + && tcp.value("updated-at-ms").toLongLong() > 0 && tcp.size() == 10, + "only a matching effective profile contributes to its rolling estimate and full wire row"); + require( + sampleFor(learnedMelbourne, 2, 20, 0, 512 * 1024).value("ordered-bytes-per-second").toDouble() == 21'000'000 + && sampleFor(learnedMelbourne, 2, 30, 0, 512 * 1024).value("ordered-bytes-per-second").toDouble() + == 22'000'000 + && sampleFor(learnedMelbourne, 2, 11, 4 * 1024 * 1024, 512 * 1024) + .value("ordered-bytes-per-second") + .toDouble() + == 23'000'000 + && sampleFor(learnedMelbourne, 2, 11, 8 * 1024 * 1024, 512 * 1024) + .value("ordered-bytes-per-second") + .toDouble() + == 24'000'000 + && sampleFor(learnedMelbourne, 2, 11, 0, 1024 * 1024).value("ordered-bytes-per-second").toDouble() + == 25'000'000 + && sampleFor(learnedMelbourne, 16, 11, 0, 512 * 1024).value("ordered-bytes-per-second").toDouble() + == 26'000'000 + && sampleFor(learnedMelbourne, 2, 0, 0, 0) == probePrior, + "protocol, receive mode/size, range size, request count and probe evidence never contaminate each other"); + for (int invalid = 0; invalid < 11; ++invalid) { auto rejected = feedback(2, 90'000'000, 4); if (invalid == 0) rejected["observed-at-ms"] = QDateTime::currentMSecsSinceEpoch() - 600'000; @@ -149,14 +248,31 @@ export function createSource(configuration) { if (invalid == 2) rejected["capacity-samples"] = 0; if (invalid == 3) - rejected = feedback(1, 90'000'000, 4); - if (invalid == 4) { + rejected = repeated; + if (invalid == 4) rejected = feedback(2, std::numeric_limits::quiet_NaN(), 4); + if (invalid == 5) + rejected["primary-origin-match"] = false; + if (invalid == 6) { + rejected = repeated; + rejected["capacity-samples"] = 4; + } + if (invalid >= 7) { + auto malformed = transportSample(90'000'000, 8); + if (invalid == 7) + malformed["http-version"] = 21; + if (invalid == 8) + malformed["receive-bytes"] = -1; + if (invalid == 9) + malformed["requests"] = 2.5; + if (invalid == 10) + malformed["source"] = 1; + rejected["transport-samples"] = QVariantList { transportSample(90'000'000, 4), malformed }; } rejected["average-bytes-per-second"] = 100.0; hub.playback()->updatePlaybackNetworkProfile(melbourneOrigin, rejected); require(hub.playback()->playbackNetworkProfile() == learnedMelbourne, - "stale, replayed, cache-throttled and invalid observations cannot poison learning"); + "stale, replayed, nonprimary and malformed observations cannot partially mutate learning"); } resolve(nj); const QUrl njOrigin = hub.playback()->mediaOrigin(); @@ -172,27 +288,44 @@ export function createSource(configuration) { { "ttfb-ms", 5.0 } } } } }); }; require(probe(40'000'000), "negative-scaling probe records"); - auto impossibleDemand = feedback(3, 8'000'000, 4); - impossibleDemand["media-bitrate"] = 800'000'000; - hub.playback()->updatePlaybackNetworkProfile(njOrigin, impossibleDemand); - require(hub.playback()->playbackNetworkProfile().value("initial-requests").toInt() == 1, - "unreachable demand chooses the fast single lane, not the previous slower four lanes"); + hub.playback()->updatePlaybackNetworkProfile(njOrigin, feedback(3, 8'000'000, 4)); + require(hub.playback()->playbackNetworkProfile().value("last-selected-requests").toInt() == 4, + "profile reports the actual count even when a probe demonstrated a faster count"); auto actualSingle = feedback(4, 6'000'000); - actualSingle["media-bitrate"] = 800'000'000; + actualSingle["transport-samples"] = QVariantList { transportSample(6'000'000, 1, 0, 0, 0) }; hub.playback()->updatePlaybackNetworkProfile(njOrigin, actualSingle); - require(hub.playback()->playbackNetworkProfile().value("initial-requests").toInt() == 2, - "actual single-lane playback overrides its faster Qt prior at the same concurrency"); + const auto actual = sampleFor(hub.playback()->playbackNetworkProfile(), 1, 0, 0, 0); + require(actual.value("source").toInt() == 2 && actual.value("ordered-bytes-per-second").toDouble() == 6'000'000, + "actual playback supersedes a probe only for its matching effective profile"); require(probe(90'000'000), "later probe refresh records"); - require(hub.playback()->playbackNetworkProfile().value("initial-requests").toInt() == 2, - "a newer Qt probe cannot replace fresh actual-playback evidence"); + require(sampleFor(hub.playback()->playbackNetworkProfile(), 1, 0, 0, 0) == actual + && sampleFor(hub.playback()->playbackNetworkProfile(), 4, 11, 0, 512 * 1024) + .value("ordered-bytes-per-second") + .toDouble() + == 8'000'000, + "a later probe cannot replace actual evidence or merge a different profile"); hub.playback()->updatePlaybackNetworkProfile(njOrigin, feedback(5, 30'000'000, 16)); - require(hub.playback()->playbackNetworkProfile().value("initial-requests").toInt() == 16, - "forced sixteen-request playback supplies valid learning instead of being silently rejected"); - hub.playback()->updatePlaybackNetworkProfile(njOrigin, feedback(6, 40'000'000)); + require(hub.playback()->playbackNetworkProfile().value("last-selected-requests").toInt() == 16 + && sampleFor(hub.playback()->playbackNetworkProfile(), 16, 11, 0, 512 * 1024) + .value("ordered-bytes-per-second") + .toDouble() + == 30'000'000, + "sixteen-request playback supplies learning and the last observed count"); + QVariantList full; + for (int index = 0; index < 64; ++index) + full.append(transportSample(10'000'000 + index * 1000, 1, 30, 0, 256 * 1024 + index * 64 * 1024)); + auto bounded = feedback(6, 10'000'000); + bounded["transport-samples"] = full; + hub.playback()->updatePlaybackNetworkProfile(njOrigin, bounded); const auto learnedNj = hub.playback()->playbackNetworkProfile(); - require(learnedNj.value("initial-requests").toInt() == 1 - && learnedNj.value("capacity-bytes-per-second").toDouble() > 20'000'000, - "servers sharing a provider retain independent capacity and startup lanes"); + require(learnedNj.value("transport-samples").toList().size() == 64, + "an origin retains at most 64 effective profiles after merging new evidence"); + full.append(transportSample(11'000'000, 2, 30)); + bounded["stream-id"] = 7; + bounded["transport-samples"] = full; + hub.playback()->updatePlaybackNetworkProfile(njOrigin, bounded); + require(hub.playback()->playbackNetworkProfile() == learnedNj, + "oversized feedback is rejected atomically instead of truncating its meaning"); hub.playback()->updatePlaybackNetworkProfile(melbourneOrigin, feedback(4, 99'000'000)); require(hub.playback()->playbackNetworkProfile() == learnedNj, "delayed feedback from another media origin is not attributed to the current server"); @@ -224,20 +357,25 @@ export function createSource(configuration) { { "endpoints", root.value("networkEndpoints") } }) .toJson(); require(!learning.contains("melbourne") && !learning.contains("nj.invalid") - && !learning.contains("private-token") && !learning.contains("https://"), + && !learning.contains("private-token") && !learning.contains("https://") + && !learning.contains("must-not-persist"), "learning storage contains only endpoint hashes and numeric data, not addresses or credentials"); auto profiles = root.value("networkProfiles").toObject(); + melbourneEndpoint = root.value("networkEndpoints").toObject().value(melbourne).toString(); + require(profiles.value(melbourneEndpoint).toObject().value("format").toInt() == 2, + "the learned payload format is stored on each origin, independent of the account envelope"); + const QString njEndpoint = root.value("networkEndpoints").toObject().value(nj).toString(); + require(profiles.value(njEndpoint).toObject().value("transport-samples").toArray().size() == 64, + "the persistent origin history itself is bounded, not only the playback view"); for (auto it = profiles.begin(); it != profiles.end(); ++it) { auto profile = it.value().toObject(); - for (const QString& field : { QStringLiteral("probe-samples"), QStringLiteral("concurrency-samples") }) { - auto samples = profile.value(field).toArray(); - for (qsizetype index = 0; index < samples.size(); ++index) { - auto sample = samples[index].toObject(); - sample.insert("updated-at-ms", QDateTime::currentMSecsSinceEpoch() - 31LL * 24 * 60 * 60 * 1000); - samples[index] = sample; - } - profile.insert(field, samples); + auto samples = profile.value("transport-samples").toArray(); + for (qsizetype index = 0; index < samples.size(); ++index) { + auto sample = samples[index].toObject(); + sample.insert("updated-at-ms", QDateTime::currentMSecsSinceEpoch() - 31LL * 24 * 60 * 60 * 1000); + samples[index] = sample; } + profile.insert("transport-samples", samples); it.value() = profile; } root.insert("networkProfiles", profiles); @@ -259,10 +397,41 @@ export function createSource(configuration) { item.id = hub.scoped(melbourne, "movie"); QCoro::waitFor(hub.playback()->resolvePlayback(item, false)); const auto profile = hub.playback()->playbackNetworkProfile(); - require(profile.value("concurrency-samples").toList().isEmpty() - && profile.value("capacity-bytes-per-second").toDouble() == 0 - && profile.value("initial-requests").toInt() == 1, - "expired measurements cannot seed capacity or retain an unsupported lane selection"); + require(profile.value("transport-samples").toList().isEmpty() + && profile.value("measured-bitrate").toLongLong() == 0 + && profile.value("last-selected-requests").toInt() == 1, + "expired measurements cannot seed capacity or retain an unsupported observed count"); + auto root = QJsonDocument::fromJson(QCoro::waitFor(database.loadSettingAsync("providers/accounts/2")).toUtf8()) + .object(); + auto profiles = root.value("networkProfiles").toObject(); + profiles.insert(melbourneEndpoint, + QJsonObject { { "format", 1 }, { "initial-requests", 16 }, + { "concurrency-samples", + QJsonArray { QJsonObject { { "requests", 16 }, { "capacity-bytes-per-second", 99'000'000 }, + { "updated-at-ms", QDateTime::currentMSecsSinceEpoch() } } } } }); + root.insert("networkProfiles", profiles); + QVariantMap settings { { "providers/accounts/2", + QString::fromUtf8(QJsonDocument(root).toJson(QJsonDocument::Compact)) } }; + QCoro::waitFor(database.saveSettings(std::move(settings))); + } + { + DatabaseManager database; + require(database.initialize(databasePath), "database opens old learned payload"); + ProviderRegistry registry(&database); + registry.setInstallDirectory(installs); + registry.loadModules(); + SourceHub hub(®istry); + QCoro::waitFor(registry.restore()); + hub.setPlaybackActive(true); + waitUntil([&] { return hub.sources().size() == 3; }, "all accounts survive a learned-format reset"); + MovieItem item; + item.id = hub.scoped(melbourne, "movie"); + QCoro::waitFor(hub.playback()->resolvePlayback(item, false)); + const auto profile = hub.playback()->playbackNetworkProfile(); + require(profile.value("format").toInt() == 2 && profile.value("transport-samples").toList().isEmpty() + && profile.value("last-selected-requests").toInt() == 1 + && hub.playback()->mediaOrigin() == QUrl("https://melbourne.invalid"), + "old learned formats reset without dropping accounts or their restored configuration"); } return 0; } diff --git a/tests/providers/SourceHubTest.cpp b/tests/providers/SourceHubTest.cpp index 77e36b05..79bf524e 100644 --- a/tests/providers/SourceHubTest.cpp +++ b/tests/providers/SourceHubTest.cpp @@ -13,6 +13,7 @@ #include #include +#include #include #include @@ -634,6 +635,27 @@ SPOOL_TEST_MAIN("source-hub") require(!home.setProviderShown(QStringLiteral("fixture.test"), false) && home.hiddenProviderIds() == QStringList { QStringLiteral("fixture.other") }, "the last provider that can fill Home cannot be turned off"); + const auto homeLibraries = QCoro::waitFor(homeHub.fetchLibraries()); + std::vector firstLibraries; + for (const LibraryItem& library : homeLibraries) { + if (homeHub.accountOf(library.id) == retainedAccount) + firstLibraries.push_back(library); + } + home.refresh(firstLibraries); + waitUntil([&] { return !home.loading(); }, "first restored account fills Home"); + require(home.latestLibraryRows().size() == 1, "the first inventory contains one account"); + auto *visibleShelf = qobject_cast( + home.latestLibraryRows().first().toMap().value(QStringLiteral("model")).value()); + require(visibleShelf && visibleShelf->rowCount() > 1, "the visible shelf has a selectable second item"); + const QPersistentModelIndex selectedCard(visibleShelf->index(1, 0)); + const QString selectedId = selectedCard.data(MovieGridModel::ItemRole).value().id; + home.refresh(homeLibraries); + waitUntil([&] { return !home.loading(); }, "late library inventory fills Home"); + require(home.latestLibraryRows().size() == 2, + "an expanded inventory refreshes Home even after an earlier inventory finished"); + require( + selectedCard.isValid() && selectedCard.data(MovieGridModel::ItemRole).value().id == selectedId, + "late libraries preserve the existing shelf's selected item"); home.refresh(QCoro::waitFor(homeHub.fetchLibraries())); waitUntil([&] { return !home.loading(); }, "multi-account homepage loads"); require(home.latestLibraryRows().size() == 2, "homepage initially includes both accounts' latest rows"); diff --git a/tests/providers/fixtures/provider.mjs b/tests/providers/fixtures/provider.mjs index 4372a4e0..ec259d3a 100644 --- a/tests/providers/fixtures/provider.mjs +++ b/tests/providers/fixtures/provider.mjs @@ -133,6 +133,7 @@ export function createSource(config, sourceHost) { announce: function(args) { sourceHost.emit('changed', {itemId: args.itemId}); return {}; }, configuration: function() { return {configuration: config}; }, expired: function() { throw new Error('http_401'); }, + unreachable: function() { throw new Error('network_error'); }, bump: function() { return {calls: ++calls, label: config.label}; }, candidates: function(args) { const rows = []; diff --git a/tests/providers/fixtures/resolve-metadata.mjs b/tests/providers/fixtures/resolve-metadata.mjs index 22032573..389a3fba 100644 --- a/tests/providers/fixtures/resolve-metadata.mjs +++ b/tests/providers/fixtures/resolve-metadata.mjs @@ -1,5 +1,17 @@ // Echoes the resolve result a test supplies, so the runtime's admission of // provider media metadata is exercised at the real script boundary. export function createSource() { - return { resolve(args) { return args.result; } }; + return { + resolve(args) { + // Real provider helpers emit explicit undefined for unknown facts. + if (args.literal) + return { url: 'http://127.0.0.1/literal.mkv', container: 'mkv', + source: { bitrate: 1500000, width: 3840, height: 2160, + sizeBytes: undefined, runtimeTicks: undefined }, delivery: undefined }; + // Null mode keeps null distinct from undefined at admission. + if (args.nullish) + return { url: 'http://127.0.0.1/nullish.mkv', source: { bitrate: 5000, sizeBytes: null } }; + return args.result; + } + }; } diff --git a/tests/qml/tst_ExtensionIntegration.qml b/tests/qml/tst_ExtensionIntegration.qml index ecc15df1..1cd52428 100644 --- a/tests/qml/tst_ExtensionIntegration.qml +++ b/tests/qml/tst_ExtensionIntegration.qml @@ -95,6 +95,35 @@ TestCase { compare(Settings.uiScalePercent, 100) tryCompare(settingsPage, "contentReady", true) + // The same settings page edits a single account, with a remote-selectable + // Default/On/Off choice and a separate default action for numeric rows. + settingsPage.configureServer(Integration.first) + selectSetting("playback/threadedStreaming") + compare(settingsPage.rowOptions(settingsPage.currentRow())[0], "Default (On)") + settingsPage.activate() + tryCompare(settingsPage, "choiceDialogVisible", true) + settingsPage.routeKey(Qt.Key_Down, "press", false) + settingsPage.routeKey(Qt.Key_Down, "press", false) + settingsPage.activate() + tryCompare(settingsPage, "choiceDialogVisible", false) + compare(Settings.effectiveValue("playback/threadedStreaming", Integration.first), false) + compare(Settings.effectiveValue("playback/threadedStreaming", Integration.second), true) + verify(Settings.hasServerOverride("playback/threadedStreaming", Integration.first)) + settingsPage.activate() + tryCompare(settingsPage, "choiceDialogVisible", true) + settingsPage.routeKey(Qt.Key_Up, "press", false) + settingsPage.routeKey(Qt.Key_Up, "press", false) + settingsPage.activate() + tryCompare(settingsPage, "choiceDialogVisible", false) + verify(!Settings.hasServerOverride("playback/threadedStreaming", Integration.first)) + Settings.setServerValue("playback/forwardCacheSizeMiB", 64, Integration.first) + settingsPage.openCategory("streaming", "action/useDefault/playback/forwardCacheSizeMiB") + tryCompare(settingsPage, "selectedRowKey", "action/useDefault/playback/forwardCacheSizeMiB") + settingsPage.activate() + verify(!Settings.hasServerOverride("playback/forwardCacheSizeMiB", Integration.first)) + compare(Settings.serverPlaybackSummary(Integration.first), "Using your defaults") + settingsPage.configureServer("") + // Preserve the rendered search result, not just query/model state, when // the category's retained row moves the ListView content origin. Metrics.keyboardFocusActive = true diff --git a/tests/qml/tst_KeyRouter.qml b/tests/qml/tst_KeyRouter.qml index c71f0711..29860004 100644 --- a/tests/qml/tst_KeyRouter.qml +++ b/tests/qml/tst_KeyRouter.qml @@ -104,6 +104,8 @@ TestCase { keyRouter.lastReleaseAt = 0 keyRouter.heldReleaseKey = 0 keyRouter.stopSustaining() + keyRouter.sustainedHoldProbeDelay = 700 + keyRouter.sustainedHoldInterval = 50 } function test_siriRemoteBackHandlesBothPhasesWithoutOpeningContextMenu() { @@ -203,6 +205,41 @@ TestCase { compare(keyRouter.pressedDirectionKey, 0) } + function test_webOSMissingReleaseDoesNotInventDirectionalRepeats() { + keyRouter.webOsScanCodes = true + keyRouter.sustainedHoldProbeDelay = 20 + keyRouter.sustainedHoldInterval = 10 + const event = { + key: Qt.Key_Right, + text: "", + modifiers: Qt.NoModifier, + isAutoRepeat: false + } + verify(keyRouter.dispatch(event, "press")) + compare(routeCalls, 1) + wait(80) + compare(routeCalls, 1, "webOS already supplies repeats; a missing release is not a hold") + verify(keyRouter.dispatch(event, "release")) + } + + function test_directionDoesNotResumeAfterTargetChanges() { + keyRouter.sustainedHoldProbeDelay = 20 + keyRouter.sustainedHoldInterval = 10 + const event = { + key: Qt.Key_Right, + text: "", + modifiers: Qt.NoModifier, + isAutoRepeat: false + } + verify(keyRouter.dispatch(event, "press")) + compare(routeCalls, 1) + keyRouter.activeTarget = null + keyRouter.activeTarget = target + wait(80) + compare(routeCalls, 1, "changing input owners retires the previous directional gesture") + verify(keyRouter.dispatch(event, "release")) + } + function test_backFallsThroughToTarget() { routeResult = false verify(keyRouter.routeBack("press", false)) diff --git a/tests/qml/tst_MediaRow.qml b/tests/qml/tst_MediaRow.qml index e73c3565..d8d4205a 100644 --- a/tests/qml/tst_MediaRow.qml +++ b/tests/qml/tst_MediaRow.qml @@ -125,6 +125,12 @@ TestCase { } } + SignalSpy { + id: activatedSpy + target: libraryRow + signalName: "activated" + } + function initTestCase() { initialModel = libraryRow.model } @@ -142,6 +148,7 @@ TestCase { openedContext = null moves = [] headerActivations = 0 + activatedSpy.clear() } function test_reorderRequiresExplicitMoveChoice() { @@ -239,6 +246,23 @@ TestCase { } } + function test_libraryRefreshKeepsSelectedIdentityWhenOrderChanges() { + libraryRow.model = initialModel + tryCompare(libraryRow, "count", 2) + libraryRow.currentIndex = 0 + libraryRow.focusList() + tryVerify(() => libraryRow.currentCard() !== null) + waitForRendering(libraryRow) + compare(libraryRow.currentCard().titleText(), "Movies") + + libraryRow.model = initialModel.slice().reverse() + waitForRendering(libraryRow) + compare(libraryRow.currentCard().titleText(), "Movies") + libraryRow.activate() + compare(activatedSpy.count, 1) + compare(activatedSpy.signalArguments[0][1].libraryId, "aaaaaaaa:movies") + } + function test_touchPressDoesNotMoveSelectionBeforeClick() { libraryRow.currentIndex = 0 libraryRow.beginPointerSelection(1) diff --git a/tests/qml/tst_RowStackView.qml b/tests/qml/tst_RowStackView.qml index 4ca991d5..4e6ecb2d 100644 --- a/tests/qml/tst_RowStackView.qml +++ b/tests/qml/tst_RowStackView.qml @@ -45,6 +45,28 @@ TestCase { signalName: "sectionsChanged" } + SignalSpy { + id: activatedSpy + signalName: "activated" + } + + function latestSection(libraryId, itemId, position) { + return { + "key": "latestLibrary:" + libraryId, + "model": [ + { + "id": itemId, + "title": itemId + }, + { + "id": itemId + "-second", + "title": itemId + "-second" + } + ], + "contextSource": "latestLibrary:" + position + } + } + function test_loadingPreservesRowsAndHorizontalSelection() { const stack = createTemporaryObject(stackComponent, testCase) verify(stack) @@ -88,4 +110,42 @@ TestCase { }) compare(stack.rowAt(0).rowVisible, true) } + + function test_latestRowInsertedAheadKeepsSelectedRowActivatable() { + const stack = createTemporaryObject(stackComponent, testCase, { + "height": 700, + "sections": [latestSection("aaaa:movies", "movies0", 0), latestSection( + "bbbb:series", "series0", 1)] + }) + verify(stack) + tryVerify(() => stack.rowAt(1) !== null) + verify(stack.focusSection(1)) + stack.currentRow().currentIndex = 1 + waitForRendering(stack) + activatedSpy.target = stack + activatedSpy.clear() + compare(stack.currentItem().id, "series0-second") + const screenY = stack.currentRow().mapToItem(stack, 0, 0).y + + stack.sections = [latestSection("cccc:movies", "new0", 0), latestSection("aaaa:movies", "movies0", 1), latestSection("bbbb:series", + "series0", + 2)] + waitForRendering(stack) + tryVerify(function () { + return stack.count === 3 && stack.currentRow() !== null + }) + + verify(stack.activeFocus, "the stack keeps keyboard focus through the rebuild") + compare(stack.currentSection, 2, "the anchor must follow the key, not the index the row used to have") + compare(stack.currentItem().id, "series0-second", "late shelves must not change the selected card") + verify(Math.abs(stack.currentRow().mapToItem(stack, 0, 0).y - screenY) < 1, + "late shelves must not move the focused card on screen") + + stack.activate() + tryCompare(activatedSpy, "count", 1) + compare(activatedSpy.signalArguments[0][0].key, "latestLibrary:bbbb:series") + compare(activatedSpy.signalArguments[0][1], 1) + compare(activatedSpy.signalArguments[0][2].id, "series0-second") + activatedSpy.target = null + } } diff --git a/tests/tools/StreamingDependenciesTest.py b/tests/tools/StreamingDependenciesTest.py new file mode 100644 index 00000000..3db2e0da --- /dev/null +++ b/tests/tools/StreamingDependenciesTest.py @@ -0,0 +1,128 @@ +#!/usr/bin/env python3 +"""Exercise transport source preparation and CMake policy at their CLI boundary.""" +import hashlib +import io +import json +from pathlib import Path +import shutil +import subprocess +import tarfile +import tempfile +import unittest + +ROOT = Path(__file__).resolve().parents[2] +NAMES = ('openssl', 'nghttp2', 'nghttp3', 'ngtcp2', 'curl') + + +class StreamingDependenciesTest(unittest.TestCase): + def setUp(self): + self.temp = tempfile.TemporaryDirectory() + self.addCleanup(self.temp.cleanup) + self.root = Path(self.temp.name) + for relative in ('tools/lib/manifest-sources.sh', 'tools/prepare-streaming-sources.sh', + 'tools/streaming-fingerprint.py', 'tools/cmake/StreamingDependencies.cmake'): + target = self.root / relative + target.parent.mkdir(parents=True, exist_ok=True) + shutil.copyfile(ROOT / relative, target) + archive = self.root / 'fixture.tar.gz' + with tarfile.open(archive, 'w:gz') as output: + info = tarfile.TarInfo('fixture/content.txt') + info.size = len(b'original\n') + output.addfile(info, io.BytesIO(b'original\n')) + self.manifest = self.root / 'tools/manifests/streaming-third-party.json' + self.manifest.parent.mkdir(parents=True) + self.data = {'schemaVersion': 1, 'sources': {name: { + 'version': '1', 'url': archive.as_uri(), + 'sha256': hashlib.sha256(archive.read_bytes()).hexdigest()} for name in NAMES}} + self.write_manifest() + self.output = self.root / 'prepared' + + def write_manifest(self): + self.manifest.write_text(json.dumps(self.data)) + + def prepare(self, *extra): + return subprocess.run(['bash', str(self.root / 'tools/prepare-streaming-sources.sh'), + '--root', str(self.root), '--output', str(self.output), *extra], + capture_output=True, text=True) + + def test_digest_rejection_precedes_source_use(self): + self.data['sources']['openssl']['sha256'] = '0' * 64 + self.write_manifest() + result = self.prepare() + self.assertNotEqual(result.returncode, 0) + self.assertIn('checksum mismatch', result.stderr) + self.assertFalse(self.output.exists()) + + def test_patch_update_reextracts_and_reuses_verified_archives(self): + patch = self.root / 'change.patch' + self.data['sources']['curl']['patches'] = ['change.patch'] + for replacement in ['first', 'second']: + patch.write_text('--- a/content.txt\n+++ b/content.txt\n@@ -1 +1 @@\n-original\n+' + replacement + '\n') + self.write_manifest() + result = self.prepare() + self.assertEqual(result.returncode, 0, result.stderr) + self.assertEqual((self.output / 'curl/content.txt').read_text(), replacement + '\n') + # Verify cache identity does not depend on an available upstream URL. + archive = self.root / 'fixture.tar.gz' + archive.unlink() + result = self.prepare() + self.assertEqual(result.returncode, 0, result.stderr) + + def test_help_and_invalid_arguments_have_no_side_effects(self): + for arguments, code in [(['--help'], 0), (['--root', 'relative', '--output', str(self.output)], 2), + (['--output'], 2), (['--invalid'], 2)]: + result = subprocess.run(['bash', str(ROOT / 'tools/prepare-streaming-sources.sh'), *arguments], + cwd=self.root, capture_output=True) + self.assertEqual(result.returncode, code) + self.assertFalse((self.root / 'build').exists()) + self.assertFalse(self.output.exists()) + + def test_target_and_wrapper_content_invalidate_configuration(self): + wrapper = self.root / 'wrapper.sh' + wrapper.write_text('original') + def identity(target): + return subprocess.check_output(['python3', str(self.root / 'tools/streaming-fingerprint.py'), + '--root', str(self.root), '--target', target, '--wrapper', str(wrapper)], text=True) + initial = identity('arm:28:static') + self.assertEqual(initial, identity('arm:28:static')) + self.assertNotEqual(initial, identity('arm:29:static')) + wrapper.write_text('changed') + self.assertNotEqual(initial, identity('arm:28:static')) + + def test_cmake_policy_builds_selected_library_and_requires_protocols(self): + source = self.root / 'project' + source.mkdir() + (source / 'sample.c').write_text('int sample(void) { return 42; }\n') + # This project consumes the initializer just like each real dependency; + # a missing protocol/adapter option fails configure at that boundary. + (source / 'CMakeLists.txt').write_text('''cmake_minimum_required(VERSION 3.20) +project(PolicyFixture C) +if(STREAMING_DEPENDENCY STREQUAL "curl") + if(NOT USE_NGHTTP2 OR NOT USE_NGHTTP3 OR NOT USE_NGTCP2 OR CURL_DISABLE_ALTSVC) + message(FATAL_ERROR "required transport capabilities disabled") + endif() +elseif(STREAMING_DEPENDENCY STREQUAL "ngtcp2") + if(NOT ENABLE_OPENSSL OR ENABLE_GNUTLS OR ENABLE_QUICTLS) + message(FATAL_ERROR "incorrect TLS adapter") + endif() +endif() +add_library(sample sample.c) +''') + for dependency in NAMES[1:]: + for shared in ('ON', 'OFF'): + with self.subTest(dependency=dependency, shared=shared): + build = self.root / f'build-{dependency}-{shared}' + result = subprocess.run(['cmake', '-S', str(source), '-B', str(build), + '-DSTREAMING_DEPENDENCY=' + dependency, '-DSTREAMING_SHARED=' + shared, + '-C', str(ROOT / 'tools/cmake/StreamingDependencies.cmake')], capture_output=True, text=True) + self.assertEqual(result.returncode, 0, result.stdout + result.stderr) + subprocess.run(['cmake', '--build', str(build)], check=True, capture_output=True) + extension = '.so' if shared == 'ON' else '.a' + self.assertTrue((build / ('libsample' + extension)).is_file()) + result = subprocess.run(['cmake', '-DSTREAMING_DEPENDENCY=bad', '-DSTREAMING_SHARED=ON', + '-P', str(ROOT / 'tools/cmake/StreamingDependencies.cmake')], capture_output=True) + self.assertNotEqual(result.returncode, 0) + + +if __name__ == '__main__': + unittest.main() diff --git a/tests/transport/protocols.py b/tests/transport/protocols.py new file mode 100644 index 00000000..07b65064 --- /dev/null +++ b/tests/transport/protocols.py @@ -0,0 +1,182 @@ +#!/usr/bin/env python3 +"""Real libmpv + nginx TLS/HTTP2/QUIC correctness; no display or external server. + +Protocol correctness never skips: missing tooling or a missing H3 build fails. +The separate packet harness may skip when user network namespaces are disabled. +""" +import argparse +import array +import importlib.util +import json +from pathlib import Path +import shutil +import socket +import struct +import subprocess +import tempfile +import time + + +def free_port(host): + with socket.socket() as listener: + listener.bind((host, 0)) + return listener.getsockname()[1] + + +def main(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument('--libmpv', required=True) + parser.add_argument('--transport-helper', type=Path, required=True) + parser.add_argument('--performance', action='store_true') + parser.add_argument('--output', type=Path) + args = parser.parse_args() + for tool in ['nginx', 'openssl']: + if not shutil.which(tool): + parser.error(f'{tool} required: run in nix develop .#native') + spec = importlib.util.spec_from_file_location('curl_transport', args.transport_helper) + transport = importlib.util.module_from_spec(spec) + spec.loader.exec_module(transport) + rows = [] + with tempfile.TemporaryDirectory(prefix='spool-protocols-') as directory: + root = Path(directory) + # Nonperiodic frame counters catch duplicated or misplaced aligned ranges. + pcm = array.array('I', range((256 if args.performance else 16) * 1024 * 1024 // 4)) + import sys + if sys.byteorder != 'little': + pcm.byteswap() + expected = pcm.tobytes() + del pcm + payload = (b'RIFF' + struct.pack(' deadline: + raise AssertionError('nginx fixture not ready') + time.sleep(.025) + counts = [1, 4, 0] if args.performance else [4] + for mode, version, port in [('http1', 11, tls), ('tcp', 20, tls), + ('prefer-h3', 30, tls), ('prefer-h3', 20, tcp)]: + for count in counts: + output = root / 'actual.pcm' + options = {'tls-ca-file': root / 'cert.pem', 'ao': 'pcm', + 'ao-pcm-file': output, 'ao-pcm-waveheader': 'no', + 'audio-format': 's16', 'curl-http-mode': mode, + 'curl-fixed-requests': str(count), + 'curl-receive-mode': 'fixed', 'curl-receive-bytes': str(4 << 20)} + player = transport.Player(args.libmpv, **options) + try: + capabilities = player.get('curl-transport-capabilities') + if not capabilities or not capabilities.get('http2') or not capabilities.get('http3'): + raise AssertionError('production libmpv must advertise HTTP2 and HTTP3') + result = player.play(f'https://127.0.0.1:{port}/fixture.wav', timeout=180) + finally: + player.close() + if output.read_bytes() != expected: + raise AssertionError(f'{mode}: decoded PCM differs from independently generated frames') + snapshots = [sample for _, sample in result['samples']] + if result['metrics']: + snapshots.append(result['metrics']) + protocols = {row['http-version'] for sample in snapshots for row in sample.get('connections', [])} + protocols.update(row.get('effective-http-version', 0) for sample in snapshots + for row in sample.get('streams', [])) + if version not in protocols: + raise AssertionError(f'{mode}: expected negotiated {version}, observed {sorted(protocols)}') + # The independent server log confirms ALPN/QUIC rather than + # trusting a request preference reported as effective. + server_protocol = {11: 'HTTP/1.1', 20: 'HTTP/2.0', 30: 'HTTP/3.0'}[version] + time.sleep(.05) + log = (root / 'access.log').read_text() + if f'{port} {server_protocol} 206 bytes=' not in log: + raise AssertionError(f'{mode}: nginx did not serve ranges over {server_protocol}') + rows.append({'mode': mode, 'fixed-requests': count, 'effective-http-version': version, + 'seconds': result['seconds'], 'first-progress-seconds': result['first-progress-seconds'], + 'pcm-bytes': len(expected), 'bytes-per-second': len(expected) / result['seconds']}) + print(json.dumps(rows[-1]), flush=True) + if not args.performance: + from reset_origin import ResetOrigin + header = (b'RIFF' + struct.pack(' 0 for start, _ in reset.ranges): + raise AssertionError('HTTP2 reset did not retry an unfinished suffix') + fallback_count = max((row.get('http-fallbacks', 0) for _, sample in result['samples'] + for row in sample.get('streams', [])), default=0) + if fallback_count < 1: + raise AssertionError('HTTP2 reset downgrade was not reported') + print(json.dumps({'scenario': 'h2-reset-with-zero-retry-budget', + 'http-fallbacks': fallback_count, 'pcm-bytes': len(expected)}), flush=True) + finally: + nginx.terminate() + try: + nginx.wait(timeout=5) + except subprocess.TimeoutExpired: + nginx.kill() + nginx.wait() + if args.output: + args.output.write_text(json.dumps(rows, indent=2) + '\n') + + +if __name__ == '__main__': + main() diff --git a/tests/transport/reset_origin.py b/tests/transport/reset_origin.py new file mode 100644 index 00000000..8cecabae --- /dev/null +++ b/tests/transport/reset_origin.py @@ -0,0 +1,114 @@ +"""TLS origin that resets HTTP2 streams after valid representation bytes. + +The HTTP1 path serves the identical strong-ETag representation. A successful +client must downgrade and retry the unread suffix, preserving exact PCM. +""" +import re +import socket +import ssl +import threading +import time + + +class ResetOrigin: + def __init__(self, root, payload): + self.payload = payload + self.protocols = [] + self.ranges = [] + self.lock = threading.Lock() + self.stop = threading.Event() + self.context = ssl.SSLContext(ssl.PROTOCOL_TLS_SERVER) + self.context.load_cert_chain(root / 'cert.pem', root / 'key.pem') + self.context.set_alpn_protocols(['h2', 'http/1.1']) + self.listener = socket.socket() + self.listener.bind(('127.0.0.1', 0)) + self.port = self.listener.getsockname()[1] + self.listener.listen(16) + self.listener.settimeout(.1) + self.worker = threading.Thread(target=self.serve, daemon=True) + + def __enter__(self): + self.worker.start() + return self + + def __exit__(self, *_): + self.stop.set() + self.worker.join(timeout=2) + self.listener.close() + + def serve(self): + while not self.stop.is_set(): + try: + connection, _ = self.listener.accept() + except socket.timeout: + continue + threading.Thread(target=self.handle, args=(connection,), daemon=True).start() + + def headers(self, values): + match = re.fullmatch(r'bytes=(\d+)-(\d*)', values.get('range', '')) + start = int(match[1]) if match else 0 + end = min(int(match[2]) + 1 if match and match[2] else len(self.payload), len(self.payload)) + with self.lock: + self.ranges.append((start, end)) + return start, end, [('content-type', 'audio/wav'), ('etag', '"reset-fixture-v1"'), + ('accept-ranges', 'bytes'), ('content-length', str(end - start)), + ('content-range', f'bytes {start}-{end - 1}/{len(self.payload)}')] + + def handle(self, raw): + try: + with self.context.wrap_socket(raw, server_side=True) as connection: + connection.settimeout(5) + protocol = connection.selected_alpn_protocol() or 'http/1.1' + with self.lock: + self.protocols.append(protocol) + if protocol == 'h2': + self.http2(connection) + else: + self.http1(connection) + except (OSError, ssl.SSLError): + raw.close() + + def http2(self, connection): + import h2.config + import h2.connection + import h2.events + h2conn = h2.connection.H2Connection(config=h2.config.H2Configuration(client_side=False, header_encoding='utf-8')) + h2conn.initiate_connection() + connection.sendall(h2conn.data_to_send()) + while not self.stop.is_set(): + data = connection.recv(65536) + if not data: + return + for event in h2conn.receive_data(data): + if isinstance(event, h2.events.RequestReceived): + start, end, headers = self.headers(dict(event.headers)) + h2conn.send_headers(event.stream_id, [(':status', '206'), *headers]) + # Real partial delivery, then a protocol-level reset. This + # cannot be mistaken for an HTTP status or empty body. + h2conn.send_data(event.stream_id, self.payload[start:min(start + 16384, end)]) + connection.sendall(h2conn.data_to_send()) + # Give curl a read turn with body bytes before the reset; + # otherwise one read can see only an already-reset stream. + time.sleep(.05) + h2conn.reset_stream(event.stream_id, error_code=2) + connection.sendall(h2conn.data_to_send()) + + def http1(self, connection): + stream = connection.makefile('rb') + while not self.stop.is_set(): + request = stream.readline() + if not request: + return + values = {} + while True: + line = stream.readline() + if line in (b'\r\n', b'\n', b''): + break + key, value = line.decode().split(':', 1) + values[key.lower()] = value.strip() + start, end, headers = self.headers(values) + connection.sendall(('HTTP/1.1 206 Partial Content\r\n' + + ''.join(f'{k}: {v}\r\n' for k, v in headers) + '\r\n').encode()) + for offset in range(start, end, 65536): + connection.sendall(self.payload[offset:min(offset + 65536, end)]) + time.sleep(.002) diff --git a/tools/android/build-dependencies.sh b/tools/android/build-dependencies.sh index 2f6f8c14..d74bc111 100755 --- a/tools/android/build-dependencies.sh +++ b/tools/android/build-dependencies.sh @@ -72,9 +72,10 @@ unset PKG_CONFIG_SYSROOT_DIR fetch_sources() { mkdir -p "$SOURCE_ROOT" "$BUILD_ROOT" local source - for source in openssl curl freetype lua qcoro fribidi harfbuzz libass libplacebo; do + for source in freetype lua qcoro fribidi harfbuzz libass libplacebo; do prepare_manifest_source "$ROOT" "$MANIFEST" "$source" "$SOURCE_ROOT/$source" done + bash "$ROOT/tools/prepare-streaming-sources.sh" --root "$ROOT" --output "$SOURCE_ROOT" prepare_toolchain_ffmpeg "$ROOT" "$SOURCE_ROOT/ffmpeg" local path url sha archive while IFS=$'\t' read -r path url sha; do @@ -119,7 +120,9 @@ EOF } build_openssl() { - [[ -f "$PREFIX/lib/libssl.so" && -f "$PREFIX/lib/libcrypto.so" ]] && return + local pin stamp="$PREFIX/lib/.spool-openssl-configuration" + pin="$(python3 "$ROOT/tools/streaming-fingerprint.py" --root "$ROOT" --target "$ABI:$API:$($CC --version):shared-tls" --wrapper "${BASH_SOURCE[0]}")" + [[ -f "$PREFIX/lib/libssl.so" && -f "$PREFIX/lib/libcrypto.so" && -f "$stamp" && "$(<"$stamp")" == "$pin" ]] && return local build="$BUILD_ROOT/openssl" rm -rf "$build" cp -R "$SOURCE_ROOT/openssl" "$build" @@ -128,10 +131,11 @@ build_openssl() { cd "$build" ./Configure "$OPENSSL_TARGET" -D__ANDROID_API__="$API" \ --prefix="$PREFIX" --openssldir="$PREFIX/ssl" \ - shared no-tests no-ui-console + shared no-apps no-docs no-tests no-comp no-dtls no-srp no-ssl3 no-weak-ssl-ciphers no-ui-console make -j"$JOBS" make install_sw ) + printf '%s\n' "$pin" >"$stamp" } build_freetype() { @@ -192,73 +196,19 @@ EOF # of FFmpeg, which cannot link OpenSSL 3 without the version3 licence flag the # capability manifest forbids. build_curl() { - # curl carries the trust store playback depends on, so its configuration is - # part of the stamp: a tree built before the CA path was named must not be - # mistaken for a current one. - local stamp="$PREFIX/lib/.spool-curl-configuration" - local pin - pin="$(sha256sum "${BASH_SOURCE[0]}" | cut -d" " -f1)" + local stamp="$PREFIX/lib/.spool-curl-configuration" pin + pin="$(python3 "$ROOT/tools/streaming-fingerprint.py" --root "$ROOT" --target "$ABI:$API:$($CC --version):static-http" --wrapper "${BASH_SOURCE[0]}" --wrapper "$ROOT/tools/lib/streaming-build.sh")" [[ -f "$PREFIX/lib/libcurl.a" && -f "$stamp" && "$(<"$stamp")" == "$pin" ]] && return - local build="$BUILD_ROOT/curl" - rm -rf "$build" - cmake -S "$SOURCE_ROOT/curl" -B "$build" -GNinja \ + source "$ROOT/tools/lib/streaming-build.sh" + build_streaming_http "$SOURCE_ROOT" "$BUILD_ROOT/streaming" "$PREFIX" OFF \ -DCMAKE_TOOLCHAIN_FILE="$ANDROID_NDK_ROOT/build/cmake/android.toolchain.cmake" \ - -DANDROID_ABI="$ABI" \ - -DANDROID_PLATFORM="android-$API" \ - -DCMAKE_BUILD_TYPE=MinSizeRel \ - -DCMAKE_INSTALL_PREFIX="$PREFIX" \ - -DCMAKE_PREFIX_PATH="$PREFIX" \ - -DCMAKE_POSITION_INDEPENDENT_CODE=ON \ - -DOPENSSL_ROOT_DIR="$PREFIX" \ - -DOPENSSL_INCLUDE_DIR="$PREFIX/include" \ - -DOPENSSL_CRYPTO_LIBRARY="$PREFIX/lib/libcrypto.so" \ - -DOPENSSL_SSL_LIBRARY="$PREFIX/lib/libssl.so" \ - -DOPENSSL_USE_STATIC_LIBS=OFF \ - -DBUILD_CURL_EXE=OFF \ - -DBUILD_LIBCURL_DOCS=OFF \ - -DBUILD_MISC_DOCS=OFF \ - -DBUILD_EXAMPLES=OFF \ - -DBUILD_SHARED_LIBS=OFF \ - -DBUILD_STATIC_LIBS=ON \ - -DBUILD_TESTING=OFF \ - -DCURL_BROTLI=OFF \ - -DCURL_DISABLE_ALTSVC=ON \ - -DCURL_DISABLE_DICT=ON \ - -DCURL_DISABLE_DOH=ON \ - -DCURL_DISABLE_FILE=ON \ - -DCURL_DISABLE_FTP=ON \ - -DCURL_DISABLE_GOPHER=ON \ - -DCURL_DISABLE_HSTS=ON \ - -DCURL_DISABLE_IMAP=ON \ - -DCURL_DISABLE_IPFS=ON \ - -DCURL_DISABLE_LDAP=ON \ - -DCURL_DISABLE_LDAPS=ON \ - -DCURL_DISABLE_MQTT=ON \ - -DCURL_DISABLE_NETRC=ON \ - -DCURL_DISABLE_POP3=ON \ - -DCURL_DISABLE_RTSP=ON \ - -DCURL_DISABLE_SMB=ON \ - -DCURL_DISABLE_SMTP=ON \ - -DCURL_DISABLE_TELNET=ON \ - -DCURL_DISABLE_TFTP=ON \ - -DCURL_DISABLE_WEBSOCKETS=ON \ - -DCURL_USE_GSSAPI=OFF \ - -DCURL_USE_LIBPSL=OFF \ - -DCURL_USE_LIBSSH2=OFF \ - -DCURL_USE_OPENSSL=ON \ - -DCURL_CA_FALLBACK=ON \ - -DCURL_CA_PATH=/system/etc/security/cacerts \ - -DCURL_ZLIB=OFF \ - -DENABLE_ARES=OFF \ - -DENABLE_THREADED_RESOLVER=ON \ - -DENABLE_CURL_MANUAL=OFF \ - -DUSE_LIBIDN2=OFF \ - -DUSE_NGHTTP2=OFF \ - -DUSE_NGTCP2=OFF \ - -DUSE_NGHTTP3=OFF - cmake --build "$build" --parallel "$JOBS" - cmake --install "$build" - printf '%s' "$pin" >"$stamp" + -DANDROID_ABI="$ABI" -DANDROID_PLATFORM="android-$API" \ + -DCMAKE_PREFIX_PATH="$PREFIX" -DOPENSSL_ROOT_DIR="$PREFIX" \ + -DOPENSSL_INCLUDE_DIR="$PREFIX/include" -DOPENSSL_CRYPTO_LIBRARY="$PREFIX/lib/libcrypto.so" \ + -DOPENSSL_SSL_LIBRARY="$PREFIX/lib/libssl.so" -DOPENSSL_USE_STATIC_LIBS=OFF \ + -DCURL_CA_FALLBACK=ON -DCURL_CA_PATH=/system/etc/security/cacerts -DCURL_ZLIB=OFF + python3 "$ROOT/tools/check-streaming-dependencies.py" --prefix "$PREFIX" --manifest "$ROOT/tools/manifests/streaming-third-party.json" + printf '%s\n' "$pin" >"$stamp" } build_meson() { diff --git a/tools/apple/build-dependencies.sh b/tools/apple/build-dependencies.sh index 5c261e3e..d7b6b848 100755 --- a/tools/apple/build-dependencies.sh +++ b/tools/apple/build-dependencies.sh @@ -40,9 +40,10 @@ export CFLAGS="-target $TRIPLE -isysroot $SDKROOT -fPIC" export CXXFLAGS="$CFLAGS" export LDFLAGS="-target $TRIPLE -isysroot $SDKROOT -L$PREFIX/lib" export CC CXX AR RANLIB SDKROOT -for name in openssl curl freetype qcoro fribidi harfbuzz libass libplacebo; do +for name in freetype qcoro fribidi harfbuzz libass libplacebo; do prepare_manifest_source "$ROOT" "$MANIFEST" "$name" "$SOURCE_ROOT/$name" done +bash "$ROOT/tools/prepare-streaming-sources.sh" --root "$ROOT" --output "$SOURCE_ROOT" prepare_toolchain_ffmpeg "$ROOT" "$SOURCE_ROOT/ffmpeg" while IFS=$'\t' read -r path url sha; do archive="$ROOT/build/downloads/apple-libplacebo-${path//\//-}-$sha.archive" @@ -106,15 +107,13 @@ case "$APPLE_SDK:$APPLE_ARCH" in esac # Only the TLS libraries belong in the application closure. OpenSSL's command # line HTTP server uses fork(), which tvOS explicitly prohibits. -(cd "$openssl_build"; "$SOURCE_ROOT/openssl/Configure" "$openssl_target" no-apps no-shared no-tests no-asm --prefix="$PREFIX"; make -j"$JOBS" build_libs; make install_dev) -cmake -S "$SOURCE_ROOT/curl" -B "$BUILD_ROOT/curl" -GNinja "${cmake_cross[@]}" \ - -DBUILD_SHARED_LIBS=OFF -DBUILD_STATIC_LIBS=ON -DBUILD_CURL_EXE=OFF -DBUILD_TESTING=OFF \ - -DCURL_USE_OPENSSL=ON -DCURL_USE_SECTRUST=ON -DOPENSSL_ROOT_DIR="$PREFIX" -DOPENSSL_USE_STATIC_LIBS=ON \ +(cd "$openssl_build"; "$SOURCE_ROOT/openssl/Configure" "$openssl_target" no-apps no-docs no-shared no-tests no-comp no-dtls no-srp no-ssl3 no-weak-ssl-ciphers no-asm --prefix="$PREFIX"; make -j"$JOBS" build_libs; make install_dev) +source "$ROOT/tools/lib/streaming-build.sh" +build_streaming_http "$SOURCE_ROOT" "$BUILD_ROOT/streaming" "$PREFIX" OFF "${cmake_cross[@]}" \ + -DUSE_APPLE_SECTRUST=ON -DOPENSSL_ROOT_DIR="$PREFIX" -DOPENSSL_USE_STATIC_LIBS=ON \ -DOPENSSL_INCLUDE_DIR="$PREFIX/include" -DOPENSSL_CRYPTO_LIBRARY="$PREFIX/lib/libcrypto.a" \ - -DOPENSSL_SSL_LIBRARY="$PREFIX/lib/libssl.a" \ - -DCURL_USE_LIBPSL=OFF -DCURL_USE_LIBSSH2=OFF -DUSE_NGHTTP2=OFF -DCURL_ZLIB=OFF -cmake --build "$BUILD_ROOT/curl" --parallel "$JOBS" -cmake --install "$BUILD_ROOT/curl" + -DOPENSSL_SSL_LIBRARY="$PREFIX/lib/libssl.a" -DCURL_ZLIB=OFF +python3 "$ROOT/tools/check-streaming-dependencies.py" --prefix "$PREFIX" --manifest "$ROOT/tools/manifests/streaming-third-party.json" cmake -S "$SOURCE_ROOT/freetype" -B "$BUILD_ROOT/freetype" -GNinja "${cmake_cross[@]}" \ -DBUILD_SHARED_LIBS=OFF -DFT_DISABLE_ZLIB=ON -DFT_DISABLE_BZIP2=ON -DFT_DISABLE_PNG=ON -DFT_DISABLE_HARFBUZZ=ON -DFT_DISABLE_BROTLI=ON cmake --build "$BUILD_ROOT/freetype" --parallel "$JOBS" diff --git a/tools/apple/smoke-ios.sh b/tools/apple/smoke-ios.sh new file mode 100644 index 00000000..03550f79 --- /dev/null +++ b/tools/apple/smoke-ios.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash +set -euo pipefail +ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)" +export SPOOL_APPLE_TEST_PLATFORM=ios +exec bash "$ROOT/tools/apple/smoke-tvos.sh" "$@" diff --git a/tools/apple/smoke-tvos.sh b/tools/apple/smoke-tvos.sh index 35fe34dd..faa0df0e 100755 --- a/tools/apple/smoke-tvos.sh +++ b/tools/apple/smoke-tvos.sh @@ -1,7 +1,13 @@ #!/usr/bin/env bash set -euo pipefail ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)" -app="${1:?Pass the built tvOS Spool.app}" +app="${1:?Pass the built Apple simulator Spool.app}" +platform="${SPOOL_APPLE_TEST_PLATFORM:-tvos}" +case "$platform" in + tvos) runtime_name=tvOS; device_name='Apple TV 4K' ;; + ios) runtime_name=iOS; device_name=iPhone ;; + *) echo 'error: SPOOL_APPLE_TEST_PLATFORM must be ios or tvos' >&2; exit 2 ;; +esac [[ "$(uname -s)" == Darwin ]] || { echo 'error: Apple TV simulator requires macOS/Xcode' >&2; exit 1; } host_build="${SPOOL_DEVICE_HOST_BUILD_DIR:-$ROOT/build/macos/app}" if [[ -z "${SPOOL_DEVICE_HOST_E2E:-}" ]]; then @@ -20,11 +26,11 @@ if [[ -z "${SPOOL_E2E_SPOOLET:-}" ]]; then fi export SPOOL_DEVICE_HOST_E2E SPOOL_E2E_SPOOLET export SPOOL_E2E_ISOLATED_DEVICE=1 -result="$ROOT/build/tvos/smoke" +result="$ROOT/build/$platform/smoke" mkdir -p "$result" -runtime="$(xcrun simctl list runtimes --json | python3 -c 'import json,sys; r=[x for x in json.load(sys.stdin)["runtimes"] if x["isAvailable"] and x["identifier"].startswith("com.apple.CoreSimulator.SimRuntime.tvOS")]; print(sorted(r,key=lambda x:tuple(map(int,x["version"].split("."))))[-1]["identifier"])')" -device_type="$(xcrun simctl list devicetypes --json | python3 -c 'import json,sys; print(next(x["identifier"] for x in json.load(sys.stdin)["devicetypes"] if x["name"].startswith("Apple TV 4K")))')" -device="$(xcrun simctl create Spool-tvOS-tests "$device_type" "$runtime")" +runtime="$(xcrun simctl list runtimes --json | python3 -c 'import json,sys; r=[x for x in json.load(sys.stdin)["runtimes"] if x["isAvailable"] and x["identifier"].startswith("com.apple.CoreSimulator.SimRuntime."+sys.argv[1])]; print(sorted(r,key=lambda x:tuple(map(int,x["version"].split("."))))[-1]["identifier"])' "$runtime_name")" +device_type="$(xcrun simctl list devicetypes --json | python3 -c 'import json,sys; print(next(x["identifier"] for x in json.load(sys.stdin)["devicetypes"] if x["name"].startswith(sys.argv[1])))' "$device_name")" +device="$(xcrun simctl create "Spool-$platform-tests" "$device_type" "$runtime")" cleanup() { xcrun simctl shutdown "$device" >/dev/null 2>&1 || true; xcrun simctl delete "$device"; } trap cleanup EXIT xcrun simctl boot "$device" diff --git a/tools/build-ios.sh b/tools/build-ios.sh index 2b4ed977..f0361bff 100755 --- a/tools/build-ios.sh +++ b/tools/build-ios.sh @@ -29,6 +29,8 @@ if [[ "${APPLE_ARCHIVE:-0}" == 1 ]]; then : "${APPLE_DEVELOPMENT_TEAM:?Archiving requires a signing team}" : "${APPLE_EXPORT_OPTIONS:?Set APPLE_EXPORT_OPTIONS to your ExportOptions.plist}" fi +build_testing=OFF +if [[ "$APPLE_SDK" == iphonesimulator ]]; then build_testing=ON; fi xcrun --sdk "$APPLE_SDK" --show-sdk-path >/dev/null bash "$ROOT/tools/apple/build-ios-scanner.sh" BASE="$ROOT/build/apple/$APPLE_SDK-$APPLE_ARCH" @@ -48,12 +50,15 @@ cmake -S "$ROOT" -B "$BASE/app" -GXcode \ -DQCoro6_DIR="$APPLE_DEPS_PREFIX/lib/cmake/QCoro6" \ -DCMAKE_OSX_SYSROOT="$APPLE_SDK" -DCMAKE_OSX_ARCHITECTURES="$APPLE_ARCH" \ -DCMAKE_OSX_DEPLOYMENT_TARGET="$APPLE_DEPLOYMENT_TARGET" \ - -DSPOOL_WEBOS=OFF -DSPOOL_APPLE_APP_STORE="${SPOOL_APPLE_APP_STORE:-ON}" -DBUILD_TESTING=OFF \ + -DSPOOL_WEBOS=OFF -DSPOOL_APPLE_APP_STORE="${SPOOL_APPLE_APP_STORE:-ON}" -DBUILD_TESTING="$build_testing" \ -DSPOOL_APPLE_QML_IMPORT_SCANNER="$ROOT/build/apple/qmlimportscanner/spool-qmlimportscanner" \ -DSPOOL_IOS_ASSETS="$ASSETS" \ -DCMAKE_XCODE_ATTRIBUTE_DEVELOPMENT_TEAM="${APPLE_DEVELOPMENT_TEAM:-}" \ -DCMAKE_XCODE_ATTRIBUTE_CODE_SIGNING_ALLOWED="${APPLE_CODE_SIGNING_ALLOWED:-NO}" -cmake --build "$BASE/app" --config Release --target spool --parallel "${BUILD_JOBS:-4}" +cmake --build "$BASE/app" --config Release --parallel "${BUILD_JOBS:-4}" +if [[ "$build_testing" == ON ]]; then + cmake --install "$BASE/app" --config Release --prefix "$BASE/install" +fi if [[ "${APPLE_ARCHIVE:-0}" == 1 ]]; then : "${APPLE_DEVELOPMENT_TEAM:?Archiving requires a signing team}" : "${APPLE_EXPORT_OPTIONS:?Set APPLE_EXPORT_OPTIONS to your ExportOptions.plist}" diff --git a/tools/check-streaming-dependencies.py b/tools/check-streaming-dependencies.py new file mode 100644 index 00000000..6e39eb0a --- /dev/null +++ b/tools/check-streaming-dependencies.py @@ -0,0 +1,31 @@ +#!/usr/bin/env python3 +"""Audit installed cross-built transport metadata; does not execute target code.""" +import argparse +import json +import re +import subprocess +from pathlib import Path + +parser = argparse.ArgumentParser(description=__doc__) +parser.add_argument('--prefix', type=Path, required=True) +parser.add_argument('--manifest', type=Path, required=True) +args = parser.parse_args() +manifest = json.loads(args.manifest.read_text())['sources'] +config = args.prefix / 'bin/curl-config' +features = set(subprocess.check_output(['bash', str(config), '--features'], text=True).split()) +missing = {'HTTP2', 'HTTP3', 'alt-svc'} - features +if missing: + parser.error('curl is missing required features: ' + ', '.join(sorted(missing))) +version = subprocess.check_output(['bash', str(config), '--version'], text=True).strip().split()[-1] +if version != manifest['curl']['version']: + parser.error(f'curl version {version} differs from pin') +for package, library in [('openssl', 'openssl'), ('nghttp2', 'libnghttp2'), + ('nghttp3', 'libnghttp3'), ('ngtcp2', 'libngtcp2')]: + pc = args.prefix / 'lib/pkgconfig' / (library + '.pc') + match = re.search(r'^Version:\s*(\S+)', pc.read_text(), re.M) + if not match or match[1] != manifest[package]['version']: + parser.error(f'{package} version does not match pin') +for name in ['ssl', 'crypto']: + files = [p for p in (args.prefix / 'lib').glob(f'lib{name}.*') if p.is_file() and not p.is_symlink()] + print(f'{name}: ' + ', '.join(f'{p.name}={p.stat().st_size}' for p in files)) +print('Transport metadata: HTTP2 HTTP3 alt-svc; pinned versions verified') diff --git a/tools/cmake/StreamingDependencies.cmake b/tools/cmake/StreamingDependencies.cmake new file mode 100644 index 00000000..1fc07a24 --- /dev/null +++ b/tools/cmake/StreamingDependencies.cmake @@ -0,0 +1,53 @@ +# Initial cache, loaded AFTER the dependency/linkage selectors. Platform wrappers +# own compilers, sysroots, OpenSSL, install prefixes and architecture arguments. +if(NOT STREAMING_DEPENDENCY MATCHES "^(nghttp2|nghttp3|ngtcp2|curl)$") + message(FATAL_ERROR "STREAMING_DEPENDENCY must be nghttp2, nghttp3, ngtcp2 or curl") +endif() +if(NOT DEFINED STREAMING_SHARED) + message(FATAL_ERROR "STREAMING_SHARED must be specified") +endif() +function(streaming_bool key value) + set(${key} ${value} CACHE BOOL "Spool transport closure" FORCE) +endfunction() +if(STREAMING_SHARED) + set(streaming_static OFF) +else() + set(streaming_static ON) +endif() +streaming_bool(BUILD_SHARED_LIBS ${STREAMING_SHARED}) +streaming_bool(BUILD_STATIC_LIBS ${streaming_static}) +streaming_bool(BUILD_TESTING OFF) +streaming_bool(CMAKE_POSITION_INDEPENDENT_CODE ON) +set(CMAKE_INSTALL_LIBDIR lib CACHE STRING "Spool transport library directory" FORCE) +if(STREAMING_DEPENDENCY STREQUAL "nghttp2") + streaming_bool(ENABLE_LIB_ONLY ON) + streaming_bool(ENABLE_DOC OFF) + streaming_bool(ENABLE_APP OFF) +elseif(STREAMING_DEPENDENCY MATCHES "^(nghttp3|ngtcp2)$") + streaming_bool(ENABLE_SHARED_LIB ${STREAMING_SHARED}) + streaming_bool(ENABLE_STATIC_LIB ${streaming_static}) + streaming_bool(ENABLE_LIB_ONLY ON) + streaming_bool(ENABLE_DOC OFF) + if(STREAMING_DEPENDENCY STREQUAL "ngtcp2") + streaming_bool(ENABLE_OPENSSL ON) + foreach(adapter BORINGSSL LIBRESSL PICOTLS WOLFSSL GNUTLS QUICTLS) + streaming_bool(ENABLE_${adapter} OFF) + endforeach() + endif() +else() + foreach(feature BUILD_CURL_EXE BUILD_LIBCURL_DOCS BUILD_MISC_DOCS BUILD_EXAMPLES + CURL_BROTLI CURL_ZSTD CURL_USE_GSSAPI CURL_USE_LIBPSL CURL_USE_LIBSSH2 + ENABLE_ARES ENABLE_CURL_MANUAL USE_LIBIDN2) + streaming_bool(${feature} OFF) + endforeach() + foreach(protocol DICT DOH FILE FTP GOPHER HSTS IMAP IPFS LDAP LDAPS MQTT NETRC + POP3 RTSP SMB SMTP TELNET TFTP WEBSOCKETS) + streaming_bool(CURL_DISABLE_${protocol} ON) + endforeach() + streaming_bool(CURL_USE_OPENSSL ON) + streaming_bool(USE_NGHTTP2 ON) + streaming_bool(USE_NGHTTP3 ON) + streaming_bool(USE_NGTCP2 ON) + streaming_bool(CURL_DISABLE_ALTSVC OFF) + streaming_bool(ENABLE_THREADED_RESOLVER ON) +endif() diff --git a/tools/lib/streaming-build.sh b/tools/lib/streaming-build.sh new file mode 100644 index 00000000..a6369c95 --- /dev/null +++ b/tools/lib/streaming-build.sh @@ -0,0 +1,15 @@ +#!/usr/bin/env bash +# Source after platform compiler/OpenSSL setup. No host/toolchain inference. +build_streaming_http() { + local sources="$1" builds="$2" prefix="$3" shared="$4" + shift 4 + local dependency + for dependency in nghttp2 nghttp3 ngtcp2 curl; do + cmake -S "$sources/$dependency" -B "$builds/$dependency" -GNinja \ + -DSTREAMING_DEPENDENCY="$dependency" -DSTREAMING_SHARED="$shared" \ + -C "$ROOT/tools/cmake/StreamingDependencies.cmake" \ + -DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_INSTALL_PREFIX="$prefix" "$@" + cmake --build "$builds/$dependency" --parallel "${JOBS:-4}" + cmake --install "$builds/$dependency" + done +} diff --git a/tools/manifests/android-third-party.json b/tools/manifests/android-third-party.json index 3ee3fb77..9bfc13ea 100644 --- a/tools/manifests/android-third-party.json +++ b/tools/manifests/android-third-party.json @@ -6,16 +6,6 @@ "url": "https://github.com/facebook/zstd/releases/download/v1.5.7/zstd-1.5.7.tar.gz", "sha256": "eb33e51f49a15e023950cd7825ca74a4a2b43db8354825ac24fc1b7ee09e6fa3" }, - "openssl": { - "version": "3.5.4", - "url": "https://github.com/openssl/openssl/releases/download/openssl-3.5.4/openssl-3.5.4.tar.gz", - "sha256": "967311f84955316969bdb1d8d4b983718ef42338639c621ec4c34fddef355e99" - }, - "curl": { - "version": "8.21.0", - "url": "https://curl.se/download/curl-8.21.0.tar.xz", - "sha256": "aa1b66a70eace83dc624508745646c08ae561de512ab403adffb93ac87fc72e6" - }, "freetype": { "version": "2.14.3", "url": "https://downloads.sourceforge.net/project/freetype/freetype2/2.14.3/freetype-2.14.3.tar.xz", diff --git a/tools/manifests/mpv-native.json b/tools/manifests/mpv-native.json index c54f3402..eacf4c22 100644 --- a/tools/manifests/mpv-native.json +++ b/tools/manifests/mpv-native.json @@ -166,42 +166,6 @@ "windows": [ "luajit:default_library=static", "luajit:luajit=false", - "curl:default_library=static", - "curl:tool=disabled", - "curl:tests=disabled", - "curl:unittests=disabled", - "curl:alt-svc=disabled", - "curl:aws=disabled", - "curl:brotli=disabled", - "curl:dict=disabled", - "curl:doh=disabled", - "curl:file=disabled", - "curl:ftp=disabled", - "curl:gopher=disabled", - "curl:gsasl=disabled", - "curl:gss-api=disabled", - "curl:hsts=disabled", - "curl:http=enabled", - "curl:http2=disabled", - "curl:imap=disabled", - "curl:ipfs=disabled", - "curl:ldap=disabled", - "curl:ldaps=disabled", - "curl:libuv=disabled", - "curl:mqtt=disabled", - "curl:pop3=disabled", - "curl:psl=disabled", - "curl:rtmp=disabled", - "curl:rtsp=disabled", - "curl:schannel=enabled", - "curl:smb=disabled", - "curl:smtp=disabled", - "curl:ssh=disabled", - "curl:ssl=enabled", - "curl:telnet=disabled", - "curl:tftp=disabled", - "curl:websockets=disabled", - "curl:zstd=disabled", "expat:default_library=static", "freetype2:default_library=static", "freetype2:brotli=disabled", diff --git a/tools/manifests/streaming-third-party.json b/tools/manifests/streaming-third-party.json new file mode 100644 index 00000000..39202574 --- /dev/null +++ b/tools/manifests/streaming-third-party.json @@ -0,0 +1,33 @@ +{ + "schemaVersion": 1, + "sources": { + "openssl": { + "version": "3.5.9", + "url": "https://github.com/openssl/openssl/releases/download/openssl-3.5.9/openssl-3.5.9.tar.gz", + "sha256": "603f5602e2eef00d77fbd429d34dcd5822bb301757a1bc9cdb24c670f1eb859a" + }, + "curl": { + "version": "8.22.0", + "url": "https://curl.se/download/curl-8.22.0.tar.xz", + "sha256": "f7ef3ae8a22e521f289803fe93543eb64c329b58aa73a9e224dfd915a2a5f4f7", + "patches": [ + "tools/patches/curl-apple-mobile-sectrust.patch" + ] + }, + "nghttp2": { + "version": "1.70.0", + "url": "https://github.com/nghttp2/nghttp2/releases/download/v1.70.0/nghttp2-1.70.0.tar.bz2", + "sha256": "8faca1f78aa99ac3bc1768a76b7e0f6b36d8e6a62c13818751b1d205f02f9405" + }, + "nghttp3": { + "version": "1.18.0", + "url": "https://github.com/ngtcp2/nghttp3/releases/download/v1.18.0/nghttp3-1.18.0.tar.bz2", + "sha256": "ca232668b94a5e1fb54b41632cc56473ab48226483814410ef62a706294e6402" + }, + "ngtcp2": { + "version": "1.23.0", + "url": "https://github.com/ngtcp2/ngtcp2/releases/download/v1.23.0/ngtcp2-1.23.0.tar.bz2", + "sha256": "de4b99ffc90d9b95744c44a0dab61c9f2a9848b881b8fdeb974aeb5ea10802ca" + } + } +} diff --git a/tools/manifests/webos-third-party.json b/tools/manifests/webos-third-party.json index 662a9e58..5676bb78 100644 --- a/tools/manifests/webos-third-party.json +++ b/tools/manifests/webos-third-party.json @@ -1,11 +1,6 @@ { "schemaVersion": 1, "sources": { - "curl": { - "version": "8.21.0", - "url": "https://curl.se/download/curl-8.21.0.tar.xz", - "sha256": "aa1b66a70eace83dc624508745646c08ae561de512ab403adffb93ac87fc72e6" - }, "qcoro": { "version": "0.13.0", "url": "https://codeload.github.com/danvratil/qcoro/tar.gz/refs/tags/v0.13.0", diff --git a/tools/patches/curl-apple-mobile-sectrust.patch b/tools/patches/curl-apple-mobile-sectrust.patch new file mode 100644 index 00000000..b61f7fd4 --- /dev/null +++ b/tools/patches/curl-apple-mobile-sectrust.patch @@ -0,0 +1,16 @@ +--- a/CMakeLists.txt ++++ b/CMakeLists.txt +@@ -815,6 +815,8 @@ +- find_library(CORESERVICES_FRAMEWORK NAMES "CoreServices") +- mark_as_advanced(CORESERVICES_FRAMEWORK) +- if(NOT CORESERVICES_FRAMEWORK) +- message(FATAL_ERROR "CoreServices framework not found") ++ if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") ++ find_library(CORESERVICES_FRAMEWORK NAMES "CoreServices") ++ mark_as_advanced(CORESERVICES_FRAMEWORK) ++ if(NOT CORESERVICES_FRAMEWORK) ++ message(FATAL_ERROR "CoreServices framework not found") ++ endif() ++ list(APPEND CURL_LIBS "-framework CoreServices") + endif() +- list(APPEND CURL_LIBS "-framework CoreServices") diff --git a/tools/prepare-streaming-sources.sh b/tools/prepare-streaming-sources.sh new file mode 100755 index 00000000..0be4071f --- /dev/null +++ b/tools/prepare-streaming-sources.sh @@ -0,0 +1,29 @@ +#!/usr/bin/env bash +set -euo pipefail +usage() { echo "Usage: $0 --root ABS --output ABS [--manifest ABS]"; } +ROOT= OUTPUT= MANIFEST= +while (( $# )); do + case "$1" in + -h|--help) usage; exit 0 ;; + --root|--output|--manifest) + (( $# >= 2 )) || { usage >&2; exit 2; } + case "$1" in --root) ROOT="$2";; --output) OUTPUT="$2";; --manifest) MANIFEST="$2";; esac + shift 2 ;; + *) usage >&2; exit 2 ;; + esac +done +[[ "$ROOT" == /* && "$OUTPUT" == /* && ( -z "$MANIFEST" || "$MANIFEST" == /* ) ]] || { usage >&2; exit 2; } +MANIFEST="${MANIFEST:-$ROOT/tools/manifests/streaming-third-party.json}" +[[ -f "$MANIFEST" && -f "$ROOT/tools/lib/manifest-sources.sh" ]] || { echo 'error: missing manifest or source helpers' >&2; exit 2; } +source "$ROOT/tools/lib/manifest-sources.sh" +# A changed patch must re-extract pristine source; reverse-applying an older +# patch cannot establish that the new patch's preimage still exists. +fingerprint="$(python3 "$ROOT/tools/streaming-fingerprint.py" --root "$ROOT" --manifest "$MANIFEST" --target sources)" +for name in openssl nghttp2 nghttp3 ngtcp2 curl; do + marker="$OUTPUT/$name/.spool-preparation-fingerprint" + if [[ -f "$OUTPUT/$name/.jellyfin-source-sha256" && ( ! -f "$marker" || "$(<"$marker")" != "$fingerprint" ) ]]; then + rm -f "$OUTPUT/$name/.jellyfin-source-sha256" + fi + prepare_manifest_source "$ROOT" "$MANIFEST" "$name" "$OUTPUT/$name" + printf '%s\n' "$fingerprint" >"$marker" +done diff --git a/tools/run-device-tests.py b/tools/run-device-tests.py index 4c7f6af0..557995cc 100755 --- a/tools/run-device-tests.py +++ b/tools/run-device-tests.py @@ -575,7 +575,7 @@ def __init__(self, platform, directory, nonce, regression=None): self.regression = regression self.ready = threading.Event() self.bundle = (os.environ.get("SPOOL_E2E_TVOS_BUNDLE", "com.sachk.spool") - if platform == "tvos" else "com.sachk.spool") + if platform in ("tvos", "ios") else "com.sachk.spool") self.device = os.environ["ANDROID_SERIAL" if platform == "android" else "SPOOL_TVOS_DEVICE"] if platform == "android" and not self.device.startswith("emulator-"): raise RuntimeError("Android journey requires an isolated emulator serial") @@ -587,7 +587,7 @@ def __init__(self, platform, directory, nonce, regression=None): self.mappings = [] self.app_path = None self.artifact_failure = False - if platform == "tvos": + if platform in ("tvos", "ios"): self.app_path = self.call("get_app_container", self.device, self.bundle, "app").stdout.strip() if not Path(self.app_path).is_dir(): raise RuntimeError("installed production simulator application is unavailable") @@ -673,7 +673,7 @@ def recover_launch(self): return if self.platform == "android" and int(birth) < self.pending_launch["minimumBirth"]: raise RuntimeError("refusing to own an Android process predating the launch") - if (self.platform == "tvos" and + if (self.platform in ("tvos", "ios") and time.mktime(time.strptime(birth, "%a %b %d %H:%M:%S %Y")) < self.pending_launch["started"] - 1): raise RuntimeError("refusing to own a simulator process predating the launch") @@ -1191,7 +1191,7 @@ def safe_result(value): result[key] = value[key] if isinstance(value.get("nonce"), str) and re.fullmatch("[a-f0-9]{32}", value["nonce"]): result["nonce"] = value["nonce"] - if value.get("platform") in ("android", "tvos"): + if value.get("platform") in ("android", "tvos", "ios"): result["platform"] = value["platform"] if isinstance(value.get("selector"), str) and re.fullmatch("[a-zA-Z0-9_-]+", value["selector"]): result["selector"] = value["selector"] @@ -1282,7 +1282,7 @@ def write_journal(path, value): def main(): parser = argparse.ArgumentParser(description=__doc__) - parser.add_argument("--platform", choices=("android", "tvos"), required=True) + parser.add_argument("--platform", choices=("android", "tvos", "ios"), required=True) parser.add_argument("--phase", choices=("traditional", "e2e"), required=True) parser.add_argument("--artifact-dir", type=Path, required=True) parser.add_argument("--timeout", type=int, default=180) diff --git a/tools/streaming-fingerprint.py b/tools/streaming-fingerprint.py new file mode 100644 index 00000000..1100fcea --- /dev/null +++ b/tools/streaming-fingerprint.py @@ -0,0 +1,24 @@ +#!/usr/bin/env python3 +"""Content identity for a target's private TLS/HTTP closure.""" +import argparse +import hashlib +import json +from pathlib import Path + +parser = argparse.ArgumentParser(description=__doc__) +parser.add_argument('--root', type=Path, required=True) +parser.add_argument('--manifest', type=Path) +parser.add_argument('--target', required=True, help='ABI, API/SDK, linkage and compiler identity') +parser.add_argument('--wrapper', type=Path, action='append', default=[]) +args = parser.parse_args() +root = args.root.resolve() +manifest = args.manifest or root / 'tools/manifests/streaming-third-party.json' +files = [manifest, root / 'tools/prepare-streaming-sources.sh', + root / 'tools/lib/manifest-sources.sh', root / 'tools/cmake/StreamingDependencies.cmake', + Path(__file__).resolve(), *args.wrapper] +for source in json.loads(manifest.read_text())['sources'].values(): + files.extend(root / patch for patch in source.get('patches', [])) +identity = hashlib.sha256(args.target.encode()) +for path in sorted(set(files)): + identity.update(path.name.encode() + b'\0' + path.read_bytes() + b'\0') +print(identity.hexdigest()) diff --git a/tools/test-transport-netns.sh b/tools/test-transport-netns.sh new file mode 100755 index 00000000..0cf2966b --- /dev/null +++ b/tools/test-transport-netns.sh @@ -0,0 +1,41 @@ +#!/usr/bin/env bash +set -euo pipefail +# All shaping stays inside a fresh user+network namespace. Never changes host +# routes, qdiscs, sysctls or socket ceilings and never invokes sudo. +ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" +usage() { echo "Usage: $0 --libmpv ABS [--output ABS] [--rtt-ms N] [--loss-percent N]"; } +LIBRARY= OUTPUT= RTT=150 LOSS=0.1 +while (( $# )); do + case "$1" in + --help|-h) usage; exit 0 ;; + --libmpv|--output|--rtt-ms|--loss-percent) + (( $# >= 2 )) || { usage >&2; exit 2; } + case "$1" in --libmpv) LIBRARY="$2";; --output) OUTPUT="$2";; --rtt-ms) RTT="$2";; --loss-percent) LOSS="$2";; esac + shift 2 ;; + *) usage >&2; exit 2 ;; + esac +done +[[ "$LIBRARY" == /* && -f "$LIBRARY" && "$RTT" =~ ^[0-9]+([.][0-9]+)?$ && "$LOSS" =~ ^[0-9]+([.][0-9]+)?$ ]] || { usage >&2; exit 2; } +for command in unshare ip tc ping python3 nginx openssl; do + command -v "$command" >/dev/null || { echo "SKIP: missing $command (use nix develop .#native)" >&2; exit 77; } +done +if ! unshare --user --map-root-user --net true 2>/dev/null; then + echo 'SKIP: unprivileged user/network namespaces unavailable' >&2 + exit 77 +fi +exec unshare --user --map-root-user --net bash -s -- "$ROOT" "$LIBRARY" "$OUTPUT" "$RTT" "$LOSS" <<'INNER' +set -euo pipefail +root="$1" library="$2" output="$3" rtt="$4" loss="$5" +ip link set lo up mtu 1500 +# A loopback packet traverses this qdisc once in each direction, so half the +# desired round-trip delay applies to each packet; ping records the real RTT. +delay="$(python3 -c 'import sys; print(float(sys.argv[1])/2)' "$rtt")" +if ! tc qdisc add dev lo root netem delay "${delay}ms" loss "${loss}%" rate 150mbit limit 10000; then + echo 'SKIP: netem qdisc unavailable in isolated namespace' >&2 + exit 77 +fi +ping -n -c 3 -i .2 127.0.0.1 +args=(--libmpv "$library" --transport-helper "$root/mpv/test/curl_transport.py" --performance) +[[ -z "$output" ]] || args+=(--output "$output") +python3 "$root/tests/transport/protocols.py" "${args[@]}" +INNER diff --git a/tools/webos-native/build-curl.sh b/tools/webos-native/build-curl.sh index 9e3ed2fb..9abdf87e 100755 --- a/tools/webos-native/build-curl.sh +++ b/tools/webos-native/build-curl.sh @@ -1,6 +1,5 @@ #!/usr/bin/env bash set -euo pipefail - PHASE="${1:-all}" if (( $# > 1 )); then echo "usage: $0 [fetch|build|all]" >&2; exit 2; fi case "$PHASE" in @@ -8,95 +7,44 @@ case "$PHASE" in fetch|build|all) ;; *) echo "usage: $0 [fetch|build|all]" >&2; exit 2 ;; esac - ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)" -# shellcheck source=tools/lib/build-common.sh source "$ROOT/tools/lib/build-common.sh" -# shellcheck source=tools/lib/manifest-sources.sh -source "$ROOT/tools/lib/manifest-sources.sh" -# shellcheck source=tools/webos-native/nixos-sdk-compat.sh source "$ROOT/tools/webos-native/nixos-sdk-compat.sh" - -MANIFEST="${WEBOS_THIRD_PARTY_MANIFEST:-$ROOT/tools/manifests/webos-third-party.json}" +source "$ROOT/tools/lib/streaming-build.sh" SDK_ROOT="${WEBOS_SDK_ROOT:-$ROOT/build/webos-sdk/arm-webos-linux-gnueabi_sdk-buildroot}" SYSROOT="$SDK_ROOT/arm-webos-linux-gnueabi/sysroot" TARGET_PREFIX="${WEBOS_TARGET_PREFIX:-/usr/local/webos-native}" PREFIX="${WEBOS_NATIVE_PREFIX:-$SYSROOT$TARGET_PREFIX}" -SRC_DIR="${CURL_SOURCE_DIR:-$ROOT/build/third_party/curl}" -BUILD_DIR="${CURL_BUILD_DIR:-$ROOT/build/webos-curl}" -TOOLCHAIN_FILE="$ROOT/tools/webos-native/qt6-webos-toolchain.cmake" - -prepare_manifest_source "$ROOT" "$MANIFEST" curl "$SRC_DIR" - -if [[ "$PHASE" == "fetch" ]]; then - echo "Fetched verified curl source into $SRC_DIR" - exit 0 -fi - +SRC_ROOT="${STREAMING_SOURCE_DIR:-$ROOT/build/streaming-sources}" +BUILD_ROOT="${STREAMING_BUILD_DIR:-$ROOT/build/webos-streaming}" +JOBS="$(recommended_parallel_jobs 512 1024)" +bash "$ROOT/tools/prepare-streaming-sources.sh" --root "$ROOT" --output "$SRC_ROOT" +[[ "$PHASE" != fetch ]] || exit 0 ensure_webos_sdk_host_tools "$SDK_ROOT" -rm -rf "$BUILD_DIR" -rm -f "$PREFIX/lib/libcurl.a" "$PREFIX/lib/libcurl.so"* - -cmake -S "$SRC_DIR" -B "$BUILD_DIR" -GNinja \ - -DCMAKE_TOOLCHAIN_FILE="$TOOLCHAIN_FILE" \ - -DCMAKE_BUILD_TYPE=MinSizeRel \ - -DCMAKE_INSTALL_PREFIX="$TARGET_PREFIX" \ - -DCMAKE_POSITION_INDEPENDENT_CODE=ON \ - -DOPENSSL_USE_STATIC_LIBS=OFF \ - -DCMAKE_C_FLAGS="$(webos_tune_cflags)" \ - -DBUILD_CURL_EXE=OFF \ - -DBUILD_LIBCURL_DOCS=OFF \ - -DBUILD_MISC_DOCS=OFF \ - -DBUILD_EXAMPLES=OFF \ - -DBUILD_SHARED_LIBS=ON \ - -DBUILD_STATIC_LIBS=OFF \ - -DBUILD_TESTING=OFF \ - -DCURL_BROTLI=OFF \ - -DCURL_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt \ - -DCURL_DISABLE_ALTSVC=ON \ - -DCURL_DISABLE_DICT=ON \ - -DCURL_DISABLE_DOH=ON \ - -DCURL_DISABLE_FILE=ON \ - -DCURL_DISABLE_FTP=ON \ - -DCURL_DISABLE_GOPHER=ON \ - -DCURL_DISABLE_HSTS=ON \ - -DCURL_DISABLE_IMAP=ON \ - -DCURL_DISABLE_IPFS=ON \ - -DCURL_DISABLE_LDAP=ON \ - -DCURL_DISABLE_LDAPS=ON \ - -DCURL_DISABLE_MQTT=ON \ - -DCURL_DISABLE_NETRC=ON \ - -DCURL_DISABLE_POP3=ON \ - -DCURL_DISABLE_RTSP=ON \ - -DCURL_DISABLE_SMB=ON \ - -DCURL_DISABLE_SMTP=ON \ - -DCURL_DISABLE_TELNET=ON \ - -DCURL_DISABLE_TFTP=ON \ - -DCURL_DISABLE_WEBSOCKETS=ON \ - -DCURL_LTO=ON \ - -DCURL_USE_GSSAPI=OFF \ - -DCURL_USE_LIBPSL=OFF \ - -DCURL_USE_LIBSSH2=OFF \ - -DCURL_USE_OPENSSL=ON \ - -DCURL_ZLIB=ON \ - -DENABLE_ARES=OFF \ - -DENABLE_THREADED_RESOLVER=ON \ - -DENABLE_CURL_MANUAL=OFF \ - -DUSE_LIBIDN2=OFF \ - -DUSE_NGHTTP2=OFF \ - -DUSE_NGTCP2=OFF \ - -DUSE_NGHTTP3=OFF - -cmake --build "$BUILD_DIR" --parallel "$(recommended_parallel_jobs 512 1024)" -DESTDIR="$SYSROOT" cmake --install "$BUILD_DIR" - -[[ -e "$PREFIX/lib/libcurl.so" ]] || { - echo "error: shared curl install missing at $PREFIX/lib/libcurl.so" >&2 - exit 1 -} -[[ ! -e "$PREFIX/lib/libcurl.a" ]] || { - echo "error: private curl build unexpectedly installed a static library" >&2 - exit 1 -} - -printf '\nInstalled private shared curl into %s\n' "$PREFIX" +export PATH="$SDK_ROOT/bin:$PATH" +export PKG_CONFIG_PATH="$PREFIX/lib/pkgconfig" +export PKG_CONFIG_LIBDIR="$PREFIX/lib/pkgconfig:$SYSROOT/usr/lib/pkgconfig" +export PKG_CONFIG_SYSROOT_DIR="$SYSROOT" +pin="$(python3 "$ROOT/tools/streaming-fingerprint.py" --root "$ROOT" --target "webos:$("$SDK_ROOT/bin/arm-webos-linux-gnueabi-gcc" --version):shared" --wrapper "${BASH_SOURCE[0]}" --wrapper "$ROOT/tools/lib/streaming-build.sh")" +stamp="$PREFIX/lib/.spool-streaming-configuration" +if [[ -f "$stamp" && "$(<"$stamp")" == "$pin" && -f "$PREFIX/lib/libcurl.so" ]]; then exit 0; fi +rm -rf "$BUILD_ROOT" +mkdir -p "$BUILD_ROOT/openssl" +( + cd "$BUILD_ROOT/openssl" + "$SRC_ROOT/openssl/Configure" linux-armv4 shared \ + no-apps no-docs no-tests no-comp no-dtls no-srp no-ssl3 no-weak-ssl-ciphers \ + --prefix="$TARGET_PREFIX" --libdir=lib --cross-compile-prefix=arm-webos-linux-gnueabi- \ + "$(webos_tune_cflags)" + make -j"$JOBS" + make DESTDIR="$SYSROOT" install_sw +) +export DESTDIR="$SYSROOT" +build_streaming_http "$SRC_ROOT" "$BUILD_ROOT" "$TARGET_PREFIX" ON \ + -DCMAKE_TOOLCHAIN_FILE="$ROOT/tools/webos-native/qt6-webos-toolchain.cmake" \ + -DCMAKE_PREFIX_PATH="$PREFIX" -DCMAKE_C_FLAGS="$(webos_tune_cflags)" \ + -DOPENSSL_ROOT_DIR="$PREFIX" -DOPENSSL_INCLUDE_DIR="$PREFIX/include" \ + -DOPENSSL_SSL_LIBRARY="$PREFIX/lib/libssl.so" -DOPENSSL_CRYPTO_LIBRARY="$PREFIX/lib/libcrypto.so" \ + -DOPENSSL_USE_STATIC_LIBS=OFF -DCURL_ZLIB=ON -DCURL_CA_BUNDLE=/etc/ssl/certs/ca-certificates.crt +python3 "$ROOT/tools/check-streaming-dependencies.py" --prefix "$PREFIX" --manifest "$ROOT/tools/manifests/streaming-third-party.json" +printf '%s\n' "$pin" >"$stamp" diff --git a/tools/webos-native/build-qt6-611.sh b/tools/webos-native/build-qt6-611.sh index 229e7009..29f45d62 100755 --- a/tools/webos-native/build-qt6-611.sh +++ b/tools/webos-native/build-qt6-611.sh @@ -530,8 +530,8 @@ configure_target_qtbase() { sdk_glesv2_lib="$(sdk_sysroot_library GLESv2)" sdk_egl_lib="$(sdk_sysroot_library EGL)" sdk_xkb_lib="$(sdk_sysroot_library xkbcommon)" - sdk_ssl_lib="$(sdk_sysroot_library ssl)" - sdk_crypto_lib="$(sdk_sysroot_library crypto)" + sdk_ssl_lib="$SYSROOT/usr/local/webos-native/lib/libssl.so" + sdk_crypto_lib="$SYSROOT/usr/local/webos-native/lib/libcrypto.so" sdk_wayland_client_lib="$(sdk_sysroot_library wayland-client)" sdk_wayland_server_lib="$(sdk_sysroot_library wayland-server)" sdk_wayland_cursor_lib="$(sdk_sysroot_library wayland-cursor)" @@ -618,8 +618,8 @@ configure_target_qtbase() { -DINPUT_openssl=linked \ -DFEATURE_ssl=ON \ -DOPENSSL_USE_STATIC_LIBS=OFF \ - -DOPENSSL_ROOT_DIR="$SYSROOT/usr" \ - -DOPENSSL_INCLUDE_DIR="$SYSROOT/usr/include" \ + -DOPENSSL_ROOT_DIR="$SYSROOT/usr/local/webos-native" \ + -DOPENSSL_INCLUDE_DIR="$SYSROOT/usr/local/webos-native/include" \ -DOPENSSL_SSL_LIBRARY="$sdk_ssl_lib" \ -DOPENSSL_CRYPTO_LIBRARY="$sdk_crypto_lib" \ -DWaylandScanner_EXECUTABLE="$target_wayland_scanner" @@ -628,6 +628,7 @@ configure_target_qtbase() { target_qtbase_up_to_date() { [[ "${QT_BUILD_FORCE:-0}" != "1" ]] || return 1 qt_prefix_matches_version "$TARGET_STAGING" || return 1 + [[ -f "$TARGET_STAGING/.spool-private-tls-v1" ]] || return 1 [[ -f "$TARGET_STAGING/.jellyfin-openssl-shared" ]] || return 1 [[ -f "$TARGET_STAGING/.spool-no-testlib-v1" ]] || return 1 if [[ "$QT_STATIC" == "1" ]]; then @@ -662,6 +663,7 @@ build_target_qtbase() { cmake_build "$TARGET_BUILD_ROOT/qtbase" --parallel "$JOBS" cmake_install "$TARGET_BUILD_ROOT/qtbase" printf 'shared\n' >"$TARGET_STAGING/.jellyfin-openssl-shared" + printf '1\n' >"$TARGET_STAGING/.spool-private-tls-v1" prune_completed_build_dir "$TARGET_BUILD_ROOT/qtbase" printf '1\n' >"$TARGET_STAGING/.spool-no-testlib-v1" } diff --git a/tools/webos-native/build-webos.sh b/tools/webos-native/build-webos.sh index 6741f211..2d0b58c7 100755 --- a/tools/webos-native/build-webos.sh +++ b/tools/webos-native/build-webos.sh @@ -44,6 +44,7 @@ run_phase() { ;; qt-target) WEBOS_SDK_ROOT="$SDK_ROOT" "$TOOLS_ROOT/restore-toolchain.sh" + "$TOOLS_ROOT/build-curl.sh" build QT_STATIC="${QT_STATIC:-1}" "$TOOLS_ROOT/build-qt6-611.sh" target ;; dependencies) diff --git a/tools/windows/build-mpv.ps1 b/tools/windows/build-mpv.ps1 index 2d55a935..0644c8d1 100644 --- a/tools/windows/build-mpv.ps1 +++ b/tools/windows/build-mpv.ps1 @@ -65,29 +65,18 @@ try { if ($LASTEXITCODE -ne 0) { throw 'Failed to update the Meson WrapDB catalog.' } } - foreach ($wrap in @('curl', 'expat', 'freetype2', 'fribidi', 'harfbuzz', 'libpng', 'luajit', 'zlib', 'xxhash')) { + foreach ($wrap in @('expat', 'freetype2', 'fribidi', 'harfbuzz', 'libpng', 'luajit', 'zlib', 'xxhash')) { if (-not (Test-Path (Join-Path $subprojects "$wrap.wrap"))) { meson wrap install $wrap if ($LASTEXITCODE -ne 0) { throw "Failed to install the Meson wrap: $wrap" } } } - meson subprojects download curl - if ($LASTEXITCODE -ne 0) { throw 'Failed to download the pinned curl source.' } - $curlRoot = Get-ChildItem -LiteralPath $subprojects -Directory -Filter 'curl-*' | Select-Object -First 1 - if (-not $curlRoot) { throw 'The downloaded curl subproject was not found.' } - $curlProject = Join-Path $curlRoot.FullName 'meson.build' - $curlLibrary = Join-Path $curlRoot.FullName 'lib\meson.build' - $curlProjectText = (Get-Content -LiteralPath $curlProject -Raw).Replace( - "if get_option('default_library') == 'static'", - 'if true') - $curlLibraryText = (Get-Content -LiteralPath $curlLibrary -Raw).Replace( - 'curl_lib = library(', - 'curl_lib = static_library(').Replace( - " version: '4.8.0',`n", - '') - [IO.File]::WriteAllText($curlProject, $curlProjectText, [Text.UTF8Encoding]::new($false)) - [IO.File]::WriteAllText($curlLibrary, $curlLibraryText, [Text.UTF8Encoding]::new($false)) + & (Join-Path $PSScriptRoot 'build-streaming-dependencies.ps1') -Clean:$Clean + if ($LASTEXITCODE -ne 0) { throw 'Building the private streaming closure failed.' } + $streamingPrefix = Join-Path $dependencyRoot 'streaming-prefix' + $streamingPkgConfig = (& (Join-Path $msysRoot 'usr\bin\cygpath.exe') -u "$streamingPrefix/lib/pkgconfig").Trim() + Remove-Item (Join-Path $subprojects 'curl.wrap') -ErrorAction SilentlyContinue # FFmpeg is built from the same upstream source pin as every desktop. & (Join-Path $PSScriptRoot 'build-ffmpeg.ps1') -Clean:$Clean @@ -102,7 +91,7 @@ try { $shaderTools = Join-Path $dependencyRoot 'shader-tools' $shaderPkgConfig = (& (Join-Path $msysRoot 'usr\bin\cygpath.exe') -u "$shaderTools/lib/pkgconfig").Trim() if ($LASTEXITCODE -ne 0) { throw 'Converting the shader tool pkg-config search path failed.' } - $env:PKG_CONFIG_PATH = "$($env:PKG_CONFIG_PATH):$shaderPkgConfig" + $env:PKG_CONFIG_PATH = "$($env:PKG_CONFIG_PATH):$shaderPkgConfig`:$streamingPkgConfig" # mpv's own sources include libplacebo/vulkan.h, so the Vulkan headers have # to be on mpv's include path too, not only on libplacebo's. $shaderInclude = Join-Path $shaderTools 'include' @@ -179,7 +168,7 @@ clone-recursive = true '--libdir', 'lib', '--buildtype', 'release', '--default-library', 'shared', - '--force-fallback-for', 'curl,expat,freetype2,fribidi,harfbuzz,libpng,luajit,zlib,xxhash,libass,libplacebo', + '--force-fallback-for', 'expat,freetype2,fribidi,harfbuzz,libpng,luajit,zlib,xxhash,libass,libplacebo', # libplacebo looks for glslang under /lib and takes the # headers from the same prefix, so the shader tools are handed to it # as though they were an SDK. They are not one: the Vulkan headers it @@ -207,7 +196,7 @@ clone-recursive = true # initial setup but may still instantiate that first fallback as shared. # Reapply these after the fallbacks exist so libmpv has no extra project # DLLs and installation does not expect import libraries for their tools. - meson configure $buildDirectory '-Dcurl:default_library=static' '-Dluajit:default_library=static' + meson configure $buildDirectory '-Dluajit:default_library=static' if ($LASTEXITCODE -ne 0) { throw 'Configuring static Windows libmpv dependencies failed.' } # Ninja's default process fan-out can exhaust Windows process creation diff --git a/tools/windows/build-streaming-dependencies.ps1 b/tools/windows/build-streaming-dependencies.ps1 new file mode 100644 index 00000000..91661da1 --- /dev/null +++ b/tools/windows/build-streaming-dependencies.ps1 @@ -0,0 +1,56 @@ +param([switch] $Clean) +. (Join-Path $PSScriptRoot 'common.ps1') +Initialize-WindowsMpvBuildEnvironment +$root = Get-RepositoryRoot +$msys = Get-Msys2Root +$bash = Join-Path $msys 'usr\bin\bash.exe' +$cygpath = Join-Path $msys 'usr\bin\cygpath.exe' +$sources = Join-Path $root 'build\windows-deps\streaming-sources' +$builds = Join-Path $root 'build\windows-deps\streaming-build' +$prefix = Join-Path $root 'build\windows-deps\streaming-prefix' +$unixRoot = (& $cygpath -u $root).Trim() +$unixSources = (& $cygpath -u $sources).Trim() +& $bash "$unixRoot/tools/prepare-streaming-sources.sh" --root $unixRoot --output $unixSources +if ($LASTEXITCODE -ne 0) { throw 'Preparing verified streaming sources failed.' } +$fingerprintArgs = @((Join-Path $root 'tools\streaming-fingerprint.py'), '--root', $root, + '--target', "windows-x64:static:MD:$(& clang --version)", '--wrapper', $PSCommandPath) +$pin = (& python @fingerprintArgs).Trim() +if ($LASTEXITCODE -ne 0) { throw 'Computing streaming dependency identity failed.' } +$stamp = Join-Path $prefix '.spool-streaming-configuration' +if (-not $Clean -and (Test-Path $stamp) -and (Get-Content $stamp -Raw).Trim() -eq $pin) { return } +if (Test-Path $builds) { Remove-Item $builds -Recurse -Force } +if (Test-Path $prefix) { Remove-Item $prefix -Recurse -Force } +$opensslBuild = Join-Path $builds 'openssl' +New-Item -ItemType Directory -Force $opensslBuild | Out-Null +Push-Location $opensslBuild +try { + & perl (Join-Path $sources 'openssl\Configure') VC-WIN64A no-shared no-apps no-docs no-tests ` + no-comp no-dtls no-srp no-ssl3 no-weak-ssl-ciphers -MD "--prefix=$prefix" --libdir=lib + if ($LASTEXITCODE -ne 0) { throw 'Configuring OpenSSL failed.' } + & nmake build_libs + if ($LASTEXITCODE -ne 0) { throw 'Building OpenSSL failed.' } + & nmake install_dev + if ($LASTEXITCODE -ne 0) { throw 'Installing OpenSSL failed.' } +} finally { Pop-Location } +$env:PKG_CONFIG_PATH = (& $cygpath -u "$prefix/lib/pkgconfig").Trim() +foreach ($name in @('nghttp2', 'nghttp3', 'ngtcp2', 'curl')) { + & cmake -S (Join-Path $sources $name) -B (Join-Path $builds $name) -GNinja ` + "-DSTREAMING_DEPENDENCY=$name" -DSTREAMING_SHARED=OFF ` + -C (Join-Path $root 'tools\cmake\StreamingDependencies.cmake') ` + -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=clang-cl -DCMAKE_CXX_COMPILER=clang-cl ` + -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDLL "-DCMAKE_INSTALL_PREFIX=$prefix" ` + "-DCMAKE_PREFIX_PATH=$prefix" "-DOPENSSL_ROOT_DIR=$prefix" -DOPENSSL_USE_STATIC_LIBS=ON ` + -DCURL_ZLIB=OFF -DCURL_USE_SCHANNEL=OFF + if ($LASTEXITCODE -ne 0) { throw "Configuring $name failed." } + & cmake --build (Join-Path $builds $name) --parallel 4 + if ($LASTEXITCODE -ne 0) { throw "Building $name failed." } + & cmake --install (Join-Path $builds $name) + if ($LASTEXITCODE -ne 0) { throw "Installing $name failed." } +} +# curl-config is a shell script even in a Windows cross-compatible install. +$unixPrefix = (& $cygpath -u $prefix).Trim() +$features = (& $bash "$unixPrefix/bin/curl-config" --features) -join ' ' +if ($LASTEXITCODE -ne 0 -or $features -notmatch '\bHTTP2\b' -or $features -notmatch '\bHTTP3\b' -or $features -notmatch '\balt-svc\b') { + throw 'Installed curl lacks HTTP2, HTTP3 or alt-svc.' +} +[IO.File]::WriteAllText($stamp, "$pin`n") diff --git a/tools/windows/common.ps1 b/tools/windows/common.ps1 index 34b5bafc..9449b164 100644 --- a/tools/windows/common.ps1 +++ b/tools/windows/common.ps1 @@ -119,7 +119,10 @@ function Get-MpvSourceRevision { 'tools/windows/build-mpv.ps1', 'tools/windows/common.ps1', 'tools/windows/build-ffmpeg.ps1', 'tools/windows/build-ffmpeg.sh', 'tools/windows/check-ffmpeg.py', 'tools/windows/build-shader-tools.ps1', - 'tools/windows/extract-archive.py', + 'tools/windows/extract-archive.py', 'tools/windows/build-streaming-dependencies.ps1', + 'tools/manifests/streaming-third-party.json', 'tools/cmake/StreamingDependencies.cmake', + 'tools/prepare-streaming-sources.sh', 'tools/streaming-fingerprint.py', + 'tools/patches/curl-apple-mobile-sectrust.patch', 'tools/lib/manifest-sources.sh', 'tools/manifests/mpv-native.json', 'tools/manifests/ffmpeg-capabilities.json', 'tools/manifests/toolchain.json', 'tools/ffmpeg-capabilities.py' )) { diff --git a/tools/windows/install-build-tools.ps1 b/tools/windows/install-build-tools.ps1 index ec8b51b8..eac8aede 100644 --- a/tools/windows/install-build-tools.ps1 +++ b/tools/windows/install-build-tools.ps1 @@ -18,6 +18,7 @@ param( $chocolateyPackages = @( @{ Name = 'meson'; Version = '1.9.1'; Provides = 'meson' }, @{ Name = 'nasm'; Provides = 'nasm' }, + @{ Name = 'strawberryperl'; Provides = 'perl' }, @{ Name = 'nsis'; Provides = 'makensis' }, # The launch screen carries the version, so it is rendered at configure # time rather than kept in the tree, and ImageMagick draws it. @@ -30,11 +31,12 @@ $toolDirectories = @( (Join-Path $env:ProgramFiles 'LLVM\bin'), (Join-Path $env:ProgramFiles 'Meson'), (Join-Path $env:ProgramFiles 'NASM'), + (Join-Path $env:SystemDrive 'Strawberry\perl\bin'), (Join-Path ${env:ProgramFiles(x86)} 'NSIS') ) -$requiredTools = @('cmake', 'ninja', 'clang', 'lld-link', 'meson', 'nasm', 'makensis', 'magick') -$msys2Packages = @('make', 'diffutils', 'pkgconf') +$requiredTools = @('cmake', 'ninja', 'clang', 'lld-link', 'meson', 'nasm', 'makensis', 'magick', 'perl') +$msys2Packages = @('make', 'diffutils', 'pkgconf', 'patch', 'tar', 'curl') function Add-ToolDirectoriesToPath { foreach ($directory in $toolDirectories) { From d5be068bc6d82e8f52bf1a629b4cb974a1d584e5 Mon Sep 17 00:00:00 2001 From: Sacha Korban Date: Fri, 27 Nov 2026 02:50:05 +1100 Subject: [PATCH 03/39] feat(streaming): integrate transport policy, memory accounting and protocol contracts Consolidate the release milestone ending at b01df004caa19f0f131fcde497c9108b8d283b16. Original starting snapshot: 738ae12a6fa8332d8841aecfba39f40185fa4ddf. --- .github/workflows/build-artifacts.yml | 46 +++- .github/workflows/ios-review.yml | 2 +- .github/workflows/tvos.yml | 2 +- CMakeLists.txt | 28 ++- flake.lock | 10 +- flake.nix | 2 +- mpv | 2 +- src/player/PlayerController.cpp | 30 ++- src/player/PlayerController.h | 1 + src/provider/ProviderRegistry.cpp | 5 + tests/providers/SourceHubSpeedTest.cpp | 12 +- tests/tools/StreamingCandidatesTest.py | 186 ++++++++++++++++ tests/tools/StreamingDependenciesTest.py | 51 ++++- tests/transport/protocols.py | 112 +++++++++- tests/transport/quic_origin.py | 91 ++++++++ tools/android/build-dependencies.sh | 1 + tools/apple/build-dependencies.sh | 8 + tools/check-streaming-dependencies.py | 11 +- tools/cmake/QuicBatchingProbe/CMakeLists.txt | 35 +++ tools/cmake/StreamingDependencies.cmake | 7 + tools/find-streaming-candidates.py | 199 ++++++++++++++++++ tools/lib/manifest-sources.sh | 17 +- tools/lib/streaming-build.sh | 9 +- .../patches/curl-apple-mobile-sectrust.patch | 15 +- tools/prepare-streaming-sources.sh | 2 +- tools/streaming-fingerprint.py | 1 + tools/webos-native/build-curl.sh | 3 +- .../windows/build-streaming-dependencies.ps1 | 38 +++- tools/windows/common.ps1 | 1 + 29 files changed, 862 insertions(+), 65 deletions(-) create mode 100644 tests/tools/StreamingCandidatesTest.py create mode 100644 tests/transport/quic_origin.py create mode 100644 tools/cmake/QuicBatchingProbe/CMakeLists.txt create mode 100755 tools/find-streaming-candidates.py diff --git a/.github/workflows/build-artifacts.yml b/.github/workflows/build-artifacts.yml index 3028db20..de3ced96 100644 --- a/.github/workflows/build-artifacts.yml +++ b/.github/workflows/build-artifacts.yml @@ -788,6 +788,20 @@ jobs: ~/Library/Caches/ccache key: ${{ steps.macos-build-cache.outputs.cache-primary-key }} + - name: Retain native macOS test journals and selector logs + if: always() + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.0 + with: + name: internal-macos-${{ matrix.arch }}-unified-tests + # Only CI fixture supervisor outputs; never an application data directory. + path: | + build/macos/app/*-results.json + build/macos/app/*-results.json.*.log + build/macos/app/test-phases.json + build/macos/app/Testing/Temporary/LastTest.log + if-no-files-found: warn + retention-days: 7 + ios: name: iOS needs: [lint, toolchain] @@ -799,7 +813,7 @@ jobs: tvos: name: tvOS (${{ matrix.sdk }} arm64) runs-on: macos-15 - timeout-minutes: 180 + timeout-minutes: 240 needs: [lint, toolchain] if: ${{ github.event_name != 'workflow_dispatch' || inputs.build_tvos }} strategy: @@ -850,7 +864,7 @@ jobs: build/apple/qt-${{ matrix.sdk }}-arm64 build/apple/${{ matrix.sdk }}-arm64 build/downloads - key: tvos-source1-${{ runner.os }}-${{ runner.arch }}-${{ matrix.sdk }}-16.0-${{ steps.apple-toolchain.outputs.key }}-${{ hashFiles('tools/manifests/streaming-third-party.json', 'tools/prepare-streaming-sources.sh', 'tools/streaming-fingerprint.py', 'tools/check-streaming-dependencies.py', 'tools/cmake/StreamingDependencies.cmake', 'tools/lib/streaming-build.sh', 'tools/patches/curl-*.patch', 'tools/windows/build-streaming-dependencies.ps1', 'tools/manifests/toolchain.json', 'tools/manifests/android-third-party.json', 'tools/manifests/ffmpeg-capabilities.json', 'tools/apple/**', 'tools/build-tvos.sh', 'tools/ffmpeg-capabilities.py', 'tools/lib/manifest-sources.sh', 'tools/webos-native/patches/qtdeclarative-*-qmlimportscanner-exclude-subtrees.patch', 'third_party/**', 'mpv/meson.build', 'mpv/meson.options') }} + key: tvos-source1-${{ runner.os }}-${{ runner.arch }}-${{ matrix.sdk }}-16.0-${{ steps.apple-toolchain.outputs.key }}-${{ hashFiles('tools/manifests/streaming-third-party.json', 'tools/prepare-streaming-sources.sh', 'tools/streaming-fingerprint.py', 'tools/check-streaming-dependencies.py', 'tools/cmake/StreamingDependencies.cmake', 'tools/cmake/QuicBatchingProbe/CMakeLists.txt', 'tools/lib/streaming-build.sh', 'tools/patches/curl-*.patch', 'tools/windows/build-streaming-dependencies.ps1', 'tools/manifests/toolchain.json', 'tools/manifests/android-third-party.json', 'tools/manifests/ffmpeg-capabilities.json', 'tools/apple/**', 'tools/build-tvos.sh', 'tools/ffmpeg-capabilities.py', 'tools/lib/manifest-sources.sh', 'tools/webos-native/patches/qtdeclarative-*-qmlimportscanner-exclude-subtrees.patch', 'third_party/**', 'mpv/meson.build', 'mpv/meson.options') }} - name: Install matching macOS Qt host tools if: ${{ steps.tvos-source-cache.outputs.cache-hit != 'true' }} env: @@ -949,7 +963,7 @@ jobs: build/third_party .ccache mpv/build/webos-libmpv - key: webos3-${{ runner.os }}-${{ hashFiles('tools/manifests/streaming-third-party.json', 'tools/prepare-streaming-sources.sh', 'tools/streaming-fingerprint.py', 'tools/check-streaming-dependencies.py', 'tools/cmake/StreamingDependencies.cmake', 'tools/lib/streaming-build.sh', 'tools/patches/curl-*.patch', 'tools/windows/build-streaming-dependencies.ps1', 'flake.nix', 'flake.lock', 'mpv/meson.build', 'build-ipk.sh', 'tools/package-audit.py', 'tools/lib/*.sh', 'tools/manifests/ffmpeg-capabilities.json', 'tools/manifests/toolchain.json', 'tools/manifests/mpv-native.json', 'tools/manifests/qt-webos-6.11.json', 'tools/manifests/webos-third-party.json', 'tools/webos-native/**') }} + key: webos3-${{ runner.os }}-${{ hashFiles('tools/manifests/streaming-third-party.json', 'tools/prepare-streaming-sources.sh', 'tools/streaming-fingerprint.py', 'tools/check-streaming-dependencies.py', 'tools/cmake/StreamingDependencies.cmake', 'tools/cmake/QuicBatchingProbe/CMakeLists.txt', 'tools/lib/streaming-build.sh', 'tools/patches/curl-*.patch', 'tools/windows/build-streaming-dependencies.ps1', 'flake.nix', 'flake.lock', 'mpv/meson.build', 'build-ipk.sh', 'tools/package-audit.py', 'tools/lib/*.sh', 'tools/manifests/ffmpeg-capabilities.json', 'tools/manifests/toolchain.json', 'tools/manifests/mpv-native.json', 'tools/manifests/qt-webos-6.11.json', 'tools/manifests/webos-third-party.json', 'tools/webos-native/**') }} restore-keys: | webos3-${{ runner.os }}- webos2-${{ runner.os }}- @@ -1090,7 +1104,7 @@ jobs: android-apks: name: Android ${{ matrix.abi }} APK runs-on: ubuntu-24.04 - timeout-minutes: 150 + timeout-minutes: 240 strategy: fail-fast: false matrix: @@ -1162,7 +1176,7 @@ jobs: build/android/qt build/android/deps build/android/qcoro - key: android6-${{ matrix.abi }}-${{ runner.os }}-${{ steps.cache-inputs.outputs.mpv }}-${{ steps.cache-inputs.outputs.toolchain }}-${{ hashFiles('tools/manifests/streaming-third-party.json', 'tools/prepare-streaming-sources.sh', 'tools/streaming-fingerprint.py', 'tools/check-streaming-dependencies.py', 'tools/cmake/StreamingDependencies.cmake', 'tools/lib/streaming-build.sh', 'tools/patches/curl-*.patch', 'tools/windows/build-streaming-dependencies.ps1', 'tools/android/build-dependencies.sh', 'tools/android/build-qt6.sh', 'tools/android/patches/*.patch', 'tools/ffmpeg-capabilities.py', 'tools/lib/build-common.sh', 'tools/lib/manifest-sources.sh', 'tools/manifests/android-third-party.json', 'tools/manifests/ffmpeg-capabilities.json', 'tools/manifests/toolchain.json', 'tools/manifests/qt-android-6.11.json') }} + key: android6-${{ matrix.abi }}-${{ runner.os }}-${{ steps.cache-inputs.outputs.mpv }}-${{ steps.cache-inputs.outputs.toolchain }}-${{ hashFiles('tools/manifests/streaming-third-party.json', 'tools/prepare-streaming-sources.sh', 'tools/streaming-fingerprint.py', 'tools/check-streaming-dependencies.py', 'tools/cmake/StreamingDependencies.cmake', 'tools/cmake/QuicBatchingProbe/CMakeLists.txt', 'tools/lib/streaming-build.sh', 'tools/patches/curl-*.patch', 'tools/windows/build-streaming-dependencies.ps1', 'tools/android/build-dependencies.sh', 'tools/android/build-qt6.sh', 'tools/android/patches/*.patch', 'tools/ffmpeg-capabilities.py', 'tools/lib/build-common.sh', 'tools/lib/manifest-sources.sh', 'tools/manifests/android-third-party.json', 'tools/manifests/ffmpeg-capabilities.json', 'tools/manifests/toolchain.json', 'tools/manifests/qt-android-6.11.json') }} - name: Build cached Android toolchains if: ${{ steps.android-cache.outputs.cache-hit != 'true' }} @@ -1384,7 +1398,7 @@ jobs: windows-x64: name: Windows x64 portable and installer runs-on: windows-2025 - timeout-minutes: 75 + timeout-minutes: 150 needs: [toolchain, lint] if: ${{ github.event_name != 'workflow_dispatch' || inputs.build_windows }} env: @@ -1452,11 +1466,11 @@ jobs: uses: actions/cache/restore@caa296126883cff596d87d8935842f9db880ef25 # v5.0.3 with: path: build/windows-deps/mpv - key: windows-mpv-${{ runner.os }}-${{ steps.mpv-revision.outputs.revision }}-${{ hashFiles('tools/manifests/streaming-third-party.json', 'tools/prepare-streaming-sources.sh', 'tools/streaming-fingerprint.py', 'tools/check-streaming-dependencies.py', 'tools/cmake/StreamingDependencies.cmake', 'tools/lib/streaming-build.sh', 'tools/patches/curl-*.patch', 'tools/windows/build-streaming-dependencies.ps1', 'tools/windows/build-mpv.ps1', 'tools/windows/build-ffmpeg.ps1', 'tools/windows/build-ffmpeg.sh', 'tools/windows/check-ffmpeg.py', 'tools/windows/build-shader-tools.ps1', 'tools/windows/common.ps1', 'tools/manifests/mpv-native.json', 'tools/manifests/ffmpeg-capabilities.json', 'tools/manifests/toolchain.json', 'tools/ffmpeg-capabilities.py') }} + key: windows-mpv-${{ runner.os }}-${{ steps.mpv-revision.outputs.revision }}-${{ hashFiles('tools/manifests/streaming-third-party.json', 'tools/prepare-streaming-sources.sh', 'tools/streaming-fingerprint.py', 'tools/check-streaming-dependencies.py', 'tools/cmake/StreamingDependencies.cmake', 'tools/cmake/QuicBatchingProbe/CMakeLists.txt', 'tools/lib/streaming-build.sh', 'tools/patches/curl-*.patch', 'tools/windows/build-streaming-dependencies.ps1', 'tools/windows/build-mpv.ps1', 'tools/windows/build-ffmpeg.ps1', 'tools/windows/build-ffmpeg.sh', 'tools/windows/check-ffmpeg.py', 'tools/windows/build-shader-tools.ps1', 'tools/windows/common.ps1', 'tools/manifests/mpv-native.json', 'tools/manifests/ffmpeg-capabilities.json', 'tools/manifests/toolchain.json', 'tools/ffmpeg-capabilities.py') }} - name: Build libmpv from the fork if: steps.mpv-cache.outputs.cache-hit != 'true' - timeout-minutes: 45 + timeout-minutes: 90 shell: pwsh env: MSYS2_LOCATION: ${{ steps.msys2.outputs.msys2-location }} @@ -1467,7 +1481,7 @@ jobs: uses: actions/cache/save@caa296126883cff596d87d8935842f9db880ef25 # v5.0.3 with: path: build/windows-deps/mpv - key: windows-mpv-${{ runner.os }}-${{ steps.mpv-revision.outputs.revision }}-${{ hashFiles('tools/manifests/streaming-third-party.json', 'tools/prepare-streaming-sources.sh', 'tools/streaming-fingerprint.py', 'tools/check-streaming-dependencies.py', 'tools/cmake/StreamingDependencies.cmake', 'tools/lib/streaming-build.sh', 'tools/patches/curl-*.patch', 'tools/windows/build-streaming-dependencies.ps1', 'tools/windows/build-mpv.ps1', 'tools/windows/build-ffmpeg.ps1', 'tools/windows/build-ffmpeg.sh', 'tools/windows/check-ffmpeg.py', 'tools/windows/build-shader-tools.ps1', 'tools/windows/common.ps1', 'tools/manifests/mpv-native.json', 'tools/manifests/ffmpeg-capabilities.json', 'tools/manifests/toolchain.json', 'tools/ffmpeg-capabilities.py') }} + key: windows-mpv-${{ runner.os }}-${{ steps.mpv-revision.outputs.revision }}-${{ hashFiles('tools/manifests/streaming-third-party.json', 'tools/prepare-streaming-sources.sh', 'tools/streaming-fingerprint.py', 'tools/check-streaming-dependencies.py', 'tools/cmake/StreamingDependencies.cmake', 'tools/cmake/QuicBatchingProbe/CMakeLists.txt', 'tools/lib/streaming-build.sh', 'tools/patches/curl-*.patch', 'tools/windows/build-streaming-dependencies.ps1', 'tools/windows/build-mpv.ps1', 'tools/windows/build-ffmpeg.ps1', 'tools/windows/build-ffmpeg.sh', 'tools/windows/check-ffmpeg.py', 'tools/windows/build-shader-tools.ps1', 'tools/windows/common.ps1', 'tools/manifests/mpv-native.json', 'tools/manifests/ffmpeg-capabilities.json', 'tools/manifests/toolchain.json', 'tools/ffmpeg-capabilities.py') }} - name: Build application shell: pwsh @@ -1509,3 +1523,17 @@ jobs: dist/*-Setup.exe if-no-files-found: error retention-days: ${{ inputs.release && 1 || 7 }} + + - name: Retain native Windows test journals and selector logs + if: always() + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.0 + with: + name: internal-windows-x64-unified-tests + # Only CI fixture supervisor outputs; never an application data directory. + path: | + build/windows-release/app/*-results.json + build/windows-release/app/*-results.json.*.log + build/windows-release/app/test-phases.json + build/windows-release/app/Testing/Temporary/LastTest.log + if-no-files-found: warn + retention-days: 7 diff --git a/.github/workflows/ios-review.yml b/.github/workflows/ios-review.yml index f1f9f5f0..34d5b126 100644 --- a/.github/workflows/ios-review.yml +++ b/.github/workflows/ios-review.yml @@ -20,7 +20,7 @@ jobs: native: name: iOS (${{ matrix.sdk }} ${{ matrix.arch }}) runs-on: macos-15-intel - timeout-minutes: 120 + timeout-minutes: 180 strategy: fail-fast: false matrix: diff --git a/.github/workflows/tvos.yml b/.github/workflows/tvos.yml index ef064538..5abdb39e 100644 --- a/.github/workflows/tvos.yml +++ b/.github/workflows/tvos.yml @@ -16,7 +16,7 @@ jobs: simulator: name: Qt mpv tvOS ${{ matrix.sdk }} build (simulator tests; device artifact audit only) runs-on: macos-15 - timeout-minutes: 180 + timeout-minutes: 240 strategy: fail-fast: false matrix: diff --git a/CMakeLists.txt b/CMakeLists.txt index 1288387f..a2bd3305 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1046,6 +1046,21 @@ if(BUILD_TESTING AND NOT SPOOL_WEBOS) else() find_package(Threads REQUIRED) find_package(Qt6 REQUIRED COMPONENTS QuickTest) + # Packaged libmpv disables Meson's test executables. Keep its standalone + # policy and accounting contracts in the native application's CI suite. + foreach(transport_module IN ITEMS budget controller policy) + set(transport_test "spool-curl-${transport_module}-tests") + add_executable(${transport_test} + "${MPV_ACTIVE_SOURCE_DIR}/stream/curl_${transport_module}.c" + "${MPV_ACTIVE_SOURCE_DIR}/test/curl_${transport_module}.c") + target_include_directories(${transport_test} PRIVATE "${MPV_ACTIVE_SOURCE_DIR}") + target_compile_features(${transport_test} PRIVATE c_std_11) + if(UNIX) + target_link_libraries(${transport_test} PRIVATE m) + endif() + add_test(NAME "curl-${transport_module}" COMMAND ${transport_test}) + set_tests_properties("curl-${transport_module}" PROPERTIES LABELS traditional TIMEOUT 30) + endforeach() get_target_property(SPOOL_APP_SOURCES spool SOURCES) set(SPOOL_TEST_PLATFORM_SOURCES ${SPOOL_APP_SOURCES}) list(FILTER SPOOL_TEST_PLATFORM_SOURCES INCLUDE REGEX "/[A-Za-z]+PlatformCapabilities\\.cpp$") @@ -1145,6 +1160,9 @@ if(BUILD_TESTING AND NOT SPOOL_WEBOS) COMMAND bash "${CMAKE_CURRENT_SOURCE_DIR}/tools/check-module-seam.sh" ) + add_test(NAME streaming-candidates + COMMAND "${Python3_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/tests/tools/StreamingCandidatesTest.py") + add_test(NAME network-shaper COMMAND "${Python3_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/tests/tools/NetworkShaperTest.py" @@ -1338,7 +1356,12 @@ if(BUILD_TESTING AND NOT SPOOL_WEBOS) INTERPROCEDURAL_OPTIMIZATION_RELEASE OFF INTERPROCEDURAL_OPTIMIZATION_MINSIZEREL OFF) endforeach() set_tests_properties(provider-sdk-tool local-provider-overrides ffmpeg-capability-generator module-seam - network-shaper render-benchmark-report altstore-source player-setup-report test-driver-ordering PROPERTIES LABELS traditional) + network-shaper streaming-candidates render-benchmark-report altstore-source player-setup-report test-driver-ordering PROPERTIES LABELS traditional) + if(UNIX) + add_test(NAME streaming-dependencies COMMAND "${Python3_EXECUTABLE}" + "${CMAKE_CURRENT_SOURCE_DIR}/tests/tools/StreamingDependenciesTest.py") + set_tests_properties(streaming-dependencies PROPERTIES LABELS traditional TIMEOUT 120) + endif() if(CMAKE_SYSTEM_NAME STREQUAL "Linux") set_tests_properties(package-audit webos-tooling PROPERTIES LABELS traditional) # Exercise the actual curl scheduler/counters, not just its exposed @@ -1349,9 +1372,6 @@ if(BUILD_TESTING AND NOT SPOOL_WEBOS) --libmpv "${SPOOL_CURL_TEST_MPV}" -v) # The real-HTTP suite runs about 330 s of playback serially. set_tests_properties(curl-transport PROPERTIES LABELS traditional TIMEOUT 600) - add_test(NAME streaming-dependencies COMMAND "${Python3_EXECUTABLE}" - "${CMAKE_CURRENT_SOURCE_DIR}/tests/tools/StreamingDependenciesTest.py") - set_tests_properties(streaming-dependencies PROPERTIES LABELS traditional TIMEOUT 120) add_test(NAME transport-protocols COMMAND "${Python3_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/tests/transport/protocols.py" --transport-helper "${MPV_ACTIVE_SOURCE_DIR}/test/curl_transport.py" diff --git a/flake.lock b/flake.lock index 2e7fd75a..6d09ef45 100644 --- a/flake.lock +++ b/flake.lock @@ -20,11 +20,11 @@ "mpv-src": { "flake": false, "locked": { - "lastModified": 1792780682, - "narHash": "sha256-d7JGskrqhdkVJ3i3UMYC66DCk1WpAWaKnA+rI4v6uKQ=", - "ref": "refs/heads/universal-sync", - "rev": "5b0231eb803df84e18669b560a2a5321f5fb2118", - "revCount": 55879, + "lastModified": 1794610812, + "narHash": "sha256-M14NLYJsRuOY/k4W5YjI+IAw+z2XGU3cBBOLwlO2EtU=", + "ref": "refs/heads/net/integration", + "rev": "11f51b304783456a4898c71e8d14521ed8610b8d", + "revCount": 55880, "type": "git", "url": "file:./mpv" }, diff --git a/flake.nix b/flake.nix index b0a39d68..438637af 100644 --- a/flake.nix +++ b/flake.nix @@ -790,7 +790,7 @@ native = pkgs.mkShell { packages = nativePackages pkgs ++ pkgs.lib.optionals pkgs.stdenv.hostPlatform.isLinux - (with pkgs; [ nginxStable iproute2 util-linux ethtool iputils python3Packages.h2 ]); + (with pkgs; [ nginxStable iproute2 util-linux ethtool iputils python3Packages.h2 python3Packages.aioquic ]); shellHook = nativeShellHook pkgs; }; diff --git a/mpv b/mpv index 5b0231eb..11f51b30 160000 --- a/mpv +++ b/mpv @@ -1 +1 @@ -Subproject commit 5b0231eb803df84e18669b560a2a5321f5fb2118 +Subproject commit 11f51b304783456a4898c71e8d14521ed8610b8d diff --git a/src/player/PlayerController.cpp b/src/player/PlayerController.cpp index 25c0ca07..45978d2c 100644 --- a/src/player/PlayerController.cpp +++ b/src/player/PlayerController.cpp @@ -129,7 +129,7 @@ namespace { for (int field = 0; field < 10; ++field) { prior.keys[field] = const_cast(priorFields[field]); const auto value = sample.value(QString::fromLatin1(priorFields[field])); - const bool real = field == 5 || field == 6; + const bool real = field == 6; prior.values[field].format = real ? MPV_FORMAT_DOUBLE : MPV_FORMAT_INT64; if (real) prior.values[field].u.double_ = value.toDouble(); @@ -326,7 +326,10 @@ namespace { QStringLiteral("receive-status"), QStringLiteral("udp-rcvbuf-requested"), QStringLiteral("udp-rcvbuf-effective"), QStringLiteral("udp-drops"), QStringLiteral("urgency"), QStringLiteral("state"), QStringLiteral("last-reason"), QStringLiteral("joint-extra-grant-bytes"), - QStringLiteral("allocated-extra-bytes"), QStringLiteral("reserved-socket-bytes") }; + QStringLiteral("allocated-extra-bytes"), QStringLiteral("reserved-socket-bytes"), + QStringLiteral("baseline-raw-bytes"), QStringLiteral("allocated-raw-bytes"), + QStringLiteral("reserved-manual-socket-bytes"), QStringLiteral("desired-joint-extra-grant-bytes"), + QStringLiteral("committed-joint-extra-grant-bytes") }; if (keys.contains(key)) return true; constexpr QLatin1String available("-available"); @@ -451,6 +454,18 @@ PlayerController::PlayerController(NativeAppWindow *window, PlaybackSource *api, m_backgroundTeardownTimer.setInterval(750); m_networkTimer.setInterval(1000); connect(&m_networkTimer, &QTimer::timeout, this, &PlayerController::updateNetworkTransport); + // Measure spare headroom before playback as well: the startup sample can + // confirm an idle observation before any fixed socket profile connects. + m_idleStreamingMemoryTimer.setInterval(5000); + connect(&m_idleStreamingMemoryTimer, &QTimer::timeout, this, [this] { + if (!m_sessionActive) + updateStreamingMemoryGrant(); + }); + m_idleStreamingMemoryTimer.start(); + QTimer::singleShot(0, this, [this] { + if (!m_sessionActive) + updateStreamingMemoryGrant(); + }); connect(&m_backgroundTeardownTimer, &QTimer::timeout, this, [this]() { if (!m_sessionActive) return; @@ -1593,7 +1608,6 @@ void PlayerController::playSession(const PlaybackSession& session, bool startPau m_sessionThreadedStreaming = m_threadedStreaming; m_sessionStreamingOptions = m_streamingOptions; m_jointExtraGrantBytes = 0; - m_previousMemoryCandidate = 0; m_streamingMemoryTimer.invalidate(); updateStreamingMemoryGrant(); m_streamingMemoryTimer.start(); @@ -3759,14 +3773,14 @@ void PlayerController::updateStreamingMemoryGrant() const bool constrained = platformMpvOptionProfile() == MpvOptionProfile::Platform::WebOS || (policy.totalBytes > 0 && policy.totalBytes < policy.lowMemoryBytes); const qint64 reserve = (constrained ? 64 : 128) * mib; - const auto& options = m_sessionStreamingOptions; + const auto& options = m_sessionActive ? m_sessionStreamingOptions : m_streamingOptions; const qint64 cap = options.maxExtraBytes > 0 ? options.maxExtraBytes : (constrained ? 32 : 64) * mib; - const qint64 desired = options.allowExtraMemory && memory.available - ? std::min(cap, std::max(qint64(0), memory.availableBytes - reserve) / 4) - : 0; + const qint64 candidate + = memory.available ? std::min(cap, std::max(qint64(0), memory.availableBytes - reserve) / 4) : 0; + const qint64 desired = options.allowExtraMemory ? candidate : 0; // Pressure shrinks admission immediately; growth needs two independent samples. const qint64 grant = desired <= m_jointExtraGrantBytes ? desired : std::min(desired, m_previousMemoryCandidate); - m_previousMemoryCandidate = desired; + m_previousMemoryCandidate = candidate; if (grant != m_jointExtraGrantBytes) { m_jointExtraGrantBytes = grant; updateBackgroundNetwork(); diff --git a/src/player/PlayerController.h b/src/player/PlayerController.h index b7bb3270..b46241c3 100644 --- a/src/player/PlayerController.h +++ b/src/player/PlayerController.h @@ -443,6 +443,7 @@ class PlayerController final : public QObject { std::function m_mpvPreparationContinuation; QTimer m_progressTimer; QTimer m_networkTimer; + QTimer m_idleStreamingMemoryTimer; QVariantMap m_networkMetrics; QVariantMap m_transportCapabilities; void refreshTransportCapabilities(mpv_handle *handle); diff --git a/src/provider/ProviderRegistry.cpp b/src/provider/ProviderRegistry.cpp index 7a86a1d8..416b0991 100644 --- a/src/provider/ProviderRegistry.cpp +++ b/src/provider/ProviderRegistry.cpp @@ -117,6 +117,11 @@ namespace { || !networkNumber(point.value(QStringLiteral("ordered-bytes-per-second"))) || !networkRate(rate) || !networkNumber(point.value(QStringLiteral("ttfb-ms"))) || ttfb < 0 || ttfb > 60000) return {}; + // Native playback knows its negotiated protocol and request shape; + // unknown dimensions are reserved for the independent Qt probe prior. + if (point.value(QStringLiteral("source")).toInt() == 2 + && (http == 0 || point.value(QStringLiteral("range-bytes")).toLongLong() == 0)) + return {}; const bool manual = point.value(QStringLiteral("receive-profile")).toInt() == 1; const qint64 receive = point.value(QStringLiteral("receive-bytes")).toLongLong(); if ((manual && receive < 1024 * 1024) || (!manual && receive != 0)) diff --git a/tests/providers/SourceHubSpeedTest.cpp b/tests/providers/SourceHubSpeedTest.cpp index 8cb6674f..30c37002 100644 --- a/tests/providers/SourceHubSpeedTest.cpp +++ b/tests/providers/SourceHubSpeedTest.cpp @@ -239,7 +239,7 @@ export function createSource(configuration) { == 26'000'000 && sampleFor(learnedMelbourne, 2, 0, 0, 0) == probePrior, "protocol, receive mode/size, range size, request count and probe evidence never contaminate each other"); - for (int invalid = 0; invalid < 11; ++invalid) { + for (int invalid = 0; invalid < 12; ++invalid) { auto rejected = feedback(2, 90'000'000, 4); if (invalid == 0) rejected["observed-at-ms"] = QDateTime::currentMSecsSinceEpoch() - 600'000; @@ -270,6 +270,8 @@ export function createSource(configuration) { rejected["transport-samples"] = QVariantList { transportSample(90'000'000, 4), malformed }; } rejected["average-bytes-per-second"] = 100.0; + if (invalid == 11) + rejected["transport-samples"] = QVariantList { transportSample(90'000'000, 4, 0, 0, 0) }; hub.playback()->updatePlaybackNetworkProfile(melbourneOrigin, rejected); require(hub.playback()->playbackNetworkProfile() == learnedMelbourne, "stale, replayed, nonprimary and malformed observations cannot partially mutate learning"); @@ -292,13 +294,13 @@ export function createSource(configuration) { require(hub.playback()->playbackNetworkProfile().value("last-selected-requests").toInt() == 4, "profile reports the actual count even when a probe demonstrated a faster count"); auto actualSingle = feedback(4, 6'000'000); - actualSingle["transport-samples"] = QVariantList { transportSample(6'000'000, 1, 0, 0, 0) }; + actualSingle["transport-samples"] = QVariantList { transportSample(6'000'000, 1) }; hub.playback()->updatePlaybackNetworkProfile(njOrigin, actualSingle); - const auto actual = sampleFor(hub.playback()->playbackNetworkProfile(), 1, 0, 0, 0); + const auto actual = sampleFor(hub.playback()->playbackNetworkProfile(), 1, 11, 0, 512 * 1024); require(actual.value("source").toInt() == 2 && actual.value("ordered-bytes-per-second").toDouble() == 6'000'000, - "actual playback supersedes a probe only for its matching effective profile"); + "actual playback retains its known effective profile separately from probe priors"); require(probe(90'000'000), "later probe refresh records"); - require(sampleFor(hub.playback()->playbackNetworkProfile(), 1, 0, 0, 0) == actual + require(sampleFor(hub.playback()->playbackNetworkProfile(), 1, 11, 0, 512 * 1024) == actual && sampleFor(hub.playback()->playbackNetworkProfile(), 4, 11, 0, 512 * 1024) .value("ordered-bytes-per-second") .toDouble() diff --git a/tests/tools/StreamingCandidatesTest.py b/tests/tools/StreamingCandidatesTest.py new file mode 100644 index 00000000..d42ebf35 --- /dev/null +++ b/tests/tools/StreamingCandidatesTest.py @@ -0,0 +1,186 @@ +#!/usr/bin/env python3 +"""Exercise the streaming-candidate report at its spoolet CLI boundary.""" +import json +import os +from pathlib import Path +import stat +import subprocess +import sys +import tempfile +import unittest + +ROOT = Path(__file__).resolve().parents[2] +SCRIPT = ROOT / 'tools/find-streaming-candidates.py' +NOISE = 'provider boom https://cdn.invalid/stream.mpd?token=SECRET-TOKEN credential=abc123' + +FAKE_SPOOLET = r'''#!/usr/bin/env python3 +import json, os, sys, time + +argv = sys.argv[1:] +if len(argv) != 6 or argv[0] != '--instance' or argv[2] != 'catalog': + sys.exit(64) +library, offset, limit = argv[3], int(argv[4]), int(argv[5]) +if limit <= 0: + sys.exit(64) +with open(os.environ['SPOOL_FAKE_LOG'], 'a') as log: + log.write('{} {}\n'.format(library, offset)) +entry = json.loads(open(os.environ['SPOOL_FAKE_CATALOG']).read())['libraries'][library] +failure = entry.get('fail') if entry.get('failOffset', offset) == offset else None +if entry.get('delay'): + with open(os.environ['SPOOL_FAKE_LOG'] + '.events', 'a') as log: + log.write(json.dumps([time.monotonic(), 1]) + '\n') + time.sleep(entry['delay']) + with open(os.environ['SPOOL_FAKE_LOG'] + '.events', 'a') as log: + log.write(json.dumps([time.monotonic(), -1]) + '\n') +if failure == 'exit': + sys.stderr.write(entry['noise']) + sys.exit(3) +if failure == 'json': + sys.stdout.write(entry['noise']) + sys.exit(0) +if failure == 'ok': + json.dump({'ok': False, 'error': {'message': entry['noise']}}, sys.stdout) + sys.exit(0) +page = entry['pages'].get(str(offset), {'items': [], 'exhausted': True}) +json.dump({'ok': True, 'result': {'items': page['items'], 'offset': offset, 'total': entry['total'], + 'exhausted': page['exhausted'], 'seekable': entry['seekable']}}, sys.stdout) +''' + + +def source(bitrate=None, size=None, width=None, height=None): + entry = {} + for key, value in (('bitrate', bitrate), ('sizeBytes', size), ('width', width), ('height', height)): + if value is not None: + entry[key] = value + return entry + + +def item(item_id, sources, playable=True, **extra): + entry = {'id': item_id, 'title': 'Title ' + item_id, 'playable': playable, 'sources': sources} + entry.update(extra) + return entry + + +def library(total, seekable, pages, **extra): + entry = {'total': total, 'seekable': seekable, 'pages': pages, 'noise': NOISE} + entry.update(extra) + return entry + + +class StreamingCandidatesTest(unittest.TestCase): + def setUp(self): + self.temp = tempfile.TemporaryDirectory() + self.addCleanup(self.temp.cleanup) + self.root = Path(self.temp.name) + self.fake = self.root / 'spoolet' + self.fake.write_text(FAKE_SPOOLET) + self.fake.chmod(self.fake.stat().st_mode | stat.S_IEXEC) + self.log = self.root / 'calls.log' + + def run_tool(self, config, arguments): + catalog = self.root / 'catalog.json' + catalog.write_text(json.dumps(config)) + env = dict(os.environ, SPOOL_FAKE_CATALOG=str(catalog), SPOOL_FAKE_LOG=str(self.log)) + return subprocess.run([sys.executable, str(SCRIPT), '--spoolet', str(self.fake), *arguments], + capture_output=True, text=True, env=env) + + def report(self, result): + self.assertEqual(result.returncode, 0, result.stderr) + return json.loads(result.stdout) + + def calls(self): + return self.log.read_text().split() if self.log.exists() else [] + + def test_parallel_pages_rank_all_rows_without_fetching_past_total(self): + rows = [item(str(i), [source(1000000 + i, i + 1, 1920, 1080)], url=NOISE) + for i in range(350)] + config = {'libraries': {'movies': library(350, True, { + str(offset): {'items': rows[offset:offset + 100], 'exhausted': offset + 100 >= 350} + for offset in range(0, 350, 100)}, delay=.1)}} + result = self.run_tool(config, ['--instance', 'acct-1', '--library', 'movies', '--top', '3', '--workers', '2']) + report = self.report(result) + self.assertEqual([r['id'] for r in report['candidates']], ['349', '348', '347']) + self.assertEqual(report['libraries'][0], {'library': 'movies', 'scanned': 350, + 'total': 350, 'unknownBitrate': 0, 'complete': True}) + calls = self.log.read_text().splitlines() + self.assertEqual(set(calls), {'movies 0', 'movies 100', 'movies 200', 'movies 300'}) + self.assertEqual(len(calls), 4) + active = peak = 0 + for _, change in sorted(json.loads(line) for line in Path(str(self.log) + '.events').read_text().splitlines()): + active += change + peak = max(peak, active) + self.assertLessEqual(peak, 2, 'catalog scan exceeded its concurrent provider operation limit') + self.assertEqual(active, 0) + self.assertNotIn(NOISE, result.stdout + result.stderr) + self.assertEqual(set(report['candidates'][0]), + {'id', 'title', 'library', 'bitrate', 'sizeBytes', 'width', 'height'}) + + def test_short_provider_pages_do_not_skip_rows(self): + config = {'libraries': {'movies': library(3, True, { + str(i): {'items': [item(str(i), [source(i + 1, 100)])], 'exhausted': i == 2} + for i in range(3)})}} + report = self.report(self.run_tool(config, ['--instance', 'acct', '--library', 'movies'])) + self.assertTrue(report['libraries'][0]['complete']) + self.assertEqual(report['libraries'][0]['scanned'], 3) + self.assertEqual([r['id'] for r in report['candidates']], ['2', '1', '0']) + + def test_cap_unknown_bitrate_and_missing_rows_prevent_complete_claims(self): + cases = [ + (library(2, True, {'0': {'items': [item('a', [source(100)])], 'exhausted': False}}), + ['--max-pages', '1']), + (library(1, False, {'0': {'items': [item('a', [])], 'exhausted': True}}), []), + (library(2, True, {'0': {'items': [item('a', [source(100)])], 'exhausted': True}}), []), + (library(200, False, {'0': {'items': [item('a', [source(100)])], 'exhausted': False}}), []), + ] + for data, arguments in cases: + with self.subTest(arguments=arguments, total=data['total']): + report = self.report(self.run_tool({'libraries': {'movies': data}}, + ['--instance', 'acct', '--library', 'movies', *arguments])) + self.assertFalse(report['libraries'][0]['complete']) + + def test_libraries_deduplication_and_strongest_source(self): + config = {'libraries': { + 'movies': library(1, True, {'0': {'items': [item('a', [source(1), source(10, 20)])], + 'exhausted': True}}), + 'shows': library(1, True, {'0': {'items': [item('b', [source(5)])], 'exhausted': True}})}} + report = self.report(self.run_tool(config, + ['--instance', 'acct', '--library', 'movies', '--library', 'shows'])) + self.assertEqual([r['id'] for r in report['candidates']], ['a', 'b']) + self.assertEqual(report['candidates'][0]['bitrate'], 10) + self.assertTrue(all(r['complete'] for r in report['libraries'])) + duplicate = library(2, True, { + '0': {'items': [item('a', [source(10)])], 'exhausted': False}, + '1': {'items': [item('a', [source(20)])], 'exhausted': True}}) + report = self.report(self.run_tool({'libraries': {'movies': duplicate}}, + ['--instance', 'acct', '--library', 'movies'])) + self.assertFalse(report['libraries'][0]['complete']) + self.assertEqual(len(report['candidates']), 1) + + def test_later_failure_is_not_hidden_by_an_earlier_terminal_reply(self): + rows = [item(str(i), [source(i + 1)]) for i in range(200)] + data = library(300, True, { + '0': {'items': rows[:100], 'exhausted': False}, + '100': {'items': rows[100:], 'exhausted': True}}, fail='exit', failOffset=200) + result = self.run_tool({'libraries': {'movies': data}}, + ['--instance', 'acct', '--library', 'movies', '--workers', '2']) + self.assertNotEqual(result.returncode, 0) + self.assertEqual(result.stdout, '') + self.assertEqual(result.stderr.strip(), 'provider read failed') + + def test_read_failure_exits_nonzero_without_provider_detail(self): + for failure in ('exit', 'json', 'ok'): + with self.subTest(failure=failure): + config = {'libraries': {'movies': library(1, True, {}, fail=failure)}} + result = self.run_tool(config, ['--instance', 'acct', '--library', 'movies']) + self.assertNotEqual(result.returncode, 0) + self.assertEqual(result.stdout, '') + self.assertEqual(result.stderr.strip(), 'provider read failed') + self.assertNotIn(NOISE, result.stderr) + result = subprocess.run([sys.executable, str(SCRIPT), '--spoolet', str(self.root / 'missing'), + '--instance', 'acct', '--library', 'movies'], capture_output=True, text=True) + self.assertNotEqual(result.returncode, 0) + self.assertEqual(result.stderr.strip(), 'provider read failed') + + +if __name__ == '__main__': + unittest.main() diff --git a/tests/tools/StreamingDependenciesTest.py b/tests/tools/StreamingDependenciesTest.py index 3db2e0da..4029e96a 100644 --- a/tests/tools/StreamingDependenciesTest.py +++ b/tests/tools/StreamingDependenciesTest.py @@ -6,6 +6,7 @@ from pathlib import Path import shutil import subprocess +import sys import tarfile import tempfile import unittest @@ -20,7 +21,8 @@ def setUp(self): self.addCleanup(self.temp.cleanup) self.root = Path(self.temp.name) for relative in ('tools/lib/manifest-sources.sh', 'tools/prepare-streaming-sources.sh', - 'tools/streaming-fingerprint.py', 'tools/cmake/StreamingDependencies.cmake'): + 'tools/streaming-fingerprint.py', 'tools/cmake/StreamingDependencies.cmake', + 'tools/cmake/QuicBatchingProbe/CMakeLists.txt'): target = self.root / relative target.parent.mkdir(parents=True, exist_ok=True) shutil.copyfile(ROOT / relative, target) @@ -89,6 +91,51 @@ def identity(target): wrapper.write_text('changed') self.assertNotEqual(initial, identity('arm:28:static')) + @unittest.skipUnless(shutil.which('ninja'), 'Ninja is required by the production dependency builder') + def test_dependency_builder_stops_on_first_configure_failure_even_inside_conditional(self): + sources = self.root / 'sources' + for name in NAMES[1:]: + source = sources / name + source.mkdir(parents=True) + source.joinpath('CMakeLists.txt').write_text('cmake_minimum_required(VERSION 3.20)\n' + 'project(FailureFixture NONE)\n' + + ('message(FATAL_ERROR "fixture configuration rejected")\n' if name == 'nghttp2' + else 'file(WRITE "${CMAKE_BINARY_DIR}/entered" "configured")\n')) + builds = self.root / 'builds' + # Conditional callers suppress bash errexit inside functions. The owner + # must propagate the failing configure command itself, before siblings. + result = subprocess.run(['bash', '-c', + 'set -e; ROOT="$1"; source "$ROOT/tools/lib/streaming-build.sh"; ' + 'if build_streaming_http "$2" "$3" "$4" OFF; then exit 99; else exit "$?"; fi', + 'bash', str(ROOT), str(sources), str(builds), str(self.root / 'prefix')], + capture_output=True, text=True) + self.assertNotEqual(result.returncode, 0) + self.assertNotEqual(result.returncode, 99) + self.assertIn('fixture configuration rejected', result.stdout + result.stderr) + self.assertFalse((builds / 'nghttp3').exists()) + + def test_batching_metadata_tracks_actual_target_compile_capability(self): + source = self.root / 'curl' + (source / 'lib').mkdir(parents=True) + (source / 'include').mkdir() + build = self.root / 'curl-build' + (build / 'lib').mkdir(parents=True) + metadata = self.root / 'libcurl.pc' + metadata.write_text('Name: test-curl\nVersion: 1\n') + setup = source / 'lib/curl_setup.h' + for available in (True, False): + setup.write_text('#include \n#define HAVE_NETINET_UDP_H 1\n' + '#define USE_NGTCP2 1\n#define USE_NGHTTP3 1\n#define HAVE_SENDMSG 1\n' + + ('#define HAVE_SENDMMSG 1\n' if available else '')) + configured = subprocess.run(['cmake', '-S', str(ROOT / 'tools/cmake/QuicBatchingProbe'), + '-B', str(self.root / 'probe'), '-DSTREAMING_CURL_SOURCE=' + str(source), + '-DSTREAMING_CURL_BUILD=' + str(build), '-DSTREAMING_INSTALLED_PC=' + str(metadata)], + capture_output=True, text=True) + self.assertEqual(configured.returncode, 0, configured.stdout + configured.stderr) + expected = '1' if available and sys.platform.startswith('linux') else '0' + self.assertIn('spool_quic_batching=' + expected, metadata.read_text()) + self.assertEqual(metadata.read_text().count('spool_quic_batching='), 1) + def test_cmake_policy_builds_selected_library_and_requires_protocols(self): source = self.root / 'project' source.mkdir() @@ -117,7 +164,7 @@ def test_cmake_policy_builds_selected_library_and_requires_protocols(self): '-C', str(ROOT / 'tools/cmake/StreamingDependencies.cmake')], capture_output=True, text=True) self.assertEqual(result.returncode, 0, result.stdout + result.stderr) subprocess.run(['cmake', '--build', str(build)], check=True, capture_output=True) - extension = '.so' if shared == 'ON' else '.a' + extension = ('.dylib' if sys.platform == 'darwin' else '.so') if shared == 'ON' else '.a' self.assertTrue((build / ('libsample' + extension)).is_file()) result = subprocess.run(['cmake', '-DSTREAMING_DEPENDENCY=bad', '-DSTREAMING_SHARED=ON', '-P', str(ROOT / 'tools/cmake/StreamingDependencies.cmake')], capture_output=True) diff --git a/tests/transport/protocols.py b/tests/transport/protocols.py index 07b65064..ac3e4470 100644 --- a/tests/transport/protocols.py +++ b/tests/transport/protocols.py @@ -7,6 +7,9 @@ import argparse import array import importlib.util +import http.client +import hashlib +import ssl import json from pathlib import Path import shutil @@ -30,6 +33,8 @@ def main(): parser.add_argument('--performance', action='store_true') parser.add_argument('--output', type=Path) args = parser.parse_args() + if args.output: + args.output.parent.mkdir(parents=True, exist_ok=True) for tool in ['nginx', 'openssl']: if not shutil.which(tool): parser.error(f'{tool} required: run in nix develop .#native') @@ -56,13 +61,22 @@ def main(): '-days', '1', '-subj', '/CN=127.0.0.1', '-addext', 'subjectAltName=IP:127.0.0.1'], check=True, capture_output=True) tls, tcp = free_port('127.0.0.1'), free_port('127.0.0.1') + broken_quic = free_port('127.0.0.1') while tls == tcp: tcp = free_port('127.0.0.1') - (root / 'nginx.conf').write_text(f'''worker_processes 1; + while broken_quic in (tls, tcp): + broken_quic = free_port('127.0.0.1') + (root / 'nginx.conf').write_text(f'''user root root; +worker_processes 1; pid {root}/nginx.pid; error_log {root}/error.log info; events {{ worker_connections 128; }} http {{ + client_body_temp_path {root}/client_body; + proxy_temp_path {root}/proxy; + fastcgi_temp_path {root}/fastcgi; + uwsgi_temp_path {root}/uwsgi; + scgi_temp_path {root}/scgi; log_format protocols '$server_port $server_protocol $status $http_range'; access_log {root}/access.log protocols; ssl_certificate {root}/cert.pem; @@ -78,6 +92,12 @@ def main(): add_header Alt-Svc 'h3=":{tls}"'; root {root}; }} + server {{ + listen 127.0.0.1:{broken_quic} ssl; + http2 on; + add_header Alt-Svc 'h3=":{broken_quic}"'; + root {root}; + }} server {{ listen 127.0.0.1:{tcp} ssl; http2 on; @@ -86,7 +106,7 @@ def main(): }} }} ''') - nginx = subprocess.Popen(['nginx', '-p', str(root), '-c', str(root / 'nginx.conf'), + nginx = subprocess.Popen(['nginx', '-e', 'stderr', '-p', str(root), '-c', str(root / 'nginx.conf'), '-g', 'daemon off;'], stdout=subprocess.DEVNULL, stderr=subprocess.PIPE) try: @@ -116,6 +136,11 @@ def main(): capabilities = player.get('curl-transport-capabilities') if not capabilities or not capabilities.get('http2') or not capabilities.get('http3'): raise AssertionError('production libmpv must advertise HTTP2 and HTTP3') + player.configure(1, max_requests=4, fixed_requests=count, + http_mode={'http1': 2, 'tcp': 1, 'prefer-h3': 3}[mode], + receive_mode=2, receive_bytes=4 << 20) + player.check(player.transport_control({'format': 2, 'op': 1, 'playback-epoch': 1, + 'joint-extra-grant-bytes': 64 << 20, 'background-network': False}), 'grant') result = player.play(f'https://127.0.0.1:{port}/fixture.wav', timeout=180) finally: player.close() @@ -152,6 +177,9 @@ def main(): 'ao-pcm-waveheader': 'no', 'audio-format': 's16', 'curl-http-mode': 'tcp', 'curl-fixed-requests': '1', 'curl-max-retries': '0'}) try: + player.configure(1, max_requests=4, fixed_requests=1, http_mode=1) + player.check(player.transport_control({'format': 2, 'op': 1, 'playback-epoch': 1, + 'joint-extra-grant-bytes': 64 << 20, 'background-network': False}), 'grant') result = player.play(f'https://127.0.0.1:{reset.port}/fixture.wav', timeout=30) finally: player.close() @@ -165,8 +193,86 @@ def main(): for row in sample.get('streams', [])), default=0) if fallback_count < 1: raise AssertionError('HTTP2 reset downgrade was not reported') + h2_connections = reset.protocols.count('h2') + second = transport.Player(args.libmpv, **{'tls-ca-file': root / 'cert.pem', + 'curl-http-mode': 'tcp', 'curl-fixed-requests': '1'}) + try: + second.play(f'https://127.0.0.1:{reset.port}/fixture.wav', timeout=30) + finally: + second.close() + if reset.protocols.count('h2') != h2_connections: + raise AssertionError('new playback core retried cooled-down failed HTTP2 origin') print(json.dumps({'scenario': 'h2-reset-with-zero-retry-budget', - 'http-fallbacks': fallback_count, 'pcm-bytes': len(expected)}), flush=True) + 'http-fallbacks': fallback_count, 'cooldown-reused': True, + 'pcm-bytes': len(expected)}), flush=True) + from quic_origin import QuicFailureOrigin + # Both protocol paths identify the same representation. Obtain the + # fixture's real validator before serving it over a second stack. + metadata = http.client.HTTPSConnection('127.0.0.1', broken_quic, + context=ssl.create_default_context(cafile=root / 'cert.pem')) + try: + metadata.request('HEAD', '/fixture.wav') + response = metadata.getresponse() + etag = response.getheader('ETag') + if response.status != 200 or not etag: + raise AssertionError('TCP fixture did not supply a strong representation validator') + response.read() + finally: + metadata.close() + with QuicFailureOrigin(root, broken_quic, header + expected, etag) as broken: + output = root / 'quic-reset.pcm' + player = transport.Player(args.libmpv, **{ + 'tls-ca-file': root / 'cert.pem', 'ao': 'pcm', 'ao-pcm-file': output, + 'ao-pcm-waveheader': 'no', 'audio-format': 's16', + 'curl-http-mode': 'prefer-h3', 'curl-fixed-requests': '1', 'curl-max-retries': '0'}) + try: + player.configure(1, max_requests=4, fixed_requests=1, http_mode=3) + player.check(player.transport_control({'format': 2, 'op': 1, 'playback-epoch': 1, + 'joint-extra-grant-bytes': 64 << 20, 'background-network': False}), 'grant') + result = player.play(f'https://127.0.0.1:{broken_quic}/fixture.wav', timeout=30) + # Reuse the process-wide origin cooldown in a new core. + # This first core must finish before creating its successor. + finally: + player.close() + actual = output.read_bytes() + if actual != expected or not broken.requests: + first_difference = next((index for index, (left, right) in enumerate(zip(actual, expected)) + if left != right), min(len(actual), len(expected))) + metric_keys = ['effective-http-version', 'http-fallbacks', 'last-reason', + 'state', 'retained-bytes', 'readable-bytes'] + print(json.dumps({'scenario': 'h3-failure-diagnostic', 'actual-bytes': len(actual), + 'expected-bytes': len(expected), 'first-difference': first_difference, + 'actual-sha256': hashlib.sha256(actual).hexdigest(), + 'expected-sha256': hashlib.sha256(expected).hexdigest(), + 'quic-ranges': broken.requests, + 'stream-samples': [{key: row.get(key) for key in metric_keys} + for _, sample in result['samples'] for row in sample.get('streams', [])][-64:], + 'fixture-requests': [line for line in (root / 'access.log').read_text().splitlines() + if line.startswith(f'{broken_quic} ')][-64:]}), flush=True) + artifact = args.output.parent / 'quic-reset-failure.pcm' if args.output else None + if artifact: + artifact.write_bytes(actual) + if not broken.requests: + raise AssertionError('HTTP3 failure fixture was never requested over QUIC') + raise AssertionError('HTTP3 connection failure did not preserve exact PCM') + fallback_count = max((row.get('http-fallbacks', 0) for _, sample in result['samples'] + for row in sample.get('streams', [])), default=0) + if fallback_count < 1: + raise AssertionError('HTTP3 connection failure was not reported as a downgrade') + if f'{broken_quic} HTTP/2.0 206 bytes=' not in (root / 'access.log').read_text(): + raise AssertionError('HTTP3 connection failure did not retry over HTTP2') + before = len(broken.requests) + second = transport.Player(args.libmpv, **{'tls-ca-file': root / 'cert.pem', + 'curl-http-mode': 'prefer-h3', 'curl-fixed-requests': '1'}) + try: + second.play(f'https://127.0.0.1:{broken_quic}/fixture.wav', timeout=30) + finally: + second.close() + if len(broken.requests) != before: + raise AssertionError('new playback core retried cooled-down failed HTTP3 origin') + print(json.dumps({'scenario': 'h3-connection-failure-with-zero-retry-budget', + 'http-fallbacks': fallback_count, 'cooldown-reused': True, + 'pcm-bytes': len(expected)}), flush=True) finally: nginx.terminate() try: diff --git a/tests/transport/quic_origin.py b/tests/transport/quic_origin.py new file mode 100644 index 00000000..63305d9f --- /dev/null +++ b/tests/transport/quic_origin.py @@ -0,0 +1,91 @@ +"""HTTP3 origin closing a QUIC connection after partial valid media bytes. + +TCP on the same port belongs to nginx and serves the identical representation. +The production client must retry over TCP, with its TLS validation intact. +""" +import asyncio +import re +import threading + + +class QuicFailureOrigin: + def __init__(self, root, port, payload, etag): + self.root, self.port, self.payload, self.etag = root, port, payload, etag + self.requests = [] + self.ready = threading.Event() + self.error = None + self.loop = asyncio.new_event_loop() + self.thread = threading.Thread(target=self.run, daemon=True) + + def __enter__(self): + import aioquic # Fail in the caller, not an unobserved worker thread. + self.thread.start() + if not self.ready.wait(timeout=5): + raise AssertionError('QUIC fixture did not become ready') + if self.error: + raise self.error + return self + + def __exit__(self, *_): + self.loop.call_soon_threadsafe(self.loop.stop) + self.thread.join(timeout=5) + + def run(self): + from aioquic.asyncio import serve + from aioquic.asyncio.protocol import QuicConnectionProtocol + from aioquic.h3.connection import H3_ALPN, H3Connection + from aioquic.h3.events import HeadersReceived + from aioquic.quic.configuration import QuicConfiguration + from aioquic.quic.events import ProtocolNegotiated + origin = self + + class Protocol(QuicConnectionProtocol): + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) + self.http = None + self.failed = False + + def quic_event_received(self, event): + if isinstance(event, ProtocolNegotiated): + self.http = H3Connection(self._quic) + if self.http is None: + return + for request in self.http.handle_event(event): + if not isinstance(request, HeadersReceived) or self.failed: + continue + values = dict(request.headers) + match = re.fullmatch(rb'bytes=(\d+)-(\d*)', values.get(b'range', b'')) + start = int(match[1]) if match else 0 + end = min(int(match[2]) + 1 if match and match[2] else len(origin.payload), len(origin.payload)) + origin.requests.append((start, end)) + self.http.send_headers(request.stream_id, [ + (b':status', b'206'), (b'content-type', b'audio/wav'), + (b'etag', origin.etag.encode()), (b'accept-ranges', b'bytes'), + (b'content-length', str(end - start).encode()), + (b'content-range', f'bytes {start}-{end - 1}/{len(origin.payload)}'.encode())]) + self.http.send_data(request.stream_id, origin.payload[start:min(start + 16384, end)], end_stream=False) + self.transmit() + self.failed = True + # A real HTTP3 connection error, not an HTTP error status. + origin.loop.call_later(.05, lambda: self.close(error_code=0x102, + reason_phrase='fixture connection failure')) + + async def start(): + configuration = QuicConfiguration(is_client=False, alpn_protocols=H3_ALPN) + configuration.load_cert_chain(self.root / 'cert.pem', self.root / 'key.pem') + return await serve('127.0.0.1', self.port, configuration=configuration, create_protocol=Protocol) + + asyncio.set_event_loop(self.loop) + server = None + try: + server = self.loop.run_until_complete(start()) + self.ready.set() + self.loop.run_forever() + except Exception as error: + self.error = error + self.ready.set() + finally: + if server: + server.close() + self.loop.run_until_complete(asyncio.sleep(.1)) + self.loop.close() diff --git a/tools/android/build-dependencies.sh b/tools/android/build-dependencies.sh index d74bc111..13197783 100755 --- a/tools/android/build-dependencies.sh +++ b/tools/android/build-dependencies.sh @@ -199,6 +199,7 @@ build_curl() { local stamp="$PREFIX/lib/.spool-curl-configuration" pin pin="$(python3 "$ROOT/tools/streaming-fingerprint.py" --root "$ROOT" --target "$ABI:$API:$($CC --version):static-http" --wrapper "${BASH_SOURCE[0]}" --wrapper "$ROOT/tools/lib/streaming-build.sh")" [[ -f "$PREFIX/lib/libcurl.a" && -f "$stamp" && "$(<"$stamp")" == "$pin" ]] && return + rm -rf "$BUILD_ROOT/streaming" source "$ROOT/tools/lib/streaming-build.sh" build_streaming_http "$SOURCE_ROOT" "$BUILD_ROOT/streaming" "$PREFIX" OFF \ -DCMAKE_TOOLCHAIN_FILE="$ANDROID_NDK_ROOT/build/cmake/android.toolchain.cmake" \ diff --git a/tools/apple/build-dependencies.sh b/tools/apple/build-dependencies.sh index d7b6b848..3968e3d1 100755 --- a/tools/apple/build-dependencies.sh +++ b/tools/apple/build-dependencies.sh @@ -96,6 +96,13 @@ cmake_cross=(-DCMAKE_SYSTEM_NAME="$APPLE_SYSTEM" -DCMAKE_OSX_SYSROOT="$APPLE_SDK # Isolated build directories retain toolchain flags; source pins are verified # above. Reconfigure every dependency rather than trusting stale install stamps. openssl_build="$BUILD_ROOT/openssl" +streaming_stamp="$PREFIX/.spool-streaming-configuration" +streaming_pin="$(python3 "$ROOT/tools/streaming-fingerprint.py" --root "$ROOT" \ + --target "$TRIPLE:$SDKROOT:$($CC --version):static" --wrapper "${BASH_SOURCE[0]}" \ + --wrapper "$ROOT/tools/lib/streaming-build.sh")" +if [[ ! -f "$streaming_stamp" || "$(<"$streaming_stamp")" != "$streaming_pin" ]]; then + rm -rf "$openssl_build" "$BUILD_ROOT/streaming" +fi mkdir -p "$openssl_build" export CROSS_TOP="$(dirname "$SDKROOT")" export CROSS_SDK="$(basename "$SDKROOT")" @@ -114,6 +121,7 @@ build_streaming_http "$SOURCE_ROOT" "$BUILD_ROOT/streaming" "$PREFIX" OFF "${cma -DOPENSSL_INCLUDE_DIR="$PREFIX/include" -DOPENSSL_CRYPTO_LIBRARY="$PREFIX/lib/libcrypto.a" \ -DOPENSSL_SSL_LIBRARY="$PREFIX/lib/libssl.a" -DCURL_ZLIB=OFF python3 "$ROOT/tools/check-streaming-dependencies.py" --prefix "$PREFIX" --manifest "$ROOT/tools/manifests/streaming-third-party.json" +printf '%s\n' "$streaming_pin" >"$streaming_stamp" cmake -S "$SOURCE_ROOT/freetype" -B "$BUILD_ROOT/freetype" -GNinja "${cmake_cross[@]}" \ -DBUILD_SHARED_LIBS=OFF -DFT_DISABLE_ZLIB=ON -DFT_DISABLE_BZIP2=ON -DFT_DISABLE_PNG=ON -DFT_DISABLE_HARFBUZZ=ON -DFT_DISABLE_BROTLI=ON cmake --build "$BUILD_ROOT/freetype" --parallel "$JOBS" diff --git a/tools/check-streaming-dependencies.py b/tools/check-streaming-dependencies.py index 6e39eb0a..d3df11d0 100644 --- a/tools/check-streaming-dependencies.py +++ b/tools/check-streaming-dependencies.py @@ -9,14 +9,19 @@ parser = argparse.ArgumentParser(description=__doc__) parser.add_argument('--prefix', type=Path, required=True) parser.add_argument('--manifest', type=Path, required=True) +parser.add_argument('--bash', default='bash', help='Host shell for generated curl-config') +parser.add_argument('--require-native-ca', action='store_true') args = parser.parse_args() manifest = json.loads(args.manifest.read_text())['sources'] config = args.prefix / 'bin/curl-config' -features = set(subprocess.check_output(['bash', str(config), '--features'], text=True).split()) -missing = {'HTTP2', 'HTTP3', 'alt-svc'} - features +features = set(subprocess.check_output([args.bash, str(config).replace('\\', '/'), '--features'], text=True).split()) +required = {'HTTP2', 'HTTP3', 'alt-svc'} +if args.require_native_ca: + required.add('NativeCA') +missing = required - features if missing: parser.error('curl is missing required features: ' + ', '.join(sorted(missing))) -version = subprocess.check_output(['bash', str(config), '--version'], text=True).strip().split()[-1] +version = subprocess.check_output([args.bash, str(config).replace('\\', '/'), '--version'], text=True).strip().split()[-1] if version != manifest['curl']['version']: parser.error(f'curl version {version} differs from pin') for package, library in [('openssl', 'openssl'), ('nghttp2', 'libnghttp2'), diff --git a/tools/cmake/QuicBatchingProbe/CMakeLists.txt b/tools/cmake/QuicBatchingProbe/CMakeLists.txt new file mode 100644 index 00000000..0bc4e6ef --- /dev/null +++ b/tools/cmake/QuicBatchingProbe/CMakeLists.txt @@ -0,0 +1,35 @@ +cmake_minimum_required(VERSION 3.20) +project(SpoolQuicBatchingProbe C) +# Probe the exact curl configuration and target headers used by this build. +# No target executable is run, so this is equally valid for cross builds. +foreach(required STREAMING_CURL_SOURCE STREAMING_CURL_BUILD STREAMING_INSTALLED_PC) + if(NOT DEFINED ${required}) + message(FATAL_ERROR "${required} is required") + endif() +endforeach() +include(CheckCSourceCompiles) +set(CMAKE_REQUIRED_INCLUDES "${STREAMING_CURL_SOURCE}/lib;${STREAMING_CURL_SOURCE}/include;${STREAMING_CURL_BUILD}/lib") +set(CMAKE_REQUIRED_DEFINITIONS -DHAVE_CONFIG_H -DBUILDING_LIBCURL -D_GNU_SOURCE) +unset(STREAMING_QUIC_BATCHING CACHE) +check_c_source_compiles([=[ +#include "curl_setup.h" +#ifdef HAVE_NETINET_UDP_H +#include +#endif +#if !defined(__linux__) || !defined(USE_NGTCP2) || !defined(USE_NGHTTP3) || !defined(UDP_GRO) || !defined(UDP_SEGMENT) || !defined(HAVE_SENDMMSG) || !defined(HAVE_SENDMSG) +#error Curl QUIC packet batching is not compiled on this target +#endif +int main(void) { + struct mmsghdr packets[1]; + return recvmmsg(-1, packets, 1, 0, 0) + UDP_GRO + UDP_SEGMENT; +} +]=] STREAMING_QUIC_BATCHING) +if(STREAMING_QUIC_BATCHING) + set(value 1) +else() + set(value 0) + message(STATUS "quic-batching-unavailable: target curl uses the portable packet path") +endif() +file(READ "${STREAMING_INSTALLED_PC}" metadata) +string(REGEX REPLACE "\nspool_quic_batching=[^\n]*" "" metadata "${metadata}") +file(WRITE "${STREAMING_INSTALLED_PC}" "${metadata}\nspool_quic_batching=${value}\n") diff --git a/tools/cmake/StreamingDependencies.cmake b/tools/cmake/StreamingDependencies.cmake index 1fc07a24..7f62d850 100644 --- a/tools/cmake/StreamingDependencies.cmake +++ b/tools/cmake/StreamingDependencies.cmake @@ -45,6 +45,13 @@ else() streaming_bool(CURL_DISABLE_${protocol} ON) endforeach() streaming_bool(CURL_USE_OPENSSL ON) + # Curl disables pkg-config by default on Android and Apple mobile targets. + # Every wrapper supplies an isolated target-only pkg-config directory; + # use it so the NDK/SDK find-root rules do not hide the installed closure. + streaming_bool(CURL_USE_PKGCONFIG ON) + foreach(dependency NGHTTP2 NGHTTP3 NGTCP2) + streaming_bool(${dependency}_USE_STATIC_LIBS ${streaming_static}) + endforeach() streaming_bool(USE_NGHTTP2 ON) streaming_bool(USE_NGHTTP3 ON) streaming_bool(USE_NGTCP2 ON) diff --git a/tools/find-streaming-candidates.py b/tools/find-streaming-candidates.py new file mode 100755 index 00000000..1920fff7 --- /dev/null +++ b/tools/find-streaming-candidates.py @@ -0,0 +1,199 @@ +#!/usr/bin/env python3 +"""Rank catalog items as streaming candidates through the spoolet CLI. + +The report is privacy-allowlisted: item IDs and titles, numeric bitrate, size +and dimensions, plus per-library counters. Provider payloads and their errors, +stream URLs and credentials never reach stdout or stderr. +""" + +import argparse +import json +import math +import subprocess +import sys +from concurrent.futures import ThreadPoolExecutor + +PAGE_SIZE = 100 +TIMEOUT_SECONDS = 30 +READ_FAILURE = 'provider read failed' + + +class ReadFailure(Exception): + """A catalog page could not be read; provider detail stays out of output.""" + + +def bounded_int(low, high): + def parse(text): + value = int(text) + if not low <= value <= high: + raise argparse.ArgumentTypeError('expected {}..{}'.format(low, high)) + return value + + return parse + + +def positive_int(text): + value = int(text) + if value < 1: + raise argparse.ArgumentTypeError('expected a positive integer') + return value + + +def positive_number(value): + if isinstance(value, bool) or not isinstance(value, (int, float)): + return None + if not math.isfinite(value) or value <= 0: + return None + return value + + +def positive_dimension(value): + if isinstance(value, bool) or not isinstance(value, int) or value <= 0: + return None + return value + + +def strongest_source(sources): + if not isinstance(sources, list): + return None + best = None + for source in sources: + if not isinstance(source, dict): + continue + bitrate = positive_number(source.get('bitrate')) + if bitrate is None: + continue + size = positive_number(source.get('sizeBytes')) or 0 + if best is None or (bitrate, size) > (best['bitrate'], best['sizeBytes']): + best = {'bitrate': bitrate, 'sizeBytes': size, + 'width': positive_dimension(source.get('width')), + 'height': positive_dimension(source.get('height'))} + return best + + +def fetch_page(spoolet, instance, library, offset): + argv = [spoolet, '--instance', instance, 'catalog', library, str(offset), str(PAGE_SIZE)] + try: + completed = subprocess.run(argv, capture_output=True, text=True, timeout=TIMEOUT_SECONDS) + except (OSError, subprocess.SubprocessError): + raise ReadFailure() + if completed.returncode != 0: + raise ReadFailure() + try: + payload = json.loads(completed.stdout) + except ValueError: + raise ReadFailure() + if not isinstance(payload, dict) or payload.get('ok') is not True: + raise ReadFailure() + result = payload.get('result') + items = result.get('items') if isinstance(result, dict) else None + if (not isinstance(items, list) or len(items) > PAGE_SIZE + or result.get('offset') != offset): + raise ReadFailure() + return items, result + + +def scan_library(args, library): + seen = set() + candidates = [] + scanned = 0 + unknown_bitrate = 0 + + def consume(items): + nonlocal scanned, unknown_bitrate + for item in items: + if not isinstance(item, dict): + continue + item_id = item.get('id') + if not isinstance(item_id, str) or item_id in seen: + continue + seen.add(item_id) + scanned += 1 + best = strongest_source(item.get('sources')) + if best is None: + unknown_bitrate += 1 + continue + if not item.get('playable'): + continue + title = item.get('title') + candidates.append({'id': item_id, 'title': title if isinstance(title, str) else '', + 'library': library, 'bitrate': best['bitrate'], 'sizeBytes': best['sizeBytes'], + 'width': best['width'], 'height': best['height']}) + + items, result = fetch_page(args.spoolet, args.instance, library, 0) + total = result.get('total') + if isinstance(total, bool) or not isinstance(total, int) or total < 0: + total = None + exhausted = result.get('exhausted') is True + pages = 1 + inconsistent = total is not None and len(items) > total + stride = len(items) + consume(items) + if not exhausted and result.get('seekable') is True and stride > 0: + offset = stride + with ThreadPoolExecutor(max_workers=args.workers) as pool: + while not exhausted and pages < args.max_pages: + batch = [offset + stride * step + for step in range(min(args.workers, args.max_pages - pages)) + if total is None or offset + stride * step < total] + if not batch: + break + pending = [pool.submit(fetch_page, args.spoolet, args.instance, library, page_offset) + for page_offset in batch] + # Observe every request, including failures after a terminal page. + # They may reveal an unstable inventory or inconsistent paging. + for page_offset, future in zip(batch, pending): + page_items, page_result = future.result() + pages += 1 + page_total = page_result.get('total') + if total is not None and page_total != total: + inconsistent = True + terminal = page_result.get('exhausted') is True + if len(page_items) < stride and not terminal: + inconsistent = True + if terminal and total is not None and page_offset + len(page_items) < total: + inconsistent = True + consume(page_items) + exhausted |= terminal + offset = batch[-1] + stride + covered = total is not None and scanned == total + summary = {'library': library, 'scanned': scanned, 'total': total, 'unknownBitrate': unknown_bitrate, + 'complete': exhausted and covered and not inconsistent and unknown_bitrate == 0} + return candidates, summary + + +def ranking_key(entry): + return (-entry['bitrate'], -entry['sizeBytes'], entry['id']) + + +def parse_args(argv): + parser = argparse.ArgumentParser(description='Rank catalog items by stream bitrate.') + parser.add_argument('--spoolet', required=True, help='spoolet executable to drive') + parser.add_argument('--instance', required=True, help='account instance id') + parser.add_argument('--library', action='append', required=True, help='library to scan; repeatable') + parser.add_argument('--workers', type=bounded_int(1, 4), default=4) + parser.add_argument('--max-pages', type=positive_int, default=1000) + parser.add_argument('--top', type=positive_int, default=10) + return parser.parse_args(argv) + + +def main(argv): + args = parse_args(argv) + report = {'candidates': [], 'libraries': []} + try: + for library in args.library: + candidates, summary = scan_library(args, library) + report['candidates'].extend(candidates) + report['libraries'].append(summary) + except ReadFailure: + print(READ_FAILURE, file=sys.stderr) + return 1 + report['candidates'].sort(key=ranking_key) + report['candidates'] = report['candidates'][:args.top] + json.dump(report, sys.stdout, indent=2, sort_keys=True) + print() + return 0 + + +if __name__ == '__main__': + sys.exit(main(sys.argv[1:])) diff --git a/tools/lib/manifest-sources.sh b/tools/lib/manifest-sources.sh index 6aec5fd3..0b638c94 100644 --- a/tools/lib/manifest-sources.sh +++ b/tools/lib/manifest-sources.sh @@ -8,6 +8,11 @@ if [ -z "$MANIFEST_PYTHON" ]; then exit 1 fi +# macOS ships a patch implementation with different fuzzy-hunk behavior. +# The Apple build installs GNU patch explicitly; use it for the same pinned +# source transformations that run on Linux, falling back elsewhere. +MANIFEST_PATCH="${MANIFEST_PATCH:-$(command -v gpatch || command -v patch || true)}" + manifest_source_field() { local manifest="$1" local source_name="$2" @@ -15,6 +20,7 @@ manifest_source_field() { "$MANIFEST_PYTHON" -c ' import json import sys +sys.stdout.reconfigure(newline="\n") with open(sys.argv[1], encoding="utf-8") as handle: data = json.load(handle) @@ -29,6 +35,7 @@ manifest_qt_field() { "$MANIFEST_PYTHON" -c ' import json import sys +sys.stdout.reconfigure(newline="\n") with open(sys.argv[1], encoding="utf-8") as handle: data = json.load(handle) @@ -42,6 +49,7 @@ manifest_qt_module_sha256() { "$MANIFEST_PYTHON" -c ' import json import sys +sys.stdout.reconfigure(newline="\n") with open(sys.argv[1], encoding="utf-8") as handle: data = json.load(handle) @@ -61,6 +69,7 @@ manifest_tool_field() { "$MANIFEST_PYTHON" -c ' import json import sys +sys.stdout.reconfigure(newline="\n") with open(sys.argv[1], encoding="utf-8") as handle: data = json.load(handle) @@ -74,6 +83,7 @@ manifest_json_array() { "$MANIFEST_PYTHON" -c ' import json import sys +sys.stdout.reconfigure(newline="\n") with open(sys.argv[1], encoding="utf-8") as handle: data = json.load(handle) @@ -88,6 +98,7 @@ manifest_source_patches() { "$MANIFEST_PYTHON" -c ' import json import sys +sys.stdout.reconfigure(newline="\n") with open(sys.argv[1], encoding="utf-8") as handle: data = json.load(handle) @@ -102,6 +113,7 @@ manifest_vendored_sources() { "$MANIFEST_PYTHON" -c ' import json import sys +sys.stdout.reconfigure(newline="\n") with open(sys.argv[1], encoding="utf-8") as handle: data = json.load(handle) @@ -172,9 +184,9 @@ prepare_manifest_source() { while IFS= read -r patch; do [[ -n "$patch" ]] || continue - if ! patch -d "$destination" -p1 --dry-run --reverse --silent \ + if ! "$MANIFEST_PATCH" -d "$destination" -p1 --dry-run --reverse --silent \ <"$root/$patch" >/dev/null 2>&1; then - patch -d "$destination" -p1 <"$root/$patch" + "$MANIFEST_PATCH" -d "$destination" -p1 <"$root/$patch" fi done < <(manifest_source_patches "$manifest" "$source_name") } @@ -188,6 +200,7 @@ toolchain_field() { "$MANIFEST_PYTHON" -c ' import json import sys +sys.stdout.reconfigure(newline="\n") with open(sys.argv[1] + "/tools/manifests/toolchain.json", encoding="utf-8") as handle: value = json.load(handle) diff --git a/tools/lib/streaming-build.sh b/tools/lib/streaming-build.sh index a6369c95..05f8ebc5 100644 --- a/tools/lib/streaming-build.sh +++ b/tools/lib/streaming-build.sh @@ -8,8 +8,11 @@ build_streaming_http() { cmake -S "$sources/$dependency" -B "$builds/$dependency" -GNinja \ -DSTREAMING_DEPENDENCY="$dependency" -DSTREAMING_SHARED="$shared" \ -C "$ROOT/tools/cmake/StreamingDependencies.cmake" \ - -DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_INSTALL_PREFIX="$prefix" "$@" - cmake --build "$builds/$dependency" --parallel "${JOBS:-4}" - cmake --install "$builds/$dependency" + -DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_INSTALL_PREFIX="$prefix" "$@" || return + cmake --build "$builds/$dependency" --parallel "${JOBS:-4}" || return + cmake --install "$builds/$dependency" || return done + cmake -S "$ROOT/tools/cmake/QuicBatchingProbe" -B "$builds/quic-batching-probe" -GNinja \ + "$@" -DSTREAMING_CURL_SOURCE="$sources/curl" -DSTREAMING_CURL_BUILD="$builds/curl" \ + -DSTREAMING_INSTALLED_PC="${DESTDIR:-}$prefix/lib/pkgconfig/libcurl.pc" || return } diff --git a/tools/patches/curl-apple-mobile-sectrust.patch b/tools/patches/curl-apple-mobile-sectrust.patch index b61f7fd4..54c6ecde 100644 --- a/tools/patches/curl-apple-mobile-sectrust.patch +++ b/tools/patches/curl-apple-mobile-sectrust.patch @@ -1,10 +1,16 @@ --- a/CMakeLists.txt +++ b/CMakeLists.txt -@@ -815,6 +815,8 @@ +@@ -824,12 +824,14 @@ + endif() + list(APPEND CURL_LIBS "-framework CoreFoundation") +- ++ - find_library(CORESERVICES_FRAMEWORK NAMES "CoreServices") - mark_as_advanced(CORESERVICES_FRAMEWORK) - if(NOT CORESERVICES_FRAMEWORK) - message(FATAL_ERROR "CoreServices framework not found") +- endif() +- list(APPEND CURL_LIBS "-framework CoreServices") + if(CMAKE_SYSTEM_NAME STREQUAL "Darwin") + find_library(CORESERVICES_FRAMEWORK NAMES "CoreServices") + mark_as_advanced(CORESERVICES_FRAMEWORK) @@ -12,5 +18,8 @@ + message(FATAL_ERROR "CoreServices framework not found") + endif() + list(APPEND CURL_LIBS "-framework CoreServices") - endif() -- list(APPEND CURL_LIBS "-framework CoreServices") ++ endif() + endif() +- ++ + if(CURL_USE_OPENSSL) diff --git a/tools/prepare-streaming-sources.sh b/tools/prepare-streaming-sources.sh index 0be4071f..83c18922 100755 --- a/tools/prepare-streaming-sources.sh +++ b/tools/prepare-streaming-sources.sh @@ -18,7 +18,7 @@ MANIFEST="${MANIFEST:-$ROOT/tools/manifests/streaming-third-party.json}" source "$ROOT/tools/lib/manifest-sources.sh" # A changed patch must re-extract pristine source; reverse-applying an older # patch cannot establish that the new patch's preimage still exists. -fingerprint="$(python3 "$ROOT/tools/streaming-fingerprint.py" --root "$ROOT" --manifest "$MANIFEST" --target sources)" +fingerprint="$("$MANIFEST_PYTHON" "$ROOT/tools/streaming-fingerprint.py" --root "$ROOT" --manifest "$MANIFEST" --target sources)" for name in openssl nghttp2 nghttp3 ngtcp2 curl; do marker="$OUTPUT/$name/.spool-preparation-fingerprint" if [[ -f "$OUTPUT/$name/.jellyfin-source-sha256" && ( ! -f "$marker" || "$(<"$marker")" != "$fingerprint" ) ]]; then diff --git a/tools/streaming-fingerprint.py b/tools/streaming-fingerprint.py index 1100fcea..3f8f1432 100644 --- a/tools/streaming-fingerprint.py +++ b/tools/streaming-fingerprint.py @@ -15,6 +15,7 @@ manifest = args.manifest or root / 'tools/manifests/streaming-third-party.json' files = [manifest, root / 'tools/prepare-streaming-sources.sh', root / 'tools/lib/manifest-sources.sh', root / 'tools/cmake/StreamingDependencies.cmake', + root / 'tools/cmake/QuicBatchingProbe/CMakeLists.txt', Path(__file__).resolve(), *args.wrapper] for source in json.loads(manifest.read_text())['sources'].values(): files.extend(root / patch for patch in source.get('patches', [])) diff --git a/tools/webos-native/build-curl.sh b/tools/webos-native/build-curl.sh index 9abdf87e..c0415d09 100755 --- a/tools/webos-native/build-curl.sh +++ b/tools/webos-native/build-curl.sh @@ -21,7 +21,6 @@ JOBS="$(recommended_parallel_jobs 512 1024)" bash "$ROOT/tools/prepare-streaming-sources.sh" --root "$ROOT" --output "$SRC_ROOT" [[ "$PHASE" != fetch ]] || exit 0 ensure_webos_sdk_host_tools "$SDK_ROOT" -export PATH="$SDK_ROOT/bin:$PATH" export PKG_CONFIG_PATH="$PREFIX/lib/pkgconfig" export PKG_CONFIG_LIBDIR="$PREFIX/lib/pkgconfig:$SYSROOT/usr/lib/pkgconfig" export PKG_CONFIG_SYSROOT_DIR="$SYSROOT" @@ -34,7 +33,7 @@ mkdir -p "$BUILD_ROOT/openssl" cd "$BUILD_ROOT/openssl" "$SRC_ROOT/openssl/Configure" linux-armv4 shared \ no-apps no-docs no-tests no-comp no-dtls no-srp no-ssl3 no-weak-ssl-ciphers \ - --prefix="$TARGET_PREFIX" --libdir=lib --cross-compile-prefix=arm-webos-linux-gnueabi- \ + --prefix="$TARGET_PREFIX" --libdir=lib --cross-compile-prefix="$SDK_ROOT/bin/arm-webos-linux-gnueabi-" \ "$(webos_tune_cflags)" make -j"$JOBS" make DESTDIR="$SYSROOT" install_sw diff --git a/tools/windows/build-streaming-dependencies.ps1 b/tools/windows/build-streaming-dependencies.ps1 index 91661da1..1c7291f2 100644 --- a/tools/windows/build-streaming-dependencies.ps1 +++ b/tools/windows/build-streaming-dependencies.ps1 @@ -8,14 +8,26 @@ $cygpath = Join-Path $msys 'usr\bin\cygpath.exe' $sources = Join-Path $root 'build\windows-deps\streaming-sources' $builds = Join-Path $root 'build\windows-deps\streaming-build' $prefix = Join-Path $root 'build\windows-deps\streaming-prefix' -$unixRoot = (& $cygpath -u $root).Trim() -$unixSources = (& $cygpath -u $sources).Trim() +function Convert-StreamingPath { + param([string] $FilePath) + $converted = & $cygpath -u $FilePath + if ($LASTEXITCODE -ne 0 -or -not $converted) { throw "Converting streaming path failed: $FilePath" } + return ($converted -join "`n").Trim() +} +$unixRoot = Convert-StreamingPath $root +$unixSources = Convert-StreamingPath $sources +$env:PKG_CONFIG = Join-Path $msys 'usr\bin\pkgconf.exe' +& $env:PKG_CONFIG --version | Out-Null +if ($LASTEXITCODE -ne 0) { throw 'The target pkg-config resolver is unavailable.' } +Remove-Item Env:PKG_CONFIG_SYSROOT_DIR -ErrorAction SilentlyContinue & $bash "$unixRoot/tools/prepare-streaming-sources.sh" --root $unixRoot --output $unixSources if ($LASTEXITCODE -ne 0) { throw 'Preparing verified streaming sources failed.' } $fingerprintArgs = @((Join-Path $root 'tools\streaming-fingerprint.py'), '--root', $root, '--target', "windows-x64:static:MD:$(& clang --version)", '--wrapper', $PSCommandPath) -$pin = (& python @fingerprintArgs).Trim() +$fingerprintOutput = & python @fingerprintArgs if ($LASTEXITCODE -ne 0) { throw 'Computing streaming dependency identity failed.' } +$pin = ($fingerprintOutput -join "`n").Trim() +if ($pin -notmatch '^[0-9a-f]{64}$') { throw 'Invalid streaming dependency identity.' } $stamp = Join-Path $prefix '.spool-streaming-configuration' if (-not $Clean -and (Test-Path $stamp) -and (Get-Content $stamp -Raw).Trim() -eq $pin) { return } if (Test-Path $builds) { Remove-Item $builds -Recurse -Force } @@ -32,7 +44,7 @@ try { & nmake install_dev if ($LASTEXITCODE -ne 0) { throw 'Installing OpenSSL failed.' } } finally { Pop-Location } -$env:PKG_CONFIG_PATH = (& $cygpath -u "$prefix/lib/pkgconfig").Trim() +$env:PKG_CONFIG_PATH = Convert-StreamingPath "$prefix/lib/pkgconfig" foreach ($name in @('nghttp2', 'nghttp3', 'ngtcp2', 'curl')) { & cmake -S (Join-Path $sources $name) -B (Join-Path $builds $name) -GNinja ` "-DSTREAMING_DEPENDENCY=$name" -DSTREAMING_SHARED=OFF ` @@ -40,17 +52,21 @@ foreach ($name in @('nghttp2', 'nghttp3', 'ngtcp2', 'curl')) { -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=clang-cl -DCMAKE_CXX_COMPILER=clang-cl ` -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDLL "-DCMAKE_INSTALL_PREFIX=$prefix" ` "-DCMAKE_PREFIX_PATH=$prefix" "-DOPENSSL_ROOT_DIR=$prefix" -DOPENSSL_USE_STATIC_LIBS=ON ` - -DCURL_ZLIB=OFF -DCURL_USE_SCHANNEL=OFF + -DCURL_ZLIB=OFF -DCURL_USE_SCHANNEL=OFF -DCURL_CA_NATIVE=ON if ($LASTEXITCODE -ne 0) { throw "Configuring $name failed." } & cmake --build (Join-Path $builds $name) --parallel 4 if ($LASTEXITCODE -ne 0) { throw "Building $name failed." } & cmake --install (Join-Path $builds $name) if ($LASTEXITCODE -ne 0) { throw "Installing $name failed." } } -# curl-config is a shell script even in a Windows cross-compatible install. -$unixPrefix = (& $cygpath -u $prefix).Trim() -$features = (& $bash "$unixPrefix/bin/curl-config" --features) -join ' ' -if ($LASTEXITCODE -ne 0 -or $features -notmatch '\bHTTP2\b' -or $features -notmatch '\bHTTP3\b' -or $features -notmatch '\balt-svc\b') { - throw 'Installed curl lacks HTTP2, HTTP3 or alt-svc.' -} +& cmake -S (Join-Path $root 'tools\cmake\QuicBatchingProbe') -B (Join-Path $builds 'quic-batching-probe') -GNinja ` + -DCMAKE_C_COMPILER=clang-cl -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDLL ` + "-DSTREAMING_CURL_SOURCE=$(Join-Path $sources 'curl')" "-DSTREAMING_CURL_BUILD=$(Join-Path $builds 'curl')" ` + "-DSTREAMING_INSTALLED_PC=$(Join-Path $prefix 'lib\pkgconfig\libcurl.pc')" +if ($LASTEXITCODE -ne 0) { throw 'Auditing compiled QUIC batching capabilities failed.' } +# Audit metadata using native Python and the explicit MSYS shell; no target +# binary or implicit system package can satisfy a wrong-version closure. +& python (Join-Path $root 'tools\check-streaming-dependencies.py') --prefix $prefix ` + --manifest (Join-Path $root 'tools\manifests\streaming-third-party.json') --bash $bash --require-native-ca +if ($LASTEXITCODE -ne 0) { throw 'The Windows streaming feature/version audit failed.' } [IO.File]::WriteAllText($stamp, "$pin`n") diff --git a/tools/windows/common.ps1 b/tools/windows/common.ps1 index 9449b164..e82d818e 100644 --- a/tools/windows/common.ps1 +++ b/tools/windows/common.ps1 @@ -121,6 +121,7 @@ function Get-MpvSourceRevision { 'tools/windows/check-ffmpeg.py', 'tools/windows/build-shader-tools.ps1', 'tools/windows/extract-archive.py', 'tools/windows/build-streaming-dependencies.ps1', 'tools/manifests/streaming-third-party.json', 'tools/cmake/StreamingDependencies.cmake', + 'tools/cmake/QuicBatchingProbe/CMakeLists.txt', 'tools/prepare-streaming-sources.sh', 'tools/streaming-fingerprint.py', 'tools/patches/curl-apple-mobile-sectrust.patch', 'tools/lib/manifest-sources.sh', 'tools/manifests/mpv-native.json', 'tools/manifests/ffmpeg-capabilities.json', From fe4afaf5aff704aa4913be747a66b375645f0128 Mon Sep 17 00:00:00 2001 From: Sacha Korban Date: Fri, 27 Nov 2026 02:50:05 +1100 Subject: [PATCH 04/39] test(transport): verify high-bitrate playback and shaped-network acceptance Consolidate the release milestone ending at aa9d311bb200afcaa845e8823f66c2a24d12cd65. Original starting snapshot: b01df004caa19f0f131fcde497c9108b8d283b16. --- CMakeLists.txt | 2 +- app/notices/OPEN_SOURCE_NOTICES.txt | 190 ++++++ flake.lock | 8 +- mpv | 2 +- qml/pages/SettingsPage.qml | 15 +- src/automation/LocalControlProtocol.cpp | 12 + src/automation/LocalControlProtocol.h | 2 + tests/e2e/JellyfinFixture.cpp | 10 +- tests/tools/StreamingDependenciesTest.py | 26 +- tests/transport/high_bitrate.py | 635 ++++++++++++++++++ tests/transport/protocols.py | 8 +- tools/streaming-fingerprint.py | 2 + tools/test-transport-netns.sh | 40 +- .../windows/build-streaming-dependencies.ps1 | 13 +- tools/windows/common.ps1 | 17 + tools/windows/install-build-tools.ps1 | 12 +- 16 files changed, 965 insertions(+), 29 deletions(-) create mode 100644 tests/transport/high_bitrate.py diff --git a/CMakeLists.txt b/CMakeLists.txt index a2bd3305..e2e82d9a 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1381,7 +1381,7 @@ if(BUILD_TESTING AND NOT SPOOL_WEBOS) "${CMAKE_CURRENT_SOURCE_DIR}/tools/test-transport-netns.sh" --libmpv "${SPOOL_CURL_TEST_MPV}") set_tests_properties(transport-packet-performance PROPERTIES LABELS performance - RUN_SERIAL TRUE RESOURCE_LOCK transport-network TIMEOUT 1200 SKIP_RETURN_CODE 77) + RUN_SERIAL TRUE RESOURCE_LOCK transport-network TIMEOUT 2400 SKIP_RETURN_CODE 77) endif() endif() if(SPOOL_SANITIZERS AND CMAKE_CXX_COMPILER_ID MATCHES "GNU|Clang") diff --git a/app/notices/OPEN_SOURCE_NOTICES.txt b/app/notices/OPEN_SOURCE_NOTICES.txt index 8bdc470d..369cbc1f 100644 --- a/app/notices/OPEN_SOURCE_NOTICES.txt +++ b/app/notices/OPEN_SOURCE_NOTICES.txt @@ -37,6 +37,10 @@ Major bundled components MoltenVK Apache-2.0 libdovi MIT curl curl license + OpenSSL Apache-2.0 + nghttp2 MIT + nghttp3 MIT + ngtcp2 MIT FriBidi LGPL-2.1-or-later HarfBuzz MIT libsecret LGPL-2.1-or-later @@ -61,6 +65,10 @@ over Apple's Metal API. Their source and license notices are available at: MIT components DwarFS reader: Copyright (c) Marcus Holland-Moritz +nghttp2: Copyright (c) 2012, 2014, 2015, 2016 Tatsuhiro Tsujikawa +nghttp2: Copyright (c) 2012, 2014, 2015, 2016 nghttp2 contributors +nghttp3: Copyright (c) 2019 nghttp3 contributors +ngtcp2: Copyright (c) 2016 ngtcp2 contributors uruntime: Copyright (c) 2026 VHSgunzo Permission is hereby granted, free of charge, to any person obtaining a copy @@ -110,3 +118,185 @@ LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +OpenSSL + +Source: https://github.com/openssl/openssl + + + Apache License + Version 2.0, January 2004 + https://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS diff --git a/flake.lock b/flake.lock index 6d09ef45..24fb9e31 100644 --- a/flake.lock +++ b/flake.lock @@ -20,11 +20,11 @@ "mpv-src": { "flake": false, "locked": { - "lastModified": 1794610812, - "narHash": "sha256-M14NLYJsRuOY/k4W5YjI+IAw+z2XGU3cBBOLwlO2EtU=", + "lastModified": 1794611110, + "narHash": "sha256-BDyGg26+kQk6SssQwxrUsdvI81Rximm+H/XRcK0Cc7A=", "ref": "refs/heads/net/integration", - "rev": "11f51b304783456a4898c71e8d14521ed8610b8d", - "revCount": 55880, + "rev": "9360911de75197e73f4be8f183beadcf90651a84", + "revCount": 55881, "type": "git", "url": "file:./mpv" }, diff --git a/mpv b/mpv index 11f51b30..9360911d 160000 --- a/mpv +++ b/mpv @@ -1 +1 @@ -Subproject commit 11f51b304783456a4898c71e8d14521ed8610b8d +Subproject commit 9360911de75197e73f4be8f183beadcf90651a84 diff --git a/qml/pages/SettingsPage.qml b/qml/pages/SettingsPage.qml index c7a65b20..d46ca000 100644 --- a/qml/pages/SettingsPage.qml +++ b/qml/pages/SettingsPage.qml @@ -18,6 +18,7 @@ FocusScope { property var allSettingsRows: [] property var expandedGroups: ({}) property bool reconcilingSettingsRows: false + property int rowFocusRevision: 0 readonly property bool directionRelease: true property var recoveryGesture: ({ "key": 0 @@ -47,6 +48,7 @@ FocusScope { const changed = sourceId !== id sourceId = id if (changed) { + ++rowFocusRevision pageMode = id.length ? "category" : "index" categoryId = id.length ? "streaming" : "" searchQuery = "" @@ -93,6 +95,7 @@ FocusScope { function openSearch() { if (modalVisible || editingKey.length || inputCompositionActive()) return false + ++rowFocusRevision searchField.focusField() return true } @@ -915,8 +918,12 @@ FocusScope { finishRowEdit() choiceDialogAnchor = null choiceDialogRow = null + const revision = rowFocusRevision Qt.callLater(function () { - selectRow(currentIndex, true) + // Closing a popup must not steal a newer search/edit or another + // route's focus while its deferred layout work finishes. + if (revision === rowFocusRevision && visible && activeFocus && !searchField.editing) + selectRow(currentIndex, true) }) } @@ -930,8 +937,12 @@ FocusScope { function closeHomeProviders() { homeProvidersVisible = false homeProvidersAnchor = null + const revision = rowFocusRevision Qt.callLater(function () { - selectRow(currentIndex, true) + // Closing a popup must not steal a newer search/edit or another + // route's focus while its deferred layout work finishes. + if (revision === rowFocusRevision && visible && activeFocus && !searchField.editing) + selectRow(currentIndex, true) }) } diff --git a/src/automation/LocalControlProtocol.cpp b/src/automation/LocalControlProtocol.cpp index 706a7213..72576c9c 100644 --- a/src/automation/LocalControlProtocol.cpp +++ b/src/automation/LocalControlProtocol.cpp @@ -8,7 +8,9 @@ #include #include #include +#if QT_CONFIG(process) #include +#endif #include #include #include @@ -193,6 +195,7 @@ QByteArray sshExchange(const QString& host, const QString& command, const QByteA *error = QStringLiteral("Invalid SSH host; use [USER@]HOST without options or shell syntax"); return {}; } +#if QT_CONFIG(process) QElapsedTimer clock; clock.start(); const auto remaining = [&] { return qMax(0, timeoutMs - int(clock.elapsed())); }; @@ -251,6 +254,15 @@ QByteArray sshExchange(const QString& host, const QString& command, const QByteA process.waitForFinished(1000); } return {}; +#else + Q_UNUSED(command) + Q_UNUSED(input) + Q_UNUSED(timeoutMs) + Q_UNUSED(maxBytes) + Q_UNUSED(forwardPort) + *error = QStringLiteral("SSH transport is unavailable on this platform"); + return {}; +#endif } QJsonObject requestSsh(const QString& host, const QJsonObject& descriptor, const QString& command, diff --git a/src/automation/LocalControlProtocol.h b/src/automation/LocalControlProtocol.h index c392245f..21b67b2c 100644 --- a/src/automation/LocalControlProtocol.h +++ b/src/automation/LocalControlProtocol.h @@ -16,6 +16,8 @@ bool validInstance(const QString& instance); bool privateFile(const QString& path); QJsonObject readDescriptor(const QString& path); // SSH transports the capability over stdin only; no remote spoolet is required. +// Platforms built without Qt process support report SSH as unavailable; their +// local socket/TCP control protocol remains supported. bool validSshHost(const QString& host); QByteArray sshExchange(const QString& host, const QString& command, const QByteArray& input, int timeoutMs, qsizetype maxBytes, QString *error, int forwardPort = 0); diff --git a/tests/e2e/JellyfinFixture.cpp b/tests/e2e/JellyfinFixture.cpp index 2b88a7d8..728149bf 100644 --- a/tests/e2e/JellyfinFixture.cpp +++ b/tests/e2e/JellyfinFixture.cpp @@ -352,7 +352,15 @@ void JellyfinFixture::handle(QTcpSocket *socket, const QByteArray& header, const items.append(movie()); if (!playedOnly && (ids.isEmpty() || ids.contains(episodeId))) items.append(episode()); - const QJsonObject result { { "Items", items }, { "TotalRecordCount", items.size() } }; + const auto total = items.size(); + const int offset = std::max(0, query.queryItemValue("StartIndex").toInt()); + bool limitPresent = false; + const int requested = query.queryItemValue("Limit").toInt(&limitPresent); + const auto limit = limitPresent ? std::max(0, requested) : total; + QJsonArray page; + for (qsizetype index = offset; index < total && page.size() < limit; ++index) + page.append(items.at(index)); + const QJsonObject result { { "Items", page }, { "TotalRecordCount", total }, { "StartIndex", offset } }; if (libraryBrowse && libraryBrowseHeld) { socket->setProperty("heldBrowse", true); pendingBrowse.append({ socket, QJsonDocument(result).toJson(QJsonDocument::Compact) }); diff --git a/tests/tools/StreamingDependenciesTest.py b/tests/tools/StreamingDependenciesTest.py index 4029e96a..4351320d 100644 --- a/tests/tools/StreamingDependenciesTest.py +++ b/tests/tools/StreamingDependenciesTest.py @@ -3,6 +3,7 @@ import hashlib import io import json +import os from pathlib import Path import shutil import subprocess @@ -42,10 +43,10 @@ def setUp(self): def write_manifest(self): self.manifest.write_text(json.dumps(self.data)) - def prepare(self, *extra): + def prepare(self, *extra, env=None): return subprocess.run(['bash', str(self.root / 'tools/prepare-streaming-sources.sh'), '--root', str(self.root), '--output', str(self.output), *extra], - capture_output=True, text=True) + capture_output=True, text=True, env=env) def test_digest_rejection_precedes_source_use(self): self.data['sources']['openssl']['sha256'] = '0' * 64 @@ -70,6 +71,27 @@ def test_patch_update_reextracts_and_reuses_verified_archives(self): result = self.prepare() self.assertEqual(result.returncode, 0, result.stderr) + def test_preparation_survives_native_windows_python_text_streams(self): + # Native Windows Python starts stdout with CRLF translation. Reproduce + # that real TextIO boundary on this host; the preparer still downloads, + # verifies, extracts and patches actual local archives. + interpreter = self.root / 'native-python' + interpreter.write_text('#!' + sys.executable + '\n' + 'import sys, runpy\n' + 'sys.stdout.reconfigure(newline="\\r\\n")\n' + 'if sys.argv[1] == "-c":\n' + ' code = sys.argv[2]; sys.argv = ["-c"] + sys.argv[3:]; exec(code)\n' + 'else:\n' + ' script = sys.argv[1]; sys.argv = sys.argv[1:]; runpy.run_path(script, run_name="__main__")\n') + interpreter.chmod(0o755) + patch = self.root / 'change.patch' + patch.write_text('--- a/content.txt\n+++ b/content.txt\n@@ -1 +1 @@\n-original\n+windows-safe\n') + self.data['sources']['curl']['patches'] = ['change.patch'] + self.write_manifest() + result = self.prepare(env=dict(os.environ, MANIFEST_PYTHON=str(interpreter))) + self.assertEqual(result.returncode, 0, result.stdout + result.stderr) + self.assertEqual((self.output / 'curl/content.txt').read_text(), 'windows-safe\n') + def test_help_and_invalid_arguments_have_no_side_effects(self): for arguments, code in [(['--help'], 0), (['--root', 'relative', '--output', str(self.output)], 2), (['--output'], 2), (['--invalid'], 2)]: diff --git a/tests/transport/high_bitrate.py b/tests/transport/high_bitrate.py new file mode 100644 index 00000000..f6c91238 --- /dev/null +++ b/tests/transport/high_bitrate.py @@ -0,0 +1,635 @@ +#!/usr/bin/env python3 +"""150 Mbps playback acceptance at the real libmpv/TLS transport boundary. + +Run inside the wrapper's private, shaped network namespace. This program never +changes networking. A local decode and a timed CPU prerequisite precede network +measurements. Capacity, exact decoded output, and timed playback are separate +claims; insufficient capacity is inconclusive and exits nonzero. +""" + +import argparse +import contextlib +import ctypes +import hashlib +import http.client +import importlib.util +import json +import math +import multiprocessing +import os +from pathlib import Path +import resource +import shutil +import signal +import socket +import ssl +import struct +import subprocess +import sys +import tempfile +import time + + +RATE = 195312 +CHANNELS = 32 +ALIGN = 96 +DURATION = 60 +BYTE_RATE = RATE * ALIGN +PAYLOAD_BYTES = BYTE_RATE * DURATION +FILE_BYTES = PAYLOAD_BYTES + 68 +PCM_BYTES = 48000 * DURATION * 2 * 2 +MODES = {"http1": (2, 11), "tcp": (1, 20), "prefer-h3": (3, 30)} +FILTER = "lavfi=[pan=stereo|c0=c0|c1=c1,aresample=48000]" + +# Only these public numeric metrics enter an artifact. Never serialize a raw +# transport node, exception message, nginx diagnostic, URL, or request header. +METRIC_KEYS = """ +playback-epoch stale-controls rejected-controls primary-origin-match +active-requests peak-active-requests selected-requests requests-per-stream +range-bytes ring-bytes received-bytes ordered-available-bytes +consumer-delivered-bytes readable-bytes retained-bytes reorder-bytes +started-requests finished-requests failed-requests retry-attempts +capacity-bytes-per-second capacity-samples ttfb-ms +average-received-bytes-per-second current-received-bytes-per-second +curl-thread-cpu-seconds curl-thread-wall-seconds curl-thread-cpu-available +consumer-thread-cpu-seconds consumer-thread-cpu-available +consumer-wait-seconds head-of-line-seconds reorder-wait-seconds oldest-gap-seconds +perform-wall-seconds dispatch-wall-seconds poll-wall-seconds ring-wait-seconds +recent-scheduling-lateness-ms peak-scheduling-lateness-ms +scheduling-lateness-p50-ms scheduling-lateness-p99-ms scheduling-lateness-available +playback-buffer-seconds playback-demand-bits-per-second declared-bits-per-second +playback-state-updates playback-user-paused physical-connections +allocated-raw-bytes committed-joint-extra-grant-bytes snapshot-truncated +""".split() +TABLE_KEYS = { + "streams": "stream-id effective-http-version http-fallbacks state last-reason urgency", + "connections": "http-version transport active-requests receive-requested-bytes " + "receive-effective-bytes receive-status tcp-rtt-ms tcp-rtt-available " + "udp-rcvbuf-requested udp-rcvbuf-effective udp-drops udp-drops-available", + "transport-samples": "requests http-version range-bytes ordered-bytes-per-second " + "ttfb-ms samples source", + "protocol-samples": "http-version ordered-available-bytes cpu-ns-per-ordered-byte " + "cpu-ns-per-ordered-byte-available", + "concurrency-samples": "requests capacity-bytes-per-second ttfb-ms samples", +} + + +class AcceptanceFailure(Exception): + """The message is a fixed, public failure code, never a library diagnostic.""" + + +def require(condition, code): + if not condition: + raise AcceptanceFailure(code) + + +def numeric_fields(node, keys): + return {key: node[key] for key in keys if key in node + and isinstance(node[key], (int, float)) and math.isfinite(node[key])} + + +def clean_metrics(node): + node = node or {} + result = numeric_fields(node, METRIC_KEYS) + for table, keys in TABLE_KEYS.items(): + result[table] = [numeric_fields(row, keys.split()) + for row in node.get(table, [])[:32]] + return result + + +def generate_wave(path): + """Write <1 MiB at a time; channel counters do not repeat within the file.""" + pcm_guid = struct.pack("> 8) + target.write(block) + require(path.stat().st_size == FILE_BYTES, "invalid-wave-size") + return {"seconds": time.monotonic() - started, "header-bytes": 68, + "payload-bytes": PAYLOAD_BYTES, "file-bytes": FILE_BYTES, + "sample-rate": RATE, "channels": CHANNELS, "bits-per-sample": 24, + "channel-mask": 0, "block-align": ALIGN, "bytes-per-second": BYTE_RATE, + "bits-per-second": BYTE_RATE * 8, "duration-seconds": DURATION, + "generation-block-bytes-max": 8192 * ALIGN} + + +def file_hash(path): + digest = hashlib.sha256() + with path.open("rb") as source: + for block in iter(lambda: source.read(1 << 20), b""): + digest.update(block) + return digest.hexdigest() + + +class PropertyEvent(ctypes.Structure): + _fields_ = [("name", ctypes.c_char_p), ("format", ctypes.c_int), + ("data", ctypes.c_void_p)] + + +def playback_worker(pipe, settings): + """Own libmpv in a killable process, including initialize and destroy.""" + # libcurl can inherit proxy settings even with mpv's empty proxy option. + # Keep every fixture request on loopback without inspecting those settings. + os.environ["no_proxy"] = "127.0.0.1" + os.environ["NO_PROXY"] = "127.0.0.1" + # terminal=no is also set by Player. Keep unexpected native diagnostics + # private rather than allowing a future dependency to print request data. + with open(os.devnull, "wb") as sink: + os.dup2(sink.fileno(), 1) + os.dup2(sink.fileno(), 2) + player = None + result = {"status": "failed", "samples": [], "cache-events": [], + "eof": False, "max-output-position-seconds": 0.0, + "max-audio-pts-seconds": 0.0} + started = time.monotonic() + cpu_started = time.process_time() + try: + spec = importlib.util.spec_from_file_location("high_bitrate_transport", settings["helper"]) + helper = importlib.util.module_from_spec(spec) + spec.loader.exec_module(helper) + timed = settings["timed"] + options = {"af": FILTER, "audio-format": "s16", "audio-samplerate": "48000", + "ao": "null" if timed else "pcm", "ao-null-untimed": "no", + "curl-max-request-size": str(16 << 20), "tls-verify": "yes", + "http-proxy": "", "cache-pause-initial": "yes", + "demuxer-max-bytes": str(32 << 20), "demuxer-readahead-secs": "2"} + if not timed: + options.update({"ao-pcm-file": settings["pcm"], "ao-pcm-waveheader": "no"}) + if settings.get("mode"): + mode = settings["mode"] + count = settings["count"] + options.update({"tls-ca-file": settings["ca"], "curl-http-mode": mode, + "curl-fixed-requests": str(count), "curl-receive-mode": "measured"}) + player = helper.Player(settings["library"], **options) + if settings.get("mode"): + caps = player.get("curl-transport-capabilities") or {} + result["capabilities"] = numeric_fields( + caps, ["http2", "http3", "alt-svc", "quic-batching", "hw-aes", "curl-version"]) + require(caps.get("http2") and caps.get("http3"), "missing-http2-or-http3") + epoch = max(settings["epoch"], + (player.get("curl-transport-metrics") or {}).get("playback-epoch", 0) + 1) + player.configure(epoch, max_requests=4, fixed_requests=count, + http_mode=MODES[mode][0], receive_mode=1, + direct_file=True, source_size_bytes=FILE_BYTES, + source_duration_seconds=DURATION, source_bitrate=BYTE_RATE * 8, + primary_origin=settings["origin"]) + player.check(player.transport_control({"format": 2, "op": 1, + "playback-epoch": epoch, "joint-extra-grant-bytes": 64 << 20, + "background-network": False}), "grant") + result["playback-epoch"] = epoch + observe = player.lib.mpv_observe_property + observe.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.c_char_p, ctypes.c_int] + observe.restype = ctypes.c_int + player.check(observe(player.handle, 1, b"paused-for-cache", 3), "observe-cache") + player.command("loadfile", settings["source"]) + loaded = False + first = None + cache_start = None + pause_seconds = 0.0 + last_advance = time.monotonic() + last_consumed = 0.0 + next_sample = 0.0 + previous_sample = None + while True: + event = player.lib.mpv_wait_event(player.handle, 0.05).contents + now = time.monotonic() + elapsed = now - started + if event.id == 8: + loaded = True + result["file-loaded-seconds"] = elapsed + result["media-duration-seconds"] = player.get("duration") + if event.id == 22 and event.userdata == 1: + prop = ctypes.cast(event.data, ctypes.POINTER(PropertyEvent)).contents + if prop.format == 3 and prop.data: + paused = bool(ctypes.cast(prop.data, ctypes.POINTER(ctypes.c_int)).contents.value) + result["cache-events"].append({"seconds": elapsed, "paused": paused, + "post-startup": first is not None}) + if first is not None and paused and cache_start is None: + cache_start = elapsed + if not paused and cache_start is not None: + pause_seconds += elapsed - cache_start + cache_start = None + position = player.get("time-pos") + audio_pts = player.get("audio-pts") + if isinstance(audio_pts, (int, float)) and math.isfinite(audio_pts): + result["max-audio-pts-seconds"] = max(result["max-audio-pts-seconds"], audio_pts) + if isinstance(position, (int, float)) and math.isfinite(position): + result["max-output-position-seconds"] = max( + result["max-output-position-seconds"], position) + if first is None and position > .05: + first = elapsed + result["first-progress-seconds"] = first + # ao=pcm is untimed: its playback clock can lag submitted audio. + # Detect a stalled decode using actual PCM output, not that clock. + consumed = result["max-output-position-seconds"] + if not timed: + pcm = Path(settings["pcm"]) + consumed = pcm.stat().st_size / (48000 * 4) if pcm.exists() else 0 + if consumed > last_consumed + .01: + last_advance = now + last_consumed = consumed + if elapsed >= next_sample: + metrics = clean_metrics(player.get("curl-transport-metrics")) + sample = {"seconds": elapsed, "position-seconds": position, + "audio-pts-seconds": audio_pts, "metrics": metrics} + if previous_sample: + seconds = elapsed - previous_sample["seconds"] + for key in ("ordered-available-bytes", "consumer-delivered-bytes"): + if key in metrics and key in previous_sample["metrics"]: + sample[key + "-per-second"] = max( + 0, metrics[key] - previous_sample["metrics"][key]) / seconds + result["samples"].append(sample) + previous_sample = sample + next_sample = elapsed + 1 + # Parent persists progress if a native call subsequently hangs. + pipe.send(("progress", result)) + if event.id == 7: + end = ctypes.cast(event.data, ctypes.POINTER(helper.EndFile)).contents + result.update({"end-reason": end.reason, "end-error": end.error}) + require(loaded and end.reason == 0, "playback-ended-without-eof") + result["eof"] = True + result["status"] = "complete" + break + if settings.get("stop-at") and result["max-output-position-seconds"] >= settings["stop-at"]: + result["status"] = "complete" + break + if elapsed >= settings["deadline"]: + result.update(status="inconclusive", failure="playback-deadline") + break + if settings.get("mode") and (now - last_advance >= 25 + or (elapsed >= 45 and consumed < 10)): + result.update(status="inconclusive", failure="insufficient-capacity-or-stall") + break + if cache_start is not None: + pause_seconds += time.monotonic() - started - cache_start + result["post-startup-cache-pause-seconds"] = pause_seconds + result["post-startup-cache-pause-count"] = sum( + row["paused"] and row["post-startup"] for row in result["cache-events"]) + result["final-metrics"] = clean_metrics(player.get("curl-transport-metrics")) + except AcceptanceFailure as error: + result["failure"] = str(error) + except BaseException as error: + result["failure"] = "libmpv-or-worker-error" + result["error-type"] = type(error).__name__ + finally: + result["seconds"] = time.monotonic() - started + result["process-cpu-seconds"] = time.process_time() - cpu_started + result["process-peak-rss-kib"] = resource.getrusage(resource.RUSAGE_SELF).ru_maxrss + # Send before destruction: a hanging native destructor cannot lose data. + pipe.send(("result", result)) + if player: + player.close() + pipe.close() + + +def run_player(settings): + context = multiprocessing.get_context("spawn") + reader, writer = context.Pipe(duplex=False) + process = context.Process(target=playback_worker, args=(writer, settings)) + process.start() + writer.close() + end = time.monotonic() + settings["deadline"] + 10 + result = {"status": "failed", "failure": "worker-exited", "samples": []} + complete = False + try: + while time.monotonic() < end: + if reader.poll(.2): + try: + kind, result = reader.recv() + except EOFError: + break + if kind == "result": + complete = True + break + elif not process.is_alive(): + break + if not complete: + result.update(status="inconclusive", failure="worker-deadline-or-exit") + process.join(timeout=3 if complete else 0) + finally: + if process.is_alive(): + process.terminate() + process.join(timeout=2) + if process.is_alive(): + process.kill() + process.join(timeout=2) + reader.close() + return result + + +def free_ports(): + # Hold TCP and UDP reservations until all three distinct ports are chosen. + with contextlib.ExitStack() as stack: + ports = [] + while len(ports) < len(MODES): + tcp = stack.enter_context(socket.socket()) + tcp.bind(("127.0.0.1", 0)) + port = tcp.getsockname()[1] + udp = stack.enter_context(socket.socket(type=socket.SOCK_DGRAM)) + try: + udp.bind(("127.0.0.1", port)) + except OSError: + continue + ports.append(port) + return dict(zip(MODES, ports)) + + +@contextlib.contextmanager +def nginx_fixture(root): + require(all(shutil.which(tool) for tool in ("nginx", "openssl")), "missing-nginx-or-openssl") + try: + subprocess.run(["openssl", "req", "-x509", "-newkey", "rsa:2048", "-nodes", + "-keyout", str(root / "key.pem"), "-out", str(root / "cert.pem"), + "-days", "1", "-subj", "/CN=127.0.0.1", "-addext", + "subjectAltName=IP:127.0.0.1"], check=True, + stdout=subprocess.DEVNULL, stderr=subprocess.DEVNULL, timeout=20) + except (OSError, subprocess.SubprocessError): + raise AcceptanceFailure("certificate-generation-failed") from None + ports = free_ports() + + def quoted(path): + return '"' + str(path).replace("\\", "\\\\").replace('"', '\\"') + '"' + + servers = [] + for mode, port in ports.items(): + servers.append(f"""server {{ + listen 127.0.0.1:{port} ssl; + {'listen 127.0.0.1:' + str(port) + ' quic reuseport;' if mode == 'prefer-h3' else ''} + {'http2 on;' if mode != 'http1' else ''} + access_log {quoted(root / (mode + '.access.log'))} measurement; + add_header Alt-Svc 'h3=":{port}"'; + root {quoted(root)}; +}}""") + # In the private mapped-root namespace the worker must retain uid 0 to + # traverse the private fixture directory. Ordinary reference use needs no user. + config = ("user root root;\n" if os.geteuid() == 0 else "") + f""" +worker_processes 1; +pid {quoted(root / 'nginx.pid')}; +error_log {quoted(root / 'error.log')} warn; +events {{ worker_connections 256; }} +http {{ + client_body_temp_path {quoted(root / 'client-body')}; + proxy_temp_path {quoted(root / 'proxy')}; + fastcgi_temp_path {quoted(root / 'fastcgi')}; + uwsgi_temp_path {quoted(root / 'uwsgi')}; + scgi_temp_path {quoted(root / 'scgi')}; + log_format measurement '$server_protocol $status'; + ssl_certificate {quoted(root / 'cert.pem')}; + ssl_certificate_key {quoted(root / 'key.pem')}; + ssl_protocols TLSv1.2 TLSv1.3; + sendfile on; + {''.join(servers)} +}} +""" + (root / "nginx.conf").write_text(config) + with (root / "nginx.stderr").open("wb") as errors: + server = subprocess.Popen(["nginx", "-e", "stderr", "-p", str(root), + "-c", str(root / "nginx.conf"), "-g", "daemon off;"], + stdout=subprocess.DEVNULL, stderr=errors, + start_new_session=True) + try: + deadline = time.monotonic() + 20 + context = ssl.create_default_context(cafile=str(root / "cert.pem")) + for port in ports.values(): + while True: + require(server.poll() is None, "nginx-startup-failed") + remaining = deadline - time.monotonic() + require(remaining > 0, "nginx-readiness-deadline") + connection = http.client.HTTPSConnection( + "127.0.0.1", port, context=context, timeout=max(1, min(3, remaining))) + try: + connection.request("HEAD", "/fixture.wav") + response = connection.getresponse() + require(response.status == 200 and + int(response.getheader("Content-Length", "0")) == FILE_BYTES, + "nginx-fixture-metadata-mismatch") + break + except (OSError, http.client.HTTPException): + time.sleep(.1) + finally: + connection.close() + yield ports + finally: + # Own the worker processes as well as nginx's master, even when a + # native server shutdown hangs or the master exits first. + with contextlib.suppress(ProcessLookupError): + os.killpg(server.pid, signal.SIGTERM) + try: + server.wait(timeout=3) + except subprocess.TimeoutExpired: + with contextlib.suppress(ProcessLookupError): + os.killpg(server.pid, signal.SIGKILL) + server.wait(timeout=3) + finally: + with contextlib.suppress(ProcessLookupError): + os.killpg(server.pid, signal.SIGKILL) + + +def protocol_evidence(result, mode, root, log_offset): + versions = {row.get("effective-http-version") for sample in result.get("samples", []) + for row in sample["metrics"].get("streams", [])} + versions.update(row.get("effective-http-version") + for row in result.get("final-metrics", {}).get("streams", [])) + result["observed-stream-http-versions"] = sorted(v for v in versions if v in (11, 20, 30)) + expected = MODES[mode][1] + expected_name = {11: "HTTP/1.1", 20: "HTTP/2.0", 30: "HTTP/3.0"}[expected] + # Each port has its own numeric/enum-only log. Scope evidence to this run. + with (root / (mode + ".access.log")).open("rb") as log: + log.seek(log_offset) + matches = sum(line.split() == [expected_name.encode(), b"206"] for line in log) + result["server-expected-protocol-range-responses"] = matches + if expected in versions and matches > 0: + result["protocol-scope"] = mode + return True + if mode == "prefer-h3": + # Safety gates can legitimately retain TCP on constrained hosts. Keep + # that acceptance distinct from a claim that HTTP/3 met this workload. + streams = [row for sample in result.get("samples", []) + for row in sample["metrics"].get("streams", [])] + streams.extend(result.get("final-metrics", {}).get("streams", [])) + reasons = sorted({row.get("last-reason") for row in streams + if row.get("last-reason") in (25, 29, 30, 31, 32, 33, 37)}) + with (root / (mode + ".access.log")).open("rb") as log: + log.seek(log_offset) + tcp_responses = sum(line.split() in ([b"HTTP/2.0", b"206"], [b"HTTP/1.1", b"206"]) + for line in log) + if reasons and versions.intersection((11, 20)) and tcp_responses: + result["protocol-scope"] = "tcp-fallback" + result["http3-unavailable-reasons"] = reasons + return True + return False + + +def save_report(path, report): + path.parent.mkdir(parents=True, exist_ok=True) + temporary = path.with_name(path.name + ".tmp") + temporary.write_text(json.dumps(report, indent=2, allow_nan=False) + "\n") + temporary.replace(path) + + +def parse_args(): + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("--libmpv", required=True) + parser.add_argument("--transport-helper", type=Path, required=True) + parser.add_argument("--output", type=Path, required=True) + parser.add_argument("--reference-only", action="store_true") + parser.add_argument("--counts", default="1,4,auto") + parser.add_argument("--protocols", default="http1,tcp,prefer-h3") + parser.add_argument("--loss-percent", type=float) + args = parser.parse_args() + counts = args.counts.split(",") + protocols = args.protocols.split(",") + if not counts or any(count not in ("1", "4", "auto") for count in counts): + parser.error("counts must be a comma separated selection of 1,4,auto") + if not protocols or any(mode not in MODES for mode in protocols): + parser.error("protocols must be a comma separated selection of http1,tcp,prefer-h3") + if args.loss_percent is not None and (not math.isfinite(args.loss_percent) + or not 0 <= args.loss_percent <= 100): + parser.error("loss-percent must be between 0 and 100") + args.counts = list(dict.fromkeys(counts)) + args.protocols = list(dict.fromkeys(protocols)) + return args + + +def main(): + args = parse_args() + report = {"schema": 1, "status": "running", "reference-only": args.reference_only, + "loss-percent": args.loss_percent, "prerequisites": {}, "results": [], + "requested-path-mbps": float(os.environ.get("SPOOL_TRANSPORT_RATE_MBIT", "200")), + "requested-rtt-ms": float(os.environ.get("SPOOL_TRANSPORT_RTT_MS", "150")), + "measured-rtt-ms": float(os.environ.get("SPOOL_TRANSPORT_MEASURED_RTT_MS", "0")), + "path-configured-by-wrapper": os.environ.get("SPOOL_TRANSPORT_NETNS") == "1", + "capacity-margin": 1.05, "request-size-limit-bytes": 16 << 20, + "timed-deadline-seconds": 100, "capacity-deadline-seconds": 180, + "seek": {"status": "not-measured", "reason": "continuous-playback-acceptance"}} + exit_code = 1 + try: + require(args.reference_only or report["path-configured-by-wrapper"], "isolated-shaped-path-required") + with tempfile.TemporaryDirectory(prefix="spool-high-bitrate-") as directory: + root = Path(directory) + report["prerequisites"]["fixture"] = generate_wave(root / "fixture.wav") + base = {"library": args.libmpv, "helper": str(args.transport_helper.resolve()), + "source": str(root / "fixture.wav"), "pcm": str(root / "reference.pcm")} + reference = run_player({**base, "timed": False, "deadline": 90}) + report["prerequisites"]["local-decode"] = reference + save_report(args.output, report) + require(reference["status"] == "complete" and reference["eof"], "local-decode-failed") + require((root / "reference.pcm").stat().st_size == PCM_BYTES, + "local-decode-duration-or-format-mismatch") + reference["pcm-bytes"] = PCM_BYTES + reference["decoded-duration-seconds"] = PCM_BYTES / (48000 * 4) + reference["pcm-sha256"] = file_hash(root / "reference.pcm") + require(abs((reference.get("media-duration-seconds") or 0) - DURATION) < .01, + "local-source-duration-mismatch") + cpu = run_player({**base, "timed": True, "deadline": 65, "stop-at": 45}) + report["prerequisites"]["local-timed-cpu"] = cpu + save_report(args.output, report) + require(cpu["status"] == "complete" and cpu["max-output-position-seconds"] >= 45 + and cpu.get("post-startup-cache-pause-count", 0) == 0 + and cpu["seconds"] <= 50, "local-timed-cpu-prerequisite-failed") + if args.reference_only: + report["status"] = "reference-passed" + exit_code = 0 + else: + with nginx_fixture(root) as ports: + epoch = 0 + for mode in args.protocols: + capacities = {} + # Timed auto always needs a separately measured auto capacity. + for label in dict.fromkeys([*args.counts, "auto"]): + epoch += 1 + origin = f"https://127.0.0.1:{ports[mode]}" + network = {**base, "source": origin + "/fixture.wav", + "origin": origin, "mode": mode, "epoch": epoch, + "count": 0 if label == "auto" else int(label), + "ca": str(root / "cert.pem"), + "pcm": str(root / "actual.pcm")} + log = root / (mode + ".access.log") + offset = log.stat().st_size if log.exists() else 0 + row = run_player({**network, "timed": False, "deadline": 180}) + row.update({"phase": "capacity", "protocol": mode, "count": label, + "supplemental-auto": label not in args.counts}) + report["results"].append(row) + save_report(args.output, report) + require(row.get("failure") != "missing-http2-or-http3", "missing-http2-or-http3") + if row["status"] == "complete": + actual = root / "actual.pcm" + row["pcm-bytes"] = actual.stat().st_size + row["pcm-sha256"] = file_hash(actual) + row["decoded-duration-seconds"] = row["pcm-bytes"] / (48000 * 4) + require(row["pcm-bytes"] == PCM_BYTES and + row["pcm-sha256"] == reference["pcm-sha256"], "network-pcm-corruption") + require(protocol_evidence(row, mode, root, offset), "negotiated-protocol-mismatch") + row["decoded-input-bits-per-second"] = PAYLOAD_BYTES * 8 / row["seconds"] + row["capacity-sufficient"] = (row["decoded-input-bits-per-second"] + >= BYTE_RATE * 8 * 1.05) + row["status"] = "passed" if row["capacity-sufficient"] else "insufficient-capacity" + else: + row["capacity-sufficient"] = False + capacities[label] = row + if (root / "actual.pcm").exists(): + (root / "actual.pcm").unlink() + save_report(args.output, report) + print(json.dumps({"phase": "capacity", "protocol": mode, + "count": label, "status": row["status"]}), flush=True) + epoch += 1 + network.update({"count": 0, "epoch": epoch}) + offset = log.stat().st_size + timed = run_player({**network, "timed": True, "deadline": 100}) + timed.update({"phase": "timed", "protocol": mode, "count": "auto", + "capacity-sufficient": capacities["auto"]["capacity-sufficient"]}) + report["results"].append(timed) + if timed["status"] == "complete": + require(protocol_evidence(timed, mode, root, offset), "negotiated-protocol-mismatch") + if not timed["capacity-sufficient"]: + timed.update(status="inconclusive", failure="insufficient-capacity") + elif (timed["status"] != "complete" or not timed["eof"] + or timed["max-output-position-seconds"] < 59 + or timed["max-audio-pts-seconds"] < 59 + or timed.get("post-startup-cache-pause-count", 0) > 0 + or timed.get("post-startup-cache-pause-seconds", 0) > 0 + or timed["seconds"] - (timed.get("first-progress-seconds") or 0) > 63): + timed.update(status="failed", failure="timed-playback-acceptance") + else: + timed["status"] = "passed" + save_report(args.output, report) + print(json.dumps({"phase": "timed", "protocol": mode, + "count": "auto", "status": timed["status"]}), flush=True) + # Fixed-count rows are comparisons, including a slow baseline. + # Every auto capacity and timed row must meet the actual gate. + automatic = [row for row in report["results"] if row["count"] == "auto"] + report["acceptance-scope"] = "automatic-capacity-and-timed-playback" + report["status"] = ("passed" if automatic and all(row["status"] == "passed" + for row in automatic) else "failed-or-inconclusive") + exit_code = 0 if report["status"] == "passed" else 1 + except AcceptanceFailure as error: + report.update(status="failed", failure=str(error)) + except KeyboardInterrupt: + report.update(status="interrupted", failure="interrupted") + exit_code = 130 + except Exception as error: + report.update(status="failed", failure="harness-error", **{"error-type": type(error).__name__}) + finally: + save_report(args.output, report) + print(json.dumps({"status": report["status"], "failure": report.get("failure")}), flush=True) + return exit_code + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/tests/transport/protocols.py b/tests/transport/protocols.py index ac3e4470..7edfe944 100644 --- a/tests/transport/protocols.py +++ b/tests/transport/protocols.py @@ -110,12 +110,12 @@ def main(): '-g', 'daemon off;'], stdout=subprocess.DEVNULL, stderr=subprocess.PIPE) try: - deadline = time.monotonic() + 5 + deadline = time.monotonic() + (20 if args.performance else 5) while True: if nginx.poll() is not None: raise AssertionError('nginx fixture failed: ' + nginx.stderr.read().decode()) try: - with socket.create_connection(('127.0.0.1', tls), timeout=.1): + with socket.create_connection(('127.0.0.1', tls), timeout=1 if args.performance else .1): break except OSError: if time.monotonic() > deadline: @@ -131,6 +131,10 @@ def main(): 'audio-format': 's16', 'curl-http-mode': mode, 'curl-fixed-requests': str(count), 'curl-receive-mode': 'fixed', 'curl-receive-bytes': str(4 << 20)} + if args.performance: + # Correctness uses short ranges to exercise many joins. + # Performance must permit BDP-sized adaptive ranges. + options['curl-max-request-size'] = str(16 << 20) player = transport.Player(args.libmpv, **options) try: capabilities = player.get('curl-transport-capabilities') diff --git a/tools/streaming-fingerprint.py b/tools/streaming-fingerprint.py index 3f8f1432..a9780872 100644 --- a/tools/streaming-fingerprint.py +++ b/tools/streaming-fingerprint.py @@ -3,8 +3,10 @@ import argparse import hashlib import json +import sys from pathlib import Path +sys.stdout.reconfigure(newline="\n") parser = argparse.ArgumentParser(description=__doc__) parser.add_argument('--root', type=Path, required=True) parser.add_argument('--manifest', type=Path) diff --git a/tools/test-transport-netns.sh b/tools/test-transport-netns.sh index 0cf2966b..c81ddb3a 100755 --- a/tools/test-transport-netns.sh +++ b/tools/test-transport-netns.sh @@ -3,19 +3,20 @@ set -euo pipefail # All shaping stays inside a fresh user+network namespace. Never changes host # routes, qdiscs, sysctls or socket ceilings and never invokes sudo. ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" -usage() { echo "Usage: $0 --libmpv ABS [--output ABS] [--rtt-ms N] [--loss-percent N]"; } -LIBRARY= OUTPUT= RTT=150 LOSS=0.1 +usage() { echo "Usage: $0 --libmpv ABS [--output ABS] [--rtt-ms N] [--loss-percent N] [--counts 1,4,auto] [--protocols http1,tcp,prefer-h3]"; } +LIBRARY= OUTPUT= RTT=150 LOSS=0 COUNTS=1,4,auto PROTOCOLS=http1,tcp,prefer-h3 while (( $# )); do case "$1" in --help|-h) usage; exit 0 ;; - --libmpv|--output|--rtt-ms|--loss-percent) + --libmpv|--output|--rtt-ms|--loss-percent|--counts|--protocols) (( $# >= 2 )) || { usage >&2; exit 2; } - case "$1" in --libmpv) LIBRARY="$2";; --output) OUTPUT="$2";; --rtt-ms) RTT="$2";; --loss-percent) LOSS="$2";; esac + case "$1" in --libmpv) LIBRARY="$2";; --output) OUTPUT="$2";; --rtt-ms) RTT="$2";; --loss-percent) LOSS="$2";; --counts) COUNTS="$2";; --protocols) PROTOCOLS="$2";; esac shift 2 ;; *) usage >&2; exit 2 ;; esac done -[[ "$LIBRARY" == /* && -f "$LIBRARY" && "$RTT" =~ ^[0-9]+([.][0-9]+)?$ && "$LOSS" =~ ^[0-9]+([.][0-9]+)?$ ]] || { usage >&2; exit 2; } +[[ ( -z "$OUTPUT" || "$OUTPUT" == /* ) && "$LIBRARY" == /* && -f "$LIBRARY" && "$RTT" =~ ^[0-9]+([.][0-9]+)?$ && "$LOSS" =~ ^[0-9]+([.][0-9]+)?$ ]] || { usage >&2; exit 2; } +OUTPUT="${OUTPUT:-$ROOT/build/transport-packet-performance/loss-$LOSS.json}" for command in unshare ip tc ping python3 nginx openssl; do command -v "$command" >/dev/null || { echo "SKIP: missing $command (use nix develop .#native)" >&2; exit 77; } done @@ -23,19 +24,34 @@ if ! unshare --user --map-root-user --net true 2>/dev/null; then echo 'SKIP: unprivileged user/network namespaces unavailable' >&2 exit 77 fi -exec unshare --user --map-root-user --net bash -s -- "$ROOT" "$LIBRARY" "$OUTPUT" "$RTT" "$LOSS" <<'INNER' +exec unshare --user --map-root-user --net bash -s -- "$ROOT" "$LIBRARY" "$OUTPUT" "$RTT" "$LOSS" "$COUNTS" "$PROTOCOLS" <<'INNER' set -euo pipefail -root="$1" library="$2" output="$3" rtt="$4" loss="$5" +root="$1" library="$2" output="$3" rtt="$4" loss="$5" counts="$6" protocols="$7" ip link set lo up mtu 1500 # A loopback packet traverses this qdisc once in each direction, so half the # desired round-trip delay applies to each packet; ping records the real RTT. delay="$(python3 -c 'import sys; print(float(sys.argv[1])/2)' "$rtt")" -if ! tc qdisc add dev lo root netem delay "${delay}ms" loss "${loss}%" rate 150mbit limit 10000; then +if ! tc qdisc add dev lo root netem delay "${delay}ms" loss "${loss}%" rate 200mbit limit 10000; then echo 'SKIP: netem qdisc unavailable in isolated namespace' >&2 exit 77 fi -ping -n -c 3 -i .2 127.0.0.1 -args=(--libmpv "$library" --transport-helper "$root/mpv/test/curl_transport.py" --performance) -[[ -z "$output" ]] || args+=(--output "$output") -python3 "$root/tests/transport/protocols.py" "${args[@]}" +ping_report="$(LC_ALL=C ping -n -c 3 -i .2 127.0.0.1)" +printf '%s\n' "$ping_report" +measured_rtt="$(python3 -c 'import math, sys +lines = [line for line in sys.stdin.read().splitlines() if line.startswith("rtt ")] +if not lines: + raise SystemExit("Could not measure private path RTT") +value = float(lines[-1].split("=", 1)[1].strip().split("/")[1]) +if not math.isfinite(value) or value < 0: + raise SystemExit("Invalid private path RTT") +print(value)' <<<"$ping_report")" +# Each loss level has an independent report; zero loss is the capacity and +# continuous-playback acceptance path. Run --loss-percent 0.1 / 1 separately +# to retain packet-loss evidence without conflating it with baseline capacity. +export SPOOL_TRANSPORT_NETNS=1 SPOOL_TRANSPORT_RTT_MS="$rtt" SPOOL_TRANSPORT_RATE_MBIT=200 +export SPOOL_TRANSPORT_MEASURED_RTT_MS="$measured_rtt" +python3 "$root/tests/transport/high_bitrate.py" --libmpv "$library" \ + --transport-helper "$root/mpv/test/curl_transport.py" --output "$output" \ + --counts "$counts" --protocols "$protocols" --loss-percent "$loss" + INNER diff --git a/tools/windows/build-streaming-dependencies.ps1 b/tools/windows/build-streaming-dependencies.ps1 index 1c7291f2..1b6a4bae 100644 --- a/tools/windows/build-streaming-dependencies.ps1 +++ b/tools/windows/build-streaming-dependencies.ps1 @@ -2,6 +2,10 @@ param([switch] $Clean) . (Join-Path $PSScriptRoot 'common.ps1') Initialize-WindowsMpvBuildEnvironment $root = Get-RepositoryRoot +$nativePerl = Get-NativeWindowsPerl +if (-not $nativePerl) { + throw 'OpenSSL VC-WIN64A requires native Windows Perl. Run tools\windows\install-build-tools.ps1 to install Strawberry Perl.' +} $msys = Get-Msys2Root $bash = Join-Path $msys 'usr\bin\bash.exe' $cygpath = Join-Path $msys 'usr\bin\cygpath.exe' @@ -34,16 +38,21 @@ if (Test-Path $builds) { Remove-Item $builds -Recurse -Force } if (Test-Path $prefix) { Remove-Item $prefix -Recurse -Force } $opensslBuild = Join-Path $builds 'openssl' New-Item -ItemType Directory -Force $opensslBuild | Out-Null +$originalStreamingPath = $env:PATH +$env:PATH = "$(Split-Path $nativePerl -Parent);$env:PATH" Push-Location $opensslBuild try { - & perl (Join-Path $sources 'openssl\Configure') VC-WIN64A no-shared no-apps no-docs no-tests ` + & $nativePerl (Join-Path $sources 'openssl\Configure') VC-WIN64A no-shared no-apps no-docs no-tests ` no-comp no-dtls no-srp no-ssl3 no-weak-ssl-ciphers -MD "--prefix=$prefix" --libdir=lib if ($LASTEXITCODE -ne 0) { throw 'Configuring OpenSSL failed.' } & nmake build_libs if ($LASTEXITCODE -ne 0) { throw 'Building OpenSSL failed.' } & nmake install_dev if ($LASTEXITCODE -ne 0) { throw 'Installing OpenSSL failed.' } -} finally { Pop-Location } +} finally { + Pop-Location + $env:PATH = $originalStreamingPath +} $env:PKG_CONFIG_PATH = Convert-StreamingPath "$prefix/lib/pkgconfig" foreach ($name in @('nghttp2', 'nghttp3', 'ngtcp2', 'curl')) { & cmake -S (Join-Path $sources $name) -B (Join-Path $builds $name) -GNinja ` diff --git a/tools/windows/common.ps1 b/tools/windows/common.ps1 index e82d818e..36eb915e 100644 --- a/tools/windows/common.ps1 +++ b/tools/windows/common.ps1 @@ -60,6 +60,23 @@ function Get-Msys2Root { return $root } +# OpenSSL's VC targets require a native Windows Perl. MSYS Perl can see a +# Windows Configure path yet resolve FindBin against the build directory. +function Get-NativeWindowsPerl { + $candidates = @() + if ($env:SPOOL_WINDOWS_PERL) { $candidates += $env:SPOOL_WINDOWS_PERL } + $candidates += Join-Path $env:SystemDrive 'Strawberry\perl\bin\perl.exe' + $candidates += @(Get-Command perl.exe -All -ErrorAction SilentlyContinue | ForEach-Object { $_.Source }) + foreach ($candidate in ($candidates | Select-Object -Unique)) { + if (-not (Test-Path -LiteralPath $candidate -PathType Leaf)) { continue } + $flavor = & $candidate -e 'print $^O' 2>$null + if ($LASTEXITCODE -eq 0 -and (($flavor -join '').Trim() -eq 'MSWin32')) { + return [IO.Path]::GetFullPath($candidate) + } + } + return $null +} + function Expand-WindowsSourceArchive { param( [Parameter(Mandatory)] [string] $Archive, diff --git a/tools/windows/install-build-tools.ps1 b/tools/windows/install-build-tools.ps1 index eac8aede..7f0edec4 100644 --- a/tools/windows/install-build-tools.ps1 +++ b/tools/windows/install-build-tools.ps1 @@ -58,7 +58,10 @@ if (-not $VerifyOnly) { # their own builds of some of these. Chocolatey is a no-op when the # pinned version is the installed one. $pinned = $package.ContainsKey('Version') - if (-not $pinned -and (Get-Command "$($package.Provides).exe" -ErrorAction SilentlyContinue)) { + $available = if ($package.Provides -eq 'perl') { + [bool](Get-NativeWindowsPerl) + } else { [bool](Get-Command "$($package.Provides).exe" -ErrorAction SilentlyContinue) } + if (-not $pinned -and $available) { Write-Host "$($package.Name) is already installed" continue } @@ -80,7 +83,12 @@ if (-not $VerifyOnly) { $missing = @() foreach ($tool in $requiredTools) { $command = Get-Command $tool -ErrorAction SilentlyContinue - if ($command) { + if ($tool -eq 'perl') { + $nativePerl = Get-NativeWindowsPerl + if ($nativePerl) { + Write-Host "native Perl -> $nativePerl" + } else { $missing += 'native Windows Perl (Strawberry Perl)' } + } elseif ($command) { Write-Host "$tool -> $($command.Source)" } else { $missing += $tool From 21bd3f0b9886d421e5ac1ff4c457be7dc8eff152 Mon Sep 17 00:00:00 2001 From: Sacha Korban Date: Fri, 27 Nov 2026 02:50:05 +1100 Subject: [PATCH 05/39] feat(android): add AV1 fallback, memory sizing and receiver passthrough Consolidate the release milestone ending at 3b7debf504ba44e10bb2275adae1436746dabbbe. Original starting snapshot: aa9d311bb200afcaa845e8823f66c2a24d12cd65. --- .../com/sachk/spool/VideoSurfaceBridge.java | 44 +++++++++++++ app/notices/OPEN_SOURCE_NOTICES.txt | 1 + flake.lock | 16 ++--- flake.nix | 4 +- mpv | 2 +- qml/pages/HomePage.qml | 10 +++ qml/pages/OpenSourceNoticesPage.qml | 5 ++ qml/pages/ProviderDetailsPage.qml | 6 -- qml/primitives/MediaRow.qml | 19 +++++- src/app/SettingsController.cpp | 13 ++-- src/app/SettingsController.h | 1 - src/app/SettingsSchema.cpp | 9 +++ src/app/SettingsSchema.h | 1 + src/platform/android/AndroidPlatform.cpp | 8 ++- .../android/AndroidPlaybackSurface.cpp | 61 ++++++++++++++++++- src/player/PlayerController.cpp | 13 ++++ src/player/PlayerController.h | 2 + tools/android/build-dependencies.sh | 10 ++- tools/manifests/android-third-party.json | 11 +++- tools/manifests/ffmpeg-capabilities.json | 2 + tools/manifests/webos-third-party.json | 6 +- tools/windows/build-mpv.ps1 | 2 +- 22 files changed, 205 insertions(+), 41 deletions(-) diff --git a/app/android-common/src/com/sachk/spool/VideoSurfaceBridge.java b/app/android-common/src/com/sachk/spool/VideoSurfaceBridge.java index 3ab46b81..52465ad6 100644 --- a/app/android-common/src/com/sachk/spool/VideoSurfaceBridge.java +++ b/app/android-common/src/com/sachk/spool/VideoSurfaceBridge.java @@ -1,11 +1,15 @@ package com.sachk.spool; import android.app.Activity; +import android.media.MediaCodecInfo; +import android.media.MediaCodecList; +import android.os.Build; import android.view.Gravity; import android.view.SurfaceHolder; import android.view.SurfaceView; import android.view.ViewGroup; import android.widget.FrameLayout; +import java.util.Locale; /** * The video plane, underneath everything Qt draws. @@ -29,6 +33,46 @@ private VideoSurfaceBridge() { } + /** + * Whether a hardware decoder exists for this video MIME type. Direct + * output can only show what MediaCodec decodes in hardware: a format the + * device lacks (AV1 on every Shield TV) would play as a black picture. + * When the platform cannot be asked, the answer is yes, which keeps the + * direct path the viewer chose. + */ + public static boolean hasHardwareDecoder(String mime) + { + try { + MediaCodecList list = new MediaCodecList(MediaCodecList.REGULAR_CODECS); + for (MediaCodecInfo info : list.getCodecInfos()) { + if (info.isEncoder() || !supportsType(info, mime)) + continue; + if (Build.VERSION.SDK_INT >= 29) { + if (info.isHardwareAccelerated()) + return true; + continue; + } + // Before Android 10 the software decoders are known by name. + String name = info.getName().toLowerCase(Locale.ROOT); + if (!name.startsWith("omx.google.") && !name.startsWith("c2.android.") + && !name.contains(".sw.")) + return true; + } + return false; + } catch (RuntimeException e) { + return true; + } + } + + private static boolean supportsType(MediaCodecInfo info, String mime) + { + for (String type : info.getSupportedTypes()) { + if (type.equalsIgnoreCase(mime)) + return true; + } + return false; + } + /** * A surface shaped like the video in it. * diff --git a/app/notices/OPEN_SOURCE_NOTICES.txt b/app/notices/OPEN_SOURCE_NOTICES.txt index 369cbc1f..81b98f97 100644 --- a/app/notices/OPEN_SOURCE_NOTICES.txt +++ b/app/notices/OPEN_SOURCE_NOTICES.txt @@ -36,6 +36,7 @@ Major bundled components Vulkan Loader Apache-2.0 MoltenVK Apache-2.0 libdovi MIT + dav1d (Android) BSD-2-Clause curl curl license OpenSSL Apache-2.0 nghttp2 MIT diff --git a/flake.lock b/flake.lock index 24fb9e31..7c486f7e 100644 --- a/flake.lock +++ b/flake.lock @@ -3,28 +3,28 @@ "libplacebo-src": { "flake": false, "locked": { - "lastModified": 1783535157, - "narHash": "sha256-cA8+APhpu3m38z5hs2EhsNlLb/xHAy/Tcxi5loFS6j0=", + "lastModified": 1792950923, + "narHash": "sha256-PYi21y7uAZUsbn9nqn4ZP8QB9iQ9pRvnIKdOtG0WeIw=", "owner": "haasn", "repo": "libplacebo", - "rev": "a7a18af88ff0a17c04840dcb3246047bb6b46df3", + "rev": "275f7dea27924cdd34ab2e6c20e448b6bc4fab65", "type": "github" }, "original": { "owner": "haasn", "repo": "libplacebo", - "rev": "a7a18af88ff0a17c04840dcb3246047bb6b46df3", + "rev": "275f7dea27924cdd34ab2e6c20e448b6bc4fab65", "type": "github" } }, "mpv-src": { "flake": false, "locked": { - "lastModified": 1794611110, - "narHash": "sha256-BDyGg26+kQk6SssQwxrUsdvI81Rximm+H/XRcK0Cc7A=", + "lastModified": 1795191261, + "narHash": "sha256-nVtQSmxrdcDuKIv4Meh7Kr/iivZGxYXHDM1S45XPPAM=", "ref": "refs/heads/net/integration", - "rev": "9360911de75197e73f4be8f183beadcf90651a84", - "revCount": 55881, + "rev": "12b98730c08c11dc159a44a3f2882c346d2360e2", + "revCount": 56224, "type": "git", "url": "file:./mpv" }, diff --git a/flake.nix b/flake.nix index 438637af..eea0f65d 100644 --- a/flake.nix +++ b/flake.nix @@ -12,7 +12,7 @@ # 26.05 darwin branch, which is maintained to the end of 2026. nixpkgs-x86-darwin.url = "github:NixOS/nixpkgs/nixpkgs-26.05-darwin"; libplacebo-src = { - url = "github:haasn/libplacebo/a7a18af88ff0a17c04840dcb3246047bb6b46df3?submodules=1"; + url = "github:haasn/libplacebo/275f7dea27924cdd34ab2e6c20e448b6bc4fab65?submodules=1"; flake = false; }; qcoro-src = { @@ -123,7 +123,7 @@ libplaceboOverlay = final: prev: { spoolLibplacebo = prev.libplacebo.overrideAttrs (_: { - version = "master-a7a18af"; + version = "7.387.0"; src = libplacebo-src; patches = []; }); diff --git a/mpv b/mpv index 9360911d..12b98730 160000 --- a/mpv +++ b/mpv @@ -1 +1 @@ -Subproject commit 9360911de75197e73f4be8f183beadcf90651a84 +Subproject commit 12b98730c08c11dc159a44a3f2882c346d2360e2 diff --git a/qml/pages/HomePage.qml b/qml/pages/HomePage.qml index 2b19c5cf..7a185b0a 100644 --- a/qml/pages/HomePage.qml +++ b/qml/pages/HomePage.qml @@ -191,6 +191,16 @@ FocusScope { function routeKey(key, phase, repeat) { if (allProvidersButton.activeFocus || accountsButton.activeFocus) { + // Show all sits above the warning's button; move between them first. + const both = allProvidersButton.visible && accountsButton.visible + if (phase === "press" && both && key === Qt.Key_Down && allProvidersButton.activeFocus) { + InputKeys.focus(accountsButton) + return true + } + if (phase === "press" && both && key === Qt.Key_Up && accountsButton.activeFocus) { + InputKeys.focus(allProvidersButton) + return true + } if (phase === "press" && key === Qt.Key_Down) return initialLoading || rows.focusPreferred("libraries") if (phase === "press" && key === Qt.Key_Up) { diff --git a/qml/pages/OpenSourceNoticesPage.qml b/qml/pages/OpenSourceNoticesPage.qml index 7d53e50b..afa84e4a 100644 --- a/qml/pages/OpenSourceNoticesPage.qml +++ b/qml/pages/OpenSourceNoticesPage.qml @@ -52,6 +52,11 @@ FocusScope { "license": "MIT", "source": "github.com/quietvoid/dovi_tool" }, + { + "name": "dav1d", + "license": "BSD-2-Clause", + "source": "code.videolan.org/videolan/dav1d" + }, { "name": "Atkinson Hyperlegible", "license": "SIL Open Font License 1.1", diff --git a/qml/pages/ProviderDetailsPage.qml b/qml/pages/ProviderDetailsPage.qml index ee68d5a1..c450fe6c 100644 --- a/qml/pages/ProviderDetailsPage.qml +++ b/qml/pages/ProviderDetailsPage.qml @@ -289,12 +289,6 @@ FocusScope { } wrapMode: Text.WordWrap } - SecondaryText { - Layout.fillWidth: true - visible: !accountRow.modelData.hasSettings - text: "No settings for this account." - wrapMode: Text.WordWrap - } AppText { Layout.fillWidth: true visible: Boolean(accountRow.modelData.errorText) diff --git a/qml/primitives/MediaRow.qml b/qml/primitives/MediaRow.qml index eebf9101..65516300 100644 --- a/qml/primitives/MediaRow.qml +++ b/qml/primitives/MediaRow.qml @@ -698,21 +698,36 @@ FocusScope { gesturePolicy: TapHandler.DragThreshold longPressThreshold: 0.52 property int pressedIndex: -1 + property string pressedIdentity: "" property bool pressedWhileMoving: false property bool held: false + // A live row can be refreshed while a finger rests on it. The + // gesture belongs to the card that was pressed, not its slot. + function identityAt(index) { + const card = index >= 0 ? listView.itemAtIndex(index) : null + const item = card && card.cardItem + return item ? String(item.id || item.libraryId || item.name || "") : "" + } + function stillPressedCard() { + return pressedIndex >= 0 && pressedIndex < root.count && identityAt(pressedIndex) + === pressedIdentity + + } + onPressedChanged: { if (pressed) { held = false pressedWhileMoving = listView.moving pressedIndex = listView.indexAt(point.position.x + listView.contentX, point.position.y + listView.contentY) + pressedIdentity = identityAt(pressedIndex) } else if (held && root.shell) { root.shell.finishItemMenuOpeningGesture() } } onTapped: (eventPoint, button) => { - if (held || pressedWhileMoving || listView.moving || pressedIndex < 0) + if (held || pressedWhileMoving || listView.moving || !stillPressedCard()) return root.pointerSelected() root.currentIndex = pressedIndex @@ -722,7 +737,7 @@ FocusScope { root.activateIndex(pressedIndex) } onLongPressed: { - if (pressedWhileMoving || listView.moving || pressedIndex < 0) + if (pressedWhileMoving || listView.moving || !stillPressedCard()) return root.pointerSelected() root.currentIndex = pressedIndex diff --git a/src/app/SettingsController.cpp b/src/app/SettingsController.cpp index 37ada267..0e66d9db 100644 --- a/src/app/SettingsController.cpp +++ b/src/app/SettingsController.cpp @@ -304,15 +304,6 @@ void SettingsController::persistServerOverrides() emit serverOverridesChanged(); } -QVariantMap SettingsController::playbackSnapshot(const QString& sourceId) const -{ - QVariantMap result; - for (const auto& spec : settingSpecs()) - if (spec.serverOverridable) - result.insert(keyString(spec), effectiveValue(keyString(spec), sourceId)); - return result; -} - QString SettingsController::serverPlaybackSummary(const QString& sourceId) const { const auto rows = m_serverOverrides.value(serverKey(sourceId)).toMap(); @@ -1041,6 +1032,10 @@ void SettingsController::applySchemaValue(const SettingSpec& spec, const QVarian if (apply && m_player) m_player->setAudioOutputMode(m_audioOutputMode); break; + case SettingTarget::AudioPassthrough: + if (m_player && (apply || !m_localSettingsLoaded)) + m_player->setAudioPassthrough(value.toString()); + break; case SettingTarget::VideoOutputMode: m_videoOutputMode = value.toString(); if (m_player && (apply || !m_localSettingsLoaded)) diff --git a/src/app/SettingsController.h b/src/app/SettingsController.h index ae798204..52a95ce7 100644 --- a/src/app/SettingsController.h +++ b/src/app/SettingsController.h @@ -99,7 +99,6 @@ class SettingsController final : public QObject { Q_INVOKABLE void resetServerValue(const QString& key, const QString& sourceId); Q_INVOKABLE void removeServerOverrides(const QString& sourceId); Q_INVOKABLE QString serverPlaybackSummary(const QString& sourceId) const; - QVariantMap playbackSnapshot(const QString& sourceId) const; void retainServerOverrides(const QStringList& accountIds); void preparePlayback(const QString& sourceId); bool playerControlTooltipsEnabled() const diff --git a/src/app/SettingsSchema.cpp b/src/app/SettingsSchema.cpp index 4c798638..a84398f3 100644 --- a/src/app/SettingsSchema.cpp +++ b/src/app/SettingsSchema.cpp @@ -93,6 +93,9 @@ namespace { constexpr SettingChoice kReceiveWindowChoices[] = { { "measured", "Measured" }, { "os-auto", "Let the system decide" }, { "4m", "4 MB (expert)" }, { "8m", "8 MB (expert)" }, { "16m", "16 MB (expert)" } }; + // mpv's audio-spdif codec lists. DTS-HD covers plain DTS cores too. + constexpr SettingChoice kAudioPassthroughChoices[] = { { "off", "Off" }, + { "dolby", "Dolby Digital and Dolby Digital Plus" }, { "all", "Dolby, DTS and Dolby TrueHD" } }; constexpr SettingChoice kMpvConfigModeChoices[] = { { "disabled", "Off" }, { "standard", "Standard mpv directory" }, { "custom", "Custom directory" } }; constexpr SettingChoice kSubtitleStylingChoices[] = { { "Auto", "Automatic" }, @@ -416,6 +419,12 @@ const QVector& settingSpecs() audioOutput.defaultValue, audioOutput.choices, audioOutput.choiceCount, SettingTarget::AudioOutput, SettingNormalizer::AudioOutput) .advanced(), + selectSpec("playback/audioPassthrough", "Playback", "Audio passthrough", + "Sends surround soundtracks to an AV receiver or soundbar undecoded. Leave off unless one is " + "connected over HDMI or optical", + "off", kAudioPassthroughChoices, SettingTarget::AudioPassthrough) + .advanced() + .onAndroid(), selectSpec("playback/mpvConfigMode", "Playback", "mpv configuration", "Your own mpv config can change or break playback", "disabled", kMpvConfigModeChoices, SettingTarget::MpvConfigMode) diff --git a/src/app/SettingsSchema.h b/src/app/SettingsSchema.h index 08de75ed..ef3a8ad7 100644 --- a/src/app/SettingsSchema.h +++ b/src/app/SettingsSchema.h @@ -57,6 +57,7 @@ enum class SettingTarget { PlayerVolumeSlider, AudioDelay, AudioOutput, + AudioPassthrough, UiScale, ArtworkFormat, ArtworkWebpQuality, diff --git a/src/platform/android/AndroidPlatform.cpp b/src/platform/android/AndroidPlatform.cpp index 413811a5..72234d79 100644 --- a/src/platform/android/AndroidPlatform.cpp +++ b/src/platform/android/AndroidPlatform.cpp @@ -18,6 +18,7 @@ #include #include #include +#include #include @@ -273,7 +274,12 @@ PlatformCpuProbe platformCpuProbe(int logicalCpus) PlatformMemoryPolicy platformMemoryPolicy() { constexpr qint64 mib = 1024LL * 1024LL; - return { 0, 2048LL * mib, 128LL * mib, 128LL * mib, 32, 24LL * mib, 96LL * mib }; + // Physical memory, so a 1 GB stick gets the low-memory budget rather + // than the 2 GB assumed when nothing is known. + const long pages = sysconf(_SC_PHYS_PAGES); + const long pageSize = sysconf(_SC_PAGESIZE); + const qint64 total = pages > 0 && pageSize > 0 ? qint64(pages) * pageSize : 0; + return { total, 2048LL * mib, 128LL * mib, 128LL * mib, 32, 24LL * mib, 96LL * mib }; } qint64 effectiveLinuxMemoryBytes(const QByteArray&, const QByteArray&, const QByteArray&) diff --git a/src/platform/android/AndroidPlaybackSurface.cpp b/src/platform/android/AndroidPlaybackSurface.cpp index 125a2a52..4648eef7 100644 --- a/src/platform/android/AndroidPlaybackSurface.cpp +++ b/src/platform/android/AndroidPlaybackSurface.cpp @@ -1,10 +1,12 @@ #include "platform/PlatformPlaybackSurface.h" +#include "media/MediaTypes.h" #include "platform/NativeAppWindow.h" #include "player/MpvVideoItem.h" #include #include +#include #include #include #include @@ -84,11 +86,64 @@ MpvOptionProfile::Platform platformMpvOptionProfile() return MpvOptionProfile::Platform::Android; } -bool platformUsesEmbeddedVideo(const PlaybackSession&, bool directRequested) +namespace { + // MediaCodec's name for a source video codec, or empty when there is no + // single one to ask about. + QString mediaCodecMime(const QString& codec) + { + const QString name = codec.toLower(); + if (name == QLatin1String("hevc") || name == QLatin1String("h265")) + return QStringLiteral("video/hevc"); + if (name == QLatin1String("h264") || name == QLatin1String("avc")) + return QStringLiteral("video/avc"); + if (name == QLatin1String("av1")) + return QStringLiteral("video/av01"); + if (name == QLatin1String("vp9")) + return QStringLiteral("video/x-vnd.on2.vp9"); + if (name == QLatin1String("vp8")) + return QStringLiteral("video/x-vnd.on2.vp8"); + if (name == QLatin1String("mpeg2video") || name == QLatin1String("mpeg2")) + return QStringLiteral("video/mpeg2"); + if (name == QLatin1String("mpeg4")) + return QStringLiteral("video/mp4v-es"); + return {}; + } + + bool hasHardwareDecoder(const QString& mime) + { + // Enumerating codecs costs tens of milliseconds and the answer never + // changes while the app runs. + static QHash known; + static QMutex mutex; + const QMutexLocker locker(&mutex); + const auto found = known.constFind(mime); + if (found != known.constEnd()) + return *found; + const bool hardware = QJniObject::callStaticMethod( + kBridge, "hasHardwareDecoder", "(Ljava/lang/String;)Z", QJniObject::fromString(mime).object()); + known.insert(mime, hardware); + return hardware; + } +} + +bool platformUsesEmbeddedVideo(const PlaybackSession& session, bool directRequested) { // Embedded means "through the Qt scene graph". Direct is the opposite of - // it, and the only thing that decides is what the viewer asked for. - return !directRequested; + // it and what the viewer asked for, unless the device cannot decode this + // video in hardware: direct output would then show nothing, while the + // rendered path decodes in software (dav1d for AV1). + if (!directRequested) + return true; + for (const MediaStreamInfo& stream : session.mediaStreams) { + if (stream.type.compare(QLatin1String("video"), Qt::CaseInsensitive) != 0) + continue; + const QString mime = mediaCodecMime(stream.codec); + if (mime.isEmpty() || hasHardwareDecoder(mime)) + return false; + qInfo() << "playback surface: no hardware decoder for" << stream.codec << "- rendering through the GPU path"; + return true; + } + return false; } QString platformPlaybackBackendName(bool embeddedVideo) diff --git a/src/player/PlayerController.cpp b/src/player/PlayerController.cpp index 45978d2c..10d5d1ca 100644 --- a/src/player/PlayerController.cpp +++ b/src/player/PlayerController.cpp @@ -690,6 +690,7 @@ void PlayerController::prepareMpvAsync(bool needsVideoSurface, bool embeddedVide { "audio-delay", QByteArray::number(static_cast(effectiveAudioDelayMs()) / 1000.0, 'f', 3) }, { "sub-delay", QByteArray::number(static_cast(m_subtitleDelayMs.load()) / 1000.0, 'f', 3) }, { "speed", QByteArray::number(effectivePlaybackSpeed(), 'f', 3) }, + { "audio-spdif", m_audioSpdifCodecs }, }; for (auto& option : MpvOptionProfile::subtitleOptions(m_subtitlePreferences, m_tracks.subtitlesEnabled(), m_hdrPlayback)) @@ -2544,6 +2545,18 @@ void PlayerController::setAudioOutputMode(const QString& mode) emit audioOutputModeChanged(); } +void PlayerController::setAudioPassthrough(const QString& mode) +{ + const QByteArray codecs = mode == QLatin1String("all") ? QByteArrayLiteral("ac3,eac3,dts,dts-hd,truehd") + : mode == QLatin1String("dolby") ? QByteArrayLiteral("ac3,eac3") + : QByteArray(); + if (m_audioSpdifCodecs == codecs) + return; + m_audioSpdifCodecs = codecs; + qInfo() << "player: audio passthrough" << (codecs.isEmpty() ? QByteArrayLiteral("off") : codecs); + discardPreparedMpvForOptionChange("audio passthrough change"); +} + void PlayerController::setVolume(int volume) { m_volumeKnown = true; diff --git a/src/player/PlayerController.h b/src/player/PlayerController.h index b46241c3..74156ba5 100644 --- a/src/player/PlayerController.h +++ b/src/player/PlayerController.h @@ -223,6 +223,7 @@ class PlayerController final : public QObject { Q_INVOKABLE void setFileAudioDelayMs(int delayMs); Q_INVOKABLE void setSubtitleDelayMs(int delayMs); Q_INVOKABLE void setAudioOutputMode(const QString& mode); + void setAudioPassthrough(const QString& mode); // Applies to the next thing that plays: the render options are set on a // fresh mpv core, and every play request builds one. void setRenderQuality(MpvOptionProfile::RenderQuality quality); @@ -505,6 +506,7 @@ class PlayerController final : public QObject { bool m_directVideoOutput = false; bool m_hardwareDecoding = true; QByteArray m_softwareRenderer; + QByteArray m_audioSpdifCodecs; bool m_threadedStreaming = true; int m_maxStreamingThreads = 4; bool m_forceStreamingThreads = false; diff --git a/tools/android/build-dependencies.sh b/tools/android/build-dependencies.sh index 13197783..5040bff9 100755 --- a/tools/android/build-dependencies.sh +++ b/tools/android/build-dependencies.sh @@ -72,7 +72,7 @@ unset PKG_CONFIG_SYSROOT_DIR fetch_sources() { mkdir -p "$SOURCE_ROOT" "$BUILD_ROOT" local source - for source in freetype lua qcoro fribidi harfbuzz libass libplacebo; do + for source in freetype lua qcoro fribidi harfbuzz libass libplacebo dav1d; do prepare_manifest_source "$ROOT" "$MANIFEST" "$source" "$SOURCE_ROOT/$source" done bash "$ROOT/tools/prepare-streaming-sources.sh" --root "$ROOT" --output "$SOURCE_ROOT" @@ -239,6 +239,14 @@ build_text_and_gpu_deps() { -Dtest=disabled -Dcompare=disabled -Dprofile=disabled -Dfuzz=disabled \ -Dcheckasm=disabled -Dfontconfig=disabled -Dlibunibreak=disabled \ -Dasm=disabled --buildtype release + # Software AV1. No Shield and few TV boxes decode AV1 in hardware, and + # FFmpeg's own AV1 decoder only drives a hardware accelerator. The x86_64 + # emulator build skips the assembly, which would need nasm. + local dav1d_asm=true + [[ "$ABI" == x86_64 ]] && dav1d_asm=false + build_meson dav1d \ + -Denable_tools=false -Denable_examples=false -Denable_tests=false \ + -Denable_docs=false -Denable_asm="$dav1d_asm" --buildtype release build_meson libplacebo \ -Ddemos=false -Dtests=false -Dbench=false -Dfuzz=false \ -Dvulkan=disabled -Dvk-proc-addr=disabled -Dd3d11=disabled \ diff --git a/tools/manifests/android-third-party.json b/tools/manifests/android-third-party.json index 9bfc13ea..764d6f1c 100644 --- a/tools/manifests/android-third-party.json +++ b/tools/manifests/android-third-party.json @@ -37,9 +37,9 @@ "sha256": "f720b449bdf8354afd193ca90795ea7b2f9fec05c85ca9709c8ea69d4290157d" }, "libplacebo": { - "revision": "a7a18af88ff0a17c04840dcb3246047bb6b46df3", - "url": "https://codeload.github.com/haasn/libplacebo/tar.gz/a7a18af88ff0a17c04840dcb3246047bb6b46df3", - "sha256": "ba0c8c011c19cb74bcee26646d2d6070447151da89a9abdd01c9034e768de8b2", + "revision": "275f7dea27924cdd34ab2e6c20e448b6bc4fab65", + "url": "https://codeload.github.com/haasn/libplacebo/tar.gz/275f7dea27924cdd34ab2e6c20e448b6bc4fab65", + "sha256": "adbca47395410ada01414bc527e0103c716b9b758be857464c40e5ff0ec695be", "vendoredSources": { "3rdparty/fast_float": { "url": "https://codeload.github.com/fastfloat/fast_float/tar.gz/97b54ca9e75f5303507699d27c6b4f4efe4641a1", @@ -62,6 +62,11 @@ "sha256": "75967a8288ff16044a86d1af462b96d2e75c435937efb75f2bb4102ab0382f29" } } + }, + "dav1d": { + "revision": "6c7bee685677fd997a431302be4fea8ea4017606", + "url": "https://codeload.github.com/videolan/dav1d/tar.gz/6c7bee685677fd997a431302be4fea8ea4017606", + "sha256": "725d0ebe5bd19316aaaeee84a170b0f6f3930fc7cf53fa0c5bbe3c86ba1c2b15" } } } diff --git a/tools/manifests/ffmpeg-capabilities.json b/tools/manifests/ffmpeg-capabilities.json index 7229631f..766e1128 100644 --- a/tools/manifests/ffmpeg-capabilities.json +++ b/tools/manifests/ffmpeg-capabilities.json @@ -193,6 +193,7 @@ "gpl": false, "configureFlags": [ "--enable-jni", + "--enable-libdav1d", "--enable-mediacodec", "--enable-network", "--enable-openssl" @@ -201,6 +202,7 @@ "av1_mediacodec", "h264_mediacodec", "hevc_mediacodec", + "libdav1d", "mpeg2_mediacodec", "mpeg4_mediacodec", "vp8_mediacodec", diff --git a/tools/manifests/webos-third-party.json b/tools/manifests/webos-third-party.json index 5676bb78..9892f631 100644 --- a/tools/manifests/webos-third-party.json +++ b/tools/manifests/webos-third-party.json @@ -27,9 +27,9 @@ "sha256": "f720b449bdf8354afd193ca90795ea7b2f9fec05c85ca9709c8ea69d4290157d" }, "libplacebo": { - "revision": "a7a18af88ff0a17c04840dcb3246047bb6b46df3", - "url": "https://codeload.github.com/haasn/libplacebo/tar.gz/a7a18af88ff0a17c04840dcb3246047bb6b46df3", - "sha256": "ba0c8c011c19cb74bcee26646d2d6070447151da89a9abdd01c9034e768de8b2", + "revision": "275f7dea27924cdd34ab2e6c20e448b6bc4fab65", + "url": "https://codeload.github.com/haasn/libplacebo/tar.gz/275f7dea27924cdd34ab2e6c20e448b6bc4fab65", + "sha256": "adbca47395410ada01414bc527e0103c716b9b758be857464c40e5ff0ec695be", "vendoredSources": { "3rdparty/fast_float": { "revision": "97b54ca9e75f5303507699d27c6b4f4efe4641a1", diff --git a/tools/windows/build-mpv.ps1 b/tools/windows/build-mpv.ps1 index 0644c8d1..e223ac49 100644 --- a/tools/windows/build-mpv.ps1 +++ b/tools/windows/build-mpv.ps1 @@ -116,7 +116,7 @@ depth = 1 @' [wrap-git] url = https://code.videolan.org/videolan/libplacebo.git -revision = a7a18af88ff0a17c04840dcb3246047bb6b46df3 +revision = 275f7dea27924cdd34ab2e6c20e448b6bc4fab65 depth = 1 clone-recursive = true '@ | Set-Content -LiteralPath (Join-Path $subprojects 'libplacebo.wrap') -Encoding ascii From 12cb5532c51d11afa1fb0a1a979d5b6970dd5195 Mon Sep 17 00:00:00 2001 From: Sacha Korban Date: Fri, 27 Nov 2026 02:50:05 +1100 Subject: [PATCH 06/39] build(deps): refresh pinned media toolchains for the 0.10.2 release Consolidate the release milestone ending at 1fe7a21ea553e83cf08322f39033db8ec52e5789. Original starting snapshot: 3b7debf504ba44e10bb2275adae1436746dabbbe. --- .github/workflows/build-artifacts.yml | 20 ++-- SECURITY.md | 2 +- VERSION | 2 +- app/com.sachk.spool.metainfo.xml | 3 + build-ipk.sh | 6 +- flake.lock | 36 +++---- flake.nix | 49 +++++++--- mpv | 2 +- packaging/aur/.SRCINFO | 6 +- packaging/aur/PKGBUILD | 2 +- src/platform/PlatformStreamingMemory.cpp | 2 +- tests/media/FfmpegComplianceTest.cpp | 9 +- tests/providers/ScriptRuntimeTest.cpp | 5 +- tools/android/build-qt6.sh | 5 +- tools/manifests/ffmpeg-vex.json | 12 +-- tools/manifests/qt-android-6.11.json | 20 ---- tools/manifests/qt-android.json | 20 ++++ tools/manifests/qt-webos-6.11.json | 46 --------- tools/manifests/qt-webos.json | 47 +++++++++ tools/manifests/qt-windows-6.11.json | 43 -------- tools/manifests/qt-windows.json | 43 ++++++++ tools/manifests/streaming-third-party.json | 24 ++--- tools/manifests/toolchain.json | 97 +++++++++---------- tools/manifests/windows-proton.json | 4 +- .../ffmpeg-fate-hls-fixed-slice-count.patch | 24 ----- .../qt-cocoa-pending-fullscreen-state.patch | 24 ++--- tools/toolchain-versions.sh | 6 +- tools/webos-native/build-qcoro.sh | 2 +- .../{build-qt6-611.sh => build-qt6.sh} | 7 +- tools/webos-native/build-webos.sh | 6 +- tools/webos-native/patches/README.md | 26 ++--- .../qtbase-6.12-webos-mt-tool-palm.patch | 14 +++ ... => qtbase-6.12-webos-no-cursor-set.patch} | 0 ...tch => qtbase-6.12-webos-qelfparser.patch} | 0 ...2-webos-qplatformwindow-private-moc.patch} | 0 ...tbase-6.12-webos-qstorageinfo-linux.patch} | 0 ...ebos-wayland-no-opengl-forward-decl.patch} | 0 ...2-qmlimportscanner-exclude-subtrees.patch} | 0 ...twayland-6.12-webos-wayland-version.patch} | 0 tools/webos-native/restore-toolchain.sh | 2 +- .../windows/build-streaming-dependencies.ps1 | 8 ++ tools/windows/install-qt.ps1 | 2 +- 42 files changed, 333 insertions(+), 293 deletions(-) delete mode 100644 tools/manifests/qt-android-6.11.json create mode 100644 tools/manifests/qt-android.json delete mode 100644 tools/manifests/qt-webos-6.11.json create mode 100644 tools/manifests/qt-webos.json delete mode 100644 tools/manifests/qt-windows-6.11.json create mode 100644 tools/manifests/qt-windows.json delete mode 100644 tools/patches/ffmpeg-fate-hls-fixed-slice-count.patch rename tools/webos-native/{build-qt6-611.sh => build-qt6.sh} (99%) create mode 100644 tools/webos-native/patches/qtbase-6.12-webos-mt-tool-palm.patch rename tools/webos-native/patches/{qtbase-6.11-webos-no-cursor-set.patch => qtbase-6.12-webos-no-cursor-set.patch} (100%) rename tools/webos-native/patches/{qtbase-6.11-webos-qelfparser.patch => qtbase-6.12-webos-qelfparser.patch} (100%) rename tools/webos-native/patches/{qtbase-6.11-webos-qplatformwindow-private-moc.patch => qtbase-6.12-webos-qplatformwindow-private-moc.patch} (100%) rename tools/webos-native/patches/{qtbase-6.11-webos-qstorageinfo-linux.patch => qtbase-6.12-webos-qstorageinfo-linux.patch} (100%) rename tools/webos-native/patches/{qtbase-6.11-webos-wayland-no-opengl-forward-decl.patch => qtbase-6.12-webos-wayland-no-opengl-forward-decl.patch} (100%) rename tools/webos-native/patches/{qtdeclarative-6.11-qmlimportscanner-exclude-subtrees.patch => qtdeclarative-6.12-qmlimportscanner-exclude-subtrees.patch} (100%) rename tools/webos-native/patches/{qtwayland-6.11-webos-wayland-version.patch => qtwayland-6.12-webos-wayland-version.patch} (100%) diff --git a/.github/workflows/build-artifacts.yml b/.github/workflows/build-artifacts.yml index de3ced96..b8367bc0 100644 --- a/.github/workflows/build-artifacts.yml +++ b/.github/workflows/build-artifacts.yml @@ -955,15 +955,15 @@ jobs: with: path: | build/webos-sdk - build/qt6-611-host-install - build/qt6-611-target-static-install - build/qt6-611-target-install + build/qt6-612-host-install + build/qt6-612-target-static-install + build/qt6-612-target-install build/webos-thirdparty-build build/webos-qcoro build/third_party .ccache mpv/build/webos-libmpv - key: webos3-${{ runner.os }}-${{ hashFiles('tools/manifests/streaming-third-party.json', 'tools/prepare-streaming-sources.sh', 'tools/streaming-fingerprint.py', 'tools/check-streaming-dependencies.py', 'tools/cmake/StreamingDependencies.cmake', 'tools/cmake/QuicBatchingProbe/CMakeLists.txt', 'tools/lib/streaming-build.sh', 'tools/patches/curl-*.patch', 'tools/windows/build-streaming-dependencies.ps1', 'flake.nix', 'flake.lock', 'mpv/meson.build', 'build-ipk.sh', 'tools/package-audit.py', 'tools/lib/*.sh', 'tools/manifests/ffmpeg-capabilities.json', 'tools/manifests/toolchain.json', 'tools/manifests/mpv-native.json', 'tools/manifests/qt-webos-6.11.json', 'tools/manifests/webos-third-party.json', 'tools/webos-native/**') }} + key: webos3-${{ runner.os }}-${{ hashFiles('tools/manifests/streaming-third-party.json', 'tools/prepare-streaming-sources.sh', 'tools/streaming-fingerprint.py', 'tools/check-streaming-dependencies.py', 'tools/cmake/StreamingDependencies.cmake', 'tools/cmake/QuicBatchingProbe/CMakeLists.txt', 'tools/lib/streaming-build.sh', 'tools/patches/curl-*.patch', 'tools/windows/build-streaming-dependencies.ps1', 'flake.nix', 'flake.lock', 'mpv/meson.build', 'build-ipk.sh', 'tools/package-audit.py', 'tools/lib/*.sh', 'tools/manifests/ffmpeg-capabilities.json', 'tools/manifests/toolchain.json', 'tools/manifests/mpv-native.json', 'tools/manifests/qt-webos.json', 'tools/manifests/webos-third-party.json', 'tools/webos-native/**') }} restore-keys: | webos3-${{ runner.os }}- webos2-${{ runner.os }}- @@ -995,9 +995,9 @@ jobs: with: path: | build/webos-sdk - build/qt6-611-host-install - build/qt6-611-target-static-install - build/qt6-611-target-install + build/qt6-612-host-install + build/qt6-612-target-static-install + build/qt6-612-target-install build/webos-thirdparty-build build/webos-qcoro build/third_party @@ -1176,7 +1176,7 @@ jobs: build/android/qt build/android/deps build/android/qcoro - key: android6-${{ matrix.abi }}-${{ runner.os }}-${{ steps.cache-inputs.outputs.mpv }}-${{ steps.cache-inputs.outputs.toolchain }}-${{ hashFiles('tools/manifests/streaming-third-party.json', 'tools/prepare-streaming-sources.sh', 'tools/streaming-fingerprint.py', 'tools/check-streaming-dependencies.py', 'tools/cmake/StreamingDependencies.cmake', 'tools/cmake/QuicBatchingProbe/CMakeLists.txt', 'tools/lib/streaming-build.sh', 'tools/patches/curl-*.patch', 'tools/windows/build-streaming-dependencies.ps1', 'tools/android/build-dependencies.sh', 'tools/android/build-qt6.sh', 'tools/android/patches/*.patch', 'tools/ffmpeg-capabilities.py', 'tools/lib/build-common.sh', 'tools/lib/manifest-sources.sh', 'tools/manifests/android-third-party.json', 'tools/manifests/ffmpeg-capabilities.json', 'tools/manifests/toolchain.json', 'tools/manifests/qt-android-6.11.json') }} + key: android6-${{ matrix.abi }}-${{ runner.os }}-${{ steps.cache-inputs.outputs.mpv }}-${{ steps.cache-inputs.outputs.toolchain }}-${{ hashFiles('tools/manifests/streaming-third-party.json', 'tools/prepare-streaming-sources.sh', 'tools/streaming-fingerprint.py', 'tools/check-streaming-dependencies.py', 'tools/cmake/StreamingDependencies.cmake', 'tools/cmake/QuicBatchingProbe/CMakeLists.txt', 'tools/lib/streaming-build.sh', 'tools/patches/curl-*.patch', 'tools/windows/build-streaming-dependencies.ps1', 'tools/android/build-dependencies.sh', 'tools/android/build-qt6.sh', 'tools/android/patches/*.patch', 'tools/ffmpeg-capabilities.py', 'tools/lib/build-common.sh', 'tools/lib/manifest-sources.sh', 'tools/manifests/android-third-party.json', 'tools/manifests/ffmpeg-capabilities.json', 'tools/manifests/toolchain.json', 'tools/manifests/qt-android.json') }} - name: Build cached Android toolchains if: ${{ steps.android-cache.outputs.cache-hit != 'true' }} @@ -1434,7 +1434,7 @@ jobs: path: | C:\Qt\${{ needs.toolchain.outputs.qt_version }}\${{ needs.toolchain.outputs.qt_windows_kit }} C:\Qt\${{ needs.toolchain.outputs.qcoro_windows_prefix }} - key: windows-qt-${{ needs.toolchain.outputs.qt_version }}-qcoro-${{ needs.toolchain.outputs.qcoro_revision }}-${{ hashFiles('tools/manifests/qt-windows-6.11.json') }} + key: windows-qt-${{ needs.toolchain.outputs.qt_version }}-qcoro-${{ needs.toolchain.outputs.qcoro_revision }}-${{ hashFiles('tools/manifests/qt-windows.json') }} - name: Install Qt from pinned official archives if: steps.qt-cache.outputs.cache-hit != 'true' @@ -1453,7 +1453,7 @@ jobs: path: | C:\Qt\${{ needs.toolchain.outputs.qt_version }}\${{ needs.toolchain.outputs.qt_windows_kit }} C:\Qt\${{ needs.toolchain.outputs.qcoro_windows_prefix }} - key: windows-qt-${{ needs.toolchain.outputs.qt_version }}-qcoro-${{ needs.toolchain.outputs.qcoro_revision }}-${{ hashFiles('tools/manifests/qt-windows-6.11.json') }} + key: windows-qt-${{ needs.toolchain.outputs.qt_version }}-qcoro-${{ needs.toolchain.outputs.qcoro_revision }}-${{ hashFiles('tools/manifests/qt-windows.json') }} - name: Read mpv revision id: mpv-revision diff --git a/SECURITY.md b/SECURITY.md index 9da7637c..a9c3367d 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -26,4 +26,4 @@ HTTP may be used only for an explicitly approved local address. Credentials are Release packages carry CycloneDX, SPDX and Syft SBOMs plus Grype results. Publication fails on fixed High or Critical findings. Scheduled rescans use the same policy. -`tools/manifests/ffmpeg-vex.json` records upstream fixes present in the SHA-256-pinned FFmpeg 9.0.2 archive for CVE-2026-75146, CVE-2026-75142 and CVE-2026-75147. Grype's commit-based advisory ranges currently report those fixes as missing from release versions. The generated `ffmpeg-vex.json` scopes this evidence to the Spool release and exact FFmpeg package version; other versions, components and advisories remain subject to the severity gate. +`tools/manifests/ffmpeg-vex.json` records upstream fixes present in the SHA-256-pinned FFmpeg 9.1 archive for CVE-2026-75146, CVE-2026-75142 and CVE-2026-75147. Grype's commit-based advisory ranges currently report those fixes as missing from release versions. The generated `ffmpeg-vex.json` scopes this evidence to the Spool release and exact FFmpeg package version; other versions, components and advisories remain subject to the severity gate. diff --git a/VERSION b/VERSION index 57121573..5eef0f10 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.10.1 +0.10.2 diff --git a/app/com.sachk.spool.metainfo.xml b/app/com.sachk.spool.metainfo.xml index 21b5bc77..011d1c4b 100644 --- a/app/com.sachk.spool.metainfo.xml +++ b/app/com.sachk.spool.metainfo.xml @@ -21,6 +21,9 @@ Spool + +

Streaming learns each server: playback reads several ranges at once, measures how many requests and how large a range a path rewards, falls back from HTTP/3 and HTTP/2 when a server mishandles them, and remembers what it learned. On distant servers ranges grow with the path, so a 300 ms connection that barely started a high-bitrate stream now sustains several times the rate. Each server can have its own playback settings, from quality limits to the HTTP version. On Android, AV1 plays on devices without an AV1 decoder, including every Nvidia Shield TV, a file the hardware cannot decode no longer plays as a black picture in direct output, surround soundtracks can be passed through to a receiver, and 1 GB Fire TV sticks get their low-memory budget. Built on Qt 6.12, mpv 0.42, FFmpeg 9.1 and curl 8.23, which fix CVE-2026-123095 and CVE-2026-92392 among others. Remote focus on Home, taps during refreshes and browsing state across provider refreshes are fixed.

+

On a television, a text field's keyboard now opens when OK is released, so it no longer closes again at once and submits an empty entry. Plex no longer asks for the PIN of the account the device signed in with, which Plex itself does not require, and empty PINs are never sent. Updates download over two connections and install as soon as they are verified, without a second press. A saved account that fails to open now says so in the log.

diff --git a/build-ipk.sh b/build-ipk.sh index 702b9f3d..c3727d4d 100755 --- a/build-ipk.sh +++ b/build-ipk.sh @@ -65,7 +65,7 @@ MPV_SRC="${MPV_SRC:-$ROOT/mpv}" MPV_BUILD="${MPV_BUILD:-$MPV_SRC/build/webos-libmpv}" WEBOS_CROSS_FILE="${WEBOS_CROSS_FILE:-$ROOT/build/webos-thirdparty-build/webos.cross.ini}" FFMPEG_CAPABILITY_MANIFEST="${FFMPEG_CAPABILITY_MANIFEST:-$ROOT/tools/manifests/ffmpeg-capabilities.json}" -QT_MANIFEST="${QT_MANIFEST:-$ROOT/tools/manifests/qt-webos-6.11.json}" +QT_MANIFEST="${QT_MANIFEST:-$ROOT/tools/manifests/qt-webos.json}" QT_VERSION="$(manifest_qt_field "$QT_MANIFEST" qtVersion)" QT_BUILD_TAG="${QT_VERSION%.*}" QT_BUILD_TAG="${QT_BUILD_TAG//./}" @@ -103,7 +103,7 @@ if (( DO_BUILD || DO_STAGE )); then if [[ ! -f "$QT6_PREFIX/lib/libQt6Core.a" ]]; then echo "error: static Qt6 install not found at $QT6_PREFIX" >&2 - echo " Run: QT_STATIC=1 bash $WEBOS_TOOLS_ROOT/build-qt6-611.sh target" >&2 + echo " Run: QT_STATIC=1 bash $WEBOS_TOOLS_ROOT/build-qt6.sh target" >&2 exit 1 fi echo "Using static Qt6 build at $QT6_PREFIX" @@ -123,7 +123,7 @@ if (( DO_BUILD || DO_STAGE )); then if ! grep -Fqx '#define QT_FEATURE_ssl 1' "$QT_NETWORK_CONFIG" 2>/dev/null \ || ! grep -Fqx '#define QT_FEATURE_openssl_linked 1' "$QT_CORE_CONFIG" 2>/dev/null; then echo "error: Qt at $QT6_PREFIX was built without linked TLS support." >&2 - echo " Rerun: QT_STATIC=1 bash $WEBOS_TOOLS_ROOT/build-qt6-611.sh target" >&2 + echo " Rerun: QT_STATIC=1 bash $WEBOS_TOOLS_ROOT/build-qt6.sh target" >&2 exit 1 fi diff --git a/flake.lock b/flake.lock index 7c486f7e..1f2dc696 100644 --- a/flake.lock +++ b/flake.lock @@ -4,27 +4,29 @@ "flake": false, "locked": { "lastModified": 1792950923, - "narHash": "sha256-PYi21y7uAZUsbn9nqn4ZP8QB9iQ9pRvnIKdOtG0WeIw=", - "owner": "haasn", - "repo": "libplacebo", + "narHash": "sha256-9CQhW/3CCUnjo0iDleKhcfZlMYVfHijqLE+oND4Wkeg=", + "ref": "refs/heads/master", "rev": "275f7dea27924cdd34ab2e6c20e448b6bc4fab65", - "type": "github" + "revCount": 4051, + "submodules": true, + "type": "git", + "url": "https://github.com/haasn/libplacebo" }, "original": { - "owner": "haasn", - "repo": "libplacebo", "rev": "275f7dea27924cdd34ab2e6c20e448b6bc4fab65", - "type": "github" + "submodules": true, + "type": "git", + "url": "https://github.com/haasn/libplacebo" } }, "mpv-src": { "flake": false, "locked": { - "lastModified": 1795191261, - "narHash": "sha256-nVtQSmxrdcDuKIv4Meh7Kr/iivZGxYXHDM1S45XPPAM=", + "lastModified": 1795215955, + "narHash": "sha256-W3o88zocNkbJyOHsShn9la9ZMwYqQwhM/0tX5EKiI1g=", "ref": "refs/heads/net/integration", - "rev": "12b98730c08c11dc159a44a3f2882c346d2360e2", - "revCount": 56224, + "rev": "8eb31c4d7745d650bc3531cb90e140d53f81e571", + "revCount": 56227, "type": "git", "url": "file:./mpv" }, @@ -35,11 +37,11 @@ }, "nixpkgs": { "locked": { - "lastModified": 1788881743, - "narHash": "sha256-2V9GZGvPfrNzxFozhI9dcqV+c3QdA8YZrvAAzqEB+dI=", + "lastModified": 1795085501, + "narHash": "sha256-S5keGWzaKpuXo9MNoIC2FfTIuTyTnx8P4NhYJMEsTLI=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "d6524aaca2ff07876657ae2b323f24be4874944b", + "rev": "0bb8272318b4ca41bf0edc6224df3e3e3046b70d", "type": "github" }, "original": { @@ -51,11 +53,11 @@ }, "nixpkgs-x86-darwin": { "locked": { - "lastModified": 1788966248, - "narHash": "sha256-F36C+08KdnP1gQ6bu9Ok+UKg50A5EVSZOeGqg+hjoO0=", + "lastModified": 1795147381, + "narHash": "sha256-8Zhru7g6o6N01kCIHIPXwt8gSp982cPzph/rXPVfzXc=", "owner": "NixOS", "repo": "nixpkgs", - "rev": "104a7c61006cd22d11c0379663afee90c62273ab", + "rev": "ca9c2429e2d01d6e75541ba92ef4e62faad696e2", "type": "github" }, "original": { diff --git a/flake.nix b/flake.nix index eea0f65d..764a79ee 100644 --- a/flake.nix +++ b/flake.nix @@ -12,7 +12,7 @@ # 26.05 darwin branch, which is maintained to the end of 2026. nixpkgs-x86-darwin.url = "github:NixOS/nixpkgs/nixpkgs-26.05-darwin"; libplacebo-src = { - url = "github:haasn/libplacebo/275f7dea27924cdd34ab2e6c20e448b6bc4fab65?submodules=1"; + url = "git+https://github.com/haasn/libplacebo?rev=275f7dea27924cdd34ab2e6c20e448b6bc4fab65&submodules=1"; flake = false; }; qcoro-src = { @@ -30,7 +30,7 @@ systems = [ "x86_64-linux" "aarch64-darwin" "x86_64-darwin" ]; androidToolchain = - builtins.fromJSON (builtins.readFile ./tools/manifests/qt-android-6.11.json); + builtins.fromJSON (builtins.readFile ./tools/manifests/qt-android.json); androidSdkArgs = { platformVersions = [ androidToolchain.android.compileSdk ]; buildToolsVersions = [ androidToolchain.android.buildTools ]; @@ -102,11 +102,15 @@ # building the same bytes. source = pkgs.fetchurl { inherit (ffmpegPin) url; hash = ffmpegPin.sri; }; }).overrideAttrs (old: { - # Keep the genuine HLS seek fixture/reference unchanged across - # CPU counts; the direct generator otherwise auto-slices video. - patches = (old.patches or []) ++ [ - ./tools/patches/ffmpeg-fate-hls-fixed-slice-count.patch - ]; + # The pinned release already carries the OpenAPV 1.1 fix that + # nixpkgs backports to older FFmpeg; applying it again fails. + patches = builtins.filter + (patch: !pkgs.lib.hasInfix "openapv-1.1-compat" (toString patch)) + (old.patches or []); + # FFmpeg 9.1 removed the OpenGL output device and its switch. + configureFlags = builtins.filter + (flag: flag != "--enable-opengl" && flag != "--disable-opengl") + (old.configureFlags or []); }); in if pkgs ? ffmpeg_9-full @@ -184,8 +188,14 @@ !(nixpkgs.lib.hasPrefix "--enable-" flag) || builtins.elem flag structuralEnableFlags; in { - spoolFfmpeg = ((spoolFfmpegFor prev).override - (nixpkgs.lib.genAttrs ffmpegCapabilities.disabledNixFeatures (_: false))).overrideAttrs (old: { + # A feature nixpkgs no longer offers is off already; passing its + # switch anyway would fail evaluation. + spoolFfmpeg = (let + base = spoolFfmpegFor prev; + offered = nixpkgs.lib.functionArgs base.override; + in base.override (nixpkgs.lib.genAttrs + (builtins.filter (feature: offered ? ${feature}) ffmpegCapabilities.disabledNixFeatures) + (_: false))).overrideAttrs (old: { doCheck = false; configureFlags = builtins.filter keepInheritedFlag old.configureFlags @@ -212,7 +222,20 @@ qt6 = (prev.qt6.overrideScope (_qtFinal: qtPrev: { inherit srcs; # qtbase takes its source directly; the other modules use qtModule. - qtbase = qtPrev.qtbase.override { inherit (srcs.qtbase) src version; }; + # nixpkgs-26.05-darwin carries its 6.11 qmlimportscanner and + # macdeployqt patches, which do not apply to the pinned release; + # take the consolidated replacement the 6.12 channel ships. + qtbase = (qtPrev.qtbase.override { inherit (srcs.qtbase) src version; }).overrideAttrs (old: { + patches = let + superseded = [ "find-qmlimportscanner.patch" "qmlimportscanner-import-path.patch" + "skip-missing-qml-directory.patch" "515cbbacfba9f4259c9c3b0714a31222c2b4c879.diff" ]; + stale = patch: builtins.any (s: nixpkgs.lib.hasSuffix s (baseNameOf (toString patch))) superseded; + inherited = old.patches or []; + in if builtins.any stale inherited + then builtins.filter (patch: !stale patch) inherited + ++ [ "${nixpkgs}/pkgs/development/libraries/qt-6/modules/qtbase/macdeployqt-fixes.patch" ] + else inherited; + }); qtModule = qtPrev.qtModule.override { inherit srcs; }; qtdeclarative = qtPrev.qtdeclarative.overrideAttrs (old: { # The Intel maintenance channel backports this TableView fix. @@ -507,7 +530,7 @@ --prefix QML2_IMPORT_PATH : "$qml_import_path" ''; - # Shell used by tools/webos-native/build-qt6-611.sh. No nixpkgs Qt here. + # Shell used by tools/webos-native/build-qt6.sh. No nixpkgs Qt here. sourceBuildPackages = pkgs: basePackages pkgs ++ pkgs.lib.optionals pkgs.stdenv.hostPlatform.isLinux (sourceLinuxPackages pkgs) @@ -608,7 +631,7 @@ nativeShellHook = pkgs: commonShellHook pkgs + '' # This shell intentionally includes Spool's tailored nixpkgs Qt # (spoolQt6) for native Linux/macOS development. Do not use it for - # tools/webos-native/build-qt6-611.sh. + # tools/webos-native/build-qt6.sh. export SPOOL_QT_CMAKE_DIR="${pkgs.spoolQt6.qtbase}/lib/cmake/Qt6" native_qt_cmake_path="${pkgs.spoolQt6.qtbase}:${pkgs.spoolQt6.qtdeclarative}:${pkgs.spoolQt6.qtsvg}:${pkgs.spoolQt6.qttools}:${pkgs.spoolQt6.qtwebsockets}:${pkgs.spoolQt6.qtshadertools}" export CMAKE_PREFIX_PATH="$native_qt_cmake_path''${CMAKE_PREFIX_PATH:+:$CMAKE_PREFIX_PATH}" @@ -652,7 +675,7 @@ # scanner exclusions. Upstream -exclude alone skips only the # named directory's direct files, not its vendored descendants. patches = (old.patches or []) ++ [ - ./tools/webos-native/patches/qtdeclarative-6.11-qmlimportscanner-exclude-subtrees.patch + ./tools/webos-native/patches/qtdeclarative-6.12-qmlimportscanner-exclude-subtrees.patch ]; # Match the webOS host-tools profile: without an imported qsb, # qtdeclarative skips Quick, Controls and styles, not QML tools. diff --git a/mpv b/mpv index 12b98730..8eb31c4d 160000 --- a/mpv +++ b/mpv @@ -1 +1 @@ -Subproject commit 12b98730c08c11dc159a44a3f2882c346d2360e2 +Subproject commit 8eb31c4d7745d650bc3531cb90e140d53f81e571 diff --git a/packaging/aur/.SRCINFO b/packaging/aur/.SRCINFO index 103e2952..8847c077 100644 --- a/packaging/aur/.SRCINFO +++ b/packaging/aur/.SRCINFO @@ -1,6 +1,6 @@ pkgbase = spool-bin pkgdesc = Fast media player for desktop and TV, built on Qt Quick and mpv - pkgver = 0.10.1 + pkgver = 0.10.2 pkgrel = 1 url = https://github.com/spool-player/spool arch = x86_64 @@ -9,12 +9,12 @@ pkgbase = spool-bin depends = glibc depends = libglvnd depends = mesa - provides = spool=0.10.1 + provides = spool=0.10.2 conflicts = spool options = !strip options = !debug options = !lto - source = https://github.com/spool-player/spool/releases/download/v0.10.1/Spool-0.10.1-linux-x86_64.tar.zst + source = https://github.com/spool-player/spool/releases/download/v0.10.2/Spool-0.10.2-linux-x86_64.tar.zst sha256sums = SKIP pkgname = spool-bin diff --git a/packaging/aur/PKGBUILD b/packaging/aur/PKGBUILD index bafc0fc4..4247c16f 100644 --- a/packaging/aur/PKGBUILD +++ b/packaging/aur/PKGBUILD @@ -1,7 +1,7 @@ # Maintainer: Sacha Korban pkgname=spool-bin -pkgver=0.10.1 +pkgver=0.10.2 pkgrel=1 pkgdesc='Fast media player for desktop and TV, built on Qt Quick and mpv' arch=('x86_64') diff --git a/src/platform/PlatformStreamingMemory.cpp b/src/platform/PlatformStreamingMemory.cpp index e892eb5f..601071ee 100644 --- a/src/platform/PlatformStreamingMemory.cpp +++ b/src/platform/PlatformStreamingMemory.cpp @@ -121,7 +121,7 @@ PlatformStreamingMemoryState platformStreamingMemoryState() && host_statistics64(host, HOST_VM_INFO64, reinterpret_cast(&state), &count) == KERN_SUCCESS; mach_port_deallocate(mach_task_self(), host); if (success) - return { qint64(state.free_count + state.inactive_count) * pageSize, true }; + return { qint64(state.free_count + state.inactive_count) * qint64(pageSize), true }; #endif #endif return {}; diff --git a/tests/media/FfmpegComplianceTest.cpp b/tests/media/FfmpegComplianceTest.cpp index 3d3717b6..b95a5812 100644 --- a/tests/media/FfmpegComplianceTest.cpp +++ b/tests/media/FfmpegComplianceTest.cpp @@ -139,8 +139,13 @@ SPOOL_TEST_MAIN("ffmpeg-compliance") }); requireNoUnexpected(FfmpegCapabilities::kBitstreamFilters, "bitstream filter", [](const auto& visit) { void *opaque = nullptr; - while (const AVBitStreamFilter *filter = av_bsf_iterate(&opaque)) - visit(filter->name); + while (const AVBitStreamFilter *filter = av_bsf_iterate(&opaque)) { + // FFmpeg 9.1 always builds these endpoints of its bitstream filter + // graphs, like the buffer filters; configure cannot leave them out. + const std::string_view name = filter->name; + if (name != "source" && name != "sink") + visit(name); + } }); requireNoUnexpected(FfmpegCapabilities::kProtocols, "input protocol", [](const auto& visit) { void *opaque = nullptr; diff --git a/tests/providers/ScriptRuntimeTest.cpp b/tests/providers/ScriptRuntimeTest.cpp index 8504d382..4bf7198c 100644 --- a/tests/providers/ScriptRuntimeTest.cpp +++ b/tests/providers/ScriptRuntimeTest.cpp @@ -203,7 +203,10 @@ SPOOL_TEST_MAIN("script-runtime") require(false, failure); }; requireNonce(!nonce.isEmpty(), "benchmark cache-busting nonce is empty"); - requireNonce(!speedNonces.contains(nonce), "benchmark cache-busting nonce is duplicated"); + // Qt may resend a GET whose reply this fixture cut short; that is + // the same request again, not a reused cache-busting nonce. + requireNonce(target.path() == QStringLiteral("/speed-truncated") || !speedNonces.contains(nonce), + "benchmark cache-busting nonce is duplicated"); speedNonces.insert(nonce); require(!request.contains("Cookie:"), "benchmark does not load shared cookies"); require(request.contains("Accept-Encoding: identity"), "benchmark requests uncompressed bytes"); diff --git a/tools/android/build-qt6.sh b/tools/android/build-qt6.sh index 8d93da0c..be338279 100755 --- a/tools/android/build-qt6.sh +++ b/tools/android/build-qt6.sh @@ -7,7 +7,7 @@ source "$ROOT/tools/lib/manifest-sources.sh" PHASE="${1:-all}" ABI="${ANDROID_ABI:-x86_64}" -MANIFEST="${QT_ANDROID_MANIFEST:-$ROOT/tools/manifests/qt-android-6.11.json}" +MANIFEST="${QT_ANDROID_MANIFEST:-$ROOT/tools/manifests/qt-android.json}" QT_VERSION="$(manifest_qt_field "$MANIFEST" qtVersion)" QT_BASE_URL="$(manifest_qt_field "$MANIFEST" baseUrl)" QT_HOST_PATH="${SPOOL_ANDROID_QT_HOST:-}" @@ -73,7 +73,7 @@ require_environment() { exit 1 } [[ -n "$QT_HOST_PATH" && -x "$QT_HOST_PATH/libexec/moc" ]] || { - echo "error: SPOOL_ANDROID_QT_HOST must name the Qt 6.11 host-tools prefix" >&2 + echo "error: SPOOL_ANDROID_QT_HOST must name the host-tools prefix of the pinned Qt" >&2 exit 1 } } @@ -145,6 +145,7 @@ build_qtbase() { -B "$BUILD_ROOT/qtbase" \ -GNinja \ -DANDROID_PLATFORM="android-$ANDROID_API" \ + -DQT_ALLOW_DOWNLOAD=ON \ -DQT_BUILD_TESTS=OFF \ -DGLESv2_INCLUDE_DIR="$NDK_SYSROOT/usr/include" \ -DEGL_INCLUDE_DIR="$NDK_SYSROOT/usr/include" \ diff --git a/tools/manifests/ffmpeg-vex.json b/tools/manifests/ffmpeg-vex.json index 0bf5e097..c2504ac3 100644 --- a/tools/manifests/ffmpeg-vex.json +++ b/tools/manifests/ffmpeg-vex.json @@ -7,21 +7,21 @@ "statements": [ { "vulnerability": { "name": "CVE-2026-75146" }, - "products": [{ "@id": "pkg:generic/ffmpeg@9.0.2" }], + "products": [{ "@id": "pkg:generic/ffmpeg@9.1" }], "status": "fixed", - "action_statement": "The SHA-256-pinned official FFmpeg 9.0.2 archive contains upstream fix 65b0dab903e5975e036b30ecc58f5935d4f151e0: libavformat/dashdec.c clamps negative cur_seq_no and checks cur_seq_no >= 0 before fragments indexing. https://github.com/FFmpeg/FFmpeg/commit/65b0dab903e5975e036b30ecc58f5935d4f151e0" + "action_statement": "The SHA-256-pinned official FFmpeg 9.1 archive contains upstream fix 65b0dab903e5975e036b30ecc58f5935d4f151e0: libavformat/dashdec.c clamps negative cur_seq_no and checks cur_seq_no >= 0 before fragments indexing. https://github.com/FFmpeg/FFmpeg/commit/65b0dab903e5975e036b30ecc58f5935d4f151e0" }, { "vulnerability": { "name": "CVE-2026-75142" }, - "products": [{ "@id": "pkg:generic/ffmpeg@9.0.2" }], + "products": [{ "@id": "pkg:generic/ffmpeg@9.1" }], "status": "fixed", - "action_statement": "The SHA-256-pinned official FFmpeg 9.0.2 archive contains upstream fix 9d786e4b5e9b8482651928574de33772aeee7be1: libavformat/mpegenc.c rejects get_system_header_size(ctx) > 128 - 14 during mpeg_mux_init. https://github.com/FFmpeg/FFmpeg/commit/9d786e4b5e9b8482651928574de33772aeee7be1" + "action_statement": "The SHA-256-pinned official FFmpeg 9.1 archive contains upstream fix 9d786e4b5e9b8482651928574de33772aeee7be1: libavformat/mpegenc.c rejects get_system_header_size(ctx) > 128 - 14 during mpeg_mux_init. https://github.com/FFmpeg/FFmpeg/commit/9d786e4b5e9b8482651928574de33772aeee7be1" }, { "vulnerability": { "name": "CVE-2026-75147" }, - "products": [{ "@id": "pkg:generic/ffmpeg@9.0.2" }], + "products": [{ "@id": "pkg:generic/ffmpeg@9.1" }], "status": "fixed", - "action_statement": "The SHA-256-pinned official FFmpeg 9.0.2 archive contains upstream fix 983dae9c19f46c87d597598c0fd2f2fcee0ad2f8: libavformat/rtpenc_av1.c consumes LEB bytes then rejects obu_size > (uint32_t) rem_size before advancing the payload pointer. https://github.com/FFmpeg/FFmpeg/commit/983dae9c19f46c87d597598c0fd2f2fcee0ad2f8" + "action_statement": "The SHA-256-pinned official FFmpeg 9.1 archive contains upstream fix 983dae9c19f46c87d597598c0fd2f2fcee0ad2f8: libavformat/rtpenc_av1.c consumes LEB bytes then rejects obu_size > (uint32_t) rem_size before advancing the payload pointer. https://github.com/FFmpeg/FFmpeg/commit/983dae9c19f46c87d597598c0fd2f2fcee0ad2f8" } ] } diff --git a/tools/manifests/qt-android-6.11.json b/tools/manifests/qt-android-6.11.json deleted file mode 100644 index 24f498c2..00000000 --- a/tools/manifests/qt-android-6.11.json +++ /dev/null @@ -1,20 +0,0 @@ -{ - "schemaVersion": 1, - "qtVersion": "6.11.2", - "series": "6.11", - "baseUrl": "https://ftp.fau.de/qtproject/archive/qt/6.11/6.11.2/submodules", - "modules": [ - {"name": "qtbase", "sha256": "5b2e00eccaf5a4d8c14134ffa0ea8dfd0a35ae1ffc7f8d87fa4305a1ed23cf22"}, - {"name": "qtshadertools", "sha256": "805046b8b7757665586890b375940047e874ae3ab00adb6d3f2b38fc6b200b1c"}, - {"name": "qtdeclarative", "sha256": "215b7b70517e380123eabc6b92243f3c47b6f016a91d126057dbe53551c6b430"}, - {"name": "qtsvg", "sha256": "d594337feca84c26fb67fe87b85e6a5c12fda404b611d905f9d138210c311876"}, - {"name": "qtimageformats", "sha256": "cecd8900f34b6550076309bc94f62f828008b633a4239e0a08c86788f41001f8"}, - {"name": "qtwebsockets", "sha256": "2bfe25c383c37f7690e3c59b02c9907d2744cf8527b1f3f1fc2c785b2ff3c9a3"} - ], - "android": { - "compileSdk": "36", - "buildTools": "36.0.0", - "ndkVersion": "27.2.12479018", - "minimumSdk": "28" - } -} diff --git a/tools/manifests/qt-android.json b/tools/manifests/qt-android.json new file mode 100644 index 00000000..ea33a718 --- /dev/null +++ b/tools/manifests/qt-android.json @@ -0,0 +1,20 @@ +{ + "schemaVersion": 1, + "qtVersion": "6.12.0", + "series": "6.12", + "baseUrl": "https://ftp.fau.de/qtproject/archive/qt/6.12/6.12.0/submodules", + "modules": [ + {"name": "qtbase", "sha256": "a951bd163c7b80fc6b8c88d7668fb56abf91c152373e13c10666763238131307"}, + {"name": "qtshadertools", "sha256": "c7d84f436e1aaef39fdcadebf2bd71bdf24dc69497e13f2e0198873cbbfea2ab"}, + {"name": "qtdeclarative", "sha256": "311f3a2603e1973bb59baef9dfa740a376de713157d4782ee043681e889c9260"}, + {"name": "qtsvg", "sha256": "e4ab39534ec97987b1b9b60ef7f4d3253d5912a69f8c713a01753174a4029331"}, + {"name": "qtimageformats", "sha256": "0943132b5db8de6b6a7f1d162682173e8763c7ed94e80fd39113292845f67762"}, + {"name": "qtwebsockets", "sha256": "21690a365cd5fbfa8dea051473e98968df9f4eca0121fed7481d1215b7455a31"} + ], + "android": { + "compileSdk": "36", + "buildTools": "36.0.0", + "ndkVersion": "27.2.12479018", + "minimumSdk": "28" + } +} diff --git a/tools/manifests/qt-webos-6.11.json b/tools/manifests/qt-webos-6.11.json deleted file mode 100644 index 6fd30d48..00000000 --- a/tools/manifests/qt-webos-6.11.json +++ /dev/null @@ -1,46 +0,0 @@ -{ - "schemaVersion": 1, - "qtVersion": "6.11.2", - "series": "6.11", - "baseUrl": "https://ftp.fau.de/qtproject/archive/qt/6.11/6.11.2/submodules", - "modules": [ - {"name": "qtbase", "sha256": "5b2e00eccaf5a4d8c14134ffa0ea8dfd0a35ae1ffc7f8d87fa4305a1ed23cf22"}, - {"name": "qtshadertools", "sha256": "805046b8b7757665586890b375940047e874ae3ab00adb6d3f2b38fc6b200b1c"}, - {"name": "qttools", "sha256": "9ea75af35c512f7e09e61c8c3af3997f13b4d43bb099cf43fcec470126b4041e"}, - {"name": "qtdeclarative", "sha256": "215b7b70517e380123eabc6b92243f3c47b6f016a91d126057dbe53551c6b430"}, - {"name": "qtwebsockets", "sha256": "2bfe25c383c37f7690e3c59b02c9907d2744cf8527b1f3f1fc2c785b2ff3c9a3"}, - {"name": "qtwayland", "sha256": "8eb7615e39332a10f506e8dd70f02d5954bb5949ff54f6dcbf8bd6168222f9df"}, - {"name": "qtimageformats", "sha256": "cecd8900f34b6550076309bc94f62f828008b633a4239e0a08c86788f41001f8"}, - {"name": "qtsvg", "sha256": "d594337feca84c26fb67fe87b85e6a5c12fda404b611d905f9d138210c311876"} - ], - "patches": [ - "tools/webos-native/patches/qtbase-6.11-webos-qstorageinfo-linux.patch", - "tools/webos-native/patches/qtbase-6.11-webos-qelfparser.patch", - "tools/webos-native/patches/qtbase-6.11-webos-wayland-no-opengl-forward-decl.patch", - "tools/webos-native/patches/qtbase-6.11-webos-qplatformwindow-private-moc.patch", - "tools/webos-native/patches/qtbase-6.11-webos-no-cursor-set.patch", - "tools/webos-native/patches/qtwayland-6.11-webos-wayland-version.patch" - ], - "toolchain": { - "triplet": "arm-webos-linux-gnueabi", - "sdkLayout": "arm-webos-linux-gnueabi_sdk-buildroot", - "archiveUrl": "https://github.com/openlgtv/buildroot-nc4/releases/download/webos-a38c582/arm-webos-linux-gnueabi_sdk-buildroot-x86_64.tar.gz", - "archiveSha256": "04ad3311b48b4557a7002aef56ae2e167478e8e129f37daac04649bddf813616", - "releaseTag": "webos-a38c582", - "buildrootVersion": "2025.02.1", - "gccVersion": "14.2.0" - }, - "outputs": { - "hostPrefix": "build/qt6-611-host-install", - "sharedTargetPrefix": "build/qt6-611-target-install", - "staticTargetPrefix": "build/qt6-611-target-static-install" - }, - "configure": { - "host": ["release", "examples=off", "tests=off", "opengl=off"], - "targetShared": ["release", "examples=off", "tests=off", "shared"], - "targetStatic": ["release", "examples=off", "tests=off", "static"] - }, - "submodules": { - "mpv": "09c26d3803000730ced3b9245c5c3cc286142e76" - } -} diff --git a/tools/manifests/qt-webos.json b/tools/manifests/qt-webos.json new file mode 100644 index 00000000..7bcec427 --- /dev/null +++ b/tools/manifests/qt-webos.json @@ -0,0 +1,47 @@ +{ + "schemaVersion": 1, + "qtVersion": "6.12.0", + "series": "6.12", + "baseUrl": "https://ftp.fau.de/qtproject/archive/qt/6.12/6.12.0/submodules", + "modules": [ + {"name": "qtbase", "sha256": "a951bd163c7b80fc6b8c88d7668fb56abf91c152373e13c10666763238131307"}, + {"name": "qtshadertools", "sha256": "c7d84f436e1aaef39fdcadebf2bd71bdf24dc69497e13f2e0198873cbbfea2ab"}, + {"name": "qttools", "sha256": "8dab8f3611496486a470ad5f115ceea584f36bc22a2b8b6f6ebdbafbb8160693"}, + {"name": "qtdeclarative", "sha256": "311f3a2603e1973bb59baef9dfa740a376de713157d4782ee043681e889c9260"}, + {"name": "qtwebsockets", "sha256": "21690a365cd5fbfa8dea051473e98968df9f4eca0121fed7481d1215b7455a31"}, + {"name": "qtwayland", "sha256": "ae14d9bcf1bb3c300a3ab2e6a53f50284e5c6c966a4ac4cc5aedcb1bc74e4d02"}, + {"name": "qtimageformats", "sha256": "0943132b5db8de6b6a7f1d162682173e8763c7ed94e80fd39113292845f67762"}, + {"name": "qtsvg", "sha256": "e4ab39534ec97987b1b9b60ef7f4d3253d5912a69f8c713a01753174a4029331"} + ], + "patches": [ + "tools/webos-native/patches/qtbase-6.12-webos-qstorageinfo-linux.patch", + "tools/webos-native/patches/qtbase-6.12-webos-qelfparser.patch", + "tools/webos-native/patches/qtbase-6.12-webos-wayland-no-opengl-forward-decl.patch", + "tools/webos-native/patches/qtbase-6.12-webos-qplatformwindow-private-moc.patch", + "tools/webos-native/patches/qtbase-6.12-webos-mt-tool-palm.patch", + "tools/webos-native/patches/qtbase-6.12-webos-no-cursor-set.patch", + "tools/webos-native/patches/qtwayland-6.12-webos-wayland-version.patch" + ], + "toolchain": { + "triplet": "arm-webos-linux-gnueabi", + "sdkLayout": "arm-webos-linux-gnueabi_sdk-buildroot", + "archiveUrl": "https://github.com/openlgtv/buildroot-nc4/releases/download/webos-a38c582/arm-webos-linux-gnueabi_sdk-buildroot-x86_64.tar.gz", + "archiveSha256": "04ad3311b48b4557a7002aef56ae2e167478e8e129f37daac04649bddf813616", + "releaseTag": "webos-a38c582", + "buildrootVersion": "2025.02.1", + "gccVersion": "14.2.0" + }, + "outputs": { + "hostPrefix": "build/qt6-612-host-install", + "sharedTargetPrefix": "build/qt6-612-target-install", + "staticTargetPrefix": "build/qt6-612-target-static-install" + }, + "configure": { + "host": ["release", "examples=off", "tests=off", "opengl=off"], + "targetShared": ["release", "examples=off", "tests=off", "shared"], + "targetStatic": ["release", "examples=off", "tests=off", "static"] + }, + "submodules": { + "mpv": "09c26d3803000730ced3b9245c5c3cc286142e76" + } +} diff --git a/tools/manifests/qt-windows-6.11.json b/tools/manifests/qt-windows-6.11.json deleted file mode 100644 index 780d1b17..00000000 --- a/tools/manifests/qt-windows-6.11.json +++ /dev/null @@ -1,43 +0,0 @@ -{ - "version": "6.11.2", - "architecture": "msvc2022_64", - "repository": "https://download.qt.io/online/qtsdkrepository/windows_x86/desktop/qt6_6112/qt6_6112_msvc2022_64", - "packageVersion": "6.11.2-0-202608131017", - "archives": [ - { - "package": "qt.qt6.6112.win64_msvc2022_64", - "file": "qtbase-Windows-Windows_11_24H2-MSVC2022-Windows-Windows_11_24H2-X86_64.7z", - "sha1": "1fca9483183d426c1a3a984f1382382fa51f48de" - }, - { - "package": "qt.qt6.6112.win64_msvc2022_64", - "file": "qtdeclarative-Windows-Windows_11_24H2-MSVC2022-Windows-Windows_11_24H2-X86_64.7z", - "sha1": "f3ac5149eb76cb0279ba84e126734cf520214519" - }, - { - "package": "qt.qt6.6112.win64_msvc2022_64", - "file": "qttools-Windows-Windows_11_24H2-MSVC2022-Windows-Windows_11_24H2-X86_64.7z", - "sha1": "0a94da47fb97103660b5bfec7361ae51b05f7323" - }, - { - "package": "qt.qt6.6112.win64_msvc2022_64", - "file": "qtsvg-Windows-Windows_11_24H2-MSVC2022-Windows-Windows_11_24H2-X86_64.7z", - "sha1": "f458d7f238795d61a3e53fa5211cf2d6b1aa08ef" - }, - { - "package": "qt.qt6.6112.addons.qtshadertools.win64_msvc2022_64", - "file": "qtshadertools-Windows-Windows_11_24H2-MSVC2022-Windows-Windows_11_24H2-X86_64.7z", - "sha1": "27f32f1cc715f91e95802e654f585e0dd42c558a" - }, - { - "package": "qt.qt6.6112.addons.qtimageformats.win64_msvc2022_64", - "file": "qtimageformats-Windows-Windows_11_24H2-MSVC2022-Windows-Windows_11_24H2-X86_64.7z", - "sha1": "00fb138473510e065753e6576e8cc4ab4625d662" - }, - { - "package": "qt.qt6.6112.addons.qtwebsockets.win64_msvc2022_64", - "file": "qtwebsockets-Windows-Windows_11_24H2-MSVC2022-Windows-Windows_11_24H2-X86_64.7z", - "sha1": "f0f2935f47e4bebc1046441bf2e4d367dd28e1f0" - } - ] -} diff --git a/tools/manifests/qt-windows.json b/tools/manifests/qt-windows.json new file mode 100644 index 00000000..7f44ebb4 --- /dev/null +++ b/tools/manifests/qt-windows.json @@ -0,0 +1,43 @@ +{ + "version": "6.12.0", + "architecture": "msvc2022_64", + "repository": "https://download.qt.io/online/qtsdkrepository/windows_x86/desktop/qt6_6120/qt6_6120_msvc2022_64", + "packageVersion": "6.12.0-0-202609280346", + "archives": [ + { + "package": "qt.qt6.6120.win64_msvc2022_64", + "file": "qtbase-Windows-Windows_11_24H2-MSVC2022-Windows-Windows_11_24H2-X86_64.7z", + "sha1": "bf35f8916164c6f313af8347dd0e91efe18178f0" + }, + { + "package": "qt.qt6.6120.win64_msvc2022_64", + "file": "qtdeclarative-Windows-Windows_11_24H2-MSVC2022-Windows-Windows_11_24H2-X86_64.7z", + "sha1": "bfe26cb07fd8d497fa1384a53d82434ad45a9756" + }, + { + "package": "qt.qt6.6120.win64_msvc2022_64", + "file": "qttools-Windows-Windows_11_24H2-MSVC2022-Windows-Windows_11_24H2-X86_64.7z", + "sha1": "879b647b61a1da35d50132e3a51ec5895b03fb95" + }, + { + "package": "qt.qt6.6120.win64_msvc2022_64", + "file": "qtsvg-Windows-Windows_11_24H2-MSVC2022-Windows-Windows_11_24H2-X86_64.7z", + "sha1": "e1c5b24e2448539684ac59dfc1a1be4de01de1d1" + }, + { + "package": "qt.qt6.6120.addons.qtshadertools.win64_msvc2022_64", + "file": "qtshadertools-Windows-Windows_11_24H2-MSVC2022-Windows-Windows_11_24H2-X86_64.7z", + "sha1": "800e54628c986596e60e46d526dc191c226b4c1b" + }, + { + "package": "qt.qt6.6120.addons.qtimageformats.win64_msvc2022_64", + "file": "qtimageformats-Windows-Windows_11_24H2-MSVC2022-Windows-Windows_11_24H2-X86_64.7z", + "sha1": "5a06cd9d22d6d5e83a1ab9a1b697020e02154881" + }, + { + "package": "qt.qt6.6120.addons.qtwebsockets.win64_msvc2022_64", + "file": "qtwebsockets-Windows-Windows_11_24H2-MSVC2022-Windows-Windows_11_24H2-X86_64.7z", + "sha1": "0c0d50ce7000289e96013cbf261ed567367044b9" + } + ] +} diff --git a/tools/manifests/streaming-third-party.json b/tools/manifests/streaming-third-party.json index 39202574..581dc33f 100644 --- a/tools/manifests/streaming-third-party.json +++ b/tools/manifests/streaming-third-party.json @@ -7,27 +7,27 @@ "sha256": "603f5602e2eef00d77fbd429d34dcd5822bb301757a1bc9cdb24c670f1eb859a" }, "curl": { - "version": "8.22.0", - "url": "https://curl.se/download/curl-8.22.0.tar.xz", - "sha256": "f7ef3ae8a22e521f289803fe93543eb64c329b58aa73a9e224dfd915a2a5f4f7", + "version": "8.23.0", + "url": "https://curl.se/download/curl-8.23.0.tar.xz", + "sha256": "8dadd7d2536a314f982ad05a651b713f426bf7d02cc2c76cffb9796f2218e6c5", "patches": [ "tools/patches/curl-apple-mobile-sectrust.patch" ] }, "nghttp2": { - "version": "1.70.0", - "url": "https://github.com/nghttp2/nghttp2/releases/download/v1.70.0/nghttp2-1.70.0.tar.bz2", - "sha256": "8faca1f78aa99ac3bc1768a76b7e0f6b36d8e6a62c13818751b1d205f02f9405" + "version": "1.71.0", + "url": "https://github.com/nghttp2/nghttp2/releases/download/v1.71.0/nghttp2-1.71.0.tar.bz2", + "sha256": "22555ed7f1ca80b7cd76659ed2dbaa041242d1dbfb2c15f88efe4d93ae953537" }, "nghttp3": { - "version": "1.18.0", - "url": "https://github.com/ngtcp2/nghttp3/releases/download/v1.18.0/nghttp3-1.18.0.tar.bz2", - "sha256": "ca232668b94a5e1fb54b41632cc56473ab48226483814410ef62a706294e6402" + "version": "1.19.0", + "url": "https://github.com/ngtcp2/nghttp3/releases/download/v1.19.0/nghttp3-1.19.0.tar.bz2", + "sha256": "e115724308a8b9be4ea1eee49a8647f6f26271b661fabf58d8143bf14208e0b2" }, "ngtcp2": { - "version": "1.23.0", - "url": "https://github.com/ngtcp2/ngtcp2/releases/download/v1.23.0/ngtcp2-1.23.0.tar.bz2", - "sha256": "de4b99ffc90d9b95744c44a0dab61c9f2a9848b881b8fdeb974aeb5ea10802ca" + "version": "1.26.0", + "url": "https://github.com/ngtcp2/ngtcp2/releases/download/v1.26.0/ngtcp2-1.26.0.tar.bz2", + "sha256": "f7dd409e2cd0f1af4bc790be5e37f606c0e86b5f69929d12e215220ae14f20d9" } } } diff --git a/tools/manifests/toolchain.json b/tools/manifests/toolchain.json index 1bce359b..f1e8033b 100644 --- a/tools/manifests/toolchain.json +++ b/tools/manifests/toolchain.json @@ -6,53 +6,52 @@ "these fields rather than repeating a version string of their own." ], "qt": { - "version": "6.11.2", - "series": "6.11", + "version": "6.12.0", + "series": "6.12", "windowsKit": "msvc2022_64", - "baseUrl": "https://download.qt.io/official_releases/qt/6.11/6.11.2/submodules", + "baseUrl": "https://download.qt.io/official_releases/qt/6.12/6.12.0/submodules", "sources": { - "qt3d": "411185a4795a711472c8f72ff7d6b13a0a9082a5f2c3c3d1ca9556727efbac29", - "qt5compat": "68c320fe3391096a9f2d870170edf1b67dac8af1d0e51c0c9e5343807f114287", - "qtactiveqt": "9daeda800eb0420286ea382bb10448671e4ee1916c0fd80195d81158e5986a3c", - "qtbase": "5b2e00eccaf5a4d8c14134ffa0ea8dfd0a35ae1ffc7f8d87fa4305a1ed23cf22", - "qtcanvaspainter": "8a90a27250ceef5ff659744e035ef4f5d3cd7392e027d5f953765b3f1083e760", - "qtcharts": "5069e53b81d125509e937c6379cba6d664c562d5a1e5ed28dd383690d4b6fb29", - "qtconnectivity": "85b01a57bd059583ab520a857990dfdf4021447507ff5b9498f036b7295e6037", - "qtdatavis3d": "d24e6919c5d6f8a16dd19ce3c7c8f47689d39a72dbe4a31c1c1bcedfa60b661d", - "qtdeclarative": "215b7b70517e380123eabc6b92243f3c47b6f016a91d126057dbe53551c6b430", - "qtdoc": "56271793257323f3caba4ea6aa2c427af4a4fcf2d957eb4af9304e3035b54eb7", - "qtgraphs": "9f2109854afa45dd144116c11461989c411a17065c63da5068441a1200fb8b21", - "qtgrpc": "44414617f0058ff34965fa852027bfcc7e4f71eefca8cd4406c96af22c64ad93", - "qthttpserver": "f0f5763b2ba58f20f5cffdfbedb97e62e32b5c639df6d9a6378905028be7bd8e", - "qtimageformats": "cecd8900f34b6550076309bc94f62f828008b633a4239e0a08c86788f41001f8", - "qtlanguageserver": "38bc4272ecf4ca0eb1927227053e52be6b2e05733f46d03422306aace511fc5e", - "qtlocation": "4d50a7ece01fbd76f6ec17c650236cb56ea60f987c52fc391dac72f13f65c23a", - "qtlottie": "f53c712716d9eba9a7ccb405b8cd2d30652097828fcfeb152f46b4ec40524852", - "qtmultimedia": "967b5e02ec6b793cdb360622cd6e703132836af983208d678dae4b50f109cd9f", - "qtnetworkauth": "0c83c23077ab7824393fa15bb0015c3c5acaf5678544aa789e3fcbb4d41fa05b", - "qtopenapi": "8b9ceb009dc45a66131c6f019d2497e2070ba54b067d66d7a833126aa35fe3a0", - "qtpositioning": "d8cf15ad43a3b1520adac64cec5900028525cf75f01a4c82a0002e7ac1ae7499", - "qtquick3d": "3ab8e1f08edb26373a37cf9d42c23e7d092c1334566b953fbb51cb1b936737b4", - "qtquick3dphysics": "1c5a24cf4285fc48481d7c7ae65bd6e80ed98b10964ea6e8530c608c4cdeb86e", - "qtquickeffectmaker": "7923dc7284e933a5e36ae24a427564f04e0b27af8dfa38eee8092c01c2835cb7", - "qtquicktimeline": "250af10500a0c4045dde74e107448a69a44d58af8b7e9a91704a808d5f881d17", - "qtremoteobjects": "5e0c9681799ec2b1179a712506266fb01fb2491e94bd2dba942b72fdef797cfd", - "qtscxml": "f594c4bba7f8bffb20857973c72895669d6e54df08c8d897f50d15251cec35ff", - "qtsensors": "68c8e44dfb32e8e2182f63f5544c2f462089b1bb049574f1d504ee2648903119", - "qtserialbus": "8f06c9ba95f6b045ec43f011094e35a4116047310aa24280966541b720df36c1", - "qtserialport": "df3a733616444f31b2ecb689218ea1444be91d8628aa3ab8e464c5eb1b17ad8e", - "qtshadertools": "805046b8b7757665586890b375940047e874ae3ab00adb6d3f2b38fc6b200b1c", - "qtspeech": "9c1d05dc9d710049f20a67680fc6b4293c9b584a90f04f4cf6cc36e758c5cb98", - "qtsvg": "d594337feca84c26fb67fe87b85e6a5c12fda404b611d905f9d138210c311876", - "qttasktree": "c0762992f01616a6cd15efea2658ace1984fb290723aab5406d813cd21c23ed8", - "qttools": "9ea75af35c512f7e09e61c8c3af3997f13b4d43bb099cf43fcec470126b4041e", - "qttranslations": "021684c1a7937a9fabc3b056a6698ad5978794caf9ac190fd6cc11399e67c014", - "qtvirtualkeyboard": "4c6a26734a5c4e4acd5ff9ae5f192a5b883bc4514118f9df2fcf12064e647c2f", - "qtwayland": "8eb7615e39332a10f506e8dd70f02d5954bb5949ff54f6dcbf8bd6168222f9df", - "qtwebchannel": "feb3149758bda887f0c292656194812dd2c227595badc8fbdeb2fb2311c5575f", - "qtwebengine": "6101c1aa00ff933d1b65ee5d167f76e8d71b9ac5b378b0111277723ebda7c163", - "qtwebsockets": "2bfe25c383c37f7690e3c59b02c9907d2744cf8527b1f3f1fc2c785b2ff3c9a3", - "qtwebview": "7e21e109ee89dadeef2d3edd786bcb9d64a5562ea546f89dcc79b3f52f881f4c" + "qt3d": "d16f7489945c6c9e971cedd4362202a2681f3c10393461e1f5e74425f7fef59a", + "qt5compat": "78cf1c283795312a7fa31c73eb7f7f556b48374adc484f10ad5a3c0bcb59264e", + "qtactiveqt": "03b92568791586c085c4a70a2f24b65b07a97d0dae7fd921caaf0e6308451d03", + "qtbase": "a951bd163c7b80fc6b8c88d7668fb56abf91c152373e13c10666763238131307", + "qtcanvaspainter": "09c0747c3bef7c58e3154346ca5fe2702ab09f7ad4083243e6d20307245119e2", + "qtcharts": "dc5e0599455c78729248a1bb95824fe6a3420e860b8cabc5ac0c7a93c2062bfb", + "qtconnectivity": "ed51f7f02c1f437fcf8a42940c7a84f6c0908c0ec7a4f5a5304fe68f47521954", + "qtdatavis3d": "5f79b948eb1e81ff7f69e335b075c1b48953d88f5d97970b537e348dbbaa98dc", + "qtdeclarative": "311f3a2603e1973bb59baef9dfa740a376de713157d4782ee043681e889c9260", + "qtdoc": "e4e49d101551c4c234fce28dfa0542d96bbd364395288434397e18d80ac2a57e", + "qtgraphs": "18c4e968785447051d94b01f8e3c975e31ddc46065c0777443cecc50753a4d8c", + "qtgrpc": "771852c4e5fbeb3d7c3b2a9aacc13db9efe942a46e7d1454ec1f16092ec3ef9c", + "qthttpserver": "ede040264551d0930ea5f6c1a4c18a7a3dea59d635e71cd2e81f02567d7814a4", + "qtimageformats": "0943132b5db8de6b6a7f1d162682173e8763c7ed94e80fd39113292845f67762", + "qtlanguageserver": "552119e37360c06c5fb0b54e91bbfdf8da5a80d2cb1441ef93e966eb3b7a426d", + "qtlocation": "218696d57c9eb95e8756e9fda62a8eabf94badc507db5f6e8ab9a640c4b0f50d", + "qtlottie": "6b8f04c917f2666f8cca4e7804bcabb6edffe151406b89fb28de3bba5a5d997e", + "qtmultimedia": "3143f53b64257ba2a0685c940f5dce476c75871ff86b516de45cfd54ea93a62d", + "qtnetworkauth": "17d47be1a724d21775daa873ac7a52c30fd5c4935ba377af48d9b37b39765ed8", + "qtopenapi": "46276b8b5ad2233e781169ec4eedb8125f4a5e02fe7c3407a1df85f847a5a847", + "qtpositioning": "b060d410fac7413b05a0e7938bbf3325f7ad08d7df14af3956270f0696e76763", + "qtquick3d": "6ced6edbd25fb5a632fe770ae820b376bf50233e8d62002c79a69a505a2e429e", + "qtquick3dphysics": "8ddb23147e4677c759d36a65ae50f6b0d0d79fa8590ac89576b91f572918b481", + "qtquickeffectmaker": "290c8c3c9835e9d3991cbf7e8fe965992c8f7c8730e694f7cf90fb719c2c63ac", + "qtquicktimeline": "6919153c841478c113f0ad20526f40e606590968334762ec6ccbc96002f8da19", + "qtremoteobjects": "54faf680f7cc84d7f54ae9bd5f98255e5d2d7ab2d6f4d0464a3fbe50f8a55509", + "qtscxml": "adc04875b383256bcd5a412f6f249d363495ea037913ca8c96d723442be38383", + "qtsensors": "861df58be8808cef777a1b531d7bec804d25733ec34e8ebbdafbe27040319090", + "qtserialbus": "1099cc24aff9d20c5ba7897c0b617c318098f009edf92f4e6ca97c815f5bdf38", + "qtserialport": "ba8886a54eee466e57c9fa1341255cc09c462c84baab3ee7b19d67cdbcbd71c3", + "qtshadertools": "c7d84f436e1aaef39fdcadebf2bd71bdf24dc69497e13f2e0198873cbbfea2ab", + "qtspeech": "9a60ce5bee54a9343740feab2582bffb996812f43d6c5585aade26dbd04933db", + "qtsvg": "e4ab39534ec97987b1b9b60ef7f4d3253d5912a69f8c713a01753174a4029331", + "qttasktree": "d28cac0d1fc2d87fbc8fd70d4f956a79b2d37a039df2766e9ff0f69635596b5e", + "qttools": "8dab8f3611496486a470ad5f115ceea584f36bc22a2b8b6f6ebdbafbb8160693", + "qttranslations": "85929c0c30d6f273f23bd879bb69803ea17b010ab73cab2f8abf95357f6f6bbb", + "qtvirtualkeyboard": "2aae3628f4648f86959d7853e7e1f50ee96a7f1bb5497afb62b7deff6c350170", + "qtwayland": "ae14d9bcf1bb3c300a3ab2e6a53f50284e5c6c966a4ac4cc5aedcb1bc74e4d02", + "qtwebchannel": "9afdfb64855b33c1cc16a4fdce69a556876f0d5b9df79d88de7306ffa2dca327", + "qtwebsockets": "21690a365cd5fbfa8dea051473e98968df9f4eca0121fed7481d1215b7455a31", + "qtwebview": "bee0642225614d7fc9486a2ca6db7d2c82a28c311404d1503185a360792c504e" } }, "qcoro": { @@ -67,10 +66,10 @@ "windowsPrefix": "qcoro-0.13-msvc2022" }, "ffmpeg": { - "version": "9.0.2", - "url": "https://ffmpeg.org/releases/ffmpeg-9.0.2.tar.xz", - "sha256": "8c3850283eb25fa026482078a04051e0be17347b09ef81a0849bec15a96e002e", - "sri": "sha256-jDhQKD6yX6AmSCB4oEBR4L4XNHsJ74GghJvsFaluAC4=" + "version": "9.1", + "url": "https://ffmpeg.org/releases/ffmpeg-9.1.tar.xz", + "sha256": "1a4d394ae63d190a526cd052eb4415c156b5c5e2df37efab41a7de0b8fde2433", + "sri": "sha256-Gk05SuY9GQpSbNBS60QVwVa1xeLfN++rQafeC4/eJDM=" }, "shaderTools": { "comment": [ diff --git a/tools/manifests/windows-proton.json b/tools/manifests/windows-proton.json index 439764d3..9c6b6a6d 100644 --- a/tools/manifests/windows-proton.json +++ b/tools/manifests/windows-proton.json @@ -59,8 +59,8 @@ }, { "file": "curl.zip", - "url": "https://curl.se/windows/dl-8.22.0_1/curl-8.22.0_1-win64-mingw.zip", - "sha256": "7f23b039f6ea4197362d4468e1a0e71428201222e1bef3b680d5ef7b2aefb714", + "url": "https://curl.se/windows/dl-8.23.0_9/curl-8.23.0_9-win64-mingw.zip", + "sha256": "89cb71930f4242d884e8e349463455932ab1d089b20f4f99318261a3cbff9167", "kind": "zip", "destination": "curl" }, diff --git a/tools/patches/ffmpeg-fate-hls-fixed-slice-count.patch b/tools/patches/ffmpeg-fate-hls-fixed-slice-count.patch deleted file mode 100644 index 41ce20fb..00000000 --- a/tools/patches/ffmpeg-fate-hls-fixed-slice-count.patch +++ /dev/null @@ -1,24 +0,0 @@ -Keep the seek-hls input fixture independent of the build host's CPU count. - -The direct generator introduced by FFmpeg f699b3a8f52c151f61318b757abf04cab0811724 -bypasses fate-run.sh's encoder thread setting. The CLI selects automatic slice -threads even with bitexact/int DCT; a three-core host uses four slice contexts, -whereas hosts with at least five cores use all five macroblock rows at 72px. -MPEG-2 motion predictors differ across slice boundaries. - -Use the original reference fixture's five contexts explicitly. This preserves -all existing seek return, stream, timestamp, position and size expectations; -no codec source, reference output or check selection is changed. Actual pinned -9.0.2 ffmpeg/ffprobe measurements: CPUcount3 auto produces size3904 at DTS4.8 / -PTS5.1; explicit5 produces3860 and the full60-packet table is identical to the -original large-core auto fixture. Explicit1 would not preserve that fixture. - -Sources: FFmpeg n9.0.2 tests/fate/seek.mak, fftools/ffmpeg_mux_init.c, -libavcodec/pthread_slice.c, mpegvideo.c and motion_est.c. This bounded test-input -patch is local; no matching official upstream fix was found. - ---- a/tests/fate/seek.mak -+++ b/tests/fate/seek.mak -@@ -207,1 +207,1 @@ -- -map 0:v -map 1:a -c:v mpeg2video -bf 2 -g 15 -dct int -idct int -flags +bitexact -c:a mp2fixed \ -+ -map 0:v -map 1:a -c:v mpeg2video -threads:v 5 -bf 2 -g 15 -dct int -idct int -flags +bitexact -c:a mp2fixed \ diff --git a/tools/patches/qt-cocoa-pending-fullscreen-state.patch b/tools/patches/qt-cocoa-pending-fullscreen-state.patch index 7c630687..86cdbf47 100644 --- a/tools/patches/qt-cocoa-pending-fullscreen-state.patch +++ b/tools/patches/qt-cocoa-pending-fullscreen-state.patch @@ -1,26 +1,26 @@ diff --git a/src/plugins/platforms/cocoa/qcocoawindow.h b/src/plugins/platforms/cocoa/qcocoawindow.h --- a/src/plugins/platforms/cocoa/qcocoawindow.h +++ b/src/plugins/platforms/cocoa/qcocoawindow.h -@@ -9,6 +9,7 @@ - #include +@@ -10,6 +10,7 @@ + #include #include #include +#include - + #ifndef QT_NO_OPENGL #include "qcocoaglcontext.h" -@@ -245,6 +246,7 @@ - QCocoaNSWindow *m_nsWindow = nil; - +@@ -235,6 +236,7 @@ + NSView *m_view = nil; + Qt::WindowStates m_lastReportedWindowState = Qt::WindowNoState; + std::optional m_pendingFullScreenState; - Qt::WindowModality m_windowModality = Qt::NonModal; - + static QPointer s_windowUnderMouse; + diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm --- a/src/plugins/platforms/cocoa/qcocoawindow.mm +++ b/src/plugins/platforms/cocoa/qcocoawindow.mm -@@ -784,6 +784,15 @@ +@@ -882,6 +882,15 @@ */ void QCocoaWindow::setWindowState(Qt::WindowStates state) { @@ -36,9 +36,9 @@ diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms if (window()->isVisible()) applyWindowState(state); // Window state set for hidden windows take effect when show() is called } -@@ -955,6 +964,15 @@ +@@ -1048,6 +1057,15 @@ setWindowFlags(window()->flags()); - + handleWindowStateChanged(); + + // A native titlebar entry has no pending Qt request. Do not undo it. @@ -50,5 +50,5 @@ diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms + window()->setWindowStates(requestedState); + } } - + void QCocoaWindow::windowWillExitFullScreen() diff --git a/tools/toolchain-versions.sh b/tools/toolchain-versions.sh index 7044c6b4..f64c6341 100755 --- a/tools/toolchain-versions.sh +++ b/tools/toolchain-versions.sh @@ -16,7 +16,7 @@ check_versions() { qt_series="$(toolchain_field "$ROOT" qt.series)" local manifest declared - for manifest in qt-webos-6.11 qt-android-6.11; do + for manifest in qt-webos qt-android; do declared="$(manifest_qt_field "$ROOT/tools/manifests/$manifest.json" qtVersion)" [[ "$declared" == "$qt_version" ]] || { printf '%s.json pins Qt %s, toolchain.json pins %s\n' "$manifest" "$declared" "$qt_version" >&2 @@ -29,9 +29,9 @@ check_versions() { } done - declared="$(manifest_qt_field "$ROOT/tools/manifests/qt-windows-6.11.json" version)" + declared="$(manifest_qt_field "$ROOT/tools/manifests/qt-windows.json" version)" [[ "$declared" == "$qt_version" ]] || { - printf 'qt-windows-6.11.json pins Qt %s, toolchain.json pins %s\n' "$declared" "$qt_version" >&2 + printf 'qt-windows.json pins Qt %s, toolchain.json pins %s\n' "$declared" "$qt_version" >&2 status=1 } diff --git a/tools/webos-native/build-qcoro.sh b/tools/webos-native/build-qcoro.sh index 3348584c..541cb2fc 100755 --- a/tools/webos-native/build-qcoro.sh +++ b/tools/webos-native/build-qcoro.sh @@ -18,7 +18,7 @@ source "$ROOT/tools/lib/manifest-sources.sh" source "$ROOT/tools/webos-native/nixos-sdk-compat.sh" MANIFEST="${WEBOS_THIRD_PARTY_MANIFEST:-$ROOT/tools/manifests/webos-third-party.json}" -QT_MANIFEST="${QT_MANIFEST:-$ROOT/tools/manifests/qt-webos-6.11.json}" +QT_MANIFEST="${QT_MANIFEST:-$ROOT/tools/manifests/qt-webos.json}" QT_STATIC="${QT_STATIC:-1}" QT_VERSION="${QT_VERSION:-$(manifest_qt_field "$QT_MANIFEST" qtVersion)}" QT_BUILD_TAG="${QT_VERSION%.*}" diff --git a/tools/webos-native/build-qt6-611.sh b/tools/webos-native/build-qt6.sh similarity index 99% rename from tools/webos-native/build-qt6-611.sh rename to tools/webos-native/build-qt6.sh index 29f45d62..ac0bb2ae 100755 --- a/tools/webos-native/build-qt6-611.sh +++ b/tools/webos-native/build-qt6.sh @@ -1,7 +1,7 @@ #!/usr/bin/env bash set -euo pipefail -# Build a private Qt 6.11 tree for native webOS development. +# Build a private Qt tree for native webOS development. # # Design goals: # - never accidentally link against nixpkgs' Qt while building Qt from source; @@ -17,7 +17,7 @@ source "$ROOT/tools/lib/build-common.sh" source "$ROOT/tools/lib/manifest-sources.sh" # shellcheck source=tools/webos-native/nixos-sdk-compat.sh source "$ROOT/tools/webos-native/nixos-sdk-compat.sh" -QT_MANIFEST="${QT_MANIFEST:-$ROOT/tools/manifests/qt-webos-6.11.json}" +QT_MANIFEST="${QT_MANIFEST:-$ROOT/tools/manifests/qt-webos.json}" SDK_ROOT="${WEBOS_SDK_ROOT:-$ROOT/build/webos-sdk/arm-webos-linux-gnueabi_sdk-buildroot}" SYSROOT="$SDK_ROOT/arm-webos-linux-gnueabi/sysroot" QT_VERSION="${QT_VERSION:-$(manifest_qt_field "$QT_MANIFEST" qtVersion)}" @@ -271,11 +271,12 @@ apply_local_patches() { apply_patch_if_needed "$QTBASE_SRC" "$PATCH_DIR/qtbase-$QT_SERIES-webos-qelfparser.patch" apply_patch_if_needed "$QTBASE_SRC" "$PATCH_DIR/qtbase-$QT_SERIES-webos-wayland-no-opengl-forward-decl.patch" apply_patch_if_needed "$QTBASE_SRC" "$PATCH_DIR/qtbase-$QT_SERIES-webos-qplatformwindow-private-moc.patch" + apply_patch_if_needed "$QTBASE_SRC" "$PATCH_DIR/qtbase-$QT_SERIES-webos-mt-tool-palm.patch" apply_patch_if_needed "$QTDECLARATIVE_SRC" \ "$PATCH_DIR/qtdeclarative-$QT_SERIES-qmlimportscanner-exclude-subtrees.patch" apply_patch_if_needed "$QTWAYLAND_SRC" "$PATCH_DIR/qtwayland-$QT_SERIES-webos-wayland-version.patch" - # In Qt 6.11 the client-side wayland platform plugin code is in qtbase, not + # Since Qt 6.11 the client-side wayland platform plugin code is in qtbase, not # qtwayland. This keeps the webOS magic-remote cursor opt-out built in. apply_patch_if_needed "$QTBASE_SRC" "$PATCH_DIR/qtbase-$QT_SERIES-webos-no-cursor-set.patch" } diff --git a/tools/webos-native/build-webos.sh b/tools/webos-native/build-webos.sh index 2d0b58c7..5b1b0281 100755 --- a/tools/webos-native/build-webos.sh +++ b/tools/webos-native/build-webos.sh @@ -33,19 +33,19 @@ run_phase() { local phase="$1" case "$phase" in fetch) - "$TOOLS_ROOT/build-qt6-611.sh" fetch + "$TOOLS_ROOT/build-qt6.sh" fetch "$TOOLS_ROOT/build-third-party.sh" fetch "$TOOLS_ROOT/build-curl.sh" fetch "$TOOLS_ROOT/build-qcoro.sh" fetch fetch_toolchain_ffmpeg ;; qt-host) - "$TOOLS_ROOT/build-qt6-611.sh" host + "$TOOLS_ROOT/build-qt6.sh" host ;; qt-target) WEBOS_SDK_ROOT="$SDK_ROOT" "$TOOLS_ROOT/restore-toolchain.sh" "$TOOLS_ROOT/build-curl.sh" build - QT_STATIC="${QT_STATIC:-1}" "$TOOLS_ROOT/build-qt6-611.sh" target + QT_STATIC="${QT_STATIC:-1}" "$TOOLS_ROOT/build-qt6.sh" target ;; dependencies) WEBOS_SDK_ROOT="$SDK_ROOT" "$TOOLS_ROOT/restore-toolchain.sh" diff --git a/tools/webos-native/patches/README.md b/tools/webos-native/patches/README.md index 538ba6a2..6d4120f0 100644 --- a/tools/webos-native/patches/README.md +++ b/tools/webos-native/patches/README.md @@ -1,10 +1,10 @@ Local patches for third-party source used in the webOS native toolchain. -These are applied by `tools/webos-native/build-qt6-611.sh` when building the +These are applied by `tools/webos-native/build-qt6.sh` when building the Qt host/target prefixes consumed by `build-ipk.sh`. They are named by Qt -*series* (`6.11`) rather than the exact patch release, and the build script -references them via `$QT_SERIES`, so a 6.11.x point bump (e.g. 6.11.0 -> -6.11.1) needs no rename — only `QT_VERSION` changes. Bump to a new series only +*series* (`6.12`) rather than the exact patch release, and the build script +references them via `$QT_SERIES`, so a 6.12.x point bump (e.g. 6.12.0 -> +6.12.1) needs no rename — only `QT_VERSION` changes. Bump to a new series only if a patch stops applying. The source cache records each module's patch-set hash after all patches apply. @@ -14,34 +14,38 @@ The target qtbase cache also requires the `SPOOL_QT_NO_CURSOR_SURFACE` marker in its installed Wayland client library. A stale install is rebuilt by the normal `./build-ipk.sh` pipeline; no manual shared-Qt build is needed. -`qtbase-6.11-webos-qstorageinfo-linux.patch` +`qtbase-6.12-webos-qstorageinfo-linux.patch` - Fixes `QStorageInfo` on the webOS ARM sysroot, whose glibc `struct statfs64` does not expose `f_flags`. - Keeps space reporting on `statfs64`, but falls back to `statvfs64().f_flag` for readonly detection. -`qtbase-6.11-webos-qelfparser.patch` +`qtbase-6.12-webos-qelfparser.patch` - Fixes `qelfparser_p.cpp` against the older webOS SDK `elf.h`, which lacks the `EM_AARCH64` constant used in a debug switch. -`qtbase-6.11-webos-qplatformwindow-private-moc.patch` +`qtbase-6.12-webos-qplatformwindow-private-moc.patch` - Includes `moc_qplatformwindow_p.cpp` so the private `QPlatformWindow` moc output links in the static build. -`qtbase-6.11-webos-wayland-no-opengl-forward-decl.patch` +`qtbase-6.12-webos-mt-tool-palm.patch` +- Defines `MT_TOOL_PALM` for the evdev touch handler: Qt 6.12 rejects palms, + and the webOS SDK's kernel headers predate the constant. + +`qtbase-6.12-webos-wayland-no-opengl-forward-decl.patch` - Moves the `QPlatformOpenGLContext` forward declaration out of the `QT_CONFIG(opengl)` guard so the non-OpenGL webOS Wayland build compiles. -`qtbase-6.11-webos-no-cursor-set.patch` +`qtbase-6.12-webos-no-cursor-set.patch` - Adds a `SPOOL_QT_NO_CURSOR_SURFACE=1` opt-out that skips client-side `set_cursor` in the Wayland QPA, so the app never displaces or hides the LSM-owned magic-remote pointer (mirrors xbmc's no-op `SetCursor`). -`qtdeclarative-6.11-qmlimportscanner-exclude-subtrees.patch` +`qtdeclarative-6.12-qmlimportscanner-exclude-subtrees.patch` - Makes `qmlimportscanner -exclude ` ignore the complete directory subtree. Upstream's iterator otherwise descends into excluded in-tree build directories and parses Qt's intentionally invalid QML parser fixtures. -`qtwayland-6.11-webos-wayland-version.patch` +`qtwayland-6.12-webos-wayland-version.patch` - Lowers the Wayland package version gate from `1.15` to `1.11` so QtWayland can target the older Wayland stack shipped in the webOS SDK sysroot. diff --git a/tools/webos-native/patches/qtbase-6.12-webos-mt-tool-palm.patch b/tools/webos-native/patches/qtbase-6.12-webos-mt-tool-palm.patch new file mode 100644 index 00000000..28db786f --- /dev/null +++ b/tools/webos-native/patches/qtbase-6.12-webos-mt-tool-palm.patch @@ -0,0 +1,14 @@ +--- a/src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp ++++ b/src/platformsupport/input/evdevtouch/qevdevtouchhandler.cpp +@@ -33,6 +33,11 @@ + #define input_event_usec time.tv_usec + #endif + ++// Older kernel headers, such as the webOS SDK's, predate palm rejection. ++#ifndef MT_TOOL_PALM ++#define MT_TOOL_PALM 0x02 ++#endif ++ + #include + + #if QT_CONFIG(mtdev) diff --git a/tools/webos-native/patches/qtbase-6.11-webos-no-cursor-set.patch b/tools/webos-native/patches/qtbase-6.12-webos-no-cursor-set.patch similarity index 100% rename from tools/webos-native/patches/qtbase-6.11-webos-no-cursor-set.patch rename to tools/webos-native/patches/qtbase-6.12-webos-no-cursor-set.patch diff --git a/tools/webos-native/patches/qtbase-6.11-webos-qelfparser.patch b/tools/webos-native/patches/qtbase-6.12-webos-qelfparser.patch similarity index 100% rename from tools/webos-native/patches/qtbase-6.11-webos-qelfparser.patch rename to tools/webos-native/patches/qtbase-6.12-webos-qelfparser.patch diff --git a/tools/webos-native/patches/qtbase-6.11-webos-qplatformwindow-private-moc.patch b/tools/webos-native/patches/qtbase-6.12-webos-qplatformwindow-private-moc.patch similarity index 100% rename from tools/webos-native/patches/qtbase-6.11-webos-qplatformwindow-private-moc.patch rename to tools/webos-native/patches/qtbase-6.12-webos-qplatformwindow-private-moc.patch diff --git a/tools/webos-native/patches/qtbase-6.11-webos-qstorageinfo-linux.patch b/tools/webos-native/patches/qtbase-6.12-webos-qstorageinfo-linux.patch similarity index 100% rename from tools/webos-native/patches/qtbase-6.11-webos-qstorageinfo-linux.patch rename to tools/webos-native/patches/qtbase-6.12-webos-qstorageinfo-linux.patch diff --git a/tools/webos-native/patches/qtbase-6.11-webos-wayland-no-opengl-forward-decl.patch b/tools/webos-native/patches/qtbase-6.12-webos-wayland-no-opengl-forward-decl.patch similarity index 100% rename from tools/webos-native/patches/qtbase-6.11-webos-wayland-no-opengl-forward-decl.patch rename to tools/webos-native/patches/qtbase-6.12-webos-wayland-no-opengl-forward-decl.patch diff --git a/tools/webos-native/patches/qtdeclarative-6.11-qmlimportscanner-exclude-subtrees.patch b/tools/webos-native/patches/qtdeclarative-6.12-qmlimportscanner-exclude-subtrees.patch similarity index 100% rename from tools/webos-native/patches/qtdeclarative-6.11-qmlimportscanner-exclude-subtrees.patch rename to tools/webos-native/patches/qtdeclarative-6.12-qmlimportscanner-exclude-subtrees.patch diff --git a/tools/webos-native/patches/qtwayland-6.11-webos-wayland-version.patch b/tools/webos-native/patches/qtwayland-6.12-webos-wayland-version.patch similarity index 100% rename from tools/webos-native/patches/qtwayland-6.11-webos-wayland-version.patch rename to tools/webos-native/patches/qtwayland-6.12-webos-wayland-version.patch diff --git a/tools/webos-native/restore-toolchain.sh b/tools/webos-native/restore-toolchain.sh index c00ee4c0..13e286b8 100755 --- a/tools/webos-native/restore-toolchain.sh +++ b/tools/webos-native/restore-toolchain.sh @@ -4,7 +4,7 @@ set -euo pipefail ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)" # shellcheck source=tools/lib/manifest-sources.sh source "$ROOT/tools/lib/manifest-sources.sh" -QT_MANIFEST="${QT_MANIFEST:-$ROOT/tools/manifests/qt-webos-6.11.json}" +QT_MANIFEST="${QT_MANIFEST:-$ROOT/tools/manifests/qt-webos.json}" SDK_PARENT="${WEBOS_SDK_PARENT:-$ROOT/build/webos-sdk}" manifest_toolchain_field() { diff --git a/tools/windows/build-streaming-dependencies.ps1 b/tools/windows/build-streaming-dependencies.ps1 index 1b6a4bae..5ac869c9 100644 --- a/tools/windows/build-streaming-dependencies.ps1 +++ b/tools/windows/build-streaming-dependencies.ps1 @@ -39,7 +39,13 @@ if (Test-Path $prefix) { Remove-Item $prefix -Recurse -Force } $opensslBuild = Join-Path $builds 'openssl' New-Item -ItemType Directory -Force $opensslBuild | Out-Null $originalStreamingPath = $env:PATH +$originalCC = $env:CC +$originalCXX = $env:CXX $env:PATH = "$(Split-Path $nativePerl -Parent);$env:PATH" +# OpenSSL's VC-WIN64A target writes cl-style flags but takes its compiler +# from CC, which the mpv toolchain sets to the GNU-style clang driver. +$env:CC = 'cl' +$env:CXX = 'cl' Push-Location $opensslBuild try { & $nativePerl (Join-Path $sources 'openssl\Configure') VC-WIN64A no-shared no-apps no-docs no-tests ` @@ -52,6 +58,8 @@ try { } finally { Pop-Location $env:PATH = $originalStreamingPath + $env:CC = $originalCC + $env:CXX = $originalCXX } $env:PKG_CONFIG_PATH = Convert-StreamingPath "$prefix/lib/pkgconfig" foreach ($name in @('nghttp2', 'nghttp3', 'ngtcp2', 'curl')) { diff --git a/tools/windows/install-qt.ps1 b/tools/windows/install-qt.ps1 index 64375467..491ecdeb 100644 --- a/tools/windows/install-qt.ps1 +++ b/tools/windows/install-qt.ps1 @@ -6,7 +6,7 @@ param( . (Join-Path $PSScriptRoot 'common.ps1') $root = Get-RepositoryRoot -$manifestPath = Join-Path $root 'tools\manifests\qt-windows-6.11.json' +$manifestPath = Join-Path $root 'tools\manifests\qt-windows.json' $manifest = Get-Content -LiteralPath $manifestPath -Raw | ConvertFrom-Json $qtRoot = Join-Path ([IO.Path]::GetFullPath($OutputDirectory)) "$($manifest.version)\$($manifest.architecture)" $downloads = if ($DownloadDirectory) { [IO.Path]::GetFullPath($DownloadDirectory) } elseif ($env:RUNNER_TEMP) { From 38a11b7ed22069f8d6e20f388122340d4009876b Mon Sep 17 00:00:00 2001 From: Sacha Korban Date: Fri, 27 Nov 2026 02:50:05 +1100 Subject: [PATCH 07/39] fix(platforms): repair desktop toolchains, Apple windows and device test setup Consolidate the release milestone ending at 626034bd097e1247ba5f6cdd7a73ce7afef3a978. Original starting snapshot: 1fe7a21ea553e83cf08322f39033db8ec52e5789. --- .github/workflows/build-artifacts.yml | 42 ++++++- flake.nix | 37 ++++-- qml/pages/SettingsPage.qml | 3 +- qml/primitives/ActionButton.qml | 14 ++- src/platform/NativeAppWindow.h | 1 + .../desktop/DesktopNativeAppWindow.cpp | 7 +- src/platform/macos/MacOSTitlebar.mm | 13 ++ tests/TestRunner.cpp | 6 +- tests/providers/ScriptRuntimeTest.cpp | 4 + tools/android/build-apks.sh | 20 ++- tools/android/emulator-launch-test.sh | 6 +- tools/build-macos.sh | 1 + tools/check-streaming-dependencies.py | 10 +- .../qt-cocoa-pending-fullscreen-state.patch | 115 ++++++++++++++---- .../qt6-nixpkgs/macdeployqt-fixes.patch | 34 ++++++ .../use-versioned-import-path.patch | 12 ++ tools/run-device-tests.py | 14 ++- .../windows/build-streaming-dependencies.ps1 | 104 ++++++++++++++-- tools/windows/common.ps1 | 34 +++++- 19 files changed, 427 insertions(+), 50 deletions(-) create mode 100644 tools/patches/qt6-nixpkgs/macdeployqt-fixes.patch create mode 100644 tools/patches/qt6-nixpkgs/use-versioned-import-path.patch diff --git a/.github/workflows/build-artifacts.yml b/.github/workflows/build-artifacts.yml index b8367bc0..8c3b897b 100644 --- a/.github/workflows/build-artifacts.yml +++ b/.github/workflows/build-artifacts.yml @@ -92,7 +92,7 @@ env: # PRs consume public caches but never receive publishing credentials. SPOOL_CACHE_WRITE: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }} concurrency: - group: build-artifacts-${{ github.ref }} + group: build-artifacts-${{ github.ref }}-${{ github.sha }} cancel-in-progress: true jobs: @@ -674,10 +674,18 @@ jobs: - name: Build macOS app env: SPOOL_MACOS_CREDENTIAL_SERVICE: ${{ inputs.enable_macos_signing && 'com.sachk.spool' || '' }} + # Hosted macOS runners expose Apple's paravirtualized Metal GPU, where + # MoltenVK vkQueueSubmit hangs (kIOGPUCommandBufferCallbackErrorHang). + # Keep the shipped Spool.app unchanged (Vulkan default + bundled + # MoltenVK, verified by the runtime load step below) and run the + # hosted e2e suite on real macOS OpenGL, matching the Windows CI gate. + SPOOL_TEST_RENDER_BACKEND: opengl run: nix develop .#native --no-write-lock-file -c bash tools/build-macos.sh - name: Run macOS traditional and real GUI e2e tests + env: + SPOOL_RENDER_API: opengl run: nix develop .#native --no-write-lock-file -c python tools/run-tests.py --build-dir build/macos/app --workers 4 - name: Lint compiled QML @@ -877,6 +885,20 @@ jobs: -m qtshadertools qttasktree qtwebsockets qtimageformats - name: Build actual source Qt, media closure, and tvOS app run: bash tools/build-tvos.sh + # The journeys drive the simulator from a native macOS controller, + # which builds in the Nix shell like the macOS job. + - uses: ./.github/actions/install-nix + if: matrix.sdk == 'appletvsimulator' + with: + nix_conf: | + experimental-features = nix-command flakes + connect-timeout = 30 + download-attempts = 5 + - uses: cachix/cachix-action@3ba601ff5bbb07c7220846facfa2cd81eeee15a1 # v16 + if: matrix.sdk == 'appletvsimulator' + with: + name: spool + skipPush: true - name: Build native host controller for tvOS application journeys if: matrix.sdk == 'appletvsimulator' run: nix develop .#native -c env DEPLOY_APP=0 bash tools/build-macos.sh @@ -908,6 +930,8 @@ jobs: name: internal-tvos-simulator-arm64 path: | ${{ runner.temp }}/tvos-simulator-arm64.tar.gz + build/tvos/smoke/safe-export + build/tvos/smoke/launch-result.json retention-days: ${{ inputs.release && 1 || 7 }} - name: Save coherent Apple dependency cache if: ${{ env.SPOOL_CACHE_WRITE == 'true' && !inputs.release && steps.tvos-source-cache.outputs.cache-hit != 'true' }} @@ -1272,6 +1296,20 @@ jobs: SPOOL_ANDROID_FORM_FACTOR: tv run: nix develop .#android -c bash tools/android/emulator-launch-test.sh + - name: Upload Android native test diagnostics on failure + if: ${{ matrix.abi == 'x86_64' && failure() }} + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.0 + with: + name: internal-android-x86_64-unified-tests + path: | + build/android/app-x86_64/test-phases.json + build/android/app-x86_64/traditional-results.json + build/android/app-x86_64/e2e-results.json + build/android/launch-test/*/safe-export/** + build/android/launch-test/*/*.png + if-no-files-found: ignore + retention-days: 7 + - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.0 with: name: spool-android-apks-${{ matrix.abi }} @@ -1485,6 +1523,8 @@ jobs: - name: Build application shell: pwsh + env: + MSYS2_LOCATION: ${{ steps.msys2.outputs.msys2-location }} run: tools\windows\build.ps1 -Clean -CMakeArguments '-DSPOOL_TEST_RENDER_BACKEND=opengl' diff --git a/flake.nix b/flake.nix index 764a79ee..258f9313 100644 --- a/flake.nix +++ b/flake.nix @@ -117,8 +117,9 @@ then pinned pkgs.ffmpeg_9-full # The x86_64-darwin maintenance branch predates FFmpeg 9. Its generic # derivation supports newer upstream versions; discard its two obsolete - # FFmpeg 8 configure switches when building the newer source. - else (pinned (pkgs.ffmpeg-full.override { withCelt = false; })).overrideAttrs (old: { + # FFmpeg 8 configure switches when building the newer source, and + # disable lcevcdec because 26.05 ships 4.1.0 while FFmpeg 9.1 needs >= 4.2. + else (pinned (pkgs.ffmpeg-full.override { withCelt = false; withLcevcdec = false; })).overrideAttrs (old: { configureFlags = builtins.filter (flag: !builtins.elem flag [ "--disable-libcelt" "--disable-libshaderc" ]) old.configureFlags; @@ -211,6 +212,13 @@ }; pinnedQtOverlay = final: prev: let + # Intel macOS workflows override the root `nixpkgs` input to + # `nixpkgs-x86-darwin` (26.05-darwin, Qt 6.11) so `nix develop` can + # resolve `bashInteractive`. Keep the two Qt 6.12 nixpkgs patches + # that diverge from 26.05-darwin in-tree so Intel builds never depend + # on the unstable `nixpkgs` tree remaining unoverridden and always + # hash identically before and after `--override-input nixpkgs`. + isOlderQtChannel = prev.qt6.qtbase.version != toolchain.qt.version; srcs = builtins.mapAttrs (name: sha256: { version = toolchain.qt.version; src = final.fetchurl { @@ -229,20 +237,29 @@ patches = let superseded = [ "find-qmlimportscanner.patch" "qmlimportscanner-import-path.patch" "skip-missing-qml-directory.patch" "515cbbacfba9f4259c9c3b0714a31222c2b4c879.diff" ]; - stale = patch: builtins.any (s: nixpkgs.lib.hasSuffix s (baseNameOf (toString patch))) superseded; + stale = patch: builtins.any (s: final.lib.hasSuffix s (baseNameOf (toString patch))) superseded; inherited = old.patches or []; - in if builtins.any stale inherited + in if isOlderQtChannel && builtins.any stale inherited then builtins.filter (patch: !stale patch) inherited - ++ [ "${nixpkgs}/pkgs/development/libraries/qt-6/modules/qtbase/macdeployqt-fixes.patch" ] + ++ [ ./tools/patches/qt6-nixpkgs/macdeployqt-fixes.patch ] else inherited; }); qtModule = qtPrev.qtModule.override { inherit srcs; }; qtdeclarative = qtPrev.qtdeclarative.overrideAttrs (old: { - # The Intel maintenance channel backports this TableView fix. - # It is already in the pinned Qt release; applying it again fails. - patches = builtins.filter (patch: - !final.lib.hasSuffix "8a2c82be6ad90e3f2a0760d8bab1e3a8cdb2473a.diff" (toString patch)) - (old.patches or []); + # The Intel maintenance channel ships 6.11 patches (and may + # backport fixes already in 6.12). Swap the 6.11 + # use-versioned-import-path patch for the 6.12 version so + # qqmltypeloader.cpp patches cleanly on x86_64-darwin. + patches = let + inherited = builtins.filter (patch: + !final.lib.hasSuffix "8a2c82be6ad90e3f2a0760d8bab1e3a8cdb2473a.diff" (toString patch)) + (old.patches or []); + in if isOlderQtChannel + then map (patch: + if final.lib.hasSuffix "use-versioned-import-path.patch" (baseNameOf (toString patch)) + then ./tools/patches/qt6-nixpkgs/use-versioned-import-path.patch + else patch) inherited + else inherited; }); })) // { override = prev.qt6.override; diff --git a/qml/pages/SettingsPage.qml b/qml/pages/SettingsPage.qml index d46ca000..62c391c8 100644 --- a/qml/pages/SettingsPage.qml +++ b/qml/pages/SettingsPage.qml @@ -563,7 +563,8 @@ FocusScope { let capability = "" if (row.key === "playback/streamingHttpVersion") { const capabilities = Player.transportCapabilities - if (String(settingsValue(row)) === "http3" && capabilities && capabilities.http3 === false) + if (String(settingsValue(row)) === "http3" && capabilities && (capabilities.http3 === false + || capabilities["quic-batching"] === false)) capability = " · This build uses HTTP/2 with HTTP/1.1 fallback" if (capabilities && capabilities.http2 === false && String(settingsValue(row)) !== "http1") capability = " · This build uses HTTP/1.1" diff --git a/qml/primitives/ActionButton.qml b/qml/primitives/ActionButton.qml index 509cea62..8da09e3b 100644 --- a/qml/primitives/ActionButton.qml +++ b/qml/primitives/ActionButton.qml @@ -57,7 +57,18 @@ T.Control { Item { id: buttonContent anchors.centerIn: parent - implicitWidth: buttonLabel.implicitWidth + (buttonIcon.visible ? buttonIcon.width + Metrics.scaled(8) : 0) + // Measure unelided text independently of buttonLabel's anchored width + // so Qt 6.12 elided layout updates cannot feed back into width. + // Add small slack so subpixel CoreText shaping never elides short labels. + TextMetrics { + id: labelMetrics + font: buttonLabel.font + text: root.text + } + implicitWidth: Math.ceil(Math.max(labelMetrics.advanceWidth, labelMetrics.width, + labelMetrics.tightBoundingRect.width)) + 4 + (buttonIcon.visible + ? buttonIcon.width + + Metrics.scaled(8) : 0) width: Math.min(implicitWidth, Math.max(0, parent.width - Metrics.scaled(34))) height: Math.max(buttonLabel.implicitHeight, buttonIcon.visible ? buttonIcon.height : 0) @@ -78,6 +89,7 @@ T.Control { anchors.leftMargin: buttonIcon.visible ? Metrics.scaled(8) : 0 anchors.right: parent.right anchors.verticalCenter: parent.verticalCenter + horizontalAlignment: buttonIcon.visible ? Text.AlignLeft : Text.AlignHCenter text: root.text color: root.foreground diff --git a/src/platform/NativeAppWindow.h b/src/platform/NativeAppWindow.h index 46375fee..07d41355 100644 --- a/src/platform/NativeAppWindow.h +++ b/src/platform/NativeAppWindow.h @@ -101,6 +101,7 @@ class NativeAppWindow final : public QQuickView { Q_INVOKABLE void exitToLauncher(); #ifdef Q_OS_MACOS Q_INVOKABLE void setTitlebarVisible(bool visible); + void configureMacOSTitlebar(); #endif void clearOverlay(); QQuickImageProvider *createOverlayImageProvider(); diff --git a/src/platform/desktop/DesktopNativeAppWindow.cpp b/src/platform/desktop/DesktopNativeAppWindow.cpp index 771af8d9..b25ee86f 100644 --- a/src/platform/desktop/DesktopNativeAppWindow.cpp +++ b/src/platform/desktop/DesktopNativeAppWindow.cpp @@ -105,7 +105,12 @@ void NativeAppWindow::resizeEvent(QResizeEvent *event) QQuickView::resizeEvent(event); } -void NativeAppWindow::handlePlatformSurfaceCreated() { } +void NativeAppWindow::handlePlatformSurfaceCreated() +{ +#ifdef Q_OS_MACOS + configureMacOSTitlebar(); +#endif +} void NativeAppWindow::handlePlatformSurfaceAboutToBeDestroyed() { } diff --git a/src/platform/macos/MacOSTitlebar.mm b/src/platform/macos/MacOSTitlebar.mm index d398b8ef..2fdaac07 100644 --- a/src/platform/macos/MacOSTitlebar.mm +++ b/src/platform/macos/MacOSTitlebar.mm @@ -5,11 +5,24 @@ #import namespace Spool { +void NativeAppWindow::configureMacOSTitlebar() +{ + if (QGuiApplication::platformName() != QStringLiteral("cocoa")) + return; + NSWindow *window = reinterpret_cast(winId()).window; + if (!window) + return; + window.titlebarAppearsTransparent = YES; +} + void NativeAppWindow::setTitlebarVisible(bool visible) { if (QGuiApplication::platformName() != QStringLiteral("cocoa")) return; NSWindow *window = reinterpret_cast(winId()).window; + if (!window) + return; + window.titlebarAppearsTransparent = YES; window.titleVisibility = visible ? NSWindowTitleVisible : NSWindowTitleHidden; for (NSWindowButton button : { NSWindowCloseButton, NSWindowMiniaturizeButton, NSWindowZoomButton }) [window standardWindowButton:button].hidden = !visible; diff --git a/tests/TestRunner.cpp b/tests/TestRunner.cpp index 087b5a04..6df1e2a8 100644 --- a/tests/TestRunner.cpp +++ b/tests/TestRunner.cpp @@ -647,11 +647,14 @@ int main(int argc, char **argv) // selector owns its one Q(Core/Gui)Application and its complete environment. int selectorIndex = 1; bool fixtures = false; + bool remoteDevice = false; for (int index = 1; index < argc; ++index) { if (std::string_view(argv[index]) == "--fixture-suite") fixtures = true; if (std::string_view(argv[index]) == "--child") selectorIndex = index + 1; + if (std::string_view(argv[index]) == "--device") + remoteDevice = true; } bool supervisor = argc == 1; bool list = false; @@ -662,7 +665,8 @@ int main(int argc, char **argv) #if defined(SPOOL_E2E_BINARY) && defined(Q_OS_LINUX) && !defined(SPOOL_ANDROID) // GUI selectors open real windows and drive input. Never on the person's // desktop: inside tools/test-gpu-session.sh, or explicitly offscreen. - if (!list && qEnvironmentVariable("SPOOL_PRIVATE_TEST_SESSION") != QLatin1String("1") + // Mobile host journeys (--device) use QCoreApplication and never open a host window. + if (!list && !remoteDevice && qEnvironmentVariable("SPOOL_PRIVATE_TEST_SESSION") != QLatin1String("1") && qEnvironmentVariable("QT_QPA_PLATFORM").section(QLatin1Char(':'), 0, 0) != QLatin1String("offscreen")) { std::cerr << "spool-e2e-tests runs only on a private display: use nix run .#tests, ctest, " "tools/test-gpu-session.sh, or QT_QPA_PLATFORM=offscreen\n"; diff --git a/tests/providers/ScriptRuntimeTest.cpp b/tests/providers/ScriptRuntimeTest.cpp index 4bf7198c..73b2226f 100644 --- a/tests/providers/ScriptRuntimeTest.cpp +++ b/tests/providers/ScriptRuntimeTest.cpp @@ -72,6 +72,10 @@ SPOOL_TEST_MAIN("script-runtime") QCoro::waitFor(std::move(removed)); QCoro::waitFor(std::move(replacement)); QCoro::waitFor(runtime.call("reused", "inspect")); + // Drain queued main-thread events already posted by the worker thread + // before inspect completed; QCoro::waitFor returns as soon as its + // future finishes without flushing other queued meta-calls. + QCoreApplication::processEvents(); require(events == QList { QVariantMap { { "capabilities", newOffer } } }, "queued capability events from a removed generation cannot change a replacement account"); } diff --git a/tools/android/build-apks.sh b/tools/android/build-apks.sh index d31ca826..5f034dba 100755 --- a/tools/android/build-apks.sh +++ b/tools/android/build-apks.sh @@ -144,7 +144,23 @@ settings["qml-root-path"] = [sys.argv[2]] path.write_text(json.dumps(settings, indent=2) + "\n") PY done - cmake --build "$build" --target spool_make_apk --parallel "$JOBS" + local build_apk_target + build_apk_target() { + local apk_target="$1" + local attempt + for attempt in 1 2 3; do + if cmake --build "$build" --target "$apk_target" --parallel "$JOBS"; then + return 0 + fi + if [[ $attempt -lt 3 ]]; then + echo "Retrying $apk_target after transient Gradle/Maven failure (attempt $((attempt + 1))/3)..." >&2 + sleep $((attempt * 15)) + fi + done + return 1 + } + + build_apk_target spool_make_apk local app_package="$build/android-build" if [[ "$developer" == ON ]]; then @@ -161,7 +177,7 @@ PY # Never replace the signed non-debuggable release/universal inputs. cp -f "$apk" "$ROOT/dist/android/spool-e2e-app-${ABI}.apk" for target in spool-tests spool-e2e-tests; do - cmake --build "$build" --target "${target}_make_apk" --parallel "$JOBS" + build_apk_target "${target}_make_apk" apk="$build/android-build-${target}/${target}.apk" [[ -f "$apk" ]] || { echo "error: test APK was not generated at $apk" >&2 diff --git a/tools/android/emulator-launch-test.sh b/tools/android/emulator-launch-test.sh index b99ac745..0085cba8 100755 --- a/tools/android/emulator-launch-test.sh +++ b/tools/android/emulator-launch-test.sh @@ -51,6 +51,7 @@ if [[ -z "${SPOOL_E2E_SPOOLET:-}" ]]; then read -r SPOOL_E2E_SPOOLET <"$host_build/native-spoolet-path.txt" fi export SPOOL_DEVICE_HOST_E2E SPOOL_E2E_SPOOLET +export SPOOL_E2E_ADB="$ADB" export SPOOL_E2E_ISOLATED_DEVICE=1 # Realize the emulator and system image before the adb registration deadline. @@ -195,8 +196,11 @@ launch_category() { fail "$package" "$package activity is not present" "$ADB" logcat -d -s Spool:V | grep -qF 'startup: QML source loaded' || fail "$package" "$package did not load its QML scene" - ! "$ADB" logcat -d -s Spool:V | grep -qE '\[qml\] |\[qt:(crit|fatal)\] ' || + if "$ADB" logcat -d -s Spool:V | grep -qE '\[qml\] |\[qt:(crit|fatal)\] '; then + "$ADB" logcat -d -s Spool:V | grep -E '\[qml\] |\[qt:(crit|fatal)\] ' | + sed -E 's#https?://[^ ]+##g' | head -n 40 >&2 || true fail "$package" "$package reported QML errors" + fi ! "$ADB" logcat -d -b crash -b main | grep -qE 'FATAL EXCEPTION|Fatal signal' || fail "$package" "Android reported a fatal launch failure for $package" diff --git a/tools/build-macos.sh b/tools/build-macos.sh index 35fe1346..0d7da2bb 100755 --- a/tools/build-macos.sh +++ b/tools/build-macos.sh @@ -48,6 +48,7 @@ cmake_build_app "$APP_ROOT" "$APP_BUILD" \ -DSPOOL_PROVIDER_OVERRIDES="${SPOOL_PROVIDER_OVERRIDES:-}" \ -DSPOOL_MACOS_ICON="$MACOS_ICON" \ -DSPOOL_MACOS_CREDENTIAL_SERVICE="$SPOOL_MACOS_CREDENTIAL_SERVICE" \ + -DSPOOL_TEST_RENDER_BACKEND="${SPOOL_TEST_RENDER_BACKEND:-all}" \ -DCMAKE_PREFIX_PATH="$MPV_PREFIX${CMAKE_PREFIX_PATH:+;$CMAKE_PREFIX_PATH}" \ -DCMAKE_INSTALL_PREFIX="$APP_INSTALL" diff --git a/tools/check-streaming-dependencies.py b/tools/check-streaming-dependencies.py index d3df11d0..fe0224ee 100644 --- a/tools/check-streaming-dependencies.py +++ b/tools/check-streaming-dependencies.py @@ -27,7 +27,15 @@ for package, library in [('openssl', 'openssl'), ('nghttp2', 'libnghttp2'), ('nghttp3', 'libnghttp3'), ('ngtcp2', 'libngtcp2')]: pc = args.prefix / 'lib/pkgconfig' / (library + '.pc') - match = re.search(r'^Version:\s*(\S+)', pc.read_text(), re.M) + if pc.exists(): + match = re.search(r'^Version:\s*(\S+)', pc.read_text(), re.M) + elif package == 'openssl': + # OpenSSL's MSVC install writes no pkg-config file; its installed + # version header states the same release. + header = args.prefix / 'include/openssl/opensslv.h' + match = re.search(r'^#\s*define\s+OPENSSL_VERSION_STR\s+"([^"]+)"', header.read_text(), re.M) + else: + match = None if not match or match[1] != manifest[package]['version']: parser.error(f'{package} version does not match pin') for name in ['ssl', 'crypto']: diff --git a/tools/patches/qt-cocoa-pending-fullscreen-state.patch b/tools/patches/qt-cocoa-pending-fullscreen-state.patch index 86cdbf47..607e930b 100644 --- a/tools/patches/qt-cocoa-pending-fullscreen-state.patch +++ b/tools/patches/qt-cocoa-pending-fullscreen-state.patch @@ -1,4 +1,5 @@ diff --git a/src/plugins/platforms/cocoa/qcocoawindow.h b/src/plugins/platforms/cocoa/qcocoawindow.h +index 10d228c..8319ca5 100644 --- a/src/plugins/platforms/cocoa/qcocoawindow.h +++ b/src/plugins/platforms/cocoa/qcocoawindow.h @@ -10,6 +10,7 @@ @@ -6,28 +7,38 @@ diff --git a/src/plugins/platforms/cocoa/qcocoawindow.h b/src/plugins/platforms/ #include #include +#include - + #ifndef QT_NO_OPENGL #include "qcocoaglcontext.h" -@@ -235,6 +236,7 @@ +@@ -199,6 +200,7 @@ protected: + void toggleMaximized(); + void toggleFullScreen(); + bool isTransitioningToFullScreen() const; ++ void replayPendingFullScreenState(); + + bool startSystemMove() override; + +@@ -235,6 +237,8 @@ public: // for QNSView NSView *m_view = nil; - + Qt::WindowStates m_lastReportedWindowState = Qt::WindowNoState; + std::optional m_pendingFullScreenState; - ++ bool m_isTransitioningFromFullScreen = false; + static QPointer s_windowUnderMouse; - + diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms/cocoa/qcocoawindow.mm +index 935645c..249da4f 100644 --- a/src/plugins/platforms/cocoa/qcocoawindow.mm +++ b/src/plugins/platforms/cocoa/qcocoawindow.mm -@@ -882,6 +882,15 @@ +@@ -882,6 +882,15 @@ void QCocoaWindow::setWindowFlags(Qt::WindowFlags flags) */ void QCocoaWindow::setWindowState(Qt::WindowStates state) { -+ if (window()->isVisible() && isTransitioningToFullScreen()) { -+ // qt_fullScreen is only set by NSWindowDidEnterFullScreenNotification. -+ // Until then, applying a normal state sees an already-normal window -+ // and loses the request. Keep only the latest explicit Qt request. ++ if (window()->isVisible() && (isTransitioningToFullScreen() || m_isTransitioningFromFullScreen)) { ++ // AppKit drops toggleFullScreen: calls while an enter or exit ++ // transition is already in flight. Keep only the latest explicit Qt ++ // request and replay it after the active transition completes. + m_pendingFullScreenState = state; + return; + } @@ -36,19 +47,81 @@ diff --git a/src/plugins/platforms/cocoa/qcocoawindow.mm b/src/plugins/platforms if (window()->isVisible()) applyWindowState(state); // Window state set for hidden windows take effect when show() is called } -@@ -1048,6 +1057,15 @@ +@@ -1036,11 +1045,39 @@ bool QCocoaWindow::isTransitioningToFullScreen() const + return window.styleMask & NSWindowStyleMaskFullScreen && !window.qt_fullScreen; + } + ++void QCocoaWindow::replayPendingFullScreenState() ++{ ++ // A native titlebar transition has no pending Qt request. Do not undo it. ++ // A newer explicit request made during state delivery clears the pending ++ // state in setWindowState(), and must likewise not be overwritten here. ++ // Defer past AppKit's notification stack: calling toggleFullScreen: ++ // synchronously inside NSWindowDid{Enter,Exit}FullScreenNotification logs ++ // a transition error and drops the request on macOS 15+. ++ if (!m_pendingFullScreenState) ++ return; ++ ++ const auto requestedState = *m_pendingFullScreenState; ++ const QPointer target(window()); ++ QMetaObject::invokeMethod( ++ target, ++ [this, target, requestedState] { ++ if (!target || target->handle() != this) ++ return; ++ if (!m_pendingFullScreenState || *m_pendingFullScreenState != requestedState) ++ return; ++ m_pendingFullScreenState.reset(); ++ target->setWindowStates(requestedState); ++ }, ++ Qt::QueuedConnection); ++} ++ + void QCocoaWindow::windowDidEnterFullScreen() + { + if (!isContentView()) + return; + ++ m_isTransitioningFromFullScreen = false; ++ + Q_ASSERT_X(m_view.window.qt_fullScreen, "QCocoaWindow", + "FullScreen category processes window notifications first"); + +@@ -1048,6 +1085,7 @@ void QCocoaWindow::windowDidEnterFullScreen() setWindowFlags(window()->flags()); - + handleWindowStateChanged(); ++ replayPendingFullScreenState(); + } + + void QCocoaWindow::windowWillExitFullScreen() +@@ -1055,6 +1093,8 @@ void QCocoaWindow::windowWillExitFullScreen() + if (!isContentView()) + return; + ++ m_isTransitioningFromFullScreen = true; + -+ // A native titlebar entry has no pending Qt request. Do not undo it. -+ // A newer explicit request made during state delivery clears the pending -+ // state in setWindowState(), and must likewise not be overwritten here. + // The NSWindow needs to be resizable, otherwise we'll end up with + // a weird zoom animation. The styleMask will be reset below. + m_view.window.styleMask |= NSWindowStyleMaskResizable; +@@ -1065,6 +1105,8 @@ void QCocoaWindow::windowDidExitFullScreen() + if (!isContentView()) + return; + ++ m_isTransitioningFromFullScreen = false; ++ + Q_ASSERT_X(!m_view.window.qt_fullScreen, "QCocoaWindow", + "FullScreen category processes window notifications first"); + +@@ -1076,6 +1118,11 @@ void QCocoaWindow::windowDidExitFullScreen() + // Deliver update of QWindow state + handleWindowStateChanged(); + + if (m_pendingFullScreenState) { -+ const auto requestedState = *m_pendingFullScreenState; -+ m_pendingFullScreenState.reset(); -+ window()->setWindowStates(requestedState); ++ replayPendingFullScreenState(); ++ return; + } - } - - void QCocoaWindow::windowWillExitFullScreen() ++ + if (requestedState != windowState() && requestedState != Qt::WindowFullScreen) { + // We were only going out of full screen as an intermediate step before + // progressing into the final step, so re-sync the desired state. diff --git a/tools/patches/qt6-nixpkgs/macdeployqt-fixes.patch b/tools/patches/qt6-nixpkgs/macdeployqt-fixes.patch new file mode 100644 index 00000000..460f35e2 --- /dev/null +++ b/tools/patches/qt6-nixpkgs/macdeployqt-fixes.patch @@ -0,0 +1,34 @@ +diff --git a/src/tools/macdeployqt/shared/shared.cpp b/src/tools/macdeployqt/shared/shared.cpp +index d1b5694df62..7d9eef816e0 100644 +--- a/src/tools/macdeployqt/shared/shared.cpp ++++ b/src/tools/macdeployqt/shared/shared.cpp +@@ -1302,6 +1302,10 @@ bool deployQmlImports(const QString &appBundlePath, DeploymentInfo deploymentInf + if (qmlImportScannerPath.isEmpty()) + qmlImportScannerPath = QCoreApplication::applicationDirPath() + "/qmlimportscanner"; + ++ // Fallback: Pass qml import scanner via environment variable ++ if (!QFile::exists(qmlImportScannerPath)) ++ qmlImportScannerPath = ::qgetenv("NIX_QMLIMPORTSCANNER"); ++ + // Verify that we found a qmlimportscanner binary + if (!QFile::exists(qmlImportScannerPath)) { + LogError() << "qmlimportscanner not found at" << qmlImportScannerPath; +@@ -1318,7 +1322,17 @@ bool deployQmlImports(const QString &appBundlePath, DeploymentInfo deploymentInf + } + for (const QString &importPath : qmlImportPaths) + argumentList << "-importPath" << importPath; +- for (const QString &importPath : QLibraryInfo::paths(QLibraryInfo::QmlImportsPath)) ++ for (const QString &importPath : QLibraryInfo::paths(QLibraryInfo::QmlImportsPath)) { ++ if (QFile::exists(importPath)) { ++ argumentList << "-importPath" << importPath; ++ } ++ } ++ ++ // In a modularized installation of qt as we have in Nix, instead, we will ++ // read the paths from the environment, as they are spread in multiple ++ // locations and normally set in the environment like this ++ auto envQmlImportPaths = ::qgetenv("QML2_IMPORT_PATH").split(':'); ++ for (const QString &importPath : envQmlImportPaths) + argumentList << "-importPath" << importPath; + + // run qmlimportscanner diff --git a/tools/patches/qt6-nixpkgs/use-versioned-import-path.patch b/tools/patches/qt6-nixpkgs/use-versioned-import-path.patch new file mode 100644 index 00000000..7196d7a5 --- /dev/null +++ b/tools/patches/qt6-nixpkgs/use-versioned-import-path.patch @@ -0,0 +1,12 @@ +diff --git a/src/qml/qml/qqmltypeloader.cpp b/src/qml/qml/qqmltypeloader.cpp +index 5f9c040c6f..5f34e49757 100644 +--- a/src/qml/qml/qqmltypeloader.cpp ++++ b/src/qml/qml/qqmltypeloader.cpp +@@ -1278,6 +1278,7 @@ QQmlTypeLoader::QQmlTypeLoader(QV4::ExecutionEngine *engine) + + addEnvPath("QML2_IMPORT_PATH", &QQmlTypeLoader::addImportPath); + addEnvPath("QML_IMPORT_PATH", &QQmlTypeLoader::addImportPath); ++ addEnvPath("NIXPKGS_QT6_QML_IMPORT_PATH", &QQmlTypeLoader::addImportPath); + + const auto qmlImportPaths = QLibraryInfo::paths(QLibraryInfo::QmlImportsPath); + for (const auto &qmlImportPath : qmlImportPaths) diff --git a/tools/run-device-tests.py b/tools/run-device-tests.py index 557995cc..8f74885a 100755 --- a/tools/run-device-tests.py +++ b/tools/run-device-tests.py @@ -968,6 +968,8 @@ def app_journey(platform, output, timeout, regression=None): "port": service.server_address[1], "token": service.token}) environment = dict(os.environ, SPOOL_E2E_DEVICE_JOURNEY_OWNER=str(capability), SPOOL_E2E_ARTIFACT_DIR=str(output)) + if platform == "android": + environment["SPOOL_E2E_ADB"] = owner.tool thread = threading.Thread(target=service.serve_forever, daemon=True) thread.start() process = None @@ -1246,15 +1248,25 @@ def export_attempt(private, destination, result): r"^app-journey: production spoolet rejected ([a-z_-]{1,32}) " r"\(exit=(-?[0-9]+), code=([a-z_]{1,64}), elapsed_ms=([0-9]+), " r"timeout_origin=(unknown|server|client_write|client_response)\)") + reason_pattern = re.compile(r'^app-journey: ([A-Za-z0-9 ,.:;()=_\x27"-]{1,200})$') with log.open(encoding="utf-8", errors="replace") as stream: for line in stream: - match = pattern.match(line) + stripped = line.rstrip("\r\n") + match = pattern.match(stripped) if match: operation, code, error, elapsed, origin = match.groups() controlled = (f"spoolet command={operation} exitCode={int(code)} code={error} " f"elapsed_ms={int(elapsed)} timeoutOrigin={origin}") lines.append(controlled) print("app-journey: " + controlled, flush=True) + continue + reason_match = reason_pattern.match(stripped) + if reason_match: + reason = reason_match.group(1) + if ("retained at" not in reason and "://" not in reason and + "/" not in reason and not re.search(r"[a-fA-F0-9]{24,}", reason)): + lines.append("reason=" + reason) + print("app-journey: " + reason, flush=True) (destination / "attempt.log").write_text("\n".join(lines) + "\n", encoding="utf-8") allowed = {"native-result.json", "controller-result.json", "attempt.log", "frame.png", "library-text.png", "mobile-default-startup.png", NATIVE_DIAGNOSTIC_NAME} diff --git a/tools/windows/build-streaming-dependencies.ps1 b/tools/windows/build-streaming-dependencies.ps1 index 5ac869c9..9a438083 100644 --- a/tools/windows/build-streaming-dependencies.ps1 +++ b/tools/windows/build-streaming-dependencies.ps1 @@ -61,20 +61,107 @@ try { $env:CC = $originalCC $env:CXX = $originalCXX } +# OpenSSL's MSVC install_dev writes CMake config files but omits pkg-config +# files, which libngtcp2_crypto_ossl.pc and libcurl.pc require via +# Requires.private when Meson resolves static libcurl. +$opensslVersionHeader = Get-Content -LiteralPath (Join-Path $prefix 'include\openssl\opensslv.h') -Raw +if ($opensslVersionHeader -notmatch '#\s*define\s+OPENSSL_VERSION_STR\s+"([^"]+)"') { + throw 'Failed to read installed OpenSSL version from opensslv.h.' +} +$opensslVersion = $Matches[1] +$pkgConfigDir = Join-Path $prefix 'lib\pkgconfig' +New-Item -ItemType Directory -Force $pkgConfigDir | Out-Null +$prefixForward = $prefix -replace '\\', '/' +$utf8NoBom = [Text.UTF8Encoding]::new($false) +[IO.File]::WriteAllText((Join-Path $pkgConfigDir 'libcrypto.pc'), @" +prefix=$prefixForward +exec_prefix=`${prefix} +libdir=`${exec_prefix}/lib +includedir=`${prefix}/include + +Name: OpenSSL-libcrypto +Description: OpenSSL cryptography library +Version: $opensslVersion +Libs: -L`${libdir} -llibcrypto +Libs.private: -lws2_32 -lgdi32 -lcrypt32 -ladvapi32 -luser32 +Cflags: -I`${includedir} +"@.Replace("`r`n", "`n") + "`n", $utf8NoBom) +[IO.File]::WriteAllText((Join-Path $pkgConfigDir 'libssl.pc'), @" +prefix=$prefixForward +exec_prefix=`${prefix} +libdir=`${exec_prefix}/lib +includedir=`${prefix}/include + +Name: OpenSSL-libssl +Description: Secure Sockets Layer and cryptography libraries +Version: $opensslVersion +Requires.private: libcrypto +Libs: -L`${libdir} -llibssl +Cflags: -I`${includedir} +"@.Replace("`r`n", "`n") + "`n", $utf8NoBom) +[IO.File]::WriteAllText((Join-Path $pkgConfigDir 'openssl.pc'), @" +prefix=$prefixForward +exec_prefix=`${prefix} +libdir=`${exec_prefix}/lib +includedir=`${prefix}/include + +Name: OpenSSL +Description: Secure Sockets Layer and cryptography libraries and tools +Version: $opensslVersion +Requires: libssl libcrypto +"@.Replace("`r`n", "`n") + "`n", $utf8NoBom) $env:PKG_CONFIG_PATH = Convert-StreamingPath "$prefix/lib/pkgconfig" +$staticMacroByPc = @{ + 'nghttp2' = @{ 'libnghttp2.pc' = '-DNGHTTP2_STATICLIB' } + 'nghttp3' = @{ 'libnghttp3.pc' = '-DNGHTTP3_STATICLIB' } + 'ngtcp2' = @{ + 'libngtcp2.pc' = '-DNGTCP2_STATICLIB' + 'libngtcp2_crypto_ossl.pc' = '-DNGTCP2_STATICLIB' + } +} foreach ($name in @('nghttp2', 'nghttp3', 'ngtcp2', 'curl')) { - & cmake -S (Join-Path $sources $name) -B (Join-Path $builds $name) -GNinja ` - "-DSTREAMING_DEPENDENCY=$name" -DSTREAMING_SHARED=OFF ` - -C (Join-Path $root 'tools\cmake\StreamingDependencies.cmake') ` - -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=clang-cl -DCMAKE_CXX_COMPILER=clang-cl ` - -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDLL "-DCMAKE_INSTALL_PREFIX=$prefix" ` - "-DCMAKE_PREFIX_PATH=$prefix" "-DOPENSSL_ROOT_DIR=$prefix" -DOPENSSL_USE_STATIC_LIBS=ON ` - -DCURL_ZLIB=OFF -DCURL_USE_SCHANNEL=OFF -DCURL_CA_NATIVE=ON + $cmakeArgs = @( + '-S', (Join-Path $sources $name), + '-B', (Join-Path $builds $name), + '-GNinja', + "-DSTREAMING_DEPENDENCY=$name", + '-DSTREAMING_SHARED=OFF', + '-C', (Join-Path $root 'tools\cmake\StreamingDependencies.cmake'), + '-DCMAKE_BUILD_TYPE=Release', + '-DCMAKE_C_COMPILER=clang-cl', + '-DCMAKE_CXX_COMPILER=clang-cl', + '-DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDLL', + "-DCMAKE_INSTALL_PREFIX=$prefix", + "-DCMAKE_PREFIX_PATH=$prefix", + "-DOPENSSL_ROOT_DIR=$prefix", + '-DOPENSSL_USE_STATIC_LIBS=ON', + '-DCURL_ZLIB=OFF', + '-DCURL_USE_SCHANNEL=OFF', + '-DCURL_CA_NATIVE=ON' + ) + # Upstream nghttp2/nghttp3/ngtcp2 Windows .pc files omit *_STATICLIB, + # causing pkg-config consumers like curl to emit __declspec(dllimport). + if ($name -in @('ngtcp2', 'curl')) { + $cmakeArgs += '-DCMAKE_C_FLAGS=-DNGHTTP2_STATICLIB -DNGHTTP3_STATICLIB -DNGTCP2_STATICLIB' + } + & cmake @cmakeArgs if ($LASTEXITCODE -ne 0) { throw "Configuring $name failed." } & cmake --build (Join-Path $builds $name) --parallel 4 if ($LASTEXITCODE -ne 0) { throw "Building $name failed." } & cmake --install (Join-Path $builds $name) if ($LASTEXITCODE -ne 0) { throw "Installing $name failed." } + if ($staticMacroByPc.ContainsKey($name)) { + foreach ($entry in $staticMacroByPc[$name].GetEnumerator()) { + $pcPath = Join-Path $pkgConfigDir $entry.Key + if (Test-Path -LiteralPath $pcPath) { + $pcText = Get-Content -LiteralPath $pcPath -Raw + if ($pcText -notmatch [regex]::Escape($entry.Value)) { + $pcText = [regex]::Replace($pcText, '(?m)^Cflags:(.*)$', "Cflags:`$1 $($entry.Value)") + [IO.File]::WriteAllText($pcPath, $pcText.Replace("`r`n", "`n"), $utf8NoBom) + } + } + } + } } & cmake -S (Join-Path $root 'tools\cmake\QuicBatchingProbe') -B (Join-Path $builds 'quic-batching-probe') -GNinja ` -DCMAKE_C_COMPILER=clang-cl -DCMAKE_MSVC_RUNTIME_LIBRARY=MultiThreadedDLL ` @@ -83,6 +170,9 @@ foreach ($name in @('nghttp2', 'nghttp3', 'ngtcp2', 'curl')) { if ($LASTEXITCODE -ne 0) { throw 'Auditing compiled QUIC batching capabilities failed.' } # Audit metadata using native Python and the explicit MSYS shell; no target # binary or implicit system package can satisfy a wrong-version closure. +$curlPkgFlags = & $env:PKG_CONFIG --cflags --libs --static libcurl +if ($LASTEXITCODE -ne 0) { throw 'Static pkg-config resolution for libcurl failed.' } +Write-Host "libcurl static pkg-config: $curlPkgFlags" & python (Join-Path $root 'tools\check-streaming-dependencies.py') --prefix $prefix ` --manifest (Join-Path $root 'tools\manifests\streaming-third-party.json') --bash $bash --require-native-ca if ($LASTEXITCODE -ne 0) { throw 'The Windows streaming feature/version audit failed.' } diff --git a/tools/windows/common.ps1 b/tools/windows/common.ps1 index 36eb915e..389e383a 100644 --- a/tools/windows/common.ps1 +++ b/tools/windows/common.ps1 @@ -114,6 +114,27 @@ function Get-DefaultQCoroRoot { # Include the working tree and build contract, not just the submodule commit: # local edits must never reuse a DLL or disposable source mirror from before them. +function Get-PreferredWindowsLlvmBin { + # Visual Studio bundles an x64 LLVM matched to its MSVC STL headers (for + # example VS 18.12's MSVC 14.52 STL rejects standalone LLVM 20 with + # STL1000). Prefer Visual Studio's bundled LLVM when it carries the full + # clang/lld/llvm-rc toolchain so both libmpv builds and revision checks + # resolve the same compiler binary. + if ($env:VSINSTALLDIR) { + $vsLlvmBin = Join-Path $env:VSINSTALLDIR 'VC\Tools\Llvm\x64\bin' + $vsLlvmTools = @('clang.exe', 'clang++.exe', 'clang-cl.exe', 'lld-link.exe', 'llvm-rc.exe') + if ((Test-Path -LiteralPath $vsLlvmBin) -and + (@($vsLlvmTools | Where-Object { -not (Test-Path -LiteralPath (Join-Path $vsLlvmBin $_) -PathType Leaf) }).Count -eq 0)) { + return $vsLlvmBin + } + } + $standalone = Join-Path $env:ProgramFiles 'LLVM\bin' + if (Test-Path -LiteralPath $standalone) { + return $standalone + } + return $null +} + function Get-MpvSourceRevision { $root = Get-RepositoryRoot $mpv = Join-Path $root 'mpv' @@ -146,9 +167,14 @@ function Get-MpvSourceRevision { )) { $inputs.Add("$file=$((Get-FileHash -LiteralPath (Join-Path $root $file) -Algorithm SHA256).Hash)") } + $preferredLlvm = Get-PreferredWindowsLlvmBin foreach ($name in @('cl.exe', 'clang.exe', 'lld-link.exe')) { - $tool = Get-Command $name -ErrorAction Stop - $inputs.Add("$name=$((Get-FileHash -LiteralPath $tool.Source -Algorithm SHA256).Hash)") + $toolPath = if ($preferredLlvm -and $name -ne 'cl.exe' -and (Test-Path -LiteralPath (Join-Path $preferredLlvm $name) -PathType Leaf)) { + Join-Path $preferredLlvm $name + } else { + (Get-Command $name -ErrorAction Stop).Source + } + $inputs.Add("$name=$((Get-FileHash -LiteralPath $toolPath -Algorithm SHA256).Hash)") } $sha = [Security.Cryptography.SHA256]::Create() try { @@ -228,6 +254,10 @@ function Initialize-WindowsMpvBuildEnvironment { (Join-Path $env:ProgramFiles 'NASM'), (Join-Path $env:ProgramFiles 'Git\usr\bin') ) + $preferredLlvm = Get-PreferredWindowsLlvmBin + if ($preferredLlvm) { + $toolDirectories += $preferredLlvm + } foreach ($directory in $toolDirectories) { if (Test-Path -LiteralPath $directory) { $env:PATH = "$directory;$env:PATH" From a3a27ebb88fc2313853858a0af087335fcc2d9cb Mon Sep 17 00:00:00 2001 From: Sacha Korban Date: Fri, 27 Nov 2026 02:50:05 +1100 Subject: [PATCH 08/39] fix(ui): stabilize focus, control sizing and asynchronous provider assertions Consolidate the release milestone ending at 368a7e967fb968d03f965afe590df69c31881e21. Original starting snapshot: 626034bd097e1247ba5f6cdd7a73ce7afef3a978. --- .github/workflows/ios-review.yml | 11 + qml/primitives/ActionButton.qml | 29 +-- qml/primitives/MediaRow.qml | 1 + qml/shell/ServerLogin.qml | 16 +- src/player/MpvOptionProfile.cpp | 12 +- tests/TestRequire.h | 2 +- tests/TestRunner.cpp | 14 ++ tests/e2e/AppJourneyTest.cpp | 256 +++++++++++++++++------ tests/player/MpvOptionProfileTest.cpp | 28 ++- tests/providers/ProviderRegistryTest.cpp | 8 + tests/providers/SourceHubSpeedTest.cpp | 15 +- tests/qml/tst_MediaRow.qml | 14 +- tests/qml/tst_ProviderForms.qml | 5 +- tests/tools/StreamingCandidatesTest.py | 13 +- tools/android/build-apks.sh | 23 ++ tools/run-device-tests.py | 2 +- 16 files changed, 350 insertions(+), 99 deletions(-) diff --git a/.github/workflows/ios-review.yml b/.github/workflows/ios-review.yml index 34d5b126..8cc2cbf3 100644 --- a/.github/workflows/ios-review.yml +++ b/.github/workflows/ios-review.yml @@ -120,6 +120,17 @@ jobs: path: ${{ runner.temp }}/ios-simulator-x86_64.tar.gz if-no-files-found: error retention-days: 7 + - name: Keep simulator test diagnostics internal + if: always() && matrix.sdk == 'iphonesimulator' + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.0 + with: + name: internal-ios-simulator-x86_64-tests + path: | + build/ios/smoke/safe-export + build/ios/smoke/launch-result.json + build/ios/smoke/simulator.png + if-no-files-found: warn + retention-days: 7 - name: Document unsigned artifact boundary if: matrix.sdk == 'iphoneos' shell: bash diff --git a/qml/primitives/ActionButton.qml b/qml/primitives/ActionButton.qml index 8da09e3b..f2f9271b 100644 --- a/qml/primitives/ActionButton.qml +++ b/qml/primitives/ActionButton.qml @@ -57,19 +57,24 @@ T.Control { Item { id: buttonContent anchors.centerIn: parent - // Measure unelided text independently of buttonLabel's anchored width - // so Qt 6.12 elided layout updates cannot feed back into width. - // Add small slack so subpixel CoreText shaping never elides short labels. - TextMetrics { - id: labelMetrics - font: buttonLabel.font + // Measure unelided text with an unconstrained AppText using the exact + // same variable font shaping path without feeding buttonLabel's elided + // width back into buttonContent.width on Qt 6.12. + AppText { + id: labelMeasure + visible: false text: root.text + font.pixelSize: buttonLabel.font.pixelSize + font.weight: buttonLabel.font.weight + elide: Text.ElideNone + maximumLineCount: 1 + Accessible.ignored: true } - implicitWidth: Math.ceil(Math.max(labelMetrics.advanceWidth, labelMetrics.width, - labelMetrics.tightBoundingRect.width)) + 4 + (buttonIcon.visible - ? buttonIcon.width - + Metrics.scaled(8) : 0) - width: Math.min(implicitWidth, Math.max(0, parent.width - Metrics.scaled(34))) + readonly property real maxContentWidth: Math.max(0, parent.width - Metrics.scaled(34)) + readonly property bool needsElide: implicitWidth > maxContentWidth + implicitWidth: Math.ceil(labelMeasure.implicitWidth) + 8 + (buttonIcon.visible ? buttonIcon.width + + Metrics.scaled(8) : 0) + width: buttonIcon.visible ? Math.min(implicitWidth, maxContentWidth) : maxContentWidth height: Math.max(buttonLabel.implicitHeight, buttonIcon.visible ? buttonIcon.height : 0) MaterialIcon { @@ -96,7 +101,7 @@ T.Control { font.pixelSize: Metrics.bodySizePx font.weight: root.kind === "primary" || root.kind === "blue" || root.kind === "danger" ? Font.DemiBold : Font.Medium - elide: Text.ElideRight + elide: buttonContent.needsElide ? Text.ElideRight : Text.ElideNone maximumLineCount: 1 Accessible.ignored: true } diff --git a/qml/primitives/MediaRow.qml b/qml/primitives/MediaRow.qml index 65516300..2df27057 100644 --- a/qml/primitives/MediaRow.qml +++ b/qml/primitives/MediaRow.qml @@ -185,6 +185,7 @@ FocusScope { } function topLeftVisibleCandidate(outerViewport) { + listView.forceLayout() return InputKeys.topLeftVisibleCandidate(listView, outerViewport) } diff --git a/qml/shell/ServerLogin.qml b/qml/shell/ServerLogin.qml index 415419a7..8b09fa81 100644 --- a/qml/shell/ServerLogin.qml +++ b/qml/shell/ServerLogin.qml @@ -255,7 +255,11 @@ FocusScope { step = "account" usernameField.text = "" password.text = "" - Qt.callLater(() => usernameField.focusRow()) + Qt.callLater(() => { + if (step === "account" && !alternateActive && !closed && !password.activeFocus && + !usernameField.activeFocus) + usernameField.focusRow() + }) }, reason => { if (current()) fail(reason) @@ -357,7 +361,10 @@ FocusScope { error = "" step = "server" password.text = "" - Qt.callLater(() => address.focusRow()) + Qt.callLater(() => { + if (step === "server" && !alternateActive && !closed) + address.focusRow() + }) return true } function activate() { @@ -382,7 +389,10 @@ FocusScope { }, fail) } else { discoverServers() - Qt.callLater(() => address.focusRow()) + Qt.callLater(() => { + if (step === "server" && !alternateActive && !closed && !address.activeFocus) + address.focusRow() + }) } } Component.onDestruction: { diff --git a/src/player/MpvOptionProfile.cpp b/src/player/MpvOptionProfile.cpp index 3594d67f..6aee4d7f 100644 --- a/src/player/MpvOptionProfile.cpp +++ b/src/player/MpvOptionProfile.cpp @@ -598,7 +598,7 @@ std::vector MpvOptionProfile::applicationOptions(Platform platform, b } else { options.push_back({ "vo", needsVideoSurface ? "libmpv" : "null" }); #if defined(SPOOL_APPLE_MOBILE) - options.push_back({ "audio-fallback-to-null", "no" }); + options.push_back({ "audio-fallback-to-null", android ? "yes" : "no" }); #else options.push_back({ "audio-fallback-to-null", "yes" }); #endif @@ -633,12 +633,14 @@ std::vector MpvOptionProfile::applicationOptions(Platform platform, b // mature Android backend and restarts cleanly. options.push_back({ "ao", "audiotrack,opensles,null" }); } - } #if defined(SPOOL_APPLE_MOBILE) - // AudioUnit otherwise enables MixWithOthers and defeats interruption focus. - options.push_back({ "ao", "audiounit" }); - options.push_back({ "audio-exclusive", "yes" }); + if (!android) { + // AudioUnit otherwise enables MixWithOthers and defeats interruption focus. + options.push_back({ "ao", "audiounit" }); + options.push_back({ "audio-exclusive", "yes" }); + } #endif + } const MpvOption applicationOptions[] = { { "osd-bar", "no" }, diff --git a/tests/TestRequire.h b/tests/TestRequire.h index 2d863726..8a12d9b2 100644 --- a/tests/TestRequire.h +++ b/tests/TestRequire.h @@ -11,7 +11,7 @@ inline void require(bool condition, const char *message) { if (condition) return; - std::cerr << message << '\n'; + std::cerr << "spool-test-require: " << message << '\n'; std::exit(EXIT_FAILURE); } diff --git a/tests/TestRunner.cpp b/tests/TestRunner.cpp index 6df1e2a8..b9bd694a 100644 --- a/tests/TestRunner.cpp +++ b/tests/TestRunner.cpp @@ -595,6 +595,20 @@ int supervise(QCoreApplication& app) row.insert(QStringLiteral("attempts"), attempts); results.insert(it->name, row); std::cout << it->name.toStdString() << ": " << status.toStdString() << '\n'; + if (status == QStringLiteral("failed")) { + QFile diagFile(row.value(QStringLiteral("log")).toString()); + if (diagFile.open(QIODevice::ReadOnly)) { + int emitted = 0; + while (!diagFile.atEnd() && emitted < 10) { + const QByteArray raw = diagFile.readLine().trimmed(); + if ((raw.startsWith("spool-test-require: ") || raw.startsWith("app-journey: ")) + && !raw.contains("private failure artifacts") && !raw.contains("://")) { + std::cerr << raw.constData() << '\n'; + ++emitted; + } + } + } + } persist(); it = running.erase(it); } diff --git a/tests/e2e/AppJourneyTest.cpp b/tests/e2e/AppJourneyTest.cpp index 22b235f1..7714cf8e 100644 --- a/tests/e2e/AppJourneyTest.cpp +++ b/tests/e2e/AppJourneyTest.cpp @@ -721,16 +721,81 @@ class Journey final { } if (positiveContrast || adaptiveContrast) { // Preserve standard BT.601 luma for adaptive thresholding, or - // binarize dark captions on coloured controls for sparse OCR. + // isolate dark captions inside bright/coloured controls onto a + // clean white canvas so dark-theme backgrounds cannot invert OCR. const QImage source = image.convertToFormat(QImage::Format_RGB32); - image = QImage(source.size(), QImage::Format_Grayscale8); - for (int y = 0; y < source.height(); ++y) { - const auto *sourcePixels = reinterpret_cast(source.constScanLine(y)); - auto *pixels = image.scanLine(y); - for (int x = 0; x < source.width(); ++x) { - const QRgb pixel = sourcePixels[x]; - const int luma = (77 * qRed(pixel) + 150 * qGreen(pixel) + 29 * qBlue(pixel) + 128) >> 8; - pixels[x] = adaptiveContrast ? luma : luma > 64 ? 255 : 0; + const int width = source.width(); + const int height = source.height(); + image = QImage(width, height, QImage::Format_Grayscale8); + if (adaptiveContrast) { + for (int y = 0; y < height; ++y) { + const auto *sourcePixels = reinterpret_cast(source.constScanLine(y)); + auto *pixels = image.scanLine(y); + for (int x = 0; x < width; ++x) { + const QRgb pixel = sourcePixels[x]; + pixels[x] = (77 * qRed(pixel) + 150 * qGreen(pixel) + 29 * qBlue(pixel) + 128) >> 8; + } + } + } else { + std::vector lumas(size_t(width) * size_t(height)); + std::vector insideH(size_t(width) * size_t(height), 0); + constexpr int kBrightLuma = 96; + constexpr int kMaxStrokeH = 24; + constexpr int kMaxStrokeV = 18; + for (int y = 0; y < height; ++y) { + const auto *sourcePixels = reinterpret_cast(source.constScanLine(y)); + const size_t row = size_t(y) * size_t(width); + int lastBright = -kMaxStrokeH - 1; + for (int x = 0; x < width; ++x) { + const QRgb pixel = sourcePixels[x]; + const uint8_t luma + = uint8_t((77 * qRed(pixel) + 150 * qGreen(pixel) + 29 * qBlue(pixel) + 128) >> 8); + lumas[row + size_t(x)] = luma; + if (luma >= kBrightLuma) + lastBright = x; + if (x - lastBright <= kMaxStrokeH) + insideH[row + size_t(x)] = 1; + } + int nextBright = width + kMaxStrokeH + 1; + for (int x = width - 1; x >= 0; --x) { + if (lumas[row + size_t(x)] >= kBrightLuma) + nextBright = x; + if (nextBright - x > kMaxStrokeH) + insideH[row + size_t(x)] = 0; + } + } + std::vector insideV(size_t(width) * size_t(height), 0); + for (int x = 0; x < width; ++x) { + int lastBright = -kMaxStrokeV - 1; + for (int y = 0; y < height; ++y) { + const size_t idx = size_t(y) * size_t(width) + size_t(x); + if (lumas[idx] >= kBrightLuma) + lastBright = y; + if (y - lastBright <= kMaxStrokeV) + insideV[idx] = 1; + } + int nextBright = height + kMaxStrokeV + 1; + for (int y = height - 1; y >= 0; --y) { + const size_t idx = size_t(y) * size_t(width) + size_t(x); + if (lumas[idx] >= kBrightLuma) + nextBright = y; + if (nextBright - y > kMaxStrokeV) + insideV[idx] = 0; + } + } + for (int y = 0; y < height; ++y) { + const size_t row = size_t(y) * size_t(width); + auto *pixels = image.scanLine(y); + for (int x = 0; x < width; ++x) { + const size_t idx = row + size_t(x); + if (insideH[idx] || insideV[idx]) { + const int luma = lumas[idx]; + const int scaled = (luma - 12) * 255 / (112 - 12); + pixels[x] = uint8_t(std::clamp(scaled, 0, 255)); + } else { + pixels[x] = 255; + } + } } } } else if (highContrast) { @@ -790,7 +855,32 @@ class Journey final { { QRect found; QRect previous; + QString lastObserved; const std::string failure = "expected user-visible label was not rendered: " + text.toStdString(); + const auto summarize = [](const QList& lines) { + QString summary; + for (const auto& line : lines) { + if (line.text.isEmpty() || line.text.contains(QStringLiteral("://"))) + continue; + QString clean; + for (const QChar ch : line.text) { + if (ch.isLetterOrNumber() || ch == QLatin1Char(' ') || ch == QLatin1Char('-') + || ch == QLatin1Char(':')) + clean += ch; + } + clean = clean.simplified(); + if (clean.isEmpty()) + continue; + if (!summary.isEmpty()) + summary += QStringLiteral("; "); + summary += clean; + if (summary.size() >= 110) { + summary.truncate(110); + break; + } + } + return summary; + }; const auto locate = [&](const QList& lines) { for (const auto& line : lines) if (line.text.compare(text, Qt::CaseInsensitive) == 0) @@ -800,61 +890,109 @@ class Journey final { if (!bounds.isEmpty()) return bounds; } + for (qsizetype index = 0; index + 1 < lines.size(); ++index) { + const auto& first = lines[index]; + const auto& second = lines[index + 1]; + if (first.rectangles.isEmpty() || second.rectangles.isEmpty()) + continue; + QRect firstBox; + for (const QRect& rect : first.rectangles) + firstBox = firstBox.united(rect); + QRect secondBox; + for (const QRect& rect : second.rectangles) + secondBox = secondBox.united(rect); + const int maxHeight = std::max(firstBox.height(), secondBox.height()); + if (secondBox.top() < firstBox.top() || secondBox.top() - firstBox.bottom() > maxHeight * 2) + continue; + Words combined = first; + const qsizetype offset = combined.text.size() + 1; + combined.text += QLatin1Char(' ') + second.text; + for (qsizetype w = 0; w < second.starts.size(); ++w) { + combined.starts.append(offset + second.starts[w]); + combined.rectangles.append(second.rectangles[w]); + } + const QRect bounds = combined.phraseBounds(text); + if (!bounds.isEmpty()) + return bounds; + } return QRect {}; }; - await( - [&] { - const QImage frame = capture(); - QString imagePath = screenshotPath; - QRect region; - if (surface == TextSurface::LibraryRow) { - const auto row = capturedState["visual"].toObject()["libraryRow"].toObject(); - const double ratio = capturedState["window"].toObject()["devicePixelRatio"].toDouble(1); - region = QRectF(row["x"].toDouble() * ratio, row["y"].toDouble() * ratio, - row["width"].toDouble() * ratio, row["height"].toDouble() * ratio) - .toAlignedRect() - .intersected(frame.rect()); - if (region.isEmpty()) + try { + await( + [&] { + const QImage frame = capture(); + QString imagePath = screenshotPath; + QRect region; + if (surface == TextSurface::LibraryRow) { + const auto row = capturedState["visual"].toObject()["libraryRow"].toObject(); + const double ratio = capturedState["window"].toObject()["devicePixelRatio"].toDouble(1); + region = QRectF(row["x"].toDouble() * ratio, row["y"].toDouble() * ratio, + row["width"].toDouble() * ratio, row["height"].toDouble() * ratio) + .toAlignedRect() + .intersected(frame.rect()); + if (region.isEmpty()) + return false; + imagePath = libraryTextPath(); + QSaveFile file(imagePath); + require(file.open(QIODevice::WriteOnly) + && file.setPermissions(QFileDevice::ReadOwner | QFileDevice::WriteOwner) + && frame.copy(region).save(&file, "PNG") && file.commit(), + "actual rendered library row could not be read for caption navigation"); + } + const QList primaryLines + = words(imagePath, surface == TextSurface::LibraryRow ? 6 : 11, region.topLeft()); + lastObserved = summarize(primaryLines); + QRect candidate = locate(primaryLines); + // Sparse-page segmentation can omit text touching a focus outline. + // Read the same real frame as a text block rather than accepting a + // larger heading's unrelated hit region or manufacturing a label. + if (candidate.isEmpty() && surface == TextSurface::Window) + candidate = locate(words(imagePath, 6)); + if (candidate.isEmpty()) + candidate = locate(words(imagePath, 6, region.topLeft(), TextPreprocess::Neutral)); + if (candidate.isEmpty()) + candidate = locate(words(imagePath, 6, region.topLeft(), TextPreprocess::Inverse)); + if (candidate.isEmpty()) { + const QList positiveLines + = words(imagePath, 11, region.topLeft(), TextPreprocess::Positive); + candidate = locate(positiveLines); + if (candidate.isEmpty()) + candidate = locate(words(imagePath, 6, region.topLeft(), TextPreprocess::Positive)); + if (candidate.isEmpty()) { + const QString pos = summarize(positiveLines); + if (!pos.isEmpty()) { + const QString combined + = QStringLiteral("pos: ") + pos + QStringLiteral("; ") + lastObserved; + lastObserved = combined.left(110); + } + } + } + if (candidate.isEmpty()) + candidate = locate(words(imagePath, 11, region.topLeft(), TextPreprocess::Adaptive)); + if (candidate.isEmpty()) + candidate = locate(words(imagePath, 3, region.topLeft(), TextPreprocess::Adaptive)); + if (!candidate.isEmpty()) { + if (surface == TextSurface::Window + || (!previous.isEmpty() && (candidate.center() - previous.center()).manhattanLength() <= 2 + && std::abs(candidate.width() - previous.width()) <= 2 + && std::abs(candidate.height() - previous.height()) <= 2)) { + found = candidate; + return true; + } + previous = candidate; return false; - imagePath = libraryTextPath(); - QSaveFile file(imagePath); - require(file.open(QIODevice::WriteOnly) - && file.setPermissions(QFileDevice::ReadOwner | QFileDevice::WriteOwner) - && frame.copy(region).save(&file, "PNG") && file.commit(), - "actual rendered library row could not be read for caption navigation"); - } - QRect candidate - = locate(words(imagePath, surface == TextSurface::LibraryRow ? 6 : 11, region.topLeft())); - // Sparse-page segmentation can omit text touching a focus outline. - // Read the same real frame as a text block rather than accepting a - // larger heading's unrelated hit region or manufacturing a label. - if (candidate.isEmpty() && surface == TextSurface::Window) - candidate = locate(words(imagePath, 6)); - if (candidate.isEmpty()) - candidate = locate(words(imagePath, 6, region.topLeft(), TextPreprocess::Neutral)); - if (candidate.isEmpty()) - candidate = locate(words(imagePath, 6, region.topLeft(), TextPreprocess::Inverse)); - if (candidate.isEmpty()) - candidate = locate(words(imagePath, 11, region.topLeft(), TextPreprocess::Positive)); - if (candidate.isEmpty()) - candidate = locate(words(imagePath, 3, region.topLeft(), TextPreprocess::Adaptive)); - if (!candidate.isEmpty()) { - if (surface == TextSurface::Window - || (!previous.isEmpty() && (candidate.center() - previous.center()).manhattanLength() <= 2 - && std::abs(candidate.width() - previous.width()) <= 2 - && std::abs(candidate.height() - previous.height()) <= 2)) { - found = candidate; - return true; } - previous = candidate; + previous = {}; + if (scroll) + command({ "key", "down" }); return false; - } - previous = {}; - if (scroll) - command({ "key", "down" }); - return false; - }, - failure.c_str(), scroll ? 90000 : 30000); + }, + failure.c_str(), scroll ? 90000 : 30000); + } catch (const std::runtime_error& error) { + if (!lastObserved.isEmpty()) + throw std::runtime_error(std::string(error.what()) + " (observed: " + lastObserved.toStdString() + ")"); + throw; + } return found; } void click(const QString& text, bool scroll = false, bool right = false) diff --git a/tests/player/MpvOptionProfileTest.cpp b/tests/player/MpvOptionProfileTest.cpp index f0037a3b..d19a1352 100644 --- a/tests/player/MpvOptionProfileTest.cpp +++ b/tests/player/MpvOptionProfileTest.cpp @@ -153,7 +153,10 @@ SPOOL_TEST_MAIN("mpv-option-profile") const auto desktop = profileOptions(MpvConfigPolicy {}, MpvOptionProfile::Platform::Desktop, QStringLiteral("alsa"), QByteArrayLiteral("/tmp/mpv.log")); require(valueFor(desktop, "vo") == "libmpv", "desktop should render through libmpv"); -#if defined(Q_OS_LINUX) +#if defined(SPOOL_APPLE_MOBILE) + require( + valueFor(desktop, "hwdec") == "videotoolbox-copy", "Apple mobile should decode through VideoToolbox copy-back"); +#elif defined(Q_OS_LINUX) require(valueFor(desktop, "hwdec") == "auto-copy", "Linux desktop should copy decoded frames across the driver boundary"); #else @@ -170,8 +173,13 @@ SPOOL_TEST_MAIN("mpv-option-profile") require(valueFor(desktop, "network-timeout") == "15", "a silent connection should be retried after 15 s"); require( valueFor(desktop, "initial-audio-sync").isEmpty(), "desktop should retain mpv's initial audio sync default"); +#if defined(SPOOL_APPLE_MOBILE) + require(valueFor(desktop, "audio-fallback-to-null") == "no", + "Apple mobile should keep AudioUnit output without silently falling back to null"); +#else require(valueFor(desktop, "audio-fallback-to-null") == "yes", "desktop playback should continue silently when no audio output device is available"); +#endif require(valueFor(desktop, "config") == "no", "disabled user configuration should bypass mpv.conf"); require(indexOf(desktop, "config") < indexOf(desktop, "input-default-bindings"), "application input invariants must be applied after user configuration policy"); @@ -253,14 +261,21 @@ SPOOL_TEST_MAIN("mpv-option-profile") require(customConfigDirectory.isValid(), "temporary custom mpv directory was not created"); const MpvConfigPolicy validatedCustom = validatedPlatformMpvConfigPolicy(QStringLiteral("custom"), customConfigDirectory.path()); + const MpvConfigPolicy validatedFileUrl = validatedPlatformMpvConfigPolicy( + QStringLiteral("custom"), QUrl::fromLocalFile(customConfigDirectory.path()).toString()); +#if defined(SPOOL_APPLE_MOBILE) + require(!validatedCustom.valid && validatedCustom.mode == MpvConfigPolicy::Mode::Disabled, + "Apple mobile builds must reject external custom mpv configuration"); + require(!validatedFileUrl.valid && validatedFileUrl.mode == MpvConfigPolicy::Mode::Disabled, + "Apple mobile builds must reject file-URL custom mpv configuration"); +#else require(validatedCustom.valid && validatedCustom.mode == MpvConfigPolicy::Mode::Custom, "existing custom mpv directory should validate"); require(validatedCustom.directory == QFileInfo(customConfigDirectory.path()).canonicalFilePath(), "custom mpv directory should be canonicalized"); - const MpvConfigPolicy validatedFileUrl = validatedPlatformMpvConfigPolicy( - QStringLiteral("custom"), QUrl::fromLocalFile(customConfigDirectory.path()).toString()); require(validatedFileUrl.valid && validatedFileUrl.directory == validatedCustom.directory, "folder-dialog file URL should validate as a local directory"); +#endif const MpvConfigPolicy missingCustom = validatedPlatformMpvConfigPolicy(QStringLiteral("custom"), QStringLiteral("/path/that/does/not/exist")); require(!missingCustom.valid && missingCustom.mode == MpvConfigPolicy::Mode::Disabled, @@ -320,7 +335,14 @@ SPOOL_TEST_MAIN("mpv-option-profile") const auto desktopAuto = profileOptions(MpvConfigPolicy {}, MpvOptionProfile::Platform::Desktop, QStringLiteral("auto"), QByteArrayLiteral("/tmp/mpv.log")); +#if defined(SPOOL_APPLE_MOBILE) + require( + valueFor(desktopAuto, "ao") == "audiounit", "Apple mobile automatic audio should select RemoteIO AudioUnit"); + require(valueFor(desktopAuto, "audio-exclusive") == "yes", + "Apple mobile audio should request exclusive AudioUnit session"); +#else require(valueFor(desktopAuto, "ao").isEmpty(), "automatic desktop audio should leave output probing to mpv"); +#endif #if defined(Q_OS_ANDROID) // Android is also Q_OS_LINUX, but its settings policy permits only auto. // Exercise the actual Android output profile instead of desktop devices. diff --git a/tests/providers/ProviderRegistryTest.cpp b/tests/providers/ProviderRegistryTest.cpp index 32992e75..16206f84 100644 --- a/tests/providers/ProviderRegistryTest.cpp +++ b/tests/providers/ProviderRegistryTest.cpp @@ -679,9 +679,13 @@ export function createSource(config, sourceHost) { auto withoutStorage = enabledOffers; withoutStorage.remove("settingsStorage"); QCoro::waitFor(registry.callSource(extendedAlice, "offers", { { "capabilities", withoutStorage } })); + waitUntil([&] { return !registry.hasCapability(extendedAlice, "settingsStorage"); }, + "withdrawing settingsStorage reaches the registry before cache reset"); QCoro::waitFor(registry.callSource(extendedAlice, "dataFixture", { { "maximum", 32 }, { "conditional", true }, { "document", QVariantMap { { "found", false } } } })); QCoro::waitFor(registry.callSource(extendedAlice, "offers", { { "capabilities", enabledOffers } })); + waitUntil([&] { return registry.hasCapability(extendedAlice, "settingsStorage"); }, + "restoring settingsStorage reaches the registry before reading dataInfo"); require(QCoro::waitFor(registry.callSource(extendedAlice, "dataInfo")).value("maxBytes").toInt() == 32 && QCoro::waitFor(registry.callSource(extendedAlice, "dataFixture")).value("infoCalls").toInt() == 2, "capability loss invalidates the generation-owned storage metadata cache"); @@ -715,9 +719,13 @@ export function createSource(config, sourceHost) { == QLocale::languageToCode(QLocale::French, QLocale::ISO639Part2), "a supported writable preference survives a worker read/write/read cycle"); QCoro::waitFor(registry.callSource(extendedAlice, "offers", { { "capabilities", withoutStorage } })); + waitUntil([&] { return !registry.hasCapability(extendedAlice, "settingsStorage"); }, + "withdrawing settingsStorage reaches the registry before updating dataFixture limits"); QCoro::waitFor( registry.callSource(extendedAlice, "dataFixture", { { "maximum", 65536 }, { "conditional", false } })); QCoro::waitFor(registry.callSource(extendedAlice, "offers", { { "capabilities", enabledOffers } })); + waitUntil([&] { return registry.hasCapability(extendedAlice, "settingsStorage"); }, + "restoring settingsStorage reaches the registry before writing wideDocument"); QVariantList wideDocument; wideDocument.reserve(20000); for (int index = 0; index < 20000; ++index) diff --git a/tests/providers/SourceHubSpeedTest.cpp b/tests/providers/SourceHubSpeedTest.cpp index 30c37002..a23f823c 100644 --- a/tests/providers/SourceHubSpeedTest.cpp +++ b/tests/providers/SourceHubSpeedTest.cpp @@ -1,5 +1,6 @@ #include "ProviderFixture.h" #include "TestMain.h" +#include "TestRequire.h" #include "cache/DatabaseManager.h" #include "provider/PlaybackSource.h" #include "provider/ProviderRegistry.h" @@ -19,13 +20,7 @@ using namespace Spool; namespace { -void require(bool condition, const char *message) -{ - if (!condition) { - std::cerr << message << '\n'; - std::exit(1); - } -} +using SpoolTests::require; void waitUntil(const std::function& condition, const char *message) { QElapsedTimer timer; @@ -165,8 +160,11 @@ export function createSource(configuration) { { "preferredMaxHeight", 1080 }, { "unlimitedLocalNetwork", true }, { "preferRemux", false } } : QVariantMap {}; }); + resolvedPreferences.clear(); resolve(melbourne); resolve(nj); + waitUntil([&] { return resolvedPreferences.contains(melbourne) && resolvedPreferences.contains(nj); }, + "resolved preference events arrive"); require(resolvedPreferences.value(melbourne).value("bitrate").toLongLong() == 20'000'000 && resolvedPreferences.value(melbourne).value("height").toInt() == 1080 && resolvedPreferences.value(melbourne).value("local").toBool() @@ -178,7 +176,10 @@ export function createSource(configuration) { "actual script resolve calls receive only their account's quality preferences"); custom = false; hub.refreshPlaybackPreferences(); + resolvedPreferences.remove(melbourne); resolve(melbourne); + waitUntil( + [&] { return resolvedPreferences.contains(melbourne); }, "refreshed resolved preference event arrives"); require(resolvedPreferences.value(melbourne).value("bitrate").toLongLong() == 90'000'000 && resolvedPreferences.value(melbourne).value("height").toInt() == 2160, "clearing a server override restores the global quality preferences at resolve"); diff --git a/tests/qml/tst_MediaRow.qml b/tests/qml/tst_MediaRow.qml index d8d4205a..cbc3c878 100644 --- a/tests/qml/tst_MediaRow.qml +++ b/tests/qml/tst_MediaRow.qml @@ -307,16 +307,19 @@ TestCase { const row = router.stack.rowAt(0) row.cardWidth = 156 row.cardGap = 16 + const pointerSurface = findChild(row, "mediaRowPointerArea") + verify(pointerSurface) + const viewport = pointerSurface.parent + viewport.forceLayout() verify(router.stack.focusPreferred("libraries")) row.currentIndex = 2 tryVerify(() => row.currentCard() !== null && row.activeFocus) + viewport.forceLayout() waitForRendering(row) - const pointerSurface = findChild(row, "mediaRowPointerArea") - verify(pointerSurface) - const viewport = pointerSurface.parent // Real native ListView geometry after a horizontal scroll; there is no // synthetic pending flag or copied candidate/recovery implementation. viewport.contentX = viewport.originX + 6 * (row.cardWidth + row.cardGap) + viewport.forceLayout() waitForRendering(row) compare(row.currentIndex, 2) const scrollX = viewport.contentX @@ -380,11 +383,14 @@ TestCase { const row = router.stack.rowAt(0) row.cardWidth = 156 row.cardGap = 16 + const viewport = findChild(row, "mediaRowPointerArea").parent + viewport.forceLayout() tryVerify(() => row.delegatesPresented) verify(router.stack.focusPreferred("libraries")) verify(row.beginMoveById("aaaaaaaa:library/7")) - const viewport = findChild(row, "mediaRowPointerArea").parent + viewport.forceLayout() viewport.contentX = viewport.originX + 6 * (row.cardWidth + row.cardGap) + viewport.forceLayout() waitForRendering(row) const scrollX = viewport.contentX - viewport.originX const scrollY = router.stack.contentY diff --git a/tests/qml/tst_ProviderForms.qml b/tests/qml/tst_ProviderForms.qml index ed997783..5248786c 100644 --- a/tests/qml/tst_ProviderForms.qml +++ b/tests/qml/tst_ProviderForms.qml @@ -202,7 +202,10 @@ TestCase { tryCompare(view, "busy", false) tryCompare(view, "error", view.errorMessages.invalid_credentials) compare(username.text, "member") - verify(password.activeFocus) + const focused = view.Window.activeFocusItem + verify(password.activeFocus, "expected password activeFocus, got " + (focused ? (focused.Accessible.name + || focused.objectName + || focused) : "null")) const error = accessibleItem(view, view.error) verify(error) compare(error.Accessible.role, Accessible.StaticText) diff --git a/tests/tools/StreamingCandidatesTest.py b/tests/tools/StreamingCandidatesTest.py index d42ebf35..17e31d6f 100644 --- a/tests/tools/StreamingCandidatesTest.py +++ b/tests/tools/StreamingCandidatesTest.py @@ -72,9 +72,16 @@ def setUp(self): self.temp = tempfile.TemporaryDirectory() self.addCleanup(self.temp.cleanup) self.root = Path(self.temp.name) - self.fake = self.root / 'spoolet' - self.fake.write_text(FAKE_SPOOLET) - self.fake.chmod(self.fake.stat().st_mode | stat.S_IEXEC) + if os.name == 'nt': + script = self.root / 'spoolet.py' + script.write_text(FAKE_SPOOLET, encoding='utf-8') + self.fake = self.root / 'spoolet.cmd' + self.fake.write_text('@echo off\r\n"{}" "{}" %*\r\n'.format(sys.executable, script), + encoding='utf-8') + else: + self.fake = self.root / 'spoolet' + self.fake.write_text(FAKE_SPOOLET, encoding='utf-8') + self.fake.chmod(self.fake.stat().st_mode | stat.S_IEXEC) self.log = self.root / 'calls.log' def run_tool(self, config, arguments): diff --git a/tools/android/build-apks.sh b/tools/android/build-apks.sh index 5f034dba..0e77f386 100755 --- a/tools/android/build-apks.sh +++ b/tools/android/build-apks.sh @@ -144,6 +144,22 @@ settings["qml-root-path"] = [sys.argv[2]] path.write_text(json.dumps(settings, indent=2) + "\n") PY done + local gradle_home="${GRADLE_USER_HOME:-$HOME/.gradle}" + mkdir -p "$gradle_home/init.d" + cat > "$gradle_home/init.d/spool-maven-mirror.gradle" <<'GRADLE' +allprojects { + buildscript { + repositories { + google() + maven { url = uri("https://maven-central.storage-download.googleapis.com/maven2/") } + } + } + repositories { + google() + maven { url = uri("https://maven-central.storage-download.googleapis.com/maven2/") } + } +} +GRADLE local build_apk_target build_apk_target() { local apk_target="$1" @@ -154,6 +170,13 @@ PY fi if [[ $attempt -lt 3 ]]; then echo "Retrying $apk_target after transient Gradle/Maven failure (attempt $((attempt + 1))/3)..." >&2 + local gradlew + for gradlew in "$build"/android-build*/gradlew; do + if [[ -x "$gradlew" ]]; then + "$gradlew" --stop >/dev/null 2>&1 || true + fi + done + rm -rf "${GRADLE_USER_HOME:-$HOME/.gradle}/caches/modules-2/metadata-"* 2>/dev/null || true sleep $((attempt * 15)) fi done diff --git a/tools/run-device-tests.py b/tools/run-device-tests.py index 8f74885a..6b009689 100755 --- a/tools/run-device-tests.py +++ b/tools/run-device-tests.py @@ -55,7 +55,7 @@ def diagnostic(text): markers = ("video result:", "orientation:", "viewport:", "first video frame", "native presentation:", "render context handoff did not complete", "render context was not ready", "failed to initialize mpv", "tvOS audio smoke:", "tvOS credentials smoke:", - "An error was encountered processing the command", "dyld[") + "An error was encountered processing the command", "dyld[", "spool-test-require:") for line in text.splitlines(): if any(marker in line for marker in markers): print(re.sub(r"https?://\S+", "[redacted-url]", line)) From 7db9d273027fc2d9cb4fff7e5a3e2d0ed8be921a Mon Sep 17 00:00:00 2001 From: Sacha Korban Date: Fri, 27 Nov 2026 02:50:05 +1100 Subject: [PATCH 09/39] fix(player): stabilize rendering and cross-platform playback journeys Consolidate the release milestone ending at f6200d405f84565edd124e29177d8e137bfaeaa4. Original starting snapshot: 368a7e967fb968d03f965afe590df69c31881e21. --- .github/workflows/build-artifacts.yml | 4 +- flake.nix | 14 + qml/primitives/TextFieldRow.qml | 8 + src/app/AppController.cpp | 22 +- src/app/AppController.h | 2 + src/app/AppControllerRemote.cpp | 9 +- src/player/MpvVideoItem.cpp | 22 +- src/player/MpvVideoItem.h | 7 + src/player/PlayerController.cpp | 30 +- tests/TestRunner.cpp | 16 +- tests/cache/DatabaseManagerTest.cpp | 3 +- tests/common/RangedDownloadTest.cpp | 6 +- tests/e2e/AppJourneyTest.cpp | 400 +++++++++++++++++-- tests/platform/MobileTestFixtures.cpp | 17 +- tests/platform/MobileTestFixtures.h | 1 + tests/player/MpvVideoItemTest.cpp | 65 ++- tests/providers/ScriptRuntimeNetworkTest.cpp | 6 + tests/providers/ScriptRuntimeTest.cpp | 11 +- tests/qml/tst_ProviderForms.qml | 71 +++- tests/tools/StreamingCandidatesTest.py | 26 +- tools/android/emulator-launch-test.sh | 86 +++- tools/run-device-tests.py | 6 +- 22 files changed, 710 insertions(+), 122 deletions(-) diff --git a/.github/workflows/build-artifacts.yml b/.github/workflows/build-artifacts.yml index 8c3b897b..6912e6eb 100644 --- a/.github/workflows/build-artifacts.yml +++ b/.github/workflows/build-artifacts.yml @@ -1394,7 +1394,7 @@ jobs: SPOOL_ANDROID_KEYSTORE_STORE_PASS: ${{ env.SPOOL_CACHE_WRITE == 'true' && inputs.release && secrets.ANDROID_RELEASE_KEYSTORE_PASSWORD || '' }} SPOOL_ANDROID_KEYSTORE_KEY_PASS: ${{ env.SPOOL_CACHE_WRITE == 'true' && inputs.release && secrets.ANDROID_RELEASE_KEY_PASSWORD || '' }} run: | - nix develop .#android -c bash tools/android/build-universal-apk.sh \ + nix develop .#android-packaging -c bash tools/android/build-universal-apk.sh \ dist/android/spool-universal.apk \ dist/android/universal-inputs \ dist/android/spool-arm64-v8a.apk \ @@ -1406,7 +1406,7 @@ jobs: EXPECTED_CERT_SHA256: 0c9deff0513eed6d43521df31ad6d2d8e928c029b146d902f4bcc25a883c1fb8 run: | set -euo pipefail - nix develop .#android -c bash -c " + nix develop .#android-packaging -c bash -c " output=\"\$(\"\$ANDROID_HOME/build-tools/36.0.0/apksigner\" verify --verbose --print-certs dist/android/spool-universal.apk)\" printf '%s\n' \"\$output\" grep -Fq \"Signer #1 certificate SHA-256 digest: \$EXPECTED_CERT_SHA256\" <<<\"\$output\" diff --git a/flake.nix b/flake.nix index 258f9313..08835003 100644 --- a/flake.nix +++ b/flake.nix @@ -864,6 +864,20 @@ SPOOL_ANDROID_QT_HOST = "${androidQtHost}"; shellHook = gitHooksShellHook; }; + + android-packaging = pkgs.mkShell { + packages = with pkgs; [ + android.sdk + bashInteractive + git + jdk17_headless + python3 + ]; + ANDROID_HOME = "${android.sdk}/libexec/android-sdk"; + ANDROID_SDK_ROOT = "${android.sdk}/libexec/android-sdk"; + JAVA_HOME = pkgs.jdk17_headless.home; + shellHook = gitHooksShellHook; + }; } // pkgs.lib.optionalAttrs pkgs.stdenv.hostPlatform.isLinux { windows-proton = pkgs.mkShell { packages = with pkgs; [ diff --git a/qml/primitives/TextFieldRow.qml b/qml/primitives/TextFieldRow.qml index 25f43605..cc27ae95 100644 --- a/qml/primitives/TextFieldRow.qml +++ b/qml/primitives/TextFieldRow.qml @@ -63,6 +63,7 @@ T.Control { } if (field.activeFocus) field.focus = false + Qt.inputMethod.hide() InputKeys.focus(row) } @@ -156,6 +157,13 @@ T.Control { onTextEdited: row.textEdited(text) onAccepted: row.accepted() + // QQuickTextInput ignores Return/Enter after emitting accepted() so + // callers can attach extra key handlers. In TV mode onAccepted can move + // focus onto a non-text row before that press finishes bubbling to + // KeyRouter, which would then arm and activate the new row on release. + Keys.priority: Keys.AfterItem + Keys.onReturnPressed: event => event.accepted = true + Keys.onEnterPressed: event => event.accepted = true // Qt's own caret is one pixel wide, which vanishes on a television // and is easy to lose on a dense screen. It holds steady while typing diff --git a/src/app/AppController.cpp b/src/app/AppController.cpp index 5ac95e99..439eaef8 100644 --- a/src/app/AppController.cpp +++ b/src/app/AppController.cpp @@ -289,6 +289,7 @@ AppController::AppController( connect(m_provider, &Provider::errorOccurred, this, &AppController::setErrorText); connect(m_provider, &SourceHub::browseSourcesChanged, this, [this] { m_libraryListGeneration.invalidate(); + m_librariesLoading = true; m_home->setLibrariesLoading(true); QSet accounts; for (Provider *source : m_provider->sources()) @@ -553,6 +554,7 @@ void AppController::resetVisibleModels() if (m_artwork) m_artwork->cancelPrefetches(); m_libraries.clear(); + m_librariesLoading = false; m_browse->clear(); m_home->reset(); m_content->reset(); @@ -591,7 +593,10 @@ void AppController::goHome() qInfo() << "app: go home viewKind=" << m_browse->viewKind(); m_libraryLoadGeneration.invalidate(); setBusy(false); - refreshHomeRows(); + if (m_librariesLoading || hasMissingSourceLibraries()) + loadLibraries(); + else + refreshHomeRows(); } void AppController::openLibrary(int index) @@ -1649,9 +1654,22 @@ void AppController::showToast(const QString& message) emit toastMessage(message); } +bool AppController::hasMissingSourceLibraries() const +{ + QSet loadedAccounts; + for (const LibraryItem& library : m_libraries.libraries()) + loadedAccounts.insert(m_provider->accountOf(library.id)); + for (Provider *source : m_provider->sources()) { + if (!loadedAccounts.contains(source->id())) + return true; + } + return false; +} + void AppController::loadLibraries() { m_prefetch->stop(); + m_librariesLoading = true; m_home->setLibrariesLoading(true); const RequestGeneration::Token generation = m_libraryListGeneration.next(); Async::runLatest( @@ -1660,10 +1678,12 @@ void AppController::loadLibraries() m_libraries.setLibraries(libraries); setBusy(false); refreshHomeRows(); + m_librariesLoading = false; m_home->setLibrariesLoading(false); }, [this](const std::exception_ptr& error) { setBusy(false); + m_librariesLoading = false; m_home->setLibrariesLoading(false); setErrorText(exceptionMessage(error)); }); diff --git a/src/app/AppController.h b/src/app/AppController.h index 08b62343..f75cd7b7 100644 --- a/src/app/AppController.h +++ b/src/app/AppController.h @@ -208,6 +208,7 @@ class AppController final : public QObject { void resetApplicationState(); void resetVisibleModels(); void loadLibraries(); + bool hasMissingSourceLibraries() const; void loadMoreCurrentItems(); void loadBrowseBlock(int start); void loadBrowseIndex(); @@ -290,6 +291,7 @@ class AppController final : public QObject { quint64 m_albumQueueGeneration = 0; bool m_episodeQueuePending = false; LibraryListModel m_libraries; + bool m_librariesLoading = false; MovieItem m_activePlaybackItem; QString m_activeMediaSourceId; qint64 m_activeSourceBitrate = 0; diff --git a/src/app/AppControllerRemote.cpp b/src/app/AppControllerRemote.cpp index ddc9275d..d17ecab8 100644 --- a/src/app/AppControllerRemote.cpp +++ b/src/app/AppControllerRemote.cpp @@ -141,8 +141,13 @@ void AppController::handleRemoteCommand(const QString& accountId, const QVariant if (name == QStringLiteral("play")) { playRemoteItems(accountId, command); } else if (name == QStringLiteral("pause") || name == QStringLiteral("unpause")) { - if (m_player->paused() == (name == QStringLiteral("unpause"))) - groupOrLocalTogglePause(); + const bool wantPaused = name == QStringLiteral("pause"); + if (inGroup()) { + if (m_player->paused() != wantPaused) + m_group->requestTogglePause(); + } else { + m_player->setPaused(wantPaused); + } } else if (name == QStringLiteral("playPause")) { groupOrLocalTogglePause(); } else if (name == QStringLiteral("stop")) { diff --git a/src/player/MpvVideoItem.cpp b/src/player/MpvVideoItem.cpp index 9fcbda7d..4ea2c984 100644 --- a/src/player/MpvVideoItem.cpp +++ b/src/player/MpvVideoItem.cpp @@ -224,8 +224,7 @@ namespace { static void onMpvUpdate(void *ctx) { - auto *item = static_cast(ctx); - QMetaObject::invokeMethod(item, "update", Qt::QueuedConnection); + static_cast(ctx)->scheduleMpvUpdate(); } QMetaObject::Connection m_frameSwappedConnection; @@ -272,6 +271,7 @@ namespace { // Qt owns the external-command bracket and binds this item's FBO. // Nested begin/end calls enqueue RHI state inside that bracket. if (m_lifecycle.hasPendingHandle()) { + QQuickOpenGLUtils::resetOpenGLState(); m_lifecycle.releaseContext(); if (auto *next = m_lifecycle.nextHandle()) createRenderContext(next); @@ -293,6 +293,12 @@ namespace { if (!fbo) return; + // Qt's QQuickFramebufferObject boundary does not restore all GL + // raster/VAO/blend/scissor state between frames; libmpv requires + // default OpenGL state before every render pass. + QQuickOpenGLUtils::resetOpenGLState(); + fbo->bind(); + mpv_opengl_fbo mpfbo {}; mpfbo.fbo = static_cast(fbo->handle()); mpfbo.w = fbo->width(); @@ -914,6 +920,18 @@ void MpvVideoItem::setMpvHandle(mpv_handle *handle) update(); } +void MpvVideoItem::scheduleMpvUpdate() +{ + if (!m_updateScheduled.exchange(true, std::memory_order_acq_rel)) + QMetaObject::invokeMethod(this, &MpvVideoItem::handleMpvUpdate, Qt::QueuedConnection); +} + +void MpvVideoItem::handleMpvUpdate() +{ + m_updateScheduled.store(false, std::memory_order_release); + update(); +} + void MpvVideoItem::setRenderBackend(const QByteArray& backend) { m_renderBackend = backend; diff --git a/src/player/MpvVideoItem.h b/src/player/MpvVideoItem.h index bb97c0d1..f6b01ab3 100644 --- a/src/player/MpvVideoItem.h +++ b/src/player/MpvVideoItem.h @@ -90,6 +90,10 @@ class MpvVideoItem : public SPOOL_MPV_ITEM_BASE { }; HandleSnapshot takePendingHandle(); + // Coalesce libmpv frame wakeups so slow main-thread software renderers + // (such as mobile simulators) cannot flood the GUI event queue. + void scheduleMpvUpdate(); + // Published for lifecycle diagnostics. Creation and destruction happen // exclusively in Renderer::render(), with the original GL context current. std::atomic m_renderCtxAtomic { nullptr }; @@ -100,8 +104,11 @@ class MpvVideoItem : public SPOOL_MPV_ITEM_BASE { void hdrOutputChanged(); private: + void handleMpvUpdate(); + static MpvVideoItem *s_instance; bool m_hdrOutput = false; + std::atomic_bool m_updateScheduled { false }; QMutex m_handleMutex; mpv_handle *m_pendingHandle = nullptr; diff --git a/src/player/PlayerController.cpp b/src/player/PlayerController.cpp index 10d5d1ca..d3d60270 100644 --- a/src/player/PlayerController.cpp +++ b/src/player/PlayerController.cpp @@ -808,11 +808,11 @@ bool PlayerController::configureAndInitializeMpv(mpv_handle *handle, const MpvPr "--input-vo-keyboard=no", "--input-cursor=no", "--terminal=no", - "--osc=no", }; - char *embeddingArguments[std::size(embeddingOptions) + 4] {}; + char *embeddingArguments[std::size(embeddingOptions) + 5] {}; + size_t argumentCount = 0; for (size_t i = 0; i < std::size(embeddingOptions); ++i) - embeddingArguments[i] = embeddingOptions[i]; + embeddingArguments[argumentCount++] = embeddingOptions[i]; // --gpu-api picks one of mpv's own ra_ctx backends: a native context and // swapchain of its own. Video and idle handles use --vo=libmpv, while // audio uses --vo=null below. None owns a desktop surface. The embedded @@ -829,17 +829,20 @@ bool PlayerController::configureAndInitializeMpv(mpv_handle *handle, const MpvPr // nothing to constrain. The option stays at auto for both. QByteArray softwareDecodeOption = QByteArrayLiteral("--hwdec=no"); if (!preparation.hardwareDecoding) - embeddingArguments[std::size(embeddingOptions)] = softwareDecodeOption.data(); + embeddingArguments[argumentCount++] = softwareDecodeOption.data(); char audioVideoOutputOption[] = "--vo=null"; char audioVideoTrackOption[] = "--vid=no"; char audioDisplayOption[] = "--audio-display=no"; if (!preparation.needsVideoSurface) { embeddingArguments[0] = audioVideoOutputOption; - // Keep the argument list contiguous when hardware decoding is enabled. - size_t index = std::size(embeddingOptions) + (preparation.hardwareDecoding ? 0 : 1); - embeddingArguments[index++] = audioVideoTrackOption; - embeddingArguments[index] = audioDisplayOption; - } + embeddingArguments[argumentCount++] = audioVideoTrackOption; + embeddingArguments[argumentCount++] = audioDisplayOption; + } + char oscOption[] = "--osc=no"; + // Builds without Lua (such as iOS and tvOS) omit the osc option entirely, + // and mpv_initialize_opts rejects unknown command-line options. + if (mpv_set_option_string(handle, "osc", "no") != MPV_ERROR_OPTION_NOT_FOUND) + embeddingArguments[argumentCount++] = oscOption; if (preparation.userConfig) qInfo() << "player: user mpv config enabled; embedding overrides vo, gpu-api, gpu-context," " wid, force-window, idle, keep-open, input-vo-keyboard, input-cursor, terminal and osc"; @@ -3148,15 +3151,19 @@ void PlayerController::handleMpvEvent(mpv_event *event, quint64 generation, mpv_ }); break; } - case MPV_EVENT_FILE_LOADED: + case MPV_EVENT_FILE_LOADED: { // Runtime snapshots may wait for the VO. Query on this core's event // thread, whose captured handle lives until the event loop is joined, // so GUI synchronization remains available to the renderer. logColorDiagnostics(handle); - postMpvEvent(generation, [this, generation]() { + int mpvPaused = 0; + const bool hasMpvPaused = mpv_get_property(handle, "pause", MPV_FORMAT_FLAG, &mpvPaused) >= 0; + postMpvEvent(generation, [this, generation, hasMpvPaused, mpvPaused]() { m_mpvLifecycle.completeFileLoad(); qInfo() << "player: file loaded"; m_fileLoaded = true; + if (hasMpvPaused) + m_paused = mpvPaused != 0; // Only video can strain the renderer, and only once per playback: // a step down rebuilds the core, which lands back here. if (!m_renderStrainReported && m_mediaKind == QStringLiteral("video")) @@ -3178,6 +3185,7 @@ void PlayerController::handleMpvEvent(mpv_event *event, quint64 generation, mpv_ startProgressReporting(); }); break; + } case MPV_EVENT_PLAYBACK_RESTART: postMpvEvent(generation, [this]() { qInfo() << "player: playback restart"; diff --git a/tests/TestRunner.cpp b/tests/TestRunner.cpp index b9bd694a..9f7d0438 100644 --- a/tests/TestRunner.cpp +++ b/tests/TestRunner.cpp @@ -60,9 +60,9 @@ int invoke(const char *name, int argc, char **argv) QString fixturePath(const char *relativePath) { #ifdef SPOOL_MOBILE_TEST_BUNDLE - static const QDir root(mobileFixtureRoot()); + const QDir root(mobileFixtureRoot()); #else - static const QDir root(QStringLiteral(TEST_SOURCE_DIR)); + const QDir root(QStringLiteral(TEST_SOURCE_DIR)); #endif return root.filePath(QString::fromUtf8(relativePath)); } @@ -306,10 +306,12 @@ void finishReceipt() { if (receiptPath.isEmpty()) return; + const QString targetPath = receiptPath; + receiptPath.clear(); #ifdef SPOOL_MOBILE_TEST_BUNDLE nativeStage("receipt-handler-entry"); #endif - const bool saved = save(receiptPath, receipt); + const bool saved = save(targetPath, receipt); #ifdef SPOOL_MOBILE_TEST_BUNDLE if (diagnosticLogReady) { std::fprintf(stderr, "native stage: receipt-handler-return saved=%d\n", int(saved)); @@ -698,6 +700,10 @@ int main(int argc, char **argv) receipt.insert(QStringLiteral("selectors"), selectors); receipt.insert(QStringLiteral("status"), QStringLiteral("passed")); receipt.insert(QStringLiteral("exitCode"), 0); + finishReceipt(); +#ifdef SPOOL_MOBILE_TEST_BUNDLE + SpoolTests::cleanupMobileFixtures(); +#endif return 0; } #ifdef SPOOL_MOBILE_TEST_BUNDLE @@ -768,5 +774,9 @@ int main(int argc, char **argv) nativeStage("status-assigned"); #endif } + finishReceipt(); +#ifdef SPOOL_MOBILE_TEST_BUNDLE + SpoolTests::cleanupMobileFixtures(); +#endif return result; } diff --git a/tests/cache/DatabaseManagerTest.cpp b/tests/cache/DatabaseManagerTest.cpp index 0bef8999..2f8fdbf1 100644 --- a/tests/cache/DatabaseManagerTest.cpp +++ b/tests/cache/DatabaseManagerTest.cpp @@ -149,7 +149,7 @@ SPOOL_TEST_MAIN("database-manager") message); }; requireLegacyAccount(database, "legacy sign-in should be readable with its token"); -#ifndef Q_OS_WIN +#if !defined(Q_OS_WIN) && !defined(SPOOL_APPLE_MOBILE) const QFileInfo credentialInfo(QDir(credentialPath).entryInfoList(QDir::Files).front()); require((credentialInfo.permissions() & (QFileDevice::ReadGroup | QFileDevice::WriteGroup | QFileDevice::ReadOther | QFileDevice::WriteOther)) @@ -290,6 +290,7 @@ SPOOL_TEST_MAIN("database-manager") readOnly.shutdown(); QFile::setPermissions(databasePath, QFileDevice::ReadOwner | QFileDevice::WriteOwner); QFile::setPermissions(statePath, QFileDevice::ReadOwner | QFileDevice::WriteOwner); + CredentialStore::remove(QStringLiteral("profile")); return 0; } diff --git a/tests/common/RangedDownloadTest.cpp b/tests/common/RangedDownloadTest.cpp index 5d1b5efd..19eca70a 100644 --- a/tests/common/RangedDownloadTest.cpp +++ b/tests/common/RangedDownloadTest.cpp @@ -150,7 +150,11 @@ SPOOL_TEST_MAIN("ranged-download") const Outcome outcome = fetch(server, path, 3, body.size()); require(outcome.error.isEmpty(), "a server without ranges failed the download"); require(outcome.file == body, "a server without ranges produced the wrong bytes"); - require(server.ranges.last().isEmpty(), "the fallback still asked for a range"); + // Concurrent initial lanes can deliver their already-written Range + // request to the loopback server after restartWhole() opens the plain + // fallback socket; assert the fallback ran once without a Range header. + require( + server.ranges.count(QByteArray()) == 1, "the fallback did not fetch the file whole once without a range"); } // A file that is not the size it was promised to be is refused. { diff --git a/tests/e2e/AppJourneyTest.cpp b/tests/e2e/AppJourneyTest.cpp index 7714cf8e..2d11c4e0 100644 --- a/tests/e2e/AppJourneyTest.cpp +++ b/tests/e2e/AppJourneyTest.cpp @@ -469,7 +469,7 @@ class DeviceSession final { qint64 deviceLaunchEpoch = 0; }; enum class TextSurface { Window, LibraryRow }; -enum class TextPreprocess { Original, Neutral, Inverse, Positive, Adaptive }; +enum class TextPreprocess { Original, Neutral, Inverse, SmoothInverse, NeutralAdaptive, Positive, Adaptive }; struct Words { QString text; QList starts; @@ -551,12 +551,18 @@ class Journey final { : QStringList { "--instance", instance }; QElapsedTimer requestClock; requestClock.start(); - process.start(control, destination + QStringList { "--timeout", "5000" } + args); + // Match LocalControl::RequestTimeoutMs (10s) across both desktop and + // mobile targets: CI runners using software OpenGL renderers (such as + // Apple Software Renderer on macOS or emulated OpenGL ES on mobile) + // share the main thread with playback setup/frames and can transiently + // push a single control round-trip slightly past 5s. + constexpr int commandTimeoutMs = 10000; + process.start(control, destination + QStringList { "--timeout", QString::number(commandTimeoutMs) } + args); require(process.waitForStarted(5000), "built spoolet could not start"); if (!input.isEmpty()) process.write(input); process.closeWriteChannel(); - require(finish(process, 10000), "spoolet exceeded its deadline"); + require(finish(process, commandTimeoutMs + 5000), "spoolet exceeded its deadline"); const qint64 requestElapsedMs = requestClock.elapsed(); ensureRunning(); const auto response = QJsonDocument::fromJson(process.readAllStandardOutput()).object(); @@ -695,15 +701,24 @@ class Journey final { QString inputPath = imagePath; const bool neutralText = preprocess == TextPreprocess::Neutral; const bool highContrast = preprocess == TextPreprocess::Inverse; + const bool smoothInverse = preprocess == TextPreprocess::SmoothInverse; + const bool neutralAdaptive = preprocess == TextPreprocess::NeutralAdaptive; const bool positiveContrast = preprocess == TextPreprocess::Positive; const bool adaptiveContrast = preprocess == TextPreprocess::Adaptive; - const int scale = mode == 6 || positiveContrast || adaptiveContrast ? 2 : 1; - if (scale > 1) { + const bool needsPreprocess + = neutralText || highContrast || smoothInverse || neutralAdaptive || positiveContrast || adaptiveContrast; + int scale = mode == 6 || smoothInverse || neutralAdaptive || positiveContrast || adaptiveContrast ? 2 : 1; + QImage image; + if (scale > 1 || needsPreprocess) { + image = QImage(imagePath); + require(!image.isNull(), "captured OCR image could not be read"); + if (std::max(image.width(), image.height()) >= 2000) + scale = 1; + } + if (scale > 1 || needsPreprocess) { // Small captions beside a focus outline can be omitted even by // text-block segmentation. Resample only the actual framebuffer; // recognized bounds below return to its physical pixel space. - QImage image(imagePath); - require(!image.isNull(), "captured OCR image could not be read"); if (neutralText) { // Chromatic artwork and focus outlines can merge with neutral // glyphs. Remove only that noise; never synthesize label pixels. @@ -790,7 +805,9 @@ class Journey final { const size_t idx = row + size_t(x); if (insideH[idx] || insideV[idx]) { const int luma = lumas[idx]; - const int scaled = (luma - 12) * 255 / (112 - 12); + // Keep anti-aliased glyph edges on mid-bright accent buttons + // (luma ~120) intact instead of clipping them to pure white. + const int scaled = (luma - 20) * 255 / (180 - 20); pixels[x] = uint8_t(std::clamp(scaled, 0, 255)); } else { pixels[x] = 255; @@ -798,6 +815,105 @@ class Journey final { } } } + } else if (smoothInverse) { + // Preserve anti-aliased light glyphs on dark controls (e.g. + // flat buttons on compact mobile viewports) by smoothly mapping + // dark theme surfaces to white ink background. + const QImage source = image.convertToFormat(QImage::Format_RGB32); + const int w = source.width(); + const int h = source.height(); + image = QImage(w, h, QImage::Format_Grayscale8); + for (int y = 0; y < h; ++y) { + const auto *sourcePixels = reinterpret_cast(source.constScanLine(y)); + auto *pixels = image.scanLine(y); + for (int x = 0; x < w; ++x) { + const QRgb pixel = sourcePixels[x]; + const int luma = (77 * qRed(pixel) + 150 * qGreen(pixel) + 29 * qBlue(pixel) + 128) >> 8; + const int scaled = (180 - luma) * 255 / (180 - 40); + pixels[x] = uint8_t(std::clamp(scaled, 0, 255)); + } + } + } else if (neutralAdaptive) { + // Erase chromatic video bands and accent focus outlines to pure + // white, invert neutral text (including dim muted detail rows) + // onto a clean white canvas, and pair with Sauvola local + // thresholding so both unfocused and focused rows read cleanly. + const QImage source = image.convertToFormat(QImage::Format_RGB32); + const int w = source.width(); + const int h = source.height(); + const int maxDim = std::max(w, h); + scale = maxDim < 960 ? 4 : (maxDim < 2000 ? 2 : 1); + image = QImage(w, h, QImage::Format_Grayscale8); + for (int y = 0; y < h; ++y) { + const auto *sourcePixels = reinterpret_cast(source.constScanLine(y)); + auto *pixels = image.scanLine(y); + for (int x = 0; x < w; ++x) { + const QRgb pixel = sourcePixels[x]; + const int r = qRed(pixel); + const int g = qGreen(pixel); + const int b = qBlue(pixel); + if (std::max({ r, g, b }) - std::min({ r, g, b }) > 48) { + pixels[x] = 255; + } else { + const int luma = (77 * r + 150 * g + 29 * b + 128) >> 8; + const int scaled = (160 - luma) * 255 / (160 - 32); + pixels[x] = uint8_t(std::clamp(scaled, 0, 255)); + } + } + } + // Strip long straight axis-aligned rules (e.g. TV-mode neutral + // white focus frames around buttons like Close) that invert to + // solid closed black boxes and cause Tesseract to drop short + // enclosed captions on both sparse and block segmentation. + const int minRuleLength = std::max(44, maxDim / 50); + std::vector eraseRule(size_t(w) * size_t(h), 0); + for (int y = 0; y < h; ++y) { + const auto *row = image.constScanLine(y); + const size_t rowOffset = size_t(y) * size_t(w); + int x = 0; + while (x < w) { + while (x < w && row[x] >= 160) + ++x; + const int start = x; + while (x < w && row[x] < 160) + ++x; + if (x - start >= minRuleLength) { + for (int k = start; k < x; ++k) + eraseRule[rowOffset + size_t(k)] = 1; + } + } + } + for (int x = 0; x < w; ++x) { + int y = 0; + while (y < h) { + while (y < h && image.constScanLine(y)[x] >= 160) + ++y; + const int start = y; + while (y < h && image.constScanLine(y)[x] < 160) + ++y; + if (y - start >= minRuleLength) { + for (int k = start; k < y; ++k) + eraseRule[size_t(k) * size_t(w) + size_t(x)] = 1; + } + } + } + for (int y = 0; y < h; ++y) { + auto *row = image.scanLine(y); + const size_t rowOffset = size_t(y) * size_t(w); + for (int x = 0; x < w; ++x) { + if (!eraseRule[rowOffset + size_t(x)]) + continue; + row[x] = 255; + if (y > 0) + image.scanLine(y - 1)[x] = 255; + if (y + 1 < h) + image.scanLine(y + 1)[x] = 255; + if (x > 0) + row[x - 1] = 255; + if (x + 1 < w) + row[x + 1] = 255; + } + } } else if (highContrast) { // Focused rows can defeat page segmentation even after scaling. // Preserve their actual light glyphs against a binary background. @@ -810,21 +926,113 @@ class Journey final { } inputPath += adaptiveContrast ? QStringLiteral(".ocr-adaptive.png") : positiveContrast ? QStringLiteral(".ocr-positive.png") + : neutralAdaptive ? QStringLiteral(".ocr-neutral-adaptive.png") + : smoothInverse ? QStringLiteral(".ocr-smooth-inverse.png") : highContrast ? QStringLiteral(".ocr-contrast.png") : neutralText ? QStringLiteral(".ocr-neutral.png") : QStringLiteral(".ocr.png"); + // Upscale smooth grayscale passes 2x with a separable Catmull-Rom + // kernel instead of Qt's bilinear filter, which smears 1px strokes + // at 8-9px glyph heights on compact mobile viewports. + const auto catmullUpscale2x = [](const QImage& mapped) { + const int w = mapped.width(); + const int h = mapped.height(); + // Pixel-center-aligned 2x Catmull-Rom (t = +-0.25 => [-3, 29, 111, -9] / 128). + const auto catmullQuarter = [](int far, int near, int center, int opposite) -> uint8_t { + return uint8_t(std::clamp((-3 * far + 29 * near + 111 * center - 9 * opposite + 64) >> 7, 0, 255)); + }; + QImage horiz(w * 2, h, QImage::Format_Grayscale8); + for (int y = 0; y < h; ++y) { + const auto *src = mapped.constScanLine(y); + auto *dst = horiz.scanLine(y); + for (int x = 0; x < w; ++x) { + const int xm2 = std::max(0, x - 2); + const int xm1 = std::max(0, x - 1); + const int xp1 = std::min(w - 1, x + 1); + const int xp2 = std::min(w - 1, x + 2); + dst[2 * x] = catmullQuarter(src[xm2], src[xm1], src[x], src[xp1]); + dst[2 * x + 1] = catmullQuarter(src[xp2], src[xp1], src[x], src[xm1]); + } + } + QImage upscaled(w * 2, h * 2, QImage::Format_Grayscale8); + for (int y = 0; y < h; ++y) { + const auto *rm2 = horiz.constScanLine(std::max(0, y - 2)); + const auto *rm1 = horiz.constScanLine(std::max(0, y - 1)); + const auto *rc = horiz.constScanLine(y); + const auto *rp1 = horiz.constScanLine(std::min(h - 1, y + 1)); + const auto *rp2 = horiz.constScanLine(std::min(h - 1, y + 2)); + auto *even = upscaled.scanLine(2 * y); + auto *odd = upscaled.scanLine(2 * y + 1); + for (int x = 0; x < w * 2; ++x) { + even[x] = catmullQuarter(rm2[x], rm1[x], rc[x], rp1[x]); + odd[x] = catmullQuarter(rp2[x], rp1[x], rc[x], rm1[x]); + } + } + return upscaled; + }; + const auto catmullUpscale4x = [](const QImage& mapped) { + const int w = mapped.width(); + const int h = mapped.height(); + // Pixel-center-aligned 4x Catmull-Rom: + // t = 3/8 => [-45, 399, 745, -75] / 1024; t = 1/8 => [-7, 93, 987, -49] / 1024. + const auto catmullThreeEighths = [](int far, int near, int center, int opposite) -> uint8_t { + return uint8_t( + std::clamp((-45 * far + 399 * near + 745 * center - 75 * opposite + 512) >> 10, 0, 255)); + }; + const auto catmullOneEighth = [](int far, int near, int center, int opposite) -> uint8_t { + return uint8_t( + std::clamp((-7 * far + 93 * near + 987 * center - 49 * opposite + 512) >> 10, 0, 255)); + }; + QImage horiz(w * 4, h, QImage::Format_Grayscale8); + for (int y = 0; y < h; ++y) { + const auto *src = mapped.constScanLine(y); + auto *dst = horiz.scanLine(y); + for (int x = 0; x < w; ++x) { + const int xm2 = std::max(0, x - 2); + const int xm1 = std::max(0, x - 1); + const int xp1 = std::min(w - 1, x + 1); + const int xp2 = std::min(w - 1, x + 2); + dst[4 * x] = catmullThreeEighths(src[xm2], src[xm1], src[x], src[xp1]); + dst[4 * x + 1] = catmullOneEighth(src[xm2], src[xm1], src[x], src[xp1]); + dst[4 * x + 2] = catmullOneEighth(src[xp2], src[xp1], src[x], src[xm1]); + dst[4 * x + 3] = catmullThreeEighths(src[xp2], src[xp1], src[x], src[xm1]); + } + } + QImage upscaled(w * 4, h * 4, QImage::Format_Grayscale8); + for (int y = 0; y < h; ++y) { + const auto *rm2 = horiz.constScanLine(std::max(0, y - 2)); + const auto *rm1 = horiz.constScanLine(std::max(0, y - 1)); + const auto *rc = horiz.constScanLine(y); + const auto *rp1 = horiz.constScanLine(std::min(h - 1, y + 1)); + const auto *rp2 = horiz.constScanLine(std::min(h - 1, y + 2)); + auto *row0 = upscaled.scanLine(4 * y); + auto *row1 = upscaled.scanLine(4 * y + 1); + auto *row2 = upscaled.scanLine(4 * y + 2); + auto *row3 = upscaled.scanLine(4 * y + 3); + for (int x = 0; x < w * 4; ++x) { + row0[x] = catmullThreeEighths(rm2[x], rm1[x], rc[x], rp1[x]); + row1[x] = catmullOneEighth(rm2[x], rm1[x], rc[x], rp1[x]); + row2[x] = catmullOneEighth(rp2[x], rp1[x], rc[x], rm1[x]); + row3[x] = catmullThreeEighths(rp2[x], rp1[x], rc[x], rm1[x]); + } + } + return upscaled; + }; QSaveFile file(inputPath); + const QImage output = (smoothInverse || neutralAdaptive || positiveContrast) + ? (scale == 4 ? catmullUpscale4x(image) + : scale == 2 ? catmullUpscale2x(image) + : image) + : (scale == 1 ? image + : image.scaled(image.width() * scale, image.height() * scale, Qt::IgnoreAspectRatio, + Qt::SmoothTransformation)); require(file.open(QIODevice::WriteOnly) && file.setPermissions(QFileDevice::ReadOwner | QFileDevice::WriteOwner) - && image - .scaled(image.width() * scale, image.height() * scale, Qt::IgnoreAspectRatio, - Qt::SmoothTransformation) - .save(&file, "PNG") - && file.commit(), + && output.save(&file, "PNG") && file.commit(), "captured OCR image could not be normalized"); } QStringList arguments { inputPath, "stdout", "-l", "eng", "--psm", QString::number(mode) }; - if (adaptiveContrast) + if (adaptiveContrast || neutralAdaptive) arguments << "-c" << "thresholding_method=2"; arguments << "tsv"; const QByteArray tsv = run(ocr, arguments, environment); @@ -952,6 +1160,14 @@ class Journey final { candidate = locate(words(imagePath, 6, region.topLeft(), TextPreprocess::Neutral)); if (candidate.isEmpty()) candidate = locate(words(imagePath, 6, region.topLeft(), TextPreprocess::Inverse)); + if (candidate.isEmpty()) + candidate = locate(words(imagePath, 11, region.topLeft(), TextPreprocess::SmoothInverse)); + if (candidate.isEmpty()) + candidate = locate(words(imagePath, 6, region.topLeft(), TextPreprocess::SmoothInverse)); + if (candidate.isEmpty()) + candidate = locate(words(imagePath, 11, region.topLeft(), TextPreprocess::NeutralAdaptive)); + if (candidate.isEmpty()) + candidate = locate(words(imagePath, 6, region.topLeft(), TextPreprocess::NeutralAdaptive)); if (candidate.isEmpty()) { const QList positiveLines = words(imagePath, 11, region.topLeft(), TextPreprocess::Positive); @@ -1125,8 +1341,8 @@ QByteArray media(const QString& directory, const QProcessEnvironment& environmen run(ffmpeg, { "-nostdin", "-hide_banner", "-loglevel", "error", "-y", "-f", "lavfi", "-i", "color=c=blue:s=640x360:r=10:d=90", "-vf", - "drawbox=x=0:y=0:w=640:h=180:color=red:t=fill:enable='lt(t,10)'," - "drawbox=x=0:y=0:w=640:h=180:color=lime:t=fill:enable='gte(t,10)'", + "drawbox=x=0:y=0:w=640:h=180:color=red:t=fill:enable='lt(t,12)'," + "drawbox=x=0:y=0:w=640:h=180:color=lime:t=fill:enable='gte(t,12)'", "-an", "-c:v", "ffv1", "-level", "3", "-g", "1", "-threads", "1", path }, environment, {}, 60000); QFile file(path); @@ -1303,8 +1519,21 @@ SPOOL_TEST_MAIN("app-journey") journey.command({ "key", "ok" }); journey.text("incorrect-password"); journey.command({ "key", "ok" }); - journey.await( - [&] { return fixture.rejectedLogins == 1; }, "wrong password was not rejected by the real login path"); + try { + journey.await( + [&] { return fixture.rejectedLogins == 1; }, "wrong password was not rejected by the real login path"); + } catch (const std::exception&) { + try { + journey.capture(); + } catch (const std::exception&) { + } + throw std::runtime_error(QStringLiteral("wrong password was not rejected by the real login path " + "(rejected=%1, successful=%2, unexpected=%3)") + .arg(fixture.rejectedLogins) + .arg(fixture.successfulLogins) + .arg(fixture.unexpected.size()) + .toStdString()); + } journey.label("Wrong username or password"); journey.text("journey-password"); journey.command({ "key", "ok" }); @@ -1478,7 +1707,7 @@ SPOOL_TEST_MAIN("app-journey") journey.command({ "key", "back" }); journey.command({ "key", "back" }); journey.label("Appearance"); - journey.click("Downloads"); + journey.click("Downloads", true); journey.click("Play saved files offline", true); journey.label("Journey Film"); journey.label("Downloaded"); @@ -1503,8 +1732,26 @@ SPOOL_TEST_MAIN("app-journey") }, "saved download did not enter real embedded playback"); journey.command({ "pause" }); - journey.await([&] { return journey.state()["playback"].toObject()["paused"].toBool(); }, - "asynchronous pause did not settle before exact paused-frame seeking"); + QJsonObject lastPauseState; + try { + journey.await( + [&] { + lastPauseState = journey.state()["playback"].toObject(); + return lastPauseState["paused"].toBool(); + }, + "asynchronous pause did not settle before exact paused-frame seeking"); + } catch (const std::exception&) { + throw std::runtime_error( + QStringLiteral("asynchronous pause did not settle before exact paused-frame seeking " + "(active=%1, loaded=%2, paused=%3, failed=%4, position=%5, duration=%6)") + .arg(lastPauseState["active"].toBool()) + .arg(lastPauseState["loaded"].toBool()) + .arg(lastPauseState["paused"].toBool()) + .arg(lastPauseState["failed"].toBool()) + .arg(lastPauseState["position"].toDouble(), 0, 'f', 2) + .arg(lastPauseState["duration"].toDouble(), 0, 'f', 2) + .toStdString()); + } journey.command({ "seek", "2" }); journey.await( [&] { @@ -1642,14 +1889,33 @@ SPOOL_TEST_MAIN("app-journey") }); }, "selected episode Resume lost the stopped position during stale series hydration"); - journey.await( - [&] { - const double position = journey.state()["playback"].toObject()["position"].toDouble(); - return position >= double(expectedTicks) / 10000000.0 - 0.5 - && position < double(expectedTicks) / 10000000.0 + 5.0 - && frameHasBands(journey.capture(true), 1); - }, - "episode Resume did not decode the saved media position"); + const double expectedSeconds = double(expectedTicks) / 10000000.0; + double resumePosition = -1; + bool resumePaused = false; + bool resumeGreen = false; + try { + journey.await( + [&] { + const auto playback = journey.state()["playback"].toObject(); + resumePosition = playback["position"].toDouble(); + resumePaused = playback["paused"].toBool(); + // Allow generous pause-settlement headroom on slow simulator + // runners while still proving Resume started near expectedTicks. + if (resumePosition < expectedSeconds - 0.5 || resumePosition >= expectedSeconds + 15.0) + return false; + resumeGreen = frameHasBands(journey.capture(true), 1); + return resumeGreen; + }, + "episode Resume did not decode the saved media position"); + } catch (const std::exception&) { + throw std::runtime_error(QStringLiteral("episode Resume did not decode the saved media position " + "(expected=%1, position=%2, paused=%3, green=%4)") + .arg(expectedSeconds) + .arg(resumePosition) + .arg(resumePaused) + .arg(resumeGreen) + .toStdString()); + } }; resumeEpisode(firstStopTicks); journey.command({ "seek", "20" }); @@ -1684,25 +1950,58 @@ SPOOL_TEST_MAIN("app-journey") "resumed episode did not stop before explicit restart"); const qsizetype reportsBeforeRemote = fixture.reports.size(); fixturePhase = QStringLiteral("episode-remote"); - require(fixture.sendRemotePlay(70000000), "real remote event socket was not connected"); + // Use 5.5s so stopping preserves resume progress (>= 5s threshold in + // isMeaningfulResumePosition, keeping "Start from beginning" visible + // on fast runners) while still leaving 6.5s of pause-settlement + // headroom before the 12s red-to-lime band boundary. + require(fixture.sendRemotePlay(55000000), "real remote event socket was not connected"); journey.await([&] { return journey.state()["playback"].toObject()["loaded"].toBool(); }, "real inbound remote Play did not load the selected episode"); journey.command({ "pause" }); + journey.await([&] { return journey.state()["playback"].toObject()["paused"].toBool(); }, + "inbound remote episode did not pause before observing its requested position"); journey.await( [&] { return std::any_of(fixture.reports.cbegin() + reportsBeforeRemote, fixture.reports.cend(), [](const QJsonObject& report) { return report["endpoint"] == "/Sessions/Playing" && report["ItemId"] == "journey-episode" - && report["PositionTicks"].toVariant().toLongLong() == 70000000; + && report["PositionTicks"].toVariant().toLongLong() == 55000000; }); }, "cached local resume progress overrode the explicit inbound remote start position"); - journey.await( - [&] { - const double position = journey.state()["playback"].toObject()["position"].toDouble(); - return position > 6.5 && position < 9.5 && frameHasBands(journey.capture(true), 0); - }, - "inbound remote start did not decode the explicitly requested position"); + double remotePosition = -1; + bool remotePaused = false; + bool remoteRed = false; + bool remoteGreen = false; + try { + journey.await( + [&] { + const auto playback = journey.state()["playback"].toObject(); + remotePosition = playback["position"].toDouble(); + remotePaused = playback["paused"].toBool(); + const auto frame = journey.capture(true); + remoteRed = frameHasBands(frame, 0); + remoteGreen = frameHasBands(frame, 1); + // On slow software simulators playback can advance past the 12s + // red-to-lime boundary before pause settles; verify the decoded + // band matches the paused position while staying strictly below + // the ~20s cached resume position. + const bool expectedBand = remotePosition < 11.8 + ? remoteRed + : (remotePosition > 12.2 ? remoteGreen : (remoteRed || remoteGreen)); + return remotePosition > 5.0 && remotePosition < 18.5 && expectedBand; + }, + "inbound remote start did not decode the explicitly requested position"); + } catch (const std::exception&) { + throw std::runtime_error( + QStringLiteral("inbound remote start did not decode the explicitly requested position " + "(position=%1, paused=%2, red=%3, green=%4)") + .arg(remotePosition) + .arg(remotePaused) + .arg(remoteRed) + .arg(remoteGreen) + .toStdString()); + } journey.command({ "stop" }); journey.await([&] { return !journey.state()["playback"].toObject()["active"].toBool(); }, "remote episode did not stop before explicit restart"); @@ -1713,6 +2012,8 @@ SPOOL_TEST_MAIN("app-journey") journey.await([&] { return journey.state()["playback"].toObject()["loaded"].toBool(); }, "explicit episode restart did not load"); journey.command({ "pause" }); + journey.await([&] { return journey.state()["playback"].toObject()["paused"].toBool(); }, + "explicit episode restart did not pause before observing the beginning"); journey.await( [&] { return std::any_of(fixture.reports.cbegin() + reportsBeforeRestart, fixture.reports.cend(), @@ -1722,12 +2023,23 @@ SPOOL_TEST_MAIN("app-journey") }); }, "local resume precedence overrode explicit Play from start"); - journey.await( - [&] { - return journey.state()["playback"].toObject()["position"].toDouble() < 5.0 - && frameHasBands(journey.capture(true), 0); - }, - "explicit episode restart did not decode the beginning"); + double restartPosition = -1; + bool restartRed = false; + try { + journey.await( + [&] { + restartPosition = journey.state()["playback"].toObject()["position"].toDouble(); + restartRed = frameHasBands(journey.capture(true), 0); + return restartPosition < 11.5 && restartRed; + }, + "explicit episode restart did not decode the beginning"); + } catch (const std::exception&) { + throw std::runtime_error( + QStringLiteral("explicit episode restart did not decode the beginning (position=%1, red=%2)") + .arg(restartPosition) + .arg(restartRed) + .toStdString()); + } // EOF is driven by the real finite media, not a synthetic controller // signal. The decoded restart and server receipt prove repeat crossed @@ -1759,7 +2071,7 @@ SPOOL_TEST_MAIN("app-journey") [&] { const auto playback = journey.state()["playback"].toObject(); return playback["loaded"].toBool() && playback["paused"].toBool() - && playback["position"].toDouble() < 8.0 && frameHasBands(journey.capture(true), 0); + && playback["position"].toDouble() < 11.5 && frameHasBands(journey.capture(true), 0); }, "repeated item did not decode its beginning"); diff --git a/tests/platform/MobileTestFixtures.cpp b/tests/platform/MobileTestFixtures.cpp index 4b5879a6..dba48ca2 100644 --- a/tests/platform/MobileTestFixtures.cpp +++ b/tests/platform/MobileTestFixtures.cpp @@ -10,6 +10,7 @@ namespace SpoolTests { namespace { + QTemporaryDir *extractedDirectory = nullptr; QString extractedRoot; } @@ -22,8 +23,9 @@ const QString& mobileFixtureRoot() bool prepareMobileFixtures() { - static QTemporaryDir directory(QDir::tempPath() + QStringLiteral("/spool-test-fixtures-XXXXXX")); - if (!directory.isValid()) { + if (!extractedDirectory) + extractedDirectory = new QTemporaryDir(QDir::tempPath() + QStringLiteral("/spool-test-fixtures-XXXXXX")); + if (!extractedDirectory->isValid()) { std::fprintf(stderr, "mobile tests: cannot create isolated fixture directory\n"); return false; } @@ -31,14 +33,21 @@ bool prepareMobileFixtures() QDirIterator fixtures(prefix, QDir::Files, QDirIterator::Subdirectories); while (fixtures.hasNext()) { const QString source = fixtures.next(); - const QString destination = directory.filePath(source.mid(prefix.size())); + const QString destination = extractedDirectory->filePath(source.mid(prefix.size())); if (!QDir().mkpath(QFileInfo(destination).absolutePath()) || !QFile::copy(source, destination)) { std::fprintf(stderr, "mobile tests: cannot extract packaged fixture\n"); return false; } } - extractedRoot = directory.path(); + extractedRoot = extractedDirectory->path(); return true; } +void cleanupMobileFixtures() +{ + extractedRoot.clear(); + delete extractedDirectory; + extractedDirectory = nullptr; +} + } // namespace SpoolTests diff --git a/tests/platform/MobileTestFixtures.h b/tests/platform/MobileTestFixtures.h index 8a143d83..c89773d6 100644 --- a/tests/platform/MobileTestFixtures.h +++ b/tests/platform/MobileTestFixtures.h @@ -7,6 +7,7 @@ namespace SpoolTests { // Materialize packaged fixtures before a selector constructs its application. // Tests use the same filesystem paths on desktop and in the mobile sandbox. bool prepareMobileFixtures(); +void cleanupMobileFixtures(); const QString& mobileFixtureRoot(); } // namespace SpoolTests diff --git a/tests/player/MpvVideoItemTest.cpp b/tests/player/MpvVideoItemTest.cpp index 9905ac11..f8404fed 100644 --- a/tests/player/MpvVideoItemTest.cpp +++ b/tests/player/MpvVideoItemTest.cpp @@ -7,6 +7,7 @@ #include "TestMain.h" #include +#include #include #include #include @@ -173,16 +174,24 @@ bool containsNeutralOsd(const QImage& image, const QImage& baseline) { if (image.size() != baseline.size()) return false; + const QImage img = image.convertToFormat(QImage::Format_RGB32); + const QImage base = baseline.convertToFormat(QImage::Format_RGB32); int neutral = 0; - for (int y = 0; y < image.height(); ++y) { - for (int x = 0; x < image.width(); ++x) { + for (int y = 0; y < img.height(); ++y) { + const auto *baseRow = reinterpret_cast(base.constScanLine(y)); + const auto *imgRow = reinterpret_cast(img.constScanLine(y)); + for (int x = 0; x < img.width(); ++x) { // Check text over the fixture's black letterbox, not antialiased // text blended into the red/blue video or a particular font weight. - if (baseline.pixelColor(x, y) != QColor(Qt::black)) + const QRgb basePixel = baseRow[x]; + if (qRed(basePixel) != 0 || qGreen(basePixel) != 0 || qBlue(basePixel) != 0) continue; - const QColor color = image.pixelColor(x, y); - const int high = std::max({ color.red(), color.green(), color.blue() }); - const int low = std::min({ color.red(), color.green(), color.blue() }); + const QRgb color = imgRow[x]; + const int r = qRed(color); + const int g = qGreen(color); + const int b = qBlue(color); + const int high = std::max({ r, g, b }); + const int low = std::min({ r, g, b }); if (high <= 16) continue; if (high - low > 8) @@ -240,7 +249,7 @@ SPOOL_TEST_MAIN("mpv-video-item") if (api == "vulkan") std::fprintf(stderr, "requested Vulkan scene graph\n"); QSurfaceFormat format; -#if defined(Q_OS_TVOS) || defined(Q_OS_ANDROID) +#if defined(SPOOL_APPLE_MOBILE) || defined(Q_OS_ANDROID) format.setRenderableType(QSurfaceFormat::OpenGLES); format.setVersion(3, 0); #else @@ -303,7 +312,7 @@ SPOOL_TEST_MAIN("mpv-video-item") }, Qt::DirectConnection); #endif -#if defined(Q_OS_TVOS) || defined(Q_OS_ANDROID) +#if defined(SPOOL_APPLE_MOBILE) || defined(Q_OS_ANDROID) window.showFullScreen(); #else window.show(); @@ -311,7 +320,7 @@ SPOOL_TEST_MAIN("mpv-video-item") app.processEvents(); const auto captureItem = [&] { const QImage image = window.grabWindow(); -#if defined(Q_OS_TVOS) || defined(Q_OS_ANDROID) +#if defined(SPOOL_APPLE_MOBILE) || defined(Q_OS_ANDROID) if (image.isNull()) return image; const qreal xScale = qreal(image.width()) / window.contentItem()->width(); @@ -323,20 +332,34 @@ SPOOL_TEST_MAIN("mpv-video-item") }; const auto waitForPresentedFrame = [&](const auto& matches) { bool matched = false; + QElapsedTimer lastCheck; QEventLoop loop; QTimer timeout; timeout.setSingleShot(true); - QObject::connect(&timeout, &QTimer::timeout, &loop, &QEventLoop::quit); + QObject::connect(&timeout, &QTimer::timeout, &loop, [&] { + if (!matched && matches(captureItem())) + matched = true; + loop.quit(); + }); QObject::connect( &window, &QQuickWindow::frameSwapped, &loop, [&] { - if (!matched && matches(captureItem())) { + if (matched) + return; + if (lastCheck.isValid() && lastCheck.elapsed() < 100) + return; + lastCheck.start(); + if (matches(captureItem())) { matched = true; loop.quit(); } }, Qt::QueuedConnection); +#if defined(SPOOL_APPLE_MOBILE) || defined(Q_OS_ANDROID) + timeout.start(15000); +#else timeout.start(5000); +#endif // UIKit returns to UIApplicationMain only for EventLoopExec, not a // manual processEvents pump. Read back after its real presentation. loop.exec(); @@ -346,7 +369,7 @@ SPOOL_TEST_MAIN("mpv-video-item") // Reusing an item after detach must reset first-frame state and publish // the new context, including when Qt replaces the render target on resize. for (const QSize size : { QSize(320, 180), QSize(480, 270) }) { -#if defined(Q_OS_TVOS) || defined(Q_OS_ANDROID) +#if defined(SPOOL_APPLE_MOBILE) || defined(Q_OS_ANDROID) // The mobile platform owns the fullscreen native window; resize the // real video viewport instead of requesting a desktop window size. viewportFraction = size.width() == 320 ? 1.0 : 2.0 / 3.0; @@ -367,8 +390,11 @@ SPOOL_TEST_MAIN("mpv-video-item") std::fprintf(stderr, "failed to enable mpv logging\n"); return 1; } + if (handle) + mpv_request_log_messages(handle, "warn"); if (!handle || mpv_set_option_string(handle, "terminal", verbose ? "yes" : "no") < 0 || mpv_set_option_string(handle, "vo", "libmpv") < 0 || mpv_set_option_string(handle, "hwdec", "no") < 0 + || mpv_set_option_string(handle, "keep-open", "yes") < 0 || mpv_set_option_string(handle, "osd-color", "#FFFFFFFF") < 0 || mpv_set_option_string(handle, "osd-font-size", "48") < 0 || mpv_set_option_string(handle, "osd-fonts-dir", osdFonts.constData()) < 0 @@ -427,7 +453,7 @@ SPOOL_TEST_MAIN("mpv-video-item") actualFormat.isEmpty() ? "(legacy renderer)" : actualFormat.constData()); #endif const QImage beforeOsd = captureItem(); - const char *osdCommand[] = { "show-text", "SDR white", "10000", nullptr }; + const char *osdCommand[] = { "show-text", "SDR white", "20000", nullptr }; double beforeOsdPosition = -1; const int beforeOsdPositionStatus = mpv_get_property(handle, "time-pos", MPV_FORMAT_DOUBLE, &beforeOsdPosition); const int osdCommandStatus = mpv_command(handle, osdCommand); @@ -471,6 +497,19 @@ SPOOL_TEST_MAIN("mpv-video-item") } mpv_free_node_contents(&dimensions); } + int drained = 0; + while (drained < 64) { + mpv_event *event = mpv_wait_event(handle, 0.0); + if (!event || event->event_id == MPV_EVENT_NONE) + break; + if (event->event_id == MPV_EVENT_LOG_MESSAGE) { + const auto *msg = static_cast(event->data); + if (msg && msg->prefix && msg->level && msg->text) { + std::fprintf(stderr, "mpv[%s][%s]: %s", msg->prefix, msg->level, msg->text); + ++drained; + } + } + } const QString capturePath = QDir::tempPath() + QStringLiteral("/mpv-video-item-failure.png"); const QImage frame = !rendered || !upright ? beforeOsd : captureItem(); if (frame.save(capturePath)) diff --git a/tests/providers/ScriptRuntimeNetworkTest.cpp b/tests/providers/ScriptRuntimeNetworkTest.cpp index 21d90d08..212dbc88 100644 --- a/tests/providers/ScriptRuntimeNetworkTest.cpp +++ b/tests/providers/ScriptRuntimeNetworkTest.cpp @@ -390,10 +390,16 @@ SPOOL_TEST_MAIN("script-runtime-network") QCoro::waitFor(runtime.addSource("account", {}, {}, capabilities)); QCoro::waitFor(runtime.addSource("baseline", {}, { QUrl(origin) })); rejects(runtime.call("baseline", "discover", { { "port", 7359 }, { "timeout", 100 } }), "unsupported_capability"); +#if defined(SPOOL_APPLE_MOBILE) + rejects(runtime.call("draft", "discover", + { { "port", 7359 }, { "message", "spool-discovery-contract-test" }, { "timeout", 100 } }), + "discovery_unavailable"); +#else const auto udp = QCoro::waitFor(runtime.call( "draft", "discover", { { "port", 7359 }, { "message", "spool-discovery-contract-test" }, { "timeout", 100 } })); require( udp.value("array").toBool(), "UDP discovery publishes an ordinary JavaScript array usable by provider code"); +#endif const auto http = [&](QString source, QString path, QVariantMap options = {}) { return runtime.call(source, "http", { { "url", origin + path }, { "options", options } }); }; diff --git a/tests/providers/ScriptRuntimeTest.cpp b/tests/providers/ScriptRuntimeTest.cpp index 73b2226f..1e6b3faf 100644 --- a/tests/providers/ScriptRuntimeTest.cpp +++ b/tests/providers/ScriptRuntimeTest.cpp @@ -207,10 +207,13 @@ SPOOL_TEST_MAIN("script-runtime") require(false, failure); }; requireNonce(!nonce.isEmpty(), "benchmark cache-busting nonce is empty"); - // Qt may resend a GET whose reply this fixture cut short; that is - // the same request again, not a reused cache-busting nonce. - requireNonce(target.path() == QStringLiteral("/speed-truncated") || !speedNonces.contains(nonce), - "benchmark cache-busting nonce is duplicated"); + // Qt may resend an idempotent GET whose reply this fixture cut + // short or closed abruptly without Content-Length; that is the + // same request again, not a reused cache-busting nonce. + const bool mayAutoRetry = target.path() == QStringLiteral("/speed-truncated") + || target.path() == QStringLiteral("/speed-oversized"); + requireNonce( + mayAutoRetry || !speedNonces.contains(nonce), "benchmark cache-busting nonce is duplicated"); speedNonces.insert(nonce); require(!request.contains("Cookie:"), "benchmark does not load shared cookies"); require(request.contains("Accept-Encoding: identity"), "benchmark requests uncompressed bytes"); diff --git a/tests/qml/tst_ProviderForms.qml b/tests/qml/tst_ProviderForms.qml index 5248786c..9cdce83f 100644 --- a/tests/qml/tst_ProviderForms.qml +++ b/tests/qml/tst_ProviderForms.qml @@ -26,6 +26,7 @@ TestCase { property var completions: [] property var pendingAuthentication: null property var pendingAuthenticationRejection: null + property int authenticationCount: 0 property var pendingPoll: null property int closes: 0 function request(operation, args) { @@ -44,11 +45,13 @@ TestCase { users: [], codeEnabled: true }) - if (operation === "authenticate") + if (operation === "authenticate") { + ++authenticationCount return new Promise((resolve, reject) => { pendingAuthentication = resolve pendingAuthenticationRejection = reject }) + } if (operation === "codeStart") return Promise.resolve({ code: "123456", @@ -80,6 +83,36 @@ TestCase { codeEnabledField: "codeEnabled" } } + Component { + id: routedLogin + KeyRouter { + id: router + property alias form: form + activeTarget: routeAdapter + textInputActive: InputKeys.isTextInputItem(router.Window.window ? router.Window.window.activeFocusItem : + null) + + QtObject { + id: routeAdapter + function activate() { + form.activate() + } + function longPress() { + return false + } + } + + ServerLogin { + id: form + anchors.fill: parent + provider: testCase.providerContext + codeLabel: "Link code" + codeStartOperation: "codeStart" + codePollOperation: "codePoll" + codeEnabledField: "codeEnabled" + } + } + } Component { id: actionPicker ProviderActionPicker { @@ -154,6 +187,7 @@ TestCase { provider.completions = [] provider.pendingAuthentication = null provider.pendingAuthenticationRejection = null + provider.authenticationCount = 0 provider.pendingPoll = null provider.closes = 0 provider.arguments = { @@ -179,6 +213,41 @@ TestCase { } return null } + function test_tvUsernameAcceptStaysOnPasswordRow() { + const previousFollowsFocus = Theme.textEntryFollowsFocus + const previousKeyboardFocus = Metrics.keyboardFocusActive + Theme.textEntryFollowsFocus = false + Metrics.keyboardFocusActive = true + try { + const shell = form(routedLogin) + shell.form.connect("fixture.invalid") + tryCompare(shell.form, "step", "account") + const username = accessibleItem(shell.form, "Username") + const password = accessibleItem(shell.form, "Password") + verify(username) + verify(password) + const usernameRow = username.parent + const passwordRow = password.parent + tryVerify(() => usernameRow.activeFocus && !username.activeFocus) + keyClick(Qt.Key_Return) + verify(username.activeFocus) + username.text = "journey" + keyClick(Qt.Key_Return) + verify(passwordRow.activeFocus) + verify(!password.activeFocus, + "accepting Username must land on Password row without re-triggering KeyRouter") + compare(provider.authenticationCount, 0) + keyClick(Qt.Key_Return) + verify(password.activeFocus) + compare(provider.authenticationCount, 0) + password.text = "incorrect-password" + keyClick(Qt.Key_Return) + tryCompare(provider, "authenticationCount", 1) + } finally { + Theme.textEntryFollowsFocus = previousFollowsFocus + Metrics.keyboardFocusActive = previousKeyboardFocus + } + } function test_wrappedRejectionKeepsPasswordVisibleWithoutFocusSteal() { const view = form(login) view.width = 360 diff --git a/tests/tools/StreamingCandidatesTest.py b/tests/tools/StreamingCandidatesTest.py index 17e31d6f..99eaa7aa 100644 --- a/tests/tools/StreamingCandidatesTest.py +++ b/tests/tools/StreamingCandidatesTest.py @@ -22,16 +22,16 @@ library, offset, limit = argv[3], int(argv[4]), int(argv[5]) if limit <= 0: sys.exit(64) -with open(os.environ['SPOOL_FAKE_LOG'], 'a') as log: - log.write('{} {}\n'.format(library, offset)) +events = [] entry = json.loads(open(os.environ['SPOOL_FAKE_CATALOG']).read())['libraries'][library] failure = entry.get('fail') if entry.get('failOffset', offset) == offset else None if entry.get('delay'): - with open(os.environ['SPOOL_FAKE_LOG'] + '.events', 'a') as log: - log.write(json.dumps([time.monotonic(), 1]) + '\n') + events.append([time.monotonic(), 1]) time.sleep(entry['delay']) - with open(os.environ['SPOOL_FAKE_LOG'] + '.events', 'a') as log: - log.write(json.dumps([time.monotonic(), -1]) + '\n') + events.append([time.monotonic(), -1]) +record_path = os.path.join(os.environ['SPOOL_FAKE_LOG'], '{}-{}.json'.format(os.getpid(), time.monotonic_ns())) +with open(record_path, 'w') as log: + json.dump({'call': '{} {}'.format(library, offset), 'events': events}, log) if failure == 'exit': sys.stderr.write(entry['noise']) sys.exit(3) @@ -82,7 +82,8 @@ def setUp(self): self.fake = self.root / 'spoolet' self.fake.write_text(FAKE_SPOOLET, encoding='utf-8') self.fake.chmod(self.fake.stat().st_mode | stat.S_IEXEC) - self.log = self.root / 'calls.log' + self.log = self.root / 'calls' + self.log.mkdir() def run_tool(self, config, arguments): catalog = self.root / 'catalog.json' @@ -95,8 +96,11 @@ def report(self, result): self.assertEqual(result.returncode, 0, result.stderr) return json.loads(result.stdout) + def read_records(self): + return [json.loads(path.read_text()) for path in sorted(self.log.glob('*.json'))] + def calls(self): - return self.log.read_text().split() if self.log.exists() else [] + return [record['call'] for record in self.read_records()] def test_parallel_pages_rank_all_rows_without_fetching_past_total(self): rows = [item(str(i), [source(1000000 + i, i + 1, 1920, 1080)], url=NOISE) @@ -109,11 +113,13 @@ def test_parallel_pages_rank_all_rows_without_fetching_past_total(self): self.assertEqual([r['id'] for r in report['candidates']], ['349', '348', '347']) self.assertEqual(report['libraries'][0], {'library': 'movies', 'scanned': 350, 'total': 350, 'unknownBitrate': 0, 'complete': True}) - calls = self.log.read_text().splitlines() + records = self.read_records() + calls = [record['call'] for record in records] self.assertEqual(set(calls), {'movies 0', 'movies 100', 'movies 200', 'movies 300'}) self.assertEqual(len(calls), 4) active = peak = 0 - for _, change in sorted(json.loads(line) for line in Path(str(self.log) + '.events').read_text().splitlines()): + events = [event for record in records for event in record['events']] + for _, change in sorted(events): active += change peak = max(peak, active) self.assertLessEqual(peak, 2, 'catalog scan exceeded its concurrent provider operation limit') diff --git a/tools/android/emulator-launch-test.sh b/tools/android/emulator-launch-test.sh index 0085cba8..5804a5da 100755 --- a/tools/android/emulator-launch-test.sh +++ b/tools/android/emulator-launch-test.sh @@ -107,21 +107,61 @@ done } export ANDROID_SERIAL +wait_adb_online() { + for _ in $(seq 1 30); do + if [[ "$("$ADB" -s "$ANDROID_SERIAL" get-state 2>/dev/null)" == device ]]; then + return 0 + fi + sleep 1 + done + return 1 +} + +# Android TV API 36 can transiently drop adbd to offline right after +# sys.boot_completed transitions to 1 while system services settle. +adb_retry() { + local attempt err status + for attempt in 1 2 3; do + wait_adb_online || return 1 + err="$(mktemp "$emulator_work/adb-err.XXXXXX")" + status=0 + "$ADB" -s "$ANDROID_SERIAL" "$@" 2>"$err" || status=$? + if [[ "$status" -eq 0 ]]; then + rm -f "$err" + return 0 + fi + if [[ "$attempt" -lt 3 ]] && + { grep -qiE 'offline|closed|not found' "$err" || [[ "$("$ADB" -s "$ANDROID_SERIAL" get-state 2>/dev/null)" != device ]]; }; then + rm -f "$err" + sleep 2 + continue + fi + cat "$err" >&2 + rm -f "$err" + return "$status" + done +} + +boot_ready=0 for _ in $(seq 1 90); do - if [[ "$("$ADB" get-state 2>/dev/null)" == device ]] && - [[ "$("$ADB" shell getprop sys.boot_completed 2>/dev/null | tr -d '\r')" == 1 ]]; then + if [[ "$("$ADB" -s "$ANDROID_SERIAL" get-state 2>/dev/null)" == device ]] && + [[ "$("$ADB" -s "$ANDROID_SERIAL" shell getprop sys.boot_completed 2>/dev/null | tr -d '\r')" == 1 ]] && + "$ADB" -s "$ANDROID_SERIAL" shell pm path android >/dev/null 2>&1 && + "$ADB" -s "$ANDROID_SERIAL" shell settings get global angle_gl_driver_selection_pkgs >/dev/null 2>&1; then + boot_ready=1 break fi sleep 2 done -[[ "$("$ADB" shell getprop sys.boot_completed 2>/dev/null | tr -d '\r')" == 1 ]] || { +[[ "$boot_ready" == 1 ]] || { cat "$EMULATOR_LOG" >&2 echo "error: Android emulator did not boot" >&2 exit 1 } # Derive the journey's input mode from the actual OS feature, not an app flag. # A TV lane must really be a TV image; handset mode must not borrow TV proof. -if "$ADB" shell pm has-feature android.software.leanback | tr -d '\r' | grep -qx true; then +leanback_feature="$(adb_retry shell 'pm has-feature android.software.leanback || true' | tr -d '\r')" +if [[ "$leanback_feature" == true ]]; then SPOOL_E2E_ANDROID_TV=1 else SPOOL_E2E_ANDROID_TV=0 @@ -134,19 +174,25 @@ expected_tv=0 } export SPOOL_E2E_ANDROID_TV -# The guest emulator GL translator advertises GLES 3.1 but rejects valid SSBO -# operations. Use the image's supported guest ANGLE, not a patched Qt/decoder or -# a software Qt scenegraph. These settings belong only to this isolated device. -"$ADB" -s "$ANDROID_SERIAL" shell 'test -f /system/lib64/libGLESv2_angle.so || test -f /system/lib/libGLESv2_angle.so' || { - echo 'error: the emulator image does not provide the required guest ANGLE driver' >&2 - exit 1 -} -angle_packages_before="$("$ADB" -s "$ANDROID_SERIAL" shell settings get global angle_gl_driver_selection_pkgs | tr -d '\r')" -angle_values_before="$("$ADB" -s "$ANDROID_SERIAL" shell settings get global angle_gl_driver_selection_values | tr -d '\r')" -angle_configured=1 -"$ADB" -s "$ANDROID_SERIAL" shell settings put global angle_gl_driver_selection_pkgs \ - com.sachk.spool.tests,com.sachk.spool.e2e_tests,com.sachk.spool -"$ADB" -s "$ANDROID_SERIAL" shell settings put global angle_gl_driver_selection_values angle,angle,angle +# The phone google_apis image uses guest ANGLE because its legacy GL translator +# path rejects valid SSBO operations. On Android TV API 36 (r04), guest +# libGLESv2_angle.so faults with SEGV_ACCERR in rx::BufferVk::directUpdate on +# the first QRhi glBufferSubData call; keep the emulator's default EGL_emulation +# path on TV, which routes through host ANGLE (-gpu swangle) with working +# GLES 3.1 SSBO support rather than a patched Qt/decoder or software scenegraph. +# These settings belong only to this isolated device. +if [[ "$SPOOL_E2E_ANDROID_TV" != 1 ]]; then + adb_retry shell 'test -f /system/lib64/libGLESv2_angle.so || test -f /system/lib/libGLESv2_angle.so' || { + echo 'error: the emulator image does not provide the required guest ANGLE driver' >&2 + exit 1 + } + angle_packages_before="$(adb_retry shell settings get global angle_gl_driver_selection_pkgs | tr -d '\r')" + angle_values_before="$(adb_retry shell settings get global angle_gl_driver_selection_values | tr -d '\r')" + angle_configured=1 + adb_retry shell settings put global angle_gl_driver_selection_pkgs \ + com.sachk.spool.tests,com.sachk.spool.e2e_tests,com.sachk.spool + adb_retry shell settings put global angle_gl_driver_selection_values angle,angle,angle +fi # Resolves through each launcher category in turn. One package now has to # answer to both, so a manifest that lost either entry point fails here rather @@ -210,9 +256,9 @@ launch_category() { printf '%s launched through %s; screenshot at %s\n' "$package" "$category" "$shot" } -"$ADB" install -r "$APK" -"$ADB" install -r "$TEST_APK" -"$ADB" install -r "$E2E_APK" +adb_retry install -r "$APK" +adb_retry install -r "$TEST_APK" +adb_retry install -r "$E2E_APK" status=0 # The shared driver finishes every traditional native selector before starting # real GUI selectors and retains both phase failures. diff --git a/tools/run-device-tests.py b/tools/run-device-tests.py index 6b009689..a3fa47c9 100755 --- a/tools/run-device-tests.py +++ b/tools/run-device-tests.py @@ -52,7 +52,7 @@ def command(arguments, *, check=True, timeout=30, input=None, env=None): def diagnostic(text): # Only controlled native test diagnostics. Never print provider/app payloads. - markers = ("video result:", "orientation:", "viewport:", "first video frame", "native presentation:", + markers = ("video result:", "orientation:", "viewport:", "first video frame", "native presentation:", "native OSD:", "render context handoff did not complete", "render context was not ready", "failed to initialize mpv", "tvOS audio smoke:", "tvOS credentials smoke:", "An error was encountered processing the command", "dyld[", "spool-test-require:") @@ -1248,7 +1248,7 @@ def export_attempt(private, destination, result): r"^app-journey: production spoolet rejected ([a-z_-]{1,32}) " r"\(exit=(-?[0-9]+), code=([a-z_]{1,64}), elapsed_ms=([0-9]+), " r"timeout_origin=(unknown|server|client_write|client_response)\)") - reason_pattern = re.compile(r'^app-journey: ([A-Za-z0-9 ,.:;()=_\x27"-]{1,200})$') + reason_pattern = re.compile(r'^app-journey: ([A-Za-z0-9 ,.:;()=_\x27"-]{1,400})$') with log.open(encoding="utf-8", errors="replace") as stream: for line in stream: stripped = line.rstrip("\r\n") @@ -1262,7 +1262,7 @@ def export_attempt(private, destination, result): continue reason_match = reason_pattern.match(stripped) if reason_match: - reason = reason_match.group(1) + reason = reason_match.group(1)[:240] if ("retained at" not in reason and "://" not in reason and "/" not in reason and not re.search(r"[a-fA-F0-9]{24,}", reason)): lines.append("reason=" + reason) From 0b0b34ca0e82df33b85f503f6dc23351551b7a2a Mon Sep 17 00:00:00 2001 From: Sacha Korban Date: Fri, 27 Nov 2026 02:50:05 +1100 Subject: [PATCH 10/39] ci(apple): harden bundle lookup, signing and pinned Intel tooling Consolidate the release milestone ending at 163ed1ebc012accf203466dbe2149750b4318b61. Original starting snapshot: f6200d405f84565edd124e29177d8e137bfaeaa4. --- .github/workflows/build-artifacts.yml | 60 +++++++++++++-- .github/workflows/ios-review.yml | 4 + .github/workflows/retry-artifact-setup.yml | 54 ++++++++++++++ qml/pages/ItemDetailsPage.qml | 1 + qml/pages/PlayerOverlayChrome.qml | 1 + qml/pages/PlayerTransportBar.qml | 1 + qml/primitives/MediaRow.qml | 1 + src/platform/NativeAppWindow.h | 18 ++++- .../android/AndroidPlaybackSurface.cpp | 10 ++- src/player/MpvVideoItem.cpp | 8 ++ src/player/PlayerController.cpp | 17 ++++- tests/e2e/AppJourneyTest.cpp | 73 ++++++++++++++----- tests/player/MpvVideoItemTest.cpp | 9 ++- tests/qml/tst_ProviderForms.qml | 2 + tools/apple/smoke-tvos.sh | 41 ++++++++++- tools/build-macos.sh | 19 ++++- tools/install-intel-darwin-cachix.sh | 18 +++++ tools/run-device-tests.py | 22 +++++- tools/windows/build-mpv.ps1 | 7 ++ tools/windows/common.ps1 | 27 +++++++ 20 files changed, 349 insertions(+), 44 deletions(-) create mode 100644 .github/workflows/retry-artifact-setup.yml create mode 100755 tools/install-intel-darwin-cachix.sh diff --git a/.github/workflows/build-artifacts.yml b/.github/workflows/build-artifacts.yml index 6912e6eb..813976e7 100644 --- a/.github/workflows/build-artifacts.yml +++ b/.github/workflows/build-artifacts.yml @@ -194,6 +194,14 @@ jobs: - name: Check commit whitespace run: git show --check --format= HEAD + - name: Verify mpv gitlink and Nix lock agree + run: | + set -euo pipefail + gitlink="$(git rev-parse HEAD:mpv)" + locked="$(jq -er '.nodes["mpv-src"].locked.rev' flake.lock)" + test "$gitlink" = "$locked" + test "$(git -C mpv rev-parse HEAD)" = "$gitlink" + - name: Syntax-check shell scripts run: | mapfile -t scripts < <(git ls-files '*.sh' | sort -u) @@ -591,6 +599,9 @@ jobs: purge-prefixes: nix-native-${{ runner.os }}-${{ matrix.arch }}- purge-created: P7D purge-primary-key: never + - name: Install Cachix from the Intel macOS pin + if: matrix.arch == 'x86_64' + run: bash tools/install-intel-darwin-cachix.sh - uses: cachix/cachix-action@3ba601ff5bbb07c7220846facfa2cd81eeee15a1 # v16 with: name: spool @@ -671,14 +682,14 @@ jobs: done exit 1 - - name: Build macOS app + # Hosted macOS runners can hang submitting MoltenVK work to the + # paravirtualized Metal GPU. Exercise the GUI with macOS OpenGL and + # verify the packaged Vulkan loader separately below. + - name: Compile macOS app and tests + id: macos-build env: + DEPLOY_APP: '0' SPOOL_MACOS_CREDENTIAL_SERVICE: ${{ inputs.enable_macos_signing && 'com.sachk.spool' || '' }} - # Hosted macOS runners expose Apple's paravirtualized Metal GPU, where - # MoltenVK vkQueueSubmit hangs (kIOGPUCommandBufferCallbackErrorHang). - # Keep the shipped Spool.app unchanged (Vulkan default + bundled - # MoltenVK, verified by the runtime load step below) and run the - # hosted e2e suite on real macOS OpenGL, matching the Windows CI gate. SPOOL_TEST_RENDER_BACKEND: opengl run: nix develop .#native --no-write-lock-file -c bash tools/build-macos.sh @@ -691,6 +702,13 @@ jobs: - name: Lint compiled QML run: nix develop .#native --no-write-lock-file -c cmake --build build/macos/app --target spool_qmllint_strict + - name: Deploy and verify macOS bundle + if: ${{ !cancelled() && steps.macos-build.outcome == 'success' }} + env: + SPOOL_MACOS_CREDENTIAL_SERVICE: ${{ inputs.enable_macos_signing && 'com.sachk.spool' || '' }} + SPOOL_TEST_RENDER_BACKEND: opengl + run: nix develop .#native --no-write-lock-file -c bash tools/build-macos.sh + - name: Load bundled Vulkan runtime run: | python3 - <<'PY' @@ -807,6 +825,7 @@ jobs: build/macos/app/*-results.json.*.log build/macos/app/test-phases.json build/macos/app/Testing/Temporary/LastTest.log + build/macos/app/test-artifacts/app-journey-*/frame.png if-no-files-found: warn retention-days: 7 @@ -1280,6 +1299,33 @@ jobs: key: ${{ steps.android-cache.outputs.cache-primary-key }} + - name: Fetch pinned libplacebo for Android host controller + if: matrix.abi == 'x86_64' + timeout-minutes: 10 + shell: bash + run: | + set -euo pipefail + source_url="$(jq -er '.nodes["libplacebo-src"].locked + | select(.type == "git" and .submodules == true) + | "git+\(.url)?rev=\(.rev)&submodules=1"' flake.lock)" + expected_hash="$(jq -er '.nodes["libplacebo-src"].locked.narHash' flake.lock)" + log="$RUNNER_TEMP/android-libplacebo-fetch.log" + for attempt in 1 2 3; do + if result="$(nix flake prefetch --json "$source_url" 2>"$log")"; then + test "$(jq -er .hash <<<"$result")" = "$expected_hash" + exit + fi + cat "$log" >&2 + if ! grep -Eiq 'Failed to connect|Could not resolve host|Connection (timed out|reset)|HTTP error (502|503|504)' "$log"; then + exit 1 + fi + if (( attempt == 3 )); then + echo 'Pinned libplacebo fetch exhausted retries after a transient connection failure.' + exit 1 + fi + sleep "$((attempt * 10))" + done + - name: Build native host controller for Android application journeys if: matrix.abi == 'x86_64' run: nix develop .#native -c bash tools/build-linux-release.sh @@ -1450,6 +1496,8 @@ jobs: with: persist-credentials: false submodules: recursive + # The Windows libmpv source mirror needs the upstream release ancestry. + fetch-depth: 0 - name: Install upstream FFmpeg build environment id: msys2 diff --git a/.github/workflows/ios-review.yml b/.github/workflows/ios-review.yml index 8cc2cbf3..aed49a18 100644 --- a/.github/workflows/ios-review.yml +++ b/.github/workflows/ios-review.yml @@ -75,6 +75,9 @@ jobs: with: nix_conf: | experimental-features = nix-command flakes + - name: Install Cachix from the Intel macOS pin + if: matrix.sdk == 'iphonesimulator' + run: bash tools/install-intel-darwin-cachix.sh - uses: cachix/cachix-action@3ba601ff5bbb07c7220846facfa2cd81eeee15a1 if: matrix.sdk == 'iphonesimulator' with: @@ -129,6 +132,7 @@ jobs: build/ios/smoke/safe-export build/ios/smoke/launch-result.json build/ios/smoke/simulator.png + build/ios/smoke/simulator-boot-*.log if-no-files-found: warn retention-days: 7 - name: Document unsigned artifact boundary diff --git a/.github/workflows/retry-artifact-setup.yml b/.github/workflows/retry-artifact-setup.yml new file mode 100644 index 00000000..b92e4df6 --- /dev/null +++ b/.github/workflows/retry-artifact-setup.yml @@ -0,0 +1,54 @@ +name: Retry transient artifact setup + +on: + workflow_run: + workflows: [build artifacts] + types: [completed] + +permissions: + actions: write + +concurrency: + group: retry-artifact-setup-${{ github.event.workflow_run.id }} + cancel-in-progress: false + +jobs: + retry: + if: >- + github.event.workflow_run.conclusion == 'failure' && + github.event.workflow_run.run_attempt == 1 && + github.event.workflow_run.head_repository.full_name == github.repository && + contains(fromJSON('["push","pull_request"]'), github.event.workflow_run.event) + runs-on: ubuntu-24.04 + env: + GH_TOKEN: ${{ github.token }} + GH_REPO: ${{ github.repository }} + RUN_ID: ${{ github.event.workflow_run.id }} + steps: + - name: Rerun failed jobs only for allowlisted setup failures + shell: bash + run: | + set -euo pipefail + endpoint="repos/$GH_REPO/actions/runs/$RUN_ID" + # Compare the current attempt again so a queued retry cannot ignore a + # rerun already started manually. Use only GitHub job metadata and logs. + gh api "$endpoint" | jq -e '.run_attempt == 1 and .conclusion == "failure"' >/dev/null || exit 0 + jobs="$(gh api --paginate --slurp "$endpoint/attempts/1/jobs?per_page=100")" + jq -e ' + [.[].jobs[]] as $jobs + | [$jobs[] | select(.conclusion == "failure")] as $failed + | ($failed | length) > 0 + and all($jobs[]; .conclusion == "success" or .conclusion == "skipped" or .conclusion == "failure") + and all($failed[]; + .name == "Android x86_64 APK" + and [.steps[] | select(.conclusion == "failure") | .name] + == ["Fetch pinned libplacebo for Android host controller"]) + ' <<<"$jobs" >/dev/null || exit 0 + + while read -r job_id; do + log="$RUNNER_TEMP/first-attempt-$job_id.log" + gh api --allow-escape-sequences "repos/$GH_REPO/actions/jobs/$job_id/logs" >"$log" + grep -Eq '^.*[0-9]Z Pinned libplacebo fetch exhausted retries after a transient connection failure\.$' "$log" || exit 0 + done < <(jq -r '.[].jobs[] | select(.conclusion == "failure") | .id' <<<"$jobs") + + gh api --method POST "$endpoint/rerun-failed-jobs" diff --git a/qml/pages/ItemDetailsPage.qml b/qml/pages/ItemDetailsPage.qml index c36a174f..830066aa 100644 --- a/qml/pages/ItemDetailsPage.qml +++ b/qml/pages/ItemDetailsPage.qml @@ -2013,6 +2013,7 @@ FocusScope { MediaRow { id: similarRowItem + objectName: "detailSimilarRow" anchors.left: parent.left anchors.right: parent.right anchors.leftMargin: root.contentMargin diff --git a/qml/pages/PlayerOverlayChrome.qml b/qml/pages/PlayerOverlayChrome.qml index 893b37c2..ef53d19e 100644 --- a/qml/pages/PlayerOverlayChrome.qml +++ b/qml/pages/PlayerOverlayChrome.qml @@ -460,6 +460,7 @@ Item { Surface { id: menuPanel + objectName: "playerOptionMenu" width: Math.min(parent.width - root.dp(32), root.dp(menuDialog.dropdown ? 340 : 660)) height: Math.min(parent.height - root.dp(64), menuBody.implicitHeight + menuBody.anchors.margins * 2) // Centre on the button rather than hanging off the screen edge, diff --git a/qml/pages/PlayerTransportBar.qml b/qml/pages/PlayerTransportBar.qml index ef50b483..5581c819 100644 --- a/qml/pages/PlayerTransportBar.qml +++ b/qml/pages/PlayerTransportBar.qml @@ -18,6 +18,7 @@ RowLayout { component ActionTarget: Rectangle { required property string action + objectName: action === "debug" ? "playerSettingsButton" : "" readonly property int globalIndex: root.overlay.actions.indexOf(action) readonly property bool focused: root.overlay.isControlsActive() && root.overlay.focusZone === "actions" && root.overlay.actionIndex === globalIndex diff --git a/qml/primitives/MediaRow.qml b/qml/primitives/MediaRow.qml index 2df27057..d8064660 100644 --- a/qml/primitives/MediaRow.qml +++ b/qml/primitives/MediaRow.qml @@ -21,6 +21,7 @@ FocusScope { property int cardWidth: Metrics.scaled(156) property int cardGap: Metrics.scaled(16) property int currentIndex: 0 + readonly property Item automationCurrentCard: currentCard() property bool enabledRow: true property bool reserveWhenEmpty: false property bool loading: false diff --git a/src/platform/NativeAppWindow.h b/src/platform/NativeAppWindow.h index 07d41355..0e57330e 100644 --- a/src/platform/NativeAppWindow.h +++ b/src/platform/NativeAppWindow.h @@ -118,11 +118,22 @@ class NativeAppWindow final : public QQuickView { const bool preview = name == QStringLiteral("playerTrickplayPreview"); const bool texture = name == QStringLiteral("playerTrickplayTexture"); const bool seekBar = name == QStringLiteral("playerSeekBar"); + const bool playerSettings = name == QStringLiteral("playerSettingsButton"); + const bool playerOptions = name == QStringLiteral("playerOptionMenu"); + const bool relatedRow = name == QStringLiteral("detailSimilarRow"); const bool libraryRow = name == QStringLiteral("libraryMediaRow"); const bool libraryMenu = name == QStringLiteral("libraryContextMenuPanel"); const bool showHidden = name == QStringLiteral("showHiddenLibrariesButton"); - if ((preview || texture || seekBar || libraryRow || libraryMenu || showHidden) && item->isVisible()) { - const QRectF geometry = item->mapRectToScene(item->boundingRect()); + if ((preview || texture || seekBar || playerSettings || playerOptions || relatedRow || libraryRow + || libraryMenu || showHidden) + && item->isVisible()) { + QRectF geometry = item->mapRectToScene(item->boundingRect()); + if (relatedRow) { + auto *card = item->property("automationCurrentCard").value(); + geometry = card && card->isVisible() + ? card->mapRectToScene(card->boundingRect()).intersected(geometry) + : QRectF {}; + } QVariantMap state { { QStringLiteral("x"), geometry.x() }, { QStringLiteral("y"), geometry.y() }, { QStringLiteral("width"), geometry.width() }, { QStringLiteral("height"), geometry.height() } }; if (preview) { @@ -142,6 +153,9 @@ class NativeAppWindow final : public QQuickView { : libraryRow ? QStringLiteral("libraryRow") : libraryMenu ? QStringLiteral("libraryMenu") : showHidden ? QStringLiteral("showHiddenLibraries") + : playerSettings ? QStringLiteral("playerSettings") + : playerOptions ? QStringLiteral("playerOptions") + : relatedRow ? QStringLiteral("relatedCard") : QStringLiteral("seekBar"); result.insert(key, state); } diff --git a/src/platform/android/AndroidPlaybackSurface.cpp b/src/platform/android/AndroidPlaybackSurface.cpp index 4648eef7..ac9b88a3 100644 --- a/src/platform/android/AndroidPlaybackSurface.cpp +++ b/src/platform/android/AndroidPlaybackSurface.cpp @@ -12,6 +12,7 @@ #include #include #include +#include #include #include @@ -138,12 +139,15 @@ bool platformUsesEmbeddedVideo(const PlaybackSession& session, bool directReques if (stream.type.compare(QLatin1String("video"), Qt::CaseInsensitive) != 0) continue; const QString mime = mediaCodecMime(stream.codec); - if (mime.isEmpty() || hasHardwareDecoder(mime)) + if (!mime.isEmpty() && hasHardwareDecoder(mime)) return false; - qInfo() << "playback surface: no hardware decoder for" << stream.codec << "- rendering through the GPU path"; + qInfo() << "playback surface: no supported hardware decoder; rendering through the GPU path"; return true; } - return false; + // Local and downloaded files can lack stream metadata. The rendered path + // still tries MediaCodec copy-back and can fall back to a software decoder. + const QUrl source(session.url); + return source.isLocalFile() || source.scheme() == QLatin1String("content"); } QString platformPlaybackBackendName(bool embeddedVideo) diff --git a/src/player/MpvVideoItem.cpp b/src/player/MpvVideoItem.cpp index 4ea2c984..05436a6d 100644 --- a/src/player/MpvVideoItem.cpp +++ b/src/player/MpvVideoItem.cpp @@ -298,6 +298,14 @@ namespace { // default OpenGL state before every render pass. QQuickOpenGLUtils::resetOpenGLState(); fbo->bind(); +#ifdef Q_OS_ANDROID + // The emulator's GLES translator can leave error flags after Qt + // restores state. libplacebo checks the shared context's error + // queue at frame start and would discard that frame. + auto *functions = QOpenGLContext::currentContext()->functions(); + for (int i = 0; i < 8 && functions->glGetError() != GL_NO_ERROR; ++i) { + } +#endif mpv_opengl_fbo mpfbo {}; mpfbo.fbo = static_cast(fbo->handle()); diff --git a/src/player/PlayerController.cpp b/src/player/PlayerController.cpp index d3d60270..f17b42f4 100644 --- a/src/player/PlayerController.cpp +++ b/src/player/PlayerController.cpp @@ -166,6 +166,7 @@ namespace { return mpv_set_property_async(handle, replyId, "curl-transport-control", MPV_FORMAT_NODE, &control); } constexpr uint64_t kCacheSpeedReply = 0x6375726c73706565ULL; + constexpr uint64_t kPauseSetReply = 0x7073000000000000ULL; constexpr uint64_t kFullscreenSetReply = 0x6673000000000000ULL; constexpr uint64_t kFullscreenObservation = 0x666f000000000000ULL; constexpr uint64_t kFullscreenReplyMask = 0xffff000000000000ULL; @@ -2082,15 +2083,18 @@ void PlayerController::togglePause() void PlayerController::setPaused(bool paused) { qInfo() << "player: pause requested" << paused; - if (!m_mpvLifecycle.handle() && m_sessionActive) { - if (m_paused != paused) { + if (!m_mpvLifecycle.handle()) { + if (m_sessionActive && m_paused != paused) { m_paused = paused; notifyPlaybackStateChanged(); } return; } - mpvCommand({ QByteArrayLiteral("no-osd"), QByteArrayLiteral("set"), QByteArrayLiteral("pause"), - paused ? QByteArrayLiteral("yes") : QByteArrayLiteral("no") }); + int pauseFlag = paused; + const int error + = mpv_set_property_async(m_mpvLifecycle.handle(), kPauseSetReply, "pause", MPV_FORMAT_FLAG, &pauseFlag); + if (error < 0) + qWarning() << "player: could not queue pause property update:" << mpv_error_string(error); } void PlayerController::prepareForBackground() @@ -3216,6 +3220,11 @@ void PlayerController::handleMpvEvent(mpv_event *event, quint64 generation, mpv_ }); break; case MPV_EVENT_SET_PROPERTY_REPLY: { + if (event->reply_userdata == kPauseSetReply) { + if (event->error < 0) + qWarning() << "player: pause property update failed:" << mpv_error_string(event->error); + break; + } if ((event->reply_userdata & kFullscreenReplyMask) == kTransportConfigureReply) { const quint64 serial = event->reply_userdata & kFullscreenSerialMask; const int error = event->error; diff --git a/tests/e2e/AppJourneyTest.cpp b/tests/e2e/AppJourneyTest.cpp index 2d11c4e0..0b5506ca 100644 --- a/tests/e2e/AppJourneyTest.cpp +++ b/tests/e2e/AppJourneyTest.cpp @@ -468,7 +468,7 @@ class DeviceSession final { QDateTime launchTime; qint64 deviceLaunchEpoch = 0; }; -enum class TextSurface { Window, LibraryRow }; +enum class TextSurface { Window, LibraryRow, RelatedCard, PlayerOptions }; enum class TextPreprocess { Original, Neutral, Inverse, SmoothInverse, NeutralAdaptive, Positive, Adaptive }; struct Words { QString text; @@ -539,7 +539,7 @@ class Journey final { "Spool did not initialize an exposed GPU window", 60000); } QJsonObject command(const QStringList& args, const QByteArray& input = {}, bool required = true, - const QString& descriptorOverride = {}, QJsonObject *envelope = nullptr) + const QString& descriptorOverride = {}, QJsonObject *envelope = nullptr, bool observeAfterTimeout = false) { ensureRunning(); QProcess process; @@ -572,6 +572,9 @@ class Journey final { device->propagateObservedCrash(); if (envelope) *envelope = response; + if (observeAfterTimeout && transportCode == "timeout" + && response["error"].toObject()["message"] == "Instance did not complete command in time") + return {}; if (required && (process.exitStatus() != QProcess::NormalExit || process.exitCode() != 0 || !response["ok"].toBool())) { const QString code = response["error"].toObject()["code"].toString(); @@ -641,9 +644,9 @@ class Journey final { require(command({ "text", "--stdin" }, value.toUtf8())["accepted"].toBool(), "focused editable field did not accept production IME input"); } - QJsonObject state() + QJsonObject state(bool observeAfterTimeout = false) { - return command({ "state" }); + return command({ "state" }, {}, true, {}, nullptr, observeAfterTimeout); } QImage capture(bool video = false) { @@ -1131,24 +1134,32 @@ class Journey final { const QImage frame = capture(); QString imagePath = screenshotPath; QRect region; - if (surface == TextSurface::LibraryRow) { - const auto row = capturedState["visual"].toObject()["libraryRow"].toObject(); + if (surface != TextSurface::Window) { + const QString key = surface == TextSurface::LibraryRow ? QStringLiteral("libraryRow") + : surface == TextSurface::RelatedCard ? QStringLiteral("relatedCard") + : QStringLiteral("playerOptions"); + const auto row = capturedState["visual"].toObject()[key].toObject(); const double ratio = capturedState["window"].toObject()["devicePixelRatio"].toDouble(1); region = QRectF(row["x"].toDouble() * ratio, row["y"].toDouble() * ratio, row["width"].toDouble() * ratio, row["height"].toDouble() * ratio) .toAlignedRect() .intersected(frame.rect()); - if (region.isEmpty()) + if (region.isEmpty()) { + if (scroll) + command({ "key", "down" }); return false; - imagePath = libraryTextPath(); + } + imagePath = surface == TextSurface::LibraryRow + ? libraryTextPath() + : screenshotPath + QStringLiteral(".caption.png"); QSaveFile file(imagePath); require(file.open(QIODevice::WriteOnly) && file.setPermissions(QFileDevice::ReadOwner | QFileDevice::WriteOwner) && frame.copy(region).save(&file, "PNG") && file.commit(), - "actual rendered library row could not be read for caption navigation"); + "actual rendered region could not be read for caption navigation"); } const QList primaryLines - = words(imagePath, surface == TextSurface::LibraryRow ? 6 : 11, region.topLeft()); + = words(imagePath, surface == TextSurface::Window ? 11 : 6, region.topLeft()); lastObserved = summarize(primaryLines); QRect candidate = locate(primaryLines); // Sparse-page segmentation can omit text touching a focus outline. @@ -1188,7 +1199,7 @@ class Journey final { if (candidate.isEmpty()) candidate = locate(words(imagePath, 3, region.topLeft(), TextPreprocess::Adaptive)); if (!candidate.isEmpty()) { - if (surface == TextSurface::Window + if (surface != TextSurface::LibraryRow || (!previous.isEmpty() && (candidate.center() - previous.center()).manhattanLength() <= 2 && std::abs(candidate.width() - previous.width()) <= 2 && std::abs(candidate.height() - previous.height()) <= 2)) { @@ -1211,9 +1222,9 @@ class Journey final { } return found; } - void click(const QString& text, bool scroll = false, bool right = false) + void click(const QString& text, bool scroll = false, bool right = false, TextSurface surface = TextSurface::Window) { - tap(label(text, scroll), right); + tap(label(text, scroll, surface), right); } void openLibrary(const QString& title) { @@ -1227,9 +1238,25 @@ class Journey final { } void openPlaybackSettings() { - // Navigate the actual transport, including on TV/mobile where there - // is no desktop shortcut. Up saturates at Back; Down reaches the - // timeline and then the actions. Right saturates at Playback settings. + if (qEnvironmentVariable("SPOOL_E2E_ANDROID_TV") == "1") { + // Use the real on-screen gear after revealing the controls. + QRect button; + await( + [&] { + const auto observed = command({ "key", "up" }); + const auto bounds = observed["visual"].toObject()["playerSettings"].toObject(); + const double ratio = observed["window"].toObject()["devicePixelRatio"].toDouble(1); + button = QRectF(bounds["x"].toDouble() * ratio, bounds["y"].toDouble() * ratio, + bounds["width"].toDouble() * ratio, bounds["height"].toDouble() * ratio) + .toAlignedRect(); + return !button.isEmpty(); + }, + "Android TV transport controls did not reveal the Playback settings button"); + tap(button); + return; + } + // Up saturates at Back, Down reaches the timeline and the actions, + // and Right saturates at Playback settings. for (int step = 0; step < 3; ++step) command({ "key", "up" }); command({ "key", "down" }); @@ -1619,7 +1646,7 @@ SPOOL_TEST_MAIN("app-journey") fixturePhase = QStringLiteral("nested-details-return"); const int nestedDetailsBefore = fixture.episodeDetailResponses; journey.label("More Like This", true); - journey.click("Journey Series", true); + journey.click("Journey Series", true, false, TextSurface::RelatedCard); journey.await([&] { return fixture.episodeDetailResponses > nestedDetailsBefore; }, "related-item activation did not fetch the selected episode through the real provider"); journey.label("Journey Episode"); @@ -2003,7 +2030,13 @@ SPOOL_TEST_MAIN("app-journey") .toStdString()); } journey.command({ "stop" }); - journey.await([&] { return !journey.state()["playback"].toObject()["active"].toBool(); }, + journey.await( + [&] { + // A dropped read during handoff is not a stopped player. + // Keep polling for an explicit inactive state within await's deadline. + const auto playback = journey.state(true)["playback"].toObject(); + return playback["active"].isBool() && !playback["active"].toBool(); + }, "remote episode did not stop before explicit restart"); journey.label("Start from beginning"); const qsizetype reportsBeforeRestart = fixture.reports.size(); @@ -2046,8 +2079,8 @@ SPOOL_TEST_MAIN("app-journey") // QML -> application queue -> mpv -> production provider reporting. fixturePhase = QStringLiteral("repeat-current-eof"); journey.openPlaybackSettings(); - journey.click("Repeat"); - journey.click("Repeat current item"); + journey.click("Repeat", false, false, TextSurface::PlayerOptions); + journey.click("Repeat current item", false, false, TextSurface::PlayerOptions); const qsizetype reportsBeforeRepeat = fixture.reports.size(); const int negotiationsBeforeRepeat = fixture.playbackNegotiations; journey.command({ "seek", "88" }); diff --git a/tests/player/MpvVideoItemTest.cpp b/tests/player/MpvVideoItemTest.cpp index f8404fed..83239851 100644 --- a/tests/player/MpvVideoItemTest.cpp +++ b/tests/player/MpvVideoItemTest.cpp @@ -416,7 +416,11 @@ SPOOL_TEST_MAIN("mpv-video-item") videoItem.setMpvHandle(handle); if (!videoItem.waitForRenderContext()) { std::fprintf(stderr, "render context was not ready before media load\n"); - mpv_terminate_destroy(handle); + const QImage frame = captureItem(); + if (!frame.isNull()) + frame.save(QDir::tempPath() + QStringLiteral("/mpv-video-item-failure.png")); + if (videoItem.releaseMpvHandle()) + mpv_terminate_destroy(handle); return 1; } @@ -547,7 +551,8 @@ SPOOL_TEST_MAIN("mpv-video-item") return 0; } -#if !defined(Q_OS_TVOS) && !defined(Q_OS_ANDROID) && !defined(SPOOL_TEST_OPENGL_ONLY) +// Apple mobile and Android use the OpenGL framebuffer item. +#if SPOOL_MPV_ITEM_RHI && !defined(SPOOL_TEST_OPENGL_ONLY) namespace { int vulkanEntry(int argc, char **argv) diff --git a/tests/qml/tst_ProviderForms.qml b/tests/qml/tst_ProviderForms.qml index 9cdce83f..e0db1369 100644 --- a/tests/qml/tst_ProviderForms.qml +++ b/tests/qml/tst_ProviderForms.qml @@ -262,9 +262,11 @@ TestCase { const password = accessibleItem(view, "Password") verify(username) verify(password) + tryVerify(() => username.activeFocus || username.parent.activeFocus) username.text = "member" password.text = "incorrect" password.forceActiveFocus() + tryVerify(() => password.activeFocus) keyClick(Qt.Key_Return) tryVerify(() => provider.pendingAuthenticationRejection !== null) provider.pendingAuthenticationRejection("invalid_credentials") diff --git a/tools/apple/smoke-tvos.sh b/tools/apple/smoke-tvos.sh index faa0df0e..40d326b4 100755 --- a/tools/apple/smoke-tvos.sh +++ b/tools/apple/smoke-tvos.sh @@ -30,11 +30,44 @@ result="$ROOT/build/$platform/smoke" mkdir -p "$result" runtime="$(xcrun simctl list runtimes --json | python3 -c 'import json,sys; r=[x for x in json.load(sys.stdin)["runtimes"] if x["isAvailable"] and x["identifier"].startswith("com.apple.CoreSimulator.SimRuntime."+sys.argv[1])]; print(sorted(r,key=lambda x:tuple(map(int,x["version"].split("."))))[-1]["identifier"])' "$runtime_name")" device_type="$(xcrun simctl list devicetypes --json | python3 -c 'import json,sys; print(next(x["identifier"] for x in json.load(sys.stdin)["devicetypes"] if x["name"].startswith(sys.argv[1])))' "$device_name")" -device="$(xcrun simctl create "Spool-$platform-tests" "$device_type" "$runtime")" -cleanup() { xcrun simctl shutdown "$device" >/dev/null 2>&1 || true; xcrun simctl delete "$device"; } +device= +cleanup() { + if [[ -n "$device" ]]; then + xcrun simctl shutdown "$device" >/dev/null 2>&1 || true + xcrun simctl delete "$device" + fi +} trap cleanup EXIT -xcrun simctl boot "$device" -xcrun simctl bootstatus "$device" -b +for attempt in 1 2; do + device="$(xcrun simctl create "Spool-$platform-tests" "$device_type" "$runtime")" + setup_log="$result/simulator-boot-$attempt.log" + if python3 - "$device" >"$setup_log" 2>&1 <<'PYTHON' +import subprocess +import sys + +device = sys.argv[1] +try: + subprocess.run(["xcrun", "simctl", "boot", device], check=True, timeout=120) + subprocess.run(["xcrun", "simctl", "bootstatus", device, "-b"], check=True, timeout=480) +except subprocess.TimeoutExpired: + print("Simulator boot timed out", flush=True) + sys.exit(75) +except subprocess.CalledProcessError: + sys.exit(1) +PYTHON + then + cat "$setup_log" + break + else + setup_status=$? + cat "$setup_log" >&2 + if [[ "$setup_status" != 75 || "$attempt" == 2 ]]; then + exit "$setup_status" + fi + cleanup + device= + fi +done export SPOOL_TVOS_DEVICE="$device" # Install the real product and both unified native selector bundles. Application # and Keychain entitlements stay embedded by the simulator linker; the local diff --git a/tools/build-macos.sh b/tools/build-macos.sh index 0d7da2bb..e0ef7dfe 100755 --- a/tools/build-macos.sh +++ b/tools/build-macos.sh @@ -99,7 +99,7 @@ if [[ "$DEPLOY_APP" == "1" ]]; then "$APP_BUILD/build.ninja" \ "$BUILD_ROOT/qt-tools-shadow" \ "$(command -v macdeployqt)")" - "$macdeployqt_shadow" "$APP_BUNDLE" -qmldir="$APP_ROOT/qml" -no-strip \ + "$macdeployqt_shadow" "$APP_BUNDLE" -qmldir="$APP_ROOT/qml" -no-strip -no-codesign \ -executable="$frameworks/libvulkan.1.dylib" \ -executable="$frameworks/libMoltenVK.dylib" @@ -243,6 +243,23 @@ if [[ "$DEPLOY_APP" == "1" ]]; then chmod u+w "$binary" "$strip_bin" -S -x "$binary" done < <(find "$APP_BUNDLE" -type f | sort) + # Sign after install_name_tool and strip have finished rewriting Mach-O files. + while IFS= read -r binary; do + # Signing Spool's executable also signs its enclosing app. Do that last. + [[ "$binary" == "$APP_BUNDLE/Contents/MacOS/Spool" ]] && continue + description="$(/usr/bin/file -b "$binary")" + [[ "$binary" == *.dylib || "$description" == *Mach-O* ]] || continue + /usr/bin/codesign --force --sign - --timestamp=none "$binary" + done < <(find "$APP_BUNDLE" -type f | sort) + cocoa_plugin="$APP_BUNDLE/Contents/PlugIns/platforms/libqcocoa.dylib" + /usr/bin/codesign --verify --strict --verbose=2 "$cocoa_plugin" + while IFS= read -r bundle; do + [[ "$bundle" == "$APP_BUNDLE" ]] && continue + /usr/bin/codesign --force --sign - --timestamp=none "$bundle" + done < <(find "$APP_BUNDLE" -depth -type d \ + \( -name '*.framework' -o -name '*.app' -o -name '*.xpc' \)) + /usr/bin/codesign --force --sign - --timestamp=none "$APP_BUNDLE" + /usr/bin/codesign --verify --strict --deep --verbose=2 "$APP_BUNDLE" python3 "$APP_ROOT/tools/package-audit.py" macho "$APP_BUNDLE" \ --root Contents/Frameworks/libvulkan.1.dylib \ --root Contents/Frameworks/libMoltenVK.dylib diff --git a/tools/install-intel-darwin-cachix.sh b/tools/install-intel-darwin-cachix.sh new file mode 100755 index 00000000..adc8c6d6 --- /dev/null +++ b/tools/install-intel-darwin-cachix.sh @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +set -euo pipefail + +root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" +# The default Cachix installer follows a nixpkgs release that has dropped +# x86_64-darwin. Resolve the client from the same lock as the native shell. +url="$(python3 - "$root/flake.lock" <<'PY' +import json +import sys + +with open(sys.argv[1], encoding="utf-8") as source: + pin = json.load(source)["nodes"]["nixpkgs-x86-darwin"]["locked"] +print(f"github:{pin['owner']}/{pin['repo']}/{pin['rev']}") +PY +)" +cachix="$(nix build --no-link --print-out-paths "$url#cachix")" +test -x "$cachix/bin/cachix" +printf '%s\n' "$cachix/bin" >>"${GITHUB_PATH:?GITHUB_PATH is required}" diff --git a/tools/run-device-tests.py b/tools/run-device-tests.py index a3fa47c9..403bc998 100755 --- a/tools/run-device-tests.py +++ b/tools/run-device-tests.py @@ -1292,6 +1292,18 @@ def write_journal(path, value): temporary.replace(path) +def apple_selector_setup(phase): + for attempt in range(2): + try: + return TvOS(phase) + except subprocess.TimeoutExpired as error: + # Initial installed-bundle lookups can stall after a slow boot. + # No test selector has started, so a fresh lookup is safe. + if attempt or error.cmd[:3] != ["xcrun", "simctl", "get_app_container"]: + raise + print("Apple selector setup: simctl get_app_container timed out; retrying once", flush=True) + + def main(): parser = argparse.ArgumentParser(description=__doc__) parser.add_argument("--platform", choices=("android", "tvos", "ios"), required=True) @@ -1312,7 +1324,7 @@ def main(): output.mkdir(parents=True, exist_ok=True) suffix = f"-cleanup-{args.cleanup_regression}" if args.cleanup_regression else "" state_path = output / f"{args.phase}{suffix}-result.json" - device = Android(args.phase) if args.platform == "android" else TvOS(args.phase) + device = Android(args.phase) if args.platform == "android" else apple_selector_setup(args.phase) if args.cleanup_regression: names = [f"app-journey-cleanup-{args.cleanup_regression}"] else: @@ -1438,5 +1450,11 @@ def persist(): try: raise SystemExit(main()) except (OSError, ValueError, RuntimeError, subprocess.SubprocessError) as error: - print(f"device test infrastructure failed: {type(error).__name__}", flush=True) + stage = "" + if isinstance(error, subprocess.TimeoutExpired) and isinstance(error.cmd, list): + if error.cmd[:3] in (["xcrun", "simctl", "launch"], ["xcrun", "simctl", "get_app_container"]): + stage = f" (simctl {error.cmd[2]})" + elif error.cmd[:2] == ["xcrun", "dwarfdump"]: + stage = " (selector binary identity)" + print(f"device test infrastructure failed: {type(error).__name__}{stage}", flush=True) raise SystemExit(1) diff --git a/tools/windows/build-mpv.ps1 b/tools/windows/build-mpv.ps1 index e223ac49..b2e56758 100644 --- a/tools/windows/build-mpv.ps1 +++ b/tools/windows/build-mpv.ps1 @@ -52,6 +52,13 @@ if (-not (Test-Path -LiteralPath $buildSource)) { Copy-Item -Destination $buildSource -Recurse -Force Write-MpvRevisionStamp -Directory $buildSource -Revision $sourceRevision } +# Meson falls back to MPV_VERSION in the mirror, which has no Git metadata. +# Keep the proven upstream release base and identify the fork build explicitly. +$mirrorVersion = Get-MpvMirrorVersion -Source $source +$mirrorVersionPath = Join-Path $buildSource 'MPV_VERSION' +if ((Get-Content -LiteralPath $mirrorVersionPath -Raw).Trim() -cne $mirrorVersion) { + [IO.File]::WriteAllText($mirrorVersionPath, "$mirrorVersion`n", [Text.UTF8Encoding]::new($false)) +} New-Item -ItemType Directory -Force $packageCache | Out-Null $env:MESON_PACKAGE_CACHE_DIR = $packageCache diff --git a/tools/windows/common.ps1 b/tools/windows/common.ps1 index 389e383a..93c60182 100644 --- a/tools/windows/common.ps1 +++ b/tools/windows/common.ps1 @@ -278,6 +278,33 @@ function Initialize-WindowsMpvBuildEnvironment { $env:WINDRES = 'llvm-rc' } +function Get-MpvMirrorVersion { + param([Parameter(Mandatory)] [string] $Source) + + # Peeled upstream v0.42.0 tag. + $releaseVersion = '0.42.0' + $releaseCommit = 'b0841e8c4d156b8403dc1876c4cbd9011eb583f3' + $version = (Get-Content -LiteralPath (Join-Path $Source 'MPV_VERSION') -Raw).Trim() + if ($version -ne "$releaseVersion-UNKNOWN") { + return $version + } + # Only use an upstream release as the version base when it is in the + # source history. A shallow or divergent checkout keeps its source version. + & git -C $Source merge-base --is-ancestor $releaseCommit HEAD 2>$null + if ($LASTEXITCODE -ne 0) { + return $version + } + & git -C $Source diff --quiet HEAD -- + if ($LASTEXITCODE -ne 0) { + return $version + } + $revision = & git -C $Source rev-parse --short=12 HEAD + if ($LASTEXITCODE -ne 0 -or $revision -notmatch '^[0-9a-f]{12,40}$') { + throw 'Cannot read the revision for the libmpv version resource.' + } + return "$releaseVersion+spool.$revision" +} + function Get-MpvFeatureArguments { param( [Parameter(Mandatory)] [string] $Platform, From 285b17c279f916fb95c43afac51d63a80d7fe4df Mon Sep 17 00:00:00 2001 From: Sacha Korban Date: Fri, 27 Nov 2026 02:50:05 +1100 Subject: [PATCH 11/39] fix(playback): synchronize pause state and validate simulator journey controls Consolidate the release milestone ending at 2d08aa6ad7795701f23a1407e5573953259fe673. Original starting snapshot: 163ed1ebc012accf203466dbe2149750b4318b61. --- .github/workflows/build-artifacts.yml | 6 +- .github/workflows/ios-review.yml | 5 +- CMakeLists.txt | 10 +- qml/pages/PlayerOverlayChrome.qml | 6 + qml/primitives/MenuRow.qml | 6 +- src/automation/LocalCommandServer.cpp | 4 +- src/platform/NativeAppWindow.h | 13 +- src/player/PlayerController.cpp | 118 ++++++++---- src/player/PlayerController.h | 14 ++ tests/app/DownloadManagerTest.cpp | 31 +++- tests/e2e/AppJourneyTest.cpp | 243 ++++++++++++++++++------- tests/e2e/JellyfinFixture.cpp | 3 + tests/e2e/JellyfinFixture.h | 2 + tests/e2e/host/CMakeLists.txt | 19 ++ tests/player/PlayerControllerTest.cpp | 4 + tests/providers/SourceHubSpeedTest.cpp | 12 +- tests/qml/tst_ProviderForms.qml | 7 +- tools/cmake/Spoolet.cmake | 8 + tools/run-device-tests.py | 17 +- tools/windows/install-build-tools.ps1 | 21 ++- 20 files changed, 426 insertions(+), 123 deletions(-) create mode 100644 tests/e2e/host/CMakeLists.txt create mode 100644 tools/cmake/Spoolet.cmake diff --git a/.github/workflows/build-artifacts.yml b/.github/workflows/build-artifacts.yml index 813976e7..17e1b8a9 100644 --- a/.github/workflows/build-artifacts.yml +++ b/.github/workflows/build-artifacts.yml @@ -920,10 +920,14 @@ jobs: skipPush: true - name: Build native host controller for tvOS application journeys if: matrix.sdk == 'appletvsimulator' - run: nix develop .#native -c env DEPLOY_APP=0 bash tools/build-macos.sh + run: | + nix develop .#native -c cmake -S tests/e2e/host -B build/apple/device-journey-host -G Ninja -DCMAKE_BUILD_TYPE=Release + nix develop .#native -c cmake --build build/apple/device-journey-host - name: Run tvOS traditional and real GPU GUI e2e tests if: matrix.sdk == 'appletvsimulator' + env: + SPOOL_DEVICE_HOST_BUILD_DIR: build/apple/device-journey-host run: bash tools/apple/smoke-tvos.sh build/tvos/appletvsimulator-arm64/install/Spool.app - name: Package artifact-audited unsigned device IPA (no device runtime claim) diff --git a/.github/workflows/ios-review.yml b/.github/workflows/ios-review.yml index aed49a18..6bbb4f68 100644 --- a/.github/workflows/ios-review.yml +++ b/.github/workflows/ios-review.yml @@ -91,11 +91,14 @@ jobs: nix flake lock --override-input nixpkgs "$url" - name: Build native host controller for iOS application journeys if: matrix.sdk == 'iphonesimulator' - run: nix develop .#native -c env DEPLOY_APP=0 bash tools/build-macos.sh + run: | + nix develop .#native -c cmake -S tests/e2e/host -B build/apple/device-journey-host -G Ninja -DCMAKE_BUILD_TYPE=Release + nix develop .#native -c cmake --build build/apple/device-journey-host - name: Run iOS traditional and real GPU GUI e2e tests if: matrix.sdk == 'iphonesimulator' env: SPOOL_TVOS_TEST_BUILD_DIR: build/apple/iphonesimulator-x86_64/app + SPOOL_DEVICE_HOST_BUILD_DIR: build/apple/device-journey-host run: bash tools/apple/smoke-ios.sh build/apple/iphonesimulator-x86_64/install/Spool.app - name: Package audited unsigned device IPA if: matrix.sdk == 'iphoneos' diff --git a/CMakeLists.txt b/CMakeLists.txt index e2e82d9a..f599caf2 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -401,15 +401,7 @@ target_sources(spool PRIVATE src/automation/LocalControlProtocol.h ) if(NOT ANDROID AND NOT SPOOL_WEBOS AND NOT SPOOL_APPLE_MOBILE) - add_executable(spoolet - src/automation/SpooletMain.cpp - src/automation/LocalControlProtocol.cpp - src/automation/LocalControlProtocol.h - ) - target_link_libraries(spoolet PRIVATE Qt6::Core Qt6::Network) - target_include_directories(spoolet PRIVATE src) - qt_add_resources(spoolet remote_discovery PREFIX "/automation" - BASE src/automation FILES src/automation/RemoteDiscovery.sh) + include(tools/cmake/Spoolet.cmake) if(UNIX AND NOT APPLE) set_target_properties(spoolet PROPERTIES INSTALL_RPATH "$ORIGIN/../lib") endif() diff --git a/qml/pages/PlayerOverlayChrome.qml b/qml/pages/PlayerOverlayChrome.qml index ef53d19e..18d4864c 100644 --- a/qml/pages/PlayerOverlayChrome.qml +++ b/qml/pages/PlayerOverlayChrome.qml @@ -461,6 +461,8 @@ Item { Surface { id: menuPanel objectName: "playerOptionMenu" + readonly property int automationRepeatFocusIndex: root.overlay.menuKind === "repeat" + ? menuList.currentIndex : -1 width: Math.min(parent.width - root.dp(32), root.dp(menuDialog.dropdown ? 340 : 660)) height: Math.min(parent.height - root.dp(64), menuBody.implicitHeight + menuBody.anchors.margins * 2) // Centre on the button rather than hanging off the screen edge, @@ -540,6 +542,10 @@ Item { width: Math.max(0, menuList.width - (menuScrollBar.visible ? menuScrollBar.width : 0)) label: root.overlay.menuLabel(modelData) detail: root.overlay.menuDetail(index) + detailObjectName: root.overlay.debugAction(index) === "repeat" ? "playerRepeatDetail" : + root.overlay.debugAction( + index) === "sleep" + ? "playerSleepDetail" : "" compact: menuDialog.dropdown || root.overlay.touchscreenControls checked: root.overlay.menuItemSelected(index) highlighted: menuList.currentIndex === index diff --git a/qml/primitives/MenuRow.qml b/qml/primitives/MenuRow.qml index 4acbd5a0..431634b1 100644 --- a/qml/primitives/MenuRow.qml +++ b/qml/primitives/MenuRow.qml @@ -9,6 +9,7 @@ Item { Component.onDestruction: InputLatency.noteDelegate("menu_row", -1) property string label: "" + property string detailObjectName: "" property string detail: "" property string iconName: "" property bool checked: false @@ -101,11 +102,12 @@ Item { elide: Text.ElideRight } SecondaryText { + objectName: root.detailObjectName Layout.fillWidth: true visible: root.detail.length > 0 text: root.detail - color: Theme.textMuted - font.pixelSize: root.compact ? Metrics.metaSizePx - 1 : Metrics.metaSizePx + Metrics.scaled(1) + color: root.actionable ? Theme.textSecondary : Theme.textMuted + font.pixelSize: root.compact ? Metrics.metaSizePx + 1 : Metrics.metaSizePx + Metrics.scaled(1) maximumLineCount: 1 elide: Text.ElideRight } diff --git a/src/automation/LocalCommandServer.cpp b/src/automation/LocalCommandServer.cpp index 09097860..5d7d3dbc 100644 --- a/src/automation/LocalCommandServer.cpp +++ b/src/automation/LocalCommandServer.cpp @@ -364,7 +364,9 @@ QJsonObject LocalCommandServer::state() const { QStringLiteral("playback"), QJsonObject { { QStringLiteral("active"), player->sessionActive() }, { QStringLiteral("loaded"), player->fileLoaded() }, { QStringLiteral("paused"), player->paused() }, - { QStringLiteral("title"), player->title() }, { QStringLiteral("position"), player->positionSeconds() }, + { QStringLiteral("ready"), player->playbackReady() }, { QStringLiteral("title"), player->title() }, + { QStringLiteral("pauseCommand"), player->pauseCommandState() }, + { QStringLiteral("position"), player->positionSeconds() }, { QStringLiteral("duration"), player->durationSeconds() }, { QStringLiteral("failed"), !player->errorText().isEmpty() }, { QStringLiteral("embeddedVideo"), player->embeddedVideoOutput() }, diff --git a/src/platform/NativeAppWindow.h b/src/platform/NativeAppWindow.h index 0e57330e..94ce2864 100644 --- a/src/platform/NativeAppWindow.h +++ b/src/platform/NativeAppWindow.h @@ -120,12 +120,14 @@ class NativeAppWindow final : public QQuickView { const bool seekBar = name == QStringLiteral("playerSeekBar"); const bool playerSettings = name == QStringLiteral("playerSettingsButton"); const bool playerOptions = name == QStringLiteral("playerOptionMenu"); + const bool playerDetail + = name == QStringLiteral("playerRepeatDetail") || name == QStringLiteral("playerSleepDetail"); const bool relatedRow = name == QStringLiteral("detailSimilarRow"); const bool libraryRow = name == QStringLiteral("libraryMediaRow"); const bool libraryMenu = name == QStringLiteral("libraryContextMenuPanel"); const bool showHidden = name == QStringLiteral("showHiddenLibrariesButton"); - if ((preview || texture || seekBar || playerSettings || playerOptions || relatedRow || libraryRow - || libraryMenu || showHidden) + if ((preview || texture || seekBar || playerSettings || playerOptions || playerDetail || relatedRow + || libraryRow || libraryMenu || showHidden) && item->isVisible()) { QRectF geometry = item->mapRectToScene(item->boundingRect()); if (relatedRow) { @@ -133,6 +135,10 @@ class NativeAppWindow final : public QQuickView { geometry = card && card->isVisible() ? card->mapRectToScene(card->boundingRect()).intersected(geometry) : QRectF {}; + } else if (playerDetail) { + const QRectF content( + 0, 0, item->property("contentWidth").toDouble(), item->property("contentHeight").toDouble()); + geometry = item->mapRectToScene(content.intersected(item->boundingRect())); } QVariantMap state { { QStringLiteral("x"), geometry.x() }, { QStringLiteral("y"), geometry.y() }, { QStringLiteral("width"), geometry.width() }, { QStringLiteral("height"), geometry.height() } }; @@ -143,6 +149,8 @@ class NativeAppWindow final : public QQuickView { } if (texture) state.insert(QStringLiteral("ready"), item->property("ready").toBool()); + if (playerOptions) + state.insert(QStringLiteral("repeatFocusIndex"), item->property("automationRepeatFocusIndex")); if (libraryRow) { state.insert(QStringLiteral("moveMode"), item->property("moveMode").toBool()); state.insert(QStringLiteral("currentIndex"), item->property("currentIndex").toInt()); @@ -155,6 +163,7 @@ class NativeAppWindow final : public QQuickView { : showHidden ? QStringLiteral("showHiddenLibraries") : playerSettings ? QStringLiteral("playerSettings") : playerOptions ? QStringLiteral("playerOptions") + : playerDetail ? name : relatedRow ? QStringLiteral("relatedCard") : QStringLiteral("seekBar"); result.insert(key, state); diff --git a/src/player/PlayerController.cpp b/src/player/PlayerController.cpp index f17b42f4..2012ca07 100644 --- a/src/player/PlayerController.cpp +++ b/src/player/PlayerController.cpp @@ -167,10 +167,11 @@ namespace { } constexpr uint64_t kCacheSpeedReply = 0x6375726c73706565ULL; constexpr uint64_t kPauseSetReply = 0x7073000000000000ULL; + constexpr uint64_t kPauseReadReply = 0x7072000000000000ULL; constexpr uint64_t kFullscreenSetReply = 0x6673000000000000ULL; constexpr uint64_t kFullscreenObservation = 0x666f000000000000ULL; - constexpr uint64_t kFullscreenReplyMask = 0xffff000000000000ULL; - constexpr uint64_t kFullscreenSerialMask = ~kFullscreenReplyMask; + constexpr uint64_t kMpvReplyKindMask = 0xffff000000000000ULL; + constexpr uint64_t kMpvReplySerialMask = ~kMpvReplyKindMask; constexpr auto kNightModeFilter = "lavfi=[pan=stereo|FL<0.5*FL+1.0*FC+0.25*BL|FR<0.5*FR+1.0*FC+0.25*BR," "dialoguenhance=original=0.25:enhance=2.0," @@ -971,7 +972,7 @@ void PlayerController::synchronizeWindowFullscreen(mpv_handle *handle) // A synchronous property write here can wait on that same render thread // until the VO's timeout, even though the native fullscreen request is fast. mpv_unobserve_property(handle, kFullscreenObservation | m_fullscreenSyncSerial); - m_fullscreenSyncSerial = (m_fullscreenSyncSerial + 1) & kFullscreenSerialMask; + m_fullscreenSyncSerial = (m_fullscreenSyncSerial + 1) & kMpvReplySerialMask; int fullscreen = m_window->fullScreen(); const int error = mpv_set_property_async( handle, kFullscreenSetReply | m_fullscreenSyncSerial, "fullscreen", MPV_FORMAT_FLAG, &fullscreen); @@ -1852,7 +1853,7 @@ void PlayerController::configureTransportForLoad(QByteArrayList loadCommand) if (!handle) return; const quint64 serial = ++m_transportReplySerial; - Q_ASSERT((serial & kFullscreenReplyMask) == 0); + Q_ASSERT((serial & kMpvReplyKindMask) == 0); const qint64 epoch = m_sessionThreadedStreaming ? ++m_transportEpoch : 0; m_pendingTransportLoads.insert(serial, { m_mpvEventGeneration, m_playGeneration, epoch, std::move(loadCommand) }); if (!m_sessionThreadedStreaming) { @@ -2077,6 +2078,8 @@ void PlayerController::togglePause() setPaused(!m_paused); return; } + m_pauseCommandSerial = (m_pauseCommandSerial + 1) & kMpvReplySerialMask; + m_pauseCommandState.clear(); mpvCommand({ QByteArrayLiteral("no-osd"), QByteArrayLiteral("cycle"), QByteArrayLiteral("pause") }); } @@ -2090,13 +2093,37 @@ void PlayerController::setPaused(bool paused) } return; } - int pauseFlag = paused; - const int error - = mpv_set_property_async(m_mpvLifecycle.handle(), kPauseSetReply, "pause", MPV_FORMAT_FLAG, &pauseFlag); + m_pauseCommandSerial = (m_pauseCommandSerial + 1) & kMpvReplySerialMask; + m_pauseCommandTarget = paused; + m_pauseCommandRetried = false; + sendMpvPauseRequest(); +} + +void PlayerController::sendMpvPauseRequest() +{ + int pauseFlag = m_pauseCommandTarget; + const int error = mpv_set_property_async( + m_mpvLifecycle.handle(), kPauseSetReply | m_pauseCommandSerial, "pause", MPV_FORMAT_FLAG, &pauseFlag); + m_pauseCommandState = error < 0 ? QStringLiteral("queue-error") + : m_pauseCommandRetried ? QStringLiteral("requeued") + : QStringLiteral("queued"); if (error < 0) qWarning() << "player: could not queue pause property update:" << mpv_error_string(error); } +void PlayerController::applyMpvPauseState(bool paused) +{ + // The idle core can report its initial pause while setup waits for the + // surface. The file-loaded event reads the actual state of the new file. + if (!m_fileLoaded || m_paused == paused) + return; + qInfo() << "player: pause state changed" << paused; + m_paused = paused; + if (!m_paused) + requestMpvPositionRefresh("unpause"); + notifyPlaybackStateChanged(); +} + void PlayerController::prepareForBackground() { if (!platformUsesBackgroundPlaybackPolicy()) @@ -3022,6 +3049,7 @@ void PlayerController::resetPlaybackUiState() emit hdrPlaybackChanged(); } m_paused = false; + m_pauseCommandState.clear(); m_buffering = false; m_bufferingPercent = 0; m_seeking = false; @@ -3220,13 +3248,25 @@ void PlayerController::handleMpvEvent(mpv_event *event, quint64 generation, mpv_ }); break; case MPV_EVENT_SET_PROPERTY_REPLY: { - if (event->reply_userdata == kPauseSetReply) { - if (event->error < 0) - qWarning() << "player: pause property update failed:" << mpv_error_string(event->error); + if ((event->reply_userdata & kMpvReplyKindMask) == kPauseSetReply) { + const auto serial = event->reply_userdata & kMpvReplySerialMask; + const int error = event->error; + postMpvEvent(generation, [this, serial, error] { + if (serial != m_pauseCommandSerial) + return; + if (error < 0) { + m_pauseCommandState = QStringLiteral("set-error"); + qWarning() << "player: pause property update failed:" << mpv_error_string(error); + return; + } + const int readError = mpv_get_property_async( + m_mpvLifecycle.handle(), kPauseReadReply | serial, "pause", MPV_FORMAT_FLAG); + m_pauseCommandState = readError < 0 ? QStringLiteral("read-queue-error") : QStringLiteral("reading"); + }); break; } - if ((event->reply_userdata & kFullscreenReplyMask) == kTransportConfigureReply) { - const quint64 serial = event->reply_userdata & kFullscreenSerialMask; + if ((event->reply_userdata & kMpvReplyKindMask) == kTransportConfigureReply) { + const quint64 serial = event->reply_userdata & kMpvReplySerialMask; const int error = event->error; postMpvEvent(generation, [this, serial, error] { const auto pending = m_pendingTransportLoads.constFind(serial); @@ -3243,9 +3283,9 @@ void PlayerController::handleMpvEvent(mpv_event *event, quint64 generation, mpv_ }); break; } - if ((event->reply_userdata & kFullscreenReplyMask) != kFullscreenSetReply) + if ((event->reply_userdata & kMpvReplyKindMask) != kFullscreenSetReply) break; - const uint64_t serial = event->reply_userdata & kFullscreenSerialMask; + const uint64_t serial = event->reply_userdata & kMpvReplySerialMask; const int error = event->error; postMpvEvent(generation, [this, serial, error] { if (serial != m_fullscreenSyncSerial) @@ -3264,9 +3304,9 @@ void PlayerController::handleMpvEvent(mpv_event *event, quint64 generation, mpv_ break; } case MPV_EVENT_COMMAND_REPLY: { - if ((event->reply_userdata & kFullscreenReplyMask) != kTransportLoadReply) + if ((event->reply_userdata & kMpvReplyKindMask) != kTransportLoadReply) break; - const quint64 serial = event->reply_userdata & kFullscreenSerialMask; + const quint64 serial = event->reply_userdata & kMpvReplySerialMask; const int error = event->error; postMpvEvent(generation, [this, serial, error] { const auto pending = m_pendingTransportLoads.find(serial); @@ -3282,6 +3322,34 @@ void PlayerController::handleMpvEvent(mpv_event *event, quint64 generation, mpv_ break; } case MPV_EVENT_GET_PROPERTY_REPLY: { + if ((event->reply_userdata & kMpvReplyKindMask) == kPauseReadReply) { + const auto serial = event->reply_userdata & kMpvReplySerialMask; + const auto *property = static_cast(event->data); + const bool valid = event->error >= 0 && property && property->data && property->format == MPV_FORMAT_FLAG; + const bool paused = valid && *static_cast(property->data); + postMpvEvent(generation, [this, generation, serial, valid, paused] { + if (serial != m_pauseCommandSerial) + return; + if (!valid) { + m_pauseCommandState = QStringLiteral("read-error"); + return; + } + applyMpvPauseState(paused); + if (!m_sessionActive || generation != m_mpvEventGeneration || serial != m_pauseCommandSerial) + return; + if (paused == m_pauseCommandTarget) { + m_pauseCommandState = paused ? QStringLiteral("paused") : QStringLiteral("playing"); + } else if (!m_pauseCommandRetried && m_fileLoaded) { + // The core acknowledged the latest request but its actual + // option still differs. Apply that same intent once. + m_pauseCommandRetried = true; + sendMpvPauseRequest(); + } else { + m_pauseCommandState = QStringLiteral("mismatch"); + } + }); + break; + } if (event->reply_userdata == kCacheSpeedReply) { const auto *property = static_cast(event->data); const qint64 bytesPerSecond @@ -3367,21 +3435,7 @@ void PlayerController::handleMpvEvent(mpv_event *event, quint64 generation, mpv_ } if (strcmp(property->name, "pause") == 0 && property->format == MPV_FORMAT_FLAG) { const bool paused = *static_cast(property->data); - postMpvEvent(generation, [this, paused]() { - // Until a file has loaded, mpv's pause is only ever what was - // set or is about to be: an adopted idle core reports its own - // initial state as it is observed, and that report lands - // while setup waits for the surface. Taking it would overwrite - // the requested start (or a pause pressed during setup). - if (!m_fileLoaded) - return; - if (m_paused != paused) - qInfo() << "player: pause state changed" << paused; - m_paused = paused; - if (!m_paused) - requestMpvPositionRefresh("unpause"); - notifyPlaybackStateChanged(); - }); + postMpvEvent(generation, [this, paused] { applyMpvPauseState(paused); }); } else if (strcmp(property->name, "paused-for-cache") == 0 && property->format == MPV_FORMAT_FLAG) { const bool buffering = *static_cast(property->data); postMpvEvent(generation, [this, buffering]() { @@ -3462,7 +3516,7 @@ void PlayerController::handleMpvEvent(mpv_event *event, quint64 generation, mpv_ }); } else if (strcmp(property->name, "fullscreen") == 0 && property->format == MPV_FORMAT_FLAG) { const bool fullscreen = *static_cast(property->data); - const uint64_t serial = event->reply_userdata & kFullscreenSerialMask; + const uint64_t serial = event->reply_userdata & kMpvReplySerialMask; postMpvEvent(generation, [this, fullscreen, serial]() { if (serial == m_fullscreenSyncSerial && m_window && m_window->fullScreen() != fullscreen) m_window->toggleFullScreen(); diff --git a/src/player/PlayerController.h b/src/player/PlayerController.h index 74156ba5..e6789399 100644 --- a/src/player/PlayerController.h +++ b/src/player/PlayerController.h @@ -107,6 +107,14 @@ class PlayerController final : public QObject { QString statusText() const; QString errorText() const; bool buffering() const; + bool playbackReady() const + { + return m_seekDispatchReady; + } + QString pauseCommandState() const + { + return m_pauseCommandState; + } int bufferingPercent() const; bool seeking() const; bool debugOsdVisible() const; @@ -371,6 +379,8 @@ class PlayerController final : public QObject { void synchronizeWindowFullscreen(mpv_handle *handle); void scheduleMpvTeardown(); void handleMpvEvent(mpv_event *event, quint64 generation, mpv_handle *handle); + void sendMpvPauseRequest(); + void applyMpvPauseState(bool paused); template void postMpvEvent(quint64 generation, Callback callback) { QMetaObject::invokeMethod(this, [this, generation, callback = std::move(callback)]() mutable { @@ -485,6 +495,10 @@ class PlayerController final : public QObject { int m_watchedThresholdPercent = 90; bool m_seekDispatchReady = false; bool m_paused = false; + quint64 m_pauseCommandSerial = 0; + bool m_pauseCommandTarget = false; + bool m_pauseCommandRetried = false; + QString m_pauseCommandState; bool m_buffering = false; int m_bufferingPercent = 0; bool m_seeking = false; diff --git a/tests/app/DownloadManagerTest.cpp b/tests/app/DownloadManagerTest.cpp index 62b3038b..5f9cd6f8 100644 --- a/tests/app/DownloadManagerTest.cpp +++ b/tests/app/DownloadManagerTest.cpp @@ -50,7 +50,7 @@ void decodeOffline(const QString& url) require(player, "offline decoder creates"); require(mpv_set_option_string(player, "vo", "null") == 0 && mpv_set_option_string(player, "ao", "null") == 0 && mpv_set_option_string(player, "audio", "no") == 0 && mpv_set_option_string(player, "hwdec", "no") == 0 - && mpv_set_option_string(player, "speed", "10") == 0 && mpv_initialize(player) == 0, + && mpv_set_option_string(player, "untimed", "yes") == 0 && mpv_initialize(player) == 0, "offline decoder initializes without network or GUI"); const QByteArray bytes = url.toUtf8(); const char *command[] = { "loadfile", bytes.constData(), nullptr }; @@ -58,9 +58,18 @@ void decodeOffline(const QString& url) bool loaded = false; bool decoded = false; bool ended = false; + int endReason = -1; + int endError = 0; +#if defined(Q_OS_IOS) && defined(Q_PROCESSOR_X86_64) + // The hosted Intel simulator required over five minutes to finish its + // system-app boot stage. Allow bounded decoder scheduling headroom there. + constexpr int deadlineMs = 30000; +#else + constexpr int deadlineMs = 10000; +#endif QElapsedTimer timer; timer.start(); - while (!ended && timer.elapsed() < 10000) { + while (!ended && timer.elapsed() < deadlineMs) { const mpv_event *event = mpv_wait_event(player, 0.1); if (event->event_id == MPV_EVENT_FILE_LOADED) loaded = true; @@ -68,13 +77,25 @@ void decodeOffline(const QString& url) decoded = true; if (event->event_id == MPV_EVENT_END_FILE) { const auto *end = static_cast(event->data); - require(end && end->reason == MPV_END_FILE_REASON_EOF && end->error == 0, - "offline media finishes without decode failure"); + if (end) { + endReason = end->reason; + endError = end->error; + } ended = true; } } + const qint64 elapsedMs = timer.elapsed(); mpv_terminate_destroy(player); - require(loaded && decoded && ended, "downloaded media actually decodes to EOF offline"); + const QByteArray result = QStringLiteral("downloaded media actually decodes to EOF offline (loaded=%1, decoded=%2, " + "ended=%3, reason=%4, error=%5, ms=%6)") + .arg(loaded) + .arg(decoded) + .arg(ended) + .arg(endReason) + .arg(endError) + .arg(elapsedMs) + .toUtf8(); + require(loaded && decoded && ended && endReason == MPV_END_FILE_REASON_EOF && endError == 0, result.constData()); } } diff --git a/tests/e2e/AppJourneyTest.cpp b/tests/e2e/AppJourneyTest.cpp index 0b5506ca..0fc9b923 100644 --- a/tests/e2e/AppJourneyTest.cpp +++ b/tests/e2e/AppJourneyTest.cpp @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -82,6 +83,17 @@ QByteArray run(const QString& executable, const QStringList& arguments, const QP "journey subprocess failed (output deliberately withheld)"); return process.readAllStandardOutput(); } +QByteArray runOcr(const QString& executable, const QStringList& arguments, QProcessEnvironment environment) +{ + // A constrained simulator host can spend more time scheduling OpenMP + // workers than reading the frame. Each OCR call owns a single worker. + environment.insert("OMP_THREAD_LIMIT", "1"); + try { + return run(executable, arguments, environment); + } catch (const std::runtime_error& error) { + throw std::runtime_error(std::string("frame OCR: ") + error.what()); + } +} QString executable(const char *variable, const QString& fallback) { const QString requested = qEnvironmentVariable(variable); @@ -209,6 +221,12 @@ class DeviceSession final { { return remoteScreenshot; } + void androidTvRemoteKey(const QString& key) + { + require(kind == "android" && qEnvironmentVariable("SPOOL_E2E_ANDROID_TV") == "1", + "Android TV remote input requires the isolated TV emulator"); + runTool({ "shell", "input", "keyevent", key }); + } void deleteScreenshot() { if (kind == "android") { @@ -375,7 +393,7 @@ class DeviceSession final { } const QImage image(screenshot); require(!image.isNull(), "actual mobile normal-startup screenshot was not an image"); - const QByteArray text = run(ocr, { screenshot, "stdout", "-l", "eng", "--psm", "11" }, environment); + const QByteArray text = runOcr(ocr, { screenshot, "stdout", "-l", "eng", "--psm", "11" }, environment); if (QString::fromUtf8(text).contains("Welcome to Spool", Qt::CaseInsensitive)) { rendered = true; break; @@ -468,7 +486,7 @@ class DeviceSession final { QDateTime launchTime; qint64 deviceLaunchEpoch = 0; }; -enum class TextSurface { Window, LibraryRow, RelatedCard, PlayerOptions }; +enum class TextSurface { Window, LibraryRow, RelatedCard, PlayerOptions, PlayerRepeatDetail, PlayerSleepDetail }; enum class TextPreprocess { Original, Neutral, Inverse, SmoothInverse, NeutralAdaptive, Positive, Adaptive }; struct Words { QString text; @@ -653,7 +671,7 @@ class Journey final { QJsonObject result; await( [&] { - const auto window = state()["window"].toObject(); + const auto window = state(true)["window"].toObject(); if (!window["exposed"].toBool() || window["width"].toInt() <= 0 || window["height"].toInt() <= 0) return false; for (const QString& previous : { screenshotPath, libraryTextPath() }) @@ -710,7 +728,10 @@ class Journey final { const bool adaptiveContrast = preprocess == TextPreprocess::Adaptive; const bool needsPreprocess = neutralText || highContrast || smoothInverse || neutralAdaptive || positiveContrast || adaptiveContrast; - int scale = mode == 6 || smoothInverse || neutralAdaptive || positiveContrast || adaptiveContrast ? 2 : 1; + const int linePadding = mode == 7 && smoothInverse ? 16 : 0; + int scale = mode == 7 ? 4 + : mode == 6 || smoothInverse || neutralAdaptive || positiveContrast || adaptiveContrast ? 2 + : 1; QImage image; if (scale > 1 || needsPreprocess) { image = QImage(imagePath); @@ -826,14 +847,30 @@ class Journey final { const int w = source.width(); const int h = source.height(); image = QImage(w, h, QImage::Format_Grayscale8); + int minimumLuma = 255; + int maximumLuma = 0; for (int y = 0; y < h; ++y) { const auto *sourcePixels = reinterpret_cast(source.constScanLine(y)); auto *pixels = image.scanLine(y); for (int x = 0; x < w; ++x) { const QRgb pixel = sourcePixels[x]; const int luma = (77 * qRed(pixel) + 150 * qGreen(pixel) + 29 * qBlue(pixel) + 128) >> 8; - const int scaled = (180 - luma) * 255 / (180 - 40); - pixels[x] = uint8_t(std::clamp(scaled, 0, 255)); + if (linePadding) { + minimumLuma = std::min(minimumLuma, luma); + maximumLuma = std::max(maximumLuma, luma); + pixels[x] = uint8_t(luma); + } else { + const int scaled = (180 - luma) * 255 / (180 - 40); + pixels[x] = uint8_t(std::clamp(scaled, 0, 255)); + } + } + } + if (linePadding) { + const int range = std::max(1, maximumLuma - minimumLuma); + for (int y = 0; y < h; ++y) { + auto *pixels = image.scanLine(y); + for (int x = 0; x < w; ++x) + pixels[x] = uint8_t((maximumLuma - pixels[x]) * 255 / range); } } } else if (neutralAdaptive) { @@ -1022,13 +1059,22 @@ class Journey final { return upscaled; }; QSaveFile file(inputPath); - const QImage output = (smoothInverse || neutralAdaptive || positiveContrast) + QImage output = (smoothInverse || neutralAdaptive || positiveContrast) ? (scale == 4 ? catmullUpscale4x(image) : scale == 2 ? catmullUpscale2x(image) : image) : (scale == 1 ? image : image.scaled(image.width() * scale, image.height() * scale, Qt::IgnoreAspectRatio, Qt::SmoothTransformation)); + if (linePadding) { + QImage padded( + output.width() + 2 * linePadding, output.height() + 2 * linePadding, QImage::Format_RGB32); + padded.fill(Qt::white); + QPainter painter(&padded); + painter.drawImage(linePadding, linePadding, output); + painter.end(); + output = std::move(padded); + } require(file.open(QIODevice::WriteOnly) && file.setPermissions(QFileDevice::ReadOwner | QFileDevice::WriteOwner) && output.save(&file, "PNG") && file.commit(), @@ -1038,7 +1084,7 @@ class Journey final { if (adaptiveContrast || neutralAdaptive) arguments << "-c" << "thresholding_method=2"; arguments << "tsv"; - const QByteArray tsv = run(ocr, arguments, environment); + const QByteArray tsv = runOcr(ocr, arguments, environment); QList lines; QString previous; for (const QByteArray& row : tsv.split('\n')) { @@ -1046,8 +1092,9 @@ class Journey final { if (fields.size() < 12 || fields[0] != "5" || fields[11].trimmed().isEmpty()) continue; const QString key = QString::fromLatin1(fields[1] + ':' + fields[2] + ':' + fields[3] + ':' + fields[4]); - const QRect bounds = QRectF(fields[6].toDouble() / scale + origin.x(), - fields[7].toDouble() / scale + origin.y(), fields[8].toDouble() / scale, fields[9].toDouble() / scale) + const QRect bounds = QRectF((fields[6].toDouble() - linePadding) / scale + origin.x(), + (fields[7].toDouble() - linePadding) / scale + origin.y(), fields[8].toDouble() / scale, + fields[9].toDouble() / scale) .toAlignedRect(); if (key != previous) { lines.append(Words {}); @@ -1067,6 +1114,7 @@ class Journey final { QRect found; QRect previous; QString lastObserved; + const bool singleLine = surface == TextSurface::PlayerRepeatDetail || surface == TextSurface::PlayerSleepDetail; const std::string failure = "expected user-visible label was not rendered: " + text.toStdString(); const auto summarize = [](const QList& lines) { QString summary; @@ -1137,6 +1185,8 @@ class Journey final { if (surface != TextSurface::Window) { const QString key = surface == TextSurface::LibraryRow ? QStringLiteral("libraryRow") : surface == TextSurface::RelatedCard ? QStringLiteral("relatedCard") + : surface == TextSurface::PlayerRepeatDetail ? QStringLiteral("playerRepeatDetail") + : surface == TextSurface::PlayerSleepDetail ? QStringLiteral("playerSleepDetail") : QStringLiteral("playerOptions"); const auto row = capturedState["visual"].toObject()[key].toObject(); const double ratio = capturedState["window"].toObject()["devicePixelRatio"].toDouble(1); @@ -1149,6 +1199,8 @@ class Journey final { command({ "key", "down" }); return false; } + if (singleLine) + region = region.adjusted(-3, 0, 4, 0).intersected(frame.rect()); imagePath = surface == TextSurface::LibraryRow ? libraryTextPath() : screenshotPath + QStringLiteral(".caption.png"); @@ -1158,6 +1210,14 @@ class Journey final { && frame.copy(region).save(&file, "PNG") && file.commit(), "actual rendered region could not be read for caption navigation"); } + if (singleLine) { + const auto lines = words(imagePath, 7, region.topLeft(), TextPreprocess::SmoothInverse); + lastObserved = summarize(lines); + found = locate(lines); + if (found.isEmpty()) + found = locate(words(imagePath, 7, region.topLeft())); + return !found.isEmpty(); + } const QList primaryLines = words(imagePath, surface == TextSurface::Window ? 11 : 6, region.topLeft()); lastObserved = summarize(primaryLines); @@ -1265,6 +1325,59 @@ class Journey final { command({ "key", "right" }); command({ "key", "ok" }); } + void selectAndroidTvRepeatCurrent() + { + require(device != nullptr, "Android TV remote input requires an owned device"); + const auto waitForFocus = [this](int expected, const char *message) { + await( + [&] { + const auto menu = state()["visual"].toObject()["playerOptions"].toObject(); + return menu["repeatFocusIndex"].toInt(-1) == expected; + }, + message); + }; + waitForFocus(0, "Android TV Repeat menu did not focus Off"); + device->androidTvRemoteKey("KEYCODE_DPAD_DOWN"); + waitForFocus(1, "Android TV remote did not focus Repeat queue"); + device->androidTvRemoteKey("KEYCODE_DPAD_DOWN"); + waitForFocus(2, "Android TV remote did not focus Repeat current item"); + device->androidTvRemoteKey("KEYCODE_DPAD_CENTER"); + await([&] { return !state()["visual"].toObject().contains("playerOptions"); }, + "Android TV remote did not accept the focused repeat option"); + openPlaybackSettings(); + label("Current item", false, TextSurface::PlayerRepeatDetail); + device->androidTvRemoteKey("KEYCODE_BACK"); + await([&] { return !state()["visual"].toObject().contains("playerOptions"); }, + "Android TV remote did not dismiss playback settings"); + } + void pauseForObservation(const char *message) + { + await([&] { return state()["playback"].toObject()["ready"].toBool(); }, + "playback did not complete its first renderer restart before pause"); + command({ "pause" }); + QJsonObject playback; + try { + await( + [&] { + playback = state()["playback"].toObject(); + return playback["paused"].toBool(); + }, + message); + } catch (const std::exception& error) { + throw std::runtime_error(QStringLiteral( + "%1 (active=%2, loaded=%3, ready=%4, paused=%5, failed=%6, position=%7, duration=%8, pause=%9)") + .arg(QString::fromUtf8(error.what())) + .arg(playback["active"].toBool()) + .arg(playback["loaded"].toBool()) + .arg(playback["ready"].toBool()) + .arg(playback["paused"].toBool()) + .arg(playback["failed"].toBool()) + .arg(playback["position"].toDouble(), 0, 'f', 2) + .arg(playback["duration"].toDouble(), 0, 'f', 2) + .arg(playback["pauseCommand"].toString()) + .toStdString()); + } + } void await(const std::function& predicate, const char *message, int timeout = 30000) { QElapsedTimer clock; @@ -1457,6 +1570,9 @@ SPOOL_TEST_MAIN("app-journey") "--device requires android, tvos or ios"); } } +#ifdef SPOOL_DEVICE_JOURNEY_ONLY + require(!deviceKind.isEmpty(), "device journey controller requires an isolated device"); +#endif if (deviceKind.isEmpty()) { require(qEnvironmentVariable("SPOOL_E2E_ISOLATED_DISPLAY") == "1", "app-journey refuses a user desktop: driver must supply an isolated GPU display"); @@ -1758,27 +1874,7 @@ SPOOL_TEST_MAIN("app-journey") && playback["duration"].toDouble() > 29; }, "saved download did not enter real embedded playback"); - journey.command({ "pause" }); - QJsonObject lastPauseState; - try { - journey.await( - [&] { - lastPauseState = journey.state()["playback"].toObject(); - return lastPauseState["paused"].toBool(); - }, - "asynchronous pause did not settle before exact paused-frame seeking"); - } catch (const std::exception&) { - throw std::runtime_error( - QStringLiteral("asynchronous pause did not settle before exact paused-frame seeking " - "(active=%1, loaded=%2, paused=%3, failed=%4, position=%5, duration=%6)") - .arg(lastPauseState["active"].toBool()) - .arg(lastPauseState["loaded"].toBool()) - .arg(lastPauseState["paused"].toBool()) - .arg(lastPauseState["failed"].toBool()) - .arg(lastPauseState["position"].toDouble(), 0, 'f', 2) - .arg(lastPauseState["duration"].toDouble(), 0, 'f', 2) - .toStdString()); - } + journey.pauseForObservation("asynchronous pause did not settle before exact paused-frame seeking"); journey.command({ "seek", "2" }); journey.await( [&] { @@ -1811,12 +1907,20 @@ SPOOL_TEST_MAIN("app-journey") journey.command({ "stop" }); journey.await( [&] { return !journey.state()["playback"].toObject()["active"].toBool(); }, "player did not stop"); - require(fixture.authenticatedRequests == authenticatedBeforeOffline, - "saved-media playback contacted an unavailable authenticated provider endpoint"); require(fixture.playbackNegotiations == negotiationsBeforeOffline, "saved-media playback renegotiated against the unavailable provider"); require(fixture.mediaRequests == remoteRequests, "saved-media playback unexpectedly fetched the unavailable server"); + const int offlineRequests = fixture.authenticatedRequests - authenticatedBeforeOffline; + if (offlineRequests != 0) { + throw std::runtime_error( + QStringLiteral("saved-media playback contacted an unavailable authenticated provider endpoint " + "(total=%1, eventReconnect=%2, progress=%3)") + .arg(offlineRequests) + .arg(fixture.offlineSocketRequests) + .arg(fixture.offlineProgressRequests) + .toStdString()); + } fixture.setNewRequestsAvailable(true); // Keep server UserData at zero even after accepted stop reports. The @@ -1852,9 +1956,7 @@ SPOOL_TEST_MAIN("app-journey") }); }, "real provider playback start for the online item was not reported"); - journey.command({ "pause" }); - journey.await([&] { return journey.state()["playback"].toObject()["paused"].toBool(); }, - "episode did not pause before the controlled stop position"); + journey.pauseForObservation("episode did not pause before the controlled stop position"); journey.command({ "seek", "14" }); journey.await( [&] { @@ -1904,9 +2006,7 @@ SPOOL_TEST_MAIN("app-journey") && journey.state()["playback"].toObject()["loaded"].toBool(); }, "Resume did not hydrate the selected episode queue and load real media"); - journey.command({ "pause" }); - journey.await([&] { return journey.state()["playback"].toObject()["paused"].toBool(); }, - "resumed episode did not pause before observing its saved position"); + journey.pauseForObservation("resumed episode did not pause before observing its saved position"); journey.await( [&] { return std::any_of(fixture.reports.cbegin() + reportsBeforeResume, fixture.reports.cend(), @@ -1984,9 +2084,7 @@ SPOOL_TEST_MAIN("app-journey") require(fixture.sendRemotePlay(55000000), "real remote event socket was not connected"); journey.await([&] { return journey.state()["playback"].toObject()["loaded"].toBool(); }, "real inbound remote Play did not load the selected episode"); - journey.command({ "pause" }); - journey.await([&] { return journey.state()["playback"].toObject()["paused"].toBool(); }, - "inbound remote episode did not pause before observing its requested position"); + journey.pauseForObservation("inbound remote episode did not pause before observing its requested position"); journey.await( [&] { return std::any_of(fixture.reports.cbegin() + reportsBeforeRemote, fixture.reports.cend(), @@ -2044,9 +2142,7 @@ SPOOL_TEST_MAIN("app-journey") journey.click("Start from beginning", true); journey.await([&] { return journey.state()["playback"].toObject()["loaded"].toBool(); }, "explicit episode restart did not load"); - journey.command({ "pause" }); - journey.await([&] { return journey.state()["playback"].toObject()["paused"].toBool(); }, - "explicit episode restart did not pause before observing the beginning"); + journey.pauseForObservation("explicit episode restart did not pause before observing the beginning"); journey.await( [&] { return std::any_of(fixture.reports.cbegin() + reportsBeforeRestart, fixture.reports.cend(), @@ -2080,26 +2176,47 @@ SPOOL_TEST_MAIN("app-journey") fixturePhase = QStringLiteral("repeat-current-eof"); journey.openPlaybackSettings(); journey.click("Repeat", false, false, TextSurface::PlayerOptions); - journey.click("Repeat current item", false, false, TextSurface::PlayerOptions); + if (qEnvironmentVariable("SPOOL_E2E_ANDROID_TV") == "1") { + journey.label("Repeat current item", false, TextSurface::PlayerOptions); + journey.selectAndroidTvRepeatCurrent(); + } else { + journey.click("Repeat current item", false, false, TextSurface::PlayerOptions); + } const qsizetype reportsBeforeRepeat = fixture.reports.size(); const int negotiationsBeforeRepeat = fixture.playbackNegotiations; journey.command({ "seek", "88" }); journey.await([&] { return journey.state()["playback"].toObject()["position"].toDouble() > 87.5; }, "repeat journey did not reach the end of the paused item"); journey.command({ "resume" }); - journey.await( - [&] { - return fixture.playbackNegotiations > negotiationsBeforeRepeat - && journey.state()["playback"].toObject()["loaded"].toBool() - && std::any_of(fixture.reports.cbegin() + reportsBeforeRepeat, fixture.reports.cend(), - [](const QJsonObject& report) { + QJsonObject repeatPlayback; + bool repeatStartedAtZero = false; + try { + journey.await( + [&] { + repeatPlayback = journey.state()["playback"].toObject(); + repeatStartedAtZero = std::any_of(fixture.reports.cbegin() + reportsBeforeRepeat, + fixture.reports.cend(), [](const QJsonObject& report) { return report["endpoint"] == "/Sessions/Playing" && report["ItemId"] == "journey-episode" && report["RepeatMode"] == "RepeatOne" && report["PositionTicks"].toVariant().toLongLong() == 0; }); - }, - "Repeat current item did not renegotiate and report an actual restart from zero"); - journey.command({ "pause" }); + return fixture.playbackNegotiations > negotiationsBeforeRepeat && repeatPlayback["loaded"].toBool() + && repeatStartedAtZero; + }, + "Repeat current item did not renegotiate and report an actual restart from zero"); + } catch (const std::exception& error) { + throw std::runtime_error( + QStringLiteral("%1 (negotiations=%2, reportedRestart=%3, active=%4, loaded=%5, paused=%6, position=%7)") + .arg(QString::fromUtf8(error.what())) + .arg(fixture.playbackNegotiations - negotiationsBeforeRepeat) + .arg(repeatStartedAtZero) + .arg(repeatPlayback["active"].toBool()) + .arg(repeatPlayback["loaded"].toBool()) + .arg(repeatPlayback["paused"].toBool()) + .arg(repeatPlayback["position"].toDouble(), 0, 'f', 2) + .toStdString()); + } + journey.pauseForObservation("repeated item did not pause after its first renderer restart"); journey.await( [&] { const auto playback = journey.state()["playback"].toObject(); @@ -2112,16 +2229,16 @@ SPOOL_TEST_MAIN("app-journey") // merely clearing the repeat setting would make this a false positive. fixturePhase = QStringLiteral("sleep-after-current-eof"); journey.openPlaybackSettings(); - journey.label("Current item"); - journey.click("Sleep timer"); - journey.click("15 minutes"); + journey.label("Current item", false, TextSurface::PlayerRepeatDetail); + journey.click("Sleep timer", false, false, TextSurface::PlayerOptions); + journey.click("15 minutes", false, false, TextSurface::PlayerOptions); journey.openPlaybackSettings(); - journey.label("remaining"); - journey.click("Sleep timer"); - journey.click("After current item"); + journey.label("remaining", false, TextSurface::PlayerSleepDetail); + journey.click("Sleep timer", false, false, TextSurface::PlayerOptions); + journey.click("After current item", false, false, TextSurface::PlayerOptions); journey.openPlaybackSettings(); - journey.label("After current item"); - journey.label("Current item"); + journey.label("After current item", false, TextSurface::PlayerSleepDetail); + journey.label("Current item", false, TextSurface::PlayerRepeatDetail); journey.command({ "key", "back" }); journey.command({ "seek", "88" }); journey.await([&] { return journey.state()["playback"].toObject()["position"].toDouble() > 87.5; }, diff --git a/tests/e2e/JellyfinFixture.cpp b/tests/e2e/JellyfinFixture.cpp index 728149bf..c3d8d53f 100644 --- a/tests/e2e/JellyfinFixture.cpp +++ b/tests/e2e/JellyfinFixture.cpp @@ -215,6 +215,7 @@ bool JellyfinFixture::upgradeWebSocket(QTcpSocket *socket) } ++authenticatedRequests; if (!newRequestsAvailable) { + ++offlineSocketRequests; respond(socket, 503, "{}"); return true; } @@ -300,6 +301,8 @@ void JellyfinFixture::handle(QTcpSocket *socket, const QByteArray& header, const && (path == "/Videos/" + movieId + "/stream" || path == "/Videos/" + episodeId + "/stream")) ++mediaRequests; if (!newRequestsAvailable) { + if (path.startsWith("/Sessions/Playing")) + ++offlineProgressRequests; json(QJsonObject {}, 503); return; } diff --git a/tests/e2e/JellyfinFixture.h b/tests/e2e/JellyfinFixture.h index 08cce997..94a2de22 100644 --- a/tests/e2e/JellyfinFixture.h +++ b/tests/e2e/JellyfinFixture.h @@ -29,6 +29,8 @@ class JellyfinFixture final { int authenticatedBrowse = 0; int playedFilterRequests = 0; int authenticatedRequests = 0; + int offlineSocketRequests = 0; + int offlineProgressRequests = 0; int playbackNegotiations = 0; int mediaRequests = 0; qint64 mediaBytes = 0; diff --git a/tests/e2e/host/CMakeLists.txt b/tests/e2e/host/CMakeLists.txt new file mode 100644 index 00000000..0a810b6c --- /dev/null +++ b/tests/e2e/host/CMakeLists.txt @@ -0,0 +1,19 @@ +cmake_minimum_required(VERSION 3.22) +project(SpoolDeviceJourney LANGUAGES CXX) + +set(CMAKE_CXX_STANDARD 20) +set(CMAKE_CXX_STANDARD_REQUIRED ON) +find_package(Qt6 REQUIRED COMPONENTS Core Gui Network WebSockets) + +include(../../../tools/cmake/Spoolet.cmake) +add_executable(spool-device-journey ../AppJourneyTest.cpp ../JellyfinFixture.cpp ../../TestRunner.cpp) +target_include_directories(spool-device-journey PRIVATE ../..) +target_compile_definitions(spool-device-journey PRIVATE SPOOL_DEVICE_JOURNEY_ONLY=1 SPOOL_E2E_BINARY=1 + TEST_SOURCE_DIR="${CMAKE_CURRENT_SOURCE_DIR}/../.." SPOOL_E2E_SPOOLET="$") +target_link_libraries(spool-device-journey PRIVATE Qt6::Core Qt6::Gui Qt6::Network Qt6::WebSockets) +add_dependencies(spool-device-journey spoolet) + +file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/native-spool-e2e-path.txt" + CONTENT "$\n") +file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/native-spoolet-path.txt" + CONTENT "$\n") diff --git a/tests/player/PlayerControllerTest.cpp b/tests/player/PlayerControllerTest.cpp index 90ee6b75..575901ec 100644 --- a/tests/player/PlayerControllerTest.cpp +++ b/tests/player/PlayerControllerTest.cpp @@ -476,6 +476,10 @@ SPOOL_TEST_MAIN("player-controller") const double heldPosition = player.positionSeconds(); processFor(400); require(player.paused() && player.positionSeconds() < heldPosition + 0.2, "intentional pause stays held"); + player.setPaused(false); + player.setPaused(true); + waitUntil([&] { return player.paused() && player.pauseCommandState() == QStringLiteral("paused"); }, + "readback of an older resume cannot replace the latest pause request"); player.stopWithReason(QStringLiteral("test-manual-stop"), true); require(!player.sessionActive() && completions == 1 && manualStops == 1, "manual stop never advances"); diff --git a/tests/providers/SourceHubSpeedTest.cpp b/tests/providers/SourceHubSpeedTest.cpp index a23f823c..fc8575c0 100644 --- a/tests/providers/SourceHubSpeedTest.cpp +++ b/tests/providers/SourceHubSpeedTest.cpp @@ -12,6 +12,7 @@ #include #include +#include #include #include #include @@ -145,7 +146,16 @@ export function createSource(configuration) { require(started == 0, "explicit refresh cannot compete with active playback"); hub.setPlaybackActive(false); hub.refreshSpeedTests(); - waitUntil([&] { return finished == 3; }, "idle explicit probes complete serially"); + waitUntil( + [&] { + const auto accounts = hub.speedTestStatus().value("accounts").toList(); + return finished == 3 && accounts.size() == 3 + && std::none_of(accounts.cbegin(), accounts.cend(), [](const QVariant& value) { + const auto account = value.toMap(); + return account.value("pending").toBool() || account.value("running").toBool(); + }); + }, + "idle explicit probes complete serially and commit their results"); require(active == 0, "all probes settle"); hub.setPlaybackActive(true); const auto resolve = [&](const QString& account) { diff --git a/tests/qml/tst_ProviderForms.qml b/tests/qml/tst_ProviderForms.qml index e0db1369..28c5fe3d 100644 --- a/tests/qml/tst_ProviderForms.qml +++ b/tests/qml/tst_ProviderForms.qml @@ -178,9 +178,10 @@ TestCase { view.dialog.activate() compare(view.alternatives, 1) const confirm = view.dialog.buttons[2] - const point = confirm.mapToItem(view, confirm.width - 3, confirm.height / 2) - mouseClick(view, point.x, point.y) - compare(view.confirmations, 1) + verify(waitForRendering(confirm)) + // Exercise the button outside its label, within the rendered target. + mouseClick(confirm, Math.floor(confirm.width) - 8, Math.floor(confirm.height / 2)) + tryCompare(view, "confirmations", 1) compare(view.dismissals, 0) } function init() { diff --git a/tools/cmake/Spoolet.cmake b/tools/cmake/Spoolet.cmake new file mode 100644 index 00000000..9f1b35c6 --- /dev/null +++ b/tools/cmake/Spoolet.cmake @@ -0,0 +1,8 @@ +set(SPOOLET_SOURCE_DIR "${CMAKE_CURRENT_LIST_DIR}/../../src/automation") +add_executable(spoolet + "${SPOOLET_SOURCE_DIR}/SpooletMain.cpp" + "${SPOOLET_SOURCE_DIR}/LocalControlProtocol.cpp" + "${SPOOLET_SOURCE_DIR}/LocalControlProtocol.h") +target_link_libraries(spoolet PRIVATE Qt6::Core Qt6::Network) +qt_add_resources(spoolet remote_discovery PREFIX "/automation" + BASE "${SPOOLET_SOURCE_DIR}" FILES "${SPOOLET_SOURCE_DIR}/RemoteDiscovery.sh") diff --git a/tools/run-device-tests.py b/tools/run-device-tests.py index 403bc998..c35b2391 100755 --- a/tools/run-device-tests.py +++ b/tools/run-device-tests.py @@ -1228,6 +1228,21 @@ def export_attempt(private, destination, result): journeys = [*private.glob("app-journey-*"), *(private / "journey-images").glob("app-journey-*")] for journey in journeys: if journey.is_dir() and not journey.is_symlink(): + # The native controller records this before propagating a signal + # observed from the separately owned product process. + crash = journey / "mobile-crash-evidence.json" + if (result.get("status") == "crashed" and crash.is_file() and not crash.is_symlink() + and crash.stat().st_size <= 1024): + try: + evidence = json.loads(crash.read_text()) + except (OSError, ValueError): + evidence = None + if (isinstance(evidence, dict) and type(evidence.get("signal")) is int + and evidence["signal"] == result.get("signal") + and type(evidence.get("pid")) is int and evidence["pid"] > 0 + and evidence.get("platform") in ("android", "tvos", "ios")): + write_journal(destination / "mobile-crash-evidence.json", + {key: evidence[key] for key in ("platform", "pid", "signal")}) images.extend(journey / name for name in ("frame.png", "library-text.png", "mobile-default-startup.png", "download-failure.png")) for image in images: @@ -1269,7 +1284,7 @@ def export_attempt(private, destination, result): print("app-journey: " + reason, flush=True) (destination / "attempt.log").write_text("\n".join(lines) + "\n", encoding="utf-8") allowed = {"native-result.json", "controller-result.json", "attempt.log", "frame.png", "library-text.png", - "mobile-default-startup.png", NATIVE_DIAGNOSTIC_NAME} + "mobile-default-startup.png", "mobile-crash-evidence.json", NATIVE_DIAGNOSTIC_NAME} files = [path for path in destination.rglob("*") if path.is_file()] if any(path.is_symlink() or (path.name not in allowed and not path.name.endswith("-failure.png")) for path in files): diff --git a/tools/windows/install-build-tools.ps1 b/tools/windows/install-build-tools.ps1 index 7f0edec4..901b87bc 100644 --- a/tools/windows/install-build-tools.ps1 +++ b/tools/windows/install-build-tools.ps1 @@ -70,10 +70,27 @@ if (-not $VerifyOnly) { $arguments += "--version=$($package.Version)" } Write-Host "Installing $($package.Name)" - & choco @arguments + if ($package.Name -eq 'nsis') { + $nsisLog = & choco @arguments 2>&1 + $installExitCode = $LASTEXITCODE + $nsisLog | Out-Host + Add-ToolDirectoriesToPath + # The feed can return 504 while Chocolatey exits zero without an + # installer. Retry the same request once and keep the first log. + $feedTimeout = "Failed to fetch results from V2 feed at 'https://community\.chocolatey\.org/api/v2/Packages\(Id='nsis',Version='[^']+'\)'.*504 \(Gateway Timeout\)" + if (-not (Get-Command makensis.exe -ErrorAction SilentlyContinue) -and ($nsisLog -match $feedTimeout)) { + Write-Warning 'Chocolatey NSIS feed returned HTTP 504. Retrying once.' + Start-Sleep -Seconds 10 + & choco @arguments + $installExitCode = $LASTEXITCODE + } + } else { + & choco @arguments + $installExitCode = $LASTEXITCODE + } # Chocolatey needs an elevated shell to write under ProgramData. Say so # rather than leaving the tool check below to report a missing binary. - if ($LASTEXITCODE -ne 0) { + if ($installExitCode -ne 0) { throw "Installing $($package.Name) failed. Chocolatey needs an elevated shell; re-run this script as Administrator." } Add-ToolDirectoriesToPath From cf0df1f11cc3528677c8e476ad154b4396bfb250 Mon Sep 17 00:00:00 2001 From: Sacha Korban Date: Fri, 27 Nov 2026 02:50:05 +1100 Subject: [PATCH 12/39] fix(player): coordinate render lifetime and preserve Android TV coverage Consolidate the release milestone ending at fbae66cd83d21be5eb8ad0192ceb9996edbd18d0. Original starting snapshot: 2d08aa6ad7795701f23a1407e5573953259fe673. --- .github/workflows/build-artifacts.yml | 3 +- src/player/MpvVideoItem.cpp | 22 +-- src/player/PlayerController.cpp | 103 ++++++++----- tests/common/RangedDownloadTest.cpp | 19 ++- tests/e2e/AppJourneyTest.cpp | 93 +++++++++--- tests/player/MpvFullscreenTest.cpp | 10 ++ tests/player/MpvVideoItemTest.cpp | 16 +- tests/qml/tst_ExtensionIntegration.qml | 4 + tests/tools/TestDriverTest.py | 21 +++ tools/android/build-dependencies.sh | 19 ++- .../patches/mpv-libmpv-vo-lifetime.patch | 141 ++++++++++++++++++ tools/run-device-tests.py | 18 ++- 12 files changed, 389 insertions(+), 80 deletions(-) create mode 100644 tools/android/patches/mpv-libmpv-vo-lifetime.patch diff --git a/.github/workflows/build-artifacts.yml b/.github/workflows/build-artifacts.yml index 17e1b8a9..78956db0 100644 --- a/.github/workflows/build-artifacts.yml +++ b/.github/workflows/build-artifacts.yml @@ -1335,13 +1335,14 @@ jobs: run: nix develop .#native -c bash tools/build-linux-release.sh - name: Run Android phone traditional and real GPU GUI e2e tests + id: android-phone-tests if: matrix.abi == 'x86_64' env: SPOOL_ANDROID_FORM_FACTOR: phone run: nix develop .#android -c bash tools/android/emulator-launch-test.sh - name: Run Android TV traditional and real GPU GUI e2e tests - if: matrix.abi == 'x86_64' + if: ${{ !cancelled() && matrix.abi == 'x86_64' && (steps.android-phone-tests.outcome == 'success' || steps.android-phone-tests.outcome == 'failure') }} env: SPOOL_ANDROID_FORM_FACTOR: tv run: nix develop .#android -c bash tools/android/emulator-launch-test.sh diff --git a/src/player/MpvVideoItem.cpp b/src/player/MpvVideoItem.cpp index 05436a6d..a0ba1ef7 100644 --- a/src/player/MpvVideoItem.cpp +++ b/src/player/MpvVideoItem.cpp @@ -980,16 +980,20 @@ bool MpvVideoItem::waitForRenderContext(int timeoutMs) bool MpvVideoItem::releaseMpvHandle(int timeoutMs) { - const auto completed = std::make_shared(false); + std::shared_ptr completed; QEventLoop releaseLoop; { QMutexLocker locker(&m_handleMutex); - const bool needsRenderHandoff = m_renderCtxAtomic.load() || m_pendingHandle; - m_pendingHandle = nullptr; - m_handleDirty = true; - if (!needsRenderHandoff) - return true; - m_releaseCompleted = completed; + // A nested teardown can arrive while the render thread is freeing + // the context. The null context pointer alone cannot acknowledge it. + if (!m_releaseCompleted) { + if (!m_renderCtxAtomic.load() && !m_pendingHandle) + return true; + m_releaseCompleted = std::make_shared(false); + m_pendingHandle = nullptr; + m_handleDirty = true; + } + completed = m_releaseCompleted; } QTimer timeout; @@ -1001,7 +1005,8 @@ bool MpvVideoItem::releaseMpvHandle(int timeoutMs) }); timeout.start(timeoutMs); update(); - releaseLoop.exec(QEventLoop::ExcludeUserInputEvents); + if (!completed->load()) + releaseLoop.exec(QEventLoop::ExcludeUserInputEvents); return completed->load(); } @@ -1023,7 +1028,6 @@ MpvVideoItem::HandleSnapshot MpvVideoItem::takePendingHandle() HandleSnapshot snap { m_pendingHandle, m_handleDirty, m_releaseCompleted, m_attachCompleted, m_pendingRenderBackend }; m_handleDirty = false; - m_releaseCompleted.reset(); return snap; } diff --git a/src/player/PlayerController.cpp b/src/player/PlayerController.cpp index 2012ca07..4f8531a8 100644 --- a/src/player/PlayerController.cpp +++ b/src/player/PlayerController.cpp @@ -168,6 +168,8 @@ namespace { constexpr uint64_t kCacheSpeedReply = 0x6375726c73706565ULL; constexpr uint64_t kPauseSetReply = 0x7073000000000000ULL; constexpr uint64_t kPauseReadReply = 0x7072000000000000ULL; + constexpr uint64_t kInitialPauseReply = 0x7069000000000000ULL; + constexpr uint64_t kColorDiagnosticReply = 0x636f000000000000ULL; constexpr uint64_t kFullscreenSetReply = 0x6673000000000000ULL; constexpr uint64_t kFullscreenObservation = 0x666f000000000000ULL; constexpr uint64_t kMpvReplyKindMask = 0xffff000000000000ULL; @@ -888,40 +890,41 @@ bool PlayerController::usesUserMpvConfig() const && m_mpvConfigPolicy.mode != MpvConfigPolicy::Mode::Disabled; } +static const char *const kColorDiagnosticProperties[] = { + "current-vo", + "current-gpu-context", + "current-render-api", + "current-render-backend", + "video-dec-params/pixelformat", + "video-params/colormatrix", + "video-params/primaries", + "video-params/gamma", + "video-params/colorlevels", + "video-params/sig-peak", + "video-params/max-cll", + "video-params/max-fall", + "video-target-params/pixelformat", + "video-target-params/colormatrix", + "video-target-params/primaries", + "video-target-params/gamma", + "video-target-params/colorlevels", + "video-target-params/min-luma", + "video-target-params/max-luma", + "video-target-params/max-cll", + "target-trc", + "target-prim", + "target-peak", + "target-contrast", + "hdr-reference-white", + "tone-mapping", +}; + void PlayerController::logColorDiagnostics(mpv_handle *handle) { if (!handle) return; - const char *props[] = { - "current-vo", - "current-gpu-context", - "current-render-api", - "current-render-backend", - "video-dec-params/pixelformat", - "video-params/colormatrix", - "video-params/primaries", - "video-params/gamma", - "video-params/colorlevels", - "video-params/sig-peak", - "video-params/max-cll", - "video-params/max-fall", - "video-target-params/pixelformat", - "video-target-params/colormatrix", - "video-target-params/primaries", - "video-target-params/gamma", - "video-target-params/colorlevels", - "video-target-params/min-luma", - "video-target-params/max-luma", - "video-target-params/max-cll", - "target-trc", - "target-prim", - "target-peak", - "target-contrast", - "hdr-reference-white", - "tone-mapping", - }; QStringList details; - for (const char *prop : props) { + for (const char *prop : kColorDiagnosticProperties) { char *val = mpv_get_property_string(handle, prop); if (val) { details.push_back(QStringLiteral("%1=%2").arg(QString::fromLatin1(prop), QString::fromUtf8(val))); @@ -3184,18 +3187,14 @@ void PlayerController::handleMpvEvent(mpv_event *event, quint64 generation, mpv_ break; } case MPV_EVENT_FILE_LOADED: { - // Runtime snapshots may wait for the VO. Query on this core's event - // thread, whose captured handle lives until the event loop is joined, - // so GUI synchronization remains available to the renderer. - logColorDiagnostics(handle); - int mpvPaused = 0; - const bool hasMpvPaused = mpv_get_property(handle, "pause", MPV_FORMAT_FLAG, &mpvPaused) >= 0; - postMpvEvent(generation, [this, generation, hasMpvPaused, mpvPaused]() { + postMpvEvent(generation, [this, generation]() { m_mpvLifecycle.completeFileLoad(); qInfo() << "player: file loaded"; m_fileLoaded = true; - if (hasMpvPaused) - m_paused = mpvPaused != 0; + // A runtime property read can wait for the VO. Keep both the GUI + // and the mpv event consumer free to service the renderer. + mpv_get_property_async( + m_mpvLifecycle.handle(), kInitialPauseReply | m_pauseCommandSerial, "pause", MPV_FORMAT_FLAG); // Only video can strain the renderer, and only once per playback: // a step down rebuilds the core, which lands back here. if (!m_renderStrainReported && m_mediaKind == QStringLiteral("video")) @@ -3221,10 +3220,11 @@ void PlayerController::handleMpvEvent(mpv_event *event, quint64 generation, mpv_ case MPV_EVENT_PLAYBACK_RESTART: postMpvEvent(generation, [this]() { qInfo() << "player: playback restart"; - // The first restart has the final output parameters. Ordinary - // seek completions do not need another synchronous property sweep. + // The first restart has the final output parameters. Collect them + // without holding up GUI synchronization or draining mpv events. if (!m_seekDispatchReady) - logColorDiagnostics(m_mpvLifecycle.handle()); + for (const char *property : kColorDiagnosticProperties) + mpv_get_property_async(m_mpvLifecycle.handle(), kColorDiagnosticReply, property, MPV_FORMAT_STRING); const bool hadPendingSeek = m_pendingSeek; m_seekDispatchReady = true; if (hadPendingSeek) { @@ -3322,6 +3322,27 @@ void PlayerController::handleMpvEvent(mpv_event *event, quint64 generation, mpv_ break; } case MPV_EVENT_GET_PROPERTY_REPLY: { + if (event->reply_userdata == kColorDiagnosticReply) { + const auto *property = static_cast(event->data); + if (event->error >= 0 && property && property->data && property->format == MPV_FORMAT_STRING) { + const auto *value = *static_cast(property->data); + if (value) + qInfo().noquote() << "player: color diagnostics ->" << property->name << '=' << value; + } + break; + } + if ((event->reply_userdata & kMpvReplyKindMask) == kInitialPauseReply) { + const auto *property = static_cast(event->data); + if (event->error >= 0 && property && property->data && property->format == MPV_FORMAT_FLAG) { + const bool paused = *static_cast(property->data); + const auto serial = event->reply_userdata & kMpvReplySerialMask; + postMpvEvent(generation, [this, serial, paused] { + if (serial == m_pauseCommandSerial) + applyMpvPauseState(paused); + }); + } + break; + } if ((event->reply_userdata & kMpvReplyKindMask) == kPauseReadReply) { const auto serial = event->reply_userdata & kMpvReplySerialMask; const auto *property = static_cast(event->data); diff --git a/tests/common/RangedDownloadTest.cpp b/tests/common/RangedDownloadTest.cpp index 19eca70a..9042ac80 100644 --- a/tests/common/RangedDownloadTest.cpp +++ b/tests/common/RangedDownloadTest.cpp @@ -1,7 +1,6 @@ #include "common/RangedDownload.h" #include "TestMain.h" -#include "TestRequire.h" #include #include @@ -13,13 +12,20 @@ #include #include +#include #include +#include using Spool::RangedDownload; -using SpoolTests::require; namespace { +void require(bool condition, const char *message) +{ + if (!condition) + throw std::runtime_error(message); +} + // HTTP/1.1, one response per connection. Honours "bytes=a-b" and "bytes=a-" // unless told to ignore ranges, and records what it was asked for. class FileServer final : public QTcpServer { @@ -31,6 +37,8 @@ class FileServer final : public QTcpServer { while (QTcpSocket *socket = nextPendingConnection()) { connect(socket, &QTcpSocket::readyRead, socket, [this, socket] { respond(socket); }); connect(socket, &QTcpSocket::disconnected, socket, &QObject::deleteLater); + if (socket->bytesAvailable() > 0) + respond(socket); } }); require(listen(QHostAddress::LocalHost), "server could not listen"); @@ -110,6 +118,8 @@ Outcome fetch(FileServer& server, const QString& path, int lanes, qint64 expecte while (!result && timer.elapsed() < 10000) QCoreApplication::processEvents(QEventLoop::AllEvents, 10); require(result.has_value(), "download never finished"); + if (!result->isEmpty()) + return { *result, {} }; QFile file(path); require(file.open(QIODevice::ReadOnly), "downloaded file could not be read"); return { *result, file.readAll() }; @@ -118,7 +128,7 @@ Outcome fetch(FileServer& server, const QString& path, int lanes, qint64 expecte } // namespace SPOOL_TEST_MAIN("ranged-download") -{ +try { QCoreApplication app(argc, argv); QTemporaryDir directory; require(directory.isValid(), "temporary directory"); @@ -163,4 +173,7 @@ SPOOL_TEST_MAIN("ranged-download") require(!outcome.error.isEmpty(), "a file of the wrong size was accepted"); } return 0; +} catch (const std::runtime_error& error) { + std::cerr << "ranged-download: " << error.what() << '\n'; + return 1; } diff --git a/tests/e2e/AppJourneyTest.cpp b/tests/e2e/AppJourneyTest.cpp index 0fc9b923..d6601fa9 100644 --- a/tests/e2e/AppJourneyTest.cpp +++ b/tests/e2e/AppJourneyTest.cpp @@ -198,7 +198,9 @@ class DeviceSession final { do { const int signal = crashSignal(); if (signal > 0) { - const QJsonObject evidence { { "platform", kind }, { "pid", processPid }, { "signal", signal } }; + QJsonObject evidence { { "platform", kind }, { "pid", processPid }, { "signal", signal } }; + if (kind == "android") + addAndroidCrashDetails(evidence); QSaveFile file(QFileInfo(hostDescriptor).dir().filePath("mobile-crash-evidence.json")); const QByteArray bytes = QJsonDocument(evidence).toJson(QJsonDocument::Compact); const bool saved = file.open(QIODevice::WriteOnly) @@ -276,6 +278,47 @@ class DeviceSession final { } return 0; } + void addAndroidCrashDetails(QJsonObject& evidence) + { + QJsonArray frames; + try { + // Android emits the backtrace from crash_dump, whose logging PID + // differs from the product PID recorded in the tombstone header. + const QString logs = QString::fromUtf8( + runTool({ "logcat", "-d", "-b", "crash", "-t", "600", "-v", "epoch", "DEBUG:I", "*:S" })); + const QRegularExpression lineFormat( + QStringLiteral("^\\s*([0-9]+(?:\\.[0-9]+)?)\\s+([0-9]+)\\s+[0-9]+\\s+[A-Z]\\s+DEBUG\\s*:\\s*(.*)$")); + const QRegularExpression product( + QStringLiteral("^pid: %1, .* >>> %2 <<<$").arg(processPid).arg(QRegularExpression::escape(bundle))); + const QRegularExpression frame(QStringLiteral( + "^#[0-9]+\\s+pc\\s+([0-9a-f]{1,16})\\s+(?:[^\\s]*/)?(lib(?:spool_x86_64|" + "Qt6(?:Core|Gui|Quick|Qml|OpenGL)|mpv|c|EGL|GLESv2|art|android_runtime)\\.so)(?:\\s|$)")); + qint64 reporter = 0; + for (const QString& line : logs.split('\n')) { + const auto record = lineFormat.match(line.trimmed()); + if (!record.hasMatch() || record.captured(1).toDouble() < deviceLaunchEpoch) + continue; + const auto message = record.captured(3); + if (message.startsWith(QLatin1String("pid: "))) { + reporter = product.match(message).hasMatch() ? record.captured(2).toLongLong() : 0; + continue; + } + if (reporter == 0 || record.captured(2).toLongLong() != reporter) + continue; + if (message.startsWith( + QLatin1String("Abort message: 'FORTIFY: pthread_mutex_lock called on a destroyed mutex"))) + evidence.insert("abortKind", "destroyed-mutex"); + const auto match = frame.match(message); + if (match.hasMatch()) + frames.append(QJsonObject { { "module", match.captured(2) }, { "offset", match.captured(1) } }); + if (frames.size() == 12) + break; + } + } catch (const std::runtime_error&) { + // The already confirmed signal remains usable without a stack. + } + evidence.insert("frames", frames); + } int crashSignal() { try { @@ -657,10 +700,26 @@ class Journey final { "actual app accepted IME input without an editable focus"); require(state()["initialized"].toBool(), "genuine control capability stopped working after denial"); } - void text(const QString& value) + void text(const QString& value, bool activateTvField = false) { - require(command({ "text", "--stdin" }, value.toUtf8())["accepted"].toBool(), - "focused editable field did not accept production IME input"); + const auto input = value.toUtf8(); + await( + [&] { + QJsonObject response; + try { + require(command({ "text", "--stdin" }, input, true, {}, &response)["accepted"].toBool(), + "focused editable field did not accept production IME input"); + } catch (const std::exception&) { + if (!activateTvField || response["error"].toObject()["code"] != "no_text_focus") + throw; + // The TV focus ring can belong to the row while its editor is inactive. + // The rejection precedes dispatch, so pressing Select and retrying cannot duplicate text. + command({ "key", "ok" }); + return false; + } + return true; + }, + "could not enter text in the intended form field", 5000); } QJsonObject state(bool observeAfterTimeout = false) { @@ -1352,14 +1411,17 @@ class Journey final { } void pauseForObservation(const char *message) { - await([&] { return state()["playback"].toObject()["ready"].toBool(); }, + await([&] { return state(true)["playback"].toObject()["ready"].toBool(); }, "playback did not complete its first renderer restart before pause"); command({ "pause" }); QJsonObject playback; try { await( [&] { - playback = state()["playback"].toObject(); + const auto observed = state(true)["playback"].toObject(); + if (observed.isEmpty()) + return false; + playback = observed; return playback["paused"].toBool(); }, message); @@ -1649,18 +1711,12 @@ SPOOL_TEST_MAIN("app-journey") = deviceKind == "tvos" || (deviceKind == "android" && qEnvironmentVariable("SPOOL_E2E_ANDROID_TV") == "1"); journey.click("Jellyfin", true); journey.label("Choose a server"); - if (television) - journey.command({ "key", "ok" }); - journey.text(fixture.origin()); + journey.text(fixture.origin(), television); journey.command({ "key", "ok" }); journey.label("Username"); - if (television) - journey.command({ "key", "ok" }); - journey.text("journey"); + journey.text("journey", television); journey.command({ "key", "ok" }); - if (television) - journey.command({ "key", "ok" }); - journey.text("incorrect-password"); + journey.text("incorrect-password", television); journey.command({ "key", "ok" }); try { journey.await( @@ -1678,7 +1734,7 @@ SPOOL_TEST_MAIN("app-journey") .toStdString()); } journey.label("Wrong username or password"); - journey.text("journey-password"); + journey.text("journey-password", television); journey.command({ "key", "ok" }); journey.await([&] { return fixture.successfulLogins == 1 && fixture.authenticatedViews > 0; }, "login did not activate an authenticated provider library"); @@ -1938,8 +1994,11 @@ SPOOL_TEST_MAIN("app-journey") journey.command({ "key", "ok" }); journey.await( [&] { + // A single read-only observation can miss its client deadline + // while the new renderer surface starts. Keep the enclosing + // deadline and require real provider negotiation and playback. return fixture.playbackNegotiations > negotiationsBeforeOnline - && journey.state()["playback"].toObject()["loaded"].toBool(); + && journey.state(true)["playback"].toObject()["loaded"].toBool(); }, "online UI play did not negotiate and load real provider media"); journey.await( diff --git a/tests/player/MpvFullscreenTest.cpp b/tests/player/MpvFullscreenTest.cpp index 8268a9a9..d7e4ec31 100644 --- a/tests/player/MpvFullscreenTest.cpp +++ b/tests/player/MpvFullscreenTest.cpp @@ -151,6 +151,7 @@ SPOOL_TEST_MAIN("mpv-video-item-fullscreen") require(waitUntil([&] { return swaps.load() > 0; }), "native window presents its first frame"); #ifdef Q_OS_MACOS NativeFullscreenReceipt nativeReceipt(window); + bool firstNativeRequest = true; #endif bool responsive = true; @@ -171,7 +172,16 @@ SPOOL_TEST_MAIN("mpv-video-item-fullscreen") #endif // The VO's 200 ms timeout must never become the GUI's fullscreen // latency. Swap timing is evidence, not a compositor speed promise. +#ifdef Q_OS_MACOS + // The first AppKit request is made before playback and can take + // longer to set up the native fullscreen space. It still has to + // present the configured frame like every other transition. + if (!firstNativeRequest) + responsive &= callMs < 150.0; + firstNativeRequest = false; +#else responsive &= callMs < 150.0; +#endif const bool presented = waitUntil([&] { // Wayland client decorations can alter the restored content // size. Require its configured frame, not a guessed border size. diff --git a/tests/player/MpvVideoItemTest.cpp b/tests/player/MpvVideoItemTest.cpp index 83239851..fb4e1427 100644 --- a/tests/player/MpvVideoItemTest.cpp +++ b/tests/player/MpvVideoItemTest.cpp @@ -519,15 +519,23 @@ SPOOL_TEST_MAIN("mpv-video-item") if (frame.save(capturePath)) std::fprintf(stderr, "native failure frame: %s\n", qPrintable(capturePath)); } + bool nestedRelease = false; + QTimer nestedReleaseTimer; + nestedReleaseTimer.setSingleShot(true); + QObject::connect( + &nestedReleaseTimer, &QTimer::timeout, &window, [&] { nestedRelease = videoItem.releaseMpvHandle(); }); + nestedReleaseTimer.start(0); const bool released = videoItem.releaseMpvHandle(); - mpv_terminate_destroy(handle); - if (!rendered || !upright || !released || !neutralOsd + QCoreApplication::processEvents(); + if (released && nestedRelease) + mpv_terminate_destroy(handle); + if (!rendered || !upright || !released || !nestedRelease || !neutralOsd #if SPOOL_MPV_ITEM_RHI || !sdrTarget #endif ) { - std::fprintf(stderr, "video result: rendered=%d upright=%d released=%d neutralOSD=%d\n", rendered, upright, - released, neutralOsd); + std::fprintf(stderr, "video result: rendered=%d upright=%d released=%d nestedRelease=%d neutralOSD=%d\n", + rendered, upright, released, nestedRelease, neutralOsd); const QImage failedFrame = captureItem(); const QColor upper = failedFrame.pixelColor(failedFrame.width() / 2, failedFrame.height() / 4); const QColor lower = failedFrame.pixelColor(failedFrame.width() / 2, 3 * failedFrame.height() / 4); diff --git a/tests/qml/tst_ExtensionIntegration.qml b/tests/qml/tst_ExtensionIntegration.qml index 1cd52428..dc009034 100644 --- a/tests/qml/tst_ExtensionIntegration.qml +++ b/tests/qml/tst_ExtensionIntegration.qml @@ -164,6 +164,10 @@ TestCase { selectSetting("theme/reducedMotion") settingsPage.activateRow(settingsPage.currentRow(), settingsPage.currentIndex) cycle() + // Local persistence can queue another sync while the first cycle is + // finishing. Wait for the writes this test made to reach the provider. + tryVerify(() => Integration.stats("first").native.audioMode === "Smart" && state("audio/trackMode").status + === "synced" && state("theme/reducedMotion").status === "synced", 10000) compare(Integration.stats("first").native.audioMode, "Smart") compare(state("theme/reducedMotion").status, "synced", JSON.stringify(state("theme/reducedMotion"))) compare(record("first", "theme/reducedMotion"), true) diff --git a/tests/tools/TestDriverTest.py b/tests/tools/TestDriverTest.py index a2d57bc8..12be3f9d 100755 --- a/tests/tools/TestDriverTest.py +++ b/tests/tools/TestDriverTest.py @@ -147,6 +147,27 @@ def test_matched_report_export_keeps_offsets_but_not_private_report_strings(self self.assertEqual(exported["lastExceptionFrames"], [{"imageIndex": 0, "imageOffset": 43}]) self.assertNotIn(private, json.dumps(exported)) + def test_android_product_crash_export_keeps_only_allowed_modules_and_offsets(self): + private = self.report.parent / "private" + journey = private / "app-journey-test" + journey.mkdir(parents=True) + frame = {"module": "libspool_x86_64.so", "offset": "a42", "symbol": "private value"} + evidence = { + "platform": "android", "pid": 1234, "signal": 6, + "abortKind": "destroyed-mutex", + "frames": [frame, {"module": "/private/libc.so", "offset": "10"}, + {"module": "libmpv.so", "offset": "21"}, + {"module": "libc.so", "offset": "private value"}], + } + (journey / "mobile-crash-evidence.json").write_text(json.dumps(evidence)) + destination = self.report.parent / "public" + self.adapter["export_attempt"](private, destination, {"status": "crashed", "signal": 6}) + exported = json.loads((destination / "mobile-crash-evidence.json").read_text()) + self.assertEqual(exported, {"platform": "android", "pid": 1234, "signal": 6, + "abortKind": "destroyed-mutex", + "frames": [{"module": "libspool_x86_64.so", "offset": "a42"}, + {"module": "libmpv.so", "offset": "21"}]}) + if __name__ == "__main__": unittest.main() diff --git a/tools/android/build-dependencies.sh b/tools/android/build-dependencies.sh index 5040bff9..09541a42 100755 --- a/tools/android/build-dependencies.sh +++ b/tools/android/build-dependencies.sh @@ -301,6 +301,8 @@ build_mpv() { # Include actual source changes and the compiler/recipe, not only the static # dependencies. A matching git revision alone cannot bless stale dirty bytes. local stamp="$PREFIX/lib/.spool-mpv-dependencies" + local source="$MPV_SRC" + local backport="$ROOT/tools/android/patches/mpv-libmpv-vo-lifetime.patch" local source_pin pin source_pin="$( cd "$MPV_SRC" || exit @@ -314,13 +316,26 @@ build_mpv() { pin="$( printf '%s\n' "$source_pin" "$ABI" "$API" "$ANDROID_NDK_ROOT" sha256sum "${BASH_SOURCE[0]}" "$ROOT/tools/manifests/toolchain.json" \ - "$ROOT/tools/manifests/mpv-native.json" "$ANDROID_NDK_ROOT/source.properties" || exit + "$ROOT/tools/manifests/mpv-native.json" "$ANDROID_NDK_ROOT/source.properties" "$backport" || exit cat "$PREFIX/lib/pkgconfig/.spool-ffmpeg-source" "$PREFIX/lib/.spool-curl-configuration" )" [[ -f "$PREFIX/lib/libmpv.so" && -f "$stamp" && "$(<"$stamp")" == "$pin" ]] && return local build="$BUILD_ROOT/mpv" rm -rf "$build" - meson setup "$build" "$MPV_SRC" \ + # Backport the VO lifetime fix to the pinned Android source until Spool can + # take the merged mpv revision. Keep the submodule checkout untouched. + if [[ "$source" == "$ROOT/mpv" && "${source_pin%%$'\n'*}" == 8eb31c4d7745d650bc3531cb90e140d53f81e571 ]]; then + source="$BUILD_ROOT/mpv-source" + rm -rf "$source" + mkdir -p "$source" + git -C "$MPV_SRC" archive HEAD | tar -xf - -C "$source" + git -C "$MPV_SRC" diff --binary HEAD -- | + GIT_CEILING_DIRECTORIES="$BUILD_ROOT" git -C "$source" apply --allow-empty - + git -C "$MPV_SRC" ls-files --others --exclude-standard -z | + tar -C "$MPV_SRC" --null -T - -cf - | tar -xf - -C "$source" + "$MANIFEST_PATCH" -d "$source" -p1 --forward <"$backport" + fi + meson setup "$build" "$source" \ --cross-file "$CROSS_FILE" --prefix "$PREFIX" --default-library shared \ -Dcplayer=false -Dlibmpv=true -Dbuild-date=false -Dtests=false \ -Dlua=lua -Djavascript=disabled -Dmanpage-build=disabled \ diff --git a/tools/android/patches/mpv-libmpv-vo-lifetime.patch b/tools/android/patches/mpv-libmpv-vo-lifetime.patch new file mode 100644 index 00000000..d80d316e --- /dev/null +++ b/tools/android/patches/mpv-libmpv-vo-lifetime.patch @@ -0,0 +1,141 @@ +diff --git a/video/out/gpu_next/libmpv_gpu_next.c b/video/out/gpu_next/libmpv_gpu_next.c +index 2eaa0d7fef..3212d118be 100644 +--- a/video/out/gpu_next/libmpv_gpu_next.c ++++ b/video/out/gpu_next/libmpv_gpu_next.c +@@ -78,7 +78,10 @@ struct priv { + struct gpu_ctx *gpu_ctx; + struct mppl_video *renderer; + struct mp_hwdec_devices *hwdec_devs; +- struct vo *vo; ++ bool has_vo; ++ struct mp_image_params rendered_target_params; ++ struct pl_hdr_metadata rendered_hdr; ++ bool rendered_hdr_valid; + struct mp_image_params target_params; + + // OpenGL: the caller's GL context, and the swapchain over its framebuffer. +@@ -458,11 +461,6 @@ static void reconfig(struct render_backend *ctx, struct mp_image_params *params) + { + struct priv *p = ctx->priv; + mppl_video_config(p->renderer, params); +- if (p->vo) { +- mp_mutex_lock(&p->vo->params_mutex); +- p->vo->target_params = NULL; +- mp_mutex_unlock(&p->vo->params_mutex); +- } + } + + static void reset(struct render_backend *ctx) +@@ -494,7 +492,7 @@ static struct mp_image *get_image(struct render_backend *ctx, int imgfmt, + static void update_external(struct render_backend *ctx, struct vo *vo) + { + struct priv *p = ctx->priv; +- p->vo = vo; ++ p->has_vo = vo != NULL; + mppl_video_set_osd_source(p->renderer, vo ? vo->osd : NULL); + if (vo) { + mppl_video_reload_options(p->renderer); +@@ -575,7 +573,7 @@ static int render(struct render_backend *ctx, mpv_render_param *params, + struct vo_frame *frame) + { + struct priv *p = ctx->priv; +- if (!p->vo) ++ if (!p->has_vo) + return MPV_ERROR_UNINITIALIZED; + + mppl_video_begin_frame(p->renderer, frame, (struct pl_color_space){0}, 0); +@@ -654,18 +652,26 @@ static int render(struct render_backend *ctx, mpv_render_param *params, + ok = false; + + if (ok) { +- mp_mutex_lock(&p->vo->params_mutex); +- p->target_params = target_params; +- p->vo->target_params = &p->target_params; +- if (p->vo->params) { +- p->vo->has_peak_detect_values = +- mppl_video_get_hdr_metadata(p->renderer, &p->vo->params->color.hdr); +- } +- mp_mutex_unlock(&p->vo->params_mutex); ++ p->rendered_target_params = target_params; ++ p->rendered_hdr_valid = mppl_video_get_hdr_metadata(p->renderer, &p->rendered_hdr); + } + return ok ? 0 : MPV_ERROR_GENERIC; + } + ++static void publish_frame(struct render_backend *ctx, struct vo *vo) ++{ ++ struct priv *p = ctx->priv; ++ mp_mutex_lock(&vo->params_mutex); ++ p->target_params = p->rendered_target_params; ++ vo->target_params = &p->target_params; ++ if (vo->params) { ++ vo->has_peak_detect_values = p->rendered_hdr_valid; ++ if (p->rendered_hdr_valid) ++ vo->params->color.hdr = p->rendered_hdr; ++ } ++ mp_mutex_unlock(&vo->params_mutex); ++} ++ + const struct render_backend_fns render_backend_gpu_next = { + .name = "gpu-next", + .init = init, +@@ -680,6 +686,7 @@ const struct render_backend_fns render_backend_gpu_next = { + .resize = resize, + .get_target_size = get_target_size, + .render = render, ++ .publish_frame = publish_frame, + .destroy = destroy, + }; + +diff --git a/video/out/libmpv.h b/video/out/libmpv.h +index 4ba0c54ad4..babb1862ee 100644 +--- a/video/out/libmpv.h ++++ b/video/out/libmpv.h +@@ -76,6 +76,9 @@ struct render_backend_fns { + // Implementation of mpv_render_context_render(). + int (*render)(struct render_backend *ctx, mpv_render_param *params, + struct vo_frame *frame); ++ // Publish metadata from a completed frame while the caller holds the ++ // context lock and the associated VO is still live. Optional. ++ void (*publish_frame)(struct render_backend *ctx, struct vo *vo); + // Free all data in ctx->priv. + void (*destroy)(struct render_backend *ctx); + }; +diff --git a/video/out/vo_libmpv.c b/video/out/vo_libmpv.c +index 0babb7e8a5..f4215d1f89 100644 +--- a/video/out/vo_libmpv.c ++++ b/video/out/vo_libmpv.c +@@ -446,11 +446,18 @@ int mpv_render_context_render(mpv_render_context *ctx, mpv_render_param *params) + if (frame != &dummy) + talloc_free(frame); + +- if (GET_MPV_RENDER_PARAM(params, MPV_RENDER_PARAM_BLOCK_FOR_TARGET_TIME, +- int, 1)) +- { ++ bool wait_for_present = GET_MPV_RENDER_PARAM( ++ params, MPV_RENDER_PARAM_BLOCK_FOR_TARGET_TIME, int, 1); ++ bool publish = do_render && err == 0 && ctx->renderer->fns->publish_frame; ++ if (wait_for_present || publish) { + mp_mutex_lock(&ctx->lock); +- while (wait_present_count > ctx->present_count) ++ // The VO can be replaced while the lock is dropped for GPU work. ++ // Detach and attach both set need_update_external until the render ++ // thread starts the next frame, even if the VO address is reused. ++ if (publish && ctx->vo && !ctx->need_update_external && ++ !ctx->need_reconfig && !ctx->need_reset) ++ ctx->renderer->fns->publish_frame(ctx->renderer, ctx->vo); ++ while (wait_for_present && wait_present_count > ctx->present_count) + mp_cond_wait(&ctx->video_wait, &ctx->lock); + mp_mutex_unlock(&ctx->lock); + } +@@ -705,6 +712,10 @@ static int reconfig(struct vo *vo, struct mp_image_params *params) + mp_mutex_lock(&ctx->lock); + forget_frames(ctx, true); + ctx->img_params = *params; ++ mp_mutex_lock(&vo->params_mutex); ++ vo->target_params = NULL; ++ vo->has_peak_detect_values = false; ++ mp_mutex_unlock(&vo->params_mutex); + ctx->need_reconfig = true; + ctx->need_resize = true; + mp_mutex_unlock(&ctx->lock); diff --git a/tools/run-device-tests.py b/tools/run-device-tests.py index c35b2391..b15e33d0 100755 --- a/tools/run-device-tests.py +++ b/tools/run-device-tests.py @@ -1232,7 +1232,7 @@ def export_attempt(private, destination, result): # observed from the separately owned product process. crash = journey / "mobile-crash-evidence.json" if (result.get("status") == "crashed" and crash.is_file() and not crash.is_symlink() - and crash.stat().st_size <= 1024): + and crash.stat().st_size <= 4096): try: evidence = json.loads(crash.read_text()) except (OSError, ValueError): @@ -1241,8 +1241,20 @@ def export_attempt(private, destination, result): and evidence["signal"] == result.get("signal") and type(evidence.get("pid")) is int and evidence["pid"] > 0 and evidence.get("platform") in ("android", "tvos", "ios")): - write_journal(destination / "mobile-crash-evidence.json", - {key: evidence[key] for key in ("platform", "pid", "signal")}) + exported = {key: evidence[key] for key in ("platform", "pid", "signal")} + if evidence["platform"] == "android" and evidence.get("abortKind") == "destroyed-mutex": + exported["abortKind"] = "destroyed-mutex" + frames = evidence.get("frames", []) + if evidence["platform"] == "android" and isinstance(frames, list): + exported["frames"] = [ + {"module": frame["module"], "offset": frame["offset"]} + for frame in frames[:12] + if isinstance(frame, dict) and isinstance(frame.get("module"), str) + and re.fullmatch(r"lib(?:spool_x86_64|Qt6(?:Core|Gui|Quick|Qml|OpenGL)" + r"|mpv|c|EGL|GLESv2|art|android_runtime)\.so", frame["module"]) + and isinstance(frame.get("offset"), str) + and re.fullmatch(r"[0-9a-f]{1,16}", frame["offset"])] + write_journal(destination / "mobile-crash-evidence.json", exported) images.extend(journey / name for name in ("frame.png", "library-text.png", "mobile-default-startup.png", "download-failure.png")) for image in images: From c87cb39d9b7abdd2e535473d5d95b134340333d9 Mon Sep 17 00:00:00 2001 From: Sacha Korban Date: Fri, 27 Nov 2026 02:50:05 +1100 Subject: [PATCH 13/39] fix(webos): restore audio sync and expose playback milestones Consolidate the release milestone ending at a27cb5cfc551000099c4c72e73a935b66959439d. Original starting snapshot: fbae66cd83d21be5eb8ad0192ceb9996edbd18d0. --- build-ipk.sh | 7 +- src/app/SettingsController.cpp | 6 +- src/app/SettingsSchema.cpp | 25 ++-- src/app/SettingsSchema.h | 1 + src/main.cpp | 98 ++++++++++++ src/platform/webos/WebOSAudioRoute.cpp | 54 ++++++- src/platform/webos/WebOSAudioSyncPolicy.cpp | 29 ++-- src/platform/webos/WebOSAudioSyncPolicy.h | 6 + src/platform/webos/WebOSSettingsPolicy.cpp | 10 +- src/player/MpvOptionProfile.cpp | 25 ++-- src/player/MpvOptionProfile.h | 2 +- src/player/PlayerController.cpp | 22 ++- src/player/PlayerController.h | 2 + tests/app/SettingsSchemaTest.cpp | 9 +- tests/player/AudioSyncPolicyTest.cpp | 6 + tests/player/MpvOptionProfileTest.cpp | 16 ++ tools/android/build-dependencies.sh | 19 +-- .../patches/mpv-libmpv-vo-lifetime.patch | 141 ------------------ tools/manifests/mpv-native.json | 1 + 19 files changed, 268 insertions(+), 211 deletions(-) delete mode 100644 tools/android/patches/mpv-libmpv-vo-lifetime.patch diff --git a/build-ipk.sh b/build-ipk.sh index c3727d4d..a24f8625 100755 --- a/build-ipk.sh +++ b/build-ipk.sh @@ -363,7 +363,10 @@ if [[ "$MPV_DYNAMIC_SECTION" != *"[libcurl.so"* ]]; then echo "error: $(basename "$MPV_STAGED_LIBRARY") does not use packaged shared curl" >&2 exit 1 fi - +if [[ "$MPV_DYNAMIC_SECTION" != *"[libpulse.so.0]"* ]]; then + echo "error: $(basename "$MPV_STAGED_LIBRARY") does not use firmware PulseAudio" >&2 + exit 1 +fi # Keep every private dependency rooted in the package instead of binding to # firmware libraries with the same SONAME. @@ -414,7 +417,7 @@ for firmware_soname in \ libatomic.so.1 libz.so.1 libfontconfig.so.1 libfreetype.so.6 \ libEGL.so.1 libGLESv2.so.2 libwayland-client.so.0 libwayland-cursor.so.0 \ libwayland-egl.so libwayland-egl.so.1 libwayland-webos-client.so.0 libwayland-webos-client.so.1 \ - libxkbcommon.so.0 libasound.so.2 libglib-2.0.so.0 libpbnjson_c.so.2 libluna-service2.so.3 \ + libxkbcommon.so.0 libasound.so.2 libpulse.so.0 libglib-2.0.so.0 libpbnjson_c.so.2 libluna-service2.so.3 \ libpf-1.0.so.1 libplayerAPIs.so.1 libunwind.so.8 \ libPmLogLib.so.3 libnyx.so.0 libudev.so.0 libhelpers.so.1 libhelpers.so.2 do diff --git a/src/app/SettingsController.cpp b/src/app/SettingsController.cpp index 0e66d9db..cfa5480b 100644 --- a/src/app/SettingsController.cpp +++ b/src/app/SettingsController.cpp @@ -1032,6 +1032,10 @@ void SettingsController::applySchemaValue(const SettingSpec& spec, const QVarian if (apply && m_player) m_player->setAudioOutputMode(m_audioOutputMode); break; + case SettingTarget::AlsaBuffer: + if (m_player && (apply || !m_localSettingsLoaded)) + m_player->setAlsaBufferMs(value.toInt()); + break; case SettingTarget::AudioPassthrough: if (m_player && (apply || !m_localSettingsLoaded)) m_player->setAudioPassthrough(value.toString()); @@ -1348,11 +1352,11 @@ void SettingsController::updateAudioOutputRoute(const QString& output, int displ qInfo() << "app: audio output" << normalizedOutput << "display latency" << displayLatencyMs << "ms; output latency" << outputLatencyMs << "ms; automatic delay" << automaticDelay << "ms"; - m_audioOutputLoadGeneration.invalidate(); m_currentAudioOutput = normalizedOutput; m_automaticAudioDelayMs = automaticDelay; m_displayLatencyMs = displayLatencyMs; if (outputChanged) { + m_audioOutputLoadGeneration.invalidate(); m_audioDelayMs = 0; m_values.insert(QStringLiteral("settings/audioDelayMs"), m_audioDelayMs); } diff --git a/src/app/SettingsSchema.cpp b/src/app/SettingsSchema.cpp index a84398f3..5523becc 100644 --- a/src/app/SettingsSchema.cpp +++ b/src/app/SettingsSchema.cpp @@ -419,6 +419,12 @@ const QVector& settingSpecs() audioOutput.defaultValue, audioOutput.choices, audioOutput.choiceCount, SettingTarget::AudioOutput, SettingNormalizer::AudioOutput) .advanced(), + sliderSpec("playback/alsaBufferMs", "Playback", "ALSA buffer", + "A larger buffer can reduce audio dropouts. Applies the next time something plays", "40", 20, 250, 10, + " ms", SettingTarget::AlsaBuffer) + .onWebOS() + .advanced() + .whenSetTo("settings/audioOutputMode", "alsa"), selectSpec("playback/audioPassthrough", "Playback", "Audio passthrough", "Sends surround soundtracks to an AV receiver or soundbar undecoded. Leave off unless one is " "connected over HDMI or optical", @@ -725,15 +731,16 @@ const QVector& settingSpecs() QStringLiteral("playback/hardwareDecoding"), QStringLiteral("playback/renderQuality"), QStringLiteral("playback/autoAdjustQuality"), QStringLiteral("playback/graphicsApi"), QStringLiteral("playback/hdrOutput"), QStringLiteral("playback/hdrPeakNits"), - QStringLiteral("settings/audioOutputMode"), QStringLiteral("playback/forwardCacheSizeMiB"), - QStringLiteral("playback/threadedStreaming"), QStringLiteral("playback/maxStreamingThreads"), - QStringLiteral("playback/forceStreamingThreads"), QStringLiteral("subtitles/hdrBrightnessPercent"), - QStringLiteral("input/redButton"), QStringLiteral("input/greenButton"), - QStringLiteral("input/yellowButton"), QStringLiteral("input/blueButton"), - QStringLiteral("updates/automatic"), QStringLiteral("providers/updates"), - QStringLiteral("shell/diagnostics"), QStringLiteral("settings/toneMappingVisualization"), - QStringLiteral("shell/latencyGuard"), QStringLiteral("shell/latencyOverlay"), - QStringLiteral("theme/antialiasedText"), QStringLiteral("theme/renderMode") }; + QStringLiteral("settings/audioOutputMode"), QStringLiteral("playback/alsaBufferMs"), + QStringLiteral("playback/forwardCacheSizeMiB"), QStringLiteral("playback/threadedStreaming"), + QStringLiteral("playback/maxStreamingThreads"), QStringLiteral("playback/forceStreamingThreads"), + QStringLiteral("subtitles/hdrBrightnessPercent"), QStringLiteral("input/redButton"), + QStringLiteral("input/greenButton"), QStringLiteral("input/yellowButton"), + QStringLiteral("input/blueButton"), QStringLiteral("updates/automatic"), + QStringLiteral("providers/updates"), QStringLiteral("shell/diagnostics"), + QStringLiteral("settings/toneMappingVisualization"), QStringLiteral("shell/latencyGuard"), + QStringLiteral("shell/latencyOverlay"), QStringLiteral("theme/antialiasedText"), + QStringLiteral("theme/renderMode") }; for (SettingSpec& spec : rows) { const QString key = QString::fromLatin1(spec.key); const QLatin1String group(spec.group); diff --git a/src/app/SettingsSchema.h b/src/app/SettingsSchema.h index ef3a8ad7..20b008f8 100644 --- a/src/app/SettingsSchema.h +++ b/src/app/SettingsSchema.h @@ -57,6 +57,7 @@ enum class SettingTarget { PlayerVolumeSlider, AudioDelay, AudioOutput, + AlsaBuffer, AudioPassthrough, UiScale, ArtworkFormat, diff --git a/src/main.cpp b/src/main.cpp index 624d5b79..7609a9eb 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -87,6 +87,9 @@ #include #include #include +#ifdef SPOOL_WEBOS +#include +#endif #include #include #include @@ -327,6 +330,95 @@ void logLine(const char *fmt, ...) writeStandardError(line); } +#ifdef SPOOL_WEBOS +void recordWebOSPlaybackDiagnostic(const QByteArray& message) +{ + // The developer account shares the jailer group. Only publish fixed + // milestones here. The live application log stays private to Spool. + static constexpr struct { + const char *prefix; + const char *event; + } playerEvents[] = { + { "webOS playback diagnostics ready", "Spool started" }, + { "player: play requested", "play requested" }, + { "player: prepareForPlaybackSurface completed", "native surface ready" }, + { "player: prepareForPlaybackSurface failed", "native surface failed" }, + { "player: audio-only playback", "audio only" }, + { "player: file loaded", "file loaded" }, + { "player: playback restart", "playback restart" }, + { "player: playback failed", "playback failed" }, + { "player: end file", "file ended" }, + }; + static constexpr struct { + const char *prefix; + const char *event; + } starfishEvents[] = { + { "Using Starfish ACB display window path", "Starfish ACB window selected" }, + { "wl_webos_exported window_id_assigned=", "Starfish window assigned" }, + { "Starfish StateUpdate: LOADCOMPLETED", "Starfish load completed" }, + { "Starfish StateUpdate: PLAYING", "Starfish playing" }, + { "Starfish first displayed frame", "Starfish first displayed frame" }, + { "Starfish draw_frame:", "Starfish draw frame" }, + { "vd_starfish starting decode on keyframe", "Starfish decoding keyframe" }, + { "vd_starfish: Starfish pipeline failed", "Starfish pipeline failed" }, + { "Starfish reloading pipeline after failed load", "Starfish retrying failed load" }, + }; + QByteArray event; + for (const auto& entry : playerEvents) { + if (message.startsWith(entry.prefix)) { + event = entry.event; + break; + } + } + if (message.startsWith("mpv/")) { + const qsizetype body = message.indexOf("] "); + if (body < 0) + return; + const QByteArray text = message.mid(body + 2); + for (const auto& entry : starfishEvents) { + if (text.startsWith(entry.prefix)) { + event = entry.event; + break; + } + } + if (event.isEmpty()) { + const QByteArray header = message.first(body); + if (header.endsWith(" [error") || header.endsWith(" [fatal")) { + if (header.startsWith("mpv/ffmpeg") || header.startsWith("mpv/demux")) + event = "mpv input error"; + else if (header.startsWith("mpv/vo")) + event = "mpv video output error"; + else if (header.startsWith("mpv/ao")) + event = "mpv audio output error"; + else + event = "mpv error"; + } + } + } + if (event.isEmpty()) + return; + + static std::mutex mutex; + static QByteArray trace; + static QList recordedEvents; + const std::lock_guard lock(mutex); + if (event == "play requested") { + trace.clear(); + recordedEvents.clear(); + } + if (recordedEvents.contains(event)) + return; + recordedEvents.append(event); + trace += QByteArray::number(g_startupTimer.elapsed()) + " ms " + event + '\n'; + + QSaveFile file(QStringLiteral("/tmp/com.sachk.spool-playback.log")); + if (file.open(QIODevice::WriteOnly) + && file.setPermissions(QFileDevice::ReadOwner | QFileDevice::WriteOwner | QFileDevice::ReadGroup) + && file.write(trace) == trace.size()) + file.commit(); +} +#endif + void qtMessageHandler(QtMsgType type, const QMessageLogContext& context, const QString& message) { if (type == QtWarningMsg && !qEnvironmentVariableIsSet("SPOOL_VERBOSE_QT")) { @@ -357,6 +449,9 @@ void qtMessageHandler(QtMsgType type, const QMessageLogContext& context, const Q } const QByteArray local = Spool::sanitizedLogMessage(message).toLocal8Bit(); +#ifdef SPOOL_WEBOS + recordWebOSPlaybackDiagnostic(local); +#endif if (context.category && context.category[0]) logLine("[qt:%s] %s: %s", level, context.category, local.constData()); else @@ -562,6 +657,9 @@ int main(int argc, char **argv) g_logFile = openAppLogFile(appRootPath); logLine("%s starting", kAppId); +#ifdef SPOOL_WEBOS + recordWebOSPlaybackDiagnostic("webOS playback diagnostics ready"); +#endif logLine("startup: exec_to_main_ms=%lld static_init_ms=%.2f", static_cast(processStartupTiming.execToMainMs), processStartupTiming.staticInitializationMs); if (!g_logPath.isEmpty()) diff --git a/src/platform/webos/WebOSAudioRoute.cpp b/src/platform/webos/WebOSAudioRoute.cpp index f375d40a..16137653 100644 --- a/src/platform/webos/WebOSAudioRoute.cpp +++ b/src/platform/webos/WebOSAudioRoute.cpp @@ -1,11 +1,14 @@ #include "platform/webos/WebOSAudioRoute.h" +#include "platform/webos/WebOSAudioSyncPolicy.h" #include +#include #include #include #include #include #include +#include #include @@ -40,19 +43,54 @@ namespace { return count == 0 ? -1 : static_cast(snd_ctl_elem_value_get_integer(value, count - 1)); } - LatencySnapshot readLatency() + int firmwareMediaLatency(const QString& output) + { + static constexpr const char *paths[] = { + "/etc/palm/audiooutputd-hwdata/delay/inOutDelayExt.xml", + "/etc/palm/audiooutputd-hwdata/delay/inOutDelayExt_OLED.xml", + }; + for (const char *path : paths) { + QFile file(QString::fromLatin1(path)); + if (!file.open(QIODevice::ReadOnly)) + continue; + QXmlStreamReader xml(&file); + bool matchedOutput = false; + while (!xml.atEnd()) { + if (xml.readNext() != QXmlStreamReader::StartElement) + continue; + const auto tag = xml.name(); + if (tag.startsWith(QLatin1String("soundOutput"))) { + matchedOutput = xml.readElementText().trimmed() == output; + } else if (matchedOutput && tag.startsWith(QLatin1String("MEDIA_24P")) && tag.size() == 10) { + bool ok = false; + const int value = xml.readElementText().toInt(&ok); + if (ok && value >= 0 && value <= 2000) + return value; + } + } + } + return -1; + } + + LatencySnapshot readLatency(const QString& output) { LatencySnapshot snapshot; snd_ctl_t *control = nullptr; const int result = snd_ctl_open(&control, "hw:0", 0); if (result < 0) { qWarning() << "webOS audio route: snd_ctl_open failed" << snd_strerror(result); - return snapshot; + } else { + snapshot.displayLatencyMs = readLastInteger(control, 62); + snapshot.outputLatencyMs = readLastInteger(control, 96); + snd_ctl_close(control); } - snapshot.displayLatencyMs = readLastInteger(control, 62); - snapshot.outputLatencyMs = readLastInteger(control, 96); - snd_ctl_close(control); - return snapshot; + const int firmwareMs = snapshot.outputLatencyMs <= 0 ? firmwareMediaLatency(output) : -1; + const auto resolved = AudioSyncPolicy::resolveRouteLatencies( + output, snapshot.displayLatencyMs, snapshot.outputLatencyMs, firmwareMs); + qInfo() << "webOS audio latency" << output << "controls" << snapshot.displayLatencyMs + << snapshot.outputLatencyMs << "firmware media" << firmwareMs << "resolved" << resolved.displayMs + << resolved.outputMs; + return { resolved.displayMs, resolved.outputMs }; } } // namespace @@ -94,7 +132,7 @@ WebOSAudioRoute::WebOSAudioRoute(QObject *parent) QTimer::singleShot(250, this, [this, output, generation] { if (m_platform->generation.load() != generation) return; - const LatencySnapshot settled = readLatency(); + const LatencySnapshot settled = readLatency(output); qInfo() << "webOS audio route settled" << output << settled.displayLatencyMs << settled.outputLatencyMs; emit routeChanged(output, settled.displayLatencyMs, settled.outputLatencyMs); }); @@ -113,7 +151,7 @@ void WebOSAudioRoute::acceptServicePayload(const QByteArray& payload) qWarning() << "webOS audio route: invalid service payload"; return; } - const LatencySnapshot latency = readLatency(); + const LatencySnapshot latency = readLatency(output); { QMutexLocker locker(&m_platform->mutex); m_platform->pendingOutput = output; diff --git a/src/platform/webos/WebOSAudioSyncPolicy.cpp b/src/platform/webos/WebOSAudioSyncPolicy.cpp index 93a3bba9..19ded2ff 100644 --- a/src/platform/webos/WebOSAudioSyncPolicy.cpp +++ b/src/platform/webos/WebOSAudioSyncPolicy.cpp @@ -43,23 +43,34 @@ QString delayStorageKey(const QString& output) return QStringLiteral("settings/webosAudioDelayMs/") + normalizedOutputKey(output); } -int automaticBaseDelayMs(const QString& output, int displayLatencyMs, int outputLatencyMs) +RouteLatencies resolveRouteLatencies(const QString& output, int displayMs, int outputMs, int firmwareMediaMs) { const QString key = normalizedOutputKey(output); + // The controls can return zero-filled payloads before the route is ready. + // These fallbacks are the calibrated values from the webOS sync experiment. + int fallbackOutput = firmwareMediaMs; + if (key == QStringLiteral("external_arc")) + fallbackOutput = 53; + else if (key == QStringLiteral("tv_speaker")) + fallbackOutput = 74; + if (displayMs <= 0 && (outputMs > 0 || fallbackOutput >= 0 || key == QStringLiteral("bt_soundbar"))) + displayMs = 150; + if (outputMs <= 0 && fallbackOutput >= 0) + outputMs = fallbackOutput; + return { displayMs, outputMs }; +} +int automaticBaseDelayMs(const QString& output, int displayLatencyMs, int outputLatencyMs) +{ // The TV's Audio Latency Time control excludes Bluetooth codec, link, and // receiver latency. The measured end-to-end correction is the useful // value for this route. - if (key == QStringLiteral("bt_soundbar")) + if (normalizedOutputKey(output) == QStringLiteral("bt_soundbar")) return 20; - if (displayLatencyMs >= 0 && outputLatencyMs >= 0) - return qBound(-2000, displayLatencyMs - outputLatencyMs, 2000); - - if (key == QStringLiteral("external_arc")) - return 97; - if (key == QStringLiteral("tv_speaker")) - return 76; + const auto latency = resolveRouteLatencies(output, displayLatencyMs, outputLatencyMs); + if (latency.displayMs >= 0 && latency.outputMs >= 0) + return qBound(-2000, latency.displayMs - latency.outputMs, 2000); return 0; } diff --git a/src/platform/webos/WebOSAudioSyncPolicy.h b/src/platform/webos/WebOSAudioSyncPolicy.h index 42a761a6..a2c59549 100644 --- a/src/platform/webos/WebOSAudioSyncPolicy.h +++ b/src/platform/webos/WebOSAudioSyncPolicy.h @@ -4,9 +4,15 @@ namespace Spool::AudioSyncPolicy { +struct RouteLatencies { + int displayMs; + int outputMs; +}; + QString normalizedOutputKey(const QString& output); QString outputDisplayName(const QString& output); QString delayStorageKey(const QString& output); +RouteLatencies resolveRouteLatencies(const QString& output, int displayMs, int outputMs, int firmwareMediaMs = -1); int automaticBaseDelayMs(const QString& output, int displayLatencyMs, int outputLatencyMs); } diff --git a/src/platform/webos/WebOSSettingsPolicy.cpp b/src/platform/webos/WebOSSettingsPolicy.cpp index b462ea5d..d0897f23 100644 --- a/src/platform/webos/WebOSSettingsPolicy.cpp +++ b/src/platform/webos/WebOSSettingsPolicy.cpp @@ -5,19 +5,21 @@ namespace Spool { namespace { - constexpr SettingChoice kChoices[] = { { "alsa", "ALSA" }, { "starfish-pcm", "Starfish" } }; + constexpr SettingChoice kChoices[] + = { { "pulse", "PulseAudio" }, { "alsa", "ALSA" }, { "starfish-pcm", "Starfish" } }; } const PlatformAudioOutputPolicy& platformAudioOutputPolicy() { - static const PlatformAudioOutputPolicy policy { kChoices, 2, "alsa" }; + static const PlatformAudioOutputPolicy policy { kChoices, 3, "pulse" }; return policy; } QString normalizedPlatformAudioOutputMode(const QString& mode) { - return mode == QStringLiteral("starfish") || mode == QStringLiteral("starfish-pcm") ? QStringLiteral("starfish-pcm") - : QStringLiteral("alsa"); + if (mode == QStringLiteral("starfish") || mode == QStringLiteral("starfish-pcm")) + return QStringLiteral("starfish-pcm"); + return mode == QStringLiteral("alsa") ? mode : QStringLiteral("pulse"); } QStringList platformSystemSubtitleFonts() diff --git a/src/player/MpvOptionProfile.cpp b/src/player/MpvOptionProfile.cpp index 6aee4d7f..94ef49b3 100644 --- a/src/player/MpvOptionProfile.cpp +++ b/src/player/MpvOptionProfile.cpp @@ -481,7 +481,7 @@ QByteArray MpvOptionProfile::systemCertificateBundle() std::vector MpvOptionProfile::applicationOptions(Platform platform, bool needsVideoSurface, const QString& audioOutputMode, const QByteArray& logPath, const StreamingOptions& streaming, const QByteArray& demuxerMaxBytes, const QByteArray& demuxerMaxBackBytes, bool embeddedVideo, - const QByteArray& shaderCachePath, const QByteArray& certificateBundlePath, RenderQuality quality) + const QByteArray& shaderCachePath, const QByteArray& certificateBundlePath, RenderQuality quality, int alsaBufferMs) { const bool webOS = platform == Platform::WebOS; const bool android = platform == Platform::Android; @@ -491,8 +491,6 @@ std::vector MpvOptionProfile::applicationOptions(Platform platform, b // had a second option; Android does now. const NetworkProfile network = networkProfile(platform); const QString normalizedAudioOutput = webOS ? audioOutputMode : normalizedAudioOutputMode(audioOutputMode); - const bool starfishAudio = webOS && !embeddedVideo - && (audioOutputMode == QStringLiteral("starfish") || audioOutputMode == QStringLiteral("starfish-pcm")); std::vector options { { "terminal", "no" }, @@ -542,10 +540,14 @@ std::vector MpvOptionProfile::applicationOptions(Platform platform, b } if (webOS) { + const bool starfishRequested + = audioOutputMode == QStringLiteral("starfish") || audioOutputMode == QStringLiteral("starfish-pcm"); + const bool starfishAudio = starfishRequested && !embeddedVideo; + const bool pulseAudio = !starfishRequested && audioOutputMode != QStringLiteral("alsa"); options.push_back({ "initial-audio-sync", embeddedVideo ? "yes" : "no" }); options.push_back({ "vo", !needsVideoSurface ? "null" : embeddedVideo ? "libmpv" : "starfish" }); options.push_back({ "vd", embeddedVideo ? "lavc" : "starfish" }); - options.push_back({ "ao", starfishAudio ? "starfish,null" : "alsa,null" }); + options.push_back({ "ao", starfishAudio ? "starfish,null" : pulseAudio ? "pulse,null" : "alsa,null" }); if (!embeddedVideo) options.push_back({ "vo-starfish-audio-hint", starfishAudio ? "yes" : "no" }); else { @@ -562,19 +564,20 @@ std::vector MpvOptionProfile::applicationOptions(Platform platform, b options.push_back({ "dither-depth", "no" }); options.push_back({ "deinterlace", "auto" }); } - if (!starfishAudio) { - options.push_back({ "audio-device", "alsa/hw:0,7" }); + if (!starfishAudio) options.push_back({ "video-sync", "display-resample" }); - } options.push_back({ "audio-channels", "stereo" }); options.push_back({ "audio-format", starfishAudio ? "s16" : "s32" }); options.push_back({ "audio-samplerate", starfishAudio ? "192000" : "48000" }); if (!starfishAudio) { options.push_back({ "audio-buffer", embeddedVideo ? "0.100" : "0.050" }); - options.push_back({ "alsa-buffer-time", "40000" }); - options.push_back({ "alsa-periods", "8" }); - options.push_back({ "alsa-no-hw-pause", "yes" }); - options.push_back({ "alsa-bounded-io", "yes" }); + if (!pulseAudio) { + options.push_back({ "audio-device", "alsa/hw:0,7" }); + options.push_back({ "alsa-buffer-time", QByteArray::number(qBound(20, alsaBufferMs, 250) * 1000) }); + options.push_back({ "alsa-periods", "8" }); + options.push_back({ "alsa-no-hw-pause", "yes" }); + options.push_back({ "alsa-bounded-io", "yes" }); + } } else { options.push_back({ "ao-starfish-feed-ahead", "0.4" }); } diff --git a/src/player/MpvOptionProfile.h b/src/player/MpvOptionProfile.h index 1f437cc4..03c9ef29 100644 --- a/src/player/MpvOptionProfile.h +++ b/src/player/MpvOptionProfile.h @@ -78,7 +78,7 @@ class MpvOptionProfile final { const QByteArray& demuxerMaxBytes = QByteArrayLiteral("64M"), const QByteArray& demuxerMaxBackBytes = QByteArrayLiteral("32M"), bool embeddedVideo = false, const QByteArray& shaderCachePath = {}, const QByteArray& certificateBundlePath = {}, - RenderQuality quality = RenderQuality::Balanced); + RenderQuality quality = RenderQuality::Balanced, int alsaBufferMs = 40); static std::vector subtitleOptions( const SubtitlePreferences& preferences, bool subtitlesEnabled, bool hdrPlayback = false); }; diff --git a/src/player/PlayerController.cpp b/src/player/PlayerController.cpp index 4f8531a8..a42ecb79 100644 --- a/src/player/PlayerController.cpp +++ b/src/player/PlayerController.cpp @@ -53,14 +53,17 @@ namespace Spool { namespace { - // Warnings and errors are what a player problem report needs; - // SPOOL_MPV_LOG_LEVEL accepts any level mpv understands when more detail is - // wanted. + // The webOS playback trace uses informational Starfish milestones. const char *mpvLogLevel() { +#ifdef SPOOL_WEBOS + constexpr auto defaultLevel = "info"; +#else + constexpr auto defaultLevel = "warn"; +#endif static const QByteArray level = qEnvironmentVariableIsSet("SPOOL_MPV_LOG_LEVEL") ? qgetenv("SPOOL_MPV_LOG_LEVEL") - : QByteArrayLiteral("warn"); + : QByteArray(defaultLevel); return level.constData(); } @@ -682,7 +685,7 @@ void PlayerController::prepareMpvAsync(bool needsVideoSurface, bool embeddedVide preparation->options = MpvOptionProfile::preInitializeOptions(m_mpvConfigPolicy); auto applicationOptions = MpvOptionProfile::applicationOptions(preparation->platform, needsVideoSurface, m_audioOutputMode, {}, m_streamingOptions, m_demuxerMaxBytes, m_demuxerMaxBackBytes, embeddedVideo, - mpvShaderCachePath(), certificateBundle, m_renderQuality); + mpvShaderCachePath(), certificateBundle, m_renderQuality, m_alsaBufferMs); applicationOptions.push_back({ "sub-fonts-dir", m_subtitleFontsPath }); applicationOptions.push_back({ "osd-fonts-dir", m_subtitleFontsPath }); applicationOptions.push_back({ "osd-font", QByteArrayLiteral("IBM Plex Sans Var") }); @@ -2582,6 +2585,15 @@ void PlayerController::setAudioOutputMode(const QString& mode) emit audioOutputModeChanged(); } +void PlayerController::setAlsaBufferMs(int milliseconds) +{ + const int bufferMs = qBound(20, milliseconds, 250); + if (m_alsaBufferMs == bufferMs) + return; + m_alsaBufferMs = bufferMs; + discardPreparedMpvForOptionChange("ALSA buffer change"); +} + void PlayerController::setAudioPassthrough(const QString& mode) { const QByteArray codecs = mode == QLatin1String("all") ? QByteArrayLiteral("ac3,eac3,dts,dts-hd,truehd") diff --git a/src/player/PlayerController.h b/src/player/PlayerController.h index e6789399..3b1fd358 100644 --- a/src/player/PlayerController.h +++ b/src/player/PlayerController.h @@ -231,6 +231,7 @@ class PlayerController final : public QObject { Q_INVOKABLE void setFileAudioDelayMs(int delayMs); Q_INVOKABLE void setSubtitleDelayMs(int delayMs); Q_INVOKABLE void setAudioOutputMode(const QString& mode); + void setAlsaBufferMs(int milliseconds); void setAudioPassthrough(const QString& mode); // Applies to the next thing that plays: the render options are set on a // fresh mpv core, and every play request builds one. @@ -557,6 +558,7 @@ class PlayerController final : public QObject { double m_syncPlaybackSpeed = 1.0; bool m_syncPlaybackSpeedActive = false; QString m_audioOutputMode = QStringLiteral("auto"); + int m_alsaBufferMs = 40; QByteArray m_automaticDemuxerMaxBytes = QByteArrayLiteral("64M"); QByteArray m_demuxerMaxBytes = QByteArrayLiteral("64M"); QByteArray m_demuxerMaxBackBytes = QByteArrayLiteral("32M"); diff --git a/tests/app/SettingsSchemaTest.cpp b/tests/app/SettingsSchemaTest.cpp index 97139ccc..3286b5b3 100644 --- a/tests/app/SettingsSchemaTest.cpp +++ b/tests/app/SettingsSchemaTest.cpp @@ -169,9 +169,12 @@ void audioOutputChoicesMatchPlatform() { const SettingSpec& audioOutput = requiredSpec(QStringLiteral("settings/audioOutputMode")); #ifdef SPOOL_WEBOS - const QStringList expectedChoices { QStringLiteral("alsa"), QStringLiteral("starfish-pcm") }; - const QString expectedDefault = QStringLiteral("alsa"); - const QString unknownFallback = QStringLiteral("alsa"); + const QStringList expectedChoices { QStringLiteral("pulse"), QStringLiteral("alsa"), + QStringLiteral("starfish-pcm") }; + const QString expectedDefault = QStringLiteral("pulse"); + const QString unknownFallback = QStringLiteral("pulse"); + require(normalizedSettingValue(audioOutput, QStringLiteral("alsa")).toString() == QStringLiteral("alsa"), + QStringLiteral("saved ALSA output should be preserved")); require( normalizedSettingValue(audioOutput, QStringLiteral("starfish")).toString() == QStringLiteral("starfish-pcm"), QStringLiteral("legacy Starfish output did not normalize to starfish-pcm")); diff --git a/tests/player/AudioSyncPolicyTest.cpp b/tests/player/AudioSyncPolicyTest.cpp index c99cc5f2..aecf45ec 100644 --- a/tests/player/AudioSyncPolicyTest.cpp +++ b/tests/player/AudioSyncPolicyTest.cpp @@ -40,6 +40,12 @@ SPOOL_TEST_MAIN("audio-sync-policy") "Bluetooth must use the calibrated end-to-end delay"); require(AudioSyncPolicy::automaticBaseDelayMs(QStringLiteral("external_arc"), -1, -1) == 97, "ARC fallback delay was incorrect"); + const auto inactiveArc = AudioSyncPolicy::resolveRouteLatencies(QStringLiteral("external_arc"), 0, 0); + require(inactiveArc.displayMs == 150 && inactiveArc.outputMs == 53, + "Zero-filled ARC readings need the calibrated fallback"); + const auto headphones = AudioSyncPolicy::resolveRouteLatencies(QStringLiteral("headphone"), 0, 0, 60); + require(headphones.displayMs == 150 && headphones.outputMs == 60, + "Firmware output latency should be used when available"); return EXIT_SUCCESS; } diff --git a/tests/player/MpvOptionProfileTest.cpp b/tests/player/MpvOptionProfileTest.cpp index d19a1352..5ab43d3e 100644 --- a/tests/player/MpvOptionProfileTest.cpp +++ b/tests/player/MpvOptionProfileTest.cpp @@ -404,6 +404,22 @@ SPOOL_TEST_MAIN("mpv-option-profile") "split-clock playback should not advertise pipeline audio"); require(valueFor(webOSAlsa, "alsa-no-hw-pause") == "yes", "webOS ALSA should avoid the broken hardware pause path"); require(valueFor(webOSAlsa, "alsa-bounded-io") == "yes", "webOS ALSA should use bounded direct-device I/O"); + require( + valueFor(webOSAlsa, "alsa-buffer-time") == "40000", "webOS should keep the existing ALSA buffer by default"); + const auto webOSAlsaTuned = MpvOptionProfile::applicationOptions(MpvOptionProfile::Platform::WebOS, true, + QStringLiteral("alsa"), {}, {}, {}, {}, false, {}, {}, MpvOptionProfile::RenderQuality::Balanced, 120); + require(valueFor(webOSAlsaTuned, "alsa-buffer-time") == "120000", "ALSA buffer is specified in microseconds"); + + const auto webOSPulse = profileOptions(MpvConfigPolicy {}, MpvOptionProfile::Platform::WebOS, + QStringLiteral("pulse"), QByteArrayLiteral("/tmp/mpv.log")); + require(valueFor(webOSPulse, "ao") == "pulse,null", "webOS PulseAudio should use its native output"); + require(valueFor(webOSPulse, "audio-device").isEmpty(), "PulseAudio should follow the system's default sink"); + require(valueFor(webOSPulse, "alsa-buffer-time").isEmpty(), "PulseAudio should not use ALSA settings"); + require(valueFor(webOSPulse, "video-sync") == "display-resample", "PulseAudio should follow the display clock"); + require(valueFor(webOSPulse, "vo-starfish-audio-hint") == "no", "Starfish must not claim PulseAudio playback"); + const auto webOSDefault = profileOptions(MpvConfigPolicy {}, MpvOptionProfile::Platform::WebOS, + QStringLiteral("auto"), QByteArrayLiteral("/tmp/mpv.log")); + require(valueFor(webOSDefault, "ao") == "pulse,null", "webOS should prewarm with PulseAudio by default"); PlaybackSession softwareSession; softwareSession.playMethod = QStringLiteral("DirectPlay"); diff --git a/tools/android/build-dependencies.sh b/tools/android/build-dependencies.sh index 09541a42..5040bff9 100755 --- a/tools/android/build-dependencies.sh +++ b/tools/android/build-dependencies.sh @@ -301,8 +301,6 @@ build_mpv() { # Include actual source changes and the compiler/recipe, not only the static # dependencies. A matching git revision alone cannot bless stale dirty bytes. local stamp="$PREFIX/lib/.spool-mpv-dependencies" - local source="$MPV_SRC" - local backport="$ROOT/tools/android/patches/mpv-libmpv-vo-lifetime.patch" local source_pin pin source_pin="$( cd "$MPV_SRC" || exit @@ -316,26 +314,13 @@ build_mpv() { pin="$( printf '%s\n' "$source_pin" "$ABI" "$API" "$ANDROID_NDK_ROOT" sha256sum "${BASH_SOURCE[0]}" "$ROOT/tools/manifests/toolchain.json" \ - "$ROOT/tools/manifests/mpv-native.json" "$ANDROID_NDK_ROOT/source.properties" "$backport" || exit + "$ROOT/tools/manifests/mpv-native.json" "$ANDROID_NDK_ROOT/source.properties" || exit cat "$PREFIX/lib/pkgconfig/.spool-ffmpeg-source" "$PREFIX/lib/.spool-curl-configuration" )" [[ -f "$PREFIX/lib/libmpv.so" && -f "$stamp" && "$(<"$stamp")" == "$pin" ]] && return local build="$BUILD_ROOT/mpv" rm -rf "$build" - # Backport the VO lifetime fix to the pinned Android source until Spool can - # take the merged mpv revision. Keep the submodule checkout untouched. - if [[ "$source" == "$ROOT/mpv" && "${source_pin%%$'\n'*}" == 8eb31c4d7745d650bc3531cb90e140d53f81e571 ]]; then - source="$BUILD_ROOT/mpv-source" - rm -rf "$source" - mkdir -p "$source" - git -C "$MPV_SRC" archive HEAD | tar -xf - -C "$source" - git -C "$MPV_SRC" diff --binary HEAD -- | - GIT_CEILING_DIRECTORIES="$BUILD_ROOT" git -C "$source" apply --allow-empty - - git -C "$MPV_SRC" ls-files --others --exclude-standard -z | - tar -C "$MPV_SRC" --null -T - -cf - | tar -xf - -C "$source" - "$MANIFEST_PATCH" -d "$source" -p1 --forward <"$backport" - fi - meson setup "$build" "$source" \ + meson setup "$build" "$MPV_SRC" \ --cross-file "$CROSS_FILE" --prefix "$PREFIX" --default-library shared \ -Dcplayer=false -Dlibmpv=true -Dbuild-date=false -Dtests=false \ -Dlua=lua -Djavascript=disabled -Dmanpage-build=disabled \ diff --git a/tools/android/patches/mpv-libmpv-vo-lifetime.patch b/tools/android/patches/mpv-libmpv-vo-lifetime.patch deleted file mode 100644 index d80d316e..00000000 --- a/tools/android/patches/mpv-libmpv-vo-lifetime.patch +++ /dev/null @@ -1,141 +0,0 @@ -diff --git a/video/out/gpu_next/libmpv_gpu_next.c b/video/out/gpu_next/libmpv_gpu_next.c -index 2eaa0d7fef..3212d118be 100644 ---- a/video/out/gpu_next/libmpv_gpu_next.c -+++ b/video/out/gpu_next/libmpv_gpu_next.c -@@ -78,7 +78,10 @@ struct priv { - struct gpu_ctx *gpu_ctx; - struct mppl_video *renderer; - struct mp_hwdec_devices *hwdec_devs; -- struct vo *vo; -+ bool has_vo; -+ struct mp_image_params rendered_target_params; -+ struct pl_hdr_metadata rendered_hdr; -+ bool rendered_hdr_valid; - struct mp_image_params target_params; - - // OpenGL: the caller's GL context, and the swapchain over its framebuffer. -@@ -458,11 +461,6 @@ static void reconfig(struct render_backend *ctx, struct mp_image_params *params) - { - struct priv *p = ctx->priv; - mppl_video_config(p->renderer, params); -- if (p->vo) { -- mp_mutex_lock(&p->vo->params_mutex); -- p->vo->target_params = NULL; -- mp_mutex_unlock(&p->vo->params_mutex); -- } - } - - static void reset(struct render_backend *ctx) -@@ -494,7 +492,7 @@ static struct mp_image *get_image(struct render_backend *ctx, int imgfmt, - static void update_external(struct render_backend *ctx, struct vo *vo) - { - struct priv *p = ctx->priv; -- p->vo = vo; -+ p->has_vo = vo != NULL; - mppl_video_set_osd_source(p->renderer, vo ? vo->osd : NULL); - if (vo) { - mppl_video_reload_options(p->renderer); -@@ -575,7 +573,7 @@ static int render(struct render_backend *ctx, mpv_render_param *params, - struct vo_frame *frame) - { - struct priv *p = ctx->priv; -- if (!p->vo) -+ if (!p->has_vo) - return MPV_ERROR_UNINITIALIZED; - - mppl_video_begin_frame(p->renderer, frame, (struct pl_color_space){0}, 0); -@@ -654,18 +652,26 @@ static int render(struct render_backend *ctx, mpv_render_param *params, - ok = false; - - if (ok) { -- mp_mutex_lock(&p->vo->params_mutex); -- p->target_params = target_params; -- p->vo->target_params = &p->target_params; -- if (p->vo->params) { -- p->vo->has_peak_detect_values = -- mppl_video_get_hdr_metadata(p->renderer, &p->vo->params->color.hdr); -- } -- mp_mutex_unlock(&p->vo->params_mutex); -+ p->rendered_target_params = target_params; -+ p->rendered_hdr_valid = mppl_video_get_hdr_metadata(p->renderer, &p->rendered_hdr); - } - return ok ? 0 : MPV_ERROR_GENERIC; - } - -+static void publish_frame(struct render_backend *ctx, struct vo *vo) -+{ -+ struct priv *p = ctx->priv; -+ mp_mutex_lock(&vo->params_mutex); -+ p->target_params = p->rendered_target_params; -+ vo->target_params = &p->target_params; -+ if (vo->params) { -+ vo->has_peak_detect_values = p->rendered_hdr_valid; -+ if (p->rendered_hdr_valid) -+ vo->params->color.hdr = p->rendered_hdr; -+ } -+ mp_mutex_unlock(&vo->params_mutex); -+} -+ - const struct render_backend_fns render_backend_gpu_next = { - .name = "gpu-next", - .init = init, -@@ -680,6 +686,7 @@ const struct render_backend_fns render_backend_gpu_next = { - .resize = resize, - .get_target_size = get_target_size, - .render = render, -+ .publish_frame = publish_frame, - .destroy = destroy, - }; - -diff --git a/video/out/libmpv.h b/video/out/libmpv.h -index 4ba0c54ad4..babb1862ee 100644 ---- a/video/out/libmpv.h -+++ b/video/out/libmpv.h -@@ -76,6 +76,9 @@ struct render_backend_fns { - // Implementation of mpv_render_context_render(). - int (*render)(struct render_backend *ctx, mpv_render_param *params, - struct vo_frame *frame); -+ // Publish metadata from a completed frame while the caller holds the -+ // context lock and the associated VO is still live. Optional. -+ void (*publish_frame)(struct render_backend *ctx, struct vo *vo); - // Free all data in ctx->priv. - void (*destroy)(struct render_backend *ctx); - }; -diff --git a/video/out/vo_libmpv.c b/video/out/vo_libmpv.c -index 0babb7e8a5..f4215d1f89 100644 ---- a/video/out/vo_libmpv.c -+++ b/video/out/vo_libmpv.c -@@ -446,11 +446,18 @@ int mpv_render_context_render(mpv_render_context *ctx, mpv_render_param *params) - if (frame != &dummy) - talloc_free(frame); - -- if (GET_MPV_RENDER_PARAM(params, MPV_RENDER_PARAM_BLOCK_FOR_TARGET_TIME, -- int, 1)) -- { -+ bool wait_for_present = GET_MPV_RENDER_PARAM( -+ params, MPV_RENDER_PARAM_BLOCK_FOR_TARGET_TIME, int, 1); -+ bool publish = do_render && err == 0 && ctx->renderer->fns->publish_frame; -+ if (wait_for_present || publish) { - mp_mutex_lock(&ctx->lock); -- while (wait_present_count > ctx->present_count) -+ // The VO can be replaced while the lock is dropped for GPU work. -+ // Detach and attach both set need_update_external until the render -+ // thread starts the next frame, even if the VO address is reused. -+ if (publish && ctx->vo && !ctx->need_update_external && -+ !ctx->need_reconfig && !ctx->need_reset) -+ ctx->renderer->fns->publish_frame(ctx->renderer, ctx->vo); -+ while (wait_for_present && wait_present_count > ctx->present_count) - mp_cond_wait(&ctx->video_wait, &ctx->lock); - mp_mutex_unlock(&ctx->lock); - } -@@ -705,6 +712,10 @@ static int reconfig(struct vo *vo, struct mp_image_params *params) - mp_mutex_lock(&ctx->lock); - forget_frames(ctx, true); - ctx->img_params = *params; -+ mp_mutex_lock(&vo->params_mutex); -+ vo->target_params = NULL; -+ vo->has_peak_detect_values = false; -+ mp_mutex_unlock(&vo->params_mutex); - ctx->need_reconfig = true; - ctx->need_resize = true; - mp_mutex_unlock(&ctx->lock); diff --git a/tools/manifests/mpv-native.json b/tools/manifests/mpv-native.json index eacf4c22..ce859fca 100644 --- a/tools/manifests/mpv-native.json +++ b/tools/manifests/mpv-native.json @@ -137,6 +137,7 @@ "webos": [ "gpl=true", "alsa=enabled", + "pulse=enabled", "wayland=enabled", "lua=enabled", "starfish=enabled" From 12c5028b2ba8d135d75eb258b6a612174f647094 Mon Sep 17 00:00:00 2001 From: Sacha Korban Date: Fri, 27 Nov 2026 02:50:05 +1100 Subject: [PATCH 14/39] feat(playback): tune cache budgets, streaming startup and paused-frame redraw Consolidate the release milestone ending at 39272acc4898e0022da6059dc22435947f2d28ce. Original starting snapshot: a27cb5cfc551000099c4c72e73a935b66959439d. --- CMakeLists.txt | 10 + flake.lock | 10 +- mpv | 2 +- src/app/MemoryBudget.cpp | 15 +- src/app/SettingsSchema.cpp | 2 +- src/app/StreamingCachePolicy.cpp | 89 +++ src/app/StreamingCachePolicy.h | 51 ++ src/diagnostics/RenderBenchmark.h | 1 - src/main.cpp | 3 +- src/player/MpvOptionProfile.cpp | 4 +- src/player/MpvOptionProfile.h | 2 +- src/player/PlayerController.cpp | 129 ++- src/player/PlayerController.h | 8 +- src/provider/ProviderRegistry.cpp | 40 +- src/provider/SpeedTest.cpp | 144 +++- src/provider/SpeedTest.h | 32 +- tests/app/SettingsControllerTest.cpp | 2 +- tests/app/StreamingCachePolicyTest.cpp | 183 +++++ tests/e2e/jellyfin_latency_e2e.py | 1004 ++++++++++++++++++++++++ tests/player/MpvOptionProfileTest.cpp | 16 +- tests/providers/ScriptRuntimeTest.cpp | 27 +- tests/providers/SourceHubSpeedTest.cpp | 37 + tests/tools/NetworkShaperTest.py | 96 ++- tests/transport/protocols.py | 69 ++ tools/network-shaper.py | 236 +++++- 25 files changed, 2083 insertions(+), 129 deletions(-) create mode 100644 src/app/StreamingCachePolicy.cpp create mode 100644 src/app/StreamingCachePolicy.h create mode 100644 tests/app/StreamingCachePolicyTest.cpp create mode 100644 tests/e2e/jellyfin_latency_e2e.py diff --git a/CMakeLists.txt b/CMakeLists.txt index f599caf2..387ccd9f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -272,6 +272,8 @@ set(SPOOL_SHELL_SOURCES src/app/LibraryQuery.h src/app/MemoryBudget.cpp src/app/MemoryBudget.h + src/app/StreamingCachePolicy.cpp + src/app/StreamingCachePolicy.h src/app/PlaybackStopPolicy.h src/app/RouterController.cpp src/app/RouterController.h @@ -869,6 +871,7 @@ if(BUILD_TESTING AND NOT SPOOL_WEBOS) artwork-concurrency tests/app/ArtworkConcurrencyTest.cpp settings-schema tests/app/SettingsSchemaTest.cpp settings-controller tests/app/SettingsControllerTest.cpp + streaming-cache-policy tests/app/StreamingCachePolicyTest.cpp settings-sync-controller tests/app/SettingsSyncControllerTest.cpp settings-sync-document tests/app/SettingsSyncDocumentTest.cpp router-controller tests/app/RouterControllerTest.cpp @@ -1369,6 +1372,13 @@ if(BUILD_TESTING AND NOT SPOOL_WEBOS) --transport-helper "${MPV_ACTIVE_SOURCE_DIR}/test/curl_transport.py" --libmpv "${SPOOL_CURL_TEST_MPV}") set_tests_properties(transport-protocols PROPERTIES LABELS traditional TIMEOUT 300) + add_test(NAME jellyfin-latency-e2e COMMAND "${Python3_EXECUTABLE}" + "${CMAKE_CURRENT_SOURCE_DIR}/tests/e2e/jellyfin_latency_e2e.py" + --libmpv "${SPOOL_CURL_TEST_MPV}" + --transport-helper "${MPV_ACTIVE_SOURCE_DIR}/test/curl_transport.py" + --shaper-script "${CMAKE_CURRENT_SOURCE_DIR}/tools/network-shaper.py" + --spool-tests "$") + set_tests_properties(jellyfin-latency-e2e PROPERTIES LABELS e2e TIMEOUT 300 SKIP_RETURN_CODE 77) add_test(NAME transport-packet-performance COMMAND bash "${CMAKE_CURRENT_SOURCE_DIR}/tools/test-transport-netns.sh" --libmpv "${SPOOL_CURL_TEST_MPV}") diff --git a/flake.lock b/flake.lock index 1f2dc696..920c2170 100644 --- a/flake.lock +++ b/flake.lock @@ -22,11 +22,11 @@ "mpv-src": { "flake": false, "locked": { - "lastModified": 1795215955, - "narHash": "sha256-W3o88zocNkbJyOHsShn9la9ZMwYqQwhM/0tX5EKiI1g=", - "ref": "refs/heads/net/integration", - "rev": "8eb31c4d7745d650bc3531cb90e140d53f81e571", - "revCount": 56227, + "lastModified": 1795681643, + "narHash": "sha256-71xK8qR/l3jf0+cLOkfV8KNpVwNno0Et801CEuKnYpc=", + "ref": "refs/heads/fix/paused-render-timeout-0.10.2", + "rev": "d3cc1b1caa397c82fdd5e3570f9bd701e6f9335e", + "revCount": 56251, "type": "git", "url": "file:./mpv" }, diff --git a/mpv b/mpv index 8eb31c4d..d3cc1b1c 160000 --- a/mpv +++ b/mpv @@ -1 +1 @@ -Subproject commit 8eb31c4d7745d650bc3531cb90e140d53f81e571 +Subproject commit d3cc1b1caa397c82fdd5e3570f9bd701e6f9335e diff --git a/src/app/MemoryBudget.cpp b/src/app/MemoryBudget.cpp index 30aa3588..df0c7f1b 100644 --- a/src/app/MemoryBudget.cpp +++ b/src/app/MemoryBudget.cpp @@ -1,5 +1,6 @@ #include "MemoryBudget.h" #include "../platform/PlatformSystemProbes.h" +#include "StreamingCachePolicy.h" #include @@ -8,6 +9,7 @@ namespace Spool { MemoryBudget MemoryBudget::detect() { const PlatformMemoryPolicy policy = platformMemoryPolicy(); + const PlatformStreamingMemoryState streamingMemory = platformStreamingMemoryState(); MemoryBudget budget; budget.memTotalBytes = policy.totalBytes; const qint64 effectiveMem = budget.memTotalBytes > 0 ? budget.memTotalBytes : policy.fallbackBytes; @@ -18,8 +20,17 @@ MemoryBudget MemoryBudget::detect() = lowMemory ? policy.baseQmlImageDiskCacheBytes / 2 : policy.baseQmlImageDiskCacheBytes; budget.artworkByteCacheBytes = static_cast( std::clamp(effectiveMem / policy.artworkDivisor, policy.minimumArtworkBytes, policy.maximumArtworkBytes)); - budget.mpvDemuxerMaxBytes = lowMemory ? QByteArrayLiteral("32M") : QByteArrayLiteral("64M"); - budget.mpvDemuxerMaxBackBytes = lowMemory ? QByteArrayLiteral("16M") : QByteArrayLiteral("32M"); + + const StreamingCacheTarget demuxerCache = computeStreamingCacheTarget({ + .totalMemoryBytes = effectiveMem, + .availableMemoryBytes = streamingMemory.availableBytes, + .availableMemoryKnown = streamingMemory.available, + .constrainedDevice = lowMemory, + .autoScaleEnabled = true, + .configuredForwardBytes = 0, + }); + budget.mpvDemuxerMaxBytes = QByteArray::number(demuxerCache.forwardBytes); + budget.mpvDemuxerMaxBackBytes = QByteArray::number(demuxerCache.backBytes); return budget; } diff --git a/src/app/SettingsSchema.cpp b/src/app/SettingsSchema.cpp index 5523becc..b5eb30e1 100644 --- a/src/app/SettingsSchema.cpp +++ b/src/app/SettingsSchema.cpp @@ -479,7 +479,7 @@ const QVector& settingSpecs() sliderSpec("playback/maxStreamingThreads", "Streaming", "Maximum concurrent requests", "Most network requests in flight at once; not decoding threads or sockets. Adapts up to this " "limit. Applies to the next playback", - "4", 1, 16, 1, "", SettingTarget::MaxStreamingThreads) + "8", 1, 16, 1, "", SettingTarget::MaxStreamingThreads) .perServer() .advanced() .whenSetTo("playback/threadedStreaming", "true"), diff --git a/src/app/StreamingCachePolicy.cpp b/src/app/StreamingCachePolicy.cpp new file mode 100644 index 00000000..73b92991 --- /dev/null +++ b/src/app/StreamingCachePolicy.cpp @@ -0,0 +1,89 @@ +#include "StreamingCachePolicy.h" + +#include + +namespace Spool { + +namespace { + + constexpr qint64 kMiB = 1024LL * 1024; + constexpr qint64 kMinForwardBytes = 16 * kMiB; + constexpr qint64 kMinBackBytes = 8 * kMiB; + constexpr qint64 kMaxManualForwardBytes = 4096 * kMiB; + constexpr qint64 kAutoMaxBackBytes = 128 * kMiB; + constexpr qint64 kAutoMaxForwardBytes = 512 * kMiB; + // Each 1:2 growth step adds 16 MiB behind + 32 MiB forward = 48 MiB total. + constexpr qint64 kRatioStepBackBytes = 16 * kMiB; + constexpr qint64 kRatioStepForwardBytes = 32 * kMiB; + constexpr qint64 kRatioStepTotalBytes = kRatioStepBackBytes + kRatioStepForwardBytes; + // Total demuxer memory at the 1:2 knee (128 MiB behind + 256 MiB forward). + constexpr qint64 kKneeTotalBytes = kAutoMaxBackBytes + 2 * kAutoMaxBackBytes; + +} // namespace + +StreamingCacheTarget computeStreamingCacheTarget(const StreamingCacheInput& input) +{ + const qint64 defaultForward = input.constrainedDevice ? 32 * kMiB : 64 * kMiB; + const qint64 baseForward + = std::clamp(input.configuredForwardBytes > 0 ? input.configuredForwardBytes : defaultForward, kMinForwardBytes, + kMaxManualForwardBytes); + const qint64 baseBack = std::clamp(baseForward / 2, kMinBackBytes, kAutoMaxBackBytes); + + if (!input.autoScaleEnabled || !input.availableMemoryKnown || input.availableMemoryBytes <= 0) + return { baseForward, baseBack }; + + const qint64 reserve = input.constrainedDevice + ? std::clamp(input.totalMemoryBytes > 0 ? input.totalMemoryBytes / 4 : 384 * kMiB, 256 * kMiB, 512 * kMiB) + : std::clamp(input.totalMemoryBytes > 0 ? input.totalMemoryBytes / 8 : 1024 * kMiB, 512 * kMiB, 2048 * kMiB); + + const qint64 surplus = std::max(0, input.availableMemoryBytes - reserve); + const qint64 usableBudget = input.constrainedDevice ? surplus / 5 : surplus / 4; + + qint64 scaledBack = 0; + qint64 scaledForward = 0; + if (usableBudget >= kKneeTotalBytes) { + scaledBack = kAutoMaxBackBytes; + const qint64 extraSteps = (usableBudget - kKneeTotalBytes) / kRatioStepForwardBytes; + scaledForward = std::min(kAutoMaxForwardBytes, 2 * kAutoMaxBackBytes + extraSteps * kRatioStepForwardBytes); + } else if (usableBudget >= kRatioStepTotalBytes) { + const qint64 steps = usableBudget / kRatioStepTotalBytes; + scaledBack = std::min(kAutoMaxBackBytes, steps * kRatioStepBackBytes); + scaledForward = std::min(2 * kAutoMaxBackBytes, steps * kRatioStepForwardBytes); + } + + const qint64 forwardBytes = std::max(baseForward, scaledForward); + const qint64 backCap = std::min(kAutoMaxBackBytes, forwardBytes / 2); + const qint64 backBytes = std::clamp(std::max(baseBack, scaledBack), kMinBackBytes, backCap); + return { forwardBytes, backBytes }; +} + +StreamingCacheTarget StreamingCacheScaler::update(const StreamingCacheTarget& candidate) +{ + if (!m_initialized) { + m_initialized = true; + m_current = candidate; + m_previousCandidate = candidate; + return m_current; + } + + // Memory pressure shrinks immediately; growth requires two consecutive samples. + const qint64 nextForward = candidate.forwardBytes <= m_current.forwardBytes + ? candidate.forwardBytes + : std::max(m_current.forwardBytes, std::min(candidate.forwardBytes, m_previousCandidate.forwardBytes)); + const qint64 nextBack = candidate.backBytes <= m_current.backBytes + ? candidate.backBytes + : std::max(m_current.backBytes, std::min(candidate.backBytes, m_previousCandidate.backBytes)); + + m_previousCandidate = candidate; + m_current = { nextForward, std::min(nextBack, nextForward / 2) }; + return m_current; +} + +void StreamingCacheScaler::reset(const StreamingCacheTarget& initial) +{ + m_initialized = true; + m_current = initial; + m_previousCandidate = initial; +} + +} // namespace Spool diff --git a/src/app/StreamingCachePolicy.h b/src/app/StreamingCachePolicy.h new file mode 100644 index 00000000..b3292cda --- /dev/null +++ b/src/app/StreamingCachePolicy.h @@ -0,0 +1,51 @@ +#pragma once + +#include + +namespace Spool { + +struct StreamingCacheTarget { + qint64 forwardBytes = 32LL * 1024 * 1024; + qint64 backBytes = 16LL * 1024 * 1024; + + bool operator==(const StreamingCacheTarget& other) const = default; +}; + +struct StreamingCacheInput { + qint64 totalMemoryBytes = 0; + qint64 availableMemoryBytes = 0; + bool availableMemoryKnown = false; + bool constrainedDevice = false; + bool autoScaleEnabled = true; + // Configured user floor for forward cache (0 uses platform default floor). + qint64 configuredForwardBytes = 0; +}; + +// Computes demuxer forward/backward cache targets based on free system memory. +// Scales smoothly at a 1:2 behind:forward growth ratio up to 128 MiB behind +// and 256 MiB forward, then continues scaling forward up to 512 MiB while +// keeping generous OS/application headroom reserved. +StreamingCacheTarget computeStreamingCacheTarget(const StreamingCacheInput& input); + +// Applies pressure-safe hysteresis to live cache budget updates: +// memory pressure shrinks immediately; growth requires two consecutive samples. +class StreamingCacheScaler final { +public: + StreamingCacheTarget update(const StreamingCacheTarget& candidate); + void reset(const StreamingCacheTarget& initial); + bool initialized() const + { + return m_initialized; + } + StreamingCacheTarget current() const + { + return m_current; + } + +private: + bool m_initialized = false; + StreamingCacheTarget m_current {}; + StreamingCacheTarget m_previousCandidate {}; +}; + +} // namespace Spool diff --git a/src/diagnostics/RenderBenchmark.h b/src/diagnostics/RenderBenchmark.h index 2fcafa24..bfcbaf11 100644 --- a/src/diagnostics/RenderBenchmark.h +++ b/src/diagnostics/RenderBenchmark.h @@ -114,7 +114,6 @@ class RenderBenchmark final : public QObject { int m_scrollSteps = 0; int m_scrollPosition = 0; bool m_scrolling = false; - qint64 m_scrollStartNs = 0; qint64 m_scrollWorstGapNs = 0; qint64 m_scrollExpectedGapNs = 0; QElapsedTimer m_scrollClock; diff --git a/src/main.cpp b/src/main.cpp index 7609a9eb..37b972d7 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1160,7 +1160,8 @@ int main(int argc, char **argv) }, [&tlsTrust](QWebSocket *socket, QUrl url) { tlsTrust.attachWebSocket(socket, [url] { return url; }, QStringLiteral("Provider")); - } }); + }, + {} }); Spool::Async::runScoped( &providers, providers.restore(), [] { }, [](const std::exception_ptr&) { }, "provider restore"); // Checked once the launch has settled, so it never competes with diff --git a/src/player/MpvOptionProfile.cpp b/src/player/MpvOptionProfile.cpp index 94ef49b3..6bd4bb32 100644 --- a/src/player/MpvOptionProfile.cpp +++ b/src/player/MpvOptionProfile.cpp @@ -382,8 +382,8 @@ QByteArray MpvOptionProfile::preloadedSubtitleStreams(const PlaybackSession& ses MpvOptionProfile::NetworkProfile MpvOptionProfile::networkProfile(Platform platform) { - return platform == Platform::WebOS ? NetworkProfile { 2 * 1024 * 1024, 512 * 1024, 128 * 1024 } - : NetworkProfile { 4 * 1024 * 1024, 1024 * 1024, 256 * 1024 }; + return platform == Platform::WebOS ? NetworkProfile { 4 * 1024 * 1024, 1024 * 1024, 128 * 1024 } + : NetworkProfile { 8 * 1024 * 1024, 4 * 1024 * 1024, 256 * 1024 }; } QByteArray MpvOptionProfile::loadFileOptions(const PlaybackSession& session) diff --git a/src/player/MpvOptionProfile.h b/src/player/MpvOptionProfile.h index 03c9ef29..b9786bad 100644 --- a/src/player/MpvOptionProfile.h +++ b/src/player/MpvOptionProfile.h @@ -45,7 +45,7 @@ class MpvOptionProfile final { struct StreamingOptions { bool enabled = true; - int maxRequests = 4; + int maxRequests = 8; int fixedRequests = 0; bool explore = true; bool allowExtraMemory = true; diff --git a/src/player/PlayerController.cpp b/src/player/PlayerController.cpp index a42ecb79..78674e5d 100644 --- a/src/player/PlayerController.cpp +++ b/src/player/PlayerController.cpp @@ -676,9 +676,10 @@ void PlayerController::prepareMpvAsync(bool needsVideoSurface, bool embeddedVide preparation->userConfig = usesUserMpvConfig(); const auto network = MpvOptionProfile::networkProfile(preparation->platform); qInfo().nospace() << "player: curl profile source=MpvOptionProfile platform=" - << platformPlaybackBackendName(embeddedVideo) << " maxRequests=" << m_maxStreamingThreads + << platformPlaybackBackendName(embeddedVideo) << " maxRequests=" << m_streamingOptions.maxRequests << " rangeBytes=" << network.rangeBytes << " ringBytes=" << network.ringBytes - << " enabled=" << m_threadedStreaming << " forced=" << m_forceStreamingThreads; + << " enabled=" << m_streamingOptions.enabled + << " forced=" << (m_streamingOptions.fixedRequests > 0); QByteArray certificateBundle = QFile::encodeName(writeTrustBundle()); if (certificateBundle.isEmpty()) certificateBundle = MpvOptionProfile::systemCertificateBundle(); @@ -1617,7 +1618,7 @@ void PlayerController::playSession(const PlaybackSession& session, bool startPau m_streamingPerformanceMetrics.clear(); m_networkQueryPending = false; m_cacheSpeedQueryPending = false; - m_sessionThreadedStreaming = m_threadedStreaming; + m_sessionThreadedStreaming = m_streamingOptions.enabled; m_sessionStreamingOptions = m_streamingOptions; m_jointExtraGrantBytes = 0; m_streamingMemoryTimer.invalidate(); @@ -2755,22 +2756,48 @@ void PlayerController::previewSubtitlePreferences(const SubtitlePreferences& pre } } +static qint64 parseByteBudgetOption(const QByteArray& raw, qint64 fallback) +{ + const QByteArray trimmed = raw.trimmed(); + if (trimmed.isEmpty()) + return fallback; + qint64 multiplier = 1; + QByteArray digits = trimmed; + const char suffix = digits.back(); + if (suffix == 'K' || suffix == 'k') { + multiplier = 1024LL; + digits.chop(1); + } else if (suffix == 'M' || suffix == 'm') { + multiplier = 1024LL * 1024; + digits.chop(1); + } else if (suffix == 'G' || suffix == 'g') { + multiplier = 1024LL * 1024 * 1024; + digits.chop(1); + } + bool ok = false; + const qint64 value = digits.toLongLong(&ok); + return ok && value > 0 ? value * multiplier : fallback; +} + void PlayerController::setDemuxerBudget(const QByteArray& maxBytes, const QByteArray& maxBackBytes) { - bool changed = false; + constexpr qint64 mib = 1024LL * 1024; + StreamingCacheTarget target = m_activeDemuxerTarget; + if (target.forwardBytes <= 0) + target.forwardBytes = parseByteBudgetOption(m_demuxerMaxBytes, 64 * mib); + if (target.backBytes <= 0) + target.backBytes = parseByteBudgetOption(m_demuxerMaxBackBytes, 32 * mib); + if (!maxBytes.isEmpty()) - m_automaticDemuxerMaxBytes = maxBytes; - const QByteArray effectiveMaxBytes - = m_forwardCacheSizeMiB > 0 ? QByteArray::number(m_forwardCacheSizeMiB) + 'M' : m_automaticDemuxerMaxBytes; - if (!effectiveMaxBytes.isEmpty() && m_demuxerMaxBytes != effectiveMaxBytes) { - m_demuxerMaxBytes = effectiveMaxBytes; - changed = true; - } - if (!maxBackBytes.isEmpty() && m_demuxerMaxBackBytes != maxBackBytes) { - m_demuxerMaxBackBytes = maxBackBytes; - changed = true; - } - if (changed) + target.forwardBytes = parseByteBudgetOption(maxBytes, target.forwardBytes); + if (m_forwardCacheSizeMiB > 0) + target.forwardBytes = std::max(target.forwardBytes, static_cast(m_forwardCacheSizeMiB) * mib); + if (!maxBackBytes.isEmpty()) + target.backBytes = parseByteBudgetOption(maxBackBytes, target.backBytes); + + const StreamingCacheTarget previous = m_activeDemuxerTarget; + applyDemuxerCacheTarget(target, false); + if (target != previous) discardPreparedMpvForOptionChange("demuxer budget change"); } @@ -2781,20 +2808,15 @@ void PlayerController::setForwardCacheSizeMiB(int sizeMiB) return; m_forwardCacheSizeMiB = sizeMiB; - const QByteArray effectiveMaxBytes = QByteArray::number(sizeMiB) + 'M'; - if (effectiveMaxBytes == m_demuxerMaxBytes) - return; - - m_demuxerMaxBytes = effectiveMaxBytes; - qInfo() << "player: forward cache size" << QString::number(sizeMiB) + QStringLiteral(" MiB"); - discardPreparedMpvForOptionChange("forward cache size change"); + qInfo() << "player: forward cache floor" << QString::number(sizeMiB) + QStringLiteral(" MiB"); + m_demuxerCacheScaler = StreamingCacheScaler {}; + updateStreamingMemoryGrant(); } void PlayerController::setThreadedStreaming(bool enabled) { - if (m_threadedStreaming == enabled) + if (m_streamingOptions.enabled == enabled) return; - m_threadedStreaming = enabled; m_streamingOptions.enabled = enabled; discardPreparedMpvForOptionChange("threaded streaming change"); } @@ -2802,20 +2824,20 @@ void PlayerController::setThreadedStreaming(bool enabled) void PlayerController::setMaxStreamingThreads(int threads) { threads = std::clamp(threads, 1, 16); - if (m_maxStreamingThreads == threads) + if (m_streamingOptions.maxRequests == threads) return; - m_maxStreamingThreads = threads; + const bool forced = m_streamingOptions.fixedRequests > 0; m_streamingOptions.maxRequests = threads; - m_streamingOptions.fixedRequests = m_forceStreamingThreads ? threads : 0; + m_streamingOptions.fixedRequests = forced ? threads : 0; discardPreparedMpvForOptionChange("streaming thread limit change"); } void PlayerController::setForceStreamingThreads(bool force) { - if (m_forceStreamingThreads == force) + const int fixed = force ? m_streamingOptions.maxRequests : 0; + if (m_streamingOptions.fixedRequests == fixed) return; - m_forceStreamingThreads = force; - m_streamingOptions.fixedRequests = force ? m_maxStreamingThreads : 0; + m_streamingOptions.fixedRequests = fixed; discardPreparedMpvForOptionChange("forced streaming threads change"); } @@ -2826,7 +2848,11 @@ void PlayerController::setStreamingExplore(bool enabled) void PlayerController::setStreamingMemoryLoan(bool enabled) { + if (m_streamingOptions.allowExtraMemory == enabled) + return; m_streamingOptions.allowExtraMemory = enabled; + m_demuxerCacheScaler = StreamingCacheScaler {}; + updateStreamingMemoryGrant(); } void PlayerController::setMaxExtraStreamingMemoryMiB(int size) @@ -3185,6 +3211,7 @@ void PlayerController::flushPendingSeek() void PlayerController::handleMpvEvent(mpv_event *event, quint64 generation, mpv_handle *handle) { + Q_UNUSED(handle); if (!event) return; @@ -3882,6 +3909,32 @@ void PlayerController::skipActiveSegment() seek(activeSegmentEndSeconds()); } +void PlayerController::applyDemuxerCacheTarget(const StreamingCacheTarget& target, bool applyLive) +{ + const QByteArray nextForward = QByteArray::number(target.forwardBytes); + const QByteArray nextBack = QByteArray::number(target.backBytes); + const bool changed + = target != m_activeDemuxerTarget || m_demuxerMaxBytes != nextForward || m_demuxerMaxBackBytes != nextBack; + if (!changed) + return; + + m_activeDemuxerTarget = target; + m_demuxerMaxBytes = nextForward; + m_demuxerMaxBackBytes = nextBack; + qInfo("player: demuxer cache target forward=%lldMiB back=%lldMiB", + static_cast(target.forwardBytes / (1024LL * 1024)), + static_cast(target.backBytes / (1024LL * 1024))); + + if (!applyLive) + return; + if (auto *handle = m_mpvLifecycle.handle()) { + int64_t forwardValue = target.forwardBytes; + int64_t backValue = target.backBytes; + mpv_set_property_async(handle, 0, "demuxer-max-bytes", MPV_FORMAT_INT64, &forwardValue); + mpv_set_property_async(handle, 0, "demuxer-max-back-bytes", MPV_FORMAT_INT64, &backValue); + } +} + void PlayerController::updateStreamingMemoryGrant() { constexpr qint64 mib = 1024LL * 1024; @@ -3902,6 +3955,20 @@ void PlayerController::updateStreamingMemoryGrant() m_jointExtraGrantBytes = grant; updateBackgroundNetwork(); } + + // Automatically scale demuxer readahead and behind cache up to + // 128 MiB behind / 512 MiB forward at a 1:2 growth ratio based on free RAM. + const qint64 effectiveTotal = policy.totalBytes > 0 ? policy.totalBytes : policy.fallbackBytes; + const StreamingCacheTarget cacheCandidate = computeStreamingCacheTarget({ + .totalMemoryBytes = effectiveTotal, + .availableMemoryBytes = memory.availableBytes, + .availableMemoryKnown = memory.available, + .constrainedDevice = constrained, + .autoScaleEnabled = options.allowExtraMemory, + .configuredForwardBytes = m_forwardCacheSizeMiB > 0 ? qint64(m_forwardCacheSizeMiB) * mib : 0, + }); + const StreamingCacheTarget target = m_demuxerCacheScaler.update(cacheCandidate); + applyDemuxerCacheTarget(target, true); } void PlayerController::setBackgroundNetwork(bool active) diff --git a/src/player/PlayerController.h b/src/player/PlayerController.h index 3b1fd358..1a61966d 100644 --- a/src/player/PlayerController.h +++ b/src/player/PlayerController.h @@ -1,5 +1,6 @@ #pragma once +#include "../app/StreamingCachePolicy.h" #include "../media/MediaTypes.h" #include "../platform/MpvConfigPolicy.h" #include "MpvLifecycle.h" @@ -522,16 +523,16 @@ class PlayerController final : public QObject { bool m_hardwareDecoding = true; QByteArray m_softwareRenderer; QByteArray m_audioSpdifCodecs; - bool m_threadedStreaming = true; - int m_maxStreamingThreads = 4; - bool m_forceStreamingThreads = false; bool m_logStreamingPerformance = false; MpvOptionProfile::StreamingOptions m_streamingOptions; MpvOptionProfile::StreamingOptions m_sessionStreamingOptions; qint64 m_jointExtraGrantBytes = 0; qint64 m_previousMemoryCandidate = 0; + StreamingCacheScaler m_demuxerCacheScaler; + StreamingCacheTarget m_activeDemuxerTarget {}; QElapsedTimer m_streamingMemoryTimer; void updateStreamingMemoryGrant(); + void applyDemuxerCacheTarget(const StreamingCacheTarget& target, bool applyLive); // The opening seconds are where a device that cannot keep up says so: // the picture is being scaled and tone-mapped from the first frame, and // nothing has warmed a cache yet. @@ -559,7 +560,6 @@ class PlayerController final : public QObject { bool m_syncPlaybackSpeedActive = false; QString m_audioOutputMode = QStringLiteral("auto"); int m_alsaBufferMs = 40; - QByteArray m_automaticDemuxerMaxBytes = QByteArrayLiteral("64M"); QByteArray m_demuxerMaxBytes = QByteArrayLiteral("64M"); QByteArray m_demuxerMaxBackBytes = QByteArrayLiteral("32M"); MpvConfigPolicy m_mpvConfigPolicy; diff --git a/src/provider/ProviderRegistry.cpp b/src/provider/ProviderRegistry.cpp index 416b0991..ee86ddf7 100644 --- a/src/provider/ProviderRegistry.cpp +++ b/src/provider/ProviderRegistry.cpp @@ -1240,25 +1240,39 @@ bool ProviderRegistry::recordSpeedTest(const QString& accountId, const QVariantM if (key.isEmpty() || !sourceRunning(accountId) || !accountOriginAllowed(accountId, origin)) return false; const QVariantList input = result.value(QStringLiteral("concurrency-samples")).toList(); - if (input.size() != 3) + if (input.size() < 3 || input.size() > 8) return false; const qint64 now = QDateTime::currentMSecsSinceEpoch(); QVariantList samples; - int expected = 1; - for (const QVariant& value : input) { - const auto sample = value.toMap(); + for (qsizetype index = 0; index < input.size(); ++index) { + const auto sample = input[index].toMap(); const double rate = sample.value(QStringLiteral("capacity-bytes-per-second")).toDouble(); const double ttfb = sample.value(QStringLiteral("ttfb-ms")).toDouble(); - if (!networkInteger(sample.value(QStringLiteral("requests")), expected, expected) - || !networkNumber(sample.value(QStringLiteral("capacity-bytes-per-second"))) || !networkRate(rate) - || !networkNumber(sample.value(QStringLiteral("ttfb-ms"))) || ttfb < 0 || ttfb > 60000) + const int requests = sample.value(QStringLiteral("requests")).toInt(); + const bool baselinePoint = index < 3; + const int expected = baselinePoint ? (1 << index) : requests; + const bool validRequests = baselinePoint + ? networkInteger(sample.value(QStringLiteral("requests")), expected, expected) + : (networkInteger(sample.value(QStringLiteral("requests")), 1, 16) && (requests & (requests - 1)) == 0); + int httpVersion = 0; + if (sample.contains(QStringLiteral("http-version"))) { + const QVariant rawHttp = sample.value(QStringLiteral("http-version")); + if (!networkInteger(rawHttp, 0, 30)) + return false; + httpVersion = rawHttp.toInt(); + if (httpVersion != 0 && httpVersion != 11 && httpVersion != 20 && httpVersion != 30) + return false; + } + if (!validRequests || !networkNumber(sample.value(QStringLiteral("capacity-bytes-per-second"))) + || !networkRate(rate) || !networkNumber(sample.value(QStringLiteral("ttfb-ms"))) || ttfb < 0 + || ttfb > 60000) return false; - samples.append(QVariantMap { { QStringLiteral("requests"), expected }, { QStringLiteral("http-version"), 0 }, - { QStringLiteral("receive-profile"), 0 }, { QStringLiteral("receive-bytes"), 0 }, - { QStringLiteral("range-bytes"), 0 }, { QStringLiteral("ordered-bytes-per-second"), rate }, - { QStringLiteral("ttfb-ms"), ttfb }, { QStringLiteral("updated-at-ms"), now }, - { QStringLiteral("source"), 1 }, { QStringLiteral("samples"), 1 } }); - expected *= 2; + samples.append( + QVariantMap { { QStringLiteral("requests"), expected }, { QStringLiteral("http-version"), httpVersion }, + { QStringLiteral("receive-profile"), 0 }, { QStringLiteral("receive-bytes"), 0 }, + { QStringLiteral("range-bytes"), 0 }, { QStringLiteral("ordered-bytes-per-second"), rate }, + { QStringLiteral("ttfb-ms"), ttfb }, { QStringLiteral("updated-at-ms"), now }, + { QStringLiteral("source"), 1 }, { QStringLiteral("samples"), 1 } }); } QVariantMap saved = m_networkProfiles.value(key).toMap(); NetworkPoints points = networkPoints(saved, now); diff --git a/src/provider/SpeedTest.cpp b/src/provider/SpeedTest.cpp index 697e1c33..8b6b2fb4 100644 --- a/src/provider/SpeedTest.cpp +++ b/src/provider/SpeedTest.cpp @@ -13,6 +13,18 @@ namespace Spool { +namespace { + + bool altSvcAdvertisesH3(const QByteArray& value) + { + if (value.isEmpty()) + return false; + const QByteArray lower = value.toLower(); + return lower.contains("h3=") || lower.contains("h3-29="); + } + +} // namespace + SpeedTest::SpeedTest(ScriptAccess *access, Completion completion, QObject *parent) : QObject(parent) , m_access(access) @@ -20,7 +32,9 @@ SpeedTest::SpeedTest(ScriptAccess *access, Completion completion, QObject *paren { m_roundDeadline.setSingleShot(true); connect(&m_roundDeadline, &QTimer::timeout, this, [this] { - qint64 received = m_round >= 0 ? m_received[m_round] : 0; + qint64 received = (m_round >= 0 && m_round < static_cast(m_samples.size())) + ? m_samples[static_cast(m_round)].receivedBytes + : 0; for (int i = 0; i < m_count; ++i) { if (m_lanes[i].reply && !drain(i)) return; @@ -60,31 +74,41 @@ void SpeedTest::finish(QString error, qint64 bitrate) QVariantMap result; if (error.isEmpty()) { QVariantList samples; - for (int i = 0; i < 3; ++i) { - samples.append(QVariantMap { { QStringLiteral("requests"), 1 << i }, - { QStringLiteral("capacity-bytes-per-second"), m_rates[i] / 8 }, - { QStringLiteral("ttfb-ms"), m_latencies[i] }, { QStringLiteral("elapsed-seconds"), m_durations[i] }, - { QStringLiteral("received-bytes"), m_received[i] } }); - qInfo("streaming probe sample requests=%d capacity_bytes_per_second=%.0f ttfb_ms=%.3f " + double maxRate = 0.0; + int bestHttpVersion = 0; + for (const RoundSample& s : m_samples) { + if (s.rateBps > maxRate) { + maxRate = s.rateBps; + bestHttpVersion = s.httpVersion; + } + samples.append(QVariantMap { { QStringLiteral("requests"), s.requests }, + { QStringLiteral("http-version"), s.httpVersion }, + { QStringLiteral("capacity-bytes-per-second"), s.rateBps / 8.0 }, + { QStringLiteral("ttfb-ms"), s.ttfbMs }, { QStringLiteral("elapsed-seconds"), s.durationS }, + { QStringLiteral("received-bytes"), s.receivedBytes } }); + qInfo("streaming probe sample requests=%d http=%d capacity_bytes_per_second=%.0f ttfb_ms=%.3f " "elapsed_seconds=%.3f received_bytes=%lld", - 1 << i, m_rates[i] / 8, m_latencies[i], m_durations[i], static_cast(m_received[i])); + s.requests, s.httpVersion, s.rateBps / 8.0, s.ttfbMs, s.durationS, + static_cast(s.receivedBytes)); } // This count describes the offline probe only; native playback chooses // its own profile from the complete measured curve. - const double threshold = *std::max_element(m_rates.cbegin(), m_rates.cend()) * 0.85; + const double threshold = maxRate * 0.85; int lanes = 1; - for (int i = 0; i < 3; ++i) { - if (m_rates[i] >= threshold) { - lanes = 1 << i; + for (const RoundSample& s : m_samples) { + if (s.rateBps >= threshold) { + lanes = s.requests; break; } } - qInfo("streaming probe selection requests=%d", lanes); + qInfo("streaming probe selection requests=%d http=%d h3_advertised=%d", lanes, bestHttpVersion, + m_h3Advertised ? 1 : 0); QUrl endpoint; endpoint.setScheme(m_request.url().scheme()); endpoint.setHost(m_request.url().host()); endpoint.setPort(m_request.url().port()); result = { { QStringLiteral("bitrate"), bitrate }, { QStringLiteral("parallelRequests"), lanes }, + { QStringLiteral("http-version"), bestHttpVersion }, { QStringLiteral("h3-advertised"), m_h3Advertised }, { QStringLiteral("concurrency-samples"), samples }, { QStringLiteral("origin"), endpoint.toString() } }; } completion(std::move(error), std::move(result)); @@ -154,22 +178,29 @@ void SpeedTest::start(const QVariantMap& options) // Compression measures generated/compressed bytes rather than link bandwidth. m_request.setRawHeader("Accept-Encoding", "identity"); m_request.setRawHeader("Cache-Control", "no-cache, no-store"); - round(1, 512 * 1024); + m_schedule = { { 1, false }, { 2, false }, { 4, false } }; + m_samples.clear(); + m_samples.reserve(5); + m_totalElapsed.start(); + round(1, 512 * 1024, false); } -void SpeedTest::round(int lanes, qint64 totalBytes) +void SpeedTest::round(int lanes, qint64 totalBytes, bool forceHttp1) { - m_count = lanes; - m_remaining = lanes; - m_expected = totalBytes / lanes; + m_count = std::clamp(lanes, 1, static_cast(m_lanes.size())); + m_remaining = m_count; + m_expected = totalBytes / m_count; + m_forceHttp1 = forceHttp1; m_elapsed.start(); - if (m_round < 0 || m_received[m_round] == 0) + const bool continuing = m_round >= 0 && m_round < static_cast(m_samples.size()) + && m_samples[static_cast(m_round)].receivedBytes > 0; + if (!continuing) m_pointElapsed.start(); // Each operating point gets at most 2.5 s (including repeated chunks), - // leaving room for warmup and JS completion inside the operation's 15 s. + // leaving room for warmup, optional WAN probes, and JS completion inside 15 s. m_roundDeadline.start(std::max(1, 2500 - int(m_pointElapsed.elapsed()))); ++m_transfer; - for (int i = 0; i < lanes; ++i) { + for (int i = 0; i < m_count; ++i) { QString address = m_template; address.replace(QStringLiteral("{bytes}"), QString::number(m_expected)); address.replace(QStringLiteral("{nonce}"), @@ -178,15 +209,17 @@ void SpeedTest::round(int lanes, qint64 totalBytes) if ((url.scheme() != QStringLiteral("http") && url.scheme() != QStringLiteral("https")) || !m_access->allows(url)) return finish(QStringLiteral("request_denied")); - m_request.setUrl(url); + QNetworkRequest request = m_request; + request.setUrl(url); + request.setAttribute(QNetworkRequest::Http2AllowedAttribute, !forceHttp1); if (m_range) { const qint64 offset = i * m_expected; - m_request.setRawHeader( + request.setRawHeader( "Range", "bytes=" + QByteArray::number(offset) + '-' + QByteArray::number(offset + m_expected - 1)); } - QNetworkReply *reply = m_access->network->get(m_request); + QNetworkReply *reply = m_access->network->get(request); reply->setReadBufferSize(m_buffer.size()); - m_lanes[i] = { reply, 0 }; + m_lanes[i] = { reply, 0, false, -1, 0 }; connect(reply, &QNetworkReply::metaDataChanged, this, [this, i] { m_lanes[i].responseChecked = false; checkResponse(i); @@ -228,6 +261,12 @@ bool SpeedTest::checkResponse(int index) finish(QStringLiteral("invalid_sample")); return false; } + if (status != 0) { + const bool usedH2 = reply->attribute(QNetworkRequest::Http2WasUsedAttribute).toBool(); + lane.httpVersion = usedH2 ? 20 : 11; + if (reply->hasRawHeader("Alt-Svc") && altSvcAdvertisesH3(reply->rawHeader("Alt-Svc"))) + m_h3Advertised = true; + } lane.responseChecked = status != 0; return true; } @@ -275,24 +314,48 @@ void SpeedTest::completeRound() { const qint64 nanoseconds = std::max(1, m_elapsed.nsecsElapsed()); qint64 received = 0; - double latency = 0; + double latency = 0.0; + int httpVersion = m_forceHttp1 ? 11 : 0; for (int i = 0; i < m_count; ++i) { received += m_lanes[i].received; latency += (m_lanes[i].firstByteNs >= 0 ? m_lanes[i].firstByteNs : nanoseconds) / 1.0e6; + if (m_lanes[i].httpVersion > 0) + httpVersion = m_lanes[i].httpVersion; } abort(); if (m_round >= 0) { - const double previousDuration = m_durations[m_round]; - m_received[m_round] += received; - m_durations[m_round] += nanoseconds / 1.0e9; - m_latencies[m_round] = (m_latencies[m_round] * previousDuration + latency / m_count * (nanoseconds / 1.0e9)) - / m_durations[m_round]; - m_rates[m_round] = m_received[m_round] * 8.0 / m_durations[m_round]; + RoundSample& sample = m_samples[static_cast(m_round)]; + const double previousDuration = sample.durationS; + sample.receivedBytes += received; + sample.durationS += nanoseconds / 1.0e9; + sample.ttfbMs + = (sample.ttfbMs * previousDuration + latency / m_count * (nanoseconds / 1.0e9)) / sample.durationS; + sample.rateBps = sample.receivedBytes * 8.0 / sample.durationS; + if (httpVersion > 0) + sample.httpVersion = httpVersion; // Short transfers get more wall time instead of rewarding a single // millisecond-scale result. Bound both traffic and duration; Range // probes repeat the minimum-size resource rather than reading past it. - if (m_durations[m_round] < 0.4 && m_received[m_round] < 64 * 1024 * 1024 && m_pointElapsed.elapsed() < 2500) - return round(m_count, std::min(m_chunkBytes, 64LL * 1024 * 1024 - m_received[m_round])); + if (sample.durationS < 0.4 && sample.receivedBytes < 64 * 1024 * 1024 && m_pointElapsed.elapsed() < 2500) + return round(m_count, std::min(m_chunkBytes, 64LL * 1024 * 1024 - sample.receivedBytes), m_forceHttp1); + + // After the 1/2/4-lane baseline curve finishes, probe higher WAN + // concurrency or escape an HTTPS HTTP/2 single-socket bottleneck when + // evidence warrants it and ample wall-clock budget remains. + if (m_round == 2 && m_samples.size() >= 3) { + const double ttfb0 = m_samples[0].ttfbMs; + const bool https = m_request.url().scheme() == QStringLiteral("https"); + const bool h2Stalled = https && m_samples[2].httpVersion == 20 && ttfb0 >= 40.0 + && m_samples[2].rateBps < m_samples[0].rateBps * 1.35; + if (h2Stalled && !m_addedHttp1Round && m_totalElapsed.elapsed() < 9500) { + m_addedHttp1Round = true; + m_schedule.push_back({ 4, true }); + } else if (!m_addedWideRound && ttfb0 >= 60.0 && m_samples[2].rateBps >= m_samples[1].rateBps * 1.25 + && m_totalElapsed.elapsed() < 8500) { + m_addedWideRound = true; + m_schedule.push_back({ 8, false }); + } + } } else { const double predicted = received * 0.4e9 / nanoseconds; // Power-of-two batches fit common server buffer size classes, while @@ -303,10 +366,15 @@ void SpeedTest::completeRound() m_chunkBytes *= 2; } } - // Always measure the complete curve, including negative scaling. - if (++m_round < 3) - return round(1 << m_round, m_chunkBytes); - const qint64 bitrate = std::llround(*std::max_element(m_rates.cbegin(), m_rates.cend()) * 0.75); + if (++m_round < static_cast(m_schedule.size())) { + const RoundSpec spec = m_schedule[static_cast(m_round)]; + m_samples.push_back(RoundSample { spec.lanes, spec.forceHttp1 ? 11 : 0, 0.0, 0.0, 0.0, 0 }); + return round(spec.lanes, m_chunkBytes, spec.forceHttp1); + } + double maxRate = 0.0; + for (const RoundSample& s : m_samples) + maxRate = std::max(maxRate, s.rateBps); + const qint64 bitrate = std::llround(maxRate * 0.75); finish({}, bitrate); } diff --git a/src/provider/SpeedTest.h b/src/provider/SpeedTest.h index 1282efaf..2bd5a9c1 100644 --- a/src/provider/SpeedTest.h +++ b/src/provider/SpeedTest.h @@ -9,6 +9,7 @@ #include #include +#include class QNetworkReply; @@ -31,8 +32,24 @@ class SpeedTest final : public QObject { qint64 received = 0; bool responseChecked = false; qint64 firstByteNs = -1; + int httpVersion = 0; }; - void round(int lanes, qint64 totalBytes); + + struct RoundSpec { + int lanes = 1; + bool forceHttp1 = false; + }; + + struct RoundSample { + int requests = 1; + int httpVersion = 0; + double rateBps = 0.0; + double ttfbMs = 0.0; + double durationS = 0.0; + qint64 receivedBytes = 0; + }; + + void round(int lanes, qint64 totalBytes, bool forceHttp1 = false); bool drain(int lane); bool checkResponse(int lane); void finished(int lane); @@ -45,12 +62,11 @@ class SpeedTest final : public QObject { QString m_template; QString m_nonce; QNetworkRequest m_request; - std::array m_lanes; - std::array m_rates {}; - std::array m_latencies {}; - std::array m_durations {}; - std::array m_received {}; + std::array m_lanes {}; + std::vector m_schedule; + std::vector m_samples; std::array m_buffer; + QElapsedTimer m_totalElapsed; QElapsedTimer m_elapsed; QElapsedTimer m_pointElapsed; QTimer m_roundDeadline; @@ -62,6 +78,10 @@ class SpeedTest final : public QObject { qint64 m_chunkBytes = 4 * 1024 * 1024; bool m_done = false; bool m_range = false; + bool m_forceHttp1 = false; + bool m_h3Advertised = false; + bool m_addedWideRound = false; + bool m_addedHttp1Round = false; }; } // namespace Spool diff --git a/tests/app/SettingsControllerTest.cpp b/tests/app/SettingsControllerTest.cpp index 9abb9e71..759da8ad 100644 --- a/tests/app/SettingsControllerTest.cpp +++ b/tests/app/SettingsControllerTest.cpp @@ -86,7 +86,7 @@ SPOOL_TEST_MAIN("settings-controller") require(settings.value(QStringLiteral("playback/forwardCacheSizeMiB")).toInt() == 32, "fresh profile did not use the 32 MB forward cache default"); require(settings.value(QStringLiteral("playback/threadedStreaming")).toBool() - && settings.value(QStringLiteral("playback/maxStreamingThreads")).toInt() == 4 + && settings.value(QStringLiteral("playback/maxStreamingThreads")).toInt() == 8 && !settings.value(QStringLiteral("playback/forceStreamingThreads")).toBool(), "fresh profile did not preserve adaptive streaming with a four-request maximum"); // Per-account overrides cross the real persistence boundary, remain local, diff --git a/tests/app/StreamingCachePolicyTest.cpp b/tests/app/StreamingCachePolicyTest.cpp new file mode 100644 index 00000000..193f7512 --- /dev/null +++ b/tests/app/StreamingCachePolicyTest.cpp @@ -0,0 +1,183 @@ +#include "app/StreamingCachePolicy.h" + +#include "TestMain.h" +#include "TestRequire.h" + +#include + +#include + +extern "C" { +#include +} + +using namespace Spool; +using SpoolTests::require; + +namespace { + +constexpr qint64 kMiB = 1024LL * 1024; +constexpr qint64 kGiB = 1024LL * kMiB; + +} // namespace + +SPOOL_TEST_MAIN("streaming-cache-policy") +{ + QCoreApplication app(argc, argv); + setlocale(LC_NUMERIC, "C"); + + // 1. Unknown available memory falls back cleanly to configured/platform floor. + { + const auto unknownDesktop = computeStreamingCacheTarget({ + .totalMemoryBytes = 16 * kGiB, + .availableMemoryBytes = 0, + .availableMemoryKnown = false, + .constrainedDevice = false, + .autoScaleEnabled = true, + .configuredForwardBytes = 32 * kMiB, + }); + require(unknownDesktop.forwardBytes == 32 * kMiB && unknownDesktop.backBytes == 16 * kMiB, + "unknown free RAM must stay at configured floor with 1:2 back ratio"); + + const auto disabledScale = computeStreamingCacheTarget({ + .totalMemoryBytes = 32 * kGiB, + .availableMemoryBytes = 24 * kGiB, + .availableMemoryKnown = true, + .constrainedDevice = false, + .autoScaleEnabled = false, + .configuredForwardBytes = 64 * kMiB, + }); + require(disabledScale.forwardBytes == 64 * kMiB && disabledScale.backBytes == 32 * kMiB, + "disabling extra streaming memory must keep base floor"); + } + + // 2. Constrained device (e.g. 1 GiB webOS TV) stays safely at floor under low headroom. + { + const auto lowTv = computeStreamingCacheTarget({ + .totalMemoryBytes = 1 * kGiB, + .availableMemoryBytes = 250 * kMiB, + .availableMemoryKnown = true, + .constrainedDevice = true, + .autoScaleEnabled = true, + .configuredForwardBytes = 32 * kMiB, + }); + require(lowTv.forwardBytes == 32 * kMiB && lowTv.backBytes == 16 * kMiB, + "constrained device under reserve must not grow past base floor"); + } + + // 3. Monotonic 1:2 behind:forward growth up to 128 MiB behind / 256 MiB forward, + // then forward continues growing smoothly up to 512 MiB cap while back stays at 128 MiB. + { + StreamingCacheTarget previous { 32 * kMiB, 16 * kMiB }; + bool sawIntermediate1To2 = false; + bool sawKnee128To256 = false; + bool sawMax128To512 = false; + for (qint64 availMiB = 512; availMiB <= 16384; availMiB += 128) { + const auto target = computeStreamingCacheTarget({ + .totalMemoryBytes = 16 * kGiB, + .availableMemoryBytes = availMiB * kMiB, + .availableMemoryKnown = true, + .constrainedDevice = false, + .autoScaleEnabled = true, + .configuredForwardBytes = 32 * kMiB, + }); + require(target.forwardBytes >= previous.forwardBytes && target.backBytes >= previous.backBytes, + "cache scaling must be monotonically non-decreasing with available memory"); + require(target.backBytes <= 128 * kMiB, "behind cache must never exceed 128 MiB"); + require(target.forwardBytes <= 512 * kMiB, "auto-scaled forward cache must never exceed 512 MiB"); + if (target.backBytes < 128 * kMiB) { + require(target.backBytes * 2 == target.forwardBytes, + "before hitting the 128 MiB behind cap, behind:forward must stay at exact 1:2 ratio"); + if (target.backBytes > 16 * kMiB) + sawIntermediate1To2 = true; + } + if (target.backBytes == 128 * kMiB && target.forwardBytes == 256 * kMiB) + sawKnee128To256 = true; + if (target.backBytes == 128 * kMiB && target.forwardBytes == 512 * kMiB) + sawMax128To512 = true; + previous = target; + } + require(sawIntermediate1To2, "growth curve must visit intermediate 1:2 steps"); + require(sawKnee128To256, "growth curve must pass through 128 MiB behind / 256 MiB forward knee"); + require(sawMax128To512, "abundant free memory must reach 128 MiB behind / 512 MiB forward cap"); + } + + // 4. Huge free RAM (128 GiB) still respects 128 MiB / 512 MiB auto cap; + // explicit user slider override above 512 MiB is honored as floor. + { + const auto hugeRam = computeStreamingCacheTarget({ + .totalMemoryBytes = 128 * kGiB, + .availableMemoryBytes = 96 * kGiB, + .availableMemoryKnown = true, + .constrainedDevice = false, + .autoScaleEnabled = true, + .configuredForwardBytes = 32 * kMiB, + }); + require(hugeRam.backBytes == 128 * kMiB && hugeRam.forwardBytes == 512 * kMiB, + "128 GiB machine must cap auto-scaled cache at 128 MiB behind / 512 MiB forward"); + + const auto manualOverride = computeStreamingCacheTarget({ + .totalMemoryBytes = 16 * kGiB, + .availableMemoryBytes = 12 * kGiB, + .availableMemoryKnown = true, + .constrainedDevice = false, + .autoScaleEnabled = true, + .configuredForwardBytes = 1024 * kMiB, + }); + require(manualOverride.forwardBytes == 1024 * kMiB && manualOverride.backBytes == 128 * kMiB, + "explicit manual forward floor above 512 MiB must be preserved while capping back at 128 MiB"); + } + + // 5. Hysteresis: growth requires two independent samples, pressure shrinks immediately. + { + StreamingCacheScaler scaler; + const StreamingCacheTarget low { 32 * kMiB, 16 * kMiB }; + const StreamingCacheTarget mid { 256 * kMiB, 128 * kMiB }; + const StreamingCacheTarget high { 512 * kMiB, 128 * kMiB }; + + require(scaler.update(low) == low, "initial sample commits immediately"); + require(scaler.update(high) == low, "single high-RAM spike must not grow cache immediately"); + require(scaler.update(mid) == mid, "second consecutive sample grows to min(previous, current)"); + require(scaler.update(high) == mid, "stepping further up requires another consecutive sample"); + require(scaler.update(high) == high, "sustained abundant RAM reaches 512/128 MiB"); + require(scaler.update(low) == low, "memory pressure must shrink immediately on a single sample"); + } + + // 6. Live libmpv runtime property test: demuxer-max-bytes and demuxer-max-back-bytes + // must accept dynamic int64 updates on an initialized headless handle. + { + mpv_handle *handle = mpv_create(); + require(handle, "live demuxer scaling test needs a real mpv handle"); + require(mpv_set_option_string(handle, "config", "no") >= 0 + && mpv_set_option_string(handle, "terminal", "no") >= 0 + && mpv_set_option_string(handle, "vo", "null") >= 0 && mpv_set_option_string(handle, "ao", "null") >= 0 + && mpv_set_option_string(handle, "demuxer-max-bytes", "32M") >= 0 + && mpv_set_option_string(handle, "demuxer-max-back-bytes", "16M") >= 0 && mpv_initialize(handle) >= 0, + "headless mpv initializes with baseline demuxer budgets"); + + int64_t fwd = 512 * kMiB; + int64_t back = 128 * kMiB; + require(mpv_set_property(handle, "demuxer-max-bytes", MPV_FORMAT_INT64, &fwd) >= 0 + && mpv_set_property(handle, "demuxer-max-back-bytes", MPV_FORMAT_INT64, &back) >= 0, + "mpv accepts live scaling to 512 MiB forward / 128 MiB behind"); + int64_t readFwd = 0, readBack = 0; + require(mpv_get_property(handle, "demuxer-max-bytes", MPV_FORMAT_INT64, &readFwd) >= 0 + && mpv_get_property(handle, "demuxer-max-back-bytes", MPV_FORMAT_INT64, &readBack) >= 0 + && readFwd == fwd && readBack == back, + "mpv reports updated 512 MiB forward / 128 MiB behind budgets"); + + fwd = 64 * kMiB; + back = 32 * kMiB; + require(mpv_set_property(handle, "demuxer-max-bytes", MPV_FORMAT_INT64, &fwd) >= 0 + && mpv_set_property(handle, "demuxer-max-back-bytes", MPV_FORMAT_INT64, &back) >= 0, + "mpv accepts live shrinking under memory pressure"); + require(mpv_get_property(handle, "demuxer-max-bytes", MPV_FORMAT_INT64, &readFwd) >= 0 + && mpv_get_property(handle, "demuxer-max-back-bytes", MPV_FORMAT_INT64, &readBack) >= 0 + && readFwd == fwd && readBack == back, + "mpv reports shrunken budgets immediately"); + + mpv_terminate_destroy(handle); + } + + return 0; +} diff --git a/tests/e2e/jellyfin_latency_e2e.py b/tests/e2e/jellyfin_latency_e2e.py new file mode 100644 index 00000000..3b19f85a --- /dev/null +++ b/tests/e2e/jellyfin_latency_e2e.py @@ -0,0 +1,1004 @@ +#!/usr/bin/env python3 +"""End-to-end Jellyfin + latency/window/slow-start proxy test and benchmark harness. + +Starts an isolated real Jellyfin server with a freshly generated high-bitrate +DirectPlay media file, fronts it with tools/network-shaper.py (simulating WAN +RTT, TCP IW10 slow-start, and per-socket window ceilings) and optionally an +nginx TLS/HTTP2/HTTP3 reverse proxy, and exercises: + 1. Spool's real bundled Jellyfin provider (`spool-tests live-jellyfin`) + through the shaped proxy. + 2. Real libmpv playback, mid-stream uncached forward seek, and behind-cache + backward seek over HTTP and HTTPS (HTTP/1.1 vs HTTP/2 vs auto). + +Exits 77 (CTest SKIP) when `jellyfin` is unavailable in PATH or `--jellyfin-bin`. +Never prints or serializes tokens, credentials, or authenticated URLs. +""" + +from __future__ import annotations + +import argparse +import ctypes +import importlib.util +import json +import math +import os +import shutil +import signal +import socket +import subprocess +import sys +import tempfile +import time +import urllib.request +from pathlib import Path + + +def free_port(host: str = "127.0.0.1") -> int: + with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as sock: + sock.bind((host, 0)) + return sock.getsockname()[1] + + +def find_jellyfin_binary(explicit: str | None) -> str | None: + if explicit: + return explicit if os.path.isfile(explicit) else None + env_bin = os.environ.get("SPOOL_JELLYFIN_BIN") + if env_bin and os.path.isfile(env_bin): + return env_bin + return shutil.which("jellyfin") + + +def generate_high_bitrate_movie(ffmpeg_bin: str, target_path: Path, *, duration_s: int, video_mbps: int) -> dict: + started = time.monotonic() + target_path.parent.mkdir(parents=True, exist_ok=True) + # Use noisy testsrc2 with CBR-like x264 ultrafast so the file has genuine + # high entropy (~video_mbps) and regular 1-second IDR keyframes for seeking. + rate_arg = f"{video_mbps}M" + buf_arg = f"{max(video_mbps // 2, 4)}M" + subprocess.run( + [ + ffmpeg_bin, + "-hide_banner", + "-loglevel", + "error", + "-y", + "-f", + "lavfi", + "-i", + f"testsrc2=size=1280x720:rate=30:duration={duration_s},noise=alls=45:allf=t", + "-f", + "lavfi", + "-i", + f"sine=frequency=440:sample_rate=48000:duration={duration_s}", + "-c:v", + "libx264", + "-preset", + "ultrafast", + "-tune", + "zerolatency", + "-b:v", + rate_arg, + "-minrate", + rate_arg, + "-maxrate", + rate_arg, + "-bufsize", + buf_arg, + "-g", + "30", + "-keyint_min", + "30", + "-c:a", + "aac", + "-b:a", + "192k", + str(target_path), + ], + check=True, + ) + size_bytes = target_path.stat().st_size + actual_bitrate_bps = round(size_bytes * 8 / duration_s) + return { + "duration_s": duration_s, + "size_bytes": size_bytes, + "actual_bitrate_bps": actual_bitrate_bps, + "actual_mbps": round(actual_bitrate_bps / 1_000_000, 2), + "generation_seconds": round(time.monotonic() - started, 3), + } + + +class JellyfinTestServer: + def __init__(self, root: Path, jellyfin_bin: str, media_dir: Path, *, username: str, password: str) -> None: + self.root = root + self.jellyfin_bin = jellyfin_bin + self.media_dir = media_dir + self.username = username + self.password = password + self.port = free_port() + self.proc: subprocess.Popen | None = None + self.token: str = "" + self.user_id: str = "" + self.item_id: str = "" + self.media_source_id: str = "" + self.media_size_bytes: int = 0 + self.media_bitrate_bps: int = 0 + self.server_version: str = "" + + @property + def base_url(self) -> str: + return f"http://127.0.0.1:{self.port}" + + def _request(self, method: str, path: str, body: dict | None = None, *, use_token: bool = False): + auth = 'MediaBrowser Client="spool-e2e", Device="harness", DeviceId="spool-e2e-harness", Version="1.0"' + if use_token and self.token: + auth += f', Token="{self.token}"' + headers = {"Authorization": auth} + data = None + if body is not None: + data = json.dumps(body).encode() + headers["Content-Type"] = "application/json" + req = urllib.request.Request(self.base_url + path, data=data, headers=headers, method=method) + with urllib.request.urlopen(req, timeout=15) as resp: + raw = resp.read() + ctype = resp.headers.get("Content-Type", "") + payload = json.loads(raw) if raw and "json" in ctype else raw + return resp.status, payload + + def start(self) -> dict: + started = time.monotonic() + config_dir = self.root / "jf-config" + data_dir = self.root / "jf-data" + cache_dir = self.root / "jf-cache" + log_dir = self.root / "jf-log" + for d in (config_dir, data_dir, cache_dir, log_dir): + d.mkdir(parents=True, exist_ok=True) + (config_dir / "network.xml").write_text( + f""" + + {self.port} + {self.port} + false + false + false + 127.0.0.1 + +""" + ) + env = dict(os.environ) + env["JELLYFIN_PublishedServerUrl"] = self.base_url + env["no_proxy"] = "127.0.0.1,localhost" + env["NO_PROXY"] = "127.0.0.1,localhost" + self.log_path = self.root / "jellyfin-stderr.log" + self._log_file = self.log_path.open("w+b") + self.proc = subprocess.Popen( + [ + self.jellyfin_bin, + "--datadir", + str(data_dir), + "--configdir", + str(config_dir), + "--cachedir", + str(cache_dir), + "--logdir", + str(log_dir), + "--nowebclient", + "--nonetchange", + "--published-server-url", + self.base_url, + ], + stdout=self._log_file, + stderr=subprocess.STDOUT, + env=env, + ) + deadline = time.monotonic() + 60.0 + while time.monotonic() < deadline: + if self.proc.poll() is not None: + self._log_file.flush() + stderr_tail = self.log_path.read_text(errors="replace")[-1500:] + raise RuntimeError(f"Jellyfin exited prematurely (code {self.proc.returncode}): {stderr_tail}") + try: + status, info = self._request("GET", "/System/Info/Public") + if status == 200 and isinstance(info, dict) and info.get("Version"): + self.server_version = str(info["Version"]) + break + except Exception: + pass + time.sleep(0.2) + else: + raise RuntimeError("Jellyfin failed to become ready within 60s") + + # Complete startup wizard + self._request( + "POST", + "/Startup/Configuration", + {"UICulture": "en-US", "MetadataCountryCode": "US", "PreferredMetadataLanguage": "en"}, + ) + self._request("GET", "/Startup/FirstUser") + self._request("POST", "/Startup/User", {"Name": self.username, "Password": self.password}) + self._request( + "POST", + "/Startup/RemoteAccess", + {"EnableRemoteAccess": True, "EnableAutomaticPortMapping": False}, + ) + self._request("POST", "/Startup/Complete", {}) + + _, auth = self._request( + "POST", + "/Users/AuthenticateByName", + {"Username": self.username, "Pw": self.password}, + ) + self.token = str(auth["AccessToken"]) + self.user_id = str(auth["User"]["Id"]) + + self._request( + "POST", + "/Library/VirtualFolders?name=Movies&collectionType=movies&refreshLibrary=true", + { + "LibraryOptions": { + "PathInfos": [{"Path": str(self.media_dir)}], + "EnableRealtimeMonitor": False, + "EnableChapterImageExtraction": False, + "EnableTrickplayImageExtraction": False, + "DisabledSubtitleFetchers": ["Open Subtitles"], + "TypeOptions": [ + { + "Type": "Movie", + "MetadataFetchers": [], + "ImageFetchers": [], + } + ], + } + }, + use_token=True, + ) + + scan_deadline = time.monotonic() + 60.0 + next_refresh = time.monotonic() + 10.0 + while time.monotonic() < scan_deadline: + if time.monotonic() >= next_refresh: + try: + self._request("POST", "/Library/Refresh", {}, use_token=True) + except Exception: + pass + next_refresh = time.monotonic() + 10.0 + _, items = self._request( + "GET", + f"/Users/{self.user_id}/Items?Recursive=true&IncludeItemTypes=Movie&Fields=MediaSources", + use_token=True, + ) + found = items.get("Items") or [] + if found: + item = found[0] + sources = item.get("MediaSources") or [] + if sources and sources[0].get("Size"): + ms = sources[0] + self.item_id = str(item["Id"]) + self.media_source_id = str(ms["Id"]) + self.media_size_bytes = int(ms["Size"]) + if ms.get("Bitrate"): + self.media_bitrate_bps = int(ms["Bitrate"]) + break + if time.monotonic() + 30.0 < scan_deadline: + time.sleep(0.25) + continue + break + time.sleep(0.25) + else: + tail = self.log_path.read_text(errors="replace")[-1500:] if getattr(self, "log_path", None) and self.log_path.exists() else "" + raise RuntimeError(f"Jellyfin failed to scan benchmark movie: {tail}") + + return { + "version": self.server_version, + "boot_and_scan_seconds": round(time.monotonic() - started, 3), + "media_size_bytes": self.media_size_bytes, + "media_bitrate_bps": self.media_bitrate_bps, + } + + def direct_stream_path(self) -> str: + return f"/Videos/{self.item_id}/stream?static=true&mediaSourceId={self.media_source_id}" + + def auth_header_value(self) -> str: + return ( + 'MediaBrowser Client="spool-e2e", Device="harness", ' + f'DeviceId="spool-e2e-harness", Version="1.0", Token="{self.token}"' + ) + + def stop(self) -> None: + if self.proc is not None and self.proc.poll() is None: + self.proc.terminate() + try: + self.proc.wait(timeout=8) + except subprocess.TimeoutExpired: + self.proc.kill() + self.proc.wait(timeout=5) + self.proc = None + if getattr(self, "_log_file", None) is not None: + try: + self._log_file.close() + except Exception: + pass + self._log_file = None + + +class NetworkShaperProcess: + def __init__( + self, + shaper_script: Path, + *, + upstream_port: int, + rtt_ms: float, + download_mbps: float = 0.0, + per_connection_mbps: float = 0.0, + initial_window_bytes: int = 0, + max_window_bytes: int = 0, + jitter_ms: float = 0.0, + summary_file: Path | None = None, + ) -> None: + self.shaper_script = shaper_script + self.upstream_port = upstream_port + self.port = free_port() + self.rtt_ms = rtt_ms + self.download_mbps = download_mbps + self.per_connection_mbps = per_connection_mbps + self.initial_window_bytes = initial_window_bytes + self.max_window_bytes = max_window_bytes + self.jitter_ms = jitter_ms + self.summary_file = summary_file + self.proc: subprocess.Popen | None = None + + def start(self) -> None: + cmd = [ + sys.executable, + str(self.shaper_script), + "--listen", + f"127.0.0.1:{self.port}", + "--upstream", + f"127.0.0.1:{self.upstream_port}", + "--rtt-ms", + str(self.rtt_ms), + "--jitter-ms", + str(self.jitter_ms), + "--download-mbps", + str(self.download_mbps), + "--per-connection-mbps", + str(self.per_connection_mbps), + "--initial-window-bytes", + str(self.initial_window_bytes), + "--max-window-bytes", + str(self.max_window_bytes), + "--metrics-interval", + "0", + ] + if self.summary_file is not None: + cmd.extend(["--summary-file", str(self.summary_file)]) + self.proc = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text=True) + assert self.proc.stdout is not None + line = self.proc.stdout.readline() + if not line: + err = self.proc.stderr.read() if self.proc.stderr else "" + raise RuntimeError(f"network-shaper failed to start: {err}") + event = json.loads(line) + if event.get("event") != "listening": + raise RuntimeError(f"unexpected network-shaper startup event: {event}") + + def stop(self) -> dict: + if self.proc is not None and self.proc.poll() is None: + self.proc.send_signal(signal.SIGTERM) + try: + self.proc.wait(timeout=5) + except subprocess.TimeoutExpired: + self.proc.kill() + self.proc.wait(timeout=5) + self.proc = None + if self.summary_file is not None and self.summary_file.is_file(): + return json.loads(self.summary_file.read_text()) + return {} + + +class NginxTlsProxy: + """Reverse-proxies Jellyfin over TLS with HTTP/1.1, HTTP/2, and HTTP/3 (QUIC).""" + + def __init__(self, root: Path, upstream_port: int) -> None: + self.root = root / "nginx-tls" + self.upstream_port = upstream_port + self.port = free_port() + self.cert_path = self.root / "cert.pem" + self.key_path = self.root / "key.pem" + self.access_log = self.root / "access.log" + self.proc: subprocess.Popen | None = None + + def start(self) -> None: + self.root.mkdir(parents=True, exist_ok=True) + subprocess.run( + [ + "openssl", + "req", + "-x509", + "-newkey", + "rsa:2048", + "-nodes", + "-keyout", + str(self.key_path), + "-out", + str(self.cert_path), + "-days", + "1", + "-subj", + "/CN=127.0.0.1", + "-addext", + "subjectAltName=IP:127.0.0.1", + ], + check=True, + capture_output=True, + ) + conf_path = self.root / "nginx.conf" + conf_path.write_text( + f"""worker_processes 1; +pid {self.root}/nginx.pid; +error_log {self.root}/error.log warn; +events {{ worker_connections 256; }} +http {{ + client_body_temp_path {self.root}/client_body; + proxy_temp_path {self.root}/proxy; + fastcgi_temp_path {self.root}/fastcgi; + uwsgi_temp_path {self.root}/uwsgi; + scgi_temp_path {self.root}/scgi; + log_format proto '$server_protocol $status $request_length $bytes_sent $http_range'; + access_log {self.access_log} proto; + ssl_certificate {self.cert_path}; + ssl_certificate_key {self.key_path}; + ssl_protocols TLSv1.2 TLSv1.3; + ssl_session_cache shared:SSL:2m; + proxy_buffering off; + proxy_http_version 1.1; + proxy_set_header Connection ""; + server {{ + listen 127.0.0.1:{self.port} ssl; + listen 127.0.0.1:{self.port} quic reuseport; + http2 on; + add_header Alt-Svc 'h3=":{self.port}"'; + location / {{ + proxy_pass http://127.0.0.1:{self.upstream_port}; + proxy_set_header Host $http_host; + }} + }} +}} +""" + ) + self.proc = subprocess.Popen( + ["nginx", "-e", "stderr", "-p", str(self.root), "-c", str(conf_path), "-g", "daemon off;"], + stdout=subprocess.DEVNULL, + stderr=subprocess.PIPE, + ) + deadline = time.monotonic() + 10.0 + while time.monotonic() < deadline: + if self.proc.poll() is not None: + err = self.proc.stderr.read().decode(errors="replace") if self.proc.stderr else "" + raise RuntimeError(f"nginx failed to start: {err}") + try: + with socket.create_connection(("127.0.0.1", self.port), timeout=0.2): + return + except OSError: + time.sleep(0.05) + raise RuntimeError("nginx did not become ready") + + def protocol_counts(self) -> dict[str, int]: + counts: dict[str, int] = {} + if not self.access_log.is_file(): + return counts + for line in self.access_log.read_text().splitlines(): + parts = line.split(" ", 2) + if len(parts) >= 2 and parts[1] in ("200", "206"): + counts[parts[0]] = counts.get(parts[0], 0) + 1 + return counts + + def stop(self) -> None: + if self.proc is not None and self.proc.poll() is None: + self.proc.terminate() + try: + self.proc.wait(timeout=5) + except subprocess.TimeoutExpired: + self.proc.kill() + self.proc.wait(timeout=5) + self.proc = None + + +class PropertyEvent(ctypes.Structure): + _fields_ = [("name", ctypes.c_char_p), ("format", ctypes.c_int), ("data", ctypes.c_void_p)] + + +def run_libmpv_scenario( + *, + helper_module, + libmpv_path: str, + url: str, + origin: str, + auth_header: str, + media_size_bytes: int, + media_duration_s: float, + media_bitrate_bps: int, + http_mode_name: str, + http_mode_int: int, + fixed_requests: int, + max_requests: int, + receive_mode: int, + max_request_size: int, + ca_file: Path | None = None, + play_seconds: float = 6.0, + forward_seek_target_s: float = 14.0, + backward_seek_target_s: float = 11.0, + demuxer_max_bytes: int = 32 << 20, + demuxer_max_back_bytes: int = 16 << 20, + buffer_size: int = 4 << 20, + timeout_s: float = 55.0, +) -> dict: + os.environ["no_proxy"] = "127.0.0.1,localhost" + os.environ["NO_PROXY"] = "127.0.0.1,localhost" + options = { + "vo": "null", + "ao": "null", + "ao-null-untimed": "no", + "video": "auto", + "audio": "auto", + "cache": "yes", + "cache-pause": "yes", + "cache-pause-initial": "yes", + "demuxer-max-bytes": str(demuxer_max_bytes), + "demuxer-max-back-bytes": str(demuxer_max_back_bytes), + "demuxer-readahead-secs": "30", + "curl-http-mode": http_mode_name, + "curl-fixed-requests": str(fixed_requests), + "curl-parallel-requests": str(max_requests), + "curl-receive-mode": {0: "os-auto", 1: "measured", 2: "fixed"}[receive_mode], + "curl-buffer-size": str(buffer_size), + "curl-max-request-size": str(max_request_size), + "http-header-fields": f"Authorization: {auth_header}", + "http-proxy": "", + } + if ca_file is not None: + options["tls-verify"] = "yes" + options["tls-ca-file"] = str(ca_file) + + player = helper_module.Player(libmpv_path, **options) + try: + player.configure( + 1, + max_requests=max_requests, + fixed_requests=fixed_requests, + http_mode=http_mode_int, + receive_mode=receive_mode, + direct_file=True, + source_size_bytes=media_size_bytes, + source_duration_seconds=media_duration_s, + source_bitrate=media_bitrate_bps, + primary_origin=origin, + ) + player.check( + player.transport_control( + { + "format": 2, + "op": 1, + "playback-epoch": 1, + "joint-extra-grant-bytes": 64 << 20, + "background-network": False, + } + ), + "grant", + ) + + observe = player.lib.mpv_observe_property + observe.argtypes = [ctypes.c_void_p, ctypes.c_uint64, ctypes.c_char_p, ctypes.c_int] + observe.restype = ctypes.c_int + player.check(observe(player.handle, 1, b"paused-for-cache", 3), "observe-cache") + + started = time.monotonic() + player.command("loadfile", url) + + file_loaded_s: float | None = None + first_frame_s: float | None = None + steady_started_at: float | None = None + paused_for_cache = False + pause_started_at: float | None = None + startup_buffering_s = 0.0 + rebuffer_events = 0 + rebuffer_seconds = 0.0 + phase = "startup" + seek_started_at: float | None = None + seek_restarted = False + seek_baseline_pos: float | None = None + forward_seek_s: float | None = None + backward_seek_s: float | None = None + phase_started_at: float | None = None + peak_requests = 0 + peak_connections = 0 + observed_http_versions: set[int] = set() + peak_range_bytes = 0 + last_metrics: dict = {} + next_sample_at = 0.0 + playback_error: str | None = None + + while True: + now = time.monotonic() + if now - started > timeout_s: + playback_error = f"timeout-in-phase-{phase}" + break + event = player.lib.mpv_wait_event(player.handle, 0.025).contents + now = time.monotonic() + elapsed = now - started + + if event.id == 8: # MPV_EVENT_FILE_LOADED + if file_loaded_s is None: + file_loaded_s = elapsed + elif event.id == 21: # MPV_EVENT_PLAYBACK_RESTART + if phase in ("forward_seek", "backward_seek"): + seek_restarted = True + elif event.id == 7: # MPV_EVENT_END_FILE + end_file = ctypes.cast(event.data, ctypes.POINTER(helper_module.EndFile)).contents + if end_file.reason == 4: + playback_error = f"mpv-error-{end_file.error}" + break + elif event.id == 22 and event.userdata == 1: # paused-for-cache + prop = ctypes.cast(event.data, ctypes.POINTER(PropertyEvent)).contents + if prop.format == 3 and prop.data: + new_paused = bool(ctypes.cast(prop.data, ctypes.POINTER(ctypes.c_int)).contents.value) + if new_paused != paused_for_cache: + if new_paused: + pause_started_at = now + if phase == "play": + rebuffer_events += 1 + else: + if pause_started_at is not None: + dur = now - pause_started_at + if phase == "startup": + startup_buffering_s += dur + elif phase == "play": + rebuffer_seconds += dur + pause_started_at = None + paused_for_cache = new_paused + + pos = player.get("time-pos") + if pos is not None and isinstance(pos, (int, float)) and math.isfinite(pos): + if first_frame_s is None and pos > 0.05: + first_frame_s = elapsed + if phase == "startup" and file_loaded_s is not None and pos > 0.25 and not paused_for_cache: + phase = "play" + steady_started_at = now + elif phase == "play" and steady_started_at is not None and (now - steady_started_at) >= play_seconds: + phase = "forward_seek" + seek_started_at = now + seek_restarted = False + seek_baseline_pos = None + player.command("seek", str(forward_seek_target_s), "absolute") + elif phase == "forward_seek" and seek_started_at is not None: + if seek_restarted and not paused_for_cache and pos >= forward_seek_target_s - 1.2: + if seek_baseline_pos is None: + seek_baseline_pos = pos + elif pos >= seek_baseline_pos + 0.05: + forward_seek_s = now - seek_started_at + phase = "post_forward_play" + phase_started_at = now + elif ( + phase == "post_forward_play" + and phase_started_at is not None + and (now - phase_started_at) >= 1.5 + ): + phase = "backward_seek" + seek_started_at = now + seek_restarted = False + seek_baseline_pos = None + player.command("seek", str(backward_seek_target_s), "absolute") + elif phase == "backward_seek" and seek_started_at is not None: + if seek_restarted and not paused_for_cache and abs(pos - backward_seek_target_s) <= 1.5: + if seek_baseline_pos is None: + seek_baseline_pos = pos + elif pos >= seek_baseline_pos + 0.05: + backward_seek_s = now - seek_started_at + phase = "done" + break + + if now >= next_sample_at: + next_sample_at = now + 0.2 + metrics = player.get("curl-transport-metrics") or {} + if metrics: + last_metrics = metrics + peak_requests = max(peak_requests, int(metrics.get("peak-active-requests", 0))) + peak_connections = max(peak_connections, int(metrics.get("physical-connections", 0))) + peak_range_bytes = max(peak_range_bytes, int(metrics.get("range-bytes", 0))) + for row in metrics.get("connections", []): + ver = int(row.get("http-version", 0)) + if ver > 0: + observed_http_versions.add(ver) + for row in metrics.get("streams", []): + ver = int(row.get("effective-http-version", 0)) + if ver > 0: + observed_http_versions.add(ver) + cache_dur = player.get("demuxer-cache-duration") or 0.0 + player.transport_control( + { + "format": 2, + "op": 2, + "playback-epoch": 1, + "playback-buffer-seconds": float(cache_dur), + "playback-demand-bits-per-second": float(media_bitrate_bps), + "playback-user-paused": False, + } + ) + + if pause_started_at is not None: + dur = time.monotonic() - pause_started_at + if phase == "startup": + startup_buffering_s += dur + elif phase == "play": + rebuffer_seconds += dur + + demux_max = player.get("demuxer-max-bytes") + demux_back = player.get("demuxer-max-back-bytes") + return { + "completed": phase == "done" and playback_error is None, + "error": playback_error, + "phase_reached": phase, + "file_loaded_s": round(file_loaded_s, 3) if file_loaded_s is not None else None, + "first_frame_s": round(first_frame_s, 3) if first_frame_s is not None else None, + "startup_buffering_s": round(startup_buffering_s, 3), + "rebuffer_events": rebuffer_events, + "rebuffer_seconds": round(rebuffer_seconds, 3), + "forward_seek_s": round(forward_seek_s, 3) if forward_seek_s is not None else None, + "backward_seek_s": round(backward_seek_s, 3) if backward_seek_s is not None else None, + "peak_active_requests": peak_requests, + "peak_physical_connections": peak_connections, + "peak_range_bytes": peak_range_bytes, + "observed_http_versions": sorted(observed_http_versions), + "selected_requests": int(last_metrics.get("selected-requests", 0)), + "capacity_mbps": round(float(last_metrics.get("capacity-bytes-per-second", 0.0)) * 8 / 1_000_000, 2), + "avg_received_mbps": round( + float(last_metrics.get("average-received-bytes-per-second", 0.0)) * 8 / 1_000_000, 2 + ), + "ttfb_ms": round(float(last_metrics.get("ttfb-ms", 0.0)), 1), + "received_bytes": int(last_metrics.get("received-bytes", 0)), + "failed_requests": int(last_metrics.get("failed-requests", 0)), + "demuxer_max_bytes": demux_max, + "demuxer_max_back_bytes": demux_back, + } + finally: + player.close() + + +def main() -> int: + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("--libmpv", required=True, help="Path to libmpv.so") + parser.add_argument("--transport-helper", type=Path, required=True, help="Path to mpv/test/curl_transport.py") + parser.add_argument("--shaper-script", type=Path, required=True, help="Path to tools/network-shaper.py") + parser.add_argument("--jellyfin-bin", default=None, help="Path to jellyfin executable") + parser.add_argument("--ffmpeg-bin", default=None, help="Path to ffmpeg executable") + parser.add_argument("--spool-tests", default=None, help="Optional path to spool-tests binary for live-jellyfin") + parser.add_argument("--duration-s", type=int, default=20, help="Generated movie duration in seconds") + parser.add_argument("--video-mbps", type=int, default=48, help="Generated movie bitrate in Mbps") + parser.add_argument("--rtt-ms", type=float, default=150.0, help="Simulated WAN round-trip latency in ms") + parser.add_argument("--initial-window-bytes", type=int, default=14600, help="Simulated TCP IW in bytes") + parser.add_argument("--max-window-bytes", type=int, default=262144, help="Simulated per-socket max window in bytes") + parser.add_argument("--download-mbps", type=float, default=200.0, help="Aggregate WAN download ceiling in Mbps") + parser.add_argument("--max-request-size", type=int, default=1 << 20, help="curl-max-request-size in bytes") + parser.add_argument("--output", type=Path, default=None, help="Write benchmark JSON report to this path") + parser.add_argument("--benchmark-only", action="store_true", help="Record metrics without failing performance thresholds") + args = parser.parse_args() + + jellyfin_bin = find_jellyfin_binary(args.jellyfin_bin) + if not jellyfin_bin: + print("SKIP: jellyfin binary not found (set --jellyfin-bin or SPOOL_JELLYFIN_BIN)", file=sys.stderr) + return 77 + + ffmpeg_bin = args.ffmpeg_bin or shutil.which("ffmpeg") + if not ffmpeg_bin: + print("SKIP: ffmpeg binary not found", file=sys.stderr) + return 77 + + spec = importlib.util.spec_from_file_location("curl_transport", args.transport_helper) + assert spec and spec.loader + helper = importlib.util.module_from_spec(spec) + spec.loader.exec_module(helper) + + report: dict = { + "config": { + "duration_s": args.duration_s, + "video_mbps": args.video_mbps, + "rtt_ms": args.rtt_ms, + "initial_window_bytes": args.initial_window_bytes, + "max_window_bytes": args.max_window_bytes, + "download_mbps": args.download_mbps, + "max_request_size": args.max_request_size, + }, + "scenarios": {}, + } + + with tempfile.TemporaryDirectory(prefix="spool-jellyfin-e2e-") as tmp: + root = Path(tmp) + media_dir = root / "movies" + movie_path = media_dir / "LatencyBenchmark (2026).mkv" + media_info = generate_high_bitrate_movie( + ffmpeg_bin, movie_path, duration_s=args.duration_s, video_mbps=args.video_mbps + ) + report["media"] = media_info + + jf = JellyfinTestServer(root, jellyfin_bin, media_dir, username="spooltest", password="spooltestpass") + try: + report["jellyfin"] = jf.start() + effective_bitrate = jf.media_bitrate_bps or media_info["actual_bitrate_bps"] + + # 1. Optional live-jellyfin C++ provider E2E through a 60ms RTT proxy + if args.spool_tests and os.path.isfile(args.spool_tests): + live_summary = root / "live-proxy-summary.json" + live_proxy = NetworkShaperProcess( + args.shaper_script, + upstream_port=jf.port, + rtt_ms=60.0, + download_mbps=200.0, + summary_file=live_summary, + ) + live_proxy.start() + try: + t0 = time.monotonic() + env = dict(os.environ) + env["SPOOL_LIVE_JELLYFIN"] = f"http://127.0.0.1:{live_proxy.port}" + env["SPOOL_LIVE_USER"] = jf.username + env["SPOOL_LIVE_PASSWORD"] = jf.password + env["no_proxy"] = "127.0.0.1,localhost" + env["NO_PROXY"] = "127.0.0.1,localhost" + res = subprocess.run( + [args.spool_tests, "live-jellyfin"], + env=env, + capture_output=True, + text=True, + timeout=90, + ) + report["scenarios"]["live_jellyfin_provider"] = { + "passed": res.returncode == 0, + "returncode": res.returncode, + "seconds": round(time.monotonic() - t0, 3), + "proxy": live_proxy.stop(), + } + if res.returncode != 0: + print("live-jellyfin failed:\n" + res.stdout + "\n" + res.stderr, file=sys.stderr) + finally: + live_proxy.stop() + + # 2. HTTP over WAN proxy: single-connection control vs auto adaptive + for name, fixed_req in [("http_single_lane_control", 1), ("http_auto_adaptive", 0)]: + summary_path = root / f"{name}-proxy.json" + proxy = NetworkShaperProcess( + args.shaper_script, + upstream_port=jf.port, + rtt_ms=args.rtt_ms, + download_mbps=args.download_mbps, + initial_window_bytes=args.initial_window_bytes, + max_window_bytes=args.max_window_bytes, + summary_file=summary_path, + ) + proxy.start() + try: + stream_url = f"http://127.0.0.1:{proxy.port}{jf.direct_stream_path()}" + result = run_libmpv_scenario( + helper_module=helper, + libmpv_path=args.libmpv, + url=stream_url, + origin=f"http://127.0.0.1:{proxy.port}", + auth_header=jf.auth_header_value(), + media_size_bytes=jf.media_size_bytes, + media_duration_s=float(args.duration_s), + media_bitrate_bps=effective_bitrate, + http_mode_name="auto", + http_mode_int=0, + fixed_requests=fixed_req, + max_requests=8, + receive_mode=1, + max_request_size=args.max_request_size, + ) + finally: + proxy_stats = proxy.stop() + result["proxy"] = proxy_stats + report["scenarios"][name] = result + + # 3. HTTPS (nginx HTTP/1.1 + HTTP/2 + HTTP/3 Alt-Svc) over WAN TCP slow-start proxy: + # Compare forced HTTP/2 (`tcp`) vs production default (`auto`) + if shutil.which("nginx") and shutil.which("openssl"): + nginx = NginxTlsProxy(root, jf.port) + nginx.start() + try: + for name, mode_name, mode_int, extra_kwargs in [ + ("https_forced_h2_single_socket", "tcp", 1, {}), + ("https_auto_adaptive", "auto", 0, {}), + ( + "https_production_scaled_cache", + "auto", + 0, + { + "buffer_size": 8 << 20, + "max_request_size": 4 << 20, + "demuxer_max_bytes": 512 << 20, + "demuxer_max_back_bytes": 128 << 20, + }, + ), + ]: + summary_path = root / f"{name}-proxy.json" + proxy = NetworkShaperProcess( + args.shaper_script, + upstream_port=nginx.port, + rtt_ms=args.rtt_ms, + download_mbps=args.download_mbps, + initial_window_bytes=args.initial_window_bytes, + max_window_bytes=args.max_window_bytes, + summary_file=summary_path, + ) + proxy.start() + try: + stream_url = f"https://127.0.0.1:{proxy.port}{jf.direct_stream_path()}" + kwargs = { + "max_request_size": args.max_request_size, + **extra_kwargs, + } + result = run_libmpv_scenario( + helper_module=helper, + libmpv_path=args.libmpv, + url=stream_url, + origin=f"https://127.0.0.1:{proxy.port}", + auth_header=jf.auth_header_value(), + media_size_bytes=jf.media_size_bytes, + media_duration_s=float(args.duration_s), + media_bitrate_bps=effective_bitrate, + http_mode_name=mode_name, + http_mode_int=mode_int, + fixed_requests=0, + max_requests=8, + receive_mode=1, + ca_file=nginx.cert_path, + **kwargs, + ) + finally: + proxy_stats = proxy.stop() + result["proxy"] = proxy_stats + result["nginx_protocols"] = nginx.protocol_counts() + report["scenarios"][name] = result + finally: + nginx.stop() + finally: + jf.stop() + + rendered = json.dumps(report, indent=2, sort_keys=True) + if args.output is not None: + args.output.parent.mkdir(parents=True, exist_ok=True) + args.output.write_text(rendered + "\n") + print(rendered, flush=True) + + if args.benchmark_only: + return 0 + + failures: list[str] = [] + live = report["scenarios"].get("live_jellyfin_provider") + if live is not None and not live.get("passed"): + failures.append("live_jellyfin_provider failed") + + http_auto = report["scenarios"].get("http_auto_adaptive", {}) + if not http_auto.get("completed"): + failures.append(f"http_auto_adaptive did not complete: {http_auto.get('error')}") + elif http_auto.get("rebuffer_seconds", 99.0) > 1.0: + failures.append(f"http_auto_adaptive rebuffered too long: {http_auto.get('rebuffer_seconds')}s") + if http_auto.get("peak_physical_connections", 0) < 2: + failures.append("http_auto_adaptive failed to scale physical connections past single-socket ceiling") + + https_auto = report["scenarios"].get("https_auto_adaptive") + if https_auto is not None: + if not https_auto.get("completed"): + failures.append(f"https_auto_adaptive did not complete: {https_auto.get('error')}") + elif https_auto.get("rebuffer_seconds", 99.0) > 1.5: + failures.append(f"https_auto_adaptive rebuffered too long: {https_auto.get('rebuffer_seconds')}s") + if https_auto.get("peak_physical_connections", 0) < 2 and 30 not in https_auto.get("observed_http_versions", []): + failures.append("https_auto_adaptive stayed trapped on a single TCP socket") + + if failures: + for msg in failures: + print("FAIL:", msg, file=sys.stderr) + return 1 + return 0 + + +if __name__ == "__main__": + raise SystemExit(main()) diff --git a/tests/player/MpvOptionProfileTest.cpp b/tests/player/MpvOptionProfileTest.cpp index 5ab43d3e..a03da58f 100644 --- a/tests/player/MpvOptionProfileTest.cpp +++ b/tests/player/MpvOptionProfileTest.cpp @@ -147,8 +147,8 @@ SPOOL_TEST_MAIN("mpv-option-profile") } const auto desktopNetwork = MpvOptionProfile::networkProfile(MpvOptionProfile::Platform::Desktop); - require(desktopNetwork.ringBytes == 4 * 1024 * 1024, "desktop curl ring profile changed"); - require(desktopNetwork.rangeBytes == 1024 * 1024, "desktop curl range profile changed"); + require(desktopNetwork.ringBytes == 8 * 1024 * 1024, "desktop curl ring profile changed"); + require(desktopNetwork.rangeBytes == 4 * 1024 * 1024, "desktop curl range profile changed"); const auto desktop = profileOptions(MpvConfigPolicy {}, MpvOptionProfile::Platform::Desktop, QStringLiteral("alsa"), QByteArrayLiteral("/tmp/mpv.log")); @@ -166,8 +166,8 @@ SPOOL_TEST_MAIN("mpv-option-profile") require(valueFor(desktop, "gpu-shader-cache-dir") == "/tmp/mpv-shaders", "desktop should use the application-owned persistent shader cache"); require(valueFor(desktop, "curl-enabled") == "yes", "desktop should use the libcurl stream backend"); - require(valueFor(desktop, "curl-buffer-size") == "4194304", "desktop should use a 4 MiB network ring"); - require(valueFor(desktop, "curl-max-request-size") == "1048576", "desktop should issue 1 MiB ranges"); + require(valueFor(desktop, "curl-buffer-size") == "8388608", "desktop should use an 8 MiB network ring"); + require(valueFor(desktop, "curl-max-request-size") == "4194304", "desktop should allow up to 4 MiB ranges"); require(valueFor(desktop, "curl-read-size") == "262144", "desktop should read 256 KiB per curl callback"); require(valueFor(desktop, "curl-parallel-requests") == "1", "desktop should default to one range request"); require(valueFor(desktop, "network-timeout") == "15", "a silent connection should be retried after 15 s"); @@ -374,8 +374,8 @@ SPOOL_TEST_MAIN("mpv-option-profile") #endif const auto webOSNetwork = MpvOptionProfile::networkProfile(MpvOptionProfile::Platform::WebOS); - require(webOSNetwork.ringBytes == 2 * 1024 * 1024, "webOS curl ring profile changed"); - require(webOSNetwork.rangeBytes == 512 * 1024, "webOS curl range profile changed"); + require(webOSNetwork.ringBytes == 4 * 1024 * 1024, "webOS curl ring profile changed"); + require(webOSNetwork.rangeBytes == 1024 * 1024, "webOS curl range profile changed"); const auto webOSPcm = profileOptions(MpvConfigPolicy {}, MpvOptionProfile::Platform::WebOS, QStringLiteral("starfish-pcm"), QByteArrayLiteral("/tmp/mpv.log")); @@ -385,8 +385,8 @@ SPOOL_TEST_MAIN("mpv-option-profile") require(valueFor(webOSPcm, "vo-starfish-audio-hint") == "yes", "Starfish PCM should advertise pipeline audio"); require(valueFor(webOSPcm, "ao-starfish-feed-ahead") == "0.4", "Starfish PCM should use the measured feed window"); require(valueFor(webOSPcm, "curl-enabled") == "yes", "webOS should use the libcurl stream backend"); - require(valueFor(webOSPcm, "curl-buffer-size") == "2097152", "webOS should use a 2 MiB network ring"); - require(valueFor(webOSPcm, "curl-max-request-size") == "524288", "webOS should issue 512 KiB ranges"); + require(valueFor(webOSPcm, "curl-buffer-size") == "4194304", "webOS should use a 4 MiB network ring"); + require(valueFor(webOSPcm, "curl-max-request-size") == "1048576", "webOS should allow up to 1 MiB ranges"); require(valueFor(webOSPcm, "curl-read-size") == "131072", "webOS should read 128 KiB per curl callback"); require(valueFor(webOSPcm, "curl-parallel-requests") == "1", "webOS should default to one range request"); require( diff --git a/tests/providers/ScriptRuntimeTest.cpp b/tests/providers/ScriptRuntimeTest.cpp index 1e6b3faf..fc9861b8 100644 --- a/tests/providers/ScriptRuntimeTest.cpp +++ b/tests/providers/ScriptRuntimeTest.cpp @@ -260,9 +260,14 @@ SPOOL_TEST_MAIN("script-runtime") responseBytes *= 2; // Warmup is quick enough to exercise adaptive larger batches; // measured larger samples still have a real parallel benefit. - QTimer::singleShot(20 + bytes / (32 * 1024), socket, [socket, responseBytes] { - socket->write("HTTP/1.1 200 OK\r\nContent-Length: " + QByteArray::number(responseBytes) - + "\r\nSet-Cookie: speed=private\r\nConnection: close\r\n\r\n"); + const bool advertiseH3 = target.path() == QStringLiteral("/speed-h3"); + QTimer::singleShot(20 + bytes / (32 * 1024), socket, [socket, responseBytes, advertiseH3] { + QByteArray headers = "HTTP/1.1 200 OK\r\nContent-Length: " + QByteArray::number(responseBytes) + + "\r\nSet-Cookie: speed=private\r\n"; + if (advertiseH3) + headers += "Alt-Svc: h3=\":443\"; ma=86400\r\n"; + headers += "Connection: close\r\n\r\n"; + socket->write(headers); socket->write(QByteArray(responseBytes, 'x')); socket->disconnectFromHost(); }); @@ -404,15 +409,17 @@ SPOOL_TEST_MAIN("script-runtime") double bestCapacity = 0; double selectedCapacity = 0; const QVariantList curve = measurement.value("concurrency-samples").toList(); - require(curve.size() == 3, "native result preserves every concurrency operating point"); - for (int index = 0; index < 3; ++index) { + require(curve.size() >= 3 && curve.size() <= 4, "native result preserves every concurrency operating point"); + require(measurement.value("http-version").toInt() == 11 && !measurement.value("h3-advertised").toBool(), + "speed probe reports negotiated HTTP protocol and Alt-Svc HTTP/3 advertisement"); + for (int index = 0; index < curve.size(); ++index) { const auto sample = curve[index].toMap(); const double seconds = sample.value("elapsed-seconds").toDouble(); const double rate = sample.value("capacity-bytes-per-second").toDouble(); const double latencyMs = sample.value("ttfb-ms").toDouble(); require(sample.value("requests").toInt() == (1 << index) && sample.value("received-bytes").toLongLong() > 0 && sample.value("received-bytes").toLongLong() <= 64 * 1024 * 1024 && seconds > 0 && latencyMs >= 35 - && latencyMs <= seconds * 1000 + && latencyMs <= seconds * 1000 && sample.value("http-version").toInt() == 11 && std::abs(rate * seconds - sample.value("received-bytes").toDouble()) < 1, "per-concurrency raw capacity accounts actual bounded payload and full wall time including TTFB"); require(seconds >= 0.4 || sample.value("received-bytes").toLongLong() == 64 * 1024 * 1024, @@ -432,9 +439,13 @@ SPOOL_TEST_MAIN("script-runtime") qint64 probeBytes = 0; for (int bytes : std::as_const(speedSizes)) probeBytes += bytes; - require(speedSizes.front() == 512 * 1024 && probeBytes <= 512 * 1024 + 3 * 64 * 1024 * 1024, + require(speedSizes.front() == 512 * 1024 && probeBytes <= 512 * 1024 + curve.size() * 64 * 1024 * 1024, "warmup and adaptive complete-curve measurements have a bounded total byte budget"); - require(speedMaximum == 4 && speedGuiTurns >= 5, "lane requests overlap without blocking GUI events"); + require(speedMaximum >= 4 && speedGuiTurns >= 5, "lane requests overlap without blocking GUI events"); + const auto h3Advertised = QCoro::waitFor(runtime->call("a", "speedTest", { { "path", "speed-h3" } })); + waitForSpeedAbort(); + require(h3Advertised.value("h3-advertised").toBool() && h3Advertised.value("http-version").toInt() == 11, + "speed probe detects Alt-Svc h3 advertisement while reporting negotiated protocol"); require(received.back().contains("Authorization: a-token"), "benchmark passes source authentication headers"); const auto overlapping = QCoro::waitFor(runtime->call("a", "overlappingSpeedTests")); require(overlapping.value("error") == "request_denied" && overlapping.value("bitrate").toLongLong() >= 1000000, diff --git a/tests/providers/SourceHubSpeedTest.cpp b/tests/providers/SourceHubSpeedTest.cpp index fc8575c0..f1135a54 100644 --- a/tests/providers/SourceHubSpeedTest.cpp +++ b/tests/providers/SourceHubSpeedTest.cpp @@ -445,6 +445,43 @@ export function createSource(configuration) { && profile.value("last-selected-requests").toInt() == 1 && hub.playback()->mediaOrigin() == QUrl("https://melbourne.invalid"), "old learned formats reset without dropping accounts or their restored configuration"); + + // Extended high-RTT WAN probe with 8 lanes and HTTPS HTTP/2 vs HTTP/1.1 protocol tags. + require(registry.recordSpeedTest(melbourne, + { { "origin", QStringLiteral("https://melbourne.invalid") }, { "parallelRequests", 8 }, + { "concurrency-samples", + QVariantList { + QVariantMap { { "requests", 1 }, { "http-version", 20 }, + { "capacity-bytes-per-second", 1'700'000.0 }, { "ttfb-ms", 150.0 } }, + QVariantMap { { "requests", 2 }, { "http-version", 20 }, + { "capacity-bytes-per-second", 1'750'000.0 }, { "ttfb-ms", 155.0 } }, + QVariantMap { { "requests", 4 }, { "http-version", 20 }, + { "capacity-bytes-per-second", 1'800'000.0 }, { "ttfb-ms", 160.0 } }, + QVariantMap { { "requests", 4 }, { "http-version", 11 }, + { "capacity-bytes-per-second", 6'800'000.0 }, { "ttfb-ms", 152.0 } }, + QVariantMap { { "requests", 8 }, { "http-version", 11 }, + { "capacity-bytes-per-second", 12'400'000.0 }, { "ttfb-ms", 154.0 } }, + } } }), + "extended WAN probe with HTTP/1.1 comparison and 8-lane point must record cleanly"); + const auto wanProfile = hub.playback()->playbackNetworkProfile(); + require(wanProfile.value("last-selected-requests").toInt() == 8, + "extended WAN probe preserves 8-lane recommendation"); + require(sampleFor(wanProfile, 4, 20, 0, 0).value("ordered-bytes-per-second").toDouble() == 1'800'000.0 + && sampleFor(wanProfile, 4, 11, 0, 0).value("ordered-bytes-per-second").toDouble() == 6'800'000.0 + && sampleFor(wanProfile, 8, 11, 0, 0).value("ordered-bytes-per-second").toDouble() == 12'400'000.0, + "protocol-tagged HTTP/2 vs HTTP/1.1 and 8-lane probe priors remain distinct and reach playback"); + require(!registry.recordSpeedTest(melbourne, + { { "origin", QStringLiteral("https://melbourne.invalid") }, + { "concurrency-samples", + QVariantList { + QVariantMap { { "requests", 1 }, { "http-version", 99 }, + { "capacity-bytes-per-second", 1'000'000.0 }, { "ttfb-ms", 10.0 } }, + QVariantMap { { "requests", 2 }, { "capacity-bytes-per-second", 2'000'000.0 }, + { "ttfb-ms", 10.0 } }, + QVariantMap { { "requests", 4 }, { "capacity-bytes-per-second", 3'000'000.0 }, + { "ttfb-ms", 10.0 } }, + } } }), + "invalid http-version in probe sample must be rejected"); } return 0; } diff --git a/tests/tools/NetworkShaperTest.py b/tests/tools/NetworkShaperTest.py index d847fb80..cd86f27c 100755 --- a/tests/tools/NetworkShaperTest.py +++ b/tests/tools/NetworkShaperTest.py @@ -55,12 +55,29 @@ async def asyncTearDown(self) -> None: self.upstream.close() await self.upstream.wait_closed() - async def start_proxy(self, *, latency: float = 0, download_rate: float = 0) -> int: + async def start_proxy( + self, + *, + latency: float = 0, + download_rate: float = 0, + per_connection_rate: float = 0, + initial_window: int = 0, + max_window: int = 0, + stall_connection: int = 0, + stall_after_bytes: int = 0, + stall_seconds: float = 0.0, + ) -> int: self.shaper = network_shaper.Shaper( self.upstream_endpoint, latency_seconds=latency, upload_bytes_per_second=0, download_bytes_per_second=download_rate, + per_connection_download_bytes_per_second=per_connection_rate, + initial_window_bytes=initial_window, + max_window_bytes=max_window, + stall_connection=stall_connection, + stall_after_bytes=stall_after_bytes, + stall_seconds=stall_seconds, chunk_bytes=4096, ) self.proxy = await asyncio.start_server(self.shaper.handle, "127.0.0.1", 0) @@ -97,6 +114,46 @@ async def test_limits_aggregate_bandwidth_across_connections(self) -> None: # A rate limit bounds throughput, not runner scheduling or socket delays. self.assertGreaterEqual(self.shaper.metrics.download_bytes, len(PAYLOAD) * 2) self.assertEqual(self.shaper.metrics.total_connections, 2) + self.assertGreaterEqual(self.shaper.metrics.peak_active_connections, 2) + + async def test_per_connection_limit_scales_with_parallel_connections(self) -> None: + port = await self.start_proxy(per_connection_rate=256_000) + started_at = time.monotonic() + results = await asyncio.gather(self.fetch(port), self.fetch(port)) + elapsed = time.monotonic() - started_at + + self.assertTrue(all(body == PAYLOAD for _, body in results)) + # Each 128 KiB connection is capped at 256 KB/s (~0.5s); running two in + # parallel must finish much faster than a 256 KB/s aggregate cap (~1.0s). + self.assertGreaterEqual(elapsed, 0.42) + self.assertLess(elapsed, 0.90) + self.assertEqual(self.shaper.metrics.peak_active_connections, 2) + + async def test_slow_start_window_delays_single_connection_warmup(self) -> None: + # 128 KiB over 50ms RTT starting at 16 KiB cwnd requires ~4 RTTs (16+32+64+128). + port = await self.start_proxy(latency=0.025, initial_window=16 * 1024, max_window=128 * 1024) + started_at = time.monotonic() + _, body = await self.fetch(port) + elapsed = time.monotonic() - started_at + + self.assertEqual(body, PAYLOAD) + self.assertGreaterEqual(elapsed, 0.18) + + async def test_injects_one_shot_connection_stall(self) -> None: + port = await self.start_proxy(stall_connection=1, stall_after_bytes=8192, stall_seconds=0.25) + started_at = time.monotonic() + _, body1 = await self.fetch(port) + first_elapsed = time.monotonic() - started_at + + started_at = time.monotonic() + _, body2 = await self.fetch(port) + second_elapsed = time.monotonic() - started_at + + self.assertEqual(body1, PAYLOAD) + self.assertEqual(body2, PAYLOAD) + self.assertGreaterEqual(first_elapsed, 0.23) + self.assertLess(second_elapsed, 0.20) + self.assertEqual(self.shaper.metrics.injected_stalls, 1) class PacerTest(unittest.IsolatedAsyncioTestCase): @@ -144,5 +201,42 @@ async def send(byte_count: int) -> None: self.assertEqual(sent, [(250, 100.0), (500, 100.25), (100, 100.75)]) +class SlowStartWindowTest(unittest.IsolatedAsyncioTestCase): + async def test_doubles_cwnd_each_rtt_and_caps_at_max_window(self) -> None: + now = 10.0 + + async def fake_sleep(delay: float) -> None: + nonlocal now + now += delay + + clock = SimpleNamespace(time=lambda: now) + timers = SimpleNamespace(get_running_loop=lambda: clock, sleep=fake_sleep) + window = network_shaper.SlowStartWindow( + rtt_seconds=0.1, + initial_window_bytes=10_000, + max_window_bytes=30_000, + ) + with patch.object(network_shaper, "asyncio", timers): + # First 10 KB fits in IW10 immediately (t=10.0). + await window.wait(10_000) + self.assertAlmostEqual(now, 10.0, places=6) + self.assertEqual(window.cwnd_bytes, 10_000) + + # Next 20 KB triggers 1 RTT wait (t=10.1), cwnd doubles to 20 KB. + await window.wait(20_000) + self.assertAlmostEqual(now, 10.1, places=6) + self.assertEqual(window.cwnd_bytes, 20_000) + + # Next 30 KB triggers 2nd RTT wait (t=10.2), cwnd caps at 30 KB. + await window.wait(30_000) + self.assertAlmostEqual(now, 10.2, places=6) + self.assertEqual(window.cwnd_bytes, 30_000) + + # Next 30 KB triggers 3rd RTT wait (t=10.3), cwnd stays capped at 30 KB. + await window.wait(30_000) + self.assertAlmostEqual(now, 10.3, places=6) + self.assertEqual(window.cwnd_bytes, 30_000) + + if __name__ == "__main__": unittest.main() diff --git a/tests/transport/protocols.py b/tests/transport/protocols.py index 7edfe944..66a259f9 100644 --- a/tests/transport/protocols.py +++ b/tests/transport/protocols.py @@ -277,6 +277,75 @@ def main(): print(json.dumps({'scenario': 'h3-connection-failure-with-zero-retry-budget', 'http-fallbacks': fallback_count, 'cooldown-reused': True, 'pcm-bytes': len(expected)}), flush=True) + # Verify curl-http-mode=auto escapes a window-capped high-RTT + # HTTPS HTTP/2 single-socket bottleneck onto multiple HTTP/1.1 + # connections while preserving bit-exact decoded PCM. + shaper_port = free_port('127.0.0.1') + while shaper_port in (tls, tcp, broken_quic): + shaper_port = free_port('127.0.0.1') + shaper_script = Path(__file__).resolve().parents[2] / 'tools' / 'network-shaper.py' + shaper = subprocess.Popen( + ['python3', str(shaper_script), + '--listen', f'127.0.0.1:{shaper_port}', + '--upstream', f'127.0.0.1:{tcp}', + '--rtt-ms', '140', '--max-window-bytes', str(256 * 1024), + '--initial-window-bytes', str(10 * 1460)], + stdout=subprocess.DEVNULL, stderr=subprocess.PIPE) + try: + shaper_deadline = time.monotonic() + 5 + while True: + if shaper.poll() is not None: + raise AssertionError('network-shaper failed: ' + shaper.stderr.read().decode()) + try: + with socket.create_connection(('127.0.0.1', shaper_port), timeout=.1): + break + except OSError: + if time.monotonic() > shaper_deadline: + raise AssertionError('network-shaper not ready') + time.sleep(.025) + output = root / 'auto-h1-escape.pcm' + player = transport.Player(args.libmpv, **{ + 'tls-ca-file': root / 'cert.pem', 'ao': 'pcm', 'ao-pcm-file': output, + 'ao-pcm-waveheader': 'no', 'audio-format': 's16', + 'curl-http-mode': 'auto', 'curl-fixed-requests': '0', + 'curl-max-request-size': str(2 << 20), + 'curl-receive-mode': 'fixed', 'curl-receive-bytes': str(4 << 20)}) + try: + player.configure(1, max_requests=4, fixed_requests=0, http_mode=0, + receive_mode=2, receive_bytes=4 << 20, + direct_file=True, source_size_bytes=len(header) + len(expected), + source_duration_seconds=8, source_bitrate=16000000) + player.check(player.transport_control({'format': 2, 'op': 1, 'playback-epoch': 1, + 'joint-extra-grant-bytes': 64 << 20, 'background-network': False}), 'grant') + result = player.play(f'https://127.0.0.1:{shaper_port}/fixture.wav', timeout=60) + finally: + player.close() + if output.read_bytes() != expected: + raise AssertionError('auto HTTPS multi-socket HTTP/1.1 escape altered decoded PCM') + snapshots = [sample for _, sample in result['samples']] + if result['metrics']: + snapshots.append(result['metrics']) + auto_protocols = {row.get('effective-http-version', 0) for sample in snapshots + for row in sample.get('streams', [])} + auto_protocols.update(row.get('http-version', 0) for sample in snapshots + for row in sample.get('connections', [])) + peak_physical = max((sample.get('physical-connections', 0) for sample in snapshots), default=0) + if 11 not in auto_protocols or peak_physical < 2: + raise AssertionError( + f'auto HTTPS did not escape to multi-socket HTTP/1.1: ' + f'protocols={sorted(auto_protocols)} peak_physical={peak_physical}') + print(json.dumps({'scenario': 'auto-https-multisocket-h1-escape', + 'protocols': sorted(auto_protocols), + 'peak-physical-connections': peak_physical, + 'seconds': round(result['seconds'], 3), + 'pcm-bytes': len(expected)}), flush=True) + finally: + shaper.terminate() + try: + shaper.wait(timeout=3) + except subprocess.TimeoutExpired: + shaper.kill() + shaper.wait() finally: nginx.terminate() try: diff --git a/tools/network-shaper.py b/tools/network-shaper.py index 02801fef..2d4e1ce3 100755 --- a/tools/network-shaper.py +++ b/tools/network-shaper.py @@ -7,9 +7,11 @@ import asyncio import contextlib import json +import random import signal import time from dataclasses import dataclass +from pathlib import Path @dataclass(frozen=True) @@ -36,9 +38,11 @@ class Metrics: def __init__(self) -> None: self.started_at = time.monotonic() self.active_connections = 0 + self.peak_active_connections = 0 self.total_connections = 0 self.upload_bytes = 0 self.download_bytes = 0 + self.injected_stalls = 0 def snapshot(self, previous: tuple[float, int, int]) -> tuple[dict[str, float | int], tuple[float, int, int]]: now = time.monotonic() @@ -46,15 +50,32 @@ def snapshot(self, previous: tuple[float, int, int]) -> tuple[dict[str, float | elapsed = max(now - previous_at, 1e-9) snapshot: dict[str, float | int] = { "active_connections": self.active_connections, + "peak_active_connections": self.peak_active_connections, "total_connections": self.total_connections, "upload_bytes": self.upload_bytes, "download_bytes": self.download_bytes, "upload_bps": round((self.upload_bytes - previous_upload) * 8 / elapsed), "download_bps": round((self.download_bytes - previous_download) * 8 / elapsed), + "injected_stalls": self.injected_stalls, "uptime_seconds": round(now - self.started_at, 3), } return snapshot, (now, self.upload_bytes, self.download_bytes) + def summary(self) -> dict[str, float | int]: + now = time.monotonic() + elapsed = max(now - self.started_at, 1e-9) + return { + "active_connections": self.active_connections, + "peak_active_connections": self.peak_active_connections, + "total_connections": self.total_connections, + "upload_bytes": self.upload_bytes, + "download_bytes": self.download_bytes, + "average_download_bps": round(self.download_bytes * 8 / elapsed), + "average_upload_bps": round(self.upload_bytes * 8 / elapsed), + "injected_stalls": self.injected_stalls, + "uptime_seconds": round(elapsed, 3), + } + class Pacer: def __init__(self, bytes_per_second: float) -> None: @@ -72,32 +93,139 @@ async def wait(self, byte_count: int) -> None: await asyncio.sleep(send_at - now) +class SlowStartWindow: + """Models per-connection TCP IW slow-start growth and receive-window ceiling. + + Within each RTT window a connection may transmit at most `cwnd` bytes. + When an RTT window is exhausted, the sender waits for the remaining RTT + duration (modeling ACK arrival) and doubles `cwnd` up to `max_window_bytes`. + """ + + def __init__( + self, + *, + rtt_seconds: float, + initial_window_bytes: int, + max_window_bytes: int, + ) -> None: + self._rtt_seconds = rtt_seconds + self._max_window_bytes = max_window_bytes + if initial_window_bytes > 0: + self._cwnd_bytes = initial_window_bytes + if max_window_bytes > 0: + self._cwnd_bytes = min(self._cwnd_bytes, max_window_bytes) + elif max_window_bytes > 0: + self._cwnd_bytes = max_window_bytes + else: + self._cwnd_bytes = 0 + self._window_started_at = 0.0 + self._sent_in_window = 0 + + @property + def enabled(self) -> bool: + return self._cwnd_bytes > 0 and self._rtt_seconds > 0 + + @property + def cwnd_bytes(self) -> int: + return self._cwnd_bytes + + async def wait(self, byte_count: int) -> None: + if not self.enabled or byte_count <= 0: + return + loop = asyncio.get_running_loop() + remaining = byte_count + while remaining > 0: + now = loop.time() + if self._window_started_at <= 0.0: + self._window_started_at = now + self._sent_in_window = 0 + elif now - self._window_started_at >= self._rtt_seconds: + # Idle or completed RTT: advance window; if bytes were sent in + # the previous RTT, grow cwnd exponentially like TCP slow-start. + if self._sent_in_window > 0: + self._grow_cwnd() + self._window_started_at = now + self._sent_in_window = 0 + + available = self._cwnd_bytes - self._sent_in_window + if available <= 0: + delay = (self._window_started_at + self._rtt_seconds) - now + if delay > 0: + await asyncio.sleep(delay) + self._grow_cwnd() + self._window_started_at = loop.time() + self._sent_in_window = 0 + available = self._cwnd_bytes + + take = min(remaining, available) + self._sent_in_window += take + remaining -= take + + def _grow_cwnd(self) -> None: + grown = self._cwnd_bytes * 2 + if self._max_window_bytes > 0: + grown = min(grown, self._max_window_bytes) + self._cwnd_bytes = max(self._cwnd_bytes, grown) + + async def relay( reader: asyncio.StreamReader, writer: asyncio.StreamWriter, *, latency_seconds: float, + jitter_seconds: float = 0.0, + rng: random.Random | None = None, pacer: Pacer, + connection_pacer: Pacer | None = None, + window: SlowStartWindow | None = None, + stall_after_bytes: int = 0, + stall_seconds: float = 0.0, + on_stall=None, chunk_bytes: int, on_bytes, ) -> None: queue: asyncio.Queue[tuple[float, bytes] | None] = asyncio.Queue(maxsize=64) loop = asyncio.get_running_loop() + last_ready_at = 0.0 async def receive() -> None: + nonlocal last_ready_at while data := await reader.read(chunk_bytes): - await queue.put((loop.time() + latency_seconds, data)) + delay = latency_seconds + if jitter_seconds > 0 and rng is not None: + delay = max(0.0, delay + rng.uniform(-jitter_seconds, jitter_seconds)) + # Preserve TCP in-order delivery even with jitter. + ready_at = max(last_ready_at, loop.time() + delay) + last_ready_at = ready_at + await queue.put((ready_at, data)) await queue.put(None) async def transmit() -> None: + transferred = 0 + stalled = False while queued := await queue.get(): ready_at, data = queued delay = ready_at - loop.time() if delay > 0: await asyncio.sleep(delay) + if ( + not stalled + and stall_after_bytes > 0 + and stall_seconds > 0 + and transferred >= stall_after_bytes + ): + stalled = True + if on_stall is not None: + on_stall() + await asyncio.sleep(stall_seconds) + if window is not None: + await window.wait(len(data)) + if connection_pacer is not None: + await connection_pacer.wait(len(data)) await pacer.wait(len(data)) writer.write(data) await writer.drain() + transferred += len(data) on_bytes(len(data)) if writer.can_write_eof(): writer.write_eof() @@ -117,11 +245,27 @@ def __init__( upload_bytes_per_second: float, download_bytes_per_second: float, chunk_bytes: int, + per_connection_download_bytes_per_second: float = 0.0, + initial_window_bytes: int = 0, + max_window_bytes: int = 0, + jitter_seconds: float = 0.0, + jitter_seed: int = 1, + stall_connection: int = 0, + stall_after_bytes: int = 0, + stall_seconds: float = 0.0, ) -> None: self.upstream = upstream self.latency_seconds = latency_seconds + self.jitter_seconds = jitter_seconds + self.rng = random.Random(jitter_seed) self.upload_pacer = Pacer(upload_bytes_per_second) self.download_pacer = Pacer(download_bytes_per_second) + self.per_connection_download_bytes_per_second = per_connection_download_bytes_per_second + self.initial_window_bytes = initial_window_bytes + self.max_window_bytes = max_window_bytes + self.stall_connection = stall_connection + self.stall_after_bytes = stall_after_bytes + self.stall_seconds = stall_seconds self.chunk_bytes = chunk_bytes self.metrics = Metrics() self.connections: set[asyncio.Task[None]] = set() @@ -132,6 +276,24 @@ async def handle(self, client_reader: asyncio.StreamReader, client_writer: async self.connections.add(task) self.metrics.active_connections += 1 self.metrics.total_connections += 1 + connection_index = self.metrics.total_connections + if self.metrics.active_connections > self.metrics.peak_active_connections: + self.metrics.peak_active_connections = self.metrics.active_connections + connection_download_pacer = ( + Pacer(self.per_connection_download_bytes_per_second) + if self.per_connection_download_bytes_per_second > 0 + else None + ) + window = ( + SlowStartWindow( + rtt_seconds=self.latency_seconds * 2.0, + initial_window_bytes=self.initial_window_bytes, + max_window_bytes=self.max_window_bytes, + ) + if (self.initial_window_bytes > 0 or self.max_window_bytes > 0) + else None + ) + should_stall = self.stall_connection > 0 and connection_index == self.stall_connection try: upstream_reader, upstream_writer = await asyncio.open_connection( self.upstream.host, self.upstream.port @@ -143,6 +305,8 @@ async def handle(self, client_reader: asyncio.StreamReader, client_writer: async client_reader, upstream_writer, latency_seconds=self.latency_seconds, + jitter_seconds=self.jitter_seconds, + rng=self.rng, pacer=self.upload_pacer, chunk_bytes=self.chunk_bytes, on_bytes=self._record_upload, @@ -153,7 +317,14 @@ async def handle(self, client_reader: asyncio.StreamReader, client_writer: async upstream_reader, client_writer, latency_seconds=self.latency_seconds, + jitter_seconds=self.jitter_seconds, + rng=self.rng, pacer=self.download_pacer, + connection_pacer=connection_download_pacer, + window=window, + stall_after_bytes=self.stall_after_bytes if should_stall else 0, + stall_seconds=self.stall_seconds if should_stall else 0.0, + on_stall=self._record_stall, chunk_bytes=self.chunk_bytes, on_bytes=self._record_download, ) @@ -177,6 +348,9 @@ def _record_upload(self, byte_count: int) -> None: def _record_download(self, byte_count: int) -> None: self.metrics.download_bytes += byte_count + def _record_stall(self) -> None: + self.metrics.injected_stalls += 1 + async def report_metrics(metrics: Metrics, interval: float) -> None: previous = (time.monotonic(), 0, 0) @@ -188,11 +362,20 @@ async def report_metrics(metrics: Metrics, interval: float) -> None: async def run(args: argparse.Namespace) -> None: one_way_latency = args.rtt_ms / 2000 + one_way_jitter = args.jitter_ms / 2000 shaper = Shaper( args.upstream, latency_seconds=one_way_latency, upload_bytes_per_second=args.upload_mbps * 1_000_000 / 8, download_bytes_per_second=args.download_mbps * 1_000_000 / 8, + per_connection_download_bytes_per_second=args.per_connection_mbps * 1_000_000 / 8, + initial_window_bytes=args.initial_window_bytes, + max_window_bytes=args.max_window_bytes, + jitter_seconds=one_way_jitter, + jitter_seed=args.jitter_seed, + stall_connection=args.stall_connection, + stall_after_bytes=args.stall_after_bytes, + stall_seconds=args.stall_seconds, chunk_bytes=args.chunk_bytes, ) stop = asyncio.Event() @@ -210,8 +393,12 @@ async def run(args: argparse.Namespace) -> None: "addresses": addresses, "upstream": [args.upstream.host, args.upstream.port], "rtt_ms": args.rtt_ms, + "jitter_ms": args.jitter_ms, "upload_mbps": args.upload_mbps, "download_mbps": args.download_mbps, + "per_connection_mbps": args.per_connection_mbps, + "initial_window_bytes": args.initial_window_bytes, + "max_window_bytes": args.max_window_bytes, }, sort_keys=True, ), @@ -234,27 +421,66 @@ async def run(args: argparse.Namespace) -> None: connection.cancel() if shaper.connections: await asyncio.gather(*shaper.connections, return_exceptions=True) + if args.summary_file: + summary_path = Path(args.summary_file) + summary_path.parent.mkdir(parents=True, exist_ok=True) + summary_path.write_text(json.dumps(shaper.metrics.summary(), indent=2, sort_keys=True) + "\n") def build_parser() -> argparse.ArgumentParser: parser = argparse.ArgumentParser( - description="Forward TCP traffic with fixed RTT and directional bandwidth limits." + description="Forward TCP traffic with fixed RTT, slow-start window, and directional bandwidth limits." ) parser.add_argument("--listen", type=parse_endpoint, default=parse_endpoint("127.0.0.1:18096")) parser.add_argument("--upstream", type=parse_endpoint, required=True) parser.add_argument("--rtt-ms", type=float, default=0, help="round-trip latency in milliseconds") + parser.add_argument("--jitter-ms", type=float, default=0, help="bounded round-trip jitter in milliseconds") + parser.add_argument("--jitter-seed", type=int, default=1, help="deterministic RNG seed for latency jitter") parser.add_argument("--upload-mbps", type=float, default=0, help="upload limit; zero is unlimited") - parser.add_argument("--download-mbps", type=float, default=0, help="download limit; zero is unlimited") + parser.add_argument("--download-mbps", type=float, default=0, help="aggregate download limit; zero is unlimited") + parser.add_argument( + "--per-connection-mbps", + type=float, + default=0, + help="per-connection download limit; zero is unlimited", + ) + parser.add_argument( + "--initial-window-bytes", + type=int, + default=0, + help="per-connection TCP initial congestion window (e.g. 14600); doubles each RTT; zero disables", + ) + parser.add_argument( + "--max-window-bytes", + type=int, + default=0, + help="per-connection receive/congestion window cap in bytes; zero is uncapped", + ) + parser.add_argument("--stall-connection", type=int, default=0, help="1-based connection index to stall once") + parser.add_argument("--stall-after-bytes", type=int, default=0, help="bytes downloaded before injecting stall") + parser.add_argument("--stall-seconds", type=float, default=0, help="duration of injected stall in seconds") parser.add_argument("--chunk-bytes", type=int, default=16 * 1024) parser.add_argument("--metrics-interval", type=float, default=1.0, help="JSON metrics interval; zero disables") + parser.add_argument("--summary-file", type=str, default="", help="optional path to write JSON metrics on exit") return parser def main() -> None: parser = build_parser() args = parser.parse_args() - if args.rtt_ms < 0 or args.upload_mbps < 0 or args.download_mbps < 0: - parser.error("latency and bandwidth limits cannot be negative") + if ( + args.rtt_ms < 0 + or args.jitter_ms < 0 + or args.upload_mbps < 0 + or args.download_mbps < 0 + or args.per_connection_mbps < 0 + or args.initial_window_bytes < 0 + or args.max_window_bytes < 0 + or args.stall_connection < 0 + or args.stall_after_bytes < 0 + or args.stall_seconds < 0 + ): + parser.error("latency, window, stall, and bandwidth limits cannot be negative") if not 1024 <= args.chunk_bytes <= 1024 * 1024: parser.error("--chunk-bytes must be between 1024 and 1048576") if args.metrics_interval < 0: From d3b5345dc16dc8bc55c5ca2bdaf655799dedd788 Mon Sep 17 00:00:00 2001 From: Sacha Korban Date: Fri, 27 Nov 2026 02:50:05 +1100 Subject: [PATCH 15/39] fix(android): configure Maven mirrors before Qt and respect repository policy Consolidate the release milestone ending at 17fbd5f4656915cf2b4545e9832c3275d4f80197. Original starting snapshot: 39272acc4898e0022da6059dc22435947f2d28ce. --- .github/workflows/build-artifacts.yml | 2 +- tools/android/build-apks.sh | 19 +++------------ tools/android/build-qt6.sh | 3 +++ tools/android/gradle-mirror.sh | 33 +++++++++++++++++++++++++++ 4 files changed, 40 insertions(+), 17 deletions(-) create mode 100644 tools/android/gradle-mirror.sh diff --git a/.github/workflows/build-artifacts.yml b/.github/workflows/build-artifacts.yml index 78956db0..b69db380 100644 --- a/.github/workflows/build-artifacts.yml +++ b/.github/workflows/build-artifacts.yml @@ -1223,7 +1223,7 @@ jobs: build/android/qt build/android/deps build/android/qcoro - key: android6-${{ matrix.abi }}-${{ runner.os }}-${{ steps.cache-inputs.outputs.mpv }}-${{ steps.cache-inputs.outputs.toolchain }}-${{ hashFiles('tools/manifests/streaming-third-party.json', 'tools/prepare-streaming-sources.sh', 'tools/streaming-fingerprint.py', 'tools/check-streaming-dependencies.py', 'tools/cmake/StreamingDependencies.cmake', 'tools/cmake/QuicBatchingProbe/CMakeLists.txt', 'tools/lib/streaming-build.sh', 'tools/patches/curl-*.patch', 'tools/windows/build-streaming-dependencies.ps1', 'tools/android/build-dependencies.sh', 'tools/android/build-qt6.sh', 'tools/android/patches/*.patch', 'tools/ffmpeg-capabilities.py', 'tools/lib/build-common.sh', 'tools/lib/manifest-sources.sh', 'tools/manifests/android-third-party.json', 'tools/manifests/ffmpeg-capabilities.json', 'tools/manifests/toolchain.json', 'tools/manifests/qt-android.json') }} + key: android6-${{ matrix.abi }}-${{ runner.os }}-${{ steps.cache-inputs.outputs.mpv }}-${{ steps.cache-inputs.outputs.toolchain }}-${{ hashFiles('tools/manifests/streaming-third-party.json', 'tools/prepare-streaming-sources.sh', 'tools/streaming-fingerprint.py', 'tools/check-streaming-dependencies.py', 'tools/cmake/StreamingDependencies.cmake', 'tools/cmake/QuicBatchingProbe/CMakeLists.txt', 'tools/lib/streaming-build.sh', 'tools/patches/curl-*.patch', 'tools/windows/build-streaming-dependencies.ps1', 'tools/android/build-dependencies.sh', 'tools/android/build-qt6.sh', 'tools/android/gradle-mirror.sh', 'tools/android/patches/*.patch', 'tools/ffmpeg-capabilities.py', 'tools/lib/build-common.sh', 'tools/lib/manifest-sources.sh', 'tools/manifests/android-third-party.json', 'tools/manifests/ffmpeg-capabilities.json', 'tools/manifests/toolchain.json', 'tools/manifests/qt-android.json') }} - name: Build cached Android toolchains if: ${{ steps.android-cache.outputs.cache-hit != 'true' }} diff --git a/tools/android/build-apks.sh b/tools/android/build-apks.sh index 0e77f386..9793e261 100755 --- a/tools/android/build-apks.sh +++ b/tools/android/build-apks.sh @@ -4,6 +4,8 @@ set -euo pipefail ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)" # shellcheck source=tools/lib/manifest-sources.sh source "$ROOT/tools/lib/manifest-sources.sh" +# shellcheck source=tools/android/gradle-mirror.sh +source "$ROOT/tools/android/gradle-mirror.sh" ABI="${ANDROID_ABI:-x86_64}" QT_VERSION="${QT_VERSION:-$(toolchain_field "$ROOT" qt.version)}" DEPS_PREFIX="${ANDROID_DEPS_PREFIX:-$ROOT/build/android/deps/$ABI}" @@ -144,22 +146,7 @@ settings["qml-root-path"] = [sys.argv[2]] path.write_text(json.dumps(settings, indent=2) + "\n") PY done - local gradle_home="${GRADLE_USER_HOME:-$HOME/.gradle}" - mkdir -p "$gradle_home/init.d" - cat > "$gradle_home/init.d/spool-maven-mirror.gradle" <<'GRADLE' -allprojects { - buildscript { - repositories { - google() - maven { url = uri("https://maven-central.storage-download.googleapis.com/maven2/") } - } - } - repositories { - google() - maven { url = uri("https://maven-central.storage-download.googleapis.com/maven2/") } - } -} -GRADLE + configure_android_gradle_mirror local build_apk_target build_apk_target() { local apk_target="$1" diff --git a/tools/android/build-qt6.sh b/tools/android/build-qt6.sh index be338279..92542030 100755 --- a/tools/android/build-qt6.sh +++ b/tools/android/build-qt6.sh @@ -4,6 +4,8 @@ set -euo pipefail ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)" source "$ROOT/tools/lib/build-common.sh" source "$ROOT/tools/lib/manifest-sources.sh" +# shellcheck source=tools/android/gradle-mirror.sh +source "$ROOT/tools/android/gradle-mirror.sh" PHASE="${1:-all}" ABI="${ANDROID_ABI:-x86_64}" @@ -241,6 +243,7 @@ build_module() { build_all() { require_environment + configure_android_gradle_mirror fetch_sources describe_parallel_jobs "$JOBS" "Android Qt" "${QT_ANDROID_MEMORY_PER_JOB_MIB:-1536}" "${QT_ANDROID_MEMORY_RESERVE_MIB:-2048}" build_qtbase diff --git a/tools/android/gradle-mirror.sh b/tools/android/gradle-mirror.sh new file mode 100644 index 00000000..e0a40894 --- /dev/null +++ b/tools/android/gradle-mirror.sh @@ -0,0 +1,33 @@ +#!/usr/bin/env bash + +# Gradle builds both Qt Java libraries and application APKs. +configure_android_gradle_mirror() { + local gradle_home="${GRADLE_USER_HOME:-$HOME/.gradle}" + mkdir -p "$gradle_home/init.d" + cat > "$gradle_home/init.d/spool-maven-mirror.gradle" <<'GRADLE' +import org.gradle.api.initialization.resolve.RepositoriesMode + +def mirror = "https://maven-central.storage-download.googleapis.com/maven2/" + +beforeSettings { settings -> + settings.dependencyResolutionManagement.repositories { + maven { url = uri(mirror) } + } +} +settingsEvaluated { settings -> + def projectRepositoriesAllowed = settings.dependencyResolutionManagement.repositoriesMode.get() == RepositoriesMode.PREFER_PROJECT + gradle.allprojects { + buildscript.repositories { + google() + maven { url = uri(mirror) } + } + if (projectRepositoriesAllowed) { + repositories { + google() + maven { url = uri(mirror) } + } + } + } +} +GRADLE +} From 2c345434947ab38fcdbd1b8ca82fd1db0a212a5d Mon Sep 17 00:00:00 2001 From: Sacha Korban Date: Fri, 27 Nov 2026 03:00:59 +1100 Subject: [PATCH 16/39] test(network): verify independent pacing without runner speed limits --- tests/tools/NetworkShaperTest.py | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/tests/tools/NetworkShaperTest.py b/tests/tools/NetworkShaperTest.py index cd86f27c..fa9d6ea9 100755 --- a/tests/tools/NetworkShaperTest.py +++ b/tests/tools/NetworkShaperTest.py @@ -117,16 +117,26 @@ async def test_limits_aggregate_bandwidth_across_connections(self) -> None: self.assertGreaterEqual(self.shaper.metrics.peak_active_connections, 2) async def test_per_connection_limit_scales_with_parallel_connections(self) -> None: - port = await self.start_proxy(per_connection_rate=256_000) - started_at = time.monotonic() - results = await asyncio.gather(self.fetch(port), self.fetch(port)) - elapsed = time.monotonic() - started_at + paced_bytes: dict[object, int] = {} + + class ObservedPacer(network_shaper.Pacer): + async def wait(self, byte_count: int) -> None: + if self._bytes_per_second > 0: + paced_bytes[self] = paced_bytes.get(self, 0) + byte_count + await super().wait(byte_count) + + with patch.object(network_shaper, "Pacer", ObservedPacer): + port = await self.start_proxy(per_connection_rate=256_000) + started_at = time.monotonic() + results = await asyncio.gather(self.fetch(port), self.fetch(port)) + elapsed = time.monotonic() - started_at self.assertTrue(all(body == PAYLOAD for _, body in results)) - # Each 128 KiB connection is capped at 256 KB/s (~0.5s); running two in - # parallel must finish much faster than a 256 KB/s aggregate cap (~1.0s). + # Both payloads must traverse separate rate reservations. A wall-clock + # upper bound also measures unrelated runner scheduling and socket I/O. self.assertGreaterEqual(elapsed, 0.42) - self.assertLess(elapsed, 0.90) + self.assertEqual(len(paced_bytes), 2) + self.assertTrue(all(count >= len(PAYLOAD) for count in paced_bytes.values())) self.assertEqual(self.shaper.metrics.peak_active_connections, 2) async def test_slow_start_window_delays_single_connection_warmup(self) -> None: @@ -145,14 +155,11 @@ async def test_injects_one_shot_connection_stall(self) -> None: _, body1 = await self.fetch(port) first_elapsed = time.monotonic() - started_at - started_at = time.monotonic() _, body2 = await self.fetch(port) - second_elapsed = time.monotonic() - started_at self.assertEqual(body1, PAYLOAD) self.assertEqual(body2, PAYLOAD) self.assertGreaterEqual(first_elapsed, 0.23) - self.assertLess(second_elapsed, 0.20) self.assertEqual(self.shaper.metrics.injected_stalls, 1) From 2c03d85e5ff80c88d80cfa52029ce5f135e6416d Mon Sep 17 00:00:00 2001 From: Sacha Korban Date: Fri, 27 Nov 2026 03:00:59 +1100 Subject: [PATCH 17/39] test(e2e): recognize startup text and diagnose stalled pause observations --- tests/e2e/AppJourneyTest.cpp | 95 +++++++++++++++++++++++++++++++++--- 1 file changed, 88 insertions(+), 7 deletions(-) diff --git a/tests/e2e/AppJourneyTest.cpp b/tests/e2e/AppJourneyTest.cpp index d6601fa9..bf21e27e 100644 --- a/tests/e2e/AppJourneyTest.cpp +++ b/tests/e2e/AppJourneyTest.cpp @@ -101,6 +101,59 @@ QString executable(const char *variable, const QString& fallback) require(!result.isEmpty() && QFileInfo(result).isExecutable(), "required built app or runtime tool is unavailable"); return result; } +QString sampleBlockedProcess(qint64 pid, const QString& directory, const QProcessEnvironment& environment) +{ +#if defined(Q_OS_MACOS) + const QString path = directory + "/blocked-process.sample"; + QFile file(path); + if (pid <= 0 || !file.open(QIODevice::WriteOnly) + || !file.setPermissions(QFileDevice::ReadOwner | QFileDevice::WriteOwner)) + return QStringLiteral("unavailable"); + file.close(); + try { + run("/usr/bin/sample", { QString::number(pid), "1", "10", "-file", path }, environment, {}, 10000); + } catch (const std::exception&) { + QFile::remove(path); + return QStringLiteral("unavailable"); + } + QStringList symbols; + if (file.open(QIODevice::ReadOnly)) { + // A sample includes process paths and other metadata. Export only + // known stack symbols, never its header, addresses or arbitrary text. + const QStringList lines = QString::fromUtf8(file.readAll()).split('\n'); + for (const QString& line : lines) { + const QStringList words = line.simplified().split(' '); + for (const QString& word : words) { + const QString symbol = word.section('(', 0, 0); + if (!symbol.startsWith("mpv_") && !symbol.startsWith("mp_") && !symbol.startsWith("vo_") + && !symbol.startsWith("Spool::") && !symbol.startsWith("QQuick") && !symbol.startsWith("QSG") + && !symbol.startsWith("QEvent") && !symbol.startsWith("QCoreApplication::") + && !symbol.startsWith("__psynch_") && !symbol.startsWith("pthread_") + && !symbol.startsWith("_pthread_") && !symbol.startsWith("mach_msg")) + continue; + if (symbol.size() > 160 || !std::all_of(symbol.cbegin(), symbol.cend(), [](QChar c) { + return c.isLetterOrNumber() || c == '_' || c == ':' || c == '~'; + })) + continue; + if (!symbols.contains(symbol)) + symbols.append(symbol); + if (symbols.size() >= 48) + break; + } + if (symbols.size() >= 48) + break; + } + } + file.close(); + QFile::remove(path); + return symbols.isEmpty() ? QStringLiteral("unavailable") : symbols.join(','); +#else + Q_UNUSED(pid); + Q_UNUSED(directory); + Q_UNUSED(environment); + return QStringLiteral("unavailable"); +#endif +} class DeviceSession final { public: DeviceSession(QString kind, const QString& directory, QProcessEnvironment environment) @@ -219,6 +272,10 @@ class DeviceSession final { { return hostDescriptor; } + QString blockedProcessSample() const + { + return sampleBlockedProcess(processPid, QFileInfo(hostDescriptor).absolutePath(), environment); + } QString screenshotPath() const { return remoteScreenshot; @@ -436,11 +493,16 @@ class DeviceSession final { } const QImage image(screenshot); require(!image.isNull(), "actual mobile normal-startup screenshot was not an image"); - const QByteArray text = runOcr(ocr, { screenshot, "stdout", "-l", "eng", "--psm", "11" }, environment); - if (QString::fromUtf8(text).contains("Welcome to Spool", Qt::CaseInsensitive)) { - rendered = true; - break; + for (const QString& segmentation : { QStringLiteral("11"), QStringLiteral("6") }) { + const QByteArray text + = runOcr(ocr, { screenshot, "stdout", "-l", "eng", "--psm", segmentation }, environment); + if (QString::fromUtf8(text).simplified().contains("Welcome to Spool", Qt::CaseInsensitive)) { + rendered = true; + break; + } } + if (rendered) + break; turn(200); } require(rendered && productRunning(), "actual mobile normal launch did not render its product UI"); @@ -1415,19 +1477,32 @@ class Journey final { "playback did not complete its first renderer restart before pause"); command({ "pause" }); QJsonObject playback; + int observations = 0; + int timeouts = 0; + QElapsedTimer lastObservation; + lastObservation.start(); try { await( [&] { const auto observed = state(true)["playback"].toObject(); - if (observed.isEmpty()) + if (observed.isEmpty()) { + ++timeouts; return false; + } + ++observations; + lastObservation.restart(); playback = observed; return playback["paused"].toBool(); }, message); } catch (const std::exception& error) { + const QString sample = timeouts > 0 ? (device ? device->blockedProcessSample() + : sampleBlockedProcess(app.processId(), + QFileInfo(screenshotPath).absolutePath(), environment)) + : QStringLiteral("not-needed"); throw std::runtime_error(QStringLiteral( - "%1 (active=%2, loaded=%3, ready=%4, paused=%5, failed=%6, position=%7, duration=%8, pause=%9)") + "%1 (active=%2, loaded=%3, ready=%4, paused=%5, failed=%6, position=%7, duration=%8, pause=%9, " + "observations=%10, timeouts=%11, last_observation_ms=%12, stack_symbols=%13)") .arg(QString::fromUtf8(error.what())) .arg(playback["active"].toBool()) .arg(playback["loaded"].toBool()) @@ -1437,6 +1512,10 @@ class Journey final { .arg(playback["position"].toDouble(), 0, 'f', 2) .arg(playback["duration"].toDouble(), 0, 'f', 2) .arg(playback["pauseCommand"].toString()) + .arg(observations) + .arg(timeouts) + .arg(lastObservation.elapsed()) + .arg(sample) .toStdString()); } } @@ -2218,7 +2297,9 @@ SPOOL_TEST_MAIN("app-journey") [&] { restartPosition = journey.state()["playback"].toObject()["position"].toDouble(); restartRed = frameHasBands(journey.capture(true), 0); - return restartPosition < 11.5 && restartRed; + // The fixture stays red until 12s. Allow the same 0.2s + // timestamp/frame tolerance used at the remote-play boundary. + return restartPosition < 12.2 && restartRed; }, "explicit episode restart did not decode the beginning"); } catch (const std::exception&) { From 4bb6ef8de07626dcad2ada6054b2459e2907eb48 Mon Sep 17 00:00:00 2001 From: Sacha Korban Date: Fri, 27 Nov 2026 08:13:30 +1100 Subject: [PATCH 18/39] fix(webos): prefer measured firmware output latency over calibration --- src/platform/webos/WebOSAudioSyncPolicy.cpp | 6 +++--- tests/player/AudioSyncPolicyTest.cpp | 11 +++++++++++ 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/src/platform/webos/WebOSAudioSyncPolicy.cpp b/src/platform/webos/WebOSAudioSyncPolicy.cpp index 19ded2ff..e25201fa 100644 --- a/src/platform/webos/WebOSAudioSyncPolicy.cpp +++ b/src/platform/webos/WebOSAudioSyncPolicy.cpp @@ -48,10 +48,10 @@ RouteLatencies resolveRouteLatencies(const QString& output, int displayMs, int o const QString key = normalizedOutputKey(output); // The controls can return zero-filled payloads before the route is ready. // These fallbacks are the calibrated values from the webOS sync experiment. - int fallbackOutput = firmwareMediaMs; - if (key == QStringLiteral("external_arc")) + int fallbackOutput = firmwareMediaMs >= 0 && firmwareMediaMs <= 2000 ? firmwareMediaMs : -1; + if (fallbackOutput < 0 && key == QStringLiteral("external_arc")) fallbackOutput = 53; - else if (key == QStringLiteral("tv_speaker")) + else if (fallbackOutput < 0 && key == QStringLiteral("tv_speaker")) fallbackOutput = 74; if (displayMs <= 0 && (outputMs > 0 || fallbackOutput >= 0 || key == QStringLiteral("bt_soundbar"))) displayMs = 150; diff --git a/tests/player/AudioSyncPolicyTest.cpp b/tests/player/AudioSyncPolicyTest.cpp index aecf45ec..aa002e6a 100644 --- a/tests/player/AudioSyncPolicyTest.cpp +++ b/tests/player/AudioSyncPolicyTest.cpp @@ -46,6 +46,17 @@ SPOOL_TEST_MAIN("audio-sync-policy") const auto headphones = AudioSyncPolicy::resolveRouteLatencies(QStringLiteral("headphone"), 0, 0, 60); require(headphones.displayMs == 150 && headphones.outputMs == 60, "Firmware output latency should be used when available"); + for (const QString& route : { QStringLiteral("external_arc"), QStringLiteral("tv_speaker") }) { + require(AudioSyncPolicy::resolveRouteLatencies(route, 150, 0, 100).outputMs == 100, + "device firmware takes precedence over route calibration"); + require(AudioSyncPolicy::resolveRouteLatencies(route, 150, 80, 100).outputMs == 80, + "measured route output takes precedence over firmware"); + require(AudioSyncPolicy::resolveRouteLatencies(route, 150, 0, 3000).outputMs + == AudioSyncPolicy::resolveRouteLatencies(route, 150, 0, -1).outputMs, + "out-of-range firmware falls back to route calibration"); + } + require(AudioSyncPolicy::resolveRouteLatencies(QStringLiteral("unknown"), 150, 0, 3000).outputMs == 0, + "invalid firmware cannot invent a measured latency for unknown routes"); return EXIT_SUCCESS; } From 606db8898c396df4a74b75a0acd763a5bbcbd20e Mon Sep 17 00:00:00 2001 From: Sacha Korban Date: Fri, 27 Nov 2026 18:12:00 +1100 Subject: [PATCH 19/39] fix(player): acknowledge cache limits and share extra memory allowance --- src/app/SettingsSchema.cpp | 4 +- src/app/StreamingCachePolicy.cpp | 18 +++ src/app/StreamingCachePolicy.h | 11 ++ src/player/PlayerController.cpp | 178 ++++++++++++++++++++----- src/player/PlayerController.h | 40 +++++- tests/app/StreamingCachePolicyTest.cpp | 28 ++++ tests/player/PlayerControllerTest.cpp | 108 +++++++++++++++ 7 files changed, 350 insertions(+), 37 deletions(-) diff --git a/src/app/SettingsSchema.cpp b/src/app/SettingsSchema.cpp index b5eb30e1..07cc717b 100644 --- a/src/app/SettingsSchema.cpp +++ b/src/app/SettingsSchema.cpp @@ -503,8 +503,8 @@ const QVector& settingSpecs() .advanced() .whenSetTo("playback/threadedStreaming", "true"), sliderSpec("playback/maxExtraStreamingMemoryMiB", "Streaming", "Extra streaming memory limit", - "Zero chooses a device-appropriate limit. Memory pressure reduces this automatically", "0", 0, 128, 8, - "MB", SettingTarget::MaxExtraStreamingMemory) + "Shared by automatic cache growth and network buffers. Zero chooses a device-appropriate limit", "0", 0, + 128, 8, "MB", SettingTarget::MaxExtraStreamingMemory) .perServer() .advanced() .whenSetTo("playback/threadedStreaming", "true"), diff --git a/src/app/StreamingCachePolicy.cpp b/src/app/StreamingCachePolicy.cpp index 73b92991..56760b36 100644 --- a/src/app/StreamingCachePolicy.cpp +++ b/src/app/StreamingCachePolicy.cpp @@ -79,6 +79,24 @@ StreamingCacheTarget StreamingCacheScaler::update(const StreamingCacheTarget& ca return m_current; } +StreamingMemoryAllocation allocateStreamingMemory(StreamingCacheTarget baseline, StreamingCacheTarget desired, + qint64 allowanceBytes, qint64 committedCacheExtraBytes, qint64 committedCurlExtraBytes, qint64 desiredCurlBytes) +{ + const qint64 allowance = std::max(0, allowanceBytes); + const qint64 cacheCommitted = std::max(0, committedCacheExtraBytes); + const qint64 curlCommitted = std::max(0, committedCurlExtraBytes); + const qint64 excess = std::max(0, cacheCommitted + curlCommitted - allowance); + const qint64 cacheBudget = excess > 0 ? 0 : std::max(0, allowance - curlCommitted); + const qint64 forwardExtra = std::max(0, desired.forwardBytes - baseline.forwardBytes); + const qint64 backExtra = std::max(0, desired.backBytes - baseline.backBytes); + const qint64 desiredExtra = forwardExtra + backExtra; + const qint64 extra = std::min(cacheBudget, desiredExtra); + const qint64 back = desiredExtra > 0 ? extra * backExtra / desiredExtra : 0; + const StreamingCacheTarget target { baseline.forwardBytes + extra - back, baseline.backBytes + back }; + const qint64 remaining = std::max(0, allowance - std::max(extra, cacheCommitted)); + return { target, excess > 0 ? 0 : std::clamp(desiredCurlBytes, qint64(0), remaining), excess }; +} + void StreamingCacheScaler::reset(const StreamingCacheTarget& initial) { m_initialized = true; diff --git a/src/app/StreamingCachePolicy.h b/src/app/StreamingCachePolicy.h index b3292cda..fbd2c051 100644 --- a/src/app/StreamingCachePolicy.h +++ b/src/app/StreamingCachePolicy.h @@ -27,6 +27,17 @@ struct StreamingCacheInput { // keeping generous OS/application headroom reserved. StreamingCacheTarget computeStreamingCacheTarget(const StreamingCacheInput& input); +struct StreamingMemoryAllocation { + StreamingCacheTarget cache; + qint64 curlGrantBytes = 0; + qint64 committedExcessBytes = 0; +}; + +// Existing commitments remain charged while a smaller limit drains. The user +// floor is separate from this shared allowance for automatic cache/curl growth. +StreamingMemoryAllocation allocateStreamingMemory(StreamingCacheTarget baseline, StreamingCacheTarget desired, + qint64 allowanceBytes, qint64 committedCacheExtraBytes, qint64 committedCurlExtraBytes, qint64 desiredCurlBytes); + // Applies pressure-safe hysteresis to live cache budget updates: // memory pressure shrinks immediately; growth requires two consecutive samples. class StreamingCacheScaler final { diff --git a/src/player/PlayerController.cpp b/src/player/PlayerController.cpp index 78674e5d..ec18a325 100644 --- a/src/player/PlayerController.cpp +++ b/src/player/PlayerController.cpp @@ -172,6 +172,8 @@ namespace { constexpr uint64_t kPauseSetReply = 0x7073000000000000ULL; constexpr uint64_t kPauseReadReply = 0x7072000000000000ULL; constexpr uint64_t kInitialPauseReply = 0x7069000000000000ULL; + constexpr uint64_t kDemuxerCacheReply = 0x6463000000000000ULL; + constexpr uint64_t kDemuxerUsageReply = 0x6475000000000000ULL; constexpr uint64_t kColorDiagnosticReply = 0x636f000000000000ULL; constexpr uint64_t kFullscreenSetReply = 0x6673000000000000ULL; constexpr uint64_t kFullscreenObservation = 0x666f000000000000ULL; @@ -461,6 +463,8 @@ PlayerController::PlayerController(NativeAppWindow *window, PlaybackSource *api, m_backgroundTeardownTimer.setInterval(750); m_networkTimer.setInterval(1000); connect(&m_networkTimer, &QTimer::timeout, this, &PlayerController::updateNetworkTransport); + m_streamingMemoryTimer.setInterval(5000); + connect(&m_streamingMemoryTimer, &QTimer::timeout, this, &PlayerController::updateStreamingMemoryGrant); // Measure spare headroom before playback as well: the startup sample can // confirm an idle observation before any fixed socket profile connects. m_idleStreamingMemoryTimer.setInterval(5000); @@ -599,6 +603,13 @@ void PlayerController::teardownMpv(bool async) const quint64 generation = ++m_mpvTeardownGeneration; Diagnostics::Phase phase(QStringLiteral("shutdown"), QStringLiteral("player_teardown_mpv")); ++m_mpvEventGeneration; + ++m_demuxerCacheSerial; + m_demuxerCacheReplies = 0; + m_appliedDemuxerTarget.reset(); + m_demuxerUsageKnown = false; + m_demuxerUsagePending = false; + m_committedDemuxerBytes = 0; + m_streamingMemoryTimer.stop(); m_pendingTransportLoads.clear(); m_idleMpvPreparationEnabled = false; m_idleMpvPreparationScheduled = false; @@ -1446,6 +1457,15 @@ bool PlayerController::ensureMpv(bool needsVideoSurface, bool embeddedVideo) return false; const bool idlePrepared = true; + // The preparation worker owns its snapshot until this handoff. Apply the + // current pair synchronously while idle, before any surface or load uses it. + if (!usesUserMpvConfig() && !applyInitialDemuxerCacheTarget(handle)) { + destroyMpvOffThread(handle); + m_errorText = QStringLiteral("libmpv rejected the cache limits."); + emit playbackStateChanged(); + return false; + } + if (((m_volumeKnown || !usesUserMpvConfig()) && !setRequiredMpvProperty(handle, "volume", QByteArray::number(m_volume.load()).constData())) || ((m_muteKnown || !usesUserMpvConfig()) @@ -1621,7 +1641,7 @@ void PlayerController::playSession(const PlaybackSession& session, bool startPau m_sessionThreadedStreaming = m_streamingOptions.enabled; m_sessionStreamingOptions = m_streamingOptions; m_jointExtraGrantBytes = 0; - m_streamingMemoryTimer.invalidate(); + m_streamingMemoryTimer.stop(); updateStreamingMemoryGrant(); m_streamingMemoryTimer.start(); m_streamingPerformanceSampler.reset(); @@ -2092,6 +2112,7 @@ void PlayerController::togglePause() void PlayerController::setPaused(bool paused) { + m_pauseRequestClock.restart(); qInfo() << "player: pause requested" << paused; if (!m_mpvLifecycle.handle()) { if (m_sessionActive && m_paused != paused) { @@ -2911,10 +2932,6 @@ double PlayerController::networkMediaBitrate() const void PlayerController::updateNetworkTransport() { - if (!m_streamingMemoryTimer.isValid() || m_streamingMemoryTimer.elapsed() >= 5000) { - updateStreamingMemoryGrant(); - m_streamingMemoryTimer.restart(); - } auto *handle = m_mpvLifecycle.handle(); if (!handle || !m_sessionActive) return; @@ -3011,6 +3028,7 @@ void PlayerController::stopProgressReporting(bool failed, bool reachedEnd, bool m_uiPositionTimer.stop(); m_seekWatchdogTimer.stop(); m_networkTimer.stop(); + m_streamingMemoryTimer.stop(); const auto session = m_session; reachedEnd = reachedEnd && !failed && m_fileLoaded; @@ -3287,6 +3305,12 @@ void PlayerController::handleMpvEvent(mpv_event *event, quint64 generation, mpv_ }); break; case MPV_EVENT_SET_PROPERTY_REPLY: { + if ((event->reply_userdata & kMpvReplyKindMask) == kDemuxerCacheReply) { + const auto serial = event->reply_userdata & kMpvReplySerialMask; + const int error = event->error; + postMpvEvent(generation, [this, serial, error] { completeDemuxerCacheWrite(serial, error); }); + break; + } if ((event->reply_userdata & kMpvReplyKindMask) == kPauseSetReply) { const auto serial = event->reply_userdata & kMpvReplySerialMask; const int error = event->error; @@ -3361,6 +3385,25 @@ void PlayerController::handleMpvEvent(mpv_event *event, quint64 generation, mpv_ break; } case MPV_EVENT_GET_PROPERTY_REPLY: { + if (event->reply_userdata == kDemuxerUsageReply) { + const auto *property = static_cast(event->data); + qint64 bytes = -1; + if (event->error >= 0 && property && property->data && property->format == MPV_FORMAT_NODE) { + const auto& node = *static_cast(property->data); + if (node.format == MPV_FORMAT_NODE_MAP && node.u.list) + for (int i = 0; i < node.u.list->num; ++i) + if (strcmp(node.u.list->keys[i], "total-bytes") == 0 + && node.u.list->values[i].format == MPV_FORMAT_INT64) + bytes = node.u.list->values[i].u.int64; + } + postMpvEvent(generation, [this, bytes] { + m_demuxerUsagePending = false; + m_demuxerUsageKnown = bytes >= 0; + if (m_demuxerUsageKnown) + m_committedDemuxerBytes = bytes; + }); + break; + } if (event->reply_userdata == kColorDiagnosticReply) { const auto *property = static_cast(event->data); if (event->error >= 0 && property && property->data && property->format == MPV_FORMAT_STRING) { @@ -3915,60 +3958,129 @@ void PlayerController::applyDemuxerCacheTarget(const StreamingCacheTarget& targe const QByteArray nextBack = QByteArray::number(target.backBytes); const bool changed = target != m_activeDemuxerTarget || m_demuxerMaxBytes != nextForward || m_demuxerMaxBackBytes != nextBack; - if (!changed) - return; - m_activeDemuxerTarget = target; m_demuxerMaxBytes = nextForward; m_demuxerMaxBackBytes = nextBack; - qInfo("player: demuxer cache target forward=%lldMiB back=%lldMiB", - static_cast(target.forwardBytes / (1024LL * 1024)), - static_cast(target.backBytes / (1024LL * 1024))); + if (changed) + qInfo("player: demuxer cache target forward=%lldMiB back=%lldMiB", + static_cast(target.forwardBytes / (1024LL * 1024)), + static_cast(target.backBytes / (1024LL * 1024))); - if (!applyLive) + if (!applyLive || m_activeUserMpvConfig || m_demuxerCacheReplies > 0 || m_appliedDemuxerTarget == target) return; if (auto *handle = m_mpvLifecycle.handle()) { - int64_t forwardValue = target.forwardBytes; - int64_t backValue = target.backBytes; - mpv_set_property_async(handle, 0, "demuxer-max-bytes", MPV_FORMAT_INT64, &forwardValue); - mpv_set_property_async(handle, 0, "demuxer-max-back-bytes", MPV_FORMAT_INT64, &backValue); + m_demuxerCacheSerial = (m_demuxerCacheSerial + 1) & kMpvReplySerialMask; + m_pendingDemuxerTarget = target; + m_demuxerCacheReplies = 2; + m_demuxerCacheFailed = false; + for (const auto& property : { std::pair { "demuxer-max-bytes", target.forwardBytes }, + std::pair { "demuxer-max-back-bytes", target.backBytes } }) { + const int error = writeDemuxerCacheProperty( + handle, kDemuxerCacheReply | m_demuxerCacheSerial, property.first, property.second, true); + if (error < 0) + completeDemuxerCacheWrite(m_demuxerCacheSerial, error); + } + } +} + +int PlayerController::writeDemuxerCacheProperty( + mpv_handle *handle, quint64 reply, const char *name, qint64 bytes, bool async) +{ + if (m_cachePropertyWriter) + return m_cachePropertyWriter(handle, reply, name, bytes, async); + int64_t value = bytes; + return async ? mpv_set_property_async(handle, reply, name, MPV_FORMAT_INT64, &value) + : mpv_set_property(handle, name, MPV_FORMAT_INT64, &value); +} + +bool PlayerController::applyInitialDemuxerCacheTarget(mpv_handle *handle) +{ + ++m_demuxerCacheSerial; + m_demuxerCacheReplies = 0; + m_appliedDemuxerTarget.reset(); + for (const auto& property : { std::pair { "demuxer-max-bytes", m_activeDemuxerTarget.forwardBytes }, + std::pair { "demuxer-max-back-bytes", m_activeDemuxerTarget.backBytes } }) { + const int error = writeDemuxerCacheProperty(handle, 0, property.first, property.second, false); + if (error < 0) { + qWarning() << "player: cache property rejected" << property.first << "error=" << error; + return false; + } + } + m_appliedDemuxerTarget = m_activeDemuxerTarget; + return true; +} + +void PlayerController::completeDemuxerCacheWrite(quint64 serial, int error) +{ + if (serial != m_demuxerCacheSerial || m_demuxerCacheReplies <= 0) + return; + if (error < 0) { + m_demuxerCacheFailed = true; + m_appliedDemuxerTarget.reset(); + qWarning() << "player: cache property update failed error=" << error; } + if (--m_demuxerCacheReplies == 0 && !m_demuxerCacheFailed) + m_appliedDemuxerTarget = m_pendingDemuxerTarget; } void PlayerController::updateStreamingMemoryGrant() { constexpr qint64 mib = 1024LL * 1024; - const auto memory = platformStreamingMemoryState(); + const auto memory = m_memoryProbe(); const auto policy = platformMemoryPolicy(); const bool constrained = platformMpvOptionProfile() == MpvOptionProfile::Platform::WebOS || (policy.totalBytes > 0 && policy.totalBytes < policy.lowMemoryBytes); - const qint64 reserve = (constrained ? 64 : 128) * mib; const auto& options = m_sessionActive ? m_sessionStreamingOptions : m_streamingOptions; - const qint64 cap = options.maxExtraBytes > 0 ? options.maxExtraBytes : (constrained ? 32 : 64) * mib; - const qint64 candidate - = memory.available ? std::min(cap, std::max(qint64(0), memory.availableBytes - reserve) / 4) : 0; - const qint64 desired = options.allowExtraMemory ? candidate : 0; - // Pressure shrinks admission immediately; growth needs two independent samples. - const qint64 grant = desired <= m_jointExtraGrantBytes ? desired : std::min(desired, m_previousMemoryCandidate); - m_previousMemoryCandidate = candidate; - if (grant != m_jointExtraGrantBytes) { - m_jointExtraGrantBytes = grant; - updateBackgroundNetwork(); - } - // Automatically scale demuxer readahead and behind cache up to // 128 MiB behind / 512 MiB forward at a 1:2 growth ratio based on free RAM. const qint64 effectiveTotal = policy.totalBytes > 0 ? policy.totalBytes : policy.fallbackBytes; - const StreamingCacheTarget cacheCandidate = computeStreamingCacheTarget({ + StreamingCacheInput input { .totalMemoryBytes = effectiveTotal, .availableMemoryBytes = memory.availableBytes, .availableMemoryKnown = memory.available, .constrainedDevice = constrained, .autoScaleEnabled = options.allowExtraMemory, .configuredForwardBytes = m_forwardCacheSizeMiB > 0 ? qint64(m_forwardCacheSizeMiB) * mib : 0, - }); - const StreamingCacheTarget target = m_demuxerCacheScaler.update(cacheCandidate); + }; + const StreamingCacheTarget desiredCache = computeStreamingCacheTarget(input); + input.autoScaleEnabled = false; + const StreamingCacheTarget baseline = computeStreamingCacheTarget(input); + const qint64 reserve = constrained ? std::clamp(effectiveTotal / 4, 256 * mib, 512 * mib) + : std::clamp(effectiveTotal / 8, 512 * mib, 2048 * mib); + const qint64 headroom + = memory.available ? std::max(0, memory.availableBytes - reserve) / (constrained ? 5 : 4) : 0; + const qint64 allowance = options.allowExtraMemory + ? std::min(headroom, options.maxExtraBytes > 0 ? options.maxExtraBytes : 704 * mib) + : 0; + const qint64 baselineBytes = baseline.forwardBytes + baseline.backBytes; + qint64 committedCache = m_demuxerUsageKnown + ? m_committedDemuxerBytes + : (m_appliedDemuxerTarget ? m_appliedDemuxerTarget->forwardBytes + m_appliedDemuxerTarget->backBytes + : baselineBytes); + if (m_demuxerCacheReplies > 0) + committedCache + = std::max(committedCache, m_pendingDemuxerTarget.forwardBytes + m_pendingDemuxerTarget.backBytes); + const qint64 committedCurl = m_sessionThreadedStreaming + ? std::max(m_jointExtraGrantBytes, + m_networkMetrics.value(QStringLiteral("committed-joint-extra-grant-bytes")).toLongLong()) + : 0; + const auto allocation = allocateStreamingMemory(baseline, desiredCache, allowance, + std::max(0, committedCache - baselineBytes), committedCurl, (constrained ? 32 : 64) * mib); + const StreamingCacheTarget target = m_demuxerCacheScaler.update(allocation.cache); applyDemuxerCacheTarget(target, true); + const qint64 desiredGrant = m_sessionThreadedStreaming ? allocation.curlGrantBytes : 0; + const qint64 grant + = desiredGrant <= m_jointExtraGrantBytes ? desiredGrant : std::min(desiredGrant, m_previousMemoryCandidate); + m_previousMemoryCandidate = desiredGrant; + if (grant != m_jointExtraGrantBytes) { + m_jointExtraGrantBytes = grant; + updateBackgroundNetwork(); + } + m_extraMemoryAllowanceBytes = allowance; + m_committedMemoryExcessBytes = allocation.committedExcessBytes; + if (auto *handle = m_mpvLifecycle.handle(); handle && m_fileLoaded && !m_demuxerUsagePending) + m_demuxerUsagePending + = mpv_get_property_async(handle, kDemuxerUsageReply, "demuxer-cache-state", MPV_FORMAT_NODE) >= 0; } void PlayerController::setBackgroundNetwork(bool active) diff --git a/src/player/PlayerController.h b/src/player/PlayerController.h index 1a61966d..ea4d02a3 100644 --- a/src/player/PlayerController.h +++ b/src/player/PlayerController.h @@ -3,6 +3,7 @@ #include "../app/StreamingCachePolicy.h" #include "../media/MediaTypes.h" #include "../platform/MpvConfigPolicy.h" +#include "../platform/PlatformSystemProbes.h" #include "MpvLifecycle.h" #include "MpvOptionProfile.h" #include "PlaybackPositionTracker.h" @@ -29,6 +30,7 @@ #include #include #include +#include #include #include @@ -44,6 +46,7 @@ class PlatformPerformanceSampler; class PlayerController final : public QObject { Q_OBJECT + friend struct PlayerControllerTestAccess; Q_PROPERTY(bool visible READ visible NOTIFY visibleChanged) Q_PROPERTY(QVariantMap transportCapabilities READ transportCapabilities NOTIFY transportCapabilitiesChanged) Q_PROPERTY(bool sessionActive READ sessionActive NOTIFY sessionActiveChanged) @@ -116,6 +119,18 @@ class PlayerController final : public QObject { { return m_pauseCommandState; } + qint64 positionSampleAgeMs() const + { + return m_positionTracker.sampleAgeMs(); + } + qint64 mpvEventAgeMs() const + { + return m_mpvEventClock.isValid() ? m_mpvEventClock.elapsed() : -1; + } + qint64 pauseRequestAgeMs() const + { + return m_pauseRequestClock.isValid() ? m_pauseRequestClock.elapsed() : -1; + } int bufferingPercent() const; bool seeking() const; bool debugOsdVisible() const; @@ -141,6 +156,8 @@ class PlayerController final : public QObject { QVariantMap networkMetrics() const { QVariantMap metrics = m_networkMetrics; + metrics.insert(QStringLiteral("memory-extra-allowance-bytes"), m_extraMemoryAllowanceBytes); + metrics.insert(QStringLiteral("memory-committed-excess-bytes"), m_committedMemoryExcessBytes); for (auto it = m_streamingPerformanceMetrics.cbegin(); it != m_streamingPerformanceMetrics.cend(); ++it) metrics.insert(it.key(), it.value()); return metrics; @@ -386,8 +403,10 @@ class PlayerController final : public QObject { template void postMpvEvent(quint64 generation, Callback callback) { QMetaObject::invokeMethod(this, [this, generation, callback = std::move(callback)]() mutable { - if (generation == m_mpvEventGeneration && m_sessionActive) + if (generation == m_mpvEventGeneration && m_sessionActive) { + m_mpvEventClock.restart(); callback(); + } }); } void startProgressReporting(); @@ -501,6 +520,8 @@ class PlayerController final : public QObject { bool m_pauseCommandTarget = false; bool m_pauseCommandRetried = false; QString m_pauseCommandState; + QElapsedTimer m_mpvEventClock; + QElapsedTimer m_pauseRequestClock; bool m_buffering = false; int m_bufferingPercent = 0; bool m_seeking = false; @@ -528,11 +549,26 @@ class PlayerController final : public QObject { MpvOptionProfile::StreamingOptions m_sessionStreamingOptions; qint64 m_jointExtraGrantBytes = 0; qint64 m_previousMemoryCandidate = 0; + qint64 m_extraMemoryAllowanceBytes = 0; + qint64 m_committedMemoryExcessBytes = 0; StreamingCacheScaler m_demuxerCacheScaler; StreamingCacheTarget m_activeDemuxerTarget {}; - QElapsedTimer m_streamingMemoryTimer; + QTimer m_streamingMemoryTimer; + std::optional m_appliedDemuxerTarget; + StreamingCacheTarget m_pendingDemuxerTarget; + quint64 m_demuxerCacheSerial = 0; + int m_demuxerCacheReplies = 0; + bool m_demuxerCacheFailed = false; + qint64 m_committedDemuxerBytes = 0; + bool m_demuxerUsageKnown = false; + bool m_demuxerUsagePending = false; + std::function m_memoryProbe = platformStreamingMemoryState; + std::function m_cachePropertyWriter; void updateStreamingMemoryGrant(); void applyDemuxerCacheTarget(const StreamingCacheTarget& target, bool applyLive); + int writeDemuxerCacheProperty(mpv_handle *handle, quint64 reply, const char *name, qint64 bytes, bool async); + bool applyInitialDemuxerCacheTarget(mpv_handle *handle); + void completeDemuxerCacheWrite(quint64 serial, int error); // The opening seconds are where a device that cannot keep up says so: // the picture is being scaled and tone-mapped from the first frame, and // nothing has warmed a cache yet. diff --git a/tests/app/StreamingCachePolicyTest.cpp b/tests/app/StreamingCachePolicyTest.cpp index 193f7512..10042f28 100644 --- a/tests/app/StreamingCachePolicyTest.cpp +++ b/tests/app/StreamingCachePolicyTest.cpp @@ -143,6 +143,34 @@ SPOOL_TEST_MAIN("streaming-cache-policy") require(scaler.update(low) == low, "memory pressure must shrink immediately on a single sample"); } + // An explicit allowance covers demuxer growth and curl together, while + // allocations still draining under pressure block further borrowing. + { + const StreamingCacheTarget baseline { 32 * kMiB, 16 * kMiB }; + const StreamingCacheTarget desired { 512 * kMiB, 128 * kMiB }; + for (qint64 limit : { 8 * kMiB, 32 * kMiB, 128 * kMiB }) { + for (qint64 committedCurl : { qint64(0), 4 * kMiB, 64 * kMiB }) { + const auto result = allocateStreamingMemory(baseline, desired, limit, 0, committedCurl, 64 * kMiB); + const qint64 cacheExtra = result.cache.forwardBytes + result.cache.backBytes - 48 * kMiB; + require(cacheExtra + result.curlGrantBytes <= limit, + "new cache and curl admissions stay within one explicit allowance"); + require(cacheExtra + committedCurl <= limit || cacheExtra == 0, + "existing curl commitments cannot be loaned to the cache again"); + } + } + const auto pressure = allocateStreamingMemory(baseline, desired, 8 * kMiB, 80 * kMiB, 20 * kMiB, 64 * kMiB); + require( + pressure.cache == baseline && pressure.curlGrantBytes == 0 && pressure.committedExcessBytes == 92 * kMiB, + "pressure reports draining commitments and admits no new extras"); + const auto unknown = allocateStreamingMemory(baseline, desired, 0, 0, 0, 64 * kMiB); + require(unknown.cache == baseline && unknown.curlGrantBytes == 0, + "unknown headroom admits only the configured floor"); + const StreamingCacheTarget manual { 1024 * kMiB, 128 * kMiB }; + const auto floor = allocateStreamingMemory(manual, manual, 8 * kMiB, 0, 0, 64 * kMiB); + require(floor.cache == manual && floor.curlGrantBytes == 8 * kMiB, + "a manual floor is separate from the automatic extra allowance"); + } + // 6. Live libmpv runtime property test: demuxer-max-bytes and demuxer-max-back-bytes // must accept dynamic int64 updates on an initialized headless handle. { diff --git a/tests/player/PlayerControllerTest.cpp b/tests/player/PlayerControllerTest.cpp index 575901ec..1a718336 100644 --- a/tests/player/PlayerControllerTest.cpp +++ b/tests/player/PlayerControllerTest.cpp @@ -28,6 +28,113 @@ #include #include +extern "C" { +#include +} + +namespace Spool { +struct PlayerControllerTestAccess { + static void runCacheContract(NativeAppWindow& window) + { + using SpoolTests::require; + constexpr qint64 mib = 1024LL * 1024; + PlayerController player(&window, nullptr, nullptr, {}); + player.m_idleStreamingMemoryTimer.stop(); + player.m_idleMpvPreparationEnabled = false; + player.m_forwardCacheSizeMiB = 32; + player.m_memoryProbe = [] { return PlatformStreamingMemoryState {}; }; + const auto waitPrepared = [&] { + QElapsedTimer deadline; + deadline.start(); + while (!player.m_idleMpvHandle && deadline.elapsed() < 10000) { + QCoreApplication::processEvents(QEventLoop::AllEvents, 10); + QThread::msleep(1); + } + require(player.m_idleMpvHandle, "preparation hands off its owned idle core"); + }; + const auto readPair = [&](StreamingCacheTarget expected) { + int64_t forward = 0, back = 0; + auto *core = player.m_mpvLifecycle.handle(); + require(core && mpv_get_property(core, "demuxer-max-bytes", MPV_FORMAT_INT64, &forward) >= 0 + && mpv_get_property(core, "demuxer-max-back-bytes", MPV_FORMAT_INT64, &back) >= 0 + && forward == expected.forwardBytes && back == expected.backBytes, + "actual adopted core limits match the latest pair before media load"); + }; + player.applyDemuxerCacheTarget({ 512 * mib, 128 * mib }, false); + player.prepareMpvAsync(false, false); + player.applyDemuxerCacheTarget({ 32 * mib, 16 * mib }, false); + waitPrepared(); + require(player.ensureMpv(false, false), "a pressure change during preparation survives adoption"); + readPair({ 32 * mib, 16 * mib }); + player.teardownMpv(); + player.prepareMpvAsync(false, false); + waitPrepared(); + auto *readyCore = player.m_idleMpvHandle; + player.applyDemuxerCacheTarget({ 64 * mib, 32 * mib }, false); + require(player.ensureMpv(false, false) && player.m_mpvLifecycle.handle() == readyCore, + "a changed floor refreshes the same ready speculative core without reinitialization"); + readPair({ 64 * mib, 32 * mib }); + player.teardownMpv(); + player.prepareMpvAsync(false, false); + player.destroyIdleMpv("test cancellation"); + QElapsedTimer cancellation; + cancellation.start(); + while (cancellation.elapsed() < 100) { + QCoreApplication::processEvents(QEventLoop::AllEvents, 10); + QThread::msleep(1); + } + require(!player.m_idleMpvHandle && !player.m_mpvPreparation, + "cancelled preparation cannot publish an abandoned idle core"); + auto *handle = mpv_create(); + require(handle && mpv_set_option_string(handle, "config", "no") >= 0 + && mpv_set_option_string(handle, "vo", "null") >= 0 && mpv_set_option_string(handle, "ao", "null") >= 0 + && mpv_initialize(handle) >= 0, + "cache application fixture initializes an idle core"); + player.applyDemuxerCacheTarget({ 512 * mib, 128 * mib }, false); + require(player.applyInitialDemuxerCacheTarget(handle), "initial limits apply before core adoption"); + player.applyDemuxerCacheTarget({ 32 * mib, 16 * mib }, false); + require(player.applyInitialDemuxerCacheTarget(handle), "adoption refreshes both limits after idle pressure"); + int64_t forward = 0, back = 0; + require(mpv_get_property(handle, "demuxer-max-bytes", MPV_FORMAT_INT64, &forward) >= 0 + && mpv_get_property(handle, "demuxer-max-back-bytes", MPV_FORMAT_INT64, &back) >= 0 + && forward == 32 * mib && back == 16 * mib, + "the adopted core reports the current pair without a later memory sample"); + require(player.m_mpvLifecycle.adopt(handle, [](mpv_event *) { }), "test adopts cache core"); + int writes = 0; + bool rejectBack = true; + player.m_cachePropertyWriter = [&](mpv_handle *, quint64, const char *name, qint64, bool async) { + ++writes; + require(async, "live cache writes stay asynchronous"); + return rejectBack && QByteArray(name) == "demuxer-max-back-bytes" ? MPV_ERROR_PROPERTY_ERROR : 0; + }; + player.applyDemuxerCacheTarget({ 64 * mib, 32 * mib }, true); + const quint64 failedSerial = player.m_demuxerCacheSerial; + player.completeDemuxerCacheWrite(failedSerial, 0); + require(!player.m_appliedDemuxerTarget && player.m_demuxerCacheReplies == 0, + "one failed property leaves the entire pair dirty"); + rejectBack = false; + player.applyDemuxerCacheTarget({ 64 * mib, 32 * mib }, true); + require( + writes == 4 && player.m_demuxerCacheReplies == 2, "an unchanged target retries after an enqueue failure"); + player.completeDemuxerCacheWrite(failedSerial, 0); + require(player.m_demuxerCacheReplies == 2, "stale completions cannot acknowledge a replacement update"); + player.completeDemuxerCacheWrite(player.m_demuxerCacheSerial, 0); + require(!player.m_appliedDemuxerTarget, "one completion cannot acknowledge both cache limits"); + player.completeDemuxerCacheWrite(player.m_demuxerCacheSerial, MPV_ERROR_PROPERTY_ERROR); + require(!player.m_appliedDemuxerTarget, "a completion error stays dirty"); + player.applyDemuxerCacheTarget({ 64 * mib, 32 * mib }, true); + player.completeDemuxerCacheWrite(player.m_demuxerCacheSerial, 0); + player.completeDemuxerCacheWrite(player.m_demuxerCacheSerial, 0); + require(player.m_appliedDemuxerTarget == player.m_activeDemuxerTarget, + "only both successful completions acknowledge the current pair"); + player.m_cachePropertyWriter = {}; + player.teardownMpv(); + require(!player.m_streamingMemoryTimer.isActive() && !player.m_appliedDemuxerTarget, + "teardown retires pressure polling and per-core applied state"); + } +}; +} + using namespace Spool; namespace { @@ -433,6 +540,7 @@ SPOOL_TEST_MAIN("player-controller") config.close(); NativeAppWindow window(QStringLiteral("player-controller-test")); + PlayerControllerTestAccess::runCacheContract(window); #if !defined(Q_OS_ANDROID) && !defined(SPOOL_APPLE_MOBILE) window.resize(320, 180); MpvVideoItem video(window.contentItem()); From 87cddb24fc13bed816756f9e7cba56035b97e864 Mon Sep 17 00:00:00 2001 From: Sacha Korban Date: Fri, 27 Nov 2026 18:12:00 +1100 Subject: [PATCH 20/39] fix(android): check delivered stream capabilities before direct output --- .../com/sachk/spool/VideoSurfaceBridge.java | 63 ++++++++++++++----- .../android/AndroidPlaybackSurface.cpp | 38 +++-------- src/player/AndroidVideoPolicy.h | 25 ++++++++ tests/player/MpvOptionProfileTest.cpp | 31 +++++++++ 4 files changed, 115 insertions(+), 42 deletions(-) create mode 100644 src/player/AndroidVideoPolicy.h diff --git a/app/android-common/src/com/sachk/spool/VideoSurfaceBridge.java b/app/android-common/src/com/sachk/spool/VideoSurfaceBridge.java index 52465ad6..157c2f29 100644 --- a/app/android-common/src/com/sachk/spool/VideoSurfaceBridge.java +++ b/app/android-common/src/com/sachk/spool/VideoSurfaceBridge.java @@ -3,6 +3,7 @@ import android.app.Activity; import android.media.MediaCodecInfo; import android.media.MediaCodecList; +import android.media.MediaFormat; import android.os.Build; import android.view.Gravity; import android.view.SurfaceHolder; @@ -34,34 +35,68 @@ private VideoSurfaceBridge() } /** - * Whether a hardware decoder exists for this video MIME type. Direct - * output can only show what MediaCodec decodes in hardware: a format the - * device lacks (AV1 on every Shield TV) would play as a black picture. - * When the platform cannot be asked, the answer is yes, which keeps the - * direct path the viewer chose. + * Whether hardware supports this delivered stream, including its size, + * profile/bit depth and known frame rate. Unknown/error answers stay on the + * rendered path, where MediaCodec copy-back can fall back to software. */ - public static boolean hasHardwareDecoder(String mime) + public static boolean hasHardwareDecoder(String mime, int width, int height, String profile, int bitDepth, double frameRate) { try { + int codecProfile = codecProfile(mime, profile, bitDepth); + if (width <= 0 || height <= 0 || codecProfile < 0) + return false; + MediaFormat format = MediaFormat.createVideoFormat(mime, width, height); + format.setInteger(MediaFormat.KEY_PROFILE, codecProfile); + if (frameRate > 0 && Build.VERSION.SDK_INT >= 22) + format.setFloat(MediaFormat.KEY_FRAME_RATE, (float) frameRate); MediaCodecList list = new MediaCodecList(MediaCodecList.REGULAR_CODECS); for (MediaCodecInfo info : list.getCodecInfos()) { if (info.isEncoder() || !supportsType(info, mime)) continue; + boolean hardware; if (Build.VERSION.SDK_INT >= 29) { - if (info.isHardwareAccelerated()) - return true; - continue; + hardware = info.isHardwareAccelerated(); + } else { + String name = info.getName().toLowerCase(Locale.ROOT); + hardware = !name.startsWith("omx.google.") && !name.startsWith("c2.android.") + && !name.contains(".sw."); } - // Before Android 10 the software decoders are known by name. - String name = info.getName().toLowerCase(Locale.ROOT); - if (!name.startsWith("omx.google.") && !name.startsWith("c2.android.") - && !name.contains(".sw.")) + if (hardware && info.getCapabilitiesForType(mime).isFormatSupported(format)) return true; } return false; } catch (RuntimeException e) { - return true; + return false; + } + } + + private static int codecProfile(String mime, String value, int bitDepth) + { + String profile = value.toLowerCase(Locale.ROOT).replaceAll("[^a-z0-9]", ""); + if (mime.equals("video/avc")) { + if (profile.equals("baseline") || profile.equals("constrainedbaseline")) + return bitDepth <= 8 ? MediaCodecInfo.CodecProfileLevel.AVCProfileBaseline : -1; + if (profile.equals("main")) + return bitDepth <= 8 ? MediaCodecInfo.CodecProfileLevel.AVCProfileMain : -1; + if (profile.equals("high")) + return bitDepth <= 8 ? MediaCodecInfo.CodecProfileLevel.AVCProfileHigh : -1; + if (profile.equals("high10")) + return MediaCodecInfo.CodecProfileLevel.AVCProfileHigh10; + } else if (mime.equals("video/hevc")) { + if (profile.equals("main") && bitDepth <= 8) + return MediaCodecInfo.CodecProfileLevel.HEVCProfileMain; + if ((profile.equals("main10") || profile.equals("main")) && bitDepth <= 10) + return MediaCodecInfo.CodecProfileLevel.HEVCProfileMain10; + } else if (mime.equals("video/x-vnd.on2.vp9")) { + if (profile.equals("profile0") && bitDepth <= 8) + return MediaCodecInfo.CodecProfileLevel.VP9Profile0; + if (profile.equals("profile2") && bitDepth <= 10) + return MediaCodecInfo.CodecProfileLevel.VP9Profile2; + } else if (mime.equals("video/av01") && (profile.equals("main") || profile.equals("main10"))) { + return bitDepth > 0 && bitDepth <= 8 ? MediaCodecInfo.CodecProfileLevel.AV1ProfileMain8 + : bitDepth <= 10 && bitDepth > 0 ? MediaCodecInfo.CodecProfileLevel.AV1ProfileMain10 : -1; } + return -1; } private static boolean supportsType(MediaCodecInfo info, String mime) diff --git a/src/platform/android/AndroidPlaybackSurface.cpp b/src/platform/android/AndroidPlaybackSurface.cpp index ac9b88a3..759cf13e 100644 --- a/src/platform/android/AndroidPlaybackSurface.cpp +++ b/src/platform/android/AndroidPlaybackSurface.cpp @@ -2,6 +2,7 @@ #include "media/MediaTypes.h" #include "platform/NativeAppWindow.h" +#include "player/AndroidVideoPolicy.h" #include "player/MpvVideoItem.h" #include @@ -110,20 +111,15 @@ namespace { return {}; } - bool hasHardwareDecoder(const QString& mime) + bool hasHardwareDecoder(const MediaStreamInfo& stream) { - // Enumerating codecs costs tens of milliseconds and the answer never - // changes while the app runs. - static QHash known; - static QMutex mutex; - const QMutexLocker locker(&mutex); - const auto found = known.constFind(mime); - if (found != known.constEnd()) - return *found; - const bool hardware = QJniObject::callStaticMethod( - kBridge, "hasHardwareDecoder", "(Ljava/lang/String;)Z", QJniObject::fromString(mime).object()); - known.insert(mime, hardware); - return hardware; + const QString mime = mediaCodecMime(stream.codec); + if (mime.isEmpty()) + return false; + return QJniObject::callStaticMethod(kBridge, "hasHardwareDecoder", + "(Ljava/lang/String;IILjava/lang/String;ID)Z", QJniObject::fromString(mime).object(), + jint(stream.width), jint(stream.height), QJniObject::fromString(stream.profile).object(), + jint(stream.bitDepth), jdouble(stream.frameRate)); } } @@ -133,21 +129,7 @@ bool platformUsesEmbeddedVideo(const PlaybackSession& session, bool directReques // it and what the viewer asked for, unless the device cannot decode this // video in hardware: direct output would then show nothing, while the // rendered path decodes in software (dav1d for AV1). - if (!directRequested) - return true; - for (const MediaStreamInfo& stream : session.mediaStreams) { - if (stream.type.compare(QLatin1String("video"), Qt::CaseInsensitive) != 0) - continue; - const QString mime = mediaCodecMime(stream.codec); - if (!mime.isEmpty() && hasHardwareDecoder(mime)) - return false; - qInfo() << "playback surface: no supported hardware decoder; rendering through the GPU path"; - return true; - } - // Local and downloaded files can lack stream metadata. The rendered path - // still tries MediaCodec copy-back and can fall back to a software decoder. - const QUrl source(session.url); - return source.isLocalFile() || source.scheme() == QLatin1String("content"); + return androidUsesEmbeddedVideo(session, directRequested, hasHardwareDecoder); } QString platformPlaybackBackendName(bool embeddedVideo) diff --git a/src/player/AndroidVideoPolicy.h b/src/player/AndroidVideoPolicy.h new file mode 100644 index 00000000..c134dc52 --- /dev/null +++ b/src/player/AndroidVideoPolicy.h @@ -0,0 +1,25 @@ +#pragma once + +#include "media/MediaTypes.h" + +#include + +namespace Spool { + +// Direct surfaces cannot display a decoder's software fallback. Query only +// facts about the delivered stream; unknown support uses the rendered path. +inline bool androidUsesEmbeddedVideo( + const PlaybackSession& session, bool directRequested, const std::function& supported) +{ + if (!directRequested || session.playMethod == QLatin1String("Transcode")) + return true; + for (const auto& stream : session.mediaStreams) { + if (stream.type.compare(QLatin1String("video"), Qt::CaseInsensitive) != 0) + continue; + return stream.codec.isEmpty() || stream.profile.isEmpty() || stream.width <= 0 || stream.height <= 0 + || !supported(stream); + } + return true; +} + +} diff --git a/tests/player/MpvOptionProfileTest.cpp b/tests/player/MpvOptionProfileTest.cpp index a03da58f..ca8197f4 100644 --- a/tests/player/MpvOptionProfileTest.cpp +++ b/tests/player/MpvOptionProfileTest.cpp @@ -1,4 +1,5 @@ #include "player/MpvOptionProfile.h" +#include "player/AndroidVideoPolicy.h" #include "TestMain.h" #include "TestRequire.h" @@ -58,6 +59,36 @@ using SpoolTests::require; SPOOL_TEST_MAIN("mpv-option-profile") { QCoreApplication app(argc, argv); + { + PlaybackSession session; + MediaStreamInfo video; + video.type = QStringLiteral("Video"); + video.codec = QStringLiteral("hevc"); + video.profile = QStringLiteral("Main 10"); + video.width = 3840; + video.height = 2160; + session.mediaStreams = { video }; + require(!androidUsesEmbeddedVideo(session, true, [](const auto&) { return true; }), + "known supported delivered video can use a direct surface"); + require(androidUsesEmbeddedVideo(session, true, [](const auto&) { return false; }), + "unsupported profile or size uses rendered software fallback"); + session.mediaStreams[0].width = 0; + bool queried = false; + require(androidUsesEmbeddedVideo(session, true, + [&](const auto&) { + queried = true; + return true; + }) + && !queried, + "unknown dimensions cannot be approved from MIME support alone"); + session.mediaStreams[0] = video; + session.playMethod = QStringLiteral("Transcode"); + require(androidUsesEmbeddedVideo(session, true, [](const auto&) { return true; }), + "source metadata cannot approve the different transcoded representation"); + session.mediaStreams.clear(); + require(androidUsesEmbeddedVideo(session, true, [](const auto&) { return true; }), + "missing delivered metadata uses the rendered path"); + } setlocale(LC_NUMERIC, "C"); { mpv_handle *handle = mpv_create(); From 6f42cce32f4278c8784e87fe98bbfee4afe3e607 Mon Sep 17 00:00:00 2001 From: Sacha Korban Date: Fri, 27 Nov 2026 18:12:00 +1100 Subject: [PATCH 21/39] test(streaming): require real server playback and retain scenario receipts --- .github/workflows/build-artifacts.yml | 23 +++++++ CMakeLists.txt | 4 ++ tests/e2e/jellyfin_latency_e2e.py | 84 +++++++++++++++++++---- tests/tools/JellyfinLatencyHarnessTest.py | 45 ++++++++++++ tests/tools/NetworkShaperTest.py | 21 ++++++ tests/transport/protocols.py | 52 +++++++++----- 6 files changed, 199 insertions(+), 30 deletions(-) create mode 100644 tests/tools/JellyfinLatencyHarnessTest.py diff --git a/.github/workflows/build-artifacts.yml b/.github/workflows/build-artifacts.yml index b69db380..09a6ab13 100644 --- a/.github/workflows/build-artifacts.yml +++ b/.github/workflows/build-artifacts.yml @@ -375,6 +375,29 @@ jobs: nix develop .#native -c python tools/run-tests.py \ --build-dir build/linux-release/app --workers "$(nproc)" + - name: Verify required real-server playback over HTTP and HTTPS + run: | + set -euo pipefail + server="$(nix build --no-link --print-out-paths \ + 'github:NixOS/nixpkgs/0bb8272318b4ca41bf0edc6224df3e3e3046b70d#jellyfin')" + nix develop .#native -c python tests/e2e/jellyfin_latency_e2e.py \ + --required --jellyfin-bin "$server/bin/jellyfin" \ + --libmpv build/linux-release/mpv-prefix/lib/libmpv.so \ + --transport-helper mpv/test/curl_transport.py --shaper-script tools/network-shaper.py \ + --spool-tests build/linux-release/app/spool-tests \ + --app-revision "$(git rev-parse HEAD)" --mpv-revision "$(git rev-parse HEAD:mpv)" \ + --harness-revision "$(git rev-parse HEAD)" \ + --output build/linux-release/app/required-jellyfin-playback.json + + - name: Retain real-server playback receipt + if: ${{ !cancelled() }} + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.0 + with: + name: internal-required-jellyfin-playback + path: build/linux-release/app/required-jellyfin-playback.json + if-no-files-found: error + retention-days: 7 + # The GUI phase measures real cold/prepared controller setup on every # run. Keep its history longer than the large transient test artifacts. - name: Report player setup latency diff --git a/CMakeLists.txt b/CMakeLists.txt index 387ccd9f..9362441d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1164,6 +1164,10 @@ if(BUILD_TESTING AND NOT SPOOL_WEBOS) "${CMAKE_CURRENT_SOURCE_DIR}/tools/network-shaper.py" ) + add_test(NAME jellyfin-latency-harness + COMMAND "${Python3_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/tests/tools/JellyfinLatencyHarnessTest.py") + set_tests_properties(jellyfin-latency-harness PROPERTIES LABELS traditional) + add_test(NAME render-benchmark-report COMMAND "${Python3_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/tests/tools/RenderBenchmarkReportTest.py" diff --git a/tests/e2e/jellyfin_latency_e2e.py b/tests/e2e/jellyfin_latency_e2e.py index 3b19f85a..f5a1232d 100644 --- a/tests/e2e/jellyfin_latency_e2e.py +++ b/tests/e2e/jellyfin_latency_e2e.py @@ -19,6 +19,7 @@ import argparse import ctypes import importlib.util +import hashlib import json import math import os @@ -48,6 +49,30 @@ def find_jellyfin_binary(explicit: str | None) -> str | None: return shutil.which("jellyfin") +def prerequisites(jellyfin_bin, ffmpeg_bin, *, required=False, spool_tests=None): + missing = [] + if not jellyfin_bin: + missing.append("jellyfin") + if not ffmpeg_bin: + missing.append("ffmpeg") + if required: + missing.extend(tool for tool in ("nginx", "openssl") if not shutil.which(tool)) + if not spool_tests or not Path(spool_tests).is_file(): + missing.append("spool-tests") + return missing + + +def file_sha256(path): + with open(path, "rb") as source: + return hashlib.file_digest(source, "sha256").hexdigest() + + +def save_report(report, destination): + if destination: + destination.parent.mkdir(parents=True, exist_ok=True) + destination.write_text(json.dumps(report, indent=2, sort_keys=True) + "\n") + + def generate_high_bitrate_movie(ffmpeg_bin: str, target_path: Path, *, duration_s: int, video_mbps: int) -> dict: started = time.monotonic() target_path.parent.mkdir(parents=True, exist_ok=True) @@ -194,8 +219,7 @@ def start(self) -> dict: while time.monotonic() < deadline: if self.proc.poll() is not None: self._log_file.flush() - stderr_tail = self.log_path.read_text(errors="replace")[-1500:] - raise RuntimeError(f"Jellyfin exited prematurely (code {self.proc.returncode}): {stderr_tail}") + raise RuntimeError(f"Jellyfin exited prematurely (code {self.proc.returncode})") try: status, info = self._request("GET", "/System/Info/Public") if status == 200 and isinstance(info, dict) and info.get("Version"): @@ -284,8 +308,7 @@ def start(self) -> dict: break time.sleep(0.25) else: - tail = self.log_path.read_text(errors="replace")[-1500:] if getattr(self, "log_path", None) and self.log_path.exists() else "" - raise RuntimeError(f"Jellyfin failed to scan benchmark movie: {tail}") + raise RuntimeError("Jellyfin failed to scan benchmark movie") return { "version": self.server_version, @@ -780,17 +803,22 @@ def main() -> int: parser.add_argument("--max-request-size", type=int, default=1 << 20, help="curl-max-request-size in bytes") parser.add_argument("--output", type=Path, default=None, help="Write benchmark JSON report to this path") parser.add_argument("--benchmark-only", action="store_true", help="Record metrics without failing performance thresholds") + parser.add_argument("--required", action="store_true", help="Require provider, HTTP and HTTPS scenarios; missing tools fail") + parser.add_argument("--app-revision") + parser.add_argument("--mpv-revision") + parser.add_argument("--harness-revision") args = parser.parse_args() jellyfin_bin = find_jellyfin_binary(args.jellyfin_bin) - if not jellyfin_bin: - print("SKIP: jellyfin binary not found (set --jellyfin-bin or SPOOL_JELLYFIN_BIN)", file=sys.stderr) - return 77 - ffmpeg_bin = args.ffmpeg_bin or shutil.which("ffmpeg") - if not ffmpeg_bin: - print("SKIP: ffmpeg binary not found", file=sys.stderr) - return 77 + missing = prerequisites(jellyfin_bin, ffmpeg_bin, required=args.required, spool_tests=args.spool_tests) + if missing: + receipt = {"format": 1, "status": "failed" if args.required else "skipped", "missing": missing, "scenarios": {}} + if args.output: + args.output.parent.mkdir(parents=True, exist_ok=True) + args.output.write_text(json.dumps(receipt) + "\n") + print(json.dumps(receipt), flush=True) + return 1 if args.required else 77 spec = importlib.util.spec_from_file_location("curl_transport", args.transport_helper) assert spec and spec.loader @@ -798,6 +826,10 @@ def main() -> int: spec.loader.exec_module(helper) report: dict = { + "format": 1, + "identity": {"app_revision": args.app_revision, "mpv_revision": args.mpv_revision, + "harness_revision": args.harness_revision, + "libmpv_sha256": file_sha256(args.libmpv)}, "config": { "duration_s": args.duration_s, "video_mbps": args.video_mbps, @@ -809,6 +841,7 @@ def main() -> int: }, "scenarios": {}, } + save_report(report, args.output) with tempfile.TemporaryDirectory(prefix="spool-jellyfin-e2e-") as tmp: root = Path(tmp) @@ -856,8 +889,10 @@ def main() -> int: "seconds": round(time.monotonic() - t0, 3), "proxy": live_proxy.stop(), } + save_report(report, args.output) if res.returncode != 0: - print("live-jellyfin failed:\n" + res.stdout + "\n" + res.stderr, file=sys.stderr) + print(json.dumps({"scenario": "live_jellyfin_provider", "status": "failed", + "exitCode": res.returncode}), file=sys.stderr) finally: live_proxy.stop() @@ -896,6 +931,7 @@ def main() -> int: proxy_stats = proxy.stop() result["proxy"] = proxy_stats report["scenarios"][name] = result + save_report(report, args.output) # 3. HTTPS (nginx HTTP/1.1 + HTTP/2 + HTTP/3 Alt-Svc) over WAN TCP slow-start proxy: # Compare forced HTTP/2 (`tcp`) vs production default (`auto`) @@ -957,6 +993,7 @@ def main() -> int: result["proxy"] = proxy_stats result["nginx_protocols"] = nginx.protocol_counts() report["scenarios"][name] = result + save_report(report, args.output) finally: nginx.stop() finally: @@ -968,10 +1005,14 @@ def main() -> int: args.output.write_text(rendered + "\n") print(rendered, flush=True) - if args.benchmark_only: + if args.benchmark_only and not args.required: return 0 failures: list[str] = [] + if args.required: + for name in ("live_jellyfin_provider", "http_auto_adaptive", "https_auto_adaptive"): + if name not in report["scenarios"]: + failures.append(name + " did not execute") live = report["scenarios"].get("live_jellyfin_provider") if live is not None and not live.get("passed"): failures.append("live_jellyfin_provider failed") @@ -1001,4 +1042,19 @@ def main() -> int: if __name__ == "__main__": - raise SystemExit(main()) + try: + raise SystemExit(main()) + except Exception as error: + # Exceptions can contain fixture headers, tokens, URLs or subprocess + # output. Only controlled failure metadata leaves this private harness. + failure = {"format": 1, "status": "failed", "errorType": type(error).__name__, "scenarios": {}} + if "--output" in sys.argv: + position = sys.argv.index("--output") + 1 + if position < len(sys.argv): + destination = Path(sys.argv[position]) + destination.parent.mkdir(parents=True, exist_ok=True) + if destination.exists(): + failure = {**json.loads(destination.read_text()), **{k: v for k, v in failure.items() if k != "scenarios"}} + destination.write_text(json.dumps(failure) + "\n") + print(json.dumps(failure), file=sys.stderr) + raise SystemExit(1) diff --git a/tests/tools/JellyfinLatencyHarnessTest.py b/tests/tools/JellyfinLatencyHarnessTest.py new file mode 100644 index 00000000..9312a55d --- /dev/null +++ b/tests/tools/JellyfinLatencyHarnessTest.py @@ -0,0 +1,45 @@ +#!/usr/bin/env python3 +"""Required CI must fail with a receipt when its real-server tools are absent.""" +import importlib.util +import json +from pathlib import Path +import sys +import tempfile +import unittest +from unittest.mock import patch + +spec = importlib.util.spec_from_file_location("latency", Path(__file__).parents[1] / "e2e/jellyfin_latency_e2e.py") +latency = importlib.util.module_from_spec(spec) +spec.loader.exec_module(latency) + + +class Prerequisites(unittest.TestCase): + def test_missing_tools_produce_optional_skip_and_required_failure(self): + for required, expected in ((False, 77), (True, 1)): + with tempfile.TemporaryDirectory() as directory: + report = Path(directory) / "receipt.json" + arguments = ["latency", "--libmpv", "unused", "--transport-helper", "unused", + "--shaper-script", "unused", "--output", str(report)] + if required: + arguments.append("--required") + with patch.object(sys, "argv", arguments), patch.object(latency.shutil, "which", return_value=None): + self.assertEqual(latency.main(), expected) + result = json.loads(report.read_text()) + self.assertEqual(result["status"], "failed" if required else "skipped") + self.assertIn("jellyfin", result["missing"]) + self.assertEqual(result["scenarios"], {}) + + def test_required_https_and_provider_prerequisites(self): + with tempfile.TemporaryDirectory() as directory: + native = Path(directory) / "spool-tests" + native.touch() + with patch.object(latency.shutil, "which", side_effect=lambda name: None if name == "nginx" else name): + self.assertEqual(latency.prerequisites("jellyfin", "ffmpeg", required=True, + spool_tests=native), ["nginx"]) + with patch.object(latency.shutil, "which", return_value="tool"): + self.assertEqual(latency.prerequisites("jellyfin", "ffmpeg", required=True, + spool_tests=native), []) + + +if __name__ == "__main__": + unittest.main() diff --git a/tests/tools/NetworkShaperTest.py b/tests/tools/NetworkShaperTest.py index fa9d6ea9..b76c9f17 100755 --- a/tests/tools/NetworkShaperTest.py +++ b/tests/tools/NetworkShaperTest.py @@ -164,6 +164,27 @@ async def test_injects_one_shot_connection_stall(self) -> None: class PacerTest(unittest.IsolatedAsyncioTestCase): + async def test_independent_pacers_do_not_reserve_a_shared_timeline(self) -> None: + now = 100.0 + deadlines = [] + + async def sleep(delay): + deadlines.append(now + delay) + + timers = SimpleNamespace(get_running_loop=lambda: SimpleNamespace(time=lambda: now), sleep=sleep) + with patch.object(network_shaper, "asyncio", timers): + first, second = network_shaper.Pacer(1000), network_shaper.Pacer(1000) + await first.wait(500) + await second.wait(500) + await first.wait(500) + await second.wait(500) + self.assertEqual(deadlines, [100.5, 100.5]) + deadlines.clear() + shared = network_shaper.Pacer(1000) + for _ in range(4): + await shared.wait(500) + self.assertEqual(deadlines, [100.5, 101.0, 101.5]) + async def test_reserves_bandwidth_before_waiting(self) -> None: now = 100.0 sleepers: list[tuple[float, asyncio.Future[None]]] = [] diff --git a/tests/transport/protocols.py b/tests/transport/protocols.py index 66a259f9..6aa86a86 100644 --- a/tests/transport/protocols.py +++ b/tests/transport/protocols.py @@ -21,9 +21,18 @@ def free_port(host): - with socket.socket() as listener: - listener.bind((host, 0)) - return listener.getsockname()[1] + # nginx/QUIC and silent-UDP fixtures need the same number free for both + # transports; a free TCP port says nothing about an existing UDP listener. + for _ in range(64): + with socket.socket() as listener, socket.socket(socket.AF_INET, socket.SOCK_DGRAM) as udp: + listener.bind((host, 0)) + port = listener.getsockname()[1] + try: + udp.bind((host, port)) + except OSError: + continue + return port + raise RuntimeError("could not reserve a TCP/UDP fixture port pair") def main(): @@ -32,6 +41,9 @@ def main(): parser.add_argument('--transport-helper', type=Path, required=True) parser.add_argument('--performance', action='store_true') parser.add_argument('--output', type=Path) + parser.add_argument('--app-revision') + parser.add_argument('--mpv-revision') + parser.add_argument('--harness-revision') args = parser.parse_args() if args.output: args.output.parent.mkdir(parents=True, exist_ok=True) @@ -42,6 +54,12 @@ def main(): transport = importlib.util.module_from_spec(spec) spec.loader.exec_module(transport) rows = [] + with open(args.libmpv, 'rb') as library: + library_sha256 = hashlib.file_digest(library, 'sha256').hexdigest() + + def record(row): + rows.append(row) + print(json.dumps(row), flush=True) with tempfile.TemporaryDirectory(prefix='spool-protocols-') as directory: root = Path(directory) # Nonperiodic frame counters catch duplicated or misplaced aligned ranges. @@ -125,6 +143,7 @@ def main(): for mode, version, port in [('http1', 11, tls), ('tcp', 20, tls), ('prefer-h3', 30, tls), ('prefer-h3', 20, tcp)]: for count in counts: + log_start = (root / 'access.log').stat().st_size if (root / 'access.log').exists() else 0 output = root / 'actual.pcm' options = {'tls-ca-file': root / 'cert.pem', 'ao': 'pcm', 'ao-pcm-file': output, 'ao-pcm-waveheader': 'no', @@ -162,13 +181,12 @@ def main(): # trusting a request preference reported as effective. server_protocol = {11: 'HTTP/1.1', 20: 'HTTP/2.0', 30: 'HTTP/3.0'}[version] time.sleep(.05) - log = (root / 'access.log').read_text() + log = (root / 'access.log').read_bytes()[log_start:].decode() if f'{port} {server_protocol} 206 bytes=' not in log: raise AssertionError(f'{mode}: nginx did not serve ranges over {server_protocol}') - rows.append({'mode': mode, 'fixed-requests': count, 'effective-http-version': version, + record({'mode': mode, 'fixed-requests': count, 'effective-http-version': version, 'seconds': result['seconds'], 'first-progress-seconds': result['first-progress-seconds'], 'pcm-bytes': len(expected), 'bytes-per-second': len(expected) / result['seconds']}) - print(json.dumps(rows[-1]), flush=True) if not args.performance: from reset_origin import ResetOrigin header = (b'RIFF' + struct.pack(' Date: Fri, 27 Nov 2026 18:12:01 +1100 Subject: [PATCH 22/39] test(apple): retain pause stall evidence and stabilize simulator visuals --- src/automation/LocalCommandServer.cpp | 3 + src/player/PlaybackPositionTracker.h | 4 + tests/e2e/AppJourneyTest.cpp | 90 +++++++++++++++++------ tests/player/MpvVideoItemTest.cpp | 14 +++- tests/providers/ProviderUiContextTest.cpp | 8 +- tools/run-device-tests.py | 10 +++ 6 files changed, 103 insertions(+), 26 deletions(-) diff --git a/src/automation/LocalCommandServer.cpp b/src/automation/LocalCommandServer.cpp index 5d7d3dbc..51e97d45 100644 --- a/src/automation/LocalCommandServer.cpp +++ b/src/automation/LocalCommandServer.cpp @@ -366,6 +366,9 @@ QJsonObject LocalCommandServer::state() const { QStringLiteral("loaded"), player->fileLoaded() }, { QStringLiteral("paused"), player->paused() }, { QStringLiteral("ready"), player->playbackReady() }, { QStringLiteral("title"), player->title() }, { QStringLiteral("pauseCommand"), player->pauseCommandState() }, + { QStringLiteral("positionSampleAgeMs"), player->positionSampleAgeMs() }, + { QStringLiteral("mpvEventAgeMs"), player->mpvEventAgeMs() }, + { QStringLiteral("pauseRequestAgeMs"), player->pauseRequestAgeMs() }, { QStringLiteral("position"), player->positionSeconds() }, { QStringLiteral("duration"), player->durationSeconds() }, { QStringLiteral("failed"), !player->errorText().isEmpty() }, diff --git a/src/player/PlaybackPositionTracker.h b/src/player/PlaybackPositionTracker.h index 0412c2a2..8af5b2cf 100644 --- a/src/player/PlaybackPositionTracker.h +++ b/src/player/PlaybackPositionTracker.h @@ -15,6 +15,10 @@ namespace Spool { // when a seek was issued and when mpv reported it finished. class PlaybackPositionTracker final { public: + qint64 sampleAgeMs() const + { + return m_positionClock.isValid() ? m_positionClock.elapsed() : -1; + } // Seeded with where playback is about to resume from, so a restart shows // the position it is starting at rather than zero until mpv reports in. void reset(double startSeconds = 0.0); diff --git a/tests/e2e/AppJourneyTest.cpp b/tests/e2e/AppJourneyTest.cpp index bf21e27e..bbee0462 100644 --- a/tests/e2e/AppJourneyTest.cpp +++ b/tests/e2e/AppJourneyTest.cpp @@ -117,33 +117,57 @@ QString sampleBlockedProcess(qint64 pid, const QString& directory, const QProces return QStringLiteral("unavailable"); } QStringList symbols; + int thread = 0; + QStringList threadSymbols; + const auto finishThread = [&] { + for (const auto& symbol : threadSymbols) + symbols.append(QStringLiteral("T%1:%2").arg(thread).arg(symbol)); + threadSymbols.clear(); + }; if (file.open(QIODevice::ReadOnly)) { // A sample includes process paths and other metadata. Export only // known stack symbols, never its header, addresses or arbitrary text. const QStringList lines = QString::fromUtf8(file.readAll()).split('\n'); for (const QString& line : lines) { + if (line.contains("Thread_")) { + finishThread(); + ++thread; + } const QStringList words = line.simplified().split(' '); for (const QString& word : words) { const QString symbol = word.section('(', 0, 0); if (!symbol.startsWith("mpv_") && !symbol.startsWith("mp_") && !symbol.startsWith("vo_") && !symbol.startsWith("Spool::") && !symbol.startsWith("QQuick") && !symbol.startsWith("QSG") && !symbol.startsWith("QEvent") && !symbol.startsWith("QCoreApplication::") - && !symbol.startsWith("__psynch_") && !symbol.startsWith("pthread_") + && !symbol.startsWith("QIOS") && !symbol.startsWith("QRhi") && !symbol.startsWith("QOpenGL") + && !symbol.startsWith("CA::") && !symbol.startsWith("EAGL") + && !symbol.startsWith("presentRenderbuffer") && !symbol.startsWith("gl_") + && !symbol.startsWith("setproperty_fn") && !symbol.startsWith("set_pause_state") + && !symbol.startsWith("flip_page") && !symbol.startsWith("render_frame") + && !symbol.startsWith("draw_frame") && !symbol.startsWith("wait_until") + && !symbol.startsWith("lock_core") && !symbol.startsWith("run_locked") + && !symbol.startsWith("play_current_file") && !symbol.startsWith("write_video") + && !symbol.startsWith("grabWindow") && !symbol.startsWith("fill_audio_out_buffers") + && !symbol.startsWith("run_playloop") && !symbol.startsWith("AudioOutputUnit") + && !symbol.startsWith("AudioUnit") && !symbol.startsWith("AURemoteIO") + && !symbol.startsWith("AUIOClient") && !symbol.startsWith("ao_") && !symbol.startsWith("ca_") + && !symbol.startsWith("pl_") && !symbol.startsWith("__psynch_") && !symbol.startsWith("pthread_") && !symbol.startsWith("_pthread_") && !symbol.startsWith("mach_msg")) continue; if (symbol.size() > 160 || !std::all_of(symbol.cbegin(), symbol.cend(), [](QChar c) { return c.isLetterOrNumber() || c == '_' || c == ':' || c == '~'; })) continue; - if (!symbols.contains(symbol)) - symbols.append(symbol); - if (symbols.size() >= 48) - break; + // sample prints root first. Retain the leaf-side waits, not + // only the entry frames that explain nothing about the stall. + threadSymbols.removeAll(symbol); + threadSymbols.append(symbol); + if (threadSymbols.size() > 12) + threadSymbols.removeFirst(); } - if (symbols.size() >= 48) - break; } } + finishThread(); file.close(); QFile::remove(path); return symbols.isEmpty() ? QStringLiteral("unavailable") : symbols.join(','); @@ -853,12 +877,25 @@ class Journey final { int scale = mode == 7 ? 4 : mode == 6 || smoothInverse || neutralAdaptive || positiveContrast || adaptiveContrast ? 2 : 1; - QImage image; - if (scale > 1 || needsPreprocess) { - image = QImage(imagePath); - require(!image.isNull(), "captured OCR image could not be read"); - if (std::max(image.width(), image.height()) >= 2000) - scale = 1; + QImage image(imagePath); + require(!image.isNull(), "captured OCR image could not be read"); + qreal sourceScale = 1.0; + if (device && std::max(image.width(), image.height()) >= 2000) { + // DPR-3 simulator captures contain far more pixels than OCR needs. + // Keep the full-resolution visual evidence and map recognized + // bounds back to it after a single 2x downsample. + image + = image.scaled(image.width() / 2, image.height() / 2, Qt::IgnoreAspectRatio, Qt::SmoothTransformation); + sourceScale = 0.5; + scale = 1; + inputPath = imagePath + QStringLiteral(".ocr-base.png"); + QSaveFile base(inputPath); + require(base.open(QIODevice::WriteOnly) + && base.setPermissions(QFileDevice::ReadOwner | QFileDevice::WriteOwner) && image.save(&base, "PNG") + && base.commit(), + "captured OCR image could not be downsampled"); + } else if (std::max(image.width(), image.height()) >= 2000) { + scale = 1; } if (scale > 1 || needsPreprocess) { // Small captions beside a focus outline can be omitted even by @@ -1213,9 +1250,10 @@ class Journey final { if (fields.size() < 12 || fields[0] != "5" || fields[11].trimmed().isEmpty()) continue; const QString key = QString::fromLatin1(fields[1] + ':' + fields[2] + ':' + fields[3] + ':' + fields[4]); - const QRect bounds = QRectF((fields[6].toDouble() - linePadding) / scale + origin.x(), - (fields[7].toDouble() - linePadding) / scale + origin.y(), fields[8].toDouble() / scale, - fields[9].toDouble() / scale) + const qreal combinedScale = scale * sourceScale; + const QRect bounds = QRectF((fields[6].toDouble() - linePadding) / combinedScale + origin.x(), + (fields[7].toDouble() - linePadding) / combinedScale + origin.y(), fields[8].toDouble() / combinedScale, + fields[9].toDouble() / combinedScale) .toAlignedRect(); if (key != previous) { lines.append(Words {}); @@ -1475,13 +1513,13 @@ class Journey final { { await([&] { return state(true)["playback"].toObject()["ready"].toBool(); }, "playback did not complete its first renderer restart before pause"); - command({ "pause" }); QJsonObject playback; int observations = 0; int timeouts = 0; QElapsedTimer lastObservation; lastObservation.start(); try { + playback = command({ "pause" })["playback"].toObject(); await( [&] { const auto observed = state(true)["playback"].toObject(); @@ -1496,13 +1534,18 @@ class Journey final { }, message); } catch (const std::exception& error) { - const QString sample = timeouts > 0 ? (device ? device->blockedProcessSample() - : sampleBlockedProcess(app.processId(), - QFileInfo(screenshotPath).absolutePath(), environment)) - : QStringLiteral("not-needed"); + const QString sample = device + ? device->blockedProcessSample() + : sampleBlockedProcess(app.processId(), QFileInfo(screenshotPath).absolutePath(), environment); + std::cerr << "app-journey-stack: " << sample.toStdString() << '\n'; + std::cerr << "app-journey-pause: observations=" << observations << ", timeouts=" << timeouts + << ", position_sample_age_ms=" << playback["positionSampleAgeMs"].toInteger(-1) + << ", mpv_event_age_ms=" << playback["mpvEventAgeMs"].toInteger(-1) + << ", pause_request_age_ms=" << playback["pauseRequestAgeMs"].toInteger(-1) << '\n'; throw std::runtime_error(QStringLiteral( "%1 (active=%2, loaded=%3, ready=%4, paused=%5, failed=%6, position=%7, duration=%8, pause=%9, " - "observations=%10, timeouts=%11, last_observation_ms=%12, stack_symbols=%13)") + "observations=%10, timeouts=%11, last_observation_ms=%12, stack_symbols=%13, " + "position_sample_age_ms=%14, mpv_event_age_ms=%15, pause_request_age_ms=%16)") .arg(QString::fromUtf8(error.what())) .arg(playback["active"].toBool()) .arg(playback["loaded"].toBool()) @@ -1516,6 +1559,9 @@ class Journey final { .arg(timeouts) .arg(lastObservation.elapsed()) .arg(sample) + .arg(playback["positionSampleAgeMs"].toInteger(-1)) + .arg(playback["mpvEventAgeMs"].toInteger(-1)) + .arg(playback["pauseRequestAgeMs"].toInteger(-1)) .toStdString()); } } diff --git a/tests/player/MpvVideoItemTest.cpp b/tests/player/MpvVideoItemTest.cpp index fb4e1427..9a4485f1 100644 --- a/tests/player/MpvVideoItemTest.cpp +++ b/tests/player/MpvVideoItemTest.cpp @@ -456,8 +456,17 @@ SPOOL_TEST_MAIN("mpv-video-item") std::fprintf(stderr, "rendered SDR target: RHI=%d mpv=%s\n", textureFormat.load(), actualFormat.isEmpty() ? "(legacy renderer)" : actualFormat.constData()); #endif + int pauseForOsd = 1; + if (mpv_set_property(handle, "pause", MPV_FORMAT_FLAG, &pauseForOsd) < 0) { + std::fprintf(stderr, "failed to pause the OSD fixture\n"); + videoItem.releaseMpvHandle(); + mpv_terminate_destroy(handle); + return 1; + } + // Hold the decoded frame: slow software simulators must exercise + // paused OSD redraw, not race the fixture's 30s EOF. const QImage beforeOsd = captureItem(); - const char *osdCommand[] = { "show-text", "SDR white", "20000", nullptr }; + const char *osdCommand[] = { "show-text", "SDR white", "3600000", nullptr }; double beforeOsdPosition = -1; const int beforeOsdPositionStatus = mpv_get_property(handle, "time-pos", MPV_FORMAT_DOUBLE, &beforeOsdPosition); const int osdCommandStatus = mpv_command(handle, osdCommand); @@ -519,6 +528,7 @@ SPOOL_TEST_MAIN("mpv-video-item") if (frame.save(capturePath)) std::fprintf(stderr, "native failure frame: %s\n", qPrintable(capturePath)); } + const QImage lastPresented = captureItem(); bool nestedRelease = false; QTimer nestedReleaseTimer; nestedReleaseTimer.setSingleShot(true); @@ -536,7 +546,7 @@ SPOOL_TEST_MAIN("mpv-video-item") ) { std::fprintf(stderr, "video result: rendered=%d upright=%d released=%d nestedRelease=%d neutralOSD=%d\n", rendered, upright, released, nestedRelease, neutralOsd); - const QImage failedFrame = captureItem(); + const QImage failedFrame = lastPresented; const QColor upper = failedFrame.pixelColor(failedFrame.width() / 2, failedFrame.height() / 4); const QColor lower = failedFrame.pixelColor(failedFrame.width() / 2, 3 * failedFrame.height() / 4); std::fprintf(stderr, diff --git a/tests/providers/ProviderUiContextTest.cpp b/tests/providers/ProviderUiContextTest.cpp index 9703519f..7fac3fdd 100644 --- a/tests/providers/ProviderUiContextTest.cpp +++ b/tests/providers/ProviderUiContextTest.cpp @@ -22,6 +22,7 @@ #include #include #include +#include namespace { void require(bool condition, const char *message) @@ -31,7 +32,7 @@ void require(bool condition, const char *message) std::exit(1); } } -void waitFor(const std::function& condition) +void waitFor(const std::function& condition, std::source_location where = std::source_location::current()) { QElapsedTimer timeout; timeout.start(); @@ -39,7 +40,10 @@ void waitFor(const std::function& condition) QCoreApplication::processEvents(); QThread::msleep(1); } - require(condition(), "provider UI action completes asynchronously"); + if (!condition()) { + std::cerr << "provider UI action did not complete at test line " << where.line() << '\n'; + std::exit(1); + } } } diff --git a/tools/run-device-tests.py b/tools/run-device-tests.py index b15e33d0..8ebd9a10 100755 --- a/tools/run-device-tests.py +++ b/tools/run-device-tests.py @@ -1279,6 +1279,16 @@ def export_attempt(private, destination, result): with log.open(encoding="utf-8", errors="replace") as stream: for line in stream: stripped = line.rstrip("\r\n") + if re.fullmatch(r"app-journey-stack: [A-Za-z0-9_:,~.-]{1,12000}", stripped): + lines.append(stripped) + print(stripped, flush=True) + continue + if re.fullmatch(r"app-journey-pause: observations=[0-9]+, timeouts=[0-9]+, " + r"position_sample_age_ms=-?[0-9]+, mpv_event_age_ms=-?[0-9]+, " + r"pause_request_age_ms=-?[0-9]+", stripped): + lines.append(stripped) + print(stripped, flush=True) + continue match = pattern.match(stripped) if match: operation, code, error, elapsed, origin = match.groups() From cc8143ad58c4e29027f74e5591992b3323433de2 Mon Sep 17 00:00:00 2001 From: Sacha Korban Date: Fri, 27 Nov 2026 23:05:26 +1100 Subject: [PATCH 23/39] ci: enable compiler caches and cancel superseded pull request builds --- .github/workflows/build-artifacts.yml | 174 ++++++++++++++------------ .github/workflows/release.yml | 35 +++++- .gitignore | 2 + CMakeLists.txt | 10 +- tools/windows/build.ps1 | 6 + 5 files changed, 141 insertions(+), 86 deletions(-) diff --git a/.github/workflows/build-artifacts.yml b/.github/workflows/build-artifacts.yml index 09a6ab13..4ea13155 100644 --- a/.github/workflows/build-artifacts.yml +++ b/.github/workflows/build-artifacts.yml @@ -89,10 +89,11 @@ on: permissions: contents: read env: - # PRs consume public caches but never receive publishing credentials. - SPOOL_CACHE_WRITE: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }} + # Same-repository PRs write within their own merge-ref cache scope. + SPOOL_CACHE_WRITE: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository) }} + SPOOL_TRUSTED_BUILD: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }} concurrency: - group: build-artifacts-${{ github.ref }}-${{ github.sha }} + group: build-artifacts-${{ github.event_name }}-${{ github.ref }}${{ github.event_name != 'pull_request' && format('-{0}', github.sha) || '' }} cancel-in-progress: true jobs: @@ -183,8 +184,7 @@ jobs: gc-max-store-size-linux: 2G # Stale entries under the same prefix are dead weight against the # shared repository quota, and nothing restores them once the key moves. - # Release tags and PR merge refs only restore; trusted branch builds - # can save and prune their own GitHub cache scope. + # A build can only save and prune its own GitHub cache scope. save: ${{ env.SPOOL_CACHE_WRITE == 'true' && !inputs.release }} purge: ${{ env.SPOOL_CACHE_WRITE == 'true' && !inputs.release }} purge-prefixes: nix-lint-${{ runner.os }}- @@ -266,7 +266,7 @@ jobs: env: BUILD_ROOT: ${{ github.workspace }}/build/linux-sanitizers SPOOL_CMAKE_EXTRA_ARGS: -DSPOOL_SANITIZERS=ON - JOBS: 2 + SPOOL_BUILD_MEMORY_PER_JOB_MIB: 3072 run: nix develop .#native -c bash tools/build-linux-release.sh - name: Exercise actual bounded decoder and provider-package consumer run: | @@ -335,41 +335,42 @@ jobs: nix build --accept-flake-config .#native-qt-cache \ --out-link "$RUNNER_TEMP/spool-native-qt" --print-build-logs - name: Publish tailored Qt - if: ${{ env.SPOOL_CACHE_WRITE == 'true' }} + if: ${{ env.SPOOL_TRUSTED_BUILD == 'true' }} env: CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }} run: | if [[ -n "$CACHIX_AUTH_TOKEN" ]]; then cachix push spool "$RUNNER_TEMP/spool-native-qt" fi - - name: Build cached nix run package - if: ${{ env.SPOOL_CACHE_WRITE == 'true' }} - run: | - nix build --accept-flake-config .#native-cache \ - --out-link "$RUNNER_TEMP/spool-native" --print-build-logs - - name: Publish native cache - if: ${{ env.SPOOL_CACHE_WRITE == 'true' }} - env: - CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }} - run: | - if [[ -n "$CACHIX_AUTH_TOKEN" ]]; then - cachix push spool "$RUNNER_TEMP/spool-native" - fi - - + - name: Read mpv revision + id: mpv-revision + run: echo "revision=$(git rev-parse HEAD:mpv)" >>"$GITHUB_OUTPUT" - uses: actions/cache/restore@caa296126883cff596d87d8935842f9db880ef25 # v5.0.3 id: linux-build-cache with: - path: .ccache - key: linux5-${{ runner.os }}-${{ hashFiles('flake.nix', 'flake.lock', 'mpv/meson.build', 'mpv/meson.options', 'tools/manifests/mpv-native.json', 'tools/manifests/ffmpeg-capabilities.json', 'tools/manifests/toolchain.json', 'tools/manifests/linuxdeploy.json', 'tools/ffmpeg-capabilities.py', 'tools/package-audit.py', 'tools/build-linux-release.sh', 'tools/package-appimage.sh', 'tools/package-linux-bundle.sh', 'tools/lib/build-common.sh', 'tools/lib/qt-deploy.sh', 'CMakeLists.txt') }} - restore-keys: | - linux5-${{ runner.os }}- + path: | + build/linux-release/mpv + build/linux-release/mpv-prefix + build/linux-release/app + .ccache + key: linux-build-${{ runner.arch }}-${{ steps.mpv-revision.outputs.revision }}-${{ hashFiles('flake.nix', 'flake.lock', 'tools/manifests/toolchain.json', 'tools/manifests/mpv-native.json', 'tools/build-linux-release.sh', 'tools/lib/build-common.sh') }} # The default dev shell has no Qt on purpose (it is the hermetic Qt-source # build shell). The native app build needs nixpkgs Qt, so use .#native. - name: Build host app run: nix develop .#native -c bash tools/build-linux-release.sh + - name: Save Linux build cache + if: ${{ env.SPOOL_CACHE_WRITE == 'true' && !inputs.release && steps.linux-build-cache.outputs.cache-hit != 'true' }} + uses: actions/cache/save@caa296126883cff596d87d8935842f9db880ef25 # v5.0.3 + with: + path: | + build/linux-release/mpv + build/linux-release/mpv-prefix + build/linux-release/app + .ccache + key: ${{ steps.linux-build-cache.outputs.cache-primary-key }} + - name: Run traditional and real GUI e2e tests run: | nix develop .#native -c python tools/run-tests.py \ @@ -556,13 +557,6 @@ jobs: if-no-files-found: error retention-days: ${{ inputs.release && 1 || 7 }} - - name: Save Linux build cache - if: ${{ env.SPOOL_CACHE_WRITE == 'true' && !inputs.release && steps.linux-build-cache.outputs.cache-hit != 'true' }} - uses: actions/cache/save@caa296126883cff596d87d8935842f9db880ef25 # v5.0.3 - with: - path: .ccache - key: ${{ steps.linux-build-cache.outputs.cache-primary-key }} - macos-dmg: name: macOS DMG (${{ matrix.arch }}) runs-on: ${{ matrix.runner }} @@ -634,29 +628,16 @@ jobs: nix build --accept-flake-config .#native-qt-cache \ --out-link "$RUNNER_TEMP/spool-native-qt" --print-build-logs - name: Publish tailored Qt - if: ${{ env.SPOOL_CACHE_WRITE == 'true' }} + if: ${{ env.SPOOL_TRUSTED_BUILD == 'true' }} env: CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }} run: | if [[ -n "$CACHIX_AUTH_TOKEN" ]]; then cachix push spool "$RUNNER_TEMP/spool-native-qt" fi - - name: Build cached nix run package - if: ${{ env.SPOOL_CACHE_WRITE == 'true' }} - run: | - nix build --accept-flake-config .#native-cache \ - --out-link "$RUNNER_TEMP/spool-native" --print-build-logs - - name: Publish native cache - if: ${{ env.SPOOL_CACHE_WRITE == 'true' }} - env: - CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }} - run: | - if [[ -n "$CACHIX_AUTH_TOKEN" ]]; then - cachix push spool "$RUNNER_TEMP/spool-native" - fi - - - + - name: Read mpv revision + id: mpv-revision + run: echo "revision=$(git rev-parse HEAD:mpv)" >>"$GITHUB_OUTPUT" - uses: actions/cache/restore@caa296126883cff596d87d8935842f9db880ef25 # v5.0.3 id: macos-build-cache with: @@ -664,10 +645,8 @@ jobs: build/macos/mpv build/macos/mpv-prefix build/macos/app - ~/Library/Caches/ccache - key: macos-${{ matrix.arch }}-${{ hashFiles('flake.nix', 'flake.lock', 'mpv/meson.build', 'tools/manifests/mpv-native.json', 'tools/manifests/ffmpeg-capabilities.json', 'tools/manifests/toolchain.json', 'tools/ffmpeg-capabilities.py', 'tools/package-audit.py', 'tools/build-macos.sh', 'tools/package-macos-dmg.sh', 'tools/sign-macos.sh', 'tools/lib/build-common.sh', 'tools/lib/qt-deploy.sh', 'CMakeLists.txt') }} - restore-keys: | - macos-${{ matrix.arch }}- + .ccache + key: macos-build-${{ matrix.arch }}-${{ steps.mpv-revision.outputs.revision }}-${{ hashFiles('flake.nix', 'flake.lock', 'tools/manifests/toolchain.json', 'tools/manifests/mpv-native.json', 'tools/build-macos.sh', 'tools/lib/build-common.sh') }} # Older Nix releases reject the relative path input recorded by newer # lock files when the root flake comes from a shallow Git checkout. @@ -717,6 +696,17 @@ jobs: run: nix develop .#native --no-write-lock-file -c bash tools/build-macos.sh + - name: Save macOS build cache + if: ${{ env.SPOOL_CACHE_WRITE == 'true' && !inputs.release && steps.macos-build-cache.outputs.cache-hit != 'true' }} + uses: actions/cache/save@caa296126883cff596d87d8935842f9db880ef25 # v5.0.3 + with: + path: | + build/macos/mpv + build/macos/mpv-prefix + build/macos/app + .ccache + key: ${{ steps.macos-build-cache.outputs.cache-primary-key }} + - name: Run macOS traditional and real GUI e2e tests env: SPOOL_RENDER_API: opengl @@ -766,7 +756,7 @@ jobs: - name: Sign macOS application - if: ${{ env.SPOOL_CACHE_WRITE == 'true' && inputs.enable_macos_signing }} + if: ${{ env.SPOOL_TRUSTED_BUILD == 'true' && inputs.enable_macos_signing }} env: MACOS_CERTIFICATE_P12: ${{ secrets.MACOS_CERTIFICATE_P12 }} MACOS_CERTIFICATE_PASSWORD: ${{ secrets.MACOS_CERTIFICATE_PASSWORD }} @@ -776,7 +766,7 @@ jobs: - name: Package DMG run: nix develop .#native --no-write-lock-file -c bash tools/package-macos-dmg.sh - name: Sign macOS disk image - if: ${{ env.SPOOL_CACHE_WRITE == 'true' && inputs.enable_macos_signing }} + if: ${{ env.SPOOL_TRUSTED_BUILD == 'true' && inputs.enable_macos_signing }} env: MACOS_CERTIFICATE_P12: ${{ secrets.MACOS_CERTIFICATE_P12 }} MACOS_CERTIFICATE_PASSWORD: ${{ secrets.MACOS_CERTIFICATE_PASSWORD }} @@ -808,7 +798,7 @@ jobs: dmg="$(printf '%s\n' dist/*.dmg)" tar -czf "${dmg}.app.tar.gz" -C build/macos/install Spool.app - name: Notarize and staple DMG - if: ${{ env.SPOOL_CACHE_WRITE == 'true' && inputs.enable_macos_signing }} + if: ${{ env.SPOOL_TRUSTED_BUILD == 'true' && inputs.enable_macos_signing }} timeout-minutes: 20 continue-on-error: true env: @@ -826,17 +816,6 @@ jobs: if-no-files-found: error retention-days: ${{ inputs.release && 1 || 7 }} - - name: Save macOS build cache - if: ${{ env.SPOOL_CACHE_WRITE == 'true' && !inputs.release && steps.macos-build-cache.outputs.cache-hit != 'true' }} - uses: actions/cache/save@caa296126883cff596d87d8935842f9db880ef25 # v5.0.3 - with: - path: | - build/macos/mpv - build/macos/mpv-prefix - build/macos/app - ~/Library/Caches/ccache - key: ${{ steps.macos-build-cache.outputs.cache-primary-key }} - - name: Retain native macOS test journals and selector logs if: always() uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.0 @@ -1208,7 +1187,7 @@ jobs: nix develop --accept-flake-config .#android \ --profile "$RUNNER_TEMP/android-shell" -c true - name: Publish the Android dev shell - if: ${{ env.SPOOL_CACHE_WRITE == 'true' }} + if: ${{ env.SPOOL_TRUSTED_BUILD == 'true' }} env: CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }} run: | @@ -1261,7 +1240,7 @@ jobs: ' - name: Prepare Android release keystore - if: ${{ env.SPOOL_CACHE_WRITE == 'true' && inputs.release }} + if: ${{ env.SPOOL_TRUSTED_BUILD == 'true' && inputs.release }} env: KEYSTORE_BASE64: ${{ secrets.ANDROID_RELEASE_KEYSTORE_BASE64 }} run: | @@ -1272,10 +1251,10 @@ jobs: - name: Build the Android APK env: - SPOOL_ANDROID_KEYSTORE_PATH: ${{ env.SPOOL_CACHE_WRITE == 'true' && inputs.release && format('{0}/spool-release.p12', runner.temp) || '' }} - SPOOL_ANDROID_KEYSTORE_ALIAS: ${{ env.SPOOL_CACHE_WRITE == 'true' && inputs.release && secrets.ANDROID_RELEASE_KEY_ALIAS || '' }} - SPOOL_ANDROID_KEYSTORE_STORE_PASS: ${{ env.SPOOL_CACHE_WRITE == 'true' && inputs.release && secrets.ANDROID_RELEASE_KEYSTORE_PASSWORD || '' }} - SPOOL_ANDROID_KEYSTORE_KEY_PASS: ${{ env.SPOOL_CACHE_WRITE == 'true' && inputs.release && secrets.ANDROID_RELEASE_KEY_PASSWORD || '' }} + SPOOL_ANDROID_KEYSTORE_PATH: ${{ env.SPOOL_TRUSTED_BUILD == 'true' && inputs.release && format('{0}/spool-release.p12', runner.temp) || '' }} + SPOOL_ANDROID_KEYSTORE_ALIAS: ${{ env.SPOOL_TRUSTED_BUILD == 'true' && inputs.release && secrets.ANDROID_RELEASE_KEY_ALIAS || '' }} + SPOOL_ANDROID_KEYSTORE_STORE_PASS: ${{ env.SPOOL_TRUSTED_BUILD == 'true' && inputs.release && secrets.ANDROID_RELEASE_KEYSTORE_PASSWORD || '' }} + SPOOL_ANDROID_KEYSTORE_KEY_PASS: ${{ env.SPOOL_TRUSTED_BUILD == 'true' && inputs.release && secrets.ANDROID_RELEASE_KEY_PASSWORD || '' }} ANDROID_ABI: ${{ matrix.abi }} SPOOL_ANDROID_BUILD_TESTS: ${{ matrix.abi == 'x86_64' && 'ON' || 'OFF' }} run: nix develop .#android -c bash tools/android/build-apks.sh @@ -1302,7 +1281,7 @@ jobs: PY - name: Verify Android release signing identity - if: ${{ env.SPOOL_CACHE_WRITE == 'true' && inputs.release }} + if: ${{ env.SPOOL_TRUSTED_BUILD == 'true' && inputs.release }} env: EXPECTED_CERT_SHA256: 0c9deff0513eed6d43521df31ad6d2d8e928c029b146d902f4bcc25a883c1fb8 run: | @@ -1452,7 +1431,7 @@ jobs: path: dist/android/universal-inputs/armeabi-v7a - name: Prepare Android release keystore - if: ${{ env.SPOOL_CACHE_WRITE == 'true' && inputs.release }} + if: ${{ env.SPOOL_TRUSTED_BUILD == 'true' && inputs.release }} env: KEYSTORE_BASE64: ${{ secrets.ANDROID_RELEASE_KEYSTORE_BASE64 }} run: | @@ -1463,10 +1442,10 @@ jobs: - name: Package the universal APK env: - SPOOL_ANDROID_KEYSTORE_PATH: ${{ env.SPOOL_CACHE_WRITE == 'true' && inputs.release && format('{0}/spool-release.p12', runner.temp) || '' }} - SPOOL_ANDROID_KEYSTORE_ALIAS: ${{ env.SPOOL_CACHE_WRITE == 'true' && inputs.release && secrets.ANDROID_RELEASE_KEY_ALIAS || '' }} - SPOOL_ANDROID_KEYSTORE_STORE_PASS: ${{ env.SPOOL_CACHE_WRITE == 'true' && inputs.release && secrets.ANDROID_RELEASE_KEYSTORE_PASSWORD || '' }} - SPOOL_ANDROID_KEYSTORE_KEY_PASS: ${{ env.SPOOL_CACHE_WRITE == 'true' && inputs.release && secrets.ANDROID_RELEASE_KEY_PASSWORD || '' }} + SPOOL_ANDROID_KEYSTORE_PATH: ${{ env.SPOOL_TRUSTED_BUILD == 'true' && inputs.release && format('{0}/spool-release.p12', runner.temp) || '' }} + SPOOL_ANDROID_KEYSTORE_ALIAS: ${{ env.SPOOL_TRUSTED_BUILD == 'true' && inputs.release && secrets.ANDROID_RELEASE_KEY_ALIAS || '' }} + SPOOL_ANDROID_KEYSTORE_STORE_PASS: ${{ env.SPOOL_TRUSTED_BUILD == 'true' && inputs.release && secrets.ANDROID_RELEASE_KEYSTORE_PASSWORD || '' }} + SPOOL_ANDROID_KEYSTORE_KEY_PASS: ${{ env.SPOOL_TRUSTED_BUILD == 'true' && inputs.release && secrets.ANDROID_RELEASE_KEY_PASSWORD || '' }} run: | nix develop .#android-packaging -c bash tools/android/build-universal-apk.sh \ dist/android/spool-universal.apk \ @@ -1475,7 +1454,7 @@ jobs: dist/android/spool-armeabi-v7a.apk - name: Verify Android release signing identity - if: ${{ env.SPOOL_CACHE_WRITE == 'true' && inputs.release }} + if: ${{ env.SPOOL_TRUSTED_BUILD == 'true' && inputs.release }} env: EXPECTED_CERT_SHA256: 0c9deff0513eed6d43521df31ad6d2d8e928c029b146d902f4bcc25a883c1fb8 run: | @@ -1518,6 +1497,8 @@ jobs: QT_ARCH: win64_${{ needs.toolchain.outputs.qt_windows_kit }} SPOOL_QT_ROOT: C:\Qt\${{ needs.toolchain.outputs.qt_version }}\${{ needs.toolchain.outputs.qt_windows_kit }} SPOOL_QCORO_ROOT: C:\Qt\${{ needs.toolchain.outputs.qcoro_windows_prefix }} + SCCACHE_DIR: ${{ github.workspace }}\.sccache + SCCACHE_CACHE_SIZE: 1G steps: - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.0.2 @@ -1597,13 +1578,40 @@ jobs: path: build/windows-deps/mpv key: windows-mpv-${{ runner.os }}-${{ steps.mpv-revision.outputs.revision }}-${{ hashFiles('tools/manifests/streaming-third-party.json', 'tools/prepare-streaming-sources.sh', 'tools/streaming-fingerprint.py', 'tools/check-streaming-dependencies.py', 'tools/cmake/StreamingDependencies.cmake', 'tools/cmake/QuicBatchingProbe/CMakeLists.txt', 'tools/lib/streaming-build.sh', 'tools/patches/curl-*.patch', 'tools/windows/build-streaming-dependencies.ps1', 'tools/windows/build-mpv.ps1', 'tools/windows/build-ffmpeg.ps1', 'tools/windows/build-ffmpeg.sh', 'tools/windows/check-ffmpeg.py', 'tools/windows/build-shader-tools.ps1', 'tools/windows/common.ps1', 'tools/manifests/mpv-native.json', 'tools/manifests/ffmpeg-capabilities.json', 'tools/manifests/toolchain.json', 'tools/ffmpeg-capabilities.py') }} + - name: Install sccache + uses: Mozilla-Actions/sccache-action@fc920bf0ec8de6ee65d409111f7ec508035751ba # v0.0.11 + with: + version: v0.18.0 + + - name: Identify the MSVC compiler + id: msvc + shell: pwsh + run: | + . tools\windows\common.ps1 + Import-MsvcEnvironment + $compiler = (Get-Item -LiteralPath $env:CC).VersionInfo.FileVersion + "version=$compiler" >> $env:GITHUB_OUTPUT + + - name: Restore Windows compiler cache + id: sccache + uses: actions/cache/restore@caa296126883cff596d87d8935842f9db880ef25 # v5.0.3 + with: + path: ${{ env.SCCACHE_DIR }} + key: windows-sccache-${{ steps.msvc.outputs.version }}-${{ github.sha }} + restore-keys: windows-sccache-${{ steps.msvc.outputs.version }}- + - name: Build application shell: pwsh env: MSYS2_LOCATION: ${{ steps.msys2.outputs.msys2-location }} - run: tools\windows\build.ps1 -Clean -CMakeArguments '-DSPOOL_TEST_RENDER_BACKEND=opengl' - + run: tools\windows\build.ps1 -Clean -UseSccache -CMakeArguments '-DSPOOL_TEST_RENDER_BACKEND=opengl' + - name: Save Windows compiler cache + if: ${{ env.SPOOL_CACHE_WRITE == 'true' && !inputs.release && steps.sccache.outputs.cache-hit != 'true' }} + uses: actions/cache/save@caa296126883cff596d87d8935842f9db880ef25 # v5.0.3 + with: + path: ${{ env.SCCACHE_DIR }} + key: ${{ steps.sccache.outputs.cache-primary-key }} - name: Install pinned Windows GPU and OCR test runtime shell: pwsh diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 926fbdbe..b0d17103 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -52,10 +52,43 @@ jobs: enable_macos_signing: ${{ vars.ENABLE_MACOS_SIGNING == 'true' }} secrets: inherit + native-cache: + name: Seed Cachix for nix run (${{ matrix.runner }}) + needs: validate + runs-on: ${{ matrix.runner }} + strategy: + fail-fast: false + matrix: + runner: [ubuntu-24.04, macos-15, macos-15-intel] + steps: + - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.0.2 + with: + persist-credentials: false + submodules: recursive + - uses: ./.github/actions/install-nix + with: + nix_conf: | + experimental-features = nix-command flakes + - name: Install Cachix from the Intel macOS pin + if: matrix.runner == 'macos-15-intel' + run: bash tools/install-intel-darwin-cachix.sh + - uses: cachix/cachix-action@3ba601ff5bbb07c7220846facfa2cd81eeee15a1 # v16 + with: + name: spool + skipPush: true + - name: Build and publish the immutable Nix package + env: + CACHIX_AUTH_TOKEN: ${{ secrets.CACHIX_AUTH_TOKEN }} + run: | + if [[ -n "$CACHIX_AUTH_TOKEN" ]]; then + nix build --accept-flake-config .#native-cache \ + --out-link "$RUNNER_TEMP/spool-native" --print-build-logs + cachix push spool "$RUNNER_TEMP/spool-native" + fi publish: name: Scan, attest, and publish prerelease - needs: platforms + needs: [platforms, native-cache] runs-on: ubuntu-24.04 environment: release permissions: diff --git a/.gitignore b/.gitignore index 9c35d59b..e65ba306 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,6 @@ /build/ +/.ccache/ +/.sccache/ /build-linux-dev/ /test-artifacts/ /build-arm/ diff --git a/CMakeLists.txt b/CMakeLists.txt index 9362441d..ff9d39f3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -58,10 +58,16 @@ set(MPV_WEBOS_BUILD_DIR "${MPV_SOURCE_DIR}/build/webos-libmpv" CACHE PATH "webOS if(SPOOL_DEV_BUILD) set(CMAKE_EXPORT_COMPILE_COMMANDS ON) set(CMAKE_INTERPROCEDURAL_OPTIMIZATION OFF) +endif() + +if(NOT MSVC AND (SPOOL_DEV_BUILD OR "$ENV{CI}" STREQUAL "true")) find_program(CCACHE_PROGRAM ccache) if(CCACHE_PROGRAM) - set(CMAKE_C_COMPILER_LAUNCHER "${CCACHE_PROGRAM}") - set(CMAKE_CXX_COMPILER_LAUNCHER "${CCACHE_PROGRAM}") + foreach(language IN ITEMS C CXX) + if(NOT DEFINED CMAKE_${language}_COMPILER_LAUNCHER) + set(CMAKE_${language}_COMPILER_LAUNCHER "${CCACHE_PROGRAM}") + endif() + endforeach() endif() endif() diff --git a/tools/windows/build.ps1 b/tools/windows/build.ps1 index 9e3dacd3..d7ff2402 100644 --- a/tools/windows/build.ps1 +++ b/tools/windows/build.ps1 @@ -1,5 +1,6 @@ param( [switch]$Clean, + [switch]$UseSccache, [string[]]$CMakeArguments = @() ) @@ -25,6 +26,11 @@ if ($Clean -and (Test-Path -LiteralPath $buildDir)) { Push-Location $root try { + if ($UseSccache) { + $launcher = (Get-Command sccache.exe -ErrorAction Stop).Source + $CMakeArguments += "-DCMAKE_C_COMPILER_LAUNCHER=$launcher" + $CMakeArguments += "-DCMAKE_CXX_COMPILER_LAUNCHER=$launcher" + } cmake --preset windows-release @CMakeArguments if ($LASTEXITCODE -ne 0) { throw 'CMake configuration failed.' } $ninjaCommands = Get-Content -LiteralPath (Join-Path $buildDir 'build.ninja') -Raw From 62f32a7ece2c2c196ad028abacfae25403d92a52 Mon Sep 17 00:00:00 2001 From: Sacha Korban Date: Fri, 27 Nov 2026 23:12:43 +1100 Subject: [PATCH 24/39] fix(release): keep mobile playback responsive and harden simulator checks --- src/main.cpp | 8 ++-- src/player/MpvVideoItem.cpp | 1 + src/player/PlayerController.cpp | 31 +++++++++---- tests/TestRunner.cpp | 1 + tests/app/StreamingCachePolicyTest.cpp | 47 +++++++++++--------- tests/e2e/AppJourneyTest.cpp | 10 +++-- tests/player/MpvVideoItemTest.cpp | 12 ++--- tests/providers/ProviderQmlCacheTest.cpp | 14 ++---- tests/providers/ProviderUiContextTest.cpp | 26 +++++------ tests/providers/ScriptRuntimeNetworkTest.cpp | 13 ++---- tools/run-device-tests.py | 45 ++++++++++++------- 11 files changed, 113 insertions(+), 95 deletions(-) diff --git a/src/main.cpp b/src/main.cpp index 37b972d7..808b5f65 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -1305,10 +1305,6 @@ int main(int argc, char **argv) return 1; } #if defined(SPOOL_ANDROID) - if (!window.prepareForUiSurface()) { - logLine("failed to initialize the native UI surface"); - return 1; - } // Hand the launch screen over the moment Qt has actually drawn one. The // shell's first frame is the same picture the system frame is showing -- // same mark, same size, same black -- so this swaps one for the other with @@ -1318,6 +1314,10 @@ int main(int argc, char **argv) QObject::connect( &window, &QQuickWindow::frameSwapped, &app, [] { QNativeInterface::QAndroidApplication::hideSplashScreen(); }, Qt::SingleShotConnection); + if (!window.prepareForUiSurface()) { + logLine("failed to initialize the native UI surface"); + return 1; + } #endif logLine("startup: QML source loaded in %lld ms", static_cast(startupTimer.elapsed())); diff --git a/src/player/MpvVideoItem.cpp b/src/player/MpvVideoItem.cpp index a0ba1ef7..7f86c9e6 100644 --- a/src/player/MpvVideoItem.cpp +++ b/src/player/MpvVideoItem.cpp @@ -79,6 +79,7 @@ namespace { { disconnectWindow(); releaseContext(); + completeHandoff(); } RenderLifecycle(const RenderLifecycle&) = delete; diff --git a/src/player/PlayerController.cpp b/src/player/PlayerController.cpp index ec18a325..0c3650e3 100644 --- a/src/player/PlayerController.cpp +++ b/src/player/PlayerController.cpp @@ -602,15 +602,6 @@ void PlayerController::teardownMpv(bool async) releaseMpvKeys(); const quint64 generation = ++m_mpvTeardownGeneration; Diagnostics::Phase phase(QStringLiteral("shutdown"), QStringLiteral("player_teardown_mpv")); - ++m_mpvEventGeneration; - ++m_demuxerCacheSerial; - m_demuxerCacheReplies = 0; - m_appliedDemuxerTarget.reset(); - m_demuxerUsageKnown = false; - m_demuxerUsagePending = false; - m_committedDemuxerBytes = 0; - m_streamingMemoryTimer.stop(); - m_pendingTransportLoads.clear(); m_idleMpvPreparationEnabled = false; m_idleMpvPreparationScheduled = false; m_mpvPreparationContinuation = {}; @@ -623,6 +614,17 @@ void PlayerController::teardownMpv(bool async) qCritical() << "player: timed out releasing the mpv render context; preserving the mpv core"; return; } + // A failed handoff leaves the current player in service. Retire its + // callbacks only once the platform has released the surface. + ++m_mpvEventGeneration; + ++m_demuxerCacheSerial; + m_demuxerCacheReplies = 0; + m_appliedDemuxerTarget.reset(); + m_demuxerUsageKnown = false; + m_demuxerUsagePending = false; + m_committedDemuxerBytes = 0; + m_streamingMemoryTimer.stop(); + m_pendingTransportLoads.clear(); // The deferred post-stop teardown must not stall the GUI thread; shutdown // and the stale-core path before a new play() stay synchronous so the new // pipeline never races the old core for media resources. @@ -2125,6 +2127,17 @@ void PlayerController::setPaused(bool paused) m_pauseCommandTarget = paused; m_pauseCommandRetried = false; sendMpvPauseRequest(); + QTimer::singleShot(2000, this, [this, serial = m_pauseCommandSerial, generation = m_mpvEventGeneration] { + if (generation != m_mpvEventGeneration || serial != m_pauseCommandSerial || !m_sessionActive + || m_pauseCommandRetried || m_paused == m_pauseCommandTarget + || (m_pauseCommandState != QStringLiteral("queued") && m_pauseCommandState != QStringLiteral("reading"))) + return; + // Reassert the latest idempotent intent if neither observation nor + // the asynchronous reply settled it. Ignore replies to the old write. + m_pauseCommandSerial = (m_pauseCommandSerial + 1) & kMpvReplySerialMask; + m_pauseCommandRetried = true; + sendMpvPauseRequest(); + }); } void PlayerController::sendMpvPauseRequest() diff --git a/tests/TestRunner.cpp b/tests/TestRunner.cpp index 9f7d0438..34029a42 100644 --- a/tests/TestRunner.cpp +++ b/tests/TestRunner.cpp @@ -731,6 +731,7 @@ int main(int argc, char **argv) } if (!receiptPath.isEmpty()) { receipt.insert(QStringLiteral("selector"), QString::fromStdString(selected->first)); + receipt.insert(QStringLiteral("pid"), QCoreApplication::applicationPid()); QJsonObject started = receipt; started.insert(QStringLiteral("status"), QStringLiteral("running")); if (!save(receiptPath, started)) diff --git a/tests/app/StreamingCachePolicyTest.cpp b/tests/app/StreamingCachePolicyTest.cpp index 10042f28..e34d6d1f 100644 --- a/tests/app/StreamingCachePolicyTest.cpp +++ b/tests/app/StreamingCachePolicyTest.cpp @@ -4,6 +4,7 @@ #include "TestRequire.h" #include +#include #include @@ -183,26 +184,32 @@ SPOOL_TEST_MAIN("streaming-cache-policy") && mpv_set_option_string(handle, "demuxer-max-back-bytes", "16M") >= 0 && mpv_initialize(handle) >= 0, "headless mpv initializes with baseline demuxer budgets"); - int64_t fwd = 512 * kMiB; - int64_t back = 128 * kMiB; - require(mpv_set_property(handle, "demuxer-max-bytes", MPV_FORMAT_INT64, &fwd) >= 0 - && mpv_set_property(handle, "demuxer-max-back-bytes", MPV_FORMAT_INT64, &back) >= 0, - "mpv accepts live scaling to 512 MiB forward / 128 MiB behind"); - int64_t readFwd = 0, readBack = 0; - require(mpv_get_property(handle, "demuxer-max-bytes", MPV_FORMAT_INT64, &readFwd) >= 0 - && mpv_get_property(handle, "demuxer-max-back-bytes", MPV_FORMAT_INT64, &readBack) >= 0 - && readFwd == fwd && readBack == back, - "mpv reports updated 512 MiB forward / 128 MiB behind budgets"); - - fwd = 64 * kMiB; - back = 32 * kMiB; - require(mpv_set_property(handle, "demuxer-max-bytes", MPV_FORMAT_INT64, &fwd) >= 0 - && mpv_set_property(handle, "demuxer-max-back-bytes", MPV_FORMAT_INT64, &back) >= 0, - "mpv accepts live shrinking under memory pressure"); - require(mpv_get_property(handle, "demuxer-max-bytes", MPV_FORMAT_INT64, &readFwd) >= 0 - && mpv_get_property(handle, "demuxer-max-back-bytes", MPV_FORMAT_INT64, &readBack) >= 0 - && readFwd == fwd && readBack == back, - "mpv reports shrunken budgets immediately"); + const auto apply = [&](int64_t forward, int64_t backward) { + require(mpv_set_property_async(handle, 1, "demuxer-max-bytes", MPV_FORMAT_INT64, &forward) >= 0 + && mpv_set_property_async(handle, 2, "demuxer-max-back-bytes", MPV_FORMAT_INT64, &backward) >= 0, + "mpv queues both live demuxer budget updates"); + bool forwardApplied = false; + bool backwardApplied = false; + QElapsedTimer timeout; + timeout.start(); + while (!(forwardApplied && backwardApplied) && timeout.elapsed() < 15000) { + const auto *event = mpv_wait_event(handle, 0.1); + if (event->event_id != MPV_EVENT_SET_PROPERTY_REPLY) + continue; + require(event->error >= 0, "mpv acknowledges the live demuxer budget update"); + forwardApplied |= event->reply_userdata == 1; + backwardApplied |= event->reply_userdata == 2; + } + require(forwardApplied && backwardApplied, "mpv acknowledges both live demuxer budget updates"); + int64_t readForward = 0; + int64_t readBackward = 0; + require(mpv_get_property(handle, "demuxer-max-bytes", MPV_FORMAT_INT64, &readForward) >= 0 + && mpv_get_property(handle, "demuxer-max-back-bytes", MPV_FORMAT_INT64, &readBackward) >= 0 + && readForward == forward && readBackward == backward, + "mpv reports both acknowledged budgets"); + }; + apply(512 * kMiB, 128 * kMiB); + apply(64 * kMiB, 32 * kMiB); mpv_terminate_destroy(handle); } diff --git a/tests/e2e/AppJourneyTest.cpp b/tests/e2e/AppJourneyTest.cpp index bbee0462..bbb2218f 100644 --- a/tests/e2e/AppJourneyTest.cpp +++ b/tests/e2e/AppJourneyTest.cpp @@ -89,7 +89,7 @@ QByteArray runOcr(const QString& executable, const QStringList& arguments, QProc // workers than reading the frame. Each OCR call owns a single worker. environment.insert("OMP_THREAD_LIMIT", "1"); try { - return run(executable, arguments, environment); + return run(executable, arguments, environment, {}, 30000); } catch (const std::runtime_error& error) { throw std::runtime_error(std::string("frame OCR: ") + error.what()); } @@ -210,7 +210,7 @@ class DeviceSession final { remoteScreenshot = container + "/Library/Caches/journey-frame.png"; ownership("prepare"); } - assertDefaultAutomationOff(origin, instance + "-default", ocr); + assertDefaultAutomationOff(instance + "-default", ocr); launchProduct({ "--automation-port=0", "--instance=" + instance, "--provider-store=" + origin + '/' }); QElapsedTimer deadline; deadline.start(); @@ -489,9 +489,9 @@ class DeviceSession final { return false; } } - void assertDefaultAutomationOff(const QString& origin, const QString& instance, const QString& ocr) + void assertDefaultAutomationOff(const QString& instance, const QString& ocr) { - launchProduct({ "--instance=" + instance, "--provider-store=" + origin + '/' }); + launchProduct({ "--instance=" + instance }); const QString screenshot = QFileInfo(hostDescriptor).dir().filePath("mobile-default-startup.png"); QElapsedTimer deadline; deadline.start(); @@ -1520,6 +1520,7 @@ class Journey final { lastObservation.start(); try { playback = command({ "pause" })["playback"].toObject(); + require(!playback["failed"].toBool(), "playback had already failed before pause could settle"); await( [&] { const auto observed = state(true)["playback"].toObject(); @@ -1530,6 +1531,7 @@ class Journey final { ++observations; lastObservation.restart(); playback = observed; + require(!playback["failed"].toBool(), "playback failed while waiting for pause"); return playback["paused"].toBool(); }, message); diff --git a/tests/player/MpvVideoItemTest.cpp b/tests/player/MpvVideoItemTest.cpp index 9a4485f1..69e8d5fa 100644 --- a/tests/player/MpvVideoItemTest.cpp +++ b/tests/player/MpvVideoItemTest.cpp @@ -394,6 +394,7 @@ SPOOL_TEST_MAIN("mpv-video-item") mpv_request_log_messages(handle, "warn"); if (!handle || mpv_set_option_string(handle, "terminal", verbose ? "yes" : "no") < 0 || mpv_set_option_string(handle, "vo", "libmpv") < 0 || mpv_set_option_string(handle, "hwdec", "no") < 0 + || mpv_set_option_string(handle, "pause", "yes") < 0 || mpv_set_option_string(handle, "keep-open", "yes") < 0 || mpv_set_option_string(handle, "osd-color", "#FFFFFFFF") < 0 || mpv_set_option_string(handle, "osd-font-size", "48") < 0 @@ -456,15 +457,8 @@ SPOOL_TEST_MAIN("mpv-video-item") std::fprintf(stderr, "rendered SDR target: RHI=%d mpv=%s\n", textureFormat.load(), actualFormat.isEmpty() ? "(legacy renderer)" : actualFormat.constData()); #endif - int pauseForOsd = 1; - if (mpv_set_property(handle, "pause", MPV_FORMAT_FLAG, &pauseForOsd) < 0) { - std::fprintf(stderr, "failed to pause the OSD fixture\n"); - videoItem.releaseMpvHandle(); - mpv_terminate_destroy(handle); - return 1; - } - // Hold the decoded frame: slow software simulators must exercise - // paused OSD redraw, not race the fixture's 30s EOF. + // The fixture begins paused so capture and OSD checks share the same + // decoded frame, even on a heavily loaded simulator. const QImage beforeOsd = captureItem(); const char *osdCommand[] = { "show-text", "SDR white", "3600000", nullptr }; double beforeOsdPosition = -1; diff --git a/tests/providers/ProviderQmlCacheTest.cpp b/tests/providers/ProviderQmlCacheTest.cpp index 0f6aa2ad..2fa863f5 100644 --- a/tests/providers/ProviderQmlCacheTest.cpp +++ b/tests/providers/ProviderQmlCacheTest.cpp @@ -1,5 +1,6 @@ #include "provider/ProviderQmlCache.h" #include "TestMain.h" +#include "TestRequire.h" #include #include @@ -11,24 +12,17 @@ #include #include -#include #include -#include #include namespace { -void require(bool condition, const char *message) -{ - if (!condition) { - std::cerr << message << '\n'; - std::exit(1); - } -} +using SpoolTests::require; + void waitUntil(const std::function& condition) { QElapsedTimer deadline; deadline.start(); - while (!condition() && deadline.elapsed() < 5000) { + while (!condition() && deadline.elapsed() < 15000) { QCoreApplication::processEvents(); QThread::msleep(1); } diff --git a/tests/providers/ProviderUiContextTest.cpp b/tests/providers/ProviderUiContextTest.cpp index 7fac3fdd..773229c6 100644 --- a/tests/providers/ProviderUiContextTest.cpp +++ b/tests/providers/ProviderUiContextTest.cpp @@ -1,6 +1,7 @@ #include "provider/ProviderUiContext.h" #include "ProviderFixture.h" #include "TestMain.h" +#include "TestRequire.h" #include "cache/DatabaseManager.h" #include "diagnostics/Diagnostics.h" #include "platform/CredentialStore.h" @@ -18,32 +19,25 @@ #include #include -#include #include #include #include #include namespace { -void require(bool condition, const char *message) -{ - if (!condition) { - std::cerr << message << '\n'; - std::exit(1); - } -} +using SpoolTests::require; + void waitFor(const std::function& condition, std::source_location where = std::source_location::current()) { QElapsedTimer timeout; timeout.start(); - while (!condition() && timeout.elapsed() < 5000) { + while (!condition() && timeout.elapsed() < 15000) { QCoreApplication::processEvents(); QThread::msleep(1); } - if (!condition()) { - std::cerr << "provider UI action did not complete at test line " << where.line() << '\n'; - std::exit(1); - } + const auto failure + = QByteArrayLiteral("provider UI action did not complete at test line ") + QByteArray::number(where.line()); + require(condition(), failure.constData()); } } @@ -82,7 +76,11 @@ SPOOL_TEST_MAIN("provider-ui-context") ++originHits; QObject::connect(socket, &QTcpSocket::disconnected, socket, &QObject::deleteLater); QObject::connect(socket, &QTcpSocket::readyRead, socket, [socket] { - socket->readAll(); + const QByteArray request = socket->property("request").toByteArray() + socket->readAll(); + if (!request.contains("\r\n\r\n")) { + socket->setProperty("request", request); + return; + } socket->write("HTTP/1.1 200 OK\r\nContent-Length: 2\r\nConnection: close\r\n\r\n{}"); socket->disconnectFromHost(); }); diff --git a/tests/providers/ScriptRuntimeNetworkTest.cpp b/tests/providers/ScriptRuntimeNetworkTest.cpp index 212dbc88..762ff57c 100644 --- a/tests/providers/ScriptRuntimeNetworkTest.cpp +++ b/tests/providers/ScriptRuntimeNetworkTest.cpp @@ -1,4 +1,5 @@ #include "TestMain.h" +#include "TestRequire.h" #include "provider/LanProbe.h" #include "provider/ScriptRuntime.h" @@ -17,17 +18,9 @@ #include #include -#include -#include namespace { -void require(bool condition, const char *message) -{ - if (!condition) { - std::cerr << message << '\n'; - std::exit(1); - } -} +using SpoolTests::require; template void rejects(QCoro::Task task, const char *code) { @@ -501,7 +494,7 @@ SPOOL_TEST_MAIN("script-runtime-network") QElapsedTimer elapsed; elapsed.start(); const auto drip = QCoro::waitFor(runtime.call("draft", "probe", probe)); - require(elapsed.elapsed() < 1000 && drip.value("responses").toList().isEmpty() && !drip.value("exhausted").toBool(), + require(elapsed.elapsed() < 5000 && drip.value("responses").toList().isEmpty() && !drip.value("exhausted").toBool(), "wall deadline aborts incomplete drip feeds and retains unstarted targets for continuation"); require(dripMaximum == 4, "at most four local HTTP requests run concurrently"); const auto drained = [&] { diff --git a/tools/run-device-tests.py b/tools/run-device-tests.py index 8ebd9a10..a617bdd5 100755 --- a/tools/run-device-tests.py +++ b/tools/run-device-tests.py @@ -91,6 +91,21 @@ def read(self, path): def stop(self): self.call("shell", "am", "force-stop", self.bundle, check=False) + def selector_exit(self, pid, started): + error = SelectorCrash("native Android selector exited without a final receipt") + if pid is None: + return error + try: + report = self.call("logcat", "-d", "-b", "crash", "-b", "main", "--pid", str(pid), + "-t", "100", "-v", "epoch", check=False, timeout=5) + except (OSError, subprocess.SubprocessError): + return error + for line in report.stdout.splitlines(): + match = re.match(r"^\s*([0-9]+(?:\.[0-9]+)?)\s+([0-9]+)\s+.*?\bFatal signal ([1-9][0-9]?)\b", line) + if match and float(match[1]) >= started and int(match[2]) == pid and int(match[3]) <= 64: + error.signal = int(match[3]) + break + return error def execute(self, arguments, timeout): self.call("shell", "am", "force-stop", self.bundle) @@ -101,6 +116,7 @@ def execute(self, arguments, timeout): # alone. No generic host environment forwarding or production flag. debug_extra = (["--es", "extraenvvars_SPOOL_TEST_MPV_LOG", "1"] if mpv_log_requested(arguments) else []) + started = int(self.call("shell", "date", "+%s").stdout.strip()) result = self.call("shell", "am", "start", "-W", "-n", f"{self.bundle}/org.qtproject.qt.android.bindings.QtActivity", "--es", "applicationArguments", extra, *debug_extra, check=False) @@ -110,7 +126,8 @@ def execute(self, arguments, timeout): # am start -W has already waited for the activity launch. A process # that dies before the first pid/receipt observation is still a crash, # not a reason to wait for the entire selector deadline. - seen_process = True + missing_process = False + pid = None try: while time.monotonic() < deadline: try: @@ -120,22 +137,20 @@ def execute(self, arguments, timeout): raise RuntimeError("Android native receipt has invalid nonce/schema") if report.get("status") != "running": return None, "" - seen_process = True + if type(report.get("pid")) is int and report["pid"] > 0: + pid = report["pid"] except FileNotFoundError: pass - running = bool(self.call("shell", "pidof", self.bundle, check=False).stdout.strip()) - seen_process |= running - if seen_process and not running: - # The process may have published its final receipt between - # our read and pidof. Re-read once; never relaunch the test. - try: - final = json.loads(self.read(self.receipt)) - except FileNotFoundError as error: - raise SelectorCrash("native Android selector exited without a final receipt") from error - if (isinstance(final, dict) and final.get("nonce") == arguments[-1] - and final.get("status") != "running"): - return None, "" - raise SelectorCrash("native Android selector crashed without a final receipt") + process = self.call("shell", "-T", "pidof", "-s", self.bundle, check=False) + observation = process.stdout.strip() + if process.returncode == 0 and re.fullmatch(r"[1-9][0-9]*", observation): + pid = int(observation) + # An ADB transport error also returns nonzero, but reports a + # message rather than a successful shell invocation of pidof. + absent = process.returncode == 1 and not observation + if missing_process and absent: + raise self.selector_exit(pid, started) + missing_process = absent time.sleep(0.2) raise TimeoutError("native Android selector exceeded its deadline") finally: From 2a7b7e1b9005c80ac7cac1bf06ff89882d544145 Mon Sep 17 00:00:00 2001 From: Sacha Korban Date: Fri, 27 Nov 2026 23:12:58 +1100 Subject: [PATCH 25/39] ci: reuse device host Qt and retain native Nix shell closures --- .github/workflows/build-artifacts.yml | 102 ++++++------------ .github/workflows/ios-review.yml | 115 ++++++++++++++------- .github/workflows/retry-artifact-setup.yml | 54 ---------- .github/workflows/tvos.yml | 21 ++-- flake.nix | 7 ++ tools/android/emulator-launch-test.sh | 8 +- tools/apple/aqt-ios.py | 44 ++++++++ tools/apple/smoke-tvos.sh | 6 +- 8 files changed, 176 insertions(+), 181 deletions(-) delete mode 100644 .github/workflows/retry-artifact-setup.yml create mode 100644 tools/apple/aqt-ios.py diff --git a/.github/workflows/build-artifacts.yml b/.github/workflows/build-artifacts.yml index 4ea13155..c4033951 100644 --- a/.github/workflows/build-artifacts.yml +++ b/.github/workflows/build-artifacts.yml @@ -257,6 +257,16 @@ jobs: with: nix_conf: | experimental-features = nix-command flakes + - uses: nix-community/cache-nix-action@7df957e333c1e5da7721f60227dbba6d06080569 # v7.0.1 + with: + primary-key: nix-native-shell-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('flake.nix', 'flake.lock', 'tools/manifests/toolchain.json', 'tools/manifests/ffmpeg-capabilities.json', 'tools/manifests/streaming-third-party.json', 'tools/patches/**', 'tools/webos-native/patches/qtdeclarative-*-qmlimportscanner-exclude-subtrees.patch') }} + restore-prefixes-first-match: nix-native-shell-${{ runner.os }}-${{ runner.arch }}- + gc-max-store-size: 5G + save: ${{ env.SPOOL_CACHE_WRITE == 'true' && !inputs.release }} + purge: ${{ env.SPOOL_CACHE_WRITE == 'true' && !inputs.release }} + purge-prefixes: nix-native-shell-${{ runner.os }}-${{ runner.arch }}- + purge-created: P7D + purge-primary-key: never - uses: cachix/cachix-action@3ba601ff5bbb07c7220846facfa2cd81eeee15a1 # v16 with: name: spool @@ -267,7 +277,7 @@ jobs: BUILD_ROOT: ${{ github.workspace }}/build/linux-sanitizers SPOOL_CMAKE_EXTRA_ARGS: -DSPOOL_SANITIZERS=ON SPOOL_BUILD_MEMORY_PER_JOB_MIB: 3072 - run: nix develop .#native -c bash tools/build-linux-release.sh + run: nix develop .#native --profile "$RUNNER_TEMP/native-shell" -c bash tools/build-linux-release.sh - name: Exercise actual bounded decoder and provider-package consumer run: | nix develop .#native -c env \ @@ -310,20 +320,14 @@ jobs: with: nix_conf: | experimental-features = nix-command flakes - - name: Resolve tailored Qt cache key - id: qt-cache-inputs - run: | - qt_derivation="$(nix eval --raw .#native-qt-cache.drvPath)" - echo "key=${qt_derivation##*/}" >>"$GITHUB_OUTPUT" - uses: nix-community/cache-nix-action@7df957e333c1e5da7721f60227dbba6d06080569 # v7.0.1 with: - primary-key: nix-native-${{ runner.os }}-${{ steps.qt-cache-inputs.outputs.key }} - restore-prefixes-first-match: nix-native-${{ runner.os }}- - gc-max-store-size-linux: 4G - # Cache hygiene: see the lint job above. + primary-key: nix-native-shell-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('flake.nix', 'flake.lock', 'tools/manifests/toolchain.json', 'tools/manifests/ffmpeg-capabilities.json', 'tools/manifests/streaming-third-party.json', 'tools/patches/**', 'tools/webos-native/patches/qtdeclarative-*-qmlimportscanner-exclude-subtrees.patch') }} + restore-prefixes-first-match: nix-native-shell-${{ runner.os }}-${{ runner.arch }}- + gc-max-store-size: 5G save: ${{ env.SPOOL_CACHE_WRITE == 'true' && !inputs.release }} purge: ${{ env.SPOOL_CACHE_WRITE == 'true' && !inputs.release }} - purge-prefixes: nix-native-${{ runner.os }}- + purge-prefixes: nix-native-shell-${{ runner.os }}-${{ runner.arch }}- purge-created: P7D purge-primary-key: never - uses: cachix/cachix-action@3ba601ff5bbb07c7220846facfa2cd81eeee15a1 # v16 @@ -331,6 +335,7 @@ jobs: name: spool skipPush: true - name: Build tailored Qt + if: ${{ env.SPOOL_TRUSTED_BUILD == 'true' }} run: | nix build --accept-flake-config .#native-qt-cache \ --out-link "$RUNNER_TEMP/spool-native-qt" --print-build-logs @@ -358,7 +363,7 @@ jobs: # The default dev shell has no Qt on purpose (it is the hermetic Qt-source # build shell). The native app build needs nixpkgs Qt, so use .#native. - name: Build host app - run: nix develop .#native -c bash tools/build-linux-release.sh + run: nix develop .#native --profile "$RUNNER_TEMP/native-shell" -c bash tools/build-linux-release.sh - name: Save Linux build cache if: ${{ env.SPOOL_CACHE_WRITE == 'true' && !inputs.release && steps.linux-build-cache.outputs.cache-hit != 'true' }} @@ -599,21 +604,14 @@ jobs: connect-timeout = 30 download-attempts = 5 - - name: Resolve tailored Qt cache key - id: qt-cache-inputs - run: | - qt_derivation="$(nix eval --raw .#native-qt-cache.drvPath)" - echo "key=${qt_derivation##*/}" >>"$GITHUB_OUTPUT" - - uses: nix-community/cache-nix-action@7df957e333c1e5da7721f60227dbba6d06080569 # v7.0.1 with: - primary-key: nix-native-${{ runner.os }}-${{ matrix.arch }}-${{ steps.qt-cache-inputs.outputs.key }} - restore-prefixes-first-match: nix-native-${{ runner.os }}-${{ matrix.arch }}- - gc-max-store-size-macos: 8G - # Cache hygiene: see the lint job above. + primary-key: nix-native-shell-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('flake.nix', 'flake.lock', 'tools/manifests/toolchain.json', 'tools/manifests/ffmpeg-capabilities.json', 'tools/manifests/streaming-third-party.json', 'tools/patches/**', 'tools/webos-native/patches/qtdeclarative-*-qmlimportscanner-exclude-subtrees.patch') }} + restore-prefixes-first-match: nix-native-shell-${{ runner.os }}-${{ runner.arch }}- + gc-max-store-size: 5G save: ${{ env.SPOOL_CACHE_WRITE == 'true' && !inputs.release }} purge: ${{ env.SPOOL_CACHE_WRITE == 'true' && !inputs.release }} - purge-prefixes: nix-native-${{ runner.os }}-${{ matrix.arch }}- + purge-prefixes: nix-native-shell-${{ runner.os }}-${{ runner.arch }}- purge-created: P7D purge-primary-key: never - name: Install Cachix from the Intel macOS pin @@ -624,6 +622,7 @@ jobs: name: spool skipPush: true - name: Build tailored Qt + if: ${{ env.SPOOL_TRUSTED_BUILD == 'true' }} run: | nix build --accept-flake-config .#native-qt-cache \ --out-link "$RUNNER_TEMP/spool-native-qt" --print-build-logs @@ -693,7 +692,7 @@ jobs: DEPLOY_APP: '0' SPOOL_MACOS_CREDENTIAL_SERVICE: ${{ inputs.enable_macos_signing && 'com.sachk.spool' || '' }} SPOOL_TEST_RENDER_BACKEND: opengl - run: nix develop .#native --no-write-lock-file -c bash tools/build-macos.sh + run: nix develop .#native --profile "$RUNNER_TEMP/native-shell" --no-write-lock-file -c bash tools/build-macos.sh - name: Save macOS build cache @@ -862,7 +861,7 @@ jobs: persist-credentials: false submodules: recursive - name: Install native source-build tools - run: brew install cmake ninja meson pkg-config bash python imagemagick gpatch + run: brew install cmake ninja meson pkg-config bash python imagemagick gpatch ffmpeg tesseract - name: Identify the exact Apple source toolchain id: apple-toolchain run: | @@ -906,25 +905,12 @@ jobs: -m qtshadertools qttasktree qtwebsockets qtimageformats - name: Build actual source Qt, media closure, and tvOS app run: bash tools/build-tvos.sh - # The journeys drive the simulator from a native macOS controller, - # which builds in the Nix shell like the macOS job. - - uses: ./.github/actions/install-nix - if: matrix.sdk == 'appletvsimulator' - with: - nix_conf: | - experimental-features = nix-command flakes - connect-timeout = 30 - download-attempts = 5 - - uses: cachix/cachix-action@3ba601ff5bbb07c7220846facfa2cd81eeee15a1 # v16 - if: matrix.sdk == 'appletvsimulator' - with: - name: spool - skipPush: true - name: Build native host controller for tvOS application journeys if: matrix.sdk == 'appletvsimulator' run: | - nix develop .#native -c cmake -S tests/e2e/host -B build/apple/device-journey-host -G Ninja -DCMAKE_BUILD_TYPE=Release - nix develop .#native -c cmake --build build/apple/device-journey-host + cmake -S tests/e2e/host -B build/apple/device-journey-host -G Ninja \ + -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="$QT_HOST_PATH" + cmake --build build/apple/device-journey-host - name: Run tvOS traditional and real GPU GUI e2e tests if: matrix.sdk == 'appletvsimulator' @@ -1305,36 +1291,14 @@ jobs: key: ${{ steps.android-cache.outputs.cache-primary-key }} - - name: Fetch pinned libplacebo for Android host controller - if: matrix.abi == 'x86_64' - timeout-minutes: 10 - shell: bash - run: | - set -euo pipefail - source_url="$(jq -er '.nodes["libplacebo-src"].locked - | select(.type == "git" and .submodules == true) - | "git+\(.url)?rev=\(.rev)&submodules=1"' flake.lock)" - expected_hash="$(jq -er '.nodes["libplacebo-src"].locked.narHash' flake.lock)" - log="$RUNNER_TEMP/android-libplacebo-fetch.log" - for attempt in 1 2 3; do - if result="$(nix flake prefetch --json "$source_url" 2>"$log")"; then - test "$(jq -er .hash <<<"$result")" = "$expected_hash" - exit - fi - cat "$log" >&2 - if ! grep -Eiq 'Failed to connect|Could not resolve host|Connection (timed out|reset)|HTTP error (502|503|504)' "$log"; then - exit 1 - fi - if (( attempt == 3 )); then - echo 'Pinned libplacebo fetch exhausted retries after a transient connection failure.' - exit 1 - fi - sleep "$((attempt * 10))" - done - - name: Build native host controller for Android application journeys if: matrix.abi == 'x86_64' - run: nix develop .#native -c bash tools/build-linux-release.sh + run: | + nix develop .#android-journey -c bash -euc ' + cmake -S tests/e2e/host -B build/android/device-journey-host -G Ninja -DCMAKE_BUILD_TYPE=Release + cmake --build build/android/device-journey-host + ' + echo "SPOOL_DEVICE_HOST_BUILD_DIR=$GITHUB_WORKSPACE/build/android/device-journey-host" >>"$GITHUB_ENV" - name: Run Android phone traditional and real GPU GUI e2e tests id: android-phone-tests diff --git a/.github/workflows/ios-review.yml b/.github/workflows/ios-review.yml index 6bbb4f68..8611cb95 100644 --- a/.github/workflows/ios-review.yml +++ b/.github/workflows/ios-review.yml @@ -19,16 +19,23 @@ permissions: jobs: native: name: iOS (${{ matrix.sdk }} ${{ matrix.arch }}) - runs-on: macos-15-intel + runs-on: macos-15 timeout-minutes: 180 strategy: fail-fast: false matrix: include: - sdk: iphonesimulator - arch: x86_64 + arch: arm64 + qt_kit: ios_simulator_arm64 - sdk: iphoneos arch: arm64 + qt_kit: ios_device + env: + APPLE_SDK: ${{ matrix.sdk }} + APPLE_ARCH: ${{ matrix.arch }} + APPLE_BUILD: build/apple/${{ matrix.sdk }}-${{ matrix.arch }} + SPOOL_CACHE_WRITE: ${{ (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository)) && !inputs.release }} steps: - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.0.2 with: @@ -47,22 +54,64 @@ jobs: fi echo "Building source $GITHUB_SHA with bundle/package version $version" - name: Install native build tools - run: brew install cmake ninja meson pkg-config bash python imagemagick nasm gpatch + run: brew install cmake ninja meson pkg-config bash python imagemagick nasm gpatch ffmpeg tesseract + - name: Resolve Qt kits and Apple SDK + id: apple-toolchain + shell: bash + run: | + version="$(bash tools/toolchain-versions.sh qt.version)" + echo "version=$version" >>"$GITHUB_OUTPUT" + echo "QT_HOST_PATH=$RUNNER_TEMP/Qt/$version/macos" >>"$GITHUB_ENV" + echo "QT_TARGET_PREFIX=$RUNNER_TEMP/Qt/$version/${{ matrix.qt_kit }}" >>"$GITHUB_ENV" + identity="$( + { + xcodebuild -version + xcrun --sdk "$APPLE_SDK" --show-sdk-build-version + xcrun --sdk "$APPLE_SDK" --show-sdk-path + } | shasum -a 256 + )" + echo "key=${identity%% *}" >>"$GITHUB_OUTPUT" + - name: Restore Qt host and iOS kits + id: qt-cache + uses: actions/cache/restore@caa296126883cff596d87d8935842f9db880ef25 # v5.0.3 + with: + path: ${{ runner.temp }}/Qt + key: ios-kits-${{ runner.arch }}-${{ matrix.qt_kit }}-${{ steps.apple-toolchain.outputs.version }}-${{ hashFiles('tools/apple/aqt-ios.py', '.github/workflows/ios-review.yml') }} - name: Install pinned Qt host and iOS kits + if: steps.qt-cache.outputs.cache-hit != 'true' + env: + QT_VERSION: ${{ steps.apple-toolchain.outputs.version }} + QT_IOS_KIT: ${{ matrix.qt_kit }} shell: bash run: | python3 -m venv "$RUNNER_TEMP/aqt" "$RUNNER_TEMP/aqt/bin/pip" install aqtinstall==3.3.0 - qt_version="$(python3 -c 'import json; print(json.load(open("tools/manifests/toolchain.json"))["qt"]["version"])')" - "$RUNNER_TEMP/aqt/bin/aqt" install-qt mac desktop "$qt_version" clang_64 -O "$RUNNER_TEMP/Qt" -m qtshadertools qtwebsockets qtimageformats qttasktree - "$RUNNER_TEMP/aqt/bin/aqt" install-qt mac ios "$qt_version" ios -O "$RUNNER_TEMP/Qt" -m qtshadertools qtwebsockets qtimageformats qttasktree - echo "QT_HOST_PATH=$RUNNER_TEMP/Qt/$qt_version/macos" >> "$GITHUB_ENV" - echo "QT_TARGET_PREFIX=$RUNNER_TEMP/Qt/$qt_version/ios" >> "$GITHUB_ENV" + modules=(qtshadertools qtwebsockets qtimageformats qttasktree) + "$RUNNER_TEMP/aqt/bin/aqt" install-qt mac desktop "$QT_VERSION" clang_64 \ + -O "$RUNNER_TEMP/Qt" -m "${modules[@]}" + "$RUNNER_TEMP/aqt/bin/python" tools/apple/aqt-ios.py install-qt mac ios "$QT_VERSION" "$QT_IOS_KIT" \ + -O "$RUNNER_TEMP/Qt" -m "${modules[@]}" + - name: Save Qt host and iOS kits + if: ${{ env.SPOOL_CACHE_WRITE == 'true' && steps.qt-cache.outputs.cache-hit != 'true' }} + uses: actions/cache/save@caa296126883cff596d87d8935842f9db880ef25 # v5.0.3 + with: + path: ${{ runner.temp }}/Qt + key: ${{ steps.qt-cache.outputs.cache-primary-key }} + - name: Read mpv revision + id: mpv-revision + run: echo "revision=$(git rev-parse HEAD:mpv)" >>"$GITHUB_OUTPUT" + - name: Restore iOS build + id: ios-build-cache + uses: actions/cache/restore@caa296126883cff596d87d8935842f9db880ef25 # v5.0.3 + with: + path: | + ${{ env.APPLE_BUILD }}/prefix + ${{ env.APPLE_BUILD }}/app + key: ios-build-${{ matrix.sdk }}-${{ matrix.arch }}-${{ steps.apple-toolchain.outputs.key }}-${{ steps.mpv-revision.outputs.revision }}-${{ hashFiles('tools/apple/build-dependencies.sh', 'tools/manifests/*.json', 'tools/build-ios.sh', 'tools/lib/*.sh', 'tools/patches/**') }} - name: Build native iOS application shell: bash env: - APPLE_SDK: ${{ matrix.sdk }} - APPLE_ARCH: ${{ matrix.arch }} + BUILD_DEPENDENCIES: ${{ steps.ios-build-cache.outputs.cache-hit == 'true' && '0' || '1' }} APPLE_CODE_SIGNING_ALLOWED: 'NO' # The published IPA is unsigned, for sideloading, so it is the open # build (all providers, provider downloads); the simulator smoke @@ -70,40 +119,30 @@ jobs: SPOOL_APPLE_APP_STORE: 'OFF' BUILD_JOBS: '4' run: bash tools/build-ios.sh - - uses: ./.github/actions/install-nix - if: matrix.sdk == 'iphonesimulator' - with: - nix_conf: | - experimental-features = nix-command flakes - - name: Install Cachix from the Intel macOS pin - if: matrix.sdk == 'iphonesimulator' - run: bash tools/install-intel-darwin-cachix.sh - - uses: cachix/cachix-action@3ba601ff5bbb07c7220846facfa2cd81eeee15a1 - if: matrix.sdk == 'iphonesimulator' + - name: Save iOS build + if: ${{ env.SPOOL_CACHE_WRITE == 'true' && steps.ios-build-cache.outputs.cache-hit != 'true' }} + uses: actions/cache/save@caa296126883cff596d87d8935842f9db880ef25 # v5.0.3 with: - name: spool - skipPush: true - - name: Select supported Intel macOS native package channel - if: matrix.sdk == 'iphonesimulator' - shell: bash - run: | - url="$(python3 -c 'import json; p=json.load(open("flake.lock"))["nodes"]["nixpkgs-x86-darwin"]["locked"]; print("github:"+p["owner"]+"/"+p["repo"]+"/"+p["rev"])')" - nix flake lock --override-input nixpkgs "$url" + path: | + ${{ env.APPLE_BUILD }}/prefix + ${{ env.APPLE_BUILD }}/app + key: ${{ steps.ios-build-cache.outputs.cache-primary-key }} - name: Build native host controller for iOS application journeys if: matrix.sdk == 'iphonesimulator' run: | - nix develop .#native -c cmake -S tests/e2e/host -B build/apple/device-journey-host -G Ninja -DCMAKE_BUILD_TYPE=Release - nix develop .#native -c cmake --build build/apple/device-journey-host + cmake -S tests/e2e/host -B build/apple/device-journey-host -G Ninja \ + -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="$QT_HOST_PATH" + cmake --build build/apple/device-journey-host - name: Run iOS traditional and real GPU GUI e2e tests if: matrix.sdk == 'iphonesimulator' env: - SPOOL_TVOS_TEST_BUILD_DIR: build/apple/iphonesimulator-x86_64/app + SPOOL_TVOS_TEST_BUILD_DIR: ${{ env.APPLE_BUILD }}/app SPOOL_DEVICE_HOST_BUILD_DIR: build/apple/device-journey-host - run: bash tools/apple/smoke-ios.sh build/apple/iphonesimulator-x86_64/install/Spool.app + run: bash tools/apple/smoke-ios.sh "$APPLE_BUILD/install/Spool.app" - name: Package audited unsigned device IPA if: matrix.sdk == 'iphoneos' shell: bash - run: bash tools/package-ios.sh build/apple/iphoneos-arm64/app/Release-iphoneos/Spool.app dist/ios + run: bash tools/package-ios.sh "$APPLE_BUILD/app/Release-$APPLE_SDK/Spool.app" dist/ios - name: Upload only the unsigned device release package if: matrix.sdk == 'iphoneos' uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.0 @@ -116,21 +155,21 @@ jobs: if: matrix.sdk == 'iphonesimulator' shell: bash run: | - tar -czf "$RUNNER_TEMP/ios-simulator-x86_64.tar.gz" \ - -C build/apple/iphonesimulator-x86_64/app/Release-iphonesimulator Spool.app + tar -czf "$RUNNER_TEMP/ios-simulator-$APPLE_ARCH.tar.gz" \ + -C "$APPLE_BUILD/app/Release-$APPLE_SDK" Spool.app - name: Keep simulator build internal if: matrix.sdk == 'iphonesimulator' uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.0 with: - name: internal-ios-simulator-x86_64 - path: ${{ runner.temp }}/ios-simulator-x86_64.tar.gz + name: internal-ios-simulator-${{ matrix.arch }} + path: ${{ runner.temp }}/ios-simulator-${{ matrix.arch }}.tar.gz if-no-files-found: error retention-days: 7 - name: Keep simulator test diagnostics internal if: always() && matrix.sdk == 'iphonesimulator' uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.0 with: - name: internal-ios-simulator-x86_64-tests + name: internal-ios-simulator-${{ matrix.arch }}-tests path: | build/ios/smoke/safe-export build/ios/smoke/launch-result.json diff --git a/.github/workflows/retry-artifact-setup.yml b/.github/workflows/retry-artifact-setup.yml deleted file mode 100644 index b92e4df6..00000000 --- a/.github/workflows/retry-artifact-setup.yml +++ /dev/null @@ -1,54 +0,0 @@ -name: Retry transient artifact setup - -on: - workflow_run: - workflows: [build artifacts] - types: [completed] - -permissions: - actions: write - -concurrency: - group: retry-artifact-setup-${{ github.event.workflow_run.id }} - cancel-in-progress: false - -jobs: - retry: - if: >- - github.event.workflow_run.conclusion == 'failure' && - github.event.workflow_run.run_attempt == 1 && - github.event.workflow_run.head_repository.full_name == github.repository && - contains(fromJSON('["push","pull_request"]'), github.event.workflow_run.event) - runs-on: ubuntu-24.04 - env: - GH_TOKEN: ${{ github.token }} - GH_REPO: ${{ github.repository }} - RUN_ID: ${{ github.event.workflow_run.id }} - steps: - - name: Rerun failed jobs only for allowlisted setup failures - shell: bash - run: | - set -euo pipefail - endpoint="repos/$GH_REPO/actions/runs/$RUN_ID" - # Compare the current attempt again so a queued retry cannot ignore a - # rerun already started manually. Use only GitHub job metadata and logs. - gh api "$endpoint" | jq -e '.run_attempt == 1 and .conclusion == "failure"' >/dev/null || exit 0 - jobs="$(gh api --paginate --slurp "$endpoint/attempts/1/jobs?per_page=100")" - jq -e ' - [.[].jobs[]] as $jobs - | [$jobs[] | select(.conclusion == "failure")] as $failed - | ($failed | length) > 0 - and all($jobs[]; .conclusion == "success" or .conclusion == "skipped" or .conclusion == "failure") - and all($failed[]; - .name == "Android x86_64 APK" - and [.steps[] | select(.conclusion == "failure") | .name] - == ["Fetch pinned libplacebo for Android host controller"]) - ' <<<"$jobs" >/dev/null || exit 0 - - while read -r job_id; do - log="$RUNNER_TEMP/first-attempt-$job_id.log" - gh api --allow-escape-sequences "repos/$GH_REPO/actions/jobs/$job_id/logs" >"$log" - grep -Eq '^.*[0-9]Z Pinned libplacebo fetch exhausted retries after a transient connection failure\.$' "$log" || exit 0 - done < <(jq -r '.[].jobs[] | select(.conclusion == "failure") | .id' <<<"$jobs") - - gh api --method POST "$endpoint/rerun-failed-jobs" diff --git a/.github/workflows/tvos.yml b/.github/workflows/tvos.yml index 5abdb39e..f0f12389 100644 --- a/.github/workflows/tvos.yml +++ b/.github/workflows/tvos.yml @@ -27,12 +27,12 @@ jobs: submodules: recursive persist-credentials: false - name: Install native build tools - run: brew install cmake ninja meson pkg-config bash python imagemagick gpatch + run: brew install cmake ninja meson pkg-config bash python imagemagick gpatch ffmpeg tesseract - name: Install pinned macOS Qt host tools run: | python3 -m venv "$RUNNER_TEMP/aqt" "$RUNNER_TEMP/aqt/bin/pip" install aqtinstall - version="$(python3 -c 'import json;print(json.load(open("tools/manifests/toolchain.json"))["qt"]["version"])')" + version="$(bash tools/toolchain-versions.sh qt.version)" "$RUNNER_TEMP/aqt/bin/aqt" install-qt mac desktop "$version" clang_64 \ -O "$RUNNER_TEMP/Qt" -m qtshadertools qtwebsockets qtimageformats qttasktree echo "QT_HOST_PATH=$RUNNER_TEMP/Qt/$version/macos" >> "$GITHUB_ENV" @@ -43,21 +43,16 @@ jobs: JOBS: 3 BUILD_JOBS: 3 run: bash tools/build-tvos.sh - - uses: ./.github/actions/install-nix - if: matrix.sdk == 'appletvsimulator' - with: - nix_conf: | - experimental-features = nix-command flakes - - uses: cachix/cachix-action@3ba601ff5bbb07c7220846facfa2cd81eeee15a1 - if: matrix.sdk == 'appletvsimulator' - with: - name: spool - skipPush: true - name: Build same-binary host controller for the actual mobile app journey if: matrix.sdk == 'appletvsimulator' - run: nix develop .#native -c env DEPLOY_APP=0 bash tools/build-macos.sh + run: | + cmake -S tests/e2e/host -B build/apple/device-journey-host -G Ninja \ + -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="$QT_HOST_PATH" + cmake --build build/apple/device-journey-host - name: Run traditional then real GPU GUI tests in isolated Apple TV simulator if: matrix.sdk == 'appletvsimulator' + env: + SPOOL_DEVICE_HOST_BUILD_DIR: build/apple/device-journey-host run: bash tools/apple/smoke-tvos.sh build/tvos/appletvsimulator-arm64/install/Spool.app - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a if: always() diff --git a/flake.nix b/flake.nix index 08835003..a059c089 100644 --- a/flake.nix +++ b/flake.nix @@ -879,6 +879,13 @@ shellHook = gitHooksShellHook; }; } // pkgs.lib.optionalAttrs pkgs.stdenv.hostPlatform.isLinux { + android-journey = pkgs.mkShell { + packages = with pkgs; [ + cmake ninja python3 spoolQt6.qtbase spoolQt6.qtwebsockets + (lib.getBin (spoolFfmpegFor pkgs)) tesseract + ]; + }; + windows-proton = pkgs.mkShell { packages = with pkgs; [ umu-launcher vulkan-tools python3 msitools gcab p7zip diff --git a/tools/android/emulator-launch-test.sh b/tools/android/emulator-launch-test.sh index 5804a5da..2788010a 100755 --- a/tools/android/emulator-launch-test.sh +++ b/tools/android/emulator-launch-test.sh @@ -38,14 +38,14 @@ done host_build="${SPOOL_DEVICE_HOST_BUILD_DIR:-$ROOT/build/linux-release/app}" if [[ -z "${SPOOL_DEVICE_HOST_E2E:-}" ]]; then [[ -f "$host_build/native-spool-e2e-path.txt" ]] || { - echo 'error: build the native host journey controller with tools/build-linux-release.sh first' >&2 + echo "error: missing native journey controller path in $host_build" >&2 exit 1 } read -r SPOOL_DEVICE_HOST_E2E <"$host_build/native-spool-e2e-path.txt" fi if [[ -z "${SPOOL_E2E_SPOOLET:-}" ]]; then [[ -f "$host_build/native-spoolet-path.txt" ]] || { - echo 'error: build the matching native spoolet with tools/build-linux-release.sh first' >&2 + echo "error: missing native spoolet path in $host_build" >&2 exit 1 } read -r SPOOL_E2E_SPOOLET <"$host_build/native-spoolet-path.txt" @@ -262,9 +262,9 @@ adb_retry install -r "$E2E_APK" status=0 # The shared driver finishes every traditional native selector before starting # real GUI selectors and retains both phase failures. -# The native shell supplies real host Qt, FFmpeg CLI and English OCR; the +# The journey shell supplies the host FFmpeg CLI and English OCR; the # controller renders nothing on the host and observes the private emulator. -nix develop "$ROOT#native" -c python "$ROOT/tools/run-tests.py" \ +nix develop "$ROOT#android-journey" -c python "$ROOT/tools/run-tests.py" \ --build-dir "$BUILD_DIR" --workers 1 || status=1 # Replace the developer application with the exact signed release artifact. # Uninstall only from this owned emulator to avoid signature/version conflicts diff --git a/tools/apple/aqt-ios.py b/tools/apple/aqt-ios.py new file mode 100644 index 00000000..cde0acad --- /dev/null +++ b/tools/apple/aqt-ios.py @@ -0,0 +1,44 @@ +#!/usr/bin/env python3 +"""Install a split iOS kit with aqtinstall 3.3 (predates the split layout).""" + +from aqt import installer +from aqt.archives import QtArchives +from aqt.updater import Updater + + +class IosArchives(QtArchives): + def _arch_ext(self): + return "_" + self.arch.removeprefix("ios_") + + def _base_package_names(self): + kit = self.arch.removeprefix("ios_") + return (f"qt.qt{self.version.major}.{self._version_str()}.qtforios.{kit}",) + + def _parse_update_xml(self, folder, xml, packages): + # The base package ends in .device or .simulator_arm64, but the + # selected add-ons and the installation directory use the ios_ prefix. + arch = self.arch + self.arch = arch.removeprefix("ios_") + try: + super()._parse_update_xml(folder, xml, packages) + finally: + self.arch = arch + + +class IosUpdater(Updater): + @classmethod + def update(cls, target, base_path, installed_desktop_arch_dir): + arch = target.arch + prefix = base_path / target.version / arch + updater = cls(prefix, installer.getLogger("aqt.updater")) + updater.set_license(str(base_path), target.version, arch) + updater.patch_qt_scripts( + str(base_path), target.version, target.os_name, "macos", installer.Version(target.version) + ) + updater.patch_target_qt_conf(str(base_path), target.version, arch, target.os_name, "macos") + + +if __name__ == "__main__": + installer.QtArchives = IosArchives + installer.Updater = IosUpdater + raise SystemExit(installer.Cli().run()) diff --git a/tools/apple/smoke-tvos.sh b/tools/apple/smoke-tvos.sh index 40d326b4..b3b54084 100755 --- a/tools/apple/smoke-tvos.sh +++ b/tools/apple/smoke-tvos.sh @@ -12,14 +12,14 @@ esac host_build="${SPOOL_DEVICE_HOST_BUILD_DIR:-$ROOT/build/macos/app}" if [[ -z "${SPOOL_DEVICE_HOST_E2E:-}" ]]; then [[ -f "$host_build/native-spool-e2e-path.txt" ]] || { - echo 'error: build the native host journey controller with tools/build-macos.sh first' >&2 + echo "error: missing native journey controller path in $host_build" >&2 exit 1 } read -r SPOOL_DEVICE_HOST_E2E <"$host_build/native-spool-e2e-path.txt" fi if [[ -z "${SPOOL_E2E_SPOOLET:-}" ]]; then [[ -f "$host_build/native-spoolet-path.txt" ]] || { - echo 'error: build the matching native spoolet with tools/build-macos.sh first' >&2 + echo "error: missing native spoolet path in $host_build" >&2 exit 1 } read -r SPOOL_E2E_SPOOLET <"$host_build/native-spoolet-path.txt" @@ -98,7 +98,7 @@ status=0 # CTest traditional and e2e phases use run-device-tests.py, requiring fresh native # nonce receipts and preserving the extra Keychain/sandbox consumer receipt. # Both phases finish even when a selector fails, crashes, or exceeds its deadline. -nix develop "$ROOT#native" -c python "$ROOT/tools/run-tests.py" \ +python3 "$ROOT/tools/run-tests.py" \ --build-dir "$build_dir" --config Release --workers 1 || status=1 # Keep the product bundle's UI launch contract in addition to native GPU/QML # selectors. This is not substituted for a provider/playback app journey. From b54779f98bd1a30f19a1994b43b96e4434637b61 Mon Sep 17 00:00:00 2001 From: Sacha Korban Date: Fri, 27 Nov 2026 23:15:58 +1100 Subject: [PATCH 26/39] fix(player): preserve pending pause across a renderer restart --- src/app/AppController.cpp | 2 +- src/player/PlayerController.cpp | 60 +++++++++++++++++---------- src/player/PlayerController.h | 6 ++- tests/player/PlayerControllerTest.cpp | 5 +++ 4 files changed, 48 insertions(+), 25 deletions(-) diff --git a/src/app/AppController.cpp b/src/app/AppController.cpp index 439eaef8..97252bd1 100644 --- a/src/app/AppController.cpp +++ b/src/app/AppController.cpp @@ -1535,7 +1535,7 @@ QCoro::Task AppController::startPlayback(MovieItem playItem, bool startPau if (!guard || !m_playbackLoadGeneration.isCurrent(generation)) co_return; m_settings->preparePlayback(m_provider->accountOf(session.itemId)); - m_player->play(session, startPaused); + m_player->play(session, startPaused, restartActive); m_playingAccountId = m_provider->accountOf(session.itemId); if (!guard || !m_playbackLoadGeneration.isCurrent(generation)) co_return; diff --git a/src/player/PlayerController.cpp b/src/player/PlayerController.cpp index 0c3650e3..a7b9489d 100644 --- a/src/player/PlayerController.cpp +++ b/src/player/PlayerController.cpp @@ -1530,9 +1530,9 @@ void PlayerController::handleVideoRenderError(const QString& message) emit playbackStateChanged(); } -void PlayerController::play(const PlaybackSession& session, bool startPaused) +void PlayerController::play(const PlaybackSession& session, bool startPaused, bool restartActive) { - playSession(session, startPaused, {}); + playSession(session, startPaused, {}, restartActive); } void PlayerController::playLocalFiles(const QList& urls) @@ -1543,10 +1543,11 @@ void PlayerController::playLocalFiles(const QList& urls) session.url = urls.first().toString(QUrl::FullyEncoded); session.title = urls.first().fileName(); session.playMethod = QStringLiteral("DirectPlay"); - playSession(session, false, urls); + playSession(session, false, urls, false); } -void PlayerController::playSession(const PlaybackSession& session, bool startPaused, const QList& localFiles) +void PlayerController::playSession( + const PlaybackSession& session, bool startPaused, const QList& localFiles, bool restartActive) { const quint64 generation = ++m_playGeneration; m_pendingTransportLoads.clear(); @@ -1591,6 +1592,13 @@ void PlayerController::playSession(const PlaybackSession& session, bool startPau return; } } + if (restartActive && m_sessionActive && m_session.itemId == session.itemId) { + // A pause can arrive while the old render context is being released. + // Carry the latest intent into the replacement's initial property. + startPaused = mpvPauseRequestPending() ? m_pauseCommandTarget : m_paused; + } + m_pauseCommandSerial = (m_pauseCommandSerial + 1) & kMpvReplySerialMask; + m_pauseCommandState.clear(); resetRenderStrain(); const bool hadFileAudioDelay = m_fileAudioDelayMs.exchange(0) != 0; @@ -2114,30 +2122,38 @@ void PlayerController::togglePause() void PlayerController::setPaused(bool paused) { + if (!m_sessionActive) + return; m_pauseRequestClock.restart(); qInfo() << "player: pause requested" << paused; - if (!m_mpvLifecycle.handle()) { - if (m_sessionActive && m_paused != paused) { - m_paused = paused; - notifyPlaybackStateChanged(); - } - return; - } m_pauseCommandSerial = (m_pauseCommandSerial + 1) & kMpvReplySerialMask; m_pauseCommandTarget = paused; m_pauseCommandRetried = false; - sendMpvPauseRequest(); - QTimer::singleShot(2000, this, [this, serial = m_pauseCommandSerial, generation = m_mpvEventGeneration] { - if (generation != m_mpvEventGeneration || serial != m_pauseCommandSerial || !m_sessionActive - || m_pauseCommandRetried || m_paused == m_pauseCommandTarget - || (m_pauseCommandState != QStringLiteral("queued") && m_pauseCommandState != QStringLiteral("reading"))) - return; - // Reassert the latest idempotent intent if neither observation nor - // the asynchronous reply settled it. Ignore replies to the old write. - m_pauseCommandSerial = (m_pauseCommandSerial + 1) & kMpvReplySerialMask; - m_pauseCommandRetried = true; + m_pauseCommandState.clear(); + if (m_mpvLifecycle.handle()) { sendMpvPauseRequest(); - }); + QTimer::singleShot(2000, this, [this, serial = m_pauseCommandSerial, generation = m_mpvEventGeneration] { + if (generation != m_mpvEventGeneration || serial != m_pauseCommandSerial || !m_sessionActive + || m_pauseCommandRetried || m_paused == m_pauseCommandTarget || !mpvPauseRequestPending()) + return; + // Reassert the latest idempotent intent if neither observation nor + // the asynchronous reply settled it. Ignore replies to the old write. + m_pauseCommandSerial = (m_pauseCommandSerial + 1) & kMpvReplySerialMask; + m_pauseCommandRetried = true; + sendMpvPauseRequest(); + }); + } + // File loading applies the current initial pause on the adopted core. + if (!m_fileLoaded && m_paused != paused) { + m_paused = paused; + notifyPlaybackStateChanged(); + } +} + +bool PlayerController::mpvPauseRequestPending() const +{ + return m_pauseCommandState == QStringLiteral("queued") || m_pauseCommandState == QStringLiteral("reading") + || m_pauseCommandState == QStringLiteral("requeued"); } void PlayerController::sendMpvPauseRequest() diff --git a/src/player/PlayerController.h b/src/player/PlayerController.h index ea4d02a3..6f930812 100644 --- a/src/player/PlayerController.h +++ b/src/player/PlayerController.h @@ -194,7 +194,7 @@ class PlayerController final : public QObject { // Tell the transport that the host is fetching other network data. void setBackgroundNetwork(bool active); - Q_INVOKABLE void play(const Spool::PlaybackSession& session, bool startPaused = false); + Q_INVOKABLE void play(const Spool::PlaybackSession& session, bool startPaused = false, bool restartActive = false); void playLocalFiles(const QList& urls); bool appendLocalFiles(const QList& urls); bool localPlaylist() const @@ -351,7 +351,8 @@ class PlayerController final : public QObject { private: QHash m_mpvKeys; - void playSession(const PlaybackSession& session, bool startPaused, const QList& localFiles); + void playSession( + const PlaybackSession& session, bool startPaused, const QList& localFiles, bool restartActive); void finishPlaySession( const PlaybackSession& session, bool startPaused, const QList& localFiles, quint64 generation); void refreshLocalPlaylist(); @@ -398,6 +399,7 @@ class PlayerController final : public QObject { void synchronizeWindowFullscreen(mpv_handle *handle); void scheduleMpvTeardown(); void handleMpvEvent(mpv_event *event, quint64 generation, mpv_handle *handle); + bool mpvPauseRequestPending() const; void sendMpvPauseRequest(); void applyMpvPauseState(bool paused); template void postMpvEvent(quint64 generation, Callback callback) diff --git a/tests/player/PlayerControllerTest.cpp b/tests/player/PlayerControllerTest.cpp index 1a718336..201b6dd3 100644 --- a/tests/player/PlayerControllerTest.cpp +++ b/tests/player/PlayerControllerTest.cpp @@ -597,6 +597,11 @@ SPOOL_TEST_MAIN("player-controller") require(player.paused() && player.positionSeconds() < 0.2, "paused startup waits for explicit unpause"); player.setPaused(false); waitUntil([&] { return !player.paused() && player.positionSeconds() > 0.2; }, "explicit unpause advances playback"); + player.setPaused(true); + require(!player.paused(), "the current core has a pause request in flight before the restart"); + player.play(second, false, true); + waitUntil([&] { return player.fileLoaded(); }, "same-item renderer restart loads its replacement"); + require(player.paused(), "same-item renderer restart carries a pause that the previous core had not acknowledged"); player.stop(); player.teardownMpv(); watchedStopPolicy(directory.path(), window); From a78cdaf08847d76460a9e2c0d6e640c9d2e993da Mon Sep 17 00:00:00 2001 From: Sacha Korban Date: Fri, 27 Nov 2026 23:21:58 +1100 Subject: [PATCH 27/39] test(provider): wait for canceled discovery sockets to close --- tests/providers/ScriptRuntimeNetworkTest.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/tests/providers/ScriptRuntimeNetworkTest.cpp b/tests/providers/ScriptRuntimeNetworkTest.cpp index 762ff57c..21f2f42d 100644 --- a/tests/providers/ScriptRuntimeNetworkTest.cpp +++ b/tests/providers/ScriptRuntimeNetworkTest.cpp @@ -319,13 +319,14 @@ SPOOL_TEST_MAIN("script-runtime-network") int requests = 0; int dripActive = 0; int dripMaximum = 0; + QEventLoop *dripDrain = nullptr; std::function onDrip; QObject::connect(&server, &QTcpServer::newConnection, &app, [&] { while (auto *socket = server.nextPendingConnection()) { QObject::connect(socket, &QTcpSocket::disconnected, socket, &QObject::deleteLater); QObject::connect(socket, &QTcpSocket::disconnected, &app, [&, socket] { - if (socket->property("drip").toBool()) - --dripActive; + if (socket->property("drip").toBool() && --dripActive == 0 && dripDrain) + dripDrain->quit(); }); QObject::connect(socket, &QTcpSocket::readyRead, socket, [&, socket] { QByteArray request = socket->property("request").toByteArray() + socket->readAll(); @@ -498,9 +499,13 @@ SPOOL_TEST_MAIN("script-runtime-network") "wall deadline aborts incomplete drip feeds and retains unstarted targets for continuation"); require(dripMaximum == 4, "at most four local HTTP requests run concurrently"); const auto drained = [&] { - QEventLoop loop; - QTimer::singleShot(100, &loop, &QEventLoop::quit); - loop.exec(); + if (dripActive > 0) { + QEventLoop loop; + dripDrain = &loop; + QTimer::singleShot(5000, &loop, &QEventLoop::quit); + loop.exec(); + dripDrain = nullptr; + } require(dripActive == 0, "deadline and cancellation close every incomplete reply"); }; drained(); From b5dea54386748274345e2d1048610af1581b97f7 Mon Sep 17 00:00:00 2001 From: Sacha Korban Date: Sat, 28 Nov 2026 04:16:16 +1100 Subject: [PATCH 28/39] ci: document intentional Markdown backticks in release notes --- .github/workflows/release.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b0d17103..4ccbebc3 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -209,6 +209,7 @@ jobs: echo "Build and sign from source with your own Apple Account, or use your own tvOS re-signing setup. See [Apple TV build and signing directions](https://github.com/$REPO/tree/$TAG#apple-tv)." if compgen -G 'release-assets/*-iOS-arm64.ipa' >/dev/null; then echo + # shellcheck disable=SC2016 # Markdown code formatting. echo 'The iPhone/iPad IPA is **unsigned**, for sideloading: SideStore or AltStore re-sign it with your own free Apple ID. Add the source `https://spool-player.github.io/spool/altstore.json` once and updates arrive there. It is not distributed through the App Store or TestFlight; simulator startup does not certify device playback.' echo "See [installing on iPhone and iPad](https://github.com/$REPO/blob/$TAG/docs/install/ios.md)." fi From b52b94aa982bfa0eba43723f785fd60726b9265c Mon Sep 17 00:00:00 2001 From: Sacha Korban Date: Sat, 28 Nov 2026 04:16:40 +1100 Subject: [PATCH 29/39] ci: share toolchain pins and isolate platform dependency caches --- .github/actions/apple-build-tools/action.yml | 127 +++++++ .github/actions/install-nix/action.yml | 12 +- .github/workflows/build-artifacts.yml | 378 ++++++++----------- .github/workflows/ios-review.yml | 72 ++-- .github/workflows/tvos.yml | 137 +++++-- CMakeLists.txt | 4 +- build-ipk.sh | 4 +- flake.nix | 17 +- renovate.json | 15 +- tests/tools/PackageAuditTest.py | 11 +- tests/tools/ToolchainVersionsTest.py | 95 +++++ tools/android/build-apks.sh | 7 +- tools/android/build-dependencies.sh | 8 +- tools/android/build-qt6.sh | 19 +- tools/android/build-universal-apk.sh | 4 +- tools/apple/build-dependencies.sh | 209 +++++----- tools/apple/build-ios-scanner.sh | 9 +- tools/apple/build-qt-tvos.sh | 15 +- tools/apple/install-build-tools.sh | 26 ++ tools/build-ios.sh | 16 +- tools/build-tvos.sh | 14 +- tools/check-release-artifacts.sh | 5 +- tools/lib/manifest-sources.sh | 50 +-- tools/manifests/macos-tools.txt | 12 + tools/manifests/qt-android.json | 18 +- tools/manifests/qt-webos.json | 22 +- tools/manifests/qt-windows.json | 2 - tools/manifests/toolchain.json | 34 +- tools/toolchain-versions.py | 250 ++++++++++++ tools/toolchain-versions.sh | 65 +--- tools/webos-native/build-qcoro.sh | 3 +- tools/webos-native/build-qt6.sh | 55 +-- tools/webos-native/build-webos.sh | 6 +- tools/windows/common.ps1 | 5 +- tools/windows/install-qt.ps1 | 7 +- 35 files changed, 1081 insertions(+), 652 deletions(-) create mode 100644 .github/actions/apple-build-tools/action.yml create mode 100644 tests/tools/ToolchainVersionsTest.py create mode 100644 tools/apple/install-build-tools.sh create mode 100644 tools/manifests/macos-tools.txt create mode 100644 tools/toolchain-versions.py diff --git a/.github/actions/apple-build-tools/action.yml b/.github/actions/apple-build-tools/action.yml new file mode 100644 index 00000000..dd1e629b --- /dev/null +++ b/.github/actions/apple-build-tools/action.yml @@ -0,0 +1,127 @@ +name: Apple build tools and Qt kits +description: Install the host tools and exact Qt binary kits needed for an Apple SDK. +inputs: + sdk: + description: Xcode SDK to build against. + required: true + ios-kit: + description: Optional aqt iOS binary kit. + default: "" + cache-write: + description: Whether to save a cache in the current GitHub ref scope. + default: "false" +outputs: + sdk-key: + description: Xcode, compiler and SDK identity. + value: ${{ steps.pins.outputs.sdk_key }} + ios-kit-key: + description: iOS Qt binary kit fingerprint. + value: ${{ steps.pins.outputs.key_ios_kit }} + tvos-qt-key: + description: tvOS source Qt fingerprint. + value: ${{ steps.pins.outputs.key_tvos_qt }} + apple-deps-key: + description: Apple media prefix fingerprint. + value: ${{ steps.pins.outputs.key_apple_deps }} + ios-app-key: + description: iOS application build recipe fingerprint. + value: ${{ steps.pins.outputs.key_ios_app }} + tvos-app-key: + description: tvOS application build recipe fingerprint. + value: ${{ steps.pins.outputs.key_tvos_app }} + mpv-key: + description: mpv revision and build profile. + value: ${{ steps.pins.outputs.key_mpv }} + ios-deployment-target: + description: iOS deployment target. + value: ${{ steps.pins.outputs.ios_deployment_target }} + tvos-deployment-target: + description: tvOS deployment target. + value: ${{ steps.pins.outputs.tvos_deployment_target }} +runs: + using: composite + steps: + - name: Read Apple build pins and SDK identity + id: pins + shell: bash + env: + APPLE_SDK: ${{ inputs.sdk }} + IOS_KIT: ${{ inputs.ios-kit }} + run: | + bash tools/toolchain-versions.sh >>"$GITHUB_OUTPUT" + version="$(bash tools/toolchain-versions.sh qt.version)" + kits="$GITHUB_WORKSPACE/build/apple/host-qt" + echo "kits=$kits" >>"$GITHUB_OUTPUT" + echo "QT_HOST_PATH=$kits/$version/macos" >>"$GITHUB_ENV" + if [[ -n "$IOS_KIT" ]]; then + echo "QT_TARGET_PREFIX=$kits/$version/$IOS_KIT" >>"$GITHUB_ENV" + fi + identity="$( + xcodebuild -version + for sdk in "$APPLE_SDK" macosx; do + xcrun --sdk "$sdk" --show-sdk-build-version + xcrun --sdk "$sdk" --show-sdk-path + xcrun --sdk "$sdk" clang --version + done + )" + key="$(printf '%s\n' "$identity" | shasum -a 256)" + echo "sdk_key=${key:0:24}" >>"$GITHUB_OUTPUT" + - name: Install native build tools + shell: bash + run: bash tools/apple/install-build-tools.sh + - name: Restore macOS Qt host kit + id: host + uses: actions/cache/restore@caa296126883cff596d87d8935842f9db880ef25 # v5.0.3 + with: + path: ${{ steps.pins.outputs.kits }}/${{ steps.pins.outputs.qt_version }}/macos + key: apple-host-qt-${{ runner.arch }}-${{ steps.pins.outputs.key_apple_host }} + - name: Restore iOS target kit + if: inputs.ios-kit != '' + id: ios + uses: actions/cache/restore@caa296126883cff596d87d8935842f9db880ef25 # v5.0.3 + with: + path: ${{ steps.pins.outputs.kits }}/${{ steps.pins.outputs.qt_version }}/${{ inputs.ios-kit }} + key: apple-ios-kit-${{ runner.arch }}-${{ inputs.ios-kit }}-${{ steps.pins.outputs.key_ios_kit }} + - name: Install the pinned aqt release + if: steps.host.outputs.cache-hit != 'true' || (inputs.ios-kit != '' && steps.ios.outputs.cache-hit != 'true') + shell: bash + env: + AQT_VERSION: ${{ steps.pins.outputs.aqt_version }} + run: | + python3 -m venv "$RUNNER_TEMP/aqt" + "$RUNNER_TEMP/aqt/bin/pip" install "aqtinstall==$AQT_VERSION" + - name: Install macOS Qt host kit + if: steps.host.outputs.cache-hit != 'true' + shell: bash + env: + QT_VERSION: ${{ steps.pins.outputs.qt_version }} + QT_MODULES: ${{ steps.pins.outputs.apple_qt_modules }} + QT_KITS: ${{ steps.pins.outputs.kits }} + run: | + read -r -a modules <<<"$QT_MODULES" + "$RUNNER_TEMP/aqt/bin/aqt" install-qt mac desktop "$QT_VERSION" clang_64 \ + -O "$QT_KITS" -m "${modules[@]}" + - name: Install iOS Qt target kit + if: inputs.ios-kit != '' && steps.ios.outputs.cache-hit != 'true' + shell: bash + env: + QT_VERSION: ${{ steps.pins.outputs.qt_version }} + QT_MODULES: ${{ steps.pins.outputs.apple_qt_modules }} + QT_KITS: ${{ steps.pins.outputs.kits }} + IOS_KIT: ${{ inputs.ios-kit }} + run: | + read -r -a modules <<<"$QT_MODULES" + "$RUNNER_TEMP/aqt/bin/python" tools/apple/aqt-ios.py install-qt mac ios "$QT_VERSION" "$IOS_KIT" \ + -O "$QT_KITS" --archives qtbase qttools qtdeclarative qtsvg -m "${modules[@]}" + - name: Save macOS Qt host kit + if: inputs.cache-write == 'true' && steps.host.outputs.cache-hit != 'true' + uses: actions/cache/save@caa296126883cff596d87d8935842f9db880ef25 # v5.0.3 + with: + path: ${{ steps.pins.outputs.kits }}/${{ steps.pins.outputs.qt_version }}/macos + key: ${{ steps.host.outputs.cache-primary-key }} + - name: Save iOS Qt target kit + if: inputs.cache-write == 'true' && inputs.ios-kit != '' && steps.ios.outputs.cache-hit != 'true' + uses: actions/cache/save@caa296126883cff596d87d8935842f9db880ef25 # v5.0.3 + with: + path: ${{ steps.pins.outputs.kits }}/${{ steps.pins.outputs.qt_version }}/${{ inputs.ios-kit }} + key: ${{ steps.ios.outputs.cache-primary-key }} diff --git a/.github/actions/install-nix/action.yml b/.github/actions/install-nix/action.yml index 73020061..fd9756a7 100644 --- a/.github/actions/install-nix/action.yml +++ b/.github/actions/install-nix/action.yml @@ -15,11 +15,9 @@ runs: - name: Fetch Nix archive id: fetch shell: bash - env: - # Must match the nix-quick-install-action pin below and its default Nix. - RELEASE: v34 - NIX_VERSION: 2.29.2 run: | + release="$(bash tools/toolchain-versions.sh nix.quickInstallRelease)" + nix_version="$(bash tools/toolchain-versions.sh nix.version)" case "$RUNNER_ARCH" in X64) arch=x86_64 ;; ARM64) arch=aarch64 ;; @@ -31,13 +29,13 @@ runs: *) echo "::error::unsupported runner OS $RUNNER_OS"; exit 1 ;; esac dir="$RUNNER_TEMP/nix-archives" - name="nix-$NIX_VERSION-$arch-$os.tar.zstd" - url="https://github.com/nixbuild/nix-quick-install-action/releases/download/$RELEASE/$name" + name="nix-$nix_version-$arch-$os.tar.zstd" + url="https://github.com/nixbuild/nix-quick-install-action/releases/download/$release/$name" mkdir -p "$dir" for attempt in 1 2 3 4 5; do if curl -fsSL --retry 3 --retry-all-errors -o "$dir/$name" "$url" && zstd -tq "$dir/$name"; then echo "archives-url=file://$dir" >>"$GITHUB_OUTPUT" - echo "nix-version=$NIX_VERSION" >>"$GITHUB_OUTPUT" + echo "nix-version=$nix_version" >>"$GITHUB_OUTPUT" exit 0 fi echo "::warning::Nix archive fetch attempt $attempt failed" diff --git a/.github/workflows/build-artifacts.yml b/.github/workflows/build-artifacts.yml index c4033951..89a5bd41 100644 --- a/.github/workflows/build-artifacts.yml +++ b/.github/workflows/build-artifacts.yml @@ -148,15 +148,40 @@ jobs: outputs: qt_version: ${{ steps.versions.outputs.qt_version }} qt_series: ${{ steps.versions.outputs.qt_series }} + qt_build_tag: ${{ steps.versions.outputs.qt_build_tag }} qt_windows_kit: ${{ steps.versions.outputs.qt_windows_kit }} ffmpeg_version: ${{ steps.versions.outputs.ffmpeg_version }} qcoro_revision: ${{ steps.versions.outputs.qcoro_revision }} qcoro_windows_prefix: ${{ steps.versions.outputs.qcoro_windows_prefix }} + ios_deployment_target: ${{ steps.versions.outputs.ios_deployment_target }} + tvos_deployment_target: ${{ steps.versions.outputs.tvos_deployment_target }} + apple_qt_modules: ${{ steps.versions.outputs.apple_qt_modules }} + aqt_version: ${{ steps.versions.outputs.aqt_version }} + android_build_tools: ${{ steps.versions.outputs.android_build_tools }} + nix_version: ${{ steps.versions.outputs.nix_version }} + key_qt: ${{ steps.versions.outputs.key_qt }} + key_mpv: ${{ steps.versions.outputs.key_mpv }} + key_streaming: ${{ steps.versions.outputs.key_streaming }} + key_ffmpeg: ${{ steps.versions.outputs.key_ffmpeg }} + key_native_shell: ${{ steps.versions.outputs.key_native_shell }} + key_linux_build: ${{ steps.versions.outputs.key_linux_build }} + key_macos_build: ${{ steps.versions.outputs.key_macos_build }} + key_apple_host: ${{ steps.versions.outputs.key_apple_host }} + key_ios_kit: ${{ steps.versions.outputs.key_ios_kit }} + key_tvos_qt: ${{ steps.versions.outputs.key_tvos_qt }} + key_apple_deps: ${{ steps.versions.outputs.key_apple_deps }} + key_ios_app: ${{ steps.versions.outputs.key_ios_app }} + key_tvos_app: ${{ steps.versions.outputs.key_tvos_app }} + key_android_qt: ${{ steps.versions.outputs.key_android_qt }} + key_android_deps: ${{ steps.versions.outputs.key_android_deps }} + key_webos_deps: ${{ steps.versions.outputs.key_webos_deps }} + key_webos_build: ${{ steps.versions.outputs.key_webos_build }} + key_windows_qt: ${{ steps.versions.outputs.key_windows_qt }} steps: - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.0.2 with: persist-credentials: false - - name: Read the pinned Qt and FFmpeg versions + - name: Read version pins and cache fingerprints id: versions run: | bash tools/toolchain-versions.sh --check @@ -246,7 +271,7 @@ jobs: name: Linux real decoder and package consumer ASan/UBSan runs-on: ubuntu-24.04 timeout-minutes: 120 - needs: lint + needs: [lint, toolchain] if: ${{ github.event_name != 'workflow_dispatch' || inputs.build_linux }} steps: - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.0.2 @@ -259,7 +284,7 @@ jobs: experimental-features = nix-command flakes - uses: nix-community/cache-nix-action@7df957e333c1e5da7721f60227dbba6d06080569 # v7.0.1 with: - primary-key: nix-native-shell-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('flake.nix', 'flake.lock', 'tools/manifests/toolchain.json', 'tools/manifests/ffmpeg-capabilities.json', 'tools/manifests/streaming-third-party.json', 'tools/patches/**', 'tools/webos-native/patches/qtdeclarative-*-qmlimportscanner-exclude-subtrees.patch') }} + primary-key: nix-native-shell-${{ runner.os }}-${{ runner.arch }}-${{ needs.toolchain.outputs.key_native_shell }} restore-prefixes-first-match: nix-native-shell-${{ runner.os }}-${{ runner.arch }}- gc-max-store-size: 5G save: ${{ env.SPOOL_CACHE_WRITE == 'true' && !inputs.release }} @@ -308,7 +333,7 @@ jobs: linux-packages: name: Linux packages runs-on: ubuntu-24.04 - needs: lint + needs: [lint, toolchain] if: ${{ github.event_name != 'workflow_dispatch' || inputs.build_linux }} steps: - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.0.2 @@ -322,7 +347,7 @@ jobs: experimental-features = nix-command flakes - uses: nix-community/cache-nix-action@7df957e333c1e5da7721f60227dbba6d06080569 # v7.0.1 with: - primary-key: nix-native-shell-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('flake.nix', 'flake.lock', 'tools/manifests/toolchain.json', 'tools/manifests/ffmpeg-capabilities.json', 'tools/manifests/streaming-third-party.json', 'tools/patches/**', 'tools/webos-native/patches/qtdeclarative-*-qmlimportscanner-exclude-subtrees.patch') }} + primary-key: nix-native-shell-${{ runner.os }}-${{ runner.arch }}-${{ needs.toolchain.outputs.key_native_shell }} restore-prefixes-first-match: nix-native-shell-${{ runner.os }}-${{ runner.arch }}- gc-max-store-size: 5G save: ${{ env.SPOOL_CACHE_WRITE == 'true' && !inputs.release }} @@ -347,9 +372,6 @@ jobs: if [[ -n "$CACHIX_AUTH_TOKEN" ]]; then cachix push spool "$RUNNER_TEMP/spool-native-qt" fi - - name: Read mpv revision - id: mpv-revision - run: echo "revision=$(git rev-parse HEAD:mpv)" >>"$GITHUB_OUTPUT" - uses: actions/cache/restore@caa296126883cff596d87d8935842f9db880ef25 # v5.0.3 id: linux-build-cache with: @@ -358,7 +380,7 @@ jobs: build/linux-release/mpv-prefix build/linux-release/app .ccache - key: linux-build-${{ runner.arch }}-${{ steps.mpv-revision.outputs.revision }}-${{ hashFiles('flake.nix', 'flake.lock', 'tools/manifests/toolchain.json', 'tools/manifests/mpv-native.json', 'tools/build-linux-release.sh', 'tools/lib/build-common.sh') }} + key: linux-build-${{ runner.arch }}-${{ needs.toolchain.outputs.key_linux_build }} # The default dev shell has no Qt on purpose (it is the hermetic Qt-source # build shell). The native app build needs nixpkgs Qt, so use .#native. @@ -565,7 +587,7 @@ jobs: macos-dmg: name: macOS DMG (${{ matrix.arch }}) runs-on: ${{ matrix.runner }} - needs: lint + needs: [lint, toolchain] # Public repositories receive unlimited standard GitHub-hosted runner # minutes, so pushes, pull requests, and releases exercise macOS too. if: ${{ github.event_name != 'workflow_dispatch' || inputs.build_macos }} @@ -606,7 +628,7 @@ jobs: - uses: nix-community/cache-nix-action@7df957e333c1e5da7721f60227dbba6d06080569 # v7.0.1 with: - primary-key: nix-native-shell-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('flake.nix', 'flake.lock', 'tools/manifests/toolchain.json', 'tools/manifests/ffmpeg-capabilities.json', 'tools/manifests/streaming-third-party.json', 'tools/patches/**', 'tools/webos-native/patches/qtdeclarative-*-qmlimportscanner-exclude-subtrees.patch') }} + primary-key: nix-native-shell-${{ runner.os }}-${{ runner.arch }}-${{ needs.toolchain.outputs.key_native_shell }} restore-prefixes-first-match: nix-native-shell-${{ runner.os }}-${{ runner.arch }}- gc-max-store-size: 5G save: ${{ env.SPOOL_CACHE_WRITE == 'true' && !inputs.release }} @@ -634,9 +656,6 @@ jobs: if [[ -n "$CACHIX_AUTH_TOKEN" ]]; then cachix push spool "$RUNNER_TEMP/spool-native-qt" fi - - name: Read mpv revision - id: mpv-revision - run: echo "revision=$(git rev-parse HEAD:mpv)" >>"$GITHUB_OUTPUT" - uses: actions/cache/restore@caa296126883cff596d87d8935842f9db880ef25 # v5.0.3 id: macos-build-cache with: @@ -645,7 +664,7 @@ jobs: build/macos/mpv-prefix build/macos/app .ccache - key: macos-build-${{ matrix.arch }}-${{ steps.mpv-revision.outputs.revision }}-${{ hashFiles('flake.nix', 'flake.lock', 'tools/manifests/toolchain.json', 'tools/manifests/mpv-native.json', 'tools/build-macos.sh', 'tools/lib/build-common.sh') }} + key: macos-build-${{ matrix.arch }}-${{ needs.toolchain.outputs.key_macos_build }} # Older Nix releases reject the relative path input recorded by newer # lock files when the root flake comes from a shallow Git checkout. @@ -839,131 +858,19 @@ jobs: release: ${{ inputs.release || false }} tvos: - name: tvOS (${{ matrix.sdk }} arm64) - runs-on: macos-15 - timeout-minutes: 240 needs: [lint, toolchain] if: ${{ github.event_name != 'workflow_dispatch' || inputs.build_tvos }} - strategy: - fail-fast: false - matrix: - sdk: [appletvos, appletvsimulator] - env: - APPLE_SDK: ${{ matrix.sdk }} - APPLE_ARCH: arm64 - APPLE_DEPLOYMENT_TARGET: "16.0" - CODE_SIGNING_ALLOWED: "NO" - JOBS: "3" - BUILD_JOBS: "3" - steps: - - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.0.2 - with: - persist-credentials: false - submodules: recursive - - name: Install native source-build tools - run: brew install cmake ninja meson pkg-config bash python imagemagick gpatch ffmpeg tesseract - - name: Identify the exact Apple source toolchain - id: apple-toolchain - run: | - set -euo pipefail - # No prefix restore: patched source trees and configured cross-builds - # must never survive a source, SDK, compiler, or toolchain change. - identity="$( - { - xcodebuild -version - xcrun --sdk "$APPLE_SDK" --show-sdk-build-version - xcrun --sdk "$APPLE_SDK" --show-sdk-path - xcrun --sdk "$APPLE_SDK" clang --version - brew list --versions - git -C mpv rev-parse HEAD - } | shasum -a 256 - )" - echo "key=${identity%% *}" >>"$GITHUB_OUTPUT" - echo "QT_HOST_PATH=$GITHUB_WORKSPACE/build/apple/host-qt/${{ needs.toolchain.outputs.qt_version }}/macos" >>"$GITHUB_ENV" - - uses: actions/cache/restore@caa296126883cff596d87d8935842f9db880ef25 # v5.0.3 - id: tvos-source-cache - with: - path: | - build/apple/host-qt - build/apple/qmlimportscanner - build/apple/downloads - build/apple/qt-sources - build/apple/sources - build/apple/qt-${{ matrix.sdk }}-arm64 - build/apple/${{ matrix.sdk }}-arm64 - build/downloads - key: tvos-source1-${{ runner.os }}-${{ runner.arch }}-${{ matrix.sdk }}-16.0-${{ steps.apple-toolchain.outputs.key }}-${{ hashFiles('tools/manifests/streaming-third-party.json', 'tools/prepare-streaming-sources.sh', 'tools/streaming-fingerprint.py', 'tools/check-streaming-dependencies.py', 'tools/cmake/StreamingDependencies.cmake', 'tools/cmake/QuicBatchingProbe/CMakeLists.txt', 'tools/lib/streaming-build.sh', 'tools/patches/curl-*.patch', 'tools/windows/build-streaming-dependencies.ps1', 'tools/manifests/toolchain.json', 'tools/manifests/android-third-party.json', 'tools/manifests/ffmpeg-capabilities.json', 'tools/apple/**', 'tools/build-tvos.sh', 'tools/ffmpeg-capabilities.py', 'tools/lib/manifest-sources.sh', 'tools/webos-native/patches/qtdeclarative-*-qmlimportscanner-exclude-subtrees.patch', 'third_party/**', 'mpv/meson.build', 'mpv/meson.options') }} - - name: Install matching macOS Qt host tools - if: ${{ steps.tvos-source-cache.outputs.cache-hit != 'true' }} - env: - QT_VERSION: ${{ needs.toolchain.outputs.qt_version }} - run: | - python3 -m venv "$RUNNER_TEMP/aqt" - "$RUNNER_TEMP/aqt/bin/pip" install aqtinstall - "$RUNNER_TEMP/aqt/bin/aqt" install-qt mac desktop "$QT_VERSION" clang_64 \ - -O "$GITHUB_WORKSPACE/build/apple/host-qt" \ - -m qtshadertools qttasktree qtwebsockets qtimageformats - - name: Build actual source Qt, media closure, and tvOS app - run: bash tools/build-tvos.sh - - name: Build native host controller for tvOS application journeys - if: matrix.sdk == 'appletvsimulator' - run: | - cmake -S tests/e2e/host -B build/apple/device-journey-host -G Ninja \ - -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="$QT_HOST_PATH" - cmake --build build/apple/device-journey-host - - - name: Run tvOS traditional and real GPU GUI e2e tests - if: matrix.sdk == 'appletvsimulator' - env: - SPOOL_DEVICE_HOST_BUILD_DIR: build/apple/device-journey-host - run: bash tools/apple/smoke-tvos.sh build/tvos/appletvsimulator-arm64/install/Spool.app - - - name: Package artifact-audited unsigned device IPA (no device runtime claim) - if: ${{ matrix.sdk == 'appletvos' }} - run: bash tools/package-tvos.sh build/tvos/appletvos-arm64/install/Spool.app dist/tvos - - name: Upload only the device release package - if: ${{ matrix.sdk == 'appletvos' }} - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.0 - with: - name: spool-tvos-device-arm64 - path: dist/tvos/Spool-*-tvOS-arm64.ipa - if-no-files-found: error - retention-days: ${{ inputs.release && 1 || 7 }} - - name: Archive simulator build without losing executable permissions - if: ${{ matrix.sdk == 'appletvsimulator' }} - run: | - tar -czf "$RUNNER_TEMP/tvos-simulator-arm64.tar.gz" \ - -C build/tvos/appletvsimulator-arm64 install - - name: Keep simulator artifacts internal - if: ${{ always() && matrix.sdk == 'appletvsimulator' }} - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.0 - with: - name: internal-tvos-simulator-arm64 - path: | - ${{ runner.temp }}/tvos-simulator-arm64.tar.gz - build/tvos/smoke/safe-export - build/tvos/smoke/launch-result.json - retention-days: ${{ inputs.release && 1 || 7 }} - - name: Save coherent Apple dependency cache - if: ${{ env.SPOOL_CACHE_WRITE == 'true' && !inputs.release && steps.tvos-source-cache.outputs.cache-hit != 'true' }} - uses: actions/cache/save@caa296126883cff596d87d8935842f9db880ef25 # v5.0.3 - with: - path: | - build/apple/host-qt - build/apple/qmlimportscanner - build/apple/downloads - build/apple/qt-sources - build/apple/sources - build/apple/qt-${{ matrix.sdk }}-arm64 - build/apple/${{ matrix.sdk }}-arm64 - build/downloads - key: ${{ steps.tvos-source-cache.outputs.cache-primary-key }} + uses: ./.github/workflows/tvos.yml + with: + release: ${{ inputs.release || false }} webos-ipk: name: webOS IPK runs-on: ubuntu-24.04 - needs: lint + needs: [lint, toolchain] if: ${{ github.event_name != 'workflow_dispatch' || inputs.build_webos }} + env: + WEBOS_TOOLCHAIN_OVERRIDE: ${{ inputs.webos_toolchain_archive_url || vars.WEBOS_TOOLCHAIN_ARCHIVE_URL }} steps: - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.0.2 with: @@ -985,63 +892,70 @@ jobs: purge-prefixes: nix-${{ runner.os }}- purge-created: P7D purge-primary-key: never - - uses: actions/cache/restore@caa296126883cff596d87d8935842f9db880ef25 # v5.0.3 - id: webos-cache + - name: Resolve the webOS Qt source shell identity + id: webos-shell + run: | + derivation="$(nix eval --raw .#devShells.x86_64-linux.qt-source.drvPath)" + echo "key=$(printf '%s' "$derivation" | sha256sum | cut -c1-24)" >>"$GITHUB_OUTPUT" + + - name: Restore the verified webOS SDK and dependency prefixes + if: env.WEBOS_TOOLCHAIN_OVERRIDE == '' + id: webos-deps + uses: actions/cache/restore@caa296126883cff596d87d8935842f9db880ef25 # v5.0.3 with: path: | build/webos-sdk - build/qt6-612-host-install - build/qt6-612-target-static-install - build/qt6-612-target-install + build/qt6-${{ needs.toolchain.outputs.qt_build_tag }}-host-install + build/qt6-${{ needs.toolchain.outputs.qt_build_tag }}-target-static-install build/webos-thirdparty-build build/webos-qcoro build/third_party - .ccache - mpv/build/webos-libmpv - key: webos3-${{ runner.os }}-${{ hashFiles('tools/manifests/streaming-third-party.json', 'tools/prepare-streaming-sources.sh', 'tools/streaming-fingerprint.py', 'tools/check-streaming-dependencies.py', 'tools/cmake/StreamingDependencies.cmake', 'tools/cmake/QuicBatchingProbe/CMakeLists.txt', 'tools/lib/streaming-build.sh', 'tools/patches/curl-*.patch', 'tools/windows/build-streaming-dependencies.ps1', 'flake.nix', 'flake.lock', 'mpv/meson.build', 'build-ipk.sh', 'tools/package-audit.py', 'tools/lib/*.sh', 'tools/manifests/ffmpeg-capabilities.json', 'tools/manifests/toolchain.json', 'tools/manifests/mpv-native.json', 'tools/manifests/qt-webos.json', 'tools/manifests/webos-third-party.json', 'tools/webos-native/**') }} - restore-keys: | - webos3-${{ runner.os }}- - webos2-${{ runner.os }}- + key: webos-deps-${{ runner.arch }}-${{ steps.webos-shell.outputs.key }}-${{ needs.toolchain.outputs.key_webos_deps }} - - name: Restore webOS toolchain archive + - name: Restore optional webOS toolchain archive + if: env.WEBOS_TOOLCHAIN_OVERRIDE != '' env: - INPUT_URL: ${{ inputs.webos_toolchain_archive_url || '' }} - VAR_URL: ${{ vars.WEBOS_TOOLCHAIN_ARCHIVE_URL }} - run: | - if [ -n "${INPUT_URL:-$VAR_URL}" ]; then - export WEBOS_TOOLCHAIN_ARCHIVE_URL="${INPUT_URL:-$VAR_URL}" - fi - nix develop -c bash tools/webos-native/restore-toolchain.sh - test -x build/webos-sdk/arm-webos-linux-gnueabi_sdk-buildroot/bin/arm-webos-linux-gnueabi-gcc + WEBOS_TOOLCHAIN_ARCHIVE_URL: ${{ env.WEBOS_TOOLCHAIN_OVERRIDE }} + run: nix develop .#qt-source -c bash tools/webos-native/restore-toolchain.sh - # build-webos.sh uses the default dev shell on purpose: the webOS target - # links the cross-built static Qt, and that build must not see nixpkgs Qt. - - name: Build webOS dependencies - if: ${{ steps.webos-cache.outputs.cache-hit != 'true' }} - run: | - for phase in fetch qt-host qt-target dependencies; do - nix develop -c bash tools/webos-native/build-webos.sh "$phase" - done + - name: Restore webOS mpv and app builds + if: env.WEBOS_TOOLCHAIN_OVERRIDE == '' + id: webos-build + uses: actions/cache/restore@caa296126883cff596d87d8935842f9db880ef25 # v5.0.3 + with: + path: | + mpv/build/webos-libmpv + build/webos/app + .ccache + key: webos-build-${{ steps.webos-deps.outputs.cache-primary-key }}-${{ needs.toolchain.outputs.key_webos_build }} + + - name: Build IPK + env: + SPOOL_WEBOS_DEPENDENCIES_READY: ${{ steps.webos-deps.outputs.cache-hit == 'true' && '1' || '0' }} + run: nix develop .#qt-source --profile "$RUNNER_TEMP/webos-shell" -c bash ./build-ipk.sh - # Tags and PR merge refs restore without creating duplicate cache copies. - name: Save webOS dependency cache - if: ${{ env.SPOOL_CACHE_WRITE == 'true' && steps.webos-cache.outputs.cache-hit != 'true' && !inputs.release }} + if: ${{ env.SPOOL_CACHE_WRITE == 'true' && !inputs.release && env.WEBOS_TOOLCHAIN_OVERRIDE == '' && steps.webos-deps.outputs.cache-hit != 'true' }} uses: actions/cache/save@caa296126883cff596d87d8935842f9db880ef25 # v5.0.3 with: path: | build/webos-sdk - build/qt6-612-host-install - build/qt6-612-target-static-install - build/qt6-612-target-install + build/qt6-${{ needs.toolchain.outputs.qt_build_tag }}-host-install + build/qt6-${{ needs.toolchain.outputs.qt_build_tag }}-target-static-install build/webos-thirdparty-build build/webos-qcoro build/third_party - .ccache - mpv/build/webos-libmpv - key: ${{ steps.webos-cache.outputs.cache-primary-key }} + key: ${{ steps.webos-deps.outputs.cache-primary-key }} - - name: Build IPK - run: ./build-ipk.sh + - name: Save webOS mpv and app builds + if: ${{ env.SPOOL_CACHE_WRITE == 'true' && !inputs.release && env.WEBOS_TOOLCHAIN_OVERRIDE == '' && steps.webos-build.outputs.cache-hit != 'true' }} + uses: actions/cache/save@caa296126883cff596d87d8935842f9db880ef25 # v5.0.3 + with: + path: | + mpv/build/webos-libmpv + build/webos/app + .ccache + key: ${{ steps.webos-build.outputs.cache-primary-key }} - name: Validate IPK shell: nix develop -c bash -euo pipefail {0} @@ -1144,7 +1058,7 @@ jobs: fail-fast: false matrix: abi: [arm64-v8a, armeabi-v7a, x86_64] - needs: lint + needs: [lint, toolchain] if: ${{ github.event_name != 'workflow_dispatch' || inputs.build_android }} steps: - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.0.2 @@ -1196,34 +1110,53 @@ jobs: id: cache-inputs run: | set -euo pipefail - echo "mpv=$(git rev-parse HEAD:mpv)" >>"$GITHUB_OUTPUT" # shellcheck disable=SC2016 - toolchain="$(nix develop .#android -c sh -c \ + toolchain="$(nix develop "$RUNNER_TEMP/android-shell" -c sh -c \ 'printf "%s\n%s\n" "$ANDROID_NDK_ROOT" "$SPOOL_ANDROID_QT_HOST"')" - printf 'toolchain inputs:\n%s\n' "$toolchain" - echo "toolchain=$(printf '%s' "$toolchain" | sha256sum | cut -c1-16)" \ + echo "toolchain=$(printf '%s' "$toolchain" | sha256sum | cut -c1-24)" \ >>"$GITHUB_OUTPUT" - - uses: actions/cache/restore@caa296126883cff596d87d8935842f9db880ef25 # v5.0.3 + - name: Restore Android media dependencies id: android-cache + uses: actions/cache/restore@caa296126883cff596d87d8935842f9db880ef25 # v5.0.3 with: - path: | - build/android/qt - build/android/deps - build/android/qcoro - key: android6-${{ matrix.abi }}-${{ runner.os }}-${{ steps.cache-inputs.outputs.mpv }}-${{ steps.cache-inputs.outputs.toolchain }}-${{ hashFiles('tools/manifests/streaming-third-party.json', 'tools/prepare-streaming-sources.sh', 'tools/streaming-fingerprint.py', 'tools/check-streaming-dependencies.py', 'tools/cmake/StreamingDependencies.cmake', 'tools/cmake/QuicBatchingProbe/CMakeLists.txt', 'tools/lib/streaming-build.sh', 'tools/patches/curl-*.patch', 'tools/windows/build-streaming-dependencies.ps1', 'tools/android/build-dependencies.sh', 'tools/android/build-qt6.sh', 'tools/android/gradle-mirror.sh', 'tools/android/patches/*.patch', 'tools/ffmpeg-capabilities.py', 'tools/lib/build-common.sh', 'tools/lib/manifest-sources.sh', 'tools/manifests/android-third-party.json', 'tools/manifests/ffmpeg-capabilities.json', 'tools/manifests/toolchain.json', 'tools/manifests/qt-android.json') }} + path: build/android/deps/${{ matrix.abi }} + key: android6-deps-${{ matrix.abi }}-${{ steps.cache-inputs.outputs.toolchain }}-${{ needs.toolchain.outputs.key_android_deps }}-${{ needs.toolchain.outputs.key_mpv }} + + - name: Restore Android target Qt + id: android-qt + uses: actions/cache/restore@caa296126883cff596d87d8935842f9db880ef25 # v5.0.3 + with: + path: build/android/qt + key: android-qt-${{ matrix.abi }}-${{ steps.cache-inputs.outputs.toolchain }}-${{ needs.toolchain.outputs.key_android_qt }} - - name: Build cached Android toolchains + - name: Build Android media dependencies if: ${{ steps.android-cache.outputs.cache-hit != 'true' }} - run: | - nix develop .#android -c env \ - ANDROID_ABI="${{ matrix.abi }}" \ - QT_ANDROID_MEMORY_PER_JOB_MIB=2500 \ - ANDROID_DEPS_MEMORY_PER_JOB_MIB=2500 \ - bash -c ' - bash tools/android/build-dependencies.sh all - bash tools/android/build-qt6.sh all - ' + env: + ANDROID_ABI: ${{ matrix.abi }} + ANDROID_DEPS_MEMORY_PER_JOB_MIB: 2500 + run: nix develop "$RUNNER_TEMP/android-shell" -c bash tools/android/build-dependencies.sh all + + - name: Build Android Qt + if: ${{ steps.android-qt.outputs.cache-hit != 'true' }} + env: + ANDROID_ABI: ${{ matrix.abi }} + QT_ANDROID_MEMORY_PER_JOB_MIB: 2500 + run: nix develop "$RUNNER_TEMP/android-shell" -c bash tools/android/build-qt6.sh all + + - name: Save Android media dependencies + if: ${{ env.SPOOL_CACHE_WRITE == 'true' && !inputs.release && steps.android-cache.outputs.cache-hit != 'true' }} + uses: actions/cache/save@caa296126883cff596d87d8935842f9db880ef25 # v5.0.3 + with: + path: build/android/deps/${{ matrix.abi }} + key: ${{ steps.android-cache.outputs.cache-primary-key }} + + - name: Save Android target Qt + if: ${{ env.SPOOL_CACHE_WRITE == 'true' && !inputs.release && steps.android-qt.outputs.cache-hit != 'true' }} + uses: actions/cache/save@caa296126883cff596d87d8935842f9db880ef25 # v5.0.3 + with: + path: build/android/qt + key: ${{ steps.android-qt.outputs.cache-primary-key }} - name: Prepare Android release keystore if: ${{ env.SPOOL_TRUSTED_BUILD == 'true' && inputs.release }} @@ -1243,7 +1176,7 @@ jobs: SPOOL_ANDROID_KEYSTORE_KEY_PASS: ${{ env.SPOOL_TRUSTED_BUILD == 'true' && inputs.release && secrets.ANDROID_RELEASE_KEY_PASSWORD || '' }} ANDROID_ABI: ${{ matrix.abi }} SPOOL_ANDROID_BUILD_TESTS: ${{ matrix.abi == 'x86_64' && 'ON' || 'OFF' }} - run: nix develop .#android -c bash tools/android/build-apks.sh + run: nix develop "$RUNNER_TEMP/android-shell" -c bash tools/android/build-apks.sh - name: Verify native libraries stay compressed env: @@ -1269,28 +1202,18 @@ jobs: - name: Verify Android release signing identity if: ${{ env.SPOOL_TRUSTED_BUILD == 'true' && inputs.release }} env: + SPOOL_ANDROID_BUILD_TOOLS: ${{ needs.toolchain.outputs.android_build_tools }} EXPECTED_CERT_SHA256: 0c9deff0513eed6d43521df31ad6d2d8e928c029b146d902f4bcc25a883c1fb8 run: | set -euo pipefail - nix develop .#android -c bash -c " + nix develop "$RUNNER_TEMP/android-shell" -c bash -c " for apk in dist/android/*.apk; do - output=\"\$(\"\$ANDROID_HOME/build-tools/36.0.0/apksigner\" verify --verbose --print-certs \"\$apk\")\" + output=\"\$(\"\$ANDROID_HOME/build-tools/\$SPOOL_ANDROID_BUILD_TOOLS/apksigner\" verify --verbose --print-certs \"\$apk\")\" printf '%s\n' \"\$output\" grep -Fq \"Signer #1 certificate SHA-256 digest: \$EXPECTED_CERT_SHA256\" <<<\"\$output\" done " - - name: Save Android toolchain cache - if: ${{ env.SPOOL_CACHE_WRITE == 'true' && steps.android-cache.outputs.cache-hit != 'true' && !inputs.release }} - uses: actions/cache/save@caa296126883cff596d87d8935842f9db880ef25 # v5.0.3 - with: - path: | - build/android/qt - build/android/deps - build/android/qcoro - key: ${{ steps.android-cache.outputs.cache-primary-key }} - - - name: Build native host controller for Android application journeys if: matrix.abi == 'x86_64' run: | @@ -1305,13 +1228,13 @@ jobs: if: matrix.abi == 'x86_64' env: SPOOL_ANDROID_FORM_FACTOR: phone - run: nix develop .#android -c bash tools/android/emulator-launch-test.sh + run: nix develop "$RUNNER_TEMP/android-shell" -c bash tools/android/emulator-launch-test.sh - name: Run Android TV traditional and real GPU GUI e2e tests if: ${{ !cancelled() && matrix.abi == 'x86_64' && (steps.android-phone-tests.outcome == 'success' || steps.android-phone-tests.outcome == 'failure') }} env: SPOOL_ANDROID_FORM_FACTOR: tv - run: nix develop .#android -c bash tools/android/emulator-launch-test.sh + run: nix develop "$RUNNER_TEMP/android-shell" -c bash tools/android/emulator-launch-test.sh - name: Upload Android native test diagnostics on failure if: ${{ matrix.abi == 'x86_64' && failure() }} @@ -1354,7 +1277,7 @@ jobs: timeout-minutes: 60 # Every ABI leg reports under this one job name, so this waits for all of # them and then packages the two that a real device can run. - needs: android-apks + needs: [android-apks, toolchain] if: ${{ github.event_name != 'workflow_dispatch' || inputs.build_android }} steps: - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.0.2 @@ -1420,11 +1343,12 @@ jobs: - name: Verify Android release signing identity if: ${{ env.SPOOL_TRUSTED_BUILD == 'true' && inputs.release }} env: + SPOOL_ANDROID_BUILD_TOOLS: ${{ needs.toolchain.outputs.android_build_tools }} EXPECTED_CERT_SHA256: 0c9deff0513eed6d43521df31ad6d2d8e928c029b146d902f4bcc25a883c1fb8 run: | set -euo pipefail nix develop .#android-packaging -c bash -c " - output=\"\$(\"\$ANDROID_HOME/build-tools/36.0.0/apksigner\" verify --verbose --print-certs dist/android/spool-universal.apk)\" + output=\"\$(\"\$ANDROID_HOME/build-tools/\$SPOOL_ANDROID_BUILD_TOOLS/apksigner\" verify --verbose --print-certs dist/android/spool-universal.apk)\" printf '%s\n' \"\$output\" grep -Fq \"Signer #1 certificate SHA-256 digest: \$EXPECTED_CERT_SHA256\" <<<\"\$output\" " @@ -1493,7 +1417,7 @@ jobs: path: | C:\Qt\${{ needs.toolchain.outputs.qt_version }}\${{ needs.toolchain.outputs.qt_windows_kit }} C:\Qt\${{ needs.toolchain.outputs.qcoro_windows_prefix }} - key: windows-qt-${{ needs.toolchain.outputs.qt_version }}-qcoro-${{ needs.toolchain.outputs.qcoro_revision }}-${{ hashFiles('tools/manifests/qt-windows.json') }} + key: windows-qt-${{ needs.toolchain.outputs.key_windows_qt }} - name: Install Qt from pinned official archives if: steps.qt-cache.outputs.cache-hit != 'true' @@ -1512,20 +1436,27 @@ jobs: path: | C:\Qt\${{ needs.toolchain.outputs.qt_version }}\${{ needs.toolchain.outputs.qt_windows_kit }} C:\Qt\${{ needs.toolchain.outputs.qcoro_windows_prefix }} - key: windows-qt-${{ needs.toolchain.outputs.qt_version }}-qcoro-${{ needs.toolchain.outputs.qcoro_revision }}-${{ hashFiles('tools/manifests/qt-windows.json') }} + key: ${{ steps.qt-cache.outputs.cache-primary-key }} - - name: Read mpv revision - id: mpv-revision + - name: Identify the Windows native build tools + id: windows-tools shell: pwsh + env: + MSYS2_LOCATION: ${{ steps.msys2.outputs.msys2-location }} run: | - "revision=$(git -C mpv rev-parse HEAD)" >> $env:GITHUB_OUTPUT + . tools\windows\common.ps1 + Initialize-WindowsMpvBuildEnvironment + $version = (Get-Item -LiteralPath (Get-Command cl.exe).Source).VersionInfo + $compiler = @($version.FileMajorPart, $version.FileMinorPart, $version.FileBuildPart, $version.FilePrivatePart) -join '.' + "msvc=$compiler" >> $env:GITHUB_OUTPUT + "mpv=$(Get-MpvSourceRevision)" >> $env:GITHUB_OUTPUT - name: Restore source-built libmpv id: mpv-cache uses: actions/cache/restore@caa296126883cff596d87d8935842f9db880ef25 # v5.0.3 with: path: build/windows-deps/mpv - key: windows-mpv-${{ runner.os }}-${{ steps.mpv-revision.outputs.revision }}-${{ hashFiles('tools/manifests/streaming-third-party.json', 'tools/prepare-streaming-sources.sh', 'tools/streaming-fingerprint.py', 'tools/check-streaming-dependencies.py', 'tools/cmake/StreamingDependencies.cmake', 'tools/cmake/QuicBatchingProbe/CMakeLists.txt', 'tools/lib/streaming-build.sh', 'tools/patches/curl-*.patch', 'tools/windows/build-streaming-dependencies.ps1', 'tools/windows/build-mpv.ps1', 'tools/windows/build-ffmpeg.ps1', 'tools/windows/build-ffmpeg.sh', 'tools/windows/check-ffmpeg.py', 'tools/windows/build-shader-tools.ps1', 'tools/windows/common.ps1', 'tools/manifests/mpv-native.json', 'tools/manifests/ffmpeg-capabilities.json', 'tools/manifests/toolchain.json', 'tools/ffmpeg-capabilities.py') }} + key: windows-mpv-${{ needs.toolchain.outputs.key_mpv }}-${{ needs.toolchain.outputs.key_ffmpeg }}-${{ needs.toolchain.outputs.key_streaming }}-${{ steps.windows-tools.outputs.mpv }} - name: Build libmpv from the fork if: steps.mpv-cache.outputs.cache-hit != 'true' @@ -1540,29 +1471,20 @@ jobs: uses: actions/cache/save@caa296126883cff596d87d8935842f9db880ef25 # v5.0.3 with: path: build/windows-deps/mpv - key: windows-mpv-${{ runner.os }}-${{ steps.mpv-revision.outputs.revision }}-${{ hashFiles('tools/manifests/streaming-third-party.json', 'tools/prepare-streaming-sources.sh', 'tools/streaming-fingerprint.py', 'tools/check-streaming-dependencies.py', 'tools/cmake/StreamingDependencies.cmake', 'tools/cmake/QuicBatchingProbe/CMakeLists.txt', 'tools/lib/streaming-build.sh', 'tools/patches/curl-*.patch', 'tools/windows/build-streaming-dependencies.ps1', 'tools/windows/build-mpv.ps1', 'tools/windows/build-ffmpeg.ps1', 'tools/windows/build-ffmpeg.sh', 'tools/windows/check-ffmpeg.py', 'tools/windows/build-shader-tools.ps1', 'tools/windows/common.ps1', 'tools/manifests/mpv-native.json', 'tools/manifests/ffmpeg-capabilities.json', 'tools/manifests/toolchain.json', 'tools/ffmpeg-capabilities.py') }} + key: ${{ steps.mpv-cache.outputs.cache-primary-key }} - name: Install sccache uses: Mozilla-Actions/sccache-action@fc920bf0ec8de6ee65d409111f7ec508035751ba # v0.0.11 with: version: v0.18.0 - - name: Identify the MSVC compiler - id: msvc - shell: pwsh - run: | - . tools\windows\common.ps1 - Import-MsvcEnvironment - $compiler = (Get-Item -LiteralPath $env:CC).VersionInfo.FileVersion - "version=$compiler" >> $env:GITHUB_OUTPUT - - name: Restore Windows compiler cache id: sccache uses: actions/cache/restore@caa296126883cff596d87d8935842f9db880ef25 # v5.0.3 with: path: ${{ env.SCCACHE_DIR }} - key: windows-sccache-${{ steps.msvc.outputs.version }}-${{ github.sha }} - restore-keys: windows-sccache-${{ steps.msvc.outputs.version }}- + key: windows-sccache-${{ steps.windows-tools.outputs.msvc }}-${{ github.sha }} + restore-keys: windows-sccache-${{ steps.windows-tools.outputs.msvc }}- - name: Build application shell: pwsh diff --git a/.github/workflows/ios-review.yml b/.github/workflows/ios-review.yml index 8611cb95..008519d9 100644 --- a/.github/workflows/ios-review.yml +++ b/.github/workflows/ios-review.yml @@ -32,9 +32,11 @@ jobs: arch: arm64 qt_kit: ios_device env: + APPLE_SYSTEM: iOS APPLE_SDK: ${{ matrix.sdk }} APPLE_ARCH: ${{ matrix.arch }} APPLE_BUILD: build/apple/${{ matrix.sdk }}-${{ matrix.arch }} + APPLE_MPV_PREFIX: ${{ github.workspace }}/build/apple/${{ matrix.sdk }}-${{ matrix.arch }}/mpv-prefix SPOOL_CACHE_WRITE: ${{ (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository)) && !inputs.release }} steps: - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.0.2 @@ -53,65 +55,39 @@ jobs: } fi echo "Building source $GITHUB_SHA with bundle/package version $version" - - name: Install native build tools - run: brew install cmake ninja meson pkg-config bash python imagemagick nasm gpatch ffmpeg tesseract - - name: Resolve Qt kits and Apple SDK - id: apple-toolchain - shell: bash - run: | - version="$(bash tools/toolchain-versions.sh qt.version)" - echo "version=$version" >>"$GITHUB_OUTPUT" - echo "QT_HOST_PATH=$RUNNER_TEMP/Qt/$version/macos" >>"$GITHUB_ENV" - echo "QT_TARGET_PREFIX=$RUNNER_TEMP/Qt/$version/${{ matrix.qt_kit }}" >>"$GITHUB_ENV" - identity="$( - { - xcodebuild -version - xcrun --sdk "$APPLE_SDK" --show-sdk-build-version - xcrun --sdk "$APPLE_SDK" --show-sdk-path - } | shasum -a 256 - )" - echo "key=${identity%% *}" >>"$GITHUB_OUTPUT" - - name: Restore Qt host and iOS kits - id: qt-cache + - uses: ./.github/actions/apple-build-tools + id: apple + with: + sdk: ${{ matrix.sdk }} + ios-kit: ${{ matrix.qt_kit }} + cache-write: ${{ env.SPOOL_CACHE_WRITE }} + - name: Restore iOS media dependencies + id: media uses: actions/cache/restore@caa296126883cff596d87d8935842f9db880ef25 # v5.0.3 with: - path: ${{ runner.temp }}/Qt - key: ios-kits-${{ runner.arch }}-${{ matrix.qt_kit }}-${{ steps.apple-toolchain.outputs.version }}-${{ hashFiles('tools/apple/aqt-ios.py', '.github/workflows/ios-review.yml') }} - - name: Install pinned Qt host and iOS kits - if: steps.qt-cache.outputs.cache-hit != 'true' - env: - QT_VERSION: ${{ steps.apple-toolchain.outputs.version }} - QT_IOS_KIT: ${{ matrix.qt_kit }} - shell: bash - run: | - python3 -m venv "$RUNNER_TEMP/aqt" - "$RUNNER_TEMP/aqt/bin/pip" install aqtinstall==3.3.0 - modules=(qtshadertools qtwebsockets qtimageformats qttasktree) - "$RUNNER_TEMP/aqt/bin/aqt" install-qt mac desktop "$QT_VERSION" clang_64 \ - -O "$RUNNER_TEMP/Qt" -m "${modules[@]}" - "$RUNNER_TEMP/aqt/bin/python" tools/apple/aqt-ios.py install-qt mac ios "$QT_VERSION" "$QT_IOS_KIT" \ - -O "$RUNNER_TEMP/Qt" -m "${modules[@]}" - - name: Save Qt host and iOS kits - if: ${{ env.SPOOL_CACHE_WRITE == 'true' && steps.qt-cache.outputs.cache-hit != 'true' }} + path: ${{ env.APPLE_BUILD }}/prefix + key: apple-media-${{ matrix.sdk }}-${{ matrix.arch }}-${{ steps.apple.outputs.sdk-key }}-${{ steps.apple.outputs.ios-kit-key }}-${{ steps.apple.outputs.ios-deployment-target }}-${{ steps.apple.outputs.apple-deps-key }} + - name: Build iOS media dependencies + if: steps.media.outputs.cache-hit != 'true' + run: bash tools/apple/build-dependencies.sh media + - name: Save iOS media dependencies + if: ${{ env.SPOOL_CACHE_WRITE == 'true' && steps.media.outputs.cache-hit != 'true' }} uses: actions/cache/save@caa296126883cff596d87d8935842f9db880ef25 # v5.0.3 with: - path: ${{ runner.temp }}/Qt - key: ${{ steps.qt-cache.outputs.cache-primary-key }} - - name: Read mpv revision - id: mpv-revision - run: echo "revision=$(git rev-parse HEAD:mpv)" >>"$GITHUB_OUTPUT" - - name: Restore iOS build + path: ${{ env.APPLE_BUILD }}/prefix + key: ${{ steps.media.outputs.cache-primary-key }} + - name: Restore iOS mpv and app builds id: ios-build-cache uses: actions/cache/restore@caa296126883cff596d87d8935842f9db880ef25 # v5.0.3 with: path: | - ${{ env.APPLE_BUILD }}/prefix + ${{ env.APPLE_MPV_PREFIX }} ${{ env.APPLE_BUILD }}/app - key: ios-build-${{ matrix.sdk }}-${{ matrix.arch }}-${{ steps.apple-toolchain.outputs.key }}-${{ steps.mpv-revision.outputs.revision }}-${{ hashFiles('tools/apple/build-dependencies.sh', 'tools/manifests/*.json', 'tools/build-ios.sh', 'tools/lib/*.sh', 'tools/patches/**') }} + key: ios-app-${{ steps.media.outputs.cache-primary-key }}-${{ steps.apple.outputs.mpv-key }}-${{ steps.apple.outputs.ios-app-key }} - name: Build native iOS application shell: bash env: - BUILD_DEPENDENCIES: ${{ steps.ios-build-cache.outputs.cache-hit == 'true' && '0' || '1' }} + BUILD_DEPENDENCIES: ${{ steps.ios-build-cache.outputs.cache-hit == 'true' && '0' || 'mpv' }} APPLE_CODE_SIGNING_ALLOWED: 'NO' # The published IPA is unsigned, for sideloading, so it is the open # build (all providers, provider downloads); the simulator smoke @@ -124,7 +100,7 @@ jobs: uses: actions/cache/save@caa296126883cff596d87d8935842f9db880ef25 # v5.0.3 with: path: | - ${{ env.APPLE_BUILD }}/prefix + ${{ env.APPLE_MPV_PREFIX }} ${{ env.APPLE_BUILD }}/app key: ${{ steps.ios-build-cache.outputs.cache-primary-key }} - name: Build native host controller for iOS application journeys diff --git a/.github/workflows/tvos.yml b/.github/workflows/tvos.yml index f0f12389..90b02cff 100644 --- a/.github/workflows/tvos.yml +++ b/.github/workflows/tvos.yml @@ -2,6 +2,11 @@ name: tvOS source build on: workflow_dispatch: + workflow_call: + inputs: + release: + type: boolean + default: false push: branches: [feature/tvos] @@ -9,56 +14,130 @@ permissions: contents: read concurrency: - group: tvos-${{ github.ref }} + group: tvos-${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true jobs: - simulator: - name: Qt mpv tvOS ${{ matrix.sdk }} build (simulator tests; device artifact audit only) + tvos: + name: tvOS (${{ matrix.sdk }} arm64) runs-on: macos-15 timeout-minutes: 240 strategy: fail-fast: false matrix: - sdk: [appletvsimulator, appletvos] + sdk: [appletvos, appletvsimulator] + env: + APPLE_SDK: ${{ matrix.sdk }} + APPLE_ARCH: arm64 + APPLE_SYSTEM: tvOS + APPLE_BUILD: build/apple/${{ matrix.sdk }}-arm64 + APPLE_MPV_PREFIX: ${{ github.workspace }}/build/apple/${{ matrix.sdk }}-arm64/mpv-prefix + QT_TARGET_PREFIX: ${{ github.workspace }}/build/apple/${{ matrix.sdk }}-arm64/qt + SPOOL_CACHE_WRITE: ${{ (github.event_name == 'push' || github.event_name == 'workflow_dispatch' || (github.event_name == 'pull_request' && github.event.pull_request.head.repo.full_name == github.repository)) && !inputs.release }} + CODE_SIGNING_ALLOWED: "NO" + JOBS: "3" + BUILD_JOBS: "3" steps: - - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 + - uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.0.2 with: - submodules: recursive persist-credentials: false - - name: Install native build tools - run: brew install cmake ninja meson pkg-config bash python imagemagick gpatch ffmpeg tesseract - - name: Install pinned macOS Qt host tools - run: | - python3 -m venv "$RUNNER_TEMP/aqt" - "$RUNNER_TEMP/aqt/bin/pip" install aqtinstall - version="$(bash tools/toolchain-versions.sh qt.version)" - "$RUNNER_TEMP/aqt/bin/aqt" install-qt mac desktop "$version" clang_64 \ - -O "$RUNNER_TEMP/Qt" -m qtshadertools qtwebsockets qtimageformats qttasktree - echo "QT_HOST_PATH=$RUNNER_TEMP/Qt/$version/macos" >> "$GITHUB_ENV" - - name: Build Qt and media libraries for Apple TV + submodules: recursive + - uses: ./.github/actions/apple-build-tools + id: apple + with: + sdk: ${{ matrix.sdk }} + cache-write: ${{ env.SPOOL_CACHE_WRITE }} + - name: Restore source-built tvOS Qt + id: qt + uses: actions/cache/restore@caa296126883cff596d87d8935842f9db880ef25 # v5.0.3 + with: + path: | + ${{ env.APPLE_BUILD }}/qt + build/apple/qmlimportscanner/spool-qmlimportscanner + key: tvos-qt-${{ runner.arch }}-${{ matrix.sdk }}-${{ steps.apple.outputs.sdk-key }}-${{ steps.apple.outputs.tvos-qt-key }} + - name: Build source Qt + if: steps.qt.outputs.cache-hit != 'true' + run: bash tools/apple/build-qt-tvos.sh + - name: Save source-built tvOS Qt + if: ${{ env.SPOOL_CACHE_WRITE == 'true' && steps.qt.outputs.cache-hit != 'true' }} + uses: actions/cache/save@caa296126883cff596d87d8935842f9db880ef25 # v5.0.3 + with: + path: | + ${{ env.APPLE_BUILD }}/qt + build/apple/qmlimportscanner/spool-qmlimportscanner + key: ${{ steps.qt.outputs.cache-primary-key }} + - name: Restore tvOS media dependencies + id: media + uses: actions/cache/restore@caa296126883cff596d87d8935842f9db880ef25 # v5.0.3 + with: + path: ${{ env.APPLE_BUILD }}/prefix + key: apple-media-${{ matrix.sdk }}-${{ steps.qt.outputs.cache-primary-key }}-${{ steps.apple.outputs.apple-deps-key }} + - name: Build tvOS media dependencies + if: steps.media.outputs.cache-hit != 'true' + run: bash tools/apple/build-dependencies.sh media + - name: Save tvOS media dependencies + if: ${{ env.SPOOL_CACHE_WRITE == 'true' && steps.media.outputs.cache-hit != 'true' }} + uses: actions/cache/save@caa296126883cff596d87d8935842f9db880ef25 # v5.0.3 + with: + path: ${{ env.APPLE_BUILD }}/prefix + key: ${{ steps.media.outputs.cache-primary-key }} + - name: Restore tvOS mpv and app builds + id: app + uses: actions/cache/restore@caa296126883cff596d87d8935842f9db880ef25 # v5.0.3 + with: + path: | + ${{ env.APPLE_MPV_PREFIX }} + build/tvos/${{ matrix.sdk }}-arm64/app + key: tvos-app-${{ steps.media.outputs.cache-primary-key }}-${{ steps.apple.outputs.mpv-key }}-${{ steps.apple.outputs.tvos-app-key }} + - name: Build tvOS app env: - APPLE_SDK: ${{ matrix.sdk }} - APPLE_ARCH: arm64 - JOBS: 3 - BUILD_JOBS: 3 + BUILD_QT: '0' + BUILD_DEPENDENCIES: ${{ steps.app.outputs.cache-hit == 'true' && '0' || 'mpv' }} run: bash tools/build-tvos.sh - - name: Build same-binary host controller for the actual mobile app journey + - name: Save tvOS mpv and app builds + if: ${{ env.SPOOL_CACHE_WRITE == 'true' && steps.app.outputs.cache-hit != 'true' }} + uses: actions/cache/save@caa296126883cff596d87d8935842f9db880ef25 # v5.0.3 + with: + path: | + ${{ env.APPLE_MPV_PREFIX }} + build/tvos/${{ matrix.sdk }}-arm64/app + key: ${{ steps.app.outputs.cache-primary-key }} + - name: Build native host controller for tvOS application journeys if: matrix.sdk == 'appletvsimulator' run: | cmake -S tests/e2e/host -B build/apple/device-journey-host -G Ninja \ -DCMAKE_BUILD_TYPE=Release -DCMAKE_PREFIX_PATH="$QT_HOST_PATH" cmake --build build/apple/device-journey-host - - name: Run traditional then real GPU GUI tests in isolated Apple TV simulator + + - name: Run tvOS traditional and real GPU GUI e2e tests if: matrix.sdk == 'appletvsimulator' env: SPOOL_DEVICE_HOST_BUILD_DIR: build/apple/device-journey-host run: bash tools/apple/smoke-tvos.sh build/tvos/appletvsimulator-arm64/install/Spool.app - - uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a - if: always() + + - name: Package artifact-audited unsigned device IPA (no device runtime claim) + if: ${{ matrix.sdk == 'appletvos' }} + run: bash tools/package-tvos.sh build/tvos/appletvos-arm64/install/Spool.app dist/tvos + - name: Upload only the device release package + if: ${{ matrix.sdk == 'appletvos' }} + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.0 + with: + name: spool-tvos-device-arm64 + path: dist/tvos/Spool-*-tvOS-arm64.ipa + if-no-files-found: error + retention-days: ${{ inputs.release && 1 || 7 }} + - name: Archive simulator build without losing executable permissions + if: ${{ matrix.sdk == 'appletvsimulator' }} + run: | + tar -czf "$RUNNER_TEMP/tvos-simulator-arm64.tar.gz" \ + -C build/tvos/appletvsimulator-arm64 install + - name: Keep simulator artifacts internal + if: ${{ always() && matrix.sdk == 'appletvsimulator' }} + uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.0 with: - name: internal-tvos-${{ matrix.sdk }}-arm64 + name: internal-tvos-simulator-arm64 path: | - build/tvos/${{ matrix.sdk }}-arm64/install - build/tvos/smoke/*.png - build/tvos/smoke/*.json + ${{ runner.temp }}/tvos-simulator-arm64.tar.gz + build/tvos/smoke/safe-export + build/tvos/smoke/launch-result.json + retention-days: ${{ inputs.release && 1 || 7 }} diff --git a/CMakeLists.txt b/CMakeLists.txt index ff9d39f3..2318b7c9 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1160,6 +1160,8 @@ if(BUILD_TESTING AND NOT SPOOL_WEBOS) add_test(NAME module-seam COMMAND bash "${CMAKE_CURRENT_SOURCE_DIR}/tools/check-module-seam.sh" ) + add_test(NAME toolchain-versions + COMMAND "${Python3_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/tests/tools/ToolchainVersionsTest.py") add_test(NAME streaming-candidates COMMAND "${Python3_EXECUTABLE}" "${CMAKE_CURRENT_SOURCE_DIR}/tests/tools/StreamingCandidatesTest.py") @@ -1360,7 +1362,7 @@ if(BUILD_TESTING AND NOT SPOOL_WEBOS) set_target_properties(${test_target} PROPERTIES INTERPROCEDURAL_OPTIMIZATION OFF INTERPROCEDURAL_OPTIMIZATION_RELEASE OFF INTERPROCEDURAL_OPTIMIZATION_MINSIZEREL OFF) endforeach() - set_tests_properties(provider-sdk-tool local-provider-overrides ffmpeg-capability-generator module-seam + set_tests_properties(provider-sdk-tool local-provider-overrides ffmpeg-capability-generator module-seam toolchain-versions network-shaper streaming-candidates render-benchmark-report altstore-source player-setup-report test-driver-ordering PROPERTIES LABELS traditional) if(UNIX) add_test(NAME streaming-dependencies COMMAND "${Python3_EXECUTABLE}" diff --git a/build-ipk.sh b/build-ipk.sh index a24f8625..6a294de5 100755 --- a/build-ipk.sh +++ b/build-ipk.sh @@ -65,8 +65,7 @@ MPV_SRC="${MPV_SRC:-$ROOT/mpv}" MPV_BUILD="${MPV_BUILD:-$MPV_SRC/build/webos-libmpv}" WEBOS_CROSS_FILE="${WEBOS_CROSS_FILE:-$ROOT/build/webos-thirdparty-build/webos.cross.ini}" FFMPEG_CAPABILITY_MANIFEST="${FFMPEG_CAPABILITY_MANIFEST:-$ROOT/tools/manifests/ffmpeg-capabilities.json}" -QT_MANIFEST="${QT_MANIFEST:-$ROOT/tools/manifests/qt-webos.json}" -QT_VERSION="$(manifest_qt_field "$QT_MANIFEST" qtVersion)" +QT_VERSION="$(toolchain_field "$ROOT" qt.version)" QT_BUILD_TAG="${QT_VERSION%.*}" QT_BUILD_TAG="${QT_BUILD_TAG//./}" QT6_HOST_PREFIX="${QT6_HOST_PREFIX:-$ROOT/build/qt6-$QT_BUILD_TAG-host-install}" @@ -136,6 +135,7 @@ if (( DO_BUILD || DO_STAGE )); then fi if (( DO_BUILD )); then +setup_native_ccache "$ROOT" describe_parallel_jobs "$WEBOS_BUILD_JOBS" "webOS app" "$WEBOS_BUILD_MEMORY_PER_JOB_MIB" "$WEBOS_BUILD_MEMORY_RESERVE_MIB" DOVI_TOOL_ROOT="${DOVI_TOOL_ROOT:-$ROOT/build/third_party/dovi_tool}" diff --git a/flake.nix b/flake.nix index a059c089..dd6f95ab 100644 --- a/flake.nix +++ b/flake.nix @@ -29,13 +29,12 @@ let systems = [ "x86_64-linux" "aarch64-darwin" "x86_64-darwin" ]; - androidToolchain = - builtins.fromJSON (builtins.readFile ./tools/manifests/qt-android.json); + androidToolchain = toolchain.android; androidSdkArgs = { - platformVersions = [ androidToolchain.android.compileSdk ]; - buildToolsVersions = [ androidToolchain.android.buildTools ]; + platformVersions = [ androidToolchain.compileSdk ]; + buildToolsVersions = [ androidToolchain.buildTools ]; includeNDK = true; - ndkVersions = [ androidToolchain.android.ndkVersion ]; + ndkVersions = [ androidToolchain.ndkVersion ]; }; androidEnvironment = pkgs: let @@ -44,7 +43,7 @@ composition = pkgs.androidenv.composeAndroidPackages androidSdkArgs; emulator = pkgs.androidenv.emulateApp { name = "spool-android-emulator"; - platformVersion = "36"; + platformVersion = androidToolchain.compileSdk; abiVersion = "x86_64"; systemImageType = "google_apis"; configOptions = { @@ -61,7 +60,7 @@ deviceName = "spool-android-tv"; # The pinned SDK metadata contains this actual Android TV image, # including its x86_64 ABI; do not merely toggle the app's TV flag. - platformVersion = "36"; + platformVersion = androidToolchain.compileSdk; abiVersion = "x86_64"; systemImageType = "android-tv"; configOptions = { @@ -222,7 +221,7 @@ srcs = builtins.mapAttrs (name: sha256: { version = toolchain.qt.version; src = final.fetchurl { - url = "${toolchain.qt.baseUrl}/${name}-everywhere-src-${toolchain.qt.version}.tar.xz"; + url = "${toolchain.qt.archiveBaseUrl}/${toolchain.qt.series}/${toolchain.qt.version}/submodules/${name}-everywhere-src-${toolchain.qt.version}.tar.xz"; inherit sha256; }; }) toolchain.qt.sources; @@ -859,7 +858,7 @@ ] ++ lib.optionals stdenv.hostPlatform.isLinux [ util-linux ]; ANDROID_HOME = "${android.sdk}/libexec/android-sdk"; ANDROID_SDK_ROOT = "${android.sdk}/libexec/android-sdk"; - ANDROID_NDK_ROOT = "${android.sdk}/libexec/android-sdk/ndk/${androidToolchain.android.ndkVersion}"; + ANDROID_NDK_ROOT = "${android.sdk}/libexec/android-sdk/ndk/${androidToolchain.ndkVersion}"; JAVA_HOME = pkgs.jdk17_headless.home; SPOOL_ANDROID_QT_HOST = "${androidQtHost}"; shellHook = gitHooksShellHook; diff --git a/renovate.json b/renovate.json index 9b61fb87..5f028e38 100644 --- a/renovate.json +++ b/renovate.json @@ -37,6 +37,11 @@ "matchManagers": ["git-submodules", "nix", "cmake", "github-releases", "regex"], "automerge": false }, + { + "description": "Update the Nix archive release pin together with the installer action digest", + "matchPackageNames": ["nixbuild/nix-quick-install-action"], + "groupName": "Nix quick installer" + }, { "description": "Preserve readable action versions beside immutable digests", "matchManagers": ["github-actions"], @@ -47,10 +52,18 @@ "customManagers": [ { "customType": "regex", - "managerFilePatterns": ["/\\.github/workflows/.*\\.ya?ml$/"], + "managerFilePatterns": ["/^\\.github/(?:workflows|actions)/.*\\.ya?ml$/"], "matchStrings": ["(?[A-Za-z0-9_.-]+)_VERSION:\\s*(?[^\\s#]+)\\s*#\\s*renovate: datasource=(?\\S+)(?: depName=(?\\S+))?"], "versioningTemplate": "loose" }, + { + "customType": "regex", + "managerFilePatterns": ["/^tools/manifests/toolchain\\.json$/"], + "matchStrings": ["\"quickInstallRelease\"\\s*:\\s*\"(?v\\d+)\""], + "depNameTemplate": "nixbuild/nix-quick-install-action", + "datasourceTemplate": "github-releases", + "versioningTemplate": "loose" + }, { "customType": "regex", "managerFilePatterns": ["/^tools/manifests/.*\\.json$/"], diff --git a/tests/tools/PackageAuditTest.py b/tests/tools/PackageAuditTest.py index 7830f2b9..1a666407 100755 --- a/tests/tools/PackageAuditTest.py +++ b/tests/tools/PackageAuditTest.py @@ -265,11 +265,13 @@ def workflow_artifact_contract(script: Path) -> None: shutil.copyfile(script, checker) release = workflows / "release.yml" release.write_text("pattern: spool-*\n") + build_workflow = workflows / "build-artifacts.yml" ios_workflow = workflows / "ios-review.yml" - for names, ios_names, expected, reason in ( - (("spool-linux", "spool-tvos-device-arm64", "internal-tvos-simulator-arm64"), + tvos_workflow = workflows / "tvos.yml" + for tvos_names, ios_names, expected, reason in ( + (("spool-tvos-device-arm64", "internal-tvos-simulator-arm64"), ("spool-ios-device-arm64", "internal-ios-simulator-x86_64"), 0, "checked"), - (("spool-linux",), ("spool-ios-device-arm64",), 1, "exactly one spool-tvos-device-arm64"), + ((), ("spool-ios-device-arm64",), 1, "exactly one spool-tvos-device-arm64"), (("spool-tvos-device-arm64", "spool-tvos-simulator-arm64"), ("spool-ios-device-arm64",), 1, "must be internal-*"), (("spool-tvos-device-arm64", "spool-tvos-device-arm64"), @@ -282,7 +284,8 @@ def workflow_artifact_contract(script: Path) -> None: (("spool-tvos-device-arm64",), ("spool-ios-device-arm64", "spool-ios-simulator-x86_64"), 1, "must be internal-*"), ): - for workflow, uploads in ((workflows / "build-artifacts.yml", names), (ios_workflow, ios_names)): + for workflow, uploads in ((build_workflow, ("spool-linux",)), + (ios_workflow, ios_names), (tvos_workflow, tvos_names)): workflow.write_text("".join( f"- uses: actions/upload-artifact@v4\n with:\n name: {name}\n" for name in uploads )) diff --git a/tests/tools/ToolchainVersionsTest.py b/tests/tools/ToolchainVersionsTest.py new file mode 100644 index 00000000..87cfc101 --- /dev/null +++ b/tests/tools/ToolchainVersionsTest.py @@ -0,0 +1,95 @@ +#!/usr/bin/env python3 +"""Keep toolchain pin validation and platform cache boundaries under test.""" + +import importlib.util +import json +from pathlib import Path +import shutil +import tempfile +import unittest + + +ROOT = Path(__file__).resolve().parents[2] +spec = importlib.util.spec_from_file_location("toolchain_versions", ROOT / "tools/toolchain-versions.py") +toolchain = importlib.util.module_from_spec(spec) +spec.loader.exec_module(toolchain) + + +class ToolchainVersionsTest(unittest.TestCase): + def setUp(self): + directory = tempfile.TemporaryDirectory(prefix="spool-toolchain-test-") + self.addCleanup(directory.cleanup) + self.root = Path(directory.name) + for name in ("tools", ".github"): + shutil.copytree(ROOT / name, self.root / name) + for name in ("flake.nix", "flake.lock", "renovate.json"): + shutil.copy2(ROOT / name, self.root / name) + + def test_repository_versions(self): + self.assertEqual(toolchain.version_errors(self.root), []) + pins = toolchain.load(self.root / "tools/manifests/toolchain.json") + outputs = toolchain.outputs(self.root, "a" * 40) + self.assertEqual(outputs["apple_qt_modules"].split(), pins["apple"]["qtModules"]) + self.assertEqual(outputs["android_build_tools"], pins["android"]["buildTools"]) + self.assertEqual(outputs["qt_build_tag"], pins["qt"]["series"].replace(".", "")) + + def test_windows_and_mpv_edits_leave_source_qt_caches_warm(self): + before = toolchain.outputs(self.root, "a" * 40) + windows = self.root / "tools/windows/install-qt.ps1" + with windows.open("a", encoding="utf-8") as handle: + handle.write("\n# edits to Windows package setup\n") + lock_file = self.root / "flake.lock" + lock = toolchain.load(lock_file) + lock["nodes"]["mpv-src"]["locked"]["rev"] = "b" * 40 + lock_file.write_text(json.dumps(lock), encoding="utf-8") + after = toolchain.outputs(self.root, "b" * 40) + for key in ("key_windows_qt", "key_mpv", "key_native_shell", "key_linux_build", "key_webos_build"): + self.assertNotEqual(before[key], after[key], key) + for key in ("key_apple_host", "key_ios_kit", "key_tvos_qt", "key_apple_deps", + "key_android_qt", "key_webos_deps"): + self.assertEqual(before[key], after[key], key) + + def test_qt_digest_change_only_affects_builds_that_use_it(self): + before = toolchain.outputs(self.root, "a" * 40) + path = self.root / "tools/manifests/toolchain.json" + pins = toolchain.load(path) + pins["qt"]["sources"]["qtwayland"] = "0" * 64 + path.write_text(json.dumps(pins), encoding="utf-8") + after = toolchain.outputs(self.root, "a" * 40) + self.assertNotEqual(before["key_webos_deps"], after["key_webos_deps"]) + self.assertEqual(before["key_tvos_qt"], after["key_tvos_qt"]) + self.assertEqual(before["key_android_qt"], after["key_android_qt"]) + self.assertEqual(before["key_windows_qt"], after["key_windows_qt"]) + + def test_qcoro_edit_does_not_invalidate_android_media_or_qt(self): + before = toolchain.outputs(self.root, "a" * 40) + path = self.root / "tools/manifests/android-third-party.json" + pins = toolchain.load(path) + pins["sources"]["qcoro"]["sha256"] = "0" * 64 + path.write_text(json.dumps(pins), encoding="utf-8") + after = toolchain.outputs(self.root, "a" * 40) + for key in ("key_android_deps", "key_android_qt"): + self.assertEqual(before[key], after[key], key) + self.assertNotEqual(before["key_apple_deps"], after["key_apple_deps"]) + + def test_guard_rejects_duplicates_literal_versions_and_partial_caches(self): + android = self.root / "tools/manifests/qt-android.json" + data = toolchain.load(android) + data["qtVersion"] = "99.0.0" + android.write_text(json.dumps(data), encoding="utf-8") + + workflow = self.root / ".github/workflows/tvos.yml" + lines = workflow.read_text(encoding="utf-8").splitlines() + line = next(index for index, text in enumerate(lines) if "key: tvos-qt-" in text) + lines.insert(line + 1, " restore-keys: tvos-qt-") + lines.append(" APPLE_DEPLOYMENT_TARGET: '99.0'") + workflow.write_text("\n".join(lines) + "\n", encoding="utf-8") + + errors = "\n".join(toolchain.version_errors(self.root)) + self.assertIn("qt-android.json repeats toolchain.json pins", errors) + self.assertIn("repeats a toolchain pin", errors) + self.assertIn("restores a partial toolchain cache", errors) + + +if __name__ == "__main__": + unittest.main() diff --git a/tools/android/build-apks.sh b/tools/android/build-apks.sh index 9793e261..4f2fbe2e 100755 --- a/tools/android/build-apks.sh +++ b/tools/android/build-apks.sh @@ -65,12 +65,15 @@ source "$ROOT/tools/android/signing.sh" build_qcoro() { local build="$ROOT/build/android/qcoro-build/$ABI" local prefix="$ROOT/build/android/qcoro/$ABI" + local source="$ROOT/build/android/sources/third-party/qcoro" if [[ -f "$prefix/lib/cmake/QCoro6/QCoro6Config.cmake" ]]; then printf 'Android QCoro for %s is current\n' "$ABI" return fi + # A restored media prefix does not include the QCoro source tree. + prepare_manifest_source "$ROOT" "$ROOT/tools/manifests/android-third-party.json" qcoro "$source" rm -rf "$build" "$prefix" - "$QT_PREFIX/bin/qt-cmake" -S "$ROOT/build/android/sources/third-party/qcoro" -B "$build" -GNinja \ + "$QT_PREFIX/bin/qt-cmake" -S "$source" -B "$build" -GNinja \ -DCMAKE_BUILD_TYPE=Release \ -DCMAKE_SYSTEM_PREFIX_PATH="$NDK_PREFIX_PATH" \ -DCMAKE_INSTALL_PREFIX="$prefix" \ @@ -122,7 +125,7 @@ build_app() { -DQT_ANDROID_DEPLOYMENT_TYPE="$deployment" \ -DSPOOL_WEBOS=OFF \ -DANDROID_ABI="$ABI" \ - -DANDROID_PLATFORM=android-28 \ + -DANDROID_PLATFORM="android-$(toolchain_field "$ROOT" android.minimumSdk)" \ -DANDROID_DEPS_PREFIX="$DEPS_PREFIX" \ -DQT_ANDROID_SIGN_APK=ON # androiddeployqt scans SOURCE_DIR recursively and does not forward diff --git a/tools/android/build-dependencies.sh b/tools/android/build-dependencies.sh index 5040bff9..c9fdf9d5 100755 --- a/tools/android/build-dependencies.sh +++ b/tools/android/build-dependencies.sh @@ -8,7 +8,7 @@ MPV_SRC="${MPV_SRC:-$ROOT/mpv}" PHASE="${1:-all}" ABI="${ANDROID_ABI:-x86_64}" -API="${ANDROID_API:-28}" +API="${ANDROID_API:-$(toolchain_field "$ROOT" android.minimumSdk)}" MANIFEST="${ANDROID_THIRD_PARTY_MANIFEST:-$ROOT/tools/manifests/android-third-party.json}" JOBS="$(recommended_parallel_jobs "${ANDROID_DEPS_MEMORY_PER_JOB_MIB:-1024}" "${ANDROID_DEPS_MEMORY_RESERVE_MIB:-2048}")" @@ -72,7 +72,7 @@ unset PKG_CONFIG_SYSROOT_DIR fetch_sources() { mkdir -p "$SOURCE_ROOT" "$BUILD_ROOT" local source - for source in freetype lua qcoro fribidi harfbuzz libass libplacebo dav1d; do + for source in freetype lua fribidi harfbuzz libass libplacebo dav1d; do prepare_manifest_source "$ROOT" "$MANIFEST" "$source" "$SOURCE_ROOT/$source" done bash "$ROOT/tools/prepare-streaming-sources.sh" --root "$ROOT" --output "$SOURCE_ROOT" @@ -313,8 +313,8 @@ build_mpv() { )" pin="$( printf '%s\n' "$source_pin" "$ABI" "$API" "$ANDROID_NDK_ROOT" - sha256sum "${BASH_SOURCE[0]}" "$ROOT/tools/manifests/toolchain.json" \ - "$ROOT/tools/manifests/mpv-native.json" "$ANDROID_NDK_ROOT/source.properties" || exit + sha256sum "${BASH_SOURCE[0]}" "$ROOT/tools/manifests/mpv-native.json" \ + "$ANDROID_NDK_ROOT/source.properties" || exit cat "$PREFIX/lib/pkgconfig/.spool-ffmpeg-source" "$PREFIX/lib/.spool-curl-configuration" )" [[ -f "$PREFIX/lib/libmpv.so" && -f "$stamp" && "$(<"$stamp")" == "$pin" ]] && return diff --git a/tools/android/build-qt6.sh b/tools/android/build-qt6.sh index 92542030..cd367870 100755 --- a/tools/android/build-qt6.sh +++ b/tools/android/build-qt6.sh @@ -10,10 +10,11 @@ source "$ROOT/tools/android/gradle-mirror.sh" PHASE="${1:-all}" ABI="${ANDROID_ABI:-x86_64}" MANIFEST="${QT_ANDROID_MANIFEST:-$ROOT/tools/manifests/qt-android.json}" -QT_VERSION="$(manifest_qt_field "$MANIFEST" qtVersion)" -QT_BASE_URL="$(manifest_qt_field "$MANIFEST" baseUrl)" +QT_VERSION="$(toolchain_field "$ROOT" qt.version)" +QT_BASE_URL="$(toolchain_qt_sources_url "$ROOT" qt.fauArchiveBaseUrl)" QT_HOST_PATH="${SPOOL_ANDROID_QT_HOST:-}" -ANDROID_API="${ANDROID_API:-28}" +ANDROID_API="${ANDROID_API:-$(toolchain_field "$ROOT" android.minimumSdk)}" +ANDROID_COMPILE_SDK="$(toolchain_field "$ROOT" android.compileSdk)" JOBS="$(recommended_parallel_jobs "${QT_ANDROID_MEMORY_PER_JOB_MIB:-1536}" "${QT_ANDROID_MEMORY_RESERVE_MIB:-2048}")" # The Nix setup hooks publish every host build input through these, the same way # build-dependencies.sh and build-apks.sh guard against. Qt's own find modules @@ -62,8 +63,8 @@ unset PKG_CONFIG_SYSROOT_DIR require_environment() { : "${ANDROID_HOME:?run through nix develop .#android}" : "${ANDROID_NDK_ROOT:?run through nix develop .#android}" - [[ -d "$ANDROID_HOME/platforms/android-36" ]] || { - echo "error: Android platform 36 missing" >&2 + [[ -d "$ANDROID_HOME/platforms/android-$ANDROID_COMPILE_SDK" ]] || { + echo "error: Android platform $ANDROID_COMPILE_SDK missing" >&2 exit 1 } [[ -f "$ANDROID_DEPS_PREFIX/lib/libssl.so" ]] || { @@ -94,21 +95,17 @@ apply_qt_patches() { done } -module_names() { - python3 -c 'import json,sys; print("\n".join(x["name"] for x in json.load(open(sys.argv[1]))["modules"]))' "$MANIFEST" -} - fetch_sources() { mkdir -p "$SOURCE_ROOT" "$DOWNLOAD_ROOT" local module sha archive source while IFS= read -r module; do [[ -n "$module" ]] || continue - sha="$(manifest_qt_module_sha256 "$MANIFEST" "$module")" + sha="$(toolchain_field "$ROOT" "qt.sources.$module")" archive="$DOWNLOAD_ROOT/$module-everywhere-src-$QT_VERSION.tar.xz" source="$SOURCE_ROOT/$module" download_verified "$QT_BASE_URL/$module-everywhere-src-$QT_VERSION.tar.xz" "$sha" "$archive" extract_verified_source "$archive" "$sha" "$source" - done < <(module_names) + done < <(manifest_json_array "$MANIFEST" modules) apply_qt_patches } diff --git a/tools/android/build-universal-apk.sh b/tools/android/build-universal-apk.sh index 0fc3a565..187781b1 100755 --- a/tools/android/build-universal-apk.sh +++ b/tools/android/build-universal-apk.sh @@ -22,6 +22,8 @@ set -euo pipefail ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)" # shellcheck source=tools/android/signing.sh source "$ROOT/tools/android/signing.sh" +# shellcheck source=tools/lib/manifest-sources.sh +source "$ROOT/tools/lib/manifest-sources.sh" [[ $# -ge 4 ]] || { echo "usage: $0 OUT.apk INPUTS_DIR IN.apk IN.apk [...]" >&2 @@ -42,7 +44,7 @@ done } : "${ANDROID_HOME:?run through nix develop .#android}" -BUILD_TOOLS="${ANDROID_BUILD_TOOLS:-$ANDROID_HOME/build-tools/36.0.0}" +BUILD_TOOLS="${ANDROID_BUILD_TOOLS:-$ANDROID_HOME/build-tools/$(toolchain_field "$ROOT" android.buildTools)}" for tool in zipalign apksigner; do [[ -x "$BUILD_TOOLS/$tool" ]] || { echo "error: $tool missing at $BUILD_TOOLS/$tool" >&2 diff --git a/tools/apple/build-dependencies.sh b/tools/apple/build-dependencies.sh index 3968e3d1..070ef47e 100755 --- a/tools/apple/build-dependencies.sh +++ b/tools/apple/build-dependencies.sh @@ -2,11 +2,15 @@ set -euo pipefail ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)" source "$ROOT/tools/lib/manifest-sources.sh" +phase="${1:-all}" +case "$phase" in + all|media|mpv) ;; + *) echo "usage: $0 [all|media|mpv]" >&2; exit 2 ;; +esac [[ "$(uname -s)" == Darwin ]] || { echo 'Apple builds require macOS and Xcode.' >&2; exit 1; } APPLE_SYSTEM="${APPLE_SYSTEM:-iOS}" APPLE_SDK="${APPLE_SDK:-iphoneos}" APPLE_ARCH="${APPLE_ARCH:-arm64}" -APPLE_DEPLOYMENT_TARGET="${APPLE_DEPLOYMENT_TARGET:-16.0}" case "$APPLE_SYSTEM:$APPLE_SDK" in iOS:iphoneos) target_os=ios ;; iOS:iphonesimulator) target_os=ios; simulator=-simulator ;; @@ -14,6 +18,7 @@ case "$APPLE_SYSTEM:$APPLE_SDK" in tvOS:appletvsimulator) target_os=tvos; simulator=-simulator ;; *) echo 'Invalid Apple system/SDK pair.' >&2; exit 2 ;; esac +APPLE_DEPLOYMENT_TARGET="${APPLE_DEPLOYMENT_TARGET:-$(toolchain_field "$ROOT" "apple.${target_os}DeploymentTarget")}" case "$APPLE_ARCH" in arm64) cpu_family=aarch64; ffmpeg_arch=aarch64 ;; x86_64) cpu_family=x86_64; ffmpeg_arch=x86_64 ;; *) exit 2 ;; esac : "${QT_TARGET_PREFIX:?Set QT_TARGET_PREFIX to the target Qt kit}" : "${QT_HOST_PATH:?Set QT_HOST_PATH to the matching host Qt kit}" @@ -28,6 +33,7 @@ BASE="$ROOT/build/apple/$APPLE_SDK-$APPLE_ARCH" export MACOS_SDK="$SDKROOT" export MACOS_SDK_VERSION="$(xcrun --sdk "$APPLE_SDK" --show-sdk-version)" PREFIX="${APPLE_DEPS_PREFIX:-$BASE/prefix}" +MPV_PREFIX="${APPLE_MPV_PREFIX:-$PREFIX}" SOURCE_ROOT="$ROOT/build/apple/sources" BUILD_ROOT="$BASE/dependencies" MANIFEST="$ROOT/tools/manifests/android-third-party.json" @@ -40,16 +46,6 @@ export CFLAGS="-target $TRIPLE -isysroot $SDKROOT -fPIC" export CXXFLAGS="$CFLAGS" export LDFLAGS="-target $TRIPLE -isysroot $SDKROOT -L$PREFIX/lib" export CC CXX AR RANLIB SDKROOT -for name in freetype qcoro fribidi harfbuzz libass libplacebo; do - prepare_manifest_source "$ROOT" "$MANIFEST" "$name" "$SOURCE_ROOT/$name" -done -bash "$ROOT/tools/prepare-streaming-sources.sh" --root "$ROOT" --output "$SOURCE_ROOT" -prepare_toolchain_ffmpeg "$ROOT" "$SOURCE_ROOT/ffmpeg" -while IFS=$'\t' read -r path url sha; do - archive="$ROOT/build/downloads/apple-libplacebo-${path//\//-}-$sha.archive" - download_verified "$url" "$sha" "$archive" - extract_verified_source "$archive" "$sha" "$SOURCE_ROOT/libplacebo/$path" -done < <(manifest_vendored_sources "$MANIFEST" libplacebo) CROSS_FILE="$BUILD_ROOT/apple.ini" cat >"$CROSS_FILE" <&2; exit 2 ;; + esac + # Only the TLS libraries belong in the application closure. OpenSSL's command + # line HTTP server uses fork(), which tvOS explicitly prohibits. + (cd "$openssl_build"; "$SOURCE_ROOT/openssl/Configure" "$openssl_target" no-apps no-docs no-shared no-tests no-comp no-dtls no-srp no-ssl3 no-weak-ssl-ciphers no-asm --prefix="$PREFIX"; make -j"$JOBS" build_libs; make install_dev) + source "$ROOT/tools/lib/streaming-build.sh" + build_streaming_http "$SOURCE_ROOT" "$BUILD_ROOT/streaming" "$PREFIX" OFF "${cmake_cross[@]}" \ + -DUSE_APPLE_SECTRUST=ON -DOPENSSL_ROOT_DIR="$PREFIX" -DOPENSSL_USE_STATIC_LIBS=ON \ + -DOPENSSL_INCLUDE_DIR="$PREFIX/include" -DOPENSSL_CRYPTO_LIBRARY="$PREFIX/lib/libcrypto.a" \ + -DOPENSSL_SSL_LIBRARY="$PREFIX/lib/libssl.a" -DCURL_ZLIB=OFF + python3 "$ROOT/tools/check-streaming-dependencies.py" --prefix "$PREFIX" --manifest "$ROOT/tools/manifests/streaming-third-party.json" + printf '%s\n' "$streaming_pin" >"$streaming_stamp" + cmake -S "$SOURCE_ROOT/freetype" -B "$BUILD_ROOT/freetype" -GNinja "${cmake_cross[@]}" \ + -DBUILD_SHARED_LIBS=OFF -DFT_DISABLE_ZLIB=ON -DFT_DISABLE_BZIP2=ON -DFT_DISABLE_PNG=ON -DFT_DISABLE_HARFBUZZ=ON -DFT_DISABLE_BROTLI=ON + cmake --build "$BUILD_ROOT/freetype" --parallel "$JOBS" + cmake --install "$BUILD_ROOT/freetype" + meson_build() { + local name="$1"; shift + local build="$BUILD_ROOT/$name" + if [[ -f "$build/meson-private/coredata.dat" ]]; then + meson setup --reconfigure "$build" "$SOURCE_ROOT/$name" --cross-file "$CROSS_FILE" --native-file "$NATIVE_FILE" --prefix "$PREFIX" --default-library static "$@" + else + meson setup "$build" "$SOURCE_ROOT/$name" --cross-file "$CROSS_FILE" --native-file "$NATIVE_FILE" --prefix "$PREFIX" --default-library static "$@" + fi + meson compile -C "$build" -j "$JOBS" + meson install -C "$build" + } + meson_build fribidi -Ddocs=false -Dbin=false -Dtests=false + meson_build harfbuzz -Dtests=disabled -Dutilities=disabled -Ddocs=disabled \ + -Dglib=disabled -Dgobject=disabled -Dcairo=disabled -Dchafa=disabled \ + -Dpng=disabled -Dzlib=disabled -Dicu=disabled -Dgraphite=disabled \ + -Dgraphite2=disabled -Dfreetype=enabled -Dfontations=disabled \ + -Dgdi=disabled -Ddirectwrite=disabled -Dcoretext=enabled \ + -Dharfrust=disabled -Dkbts=disabled -Dwasm=disabled -Draster=disabled \ + -Dvector=disabled -Dgpu=disabled -Dsubset=disabled + meson_build libass -Dtest=disabled -Dcompare=disabled -Dprofile=disabled -Dfuzz=disabled -Dfontconfig=disabled -Dlibunibreak=disabled -Dasm=disabled + meson_build libplacebo -Ddemos=false -Dtests=false -Dbench=false -Dfuzz=false -Dvulkan=disabled -Dvk-proc-addr=disabled -Dd3d11=disabled -Dshaderc=disabled -Dglslang=disabled -Dlcms=disabled -Ddovi=disabled -Dlibdovi=disabled -Dxxhash=disabled -Dopengl=enabled -Dgl-proc-addr=enabled + ffmpeg_build="$BUILD_ROOT/ffmpeg" + mkdir -p "$ffmpeg_build" + python3 "$ROOT/tools/ffmpeg-capabilities.py" configure --platform "$target_os" >"$ffmpeg_build/flags" + feature_flags=() + while IFS= read -r flag; do feature_flags+=("$flag"); done <"$ffmpeg_build/flags" + (cd "$ffmpeg_build"; "$SOURCE_ROOT/ffmpeg/configure" --prefix="$PREFIX" --target-os=darwin --arch="$ffmpeg_arch" \ + --enable-cross-compile --cc="$CC" --cxx="$CXX" --ar="$AR" --ranlib="$RANLIB" --sysroot="$SDKROOT" \ + --host-cc="$NATIVE_CC" --host-cflags="-isysroot $NATIVE_SDK" --host-ldflags="-isysroot $NATIVE_SDK" \ + --enable-static --disable-shared --enable-pic --pkg-config=pkg-config \ + --extra-cflags="$CFLAGS -I$PREFIX/include" --extra-ldflags="$LDFLAGS" "${feature_flags[@]}"; make -j"$JOBS"; make install) + python3 "$ROOT/tools/ffmpeg-capabilities.py" audit-config --platform "$target_os" "$ffmpeg_build/config.h" + python3 "$ROOT/tools/ffmpeg-capabilities.py" audit-components --platform "$target_os" "$ffmpeg_build/config_components.h" + cmake -S "$SOURCE_ROOT/qcoro" -B "$BUILD_ROOT/qcoro" -GNinja "${cmake_cross[@]}" \ + -DCMAKE_TOOLCHAIN_FILE="$QT_TARGET_PREFIX/lib/cmake/Qt6/qt.toolchain.cmake" -DQT_HOST_PATH="$QT_HOST_PATH" \ + -DBUILD_SHARED_LIBS=OFF -DBUILD_TESTING=OFF -DQCORO_BUILD_EXAMPLES=OFF -DQCORO_WITH_QTDBUS=OFF \ + -DQCORO_WITH_QTTEST=OFF + cmake --build "$BUILD_ROOT/qcoro" --parallel "$JOBS" + cmake --install "$BUILD_ROOT/qcoro" + printf 'Apple media prefix: %s\n' "$PREFIX" fi -mkdir -p "$openssl_build" -export CROSS_TOP="$(dirname "$SDKROOT")" -export CROSS_SDK="$(basename "$SDKROOT")" -case "$APPLE_SDK:$APPLE_ARCH" in - iphoneos:arm64|appletvos:arm64) openssl_target=ios64-xcrun ;; - iphonesimulator:arm64|appletvsimulator:arm64) openssl_target=iossimulator-arm64-xcrun ;; - iphonesimulator:x86_64|appletvsimulator:x86_64) openssl_target=iossimulator-xcrun ;; - *) echo 'Unsupported OpenSSL Apple target.' >&2; exit 2 ;; -esac -# Only the TLS libraries belong in the application closure. OpenSSL's command -# line HTTP server uses fork(), which tvOS explicitly prohibits. -(cd "$openssl_build"; "$SOURCE_ROOT/openssl/Configure" "$openssl_target" no-apps no-docs no-shared no-tests no-comp no-dtls no-srp no-ssl3 no-weak-ssl-ciphers no-asm --prefix="$PREFIX"; make -j"$JOBS" build_libs; make install_dev) -source "$ROOT/tools/lib/streaming-build.sh" -build_streaming_http "$SOURCE_ROOT" "$BUILD_ROOT/streaming" "$PREFIX" OFF "${cmake_cross[@]}" \ - -DUSE_APPLE_SECTRUST=ON -DOPENSSL_ROOT_DIR="$PREFIX" -DOPENSSL_USE_STATIC_LIBS=ON \ - -DOPENSSL_INCLUDE_DIR="$PREFIX/include" -DOPENSSL_CRYPTO_LIBRARY="$PREFIX/lib/libcrypto.a" \ - -DOPENSSL_SSL_LIBRARY="$PREFIX/lib/libssl.a" -DCURL_ZLIB=OFF -python3 "$ROOT/tools/check-streaming-dependencies.py" --prefix "$PREFIX" --manifest "$ROOT/tools/manifests/streaming-third-party.json" -printf '%s\n' "$streaming_pin" >"$streaming_stamp" -cmake -S "$SOURCE_ROOT/freetype" -B "$BUILD_ROOT/freetype" -GNinja "${cmake_cross[@]}" \ - -DBUILD_SHARED_LIBS=OFF -DFT_DISABLE_ZLIB=ON -DFT_DISABLE_BZIP2=ON -DFT_DISABLE_PNG=ON -DFT_DISABLE_HARFBUZZ=ON -DFT_DISABLE_BROTLI=ON -cmake --build "$BUILD_ROOT/freetype" --parallel "$JOBS" -cmake --install "$BUILD_ROOT/freetype" -meson_build() { - local name="$1"; shift - local build="$BUILD_ROOT/$name" - if [[ -f "$build/meson-private/coredata.dat" ]]; then - meson setup --reconfigure "$build" "$SOURCE_ROOT/$name" --cross-file "$CROSS_FILE" --native-file "$NATIVE_FILE" --prefix "$PREFIX" --default-library static "$@" + +if [[ "$phase" != media ]]; then + mpv_build="$BUILD_ROOT/mpv" + mpv_args=(--cross-file "$CROSS_FILE" --native-file "$NATIVE_FILE" --prefix "$MPV_PREFIX" --default-library static --buildtype release + -Dcplayer=false -Dlibmpv=true -Dbuild-date=false -Dtests=false -Dlua=disabled -Djavascript=disabled + -Dmanpage-build=disabled -Dlibarchive=disabled -Dlibbluray=disabled -Dlibcurl=enabled -Dgl=enabled + -Dios-gl=enabled -Dvideotoolbox-gl=disabled -Dvideotoolbox-pl=disabled -Dvulkan=disabled + -Dcocoa=disabled -Dcoreaudio=disabled -Davfoundation=disabled -Daudiounit=enabled + -Dgl-cocoa=disabled) + if [[ -f "$mpv_build/meson-private/coredata.dat" ]]; then + meson setup --reconfigure "$mpv_build" "$ROOT/mpv" "${mpv_args[@]}" else - meson setup "$build" "$SOURCE_ROOT/$name" --cross-file "$CROSS_FILE" --native-file "$NATIVE_FILE" --prefix "$PREFIX" --default-library static "$@" + meson setup "$mpv_build" "$ROOT/mpv" "${mpv_args[@]}" fi - meson compile -C "$build" -j "$JOBS" - meson install -C "$build" -} -meson_build fribidi -Ddocs=false -Dbin=false -Dtests=false -meson_build harfbuzz -Dtests=disabled -Dutilities=disabled -Ddocs=disabled \ - -Dglib=disabled -Dgobject=disabled -Dcairo=disabled -Dchafa=disabled \ - -Dpng=disabled -Dzlib=disabled -Dicu=disabled -Dgraphite=disabled \ - -Dgraphite2=disabled -Dfreetype=enabled -Dfontations=disabled \ - -Dgdi=disabled -Ddirectwrite=disabled -Dcoretext=enabled \ - -Dharfrust=disabled -Dkbts=disabled -Dwasm=disabled -Draster=disabled \ - -Dvector=disabled -Dgpu=disabled -Dsubset=disabled -meson_build libass -Dtest=disabled -Dcompare=disabled -Dprofile=disabled -Dfuzz=disabled -Dfontconfig=disabled -Dlibunibreak=disabled -Dasm=disabled -meson_build libplacebo -Ddemos=false -Dtests=false -Dbench=false -Dfuzz=false -Dvulkan=disabled -Dvk-proc-addr=disabled -Dd3d11=disabled -Dshaderc=disabled -Dglslang=disabled -Dlcms=disabled -Ddovi=disabled -Dlibdovi=disabled -Dxxhash=disabled -Dopengl=enabled -Dgl-proc-addr=enabled -ffmpeg_build="$BUILD_ROOT/ffmpeg" -mkdir -p "$ffmpeg_build" -python3 "$ROOT/tools/ffmpeg-capabilities.py" configure --platform "$target_os" >"$ffmpeg_build/flags" -feature_flags=() -while IFS= read -r flag; do feature_flags+=("$flag"); done <"$ffmpeg_build/flags" -(cd "$ffmpeg_build"; "$SOURCE_ROOT/ffmpeg/configure" --prefix="$PREFIX" --target-os=darwin --arch="$ffmpeg_arch" \ - --enable-cross-compile --cc="$CC" --cxx="$CXX" --ar="$AR" --ranlib="$RANLIB" --sysroot="$SDKROOT" \ - --host-cc="$NATIVE_CC" --host-cflags="-isysroot $NATIVE_SDK" --host-ldflags="-isysroot $NATIVE_SDK" \ - --enable-static --disable-shared --enable-pic --pkg-config=pkg-config \ - --extra-cflags="$CFLAGS -I$PREFIX/include" --extra-ldflags="$LDFLAGS" "${feature_flags[@]}"; make -j"$JOBS"; make install) -python3 "$ROOT/tools/ffmpeg-capabilities.py" audit-config --platform "$target_os" "$ffmpeg_build/config.h" -python3 "$ROOT/tools/ffmpeg-capabilities.py" audit-components --platform "$target_os" "$ffmpeg_build/config_components.h" -mpv_build="$BUILD_ROOT/mpv" -mpv_args=(--cross-file "$CROSS_FILE" --native-file "$NATIVE_FILE" --prefix "$PREFIX" --default-library static --buildtype release - -Dcplayer=false -Dlibmpv=true -Dbuild-date=false -Dtests=false -Dlua=disabled -Djavascript=disabled - -Dmanpage-build=disabled -Dlibarchive=disabled -Dlibbluray=disabled -Dlibcurl=enabled -Dgl=enabled - -Dios-gl=enabled -Dvideotoolbox-gl=disabled -Dvideotoolbox-pl=disabled -Dvulkan=disabled - -Dcocoa=disabled -Dcoreaudio=disabled -Davfoundation=disabled -Daudiounit=enabled - -Dgl-cocoa=disabled) -if [[ -f "$mpv_build/meson-private/coredata.dat" ]]; then - meson setup --reconfigure "$mpv_build" "$ROOT/mpv" "${mpv_args[@]}" -else - meson setup "$mpv_build" "$ROOT/mpv" "${mpv_args[@]}" + meson compile -C "$mpv_build" -j "$JOBS" + meson install -C "$mpv_build" fi -meson compile -C "$mpv_build" -j "$JOBS" -meson install -C "$mpv_build" -cmake -S "$SOURCE_ROOT/qcoro" -B "$BUILD_ROOT/qcoro" -GNinja "${cmake_cross[@]}" \ - -DCMAKE_TOOLCHAIN_FILE="$QT_TARGET_PREFIX/lib/cmake/Qt6/qt.toolchain.cmake" -DQT_HOST_PATH="$QT_HOST_PATH" \ - -DBUILD_SHARED_LIBS=OFF -DBUILD_TESTING=OFF -DQCORO_BUILD_EXAMPLES=OFF -DQCORO_WITH_QTDBUS=OFF \ - -DQCORO_WITH_QTTEST=OFF -cmake --build "$BUILD_ROOT/qcoro" --parallel "$JOBS" -cmake --install "$BUILD_ROOT/qcoro" -printf 'Apple media prefix: %s\n' "$PREFIX" diff --git a/tools/apple/build-ios-scanner.sh b/tools/apple/build-ios-scanner.sh index ef8b9448..f0335d9f 100755 --- a/tools/apple/build-ios-scanner.sh +++ b/tools/apple/build-ios-scanner.sh @@ -4,14 +4,13 @@ ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)" source "$ROOT/tools/lib/manifest-sources.sh" [[ "$(uname -s)" == Darwin ]] || { echo 'iOS host tools require macOS and Xcode.' >&2; exit 1; } : "${QT_HOST_PATH:?Set QT_HOST_PATH to the pinned macOS Qt kit}" -manifest="$ROOT/tools/manifests/toolchain.json" -version="$(python3 -c 'import json,sys; print(json.load(open(sys.argv[1]))["qt"]["version"])' "$manifest")" +version="$(toolchain_field "$ROOT" qt.version)" [[ "$("$QT_HOST_PATH/bin/qtpaths" --query QT_VERSION)" == "$version" ]] || { echo "error: QT_HOST_PATH must supply Qt $version host tools" >&2; exit 1; } -base_url="$(python3 -c 'import json,sys; print(json.load(open(sys.argv[1]))["qt"]["baseUrl"])' "$manifest")" -sha="$(python3 -c 'import json,sys; print(json.load(open(sys.argv[1]))["qt"]["sources"]["qtdeclarative"])' "$manifest")" -series="$(python3 -c 'import json,sys; print(json.load(open(sys.argv[1]))["qt"]["series"])' "$manifest")" +base_url="$(toolchain_qt_sources_url "$ROOT")" +sha="$(toolchain_field "$ROOT" qt.sources.qtdeclarative)" +series="$(toolchain_field "$ROOT" qt.series)" source_root="$ROOT/build/apple/qt-sources/$version/qtdeclarative" archive="$ROOT/build/apple/downloads/qtdeclarative-everywhere-src-$version.tar.xz" download_verified "$base_url/qtdeclarative-everywhere-src-$version.tar.xz" "$sha" "$archive" diff --git a/tools/apple/build-qt-tvos.sh b/tools/apple/build-qt-tvos.sh index 31832821..2cfbc624 100755 --- a/tools/apple/build-qt-tvos.sh +++ b/tools/apple/build-qt-tvos.sh @@ -11,7 +11,7 @@ fi : "${QT_HOST_PATH:?Set QT_HOST_PATH to the pinned macOS Qt host-tools prefix}" APPLE_SDK="${APPLE_SDK:-appletvsimulator}" APPLE_ARCH="${APPLE_ARCH:-arm64}" -APPLE_DEPLOYMENT_TARGET="${APPLE_DEPLOYMENT_TARGET:-16.0}" +APPLE_DEPLOYMENT_TARGET="${APPLE_DEPLOYMENT_TARGET:-$(toolchain_field "$ROOT" apple.tvosDeploymentTarget)}" case "$APPLE_SDK:$APPLE_ARCH" in appletvos:arm64|appletvsimulator:arm64|appletvsimulator:x86_64) ;; *) echo "error: unsupported tvOS SDK/architecture: $APPLE_SDK/$APPLE_ARCH" >&2; exit 1 ;; @@ -20,9 +20,9 @@ xcrun --sdk "$APPLE_SDK" --show-sdk-path >/dev/null for tool in cmake ninja curl python3 gpatch; do command -v "$tool" >/dev/null || { echo "error: missing $tool" >&2; exit 1; } done -manifest="$ROOT/tools/manifests/toolchain.json" -version="$(python3 -c 'import json,sys;print(json.load(open(sys.argv[1]))["qt"]["version"])' "$manifest")" -base_url="$(python3 -c 'import json,sys;print(json.load(open(sys.argv[1]))["qt"]["baseUrl"])' "$manifest")" +version="$(toolchain_field "$ROOT" qt.version)" +base_url="$(toolchain_qt_sources_url "$ROOT")" +series="$(toolchain_field "$ROOT" qt.series)" if [[ "$("$QT_HOST_PATH/bin/qtpaths" --query QT_VERSION)" != "$version" ]]; then echo "error: QT_HOST_PATH must supply Qt $version host tools" >&2 exit 1 @@ -38,8 +38,8 @@ mkdir -p "$source_root" "$build_root/empty-pkgconfig" "$prefix" # Qt retains a UIKit tvOS source port, but does not list tvOS as an officially # supported/tested platform. A successful source build is a prerequisite, not # evidence of device playback, accessibility, or App Store acceptance. -for module in qtbase qtshadertools qttasktree qtdeclarative qtsvg qtimageformats qtwebsockets qttools; do - sha="$(python3 -c 'import json,sys;print(json.load(open(sys.argv[1]))["qt"]["sources"][sys.argv[2]])' "$manifest" "$module")" +while IFS= read -r module; do + sha="$(toolchain_field "$ROOT" "qt.sources.$module")" archive="$ROOT/build/apple/downloads/$module-everywhere-src-$version.tar.xz" download_verified "$base_url/$module-everywhere-src-$version.tar.xz" "$sha" "$archive" extract_verified_source "$archive" "$sha" "$source_root/$module" @@ -56,7 +56,6 @@ for module in qtbase qtshadertools qttasktree qtdeclarative qtsvg qtimageformats if [[ "$module" == qtdeclarative ]]; then # Reuse the project's existing scanner subtree fix. The official host kit # otherwise scans deliberately invalid Qt parser fixtures under build/. - series="$(python3 -c 'import json,sys;print(json.load(open(sys.argv[1]))["qt"]["series"])' "$manifest")" patch_file="$ROOT/tools/webos-native/patches/qtdeclarative-$series-qmlimportscanner-exclude-subtrees.patch" if gpatch --dry-run --forward --silent -d "$source_root/$module" -p1 <"$patch_file" >/dev/null 2>&1; then gpatch --forward -d "$source_root/$module" -p1 <"$patch_file" @@ -92,5 +91,5 @@ for module in qtbase qtshadertools qttasktree qtdeclarative qtsvg qtimageformats fi cmake --build "$build_root/$module" --parallel "$jobs" -- -k 0 cmake --install "$build_root/$module" -done +done < <(manifest_json_array "$ROOT/tools/manifests/toolchain.json" apple.tvosQtSourceModules) printf 'Built source Qt %s for %s/%s at %s\n' "$version" "$APPLE_SDK" "$APPLE_ARCH" "$prefix" diff --git a/tools/apple/install-build-tools.sh b/tools/apple/install-build-tools.sh new file mode 100644 index 00000000..55bd2348 --- /dev/null +++ b/tools/apple/install-build-tools.sh @@ -0,0 +1,26 @@ +#!/usr/bin/env bash +set -euo pipefail +ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)" + +formulae=() +packages=() +while IFS= read -r entry; do + case "$entry" in + ''|\#*) ;; + *==*) packages+=("$entry") ;; + *) formulae+=("$entry") ;; + esac +done <"$ROOT/tools/manifests/macos-tools.txt" + +missing=() +for formula in "${formulae[@]}"; do + if ! brew list --formula "$formula" >/dev/null 2>&1; then + missing+=("$formula") + fi +done +if [[ -n "${missing[0]:-}" ]]; then + HOMEBREW_NO_AUTO_UPDATE=1 brew install "${missing[@]}" +fi +python3 -m venv "$RUNNER_TEMP/apple-build-tools" +"$RUNNER_TEMP/apple-build-tools/bin/pip" install "${packages[@]}" +echo "$RUNNER_TEMP/apple-build-tools/bin" >>"$GITHUB_PATH" diff --git a/tools/build-ios.sh b/tools/build-ios.sh index f0361bff..0e1b661d 100755 --- a/tools/build-ios.sh +++ b/tools/build-ios.sh @@ -1,17 +1,18 @@ #!/usr/bin/env bash set -euo pipefail ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" +source "$ROOT/tools/lib/manifest-sources.sh" [[ "$(uname -s)" == Darwin ]] || { echo 'iOS builds require macOS and Xcode.' >&2; exit 1; } : "${QT_TARGET_PREFIX:?Set QT_TARGET_PREFIX to the iOS Qt kit}" : "${QT_HOST_PATH:?Set QT_HOST_PATH to the matching macOS Qt kit}" export APPLE_SYSTEM=iOS export APPLE_SDK="${APPLE_SDK:-iphoneos}" if [[ "$APPLE_SDK" == iphonesimulator ]]; then - export APPLE_ARCH="${APPLE_ARCH:-x86_64}" + export APPLE_ARCH="${APPLE_ARCH:-$(uname -m)}" else export APPLE_ARCH="${APPLE_ARCH:-arm64}" fi -export APPLE_DEPLOYMENT_TARGET="${APPLE_DEPLOYMENT_TARGET:-17.0}" +export APPLE_DEPLOYMENT_TARGET="${APPLE_DEPLOYMENT_TARGET:-$(toolchain_field "$ROOT" apple.iosDeploymentTarget)}" case "$APPLE_SDK:$APPLE_ARCH" in iphoneos:arm64|iphonesimulator:arm64|iphonesimulator:x86_64) ;; *) echo "error: unsupported iOS SDK/architecture: $APPLE_SDK/$APPLE_ARCH" >&2; exit 1 ;; @@ -35,9 +36,14 @@ xcrun --sdk "$APPLE_SDK" --show-sdk-path >/dev/null bash "$ROOT/tools/apple/build-ios-scanner.sh" BASE="$ROOT/build/apple/$APPLE_SDK-$APPLE_ARCH" export APPLE_DEPS_PREFIX="${APPLE_DEPS_PREFIX:-$BASE/prefix}" -if [[ "${BUILD_DEPENDENCIES:-1}" == 1 ]]; then "$ROOT/tools/apple/build-dependencies.sh"; fi -export PKG_CONFIG_PATH="$APPLE_DEPS_PREFIX/lib/pkgconfig" -export PKG_CONFIG_LIBDIR="$PKG_CONFIG_PATH" +case "${BUILD_DEPENDENCIES:-1}" in + 1) bash "$ROOT/tools/apple/build-dependencies.sh" ;; + mpv) bash "$ROOT/tools/apple/build-dependencies.sh" mpv ;; + 0) ;; + *) echo 'error: BUILD_DEPENDENCIES must be 0, 1, or mpv' >&2; exit 2 ;; +esac +export PKG_CONFIG_LIBDIR="${APPLE_MPV_PREFIX:+$APPLE_MPV_PREFIX/lib/pkgconfig:}$APPLE_DEPS_PREFIX/lib/pkgconfig" +export PKG_CONFIG_PATH="$PKG_CONFIG_LIBDIR" ASSETS="$BASE/Spool.xcassets" mkdir -p "$ASSETS/AppIcon.appiconset" magick "$ROOT/app/icons/png/spool/1024.png" -background black -alpha remove -alpha off "$ASSETS/AppIcon.appiconset/icon.png" diff --git a/tools/build-tvos.sh b/tools/build-tvos.sh index 7d8804ec..f4aea7b1 100755 --- a/tools/build-tvos.sh +++ b/tools/build-tvos.sh @@ -1,6 +1,7 @@ #!/usr/bin/env bash set -euo pipefail ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" +source "$ROOT/tools/lib/manifest-sources.sh" if [[ "$(uname -s)" != Darwin ]]; then echo 'error: tvOS builds require macOS and Xcode with the Apple TV SDK' >&2 exit 1 @@ -8,7 +9,7 @@ fi export APPLE_SYSTEM=tvOS export APPLE_SDK="${APPLE_SDK:-appletvsimulator}" export APPLE_ARCH="${APPLE_ARCH:-arm64}" -export APPLE_DEPLOYMENT_TARGET="${APPLE_DEPLOYMENT_TARGET:-16.0}" +export APPLE_DEPLOYMENT_TARGET="${APPLE_DEPLOYMENT_TARGET:-$(toolchain_field "$ROOT" apple.tvosDeploymentTarget)}" export QT_TARGET_PREFIX="${QT_TARGET_PREFIX:-$ROOT/build/apple/$APPLE_SDK-$APPLE_ARCH/qt}" export APPLE_DEPS_PREFIX="${APPLE_DEPS_PREFIX:-$ROOT/build/apple/$APPLE_SDK-$APPLE_ARCH/prefix}" : "${QT_HOST_PATH:?Set QT_HOST_PATH to the pinned macOS Qt host-tools prefix}" @@ -25,9 +26,14 @@ xcrun --sdk "$APPLE_SDK" --show-sdk-path >/dev/null if [[ "$APPLE_SDK" == appletvsimulator ]]; then xcrun --find derq >/dev/null fi -bash "$ROOT/tools/apple/build-qt-tvos.sh" -bash "$ROOT/tools/apple/build-dependencies.sh" -export PKG_CONFIG_LIBDIR="$APPLE_DEPS_PREFIX/lib/pkgconfig" +if [[ "${BUILD_QT:-1}" == 1 ]]; then bash "$ROOT/tools/apple/build-qt-tvos.sh"; fi +case "${BUILD_DEPENDENCIES:-1}" in + 1) bash "$ROOT/tools/apple/build-dependencies.sh" ;; + mpv) bash "$ROOT/tools/apple/build-dependencies.sh" mpv ;; + 0) ;; + *) echo 'error: BUILD_DEPENDENCIES must be 0, 1, or mpv' >&2; exit 2 ;; +esac +export PKG_CONFIG_LIBDIR="${APPLE_MPV_PREFIX:+$APPLE_MPV_PREFIX/lib/pkgconfig:}$APPLE_DEPS_PREFIX/lib/pkgconfig" export PKG_CONFIG_PATH="$PKG_CONFIG_LIBDIR" app_build="$ROOT/build/tvos/$APPLE_SDK-$APPLE_ARCH/app" assets="$ROOT/build/tvos/$APPLE_SDK-$APPLE_ARCH/Assets.xcassets" diff --git a/tools/check-release-artifacts.sh b/tools/check-release-artifacts.sh index ae978504..d1a47ffa 100755 --- a/tools/check-release-artifacts.sh +++ b/tools/check-release-artifacts.sh @@ -15,6 +15,7 @@ root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" build="$root/.github/workflows/build-artifacts.yml" release="$root/.github/workflows/release.yml" ios="$root/.github/workflows/ios-review.yml" +tvos="$root/.github/workflows/tvos.yml" status=0 tvos_devices=0 ios_devices=0 @@ -30,10 +31,10 @@ names="$(awk ' next } in_upload && /^[[:space:]]*-[[:space:]]/ { in_upload = 0 } -' "$build" "$ios")" +' "$build" "$ios" "$tvos")" [[ -n "$names" ]] || { - echo "error: found no uploaded artifacts to check in build-artifacts.yml" >&2 + echo "error: found no uploaded artifacts to check in the build workflows" >&2 exit 1 } diff --git a/tools/lib/manifest-sources.sh b/tools/lib/manifest-sources.sh index 0b638c94..e056f424 100644 --- a/tools/lib/manifest-sources.sh +++ b/tools/lib/manifest-sources.sh @@ -29,39 +29,6 @@ print(value) ' "$manifest" "$source_name" "$field" } -manifest_qt_field() { - local manifest="$1" - local field="$2" - "$MANIFEST_PYTHON" -c ' -import json -import sys -sys.stdout.reconfigure(newline="\n") - -with open(sys.argv[1], encoding="utf-8") as handle: - data = json.load(handle) -print(data[sys.argv[2]]) -' "$manifest" "$field" -} - -manifest_qt_module_sha256() { - local manifest="$1" - local module="$2" - "$MANIFEST_PYTHON" -c ' -import json -import sys -sys.stdout.reconfigure(newline="\n") - -with open(sys.argv[1], encoding="utf-8") as handle: - data = json.load(handle) -for module in data["modules"]: - if module["name"] == sys.argv[2]: - print(module["sha256"]) - break -else: - raise SystemExit(f"module not found in manifest: {sys.argv[2]}") -' "$manifest" "$module" -} - manifest_tool_field() { local manifest="$1" local tool_name="$2" @@ -86,8 +53,10 @@ import sys sys.stdout.reconfigure(newline="\n") with open(sys.argv[1], encoding="utf-8") as handle: - data = json.load(handle) -for value in data[sys.argv[2]]: + values = json.load(handle) +for key in sys.argv[2].split("."): + values = values[key] +for value in values: print(value) ' "$manifest" "$key" } @@ -206,10 +175,19 @@ with open(sys.argv[1] + "/tools/manifests/toolchain.json", encoding="utf-8") as value = json.load(handle) for key in sys.argv[2].split("."): value = value[key] -print(value) +print(" ".join(value) if isinstance(value, list) else value) ' "$root" "$path" } +toolchain_qt_sources_url() { + local root="$1" + local archive_field="${2:-qt.archiveBaseUrl}" + printf '%s/%s/%s/submodules\n' \ + "$(toolchain_field "$root" "$archive_field")" \ + "$(toolchain_field "$root" qt.series)" \ + "$(toolchain_field "$root" qt.version)" +} + # FFmpeg is pinned centrally rather than repeated per platform, so the cross # builds fetch it straight from the toolchain manifest. prepare_toolchain_ffmpeg() { diff --git a/tools/manifests/macos-tools.txt b/tools/manifests/macos-tools.txt new file mode 100644 index 00000000..7eedf88d --- /dev/null +++ b/tools/manifests/macos-tools.txt @@ -0,0 +1,12 @@ +# Python wheels pin the tools that generate cached build trees. +cmake==4.2.3 +ninja==1.13.0 +meson==1.9.1 +# Other host tool names are Homebrew formulae. The runner may already have them. +bash +pkgconf +imagemagick +nasm +gpatch +ffmpeg +tesseract diff --git a/tools/manifests/qt-android.json b/tools/manifests/qt-android.json index ea33a718..1a9baff9 100644 --- a/tools/manifests/qt-android.json +++ b/tools/manifests/qt-android.json @@ -1,20 +1,4 @@ { "schemaVersion": 1, - "qtVersion": "6.12.0", - "series": "6.12", - "baseUrl": "https://ftp.fau.de/qtproject/archive/qt/6.12/6.12.0/submodules", - "modules": [ - {"name": "qtbase", "sha256": "a951bd163c7b80fc6b8c88d7668fb56abf91c152373e13c10666763238131307"}, - {"name": "qtshadertools", "sha256": "c7d84f436e1aaef39fdcadebf2bd71bdf24dc69497e13f2e0198873cbbfea2ab"}, - {"name": "qtdeclarative", "sha256": "311f3a2603e1973bb59baef9dfa740a376de713157d4782ee043681e889c9260"}, - {"name": "qtsvg", "sha256": "e4ab39534ec97987b1b9b60ef7f4d3253d5912a69f8c713a01753174a4029331"}, - {"name": "qtimageformats", "sha256": "0943132b5db8de6b6a7f1d162682173e8763c7ed94e80fd39113292845f67762"}, - {"name": "qtwebsockets", "sha256": "21690a365cd5fbfa8dea051473e98968df9f4eca0121fed7481d1215b7455a31"} - ], - "android": { - "compileSdk": "36", - "buildTools": "36.0.0", - "ndkVersion": "27.2.12479018", - "minimumSdk": "28" - } + "modules": ["qtbase", "qtshadertools", "qtdeclarative", "qtsvg", "qtimageformats", "qtwebsockets"] } diff --git a/tools/manifests/qt-webos.json b/tools/manifests/qt-webos.json index 7bcec427..ae0964e7 100644 --- a/tools/manifests/qt-webos.json +++ b/tools/manifests/qt-webos.json @@ -1,18 +1,6 @@ { "schemaVersion": 1, - "qtVersion": "6.12.0", - "series": "6.12", - "baseUrl": "https://ftp.fau.de/qtproject/archive/qt/6.12/6.12.0/submodules", - "modules": [ - {"name": "qtbase", "sha256": "a951bd163c7b80fc6b8c88d7668fb56abf91c152373e13c10666763238131307"}, - {"name": "qtshadertools", "sha256": "c7d84f436e1aaef39fdcadebf2bd71bdf24dc69497e13f2e0198873cbbfea2ab"}, - {"name": "qttools", "sha256": "8dab8f3611496486a470ad5f115ceea584f36bc22a2b8b6f6ebdbafbb8160693"}, - {"name": "qtdeclarative", "sha256": "311f3a2603e1973bb59baef9dfa740a376de713157d4782ee043681e889c9260"}, - {"name": "qtwebsockets", "sha256": "21690a365cd5fbfa8dea051473e98968df9f4eca0121fed7481d1215b7455a31"}, - {"name": "qtwayland", "sha256": "ae14d9bcf1bb3c300a3ab2e6a53f50284e5c6c966a4ac4cc5aedcb1bc74e4d02"}, - {"name": "qtimageformats", "sha256": "0943132b5db8de6b6a7f1d162682173e8763c7ed94e80fd39113292845f67762"}, - {"name": "qtsvg", "sha256": "e4ab39534ec97987b1b9b60ef7f4d3253d5912a69f8c713a01753174a4029331"} - ], + "modules": ["qtbase", "qtshadertools", "qttools", "qtdeclarative", "qtwebsockets", "qtwayland", "qtimageformats", "qtsvg"], "patches": [ "tools/webos-native/patches/qtbase-6.12-webos-qstorageinfo-linux.patch", "tools/webos-native/patches/qtbase-6.12-webos-qelfparser.patch", @@ -31,17 +19,9 @@ "buildrootVersion": "2025.02.1", "gccVersion": "14.2.0" }, - "outputs": { - "hostPrefix": "build/qt6-612-host-install", - "sharedTargetPrefix": "build/qt6-612-target-install", - "staticTargetPrefix": "build/qt6-612-target-static-install" - }, "configure": { "host": ["release", "examples=off", "tests=off", "opengl=off"], "targetShared": ["release", "examples=off", "tests=off", "shared"], "targetStatic": ["release", "examples=off", "tests=off", "static"] - }, - "submodules": { - "mpv": "09c26d3803000730ced3b9245c5c3cc286142e76" } } diff --git a/tools/manifests/qt-windows.json b/tools/manifests/qt-windows.json index 7f44ebb4..66bdaeb3 100644 --- a/tools/manifests/qt-windows.json +++ b/tools/manifests/qt-windows.json @@ -1,6 +1,4 @@ { - "version": "6.12.0", - "architecture": "msvc2022_64", "repository": "https://download.qt.io/online/qtsdkrepository/windows_x86/desktop/qt6_6120/qt6_6120_msvc2022_64", "packageVersion": "6.12.0-0-202609280346", "archives": [ diff --git a/tools/manifests/toolchain.json b/tools/manifests/toolchain.json index f1e8033b..f3abb399 100644 --- a/tools/manifests/toolchain.json +++ b/tools/manifests/toolchain.json @@ -9,7 +9,8 @@ "version": "6.12.0", "series": "6.12", "windowsKit": "msvc2022_64", - "baseUrl": "https://download.qt.io/official_releases/qt/6.12/6.12.0/submodules", + "archiveBaseUrl": "https://download.qt.io/official_releases/qt", + "fauArchiveBaseUrl": "https://ftp.fau.de/qtproject/archive/qt", "sources": { "qt3d": "d16f7489945c6c9e971cedd4362202a2681f3c10393461e1f5e74425f7fef59a", "qt5compat": "78cf1c283795312a7fa31c73eb7f7f556b48374adc484f10ad5a3c0bcb59264e", @@ -95,5 +96,36 @@ "url": "https://github.com/KhronosGroup/Vulkan-Headers/archive/refs/tags/vulkan-sdk-1.4.357.0.tar.gz", "sha256": "e87dce08116151f6b6d7de6b6faf41498e87e6cf848ff16fa3bd5402190ad4a3" } + }, + "apple": { + "iosDeploymentTarget": "17.0", + "tvosDeploymentTarget": "16.0", + "aqtinstall": "3.3.0", + "qtModules": [ + "qtshadertools", + "qttasktree", + "qtwebsockets", + "qtimageformats" + ], + "tvosQtSourceModules": [ + "qtbase", + "qtshadertools", + "qttasktree", + "qtdeclarative", + "qtsvg", + "qtimageformats", + "qtwebsockets", + "qttools" + ] + }, + "nix": { + "version": "2.29.2", + "quickInstallRelease": "v34" + }, + "android": { + "compileSdk": "36", + "buildTools": "36.0.0", + "ndkVersion": "27.2.12479018", + "minimumSdk": "28" } } diff --git a/tools/toolchain-versions.py b/tools/toolchain-versions.py new file mode 100644 index 00000000..f43c712b --- /dev/null +++ b/tools/toolchain-versions.py @@ -0,0 +1,250 @@ +#!/usr/bin/env python3 +"""Validate version pins and fingerprint the inputs to CI's build caches.""" + +import hashlib +import json +from pathlib import Path +import re +import subprocess +import sys + + +ROOT = Path(__file__).resolve().parents[1] +MANIFESTS = "tools/manifests" + + +def load(path): + return json.loads(path.read_text(encoding="utf-8")) + + +def fingerprint(root, *data, files=()): + paths = sorted({path for pattern in files for path in root.glob(pattern) if path.is_file()}) + inputs = [(path.relative_to(root).as_posix(), hashlib.sha256(path.read_bytes()).hexdigest()) + for path in paths] + return hashlib.sha256(json.dumps((data, inputs), sort_keys=True).encode()).hexdigest()[:24] + + +def outputs(root, mpv_revision): + manifests = root / MANIFESTS + pins = load(manifests / "toolchain.json") + qt, apple, android, qcoro = (pins[name] for name in ("qt", "apple", "android", "qcoro")) + android_qt = load(manifests / "qt-android.json") + webos_qt = load(manifests / "qt-webos.json") + android_sources = load(manifests / "android-third-party.json")["sources"] + streaming_sources = load(manifests / "streaming-third-party.json")["sources"] + + def qt_sources(modules, mirror): + return (qt["version"], qt["series"], qt[mirror], modules, + {module: qt["sources"][module] for module in modules}) + + streaming = fingerprint(root, streaming_sources, files=( + "tools/prepare-streaming-sources.sh", "tools/streaming-fingerprint.py", + "tools/check-streaming-dependencies.py", "tools/cmake/StreamingDependencies.cmake", + "tools/cmake/QuicBatchingProbe/CMakeLists.txt", "tools/lib/streaming-build.sh", + "tools/patches/curl-*.patch", + )) + ffmpeg = fingerprint(root, pins["ffmpeg"], files=( + f"{MANIFESTS}/ffmpeg-capabilities.json", "tools/ffmpeg-capabilities.py", + )) + native_shell = fingerprint(root, qt, qcoro, ffmpeg, streaming, pins["nix"], files=( + "flake.nix", "flake.lock", "tools/patches/**/*", + "tools/webos-native/patches/qtdeclarative-*-qmlimportscanner-exclude-subtrees.patch", + )) + mpv = fingerprint(root, mpv_revision, files=(f"{MANIFESTS}/mpv-native.json",)) + apple_tools = fingerprint(root, files=(f"{MANIFESTS}/macos-tools.txt", "tools/apple/install-build-tools.sh")) + apple_host = fingerprint(root, qt["version"], apple["aqtinstall"], apple["qtModules"]) + ios_kit = fingerprint(root, apple_host, files=("tools/apple/aqt-ios.py",)) + tvos_qt = fingerprint(root, apple_host, apple_tools, apple["tvosDeploymentTarget"], + qt_sources(apple["tvosQtSourceModules"], "archiveBaseUrl"), files=( + "tools/apple/build-qt-tvos.sh", "tools/apple/patches/qt-tvos-*.patch", + "tools/apple/qmlimportscanner/CMakeLists.txt", "tools/lib/manifest-sources.sh", + "tools/webos-native/patches/qtdeclarative-*-qmlimportscanner-exclude-subtrees.patch", + )) + apple_sources = {name: android_sources[name] for name in + ("freetype", "qcoro", "fribidi", "harfbuzz", "libass", "libplacebo")} + apple_deps = fingerprint(root, apple_sources, apple_tools, streaming, ffmpeg, files=( + "tools/apple/build-dependencies.sh", "tools/lib/manifest-sources.sh", + )) + # Qt probes the target's TLS and FreeType libraries, independently of the + # FFmpeg, mpv and QCoro builds in the same prefix. + android_qt_key = fingerprint(root, android, streaming_sources["openssl"], android_sources["freetype"], + qt_sources(android_qt["modules"], "fauArchiveBaseUrl"), files=( + "tools/android/build-qt6.sh", "tools/android/patches/qt-android-*.patch", + "tools/lib/manifest-sources.sh", + )) + android_media_sources = {name: source for name, source in android_sources.items() if name != "qcoro"} + android_deps = fingerprint(root, android, android_media_sources, ffmpeg, streaming, files=( + "tools/android/build-dependencies.sh", + "tools/android/gradle-mirror.sh", "tools/android/patches/*.patch", + "tools/lib/manifest-sources.sh", "tools/lib/build-common.sh", + )) + webos_deps = fingerprint(root, webos_qt, qt_sources(webos_qt["modules"], "fauArchiveBaseUrl"), + streaming, ffmpeg, files=( + f"{MANIFESTS}/webos-third-party.json", "tools/lib/manifest-sources.sh", + "tools/lib/build-common.sh", "tools/webos-native/build-webos.sh", + "tools/webos-native/build-qt6.sh", "tools/webos-native/build-qcoro.sh", + "tools/webos-native/build-third-party.sh", "tools/webos-native/build-ffmpeg.sh", + "tools/webos-native/build-curl.sh", "tools/webos-native/restore-toolchain.sh", + "tools/webos-native/nixos-sdk-compat.sh", "tools/webos-native/*.cmake", + "tools/webos-native/patches/*.patch", + )) + return { + "qt_version": qt["version"], + "qt_series": qt["series"], + "qt_build_tag": qt["series"].replace(".", ""), + "qt_windows_kit": qt["windowsKit"], + "ffmpeg_version": pins["ffmpeg"]["version"], + "qcoro_revision": qcoro["revision"], + "qcoro_windows_prefix": qcoro["windowsPrefix"], + "ios_deployment_target": apple["iosDeploymentTarget"], + "tvos_deployment_target": apple["tvosDeploymentTarget"], + "apple_qt_modules": " ".join(apple["qtModules"]), + "aqt_version": apple["aqtinstall"], + "android_build_tools": android["buildTools"], + "nix_version": pins["nix"]["version"], + "key_qt": fingerprint(root, qt), + "key_mpv": mpv, + "key_streaming": streaming, + "key_ffmpeg": ffmpeg, + "key_native_shell": native_shell, + "key_linux_build": fingerprint(root, native_shell, mpv, files=( + "tools/build-linux-release.sh", "tools/lib/build-common.sh", + )), + "key_macos_build": fingerprint(root, native_shell, mpv, files=( + "tools/build-macos.sh", "tools/lib/build-common.sh", + )), + "key_apple_host": apple_host, + "key_ios_kit": ios_kit, + "key_tvos_qt": tvos_qt, + "key_apple_deps": apple_deps, + "key_ios_app": fingerprint(root, files=("tools/build-ios.sh", "tools/apple/build-ios-scanner.sh")), + "key_tvos_app": fingerprint(root, files=("tools/build-tvos.sh",)), + "key_android_qt": android_qt_key, + "key_android_deps": android_deps, + "key_webos_deps": webos_deps, + "key_webos_build": fingerprint(root, mpv, files=("build-ipk.sh", "tools/lib/build-common.sh")), + "key_windows_qt": fingerprint(root, qt["version"], qt["windowsKit"], qcoro, files=( + f"{MANIFESTS}/qt-windows.json", "tools/windows/install-qt.ps1", "tools/windows/install-qcoro.ps1", + )), + } + + +def version_errors(root): + manifests = root / MANIFESTS + pins = load(manifests / "toolchain.json") + qt, apple, android, nix = (pins[name] for name in ("qt", "apple", "android", "nix")) + errors = [] + + def require(condition, message): + if not condition: + errors.append(message) + + def check_modules(modules, label): + valid = isinstance(modules, list) and bool(modules) and all( + isinstance(module, str) and module in qt["sources"] for module in modules + ) + require(valid, f"{label} must list modules by name from toolchain.json") + if valid: + require(len(set(modules)) == len(modules), f"{label} contains duplicate modules") + + semver = r"\d+\.\d+\.\d+" + require(re.fullmatch(semver, qt["version"]) and qt["version"].rsplit(".", 1)[0] == qt["series"], + "toolchain.json Qt version and series disagree") + require(all(re.fullmatch(r"[a-f0-9]{64}", digest) for digest in qt["sources"].values()), + "toolchain.json Qt sources must have SHA-256 digests") + for platform in ("android", "webos"): + name = f"qt-{platform}.json" + data = load(manifests / name) + require(not (data.keys() & {"qtVersion", "version", "series", "baseUrl", "android"}), + f"{name} repeats toolchain.json pins") + check_modules(data["modules"], name) + check_modules(apple["qtModules"], "apple.qtModules") + check_modules(apple["tvosQtSourceModules"], "apple.tvosQtSourceModules") + for target in ("iosDeploymentTarget", "tvosDeploymentTarget"): + require(re.fullmatch(r"\d+\.\d+", apple[target]), f"invalid apple.{target}") + for name, value in (("apple.aqtinstall", apple["aqtinstall"]), ("android.buildTools", android["buildTools"]), + ("android.ndkVersion", android["ndkVersion"]), ("nix.version", nix["version"])): + require(re.fullmatch(semver, value), f"invalid {name}") + require(android["minimumSdk"].isdigit() and android["compileSdk"].isdigit() + and int(android["minimumSdk"]) <= int(android["compileSdk"]), "invalid Android SDK bounds") + macos_tools = (manifests / "macos-tools.txt").read_text(encoding="utf-8") + for tool in ("cmake", "ninja", "meson"): + require(re.search(rf"(?m)^{tool}=={semver}$", macos_tools), + f"macos-tools.txt must pin the {tool} version") + + windows = load(manifests / "qt-windows.json") + require(not (windows.keys() & {"version", "architecture"}), "qt-windows.json repeats toolchain.json pins") + qt_digits = qt["version"].replace(".", "") + require(windows["packageVersion"].startswith(qt["version"] + "-") and + windows["repository"].endswith(f"/qt6_{qt_digits}/qt6_{qt_digits}_{qt['windowsKit']}") and + all(archive["package"].startswith(f"qt.qt6.{qt_digits}.") and + archive["package"].endswith(f".win64_{qt['windowsKit']}") for archive in windows["archives"]), + "qt-windows.json official archive metadata disagrees with the Qt version or kit") + require(qt["fauArchiveBaseUrl"] == "https://ftp.fau.de/qtproject/archive/qt", + "cross-built Qt must use the FAU archive mirror") + for platform in ("android", "webos"): + name = f"{platform}-third-party.json" + require("ffmpeg" not in load(manifests / name)["sources"], + f"{name} still pins FFmpeg; toolchain.json owns it") + + installer = (root / ".github/actions/install-nix/action.yml").read_text(encoding="utf-8") + action = re.search(r"uses: nixbuild/nix-quick-install-action@[0-9a-f]{40}\s+# (v\d+)", installer) + require(action and action[1] == nix["quickInstallRelease"], + "nix-quick-install action version comment must match toolchain.json") + for field in ("version", "quickInstallRelease"): + require(f"tools/toolchain-versions.sh nix.{field}" in installer, + f"install-nix must read nix.{field} from toolchain.json") + require(not re.search(r"(?m)^\s+RELEASE:\s*[\"']?v\d+", installer), + "install-nix repeats the archive release pin") + renovate = load(root / "renovate.json") + installer_name = "nixbuild/nix-quick-install-action" + require(any(manager.get("depNameTemplate") == installer_name and + "quickInstallRelease" in "".join(manager.get("matchStrings", [])) + for manager in renovate["customManagers"]), + "Renovate must track the Nix archive release pin") + require(any(installer_name in rule.get("matchPackageNames", []) and rule.get("groupName") + for rule in renovate["packageRules"]), + "Renovate must group the Nix archive release and installer action") + + literal_pin = re.compile( + r"\b(?:APPLE_DEPLOYMENT_TARGET|QT_VERSION|FFMPEG_VERSION|NIX_VERSION)\s*[:=]\s*[\"']?\d+\.\d+" + r"|aqtinstall==\d|build-tools/\d+\.\d+|brew list --versions" + r"|\b(?:ios|tvos)DeploymentTarget\s*[:=]\s*[\"']?\d+\.\d+" + ) + cache_key = re.compile( + r"\s+(?:primary-)?key:\s*(?:android6-|android-qt-|apple-(?:host-qt|ios-kit|media)-" + r"|ios-app-|tvos-(?:source1|qt|app)-|webos-(?:deps|build)-|windows-(?:qt|mpv)-" + r"|linux-build-|macos-build-|nix-native-shell-)" + ) + for path in sorted((root / ".github").rglob("*.y*ml")): + text = path.read_text(encoding="utf-8") + for number, line in enumerate(text.splitlines(), 1): + require(not literal_pin.search(line), f"{path.relative_to(root)}:{number} repeats a toolchain pin") + if cache_key.match(line): + require("hashFiles(" not in line and ".outputs." in line, + f"{path.relative_to(root)}:{number} must use a toolchain fingerprint") + require(not re.search(r"\b\d+\.\d+(?:\.\d+)?\b", line), + f"{path.relative_to(root)}:{number} repeats a version in a cache key") + for step in re.split(r"(?m)^ +-(?: (?:name|uses|id):)", text): + if re.search(r"(?m)^\s+key:\s*(?:android6-|android-qt-|tvos-source1-|tvos-qt-|windows-mpv-)", step): + require("restore-keys:" not in step, f"{path.relative_to(root)} restores a partial toolchain cache") + return errors + + +def main(): + if sys.argv[1:] == ["--check"]: + errors = version_errors(ROOT) + if errors: + print("\n".join(errors), file=sys.stderr) + return 1 + pins = load(ROOT / MANIFESTS / "toolchain.json") + print(f"toolchain: Qt {pins['qt']['version']}, FFmpeg {pins['ffmpeg']['version']}") + return 0 + mpv_revision = subprocess.check_output(["git", "rev-parse", "HEAD:mpv"], cwd=ROOT, text=True).strip() + for key, value in outputs(ROOT, mpv_revision).items(): + print(f"{key}={value}") + return 0 + + +if __name__ == "__main__": + sys.exit(main()) diff --git a/tools/toolchain-versions.sh b/tools/toolchain-versions.sh index f64c6341..d6d259d4 100755 --- a/tools/toolchain-versions.sh +++ b/tools/toolchain-versions.sh @@ -1,69 +1,12 @@ #!/usr/bin/env bash -# The toolchain versions, read from the one manifest that sets them. -# -# tools/toolchain-versions.sh # KEY=value lines, for $GITHUB_OUTPUT -# tools/toolchain-versions.sh qt.version # one field -# tools/toolchain-versions.sh --check # the manifests agree with the pin +# Run without arguments for GitHub Actions outputs, with a dotted path for a +# single pin, or with --check to detect drift in the consumers. set -euo pipefail - ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" # shellcheck source=tools/lib/manifest-sources.sh source "$ROOT/tools/lib/manifest-sources.sh" -check_versions() { - local qt_version qt_series status=0 - qt_version="$(toolchain_field "$ROOT" qt.version)" - qt_series="$(toolchain_field "$ROOT" qt.series)" - - local manifest declared - for manifest in qt-webos qt-android; do - declared="$(manifest_qt_field "$ROOT/tools/manifests/$manifest.json" qtVersion)" - [[ "$declared" == "$qt_version" ]] || { - printf '%s.json pins Qt %s, toolchain.json pins %s\n' "$manifest" "$declared" "$qt_version" >&2 - status=1 - } - declared="$(manifest_qt_field "$ROOT/tools/manifests/$manifest.json" series)" - [[ "$declared" == "$qt_series" ]] || { - printf '%s.json is series %s, toolchain.json is %s\n' "$manifest" "$declared" "$qt_series" >&2 - status=1 - } - done - - declared="$(manifest_qt_field "$ROOT/tools/manifests/qt-windows.json" version)" - [[ "$declared" == "$qt_version" ]] || { - printf 'qt-windows.json pins Qt %s, toolchain.json pins %s\n' "$declared" "$qt_version" >&2 - status=1 - } - - # FFmpeg is fetched from the pin everywhere it is built from source, so the - # per-platform manifests must not carry one of their own any more. - for manifest in webos-third-party android-third-party; do - if grep -q '"ffmpeg"' "$ROOT/tools/manifests/$manifest.json"; then - printf '%s.json still pins FFmpeg; toolchain.json owns it\n' "$manifest" >&2 - status=1 - fi - done - - if [[ $status -eq 0 ]]; then - printf 'toolchain: Qt %s, FFmpeg %s\n' \ - "$qt_version" "$(toolchain_field "$ROOT" ffmpeg.version)" - fi - return "$status" -} - case "${1:-}" in - --check) - check_versions - ;; - "") - printf 'qt_version=%s\n' "$(toolchain_field "$ROOT" qt.version)" - printf 'qt_series=%s\n' "$(toolchain_field "$ROOT" qt.series)" - printf 'qt_windows_kit=%s\n' "$(toolchain_field "$ROOT" qt.windowsKit)" - printf 'ffmpeg_version=%s\n' "$(toolchain_field "$ROOT" ffmpeg.version)" - printf 'qcoro_revision=%s\n' "$(toolchain_field "$ROOT" qcoro.revision)" - printf 'qcoro_windows_prefix=%s\n' "$(toolchain_field "$ROOT" qcoro.windowsPrefix)" - ;; - *) - toolchain_field "$ROOT" "$1" - ;; + ""|--check) exec "$MANIFEST_PYTHON" "$ROOT/tools/toolchain-versions.py" "$@" ;; + *) toolchain_field "$ROOT" "$1" ;; esac diff --git a/tools/webos-native/build-qcoro.sh b/tools/webos-native/build-qcoro.sh index 541cb2fc..cfaa8660 100755 --- a/tools/webos-native/build-qcoro.sh +++ b/tools/webos-native/build-qcoro.sh @@ -18,9 +18,8 @@ source "$ROOT/tools/lib/manifest-sources.sh" source "$ROOT/tools/webos-native/nixos-sdk-compat.sh" MANIFEST="${WEBOS_THIRD_PARTY_MANIFEST:-$ROOT/tools/manifests/webos-third-party.json}" -QT_MANIFEST="${QT_MANIFEST:-$ROOT/tools/manifests/qt-webos.json}" QT_STATIC="${QT_STATIC:-1}" -QT_VERSION="${QT_VERSION:-$(manifest_qt_field "$QT_MANIFEST" qtVersion)}" +QT_VERSION="${QT_VERSION:-$(toolchain_field "$ROOT" qt.version)}" QT_BUILD_TAG="${QT_VERSION%.*}" QT_BUILD_TAG="${QT_BUILD_TAG//./}" diff --git a/tools/webos-native/build-qt6.sh b/tools/webos-native/build-qt6.sh index ac0bb2ae..63781f47 100755 --- a/tools/webos-native/build-qt6.sh +++ b/tools/webos-native/build-qt6.sh @@ -20,9 +20,9 @@ source "$ROOT/tools/webos-native/nixos-sdk-compat.sh" QT_MANIFEST="${QT_MANIFEST:-$ROOT/tools/manifests/qt-webos.json}" SDK_ROOT="${WEBOS_SDK_ROOT:-$ROOT/build/webos-sdk/arm-webos-linux-gnueabi_sdk-buildroot}" SYSROOT="$SDK_ROOT/arm-webos-linux-gnueabi/sysroot" -QT_VERSION="${QT_VERSION:-$(manifest_qt_field "$QT_MANIFEST" qtVersion)}" +QT_VERSION="${QT_VERSION:-$(toolchain_field "$ROOT" qt.version)}" QT_SERIES="${QT_VERSION%.*}" -QT_BASE_URL="${QT_BASE_URL:-$(manifest_qt_field "$QT_MANIFEST" baseUrl)}" +QT_BASE_URL="${QT_BASE_URL:-$(toolchain_qt_sources_url "$ROOT" qt.fauArchiveBaseUrl)}" QT_STATIC="${QT_STATIC:-0}" PHASE="${1:-all}" QT_BUILD_CLEAN_POISONED="${QT_BUILD_CLEAN_POISONED:-1}" @@ -39,14 +39,6 @@ JOBS="$(recommended_parallel_jobs "$QT_BUILD_MEMORY_PER_JOB_MIB" "$QT_BUILD_MEMO QT_TARGET_TUNE_CFLAGS="$(webos_tune_cflags)" SRC_DIR="$ROOT/build/qt6-src" -QTBASE_TARBALL="$SRC_DIR/qtbase-everywhere-src-$QT_VERSION.tar.xz" -QTSHADERTOOLS_TARBALL="$SRC_DIR/qtshadertools-everywhere-src-$QT_VERSION.tar.xz" -QTTOOLS_TARBALL="$SRC_DIR/qttools-everywhere-src-$QT_VERSION.tar.xz" -QTDECLARATIVE_TARBALL="$SRC_DIR/qtdeclarative-everywhere-src-$QT_VERSION.tar.xz" -QTWEBSOCKETS_TARBALL="$SRC_DIR/qtwebsockets-everywhere-src-$QT_VERSION.tar.xz" -QTWAYLAND_TARBALL="$SRC_DIR/qtwayland-everywhere-src-$QT_VERSION.tar.xz" -QTIMAGEFORMATS_TARBALL="$SRC_DIR/qtimageformats-everywhere-src-$QT_VERSION.tar.xz" -QTSVG_TARBALL="$SRC_DIR/qtsvg-everywhere-src-$QT_VERSION.tar.xz" QTBASE_SRC="$SRC_DIR/qtbase-everywhere-src-$QT_VERSION" QTSHADERTOOLS_SRC="$SRC_DIR/qtshadertools-everywhere-src-$QT_VERSION" @@ -215,7 +207,7 @@ download_submodule() { local module="$1" local tarball="$2" local expected - expected="$(manifest_qt_module_sha256 "$QT_MANIFEST" "$module")" + expected="$(toolchain_field "$ROOT" "qt.sources.$module")" log "Downloading $module $QT_VERSION" download_verified \ @@ -237,7 +229,7 @@ extract_if_needed() { local src_dir="$2" local module expected module="$(basename "$tarball" "-everywhere-src-$QT_VERSION.tar.xz")" - expected="$(manifest_qt_module_sha256 "$QT_MANIFEST" "$module")" + expected="$(toolchain_field "$ROOT" "qt.sources.$module")" # Patches may change without a Qt version bump. Start from pristine source # rather than applying a renamed/revised patch on top of its old contents. local patch_hash patch_marker @@ -305,33 +297,22 @@ fetch_sources() { require_base_tools mkdir -p "$SRC_DIR" - download_submodule qtbase "$QTBASE_TARBALL" - download_submodule qtshadertools "$QTSHADERTOOLS_TARBALL" - download_submodule qttools "$QTTOOLS_TARBALL" - download_submodule qtdeclarative "$QTDECLARATIVE_TARBALL" - download_submodule qtwebsockets "$QTWEBSOCKETS_TARBALL" - download_submodule qtwayland "$QTWAYLAND_TARBALL" - download_submodule qtimageformats "$QTIMAGEFORMATS_TARBALL" - download_submodule qtsvg "$QTSVG_TARBALL" - - extract_if_needed "$QTBASE_TARBALL" "$QTBASE_SRC" - extract_if_needed "$QTSHADERTOOLS_TARBALL" "$QTSHADERTOOLS_SRC" - extract_if_needed "$QTTOOLS_TARBALL" "$QTTOOLS_SRC" - extract_if_needed "$QTDECLARATIVE_TARBALL" "$QTDECLARATIVE_SRC" - extract_if_needed "$QTWEBSOCKETS_TARBALL" "$QTWEBSOCKETS_SRC" - extract_if_needed "$QTWAYLAND_TARBALL" "$QTWAYLAND_SRC" - extract_if_needed "$QTIMAGEFORMATS_TARBALL" "$QTIMAGEFORMATS_SRC" - extract_if_needed "$QTSVG_TARBALL" "$QTSVG_SRC" + local module src archive + local modules + modules="$(manifest_json_array "$QT_MANIFEST" modules)" + while IFS= read -r module; do + src="$SRC_DIR/$module-everywhere-src-$QT_VERSION" + archive="$src.tar.xz" + download_submodule "$module" "$archive" + extract_if_needed "$archive" "$src" + done <<<"$modules" apply_local_patches - local src module patch_hash - for src in "$QTBASE_SRC" "$QTSHADERTOOLS_SRC" "$QTTOOLS_SRC" \ - "$QTDECLARATIVE_SRC" "$QTWEBSOCKETS_SRC" "$QTWAYLAND_SRC" \ - "$QTIMAGEFORMATS_SRC" "$QTSVG_SRC"; do - module="$(basename "$src" "-everywhere-src-$QT_VERSION")" - patch_hash="$(qt_module_patch_hash "$module")" - printf '%s\n' "$patch_hash" >"$src/.spool-patches-sha256" - done + while IFS= read -r module; do + src="$SRC_DIR/$module-everywhere-src-$QT_VERSION" + qt_module_patch_hash "$module" >"$src/.spool-patches-sha256" + done <<<"$modules" + } host_qtbase_up_to_date() { diff --git a/tools/webos-native/build-webos.sh b/tools/webos-native/build-webos.sh index 5b1b0281..2b830fc2 100755 --- a/tools/webos-native/build-webos.sh +++ b/tools/webos-native/build-webos.sh @@ -65,7 +65,11 @@ run_phase() { } if [[ "$PHASE" == "all" ]]; then - for phase in fetch qt-host qt-target dependencies app stage package; do + phases=(app stage package) + if [[ "${SPOOL_WEBOS_DEPENDENCIES_READY:-0}" != 1 ]]; then + phases=(fetch qt-host qt-target dependencies "${phases[@]}") + fi + for phase in "${phases[@]}"; do echo echo ">>> webOS phase: $phase" run_phase "$phase" diff --git a/tools/windows/common.ps1 b/tools/windows/common.ps1 index 93c60182..d9098b09 100644 --- a/tools/windows/common.ps1 +++ b/tools/windows/common.ps1 @@ -163,10 +163,13 @@ function Get-MpvSourceRevision { 'tools/prepare-streaming-sources.sh', 'tools/streaming-fingerprint.py', 'tools/patches/curl-apple-mobile-sectrust.patch', 'tools/lib/manifest-sources.sh', 'tools/manifests/mpv-native.json', 'tools/manifests/ffmpeg-capabilities.json', - 'tools/manifests/toolchain.json', 'tools/ffmpeg-capabilities.py' + 'tools/ffmpeg-capabilities.py' )) { $inputs.Add("$file=$((Get-FileHash -LiteralPath (Join-Path $root $file) -Algorithm SHA256).Hash)") } + $toolchain = Get-ToolchainManifest + $inputs.Add(($toolchain.ffmpeg | ConvertTo-Json -Compress)) + $inputs.Add(($toolchain.shaderTools | ConvertTo-Json -Depth 5 -Compress)) $preferredLlvm = Get-PreferredWindowsLlvmBin foreach ($name in @('cl.exe', 'clang.exe', 'lld-link.exe')) { $toolPath = if ($preferredLlvm -and $name -ne 'cl.exe' -and (Test-Path -LiteralPath (Join-Path $preferredLlvm $name) -PathType Leaf)) { diff --git a/tools/windows/install-qt.ps1 b/tools/windows/install-qt.ps1 index 491ecdeb..962fb28d 100644 --- a/tools/windows/install-qt.ps1 +++ b/tools/windows/install-qt.ps1 @@ -8,7 +8,8 @@ param( $root = Get-RepositoryRoot $manifestPath = Join-Path $root 'tools\manifests\qt-windows.json' $manifest = Get-Content -LiteralPath $manifestPath -Raw | ConvertFrom-Json -$qtRoot = Join-Path ([IO.Path]::GetFullPath($OutputDirectory)) "$($manifest.version)\$($manifest.architecture)" +$qt = (Get-ToolchainManifest).qt +$qtRoot = Join-Path ([IO.Path]::GetFullPath($OutputDirectory)) "$($qt.version)\$($qt.windowsKit)" $downloads = if ($DownloadDirectory) { [IO.Path]::GetFullPath($DownloadDirectory) } elseif ($env:RUNNER_TEMP) { Join-Path $env:RUNNER_TEMP 'spool-qt-downloads' } else { @@ -25,7 +26,7 @@ function Test-QtInstallation { } if ((Test-QtInstallation) -and -not $Force) { - Write-Host "Qt $($manifest.version) is already installed at $qtRoot" + Write-Host "Qt $($qt.version) is already installed at $qtRoot" return } @@ -74,4 +75,4 @@ $qtConf = "[Paths]`r`nPrefix=..`r`n" if (-not (Test-QtInstallation)) { throw "The extracted Qt installation is incomplete: $qtRoot" } -Write-Host "Installed Qt $($manifest.version) at $qtRoot" +Write-Host "Installed Qt $($qt.version) at $qtRoot" From ebd892596de2039fcb85cf900a4f8064af4adaa4 Mon Sep 17 00:00:00 2001 From: Sacha Korban Date: Sat, 28 Nov 2026 16:38:05 +1100 Subject: [PATCH 30/39] fix(apple): find the split libmpv prefix when cross-compiling --- tools/build-ios.sh | 4 ++-- tools/build-tvos.sh | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tools/build-ios.sh b/tools/build-ios.sh index 0e1b661d..b7f7f3ef 100755 --- a/tools/build-ios.sh +++ b/tools/build-ios.sh @@ -50,9 +50,9 @@ magick "$ROOT/app/icons/png/spool/1024.png" -background black -alpha remove -alp printf '%s\n' '{"images":[{"filename":"icon.png","idiom":"universal","platform":"ios","size":"1024x1024"}],"info":{"author":"xcode","version":1}}' >"$ASSETS/AppIcon.appiconset/Contents.json" cmake -S "$ROOT" -B "$BASE/app" -GXcode \ -DCMAKE_TOOLCHAIN_FILE="$QT_TARGET_PREFIX/lib/cmake/Qt6/qt.toolchain.cmake" \ - -DQT_HOST_PATH="$QT_HOST_PATH" -DCMAKE_PREFIX_PATH="$APPLE_DEPS_PREFIX;$QT_TARGET_PREFIX" \ + -DQT_HOST_PATH="$QT_HOST_PATH" -DCMAKE_PREFIX_PATH="${APPLE_MPV_PREFIX:+$APPLE_MPV_PREFIX;}$APPLE_DEPS_PREFIX;$QT_TARGET_PREFIX" \ -DQT_ADDITIONAL_PACKAGES_PREFIX_PATH="$APPLE_DEPS_PREFIX" \ - -DCMAKE_FIND_ROOT_PATH="$APPLE_DEPS_PREFIX;$QT_TARGET_PREFIX" \ + -DCMAKE_FIND_ROOT_PATH="${APPLE_MPV_PREFIX:+$APPLE_MPV_PREFIX;}$APPLE_DEPS_PREFIX;$QT_TARGET_PREFIX" \ -DQCoro6_DIR="$APPLE_DEPS_PREFIX/lib/cmake/QCoro6" \ -DCMAKE_OSX_SYSROOT="$APPLE_SDK" -DCMAKE_OSX_ARCHITECTURES="$APPLE_ARCH" \ -DCMAKE_OSX_DEPLOYMENT_TARGET="$APPLE_DEPLOYMENT_TARGET" \ diff --git a/tools/build-tvos.sh b/tools/build-tvos.sh index f4aea7b1..5874e210 100755 --- a/tools/build-tvos.sh +++ b/tools/build-tvos.sh @@ -42,8 +42,8 @@ python3 "$ROOT/tools/apple/tvos-assets.py" "$assets" -DCMAKE_SYSTEM_NAME=tvOS -DCMAKE_OSX_SYSROOT="$APPLE_SDK" \ -DCMAKE_OSX_ARCHITECTURES="$APPLE_ARCH" \ -DCMAKE_OSX_DEPLOYMENT_TARGET="$APPLE_DEPLOYMENT_TARGET" \ - -DCMAKE_PREFIX_PATH="$QT_TARGET_PREFIX;$APPLE_DEPS_PREFIX" \ - -DCMAKE_FIND_ROOT_PATH="$APPLE_DEPS_PREFIX;$QT_TARGET_PREFIX" \ + -DCMAKE_PREFIX_PATH="${APPLE_MPV_PREFIX:+$APPLE_MPV_PREFIX;}$QT_TARGET_PREFIX;$APPLE_DEPS_PREFIX" \ + -DCMAKE_FIND_ROOT_PATH="${APPLE_MPV_PREFIX:+$APPLE_MPV_PREFIX;}$APPLE_DEPS_PREFIX;$QT_TARGET_PREFIX" \ -DQT_ADDITIONAL_PACKAGES_PREFIX_PATH="$APPLE_DEPS_PREFIX" \ -DQCoro6_DIR="$APPLE_DEPS_PREFIX/lib/cmake/QCoro6" \ -DSPOOL_APPLE_QML_IMPORT_SCANNER="$ROOT/build/apple/qmlimportscanner/spool-qmlimportscanner" \ From f6f69a8353a3c99e1127bbc88dd47b87538ebed7 Mon Sep 17 00:00:00 2001 From: Sacha Korban Date: Sat, 28 Nov 2026 17:21:42 +1100 Subject: [PATCH 31/39] test(e2e): observe pause across a playback session transition --- tests/e2e/AppJourneyTest.cpp | 26 +++++++++++++++++++++----- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/tests/e2e/AppJourneyTest.cpp b/tests/e2e/AppJourneyTest.cpp index bbb2218f..1757c174 100644 --- a/tests/e2e/AppJourneyTest.cpp +++ b/tests/e2e/AppJourneyTest.cpp @@ -1511,16 +1511,31 @@ class Journey final { } void pauseForObservation(const char *message) { - await([&] { return state(true)["playback"].toObject()["ready"].toBool(); }, - "playback did not complete its first renderer restart before pause"); QJsonObject playback; int observations = 0; int timeouts = 0; QElapsedTimer lastObservation; lastObservation.start(); try { - playback = command({ "pause" })["playback"].toObject(); - require(!playback["failed"].toBool(), "playback had already failed before pause could settle"); + await( + [&] { + playback = state(true)["playback"].toObject(); + require(!playback["failed"].toBool(), "playback failed before it could be paused"); + if (!playback["active"].toBool() || !playback["ready"].toBool()) + return false; + QJsonObject response; + const auto paused = command({ "pause" }, {}, false, {}, &response); + // Ready is a snapshot, not a lease on a session. A repeat + // or renderer replacement can leave a gap between status + // and pause; wait for a real ready session again. + if (response["error"].toObject()["code"] == "no_playback") + return false; + require(response["ok"].toBool(), "pause control request was rejected"); + playback = paused["playback"].toObject(); + require(!playback["failed"].toBool(), "playback had already failed before pause could settle"); + return true; + }, + message); await( [&] { const auto observed = state(true)["playback"].toObject(); @@ -1748,6 +1763,7 @@ SPOOL_TEST_MAIN("app-journey") #if defined(Q_OS_MACOS) std::optional runtime; #endif + QString fixturePhase = QStringLiteral("login"); try { QString deviceKind; const QStringList arguments = application.arguments().mid(1); @@ -1793,7 +1809,6 @@ SPOOL_TEST_MAIN("app-journey") const QString app = deviceKind.isEmpty() ? executable("SPOOL_E2E_APP", appDefault) : QString(); const QString control = executable("SPOOL_E2E_SPOOLET", controlDefault); AppJourney::JellyfinFixture fixture(media(root.path(), environment)); - QString fixturePhase = QStringLiteral("login"); const auto retainFixtureCounters = qScopeGuard([&] { const QJsonObject counters { { "format", 1 }, { "phase", fixturePhase }, { "successfulLogins", fixture.successfulLogins }, { "rejectedLogins", fixture.rejectedLogins }, @@ -2466,6 +2481,7 @@ SPOOL_TEST_MAIN("app-journey") root.setAutoRemove(false); std::cerr << "app-journey: private failure artifacts retained at " << root.path().toStdString() << '\n'; } + std::cerr << "app-journey: failure phase " << fixturePhase.toStdString() << '\n'; std::cerr << "app-journey: " << error.what() << '\n'; return 1; } From 9ecc158e1aa3ec02654b38283c063aab90f8fe1b Mon Sep 17 00:00:00 2001 From: Sacha Korban Date: Sat, 28 Nov 2026 17:41:13 +1100 Subject: [PATCH 32/39] fix(ci): gate Windows MSYS2 cache writes (cherry picked from commit 79c9eaca4a81bca3aa2e03395b8cdec44d08cc34) --- .github/workflows/build-artifacts.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build-artifacts.yml b/.github/workflows/build-artifacts.yml index 89a5bd41..e720cef8 100644 --- a/.github/workflows/build-artifacts.yml +++ b/.github/workflows/build-artifacts.yml @@ -1403,6 +1403,7 @@ jobs: msystem: MSYS path-type: inherit install: make diffutils pkgconf patch tar curl + cache: ${{ env.SPOOL_CACHE_WRITE == 'true' && !inputs.release }} - name: Install build and packaging tools shell: pwsh From 4bc3ae499003451a841fa783f8ab797a34315776 Mon Sep 17 00:00:00 2001 From: Sacha Korban Date: Sat, 28 Nov 2026 17:42:03 +1100 Subject: [PATCH 33/39] fix(ci): keep Nix installer archive pins atomic (cherry picked from commit 64c2c1470cb95461a8c3c520b5759b1015c37be0) --- .github/actions/install-nix/action.yml | 1 + .github/workflows/build-artifacts.yml | 5 ++- .github/workflows/release.yml | 4 ++ renovate.json | 12 +----- tests/tools/ToolchainVersionsTest.py | 8 ++++ tools/toolchain-versions.py | 57 +++++++++++++++++++------- tools/toolchain-versions.sh | 2 +- 7 files changed, 62 insertions(+), 27 deletions(-) diff --git a/.github/actions/install-nix/action.yml b/.github/actions/install-nix/action.yml index fd9756a7..fc553a8a 100644 --- a/.github/actions/install-nix/action.yml +++ b/.github/actions/install-nix/action.yml @@ -43,6 +43,7 @@ runs: done echo "::error::could not fetch a valid $url" exit 1 + # Update this digest and both Nix pins in tools/manifests/toolchain.json in one commit. - uses: nixbuild/nix-quick-install-action@2c9db80fb984ceb1bcaa77cdda3fdf8cfba92035 # v34 with: nix_version: ${{ steps.fetch.outputs.nix-version }} diff --git a/.github/workflows/build-artifacts.yml b/.github/workflows/build-artifacts.yml index e720cef8..2a074a82 100644 --- a/.github/workflows/build-artifacts.yml +++ b/.github/workflows/build-artifacts.yml @@ -158,7 +158,6 @@ jobs: apple_qt_modules: ${{ steps.versions.outputs.apple_qt_modules }} aqt_version: ${{ steps.versions.outputs.aqt_version }} android_build_tools: ${{ steps.versions.outputs.android_build_tools }} - nix_version: ${{ steps.versions.outputs.nix_version }} key_qt: ${{ steps.versions.outputs.key_qt }} key_mpv: ${{ steps.versions.outputs.key_mpv }} key_streaming: ${{ steps.versions.outputs.key_streaming }} @@ -198,6 +197,10 @@ jobs: persist-credentials: false fetch-depth: 2 submodules: recursive + - name: Check pinned Nix installer archives + env: + GH_TOKEN: ${{ github.token }} + run: bash tools/toolchain-versions.sh --check-nix-archives - uses: ./.github/actions/install-nix with: nix_conf: | diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 4ccbebc3..c09ebbcf 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -32,6 +32,10 @@ jobs: } test "$(git rev-parse "$RELEASE_TAG^{commit}")" = "$GITHUB_SHA" tools/check-release-version.sh "${RELEASE_TAG#v}" + - name: Check pinned Nix installer archives + env: + GH_TOKEN: ${{ github.token }} + run: bash tools/toolchain-versions.sh --check-nix-archives - name: Package exact corresponding source run: tools/package-release-source.sh release-source - name: Upload corresponding source diff --git a/renovate.json b/renovate.json index 5f028e38..8820a3d9 100644 --- a/renovate.json +++ b/renovate.json @@ -38,9 +38,9 @@ "automerge": false }, { - "description": "Update the Nix archive release pin together with the installer action digest", + "description": "Update the Nix installer digest, archive release and Nix version together by hand after checking all runner archives", "matchPackageNames": ["nixbuild/nix-quick-install-action"], - "groupName": "Nix quick installer" + "enabled": false }, { "description": "Preserve readable action versions beside immutable digests", @@ -56,14 +56,6 @@ "matchStrings": ["(?[A-Za-z0-9_.-]+)_VERSION:\\s*(?[^\\s#]+)\\s*#\\s*renovate: datasource=(?\\S+)(?: depName=(?\\S+))?"], "versioningTemplate": "loose" }, - { - "customType": "regex", - "managerFilePatterns": ["/^tools/manifests/toolchain\\.json$/"], - "matchStrings": ["\"quickInstallRelease\"\\s*:\\s*\"(?v\\d+)\""], - "depNameTemplate": "nixbuild/nix-quick-install-action", - "datasourceTemplate": "github-releases", - "versioningTemplate": "loose" - }, { "customType": "regex", "managerFilePatterns": ["/^tools/manifests/.*\\.json$/"], diff --git a/tests/tools/ToolchainVersionsTest.py b/tests/tools/ToolchainVersionsTest.py index 87cfc101..35706430 100644 --- a/tests/tools/ToolchainVersionsTest.py +++ b/tests/tools/ToolchainVersionsTest.py @@ -33,6 +33,14 @@ def test_repository_versions(self): self.assertEqual(outputs["android_build_tools"], pins["android"]["buildTools"]) self.assertEqual(outputs["qt_build_tag"], pins["qt"]["series"].replace(".", "")) + def test_nix_archives_must_exist_for_each_runner(self): + nix = {"version": "2.99.0", "quickInstallRelease": "v99"} + archives = ["nix-2.99.0-x86_64-linux.tar.zstd", "nix-2.99.0-aarch64-darwin.tar.zstd", + "nix-2.99.0-x86_64-darwin.tar.zstd"] + self.assertEqual(toolchain.nix_archive_errors(nix, archives), []) + self.assertEqual(toolchain.nix_archive_errors(nix, archives[:-1] + ["nix-2.99.1-x86_64-darwin.tar.zstd"]), + ["Nix installer v99 is missing archives: nix-2.99.0-x86_64-darwin.tar.zstd"]) + def test_windows_and_mpv_edits_leave_source_qt_caches_warm(self): before = toolchain.outputs(self.root, "a" * 40) windows = self.root / "tools/windows/install-qt.ps1" diff --git a/tools/toolchain-versions.py b/tools/toolchain-versions.py index f43c712b..ac8e9246 100644 --- a/tools/toolchain-versions.py +++ b/tools/toolchain-versions.py @@ -11,6 +11,9 @@ ROOT = Path(__file__).resolve().parents[1] MANIFESTS = "tools/manifests" +NIX_INSTALL_ACTION = ".github/actions/install-nix/action.yml" +NIX_INSTALLER_REPO = "nixbuild/nix-quick-install-action" +NIX_INSTALLER_PIN = re.compile(rf"uses: {NIX_INSTALLER_REPO}@([0-9a-f]{{40}})\s+# (v\d+)") def load(path): @@ -47,7 +50,7 @@ def qt_sources(modules, mirror): f"{MANIFESTS}/ffmpeg-capabilities.json", "tools/ffmpeg-capabilities.py", )) native_shell = fingerprint(root, qt, qcoro, ffmpeg, streaming, pins["nix"], files=( - "flake.nix", "flake.lock", "tools/patches/**/*", + "flake.nix", "flake.lock", NIX_INSTALL_ACTION, "tools/patches/**/*", "tools/webos-native/patches/qtdeclarative-*-qmlimportscanner-exclude-subtrees.patch", )) mpv = fingerprint(root, mpv_revision, files=(f"{MANIFESTS}/mpv-native.json",)) @@ -101,7 +104,6 @@ def qt_sources(modules, mirror): "apple_qt_modules": " ".join(apple["qtModules"]), "aqt_version": apple["aqtinstall"], "android_build_tools": android["buildTools"], - "nix_version": pins["nix"]["version"], "key_qt": fingerprint(root, qt), "key_mpv": mpv, "key_streaming": streaming, @@ -187,9 +189,9 @@ def check_modules(modules, label): require("ffmpeg" not in load(manifests / name)["sources"], f"{name} still pins FFmpeg; toolchain.json owns it") - installer = (root / ".github/actions/install-nix/action.yml").read_text(encoding="utf-8") - action = re.search(r"uses: nixbuild/nix-quick-install-action@[0-9a-f]{40}\s+# (v\d+)", installer) - require(action and action[1] == nix["quickInstallRelease"], + installer = (root / NIX_INSTALL_ACTION).read_text(encoding="utf-8") + action = NIX_INSTALLER_PIN.search(installer) + require(action and action[2] == nix["quickInstallRelease"], "nix-quick-install action version comment must match toolchain.json") for field in ("version", "quickInstallRelease"): require(f"tools/toolchain-versions.sh nix.{field}" in installer, @@ -197,14 +199,9 @@ def check_modules(modules, label): require(not re.search(r"(?m)^\s+RELEASE:\s*[\"']?v\d+", installer), "install-nix repeats the archive release pin") renovate = load(root / "renovate.json") - installer_name = "nixbuild/nix-quick-install-action" - require(any(manager.get("depNameTemplate") == installer_name and - "quickInstallRelease" in "".join(manager.get("matchStrings", [])) - for manager in renovate["customManagers"]), - "Renovate must track the Nix archive release pin") - require(any(installer_name in rule.get("matchPackageNames", []) and rule.get("groupName") + require(any(NIX_INSTALLER_REPO in rule.get("matchPackageNames", []) and rule.get("enabled") is False for rule in renovate["packageRules"]), - "Renovate must group the Nix archive release and installer action") + "Renovate must leave the Nix installer pins to atomic manual updates") literal_pin = re.compile( r"\b(?:APPLE_DEPLOYMENT_TARGET|QT_VERSION|FFMPEG_VERSION|NIX_VERSION)\s*[:=]\s*[\"']?\d+\.\d+" @@ -231,14 +228,44 @@ def check_modules(modules, label): return errors +def nix_archive_errors(nix, asset_names): + # Keep these in sync with the Linux, Apple Silicon and Intel macOS runners. + platforms = ("x86_64-linux", "aarch64-darwin", "x86_64-darwin") + required = {f"nix-{nix['version']}-{platform}.tar.zstd" for platform in platforms} + missing = sorted(required.difference(asset_names)) + if missing: + return [f"Nix installer {nix['quickInstallRelease']} is missing archives: {', '.join(missing)}"] + return [] + + +def check_nix_archives(root, nix): + revision, release = NIX_INSTALLER_PIN.search((root / NIX_INSTALL_ACTION).read_text(encoding="utf-8")).groups() + api = f"repos/{NIX_INSTALLER_REPO}" + try: + published_revision = subprocess.check_output(["gh", "api", f"{api}/commits/{release}", "--jq", ".sha"], + text=True).strip() + asset_names = subprocess.check_output(["gh", "api", f"{api}/releases/tags/{release}", + "--jq", ".assets[].name"], text=True).splitlines() + except (OSError, subprocess.CalledProcessError) as error: + return [f"Could not check Nix installer {release}: {error}"] + if published_revision != revision: + return [f"Nix installer {release} points to {published_revision}, expected {revision}"] + return nix_archive_errors(nix, asset_names) + + def main(): - if sys.argv[1:] == ["--check"]: + if sys.argv[1:] in (["--check"], ["--check-nix-archives"]): + pins = load(ROOT / MANIFESTS / "toolchain.json") errors = version_errors(ROOT) + if not errors and sys.argv[1:] == ["--check-nix-archives"]: + errors = check_nix_archives(ROOT, pins["nix"]) if errors: print("\n".join(errors), file=sys.stderr) return 1 - pins = load(ROOT / MANIFESTS / "toolchain.json") - print(f"toolchain: Qt {pins['qt']['version']}, FFmpeg {pins['ffmpeg']['version']}") + if sys.argv[1:] == ["--check-nix-archives"]: + print(f"Nix installer {pins['nix']['quickInstallRelease']} publishes all required Nix {pins['nix']['version']} archives") + else: + print(f"toolchain: Qt {pins['qt']['version']}, FFmpeg {pins['ffmpeg']['version']}") return 0 mpv_revision = subprocess.check_output(["git", "rev-parse", "HEAD:mpv"], cwd=ROOT, text=True).strip() for key, value in outputs(ROOT, mpv_revision).items(): diff --git a/tools/toolchain-versions.sh b/tools/toolchain-versions.sh index d6d259d4..3e92a238 100755 --- a/tools/toolchain-versions.sh +++ b/tools/toolchain-versions.sh @@ -7,6 +7,6 @@ ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)" source "$ROOT/tools/lib/manifest-sources.sh" case "${1:-}" in - ""|--check) exec "$MANIFEST_PYTHON" "$ROOT/tools/toolchain-versions.py" "$@" ;; + ""|--check|--check-nix-archives) exec "$MANIFEST_PYTHON" "$ROOT/tools/toolchain-versions.py" "$@" ;; *) toolchain_field "$ROOT" "$1" ;; esac From 7e2df57786260257eef7040d348886aed6853ab5 Mon Sep 17 00:00:00 2001 From: Sacha Korban Date: Sat, 28 Nov 2026 17:42:16 +1100 Subject: [PATCH 34/39] fix(ci): fingerprint Android Qt dependency recipes (cherry picked from commit cdad353d4f367c1f44a3f2b01f51345df8ecd041) --- tests/tools/ToolchainVersionsTest.py | 10 ++++++++++ tools/toolchain-versions.py | 3 ++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/tests/tools/ToolchainVersionsTest.py b/tests/tools/ToolchainVersionsTest.py index 35706430..b6225344 100644 --- a/tests/tools/ToolchainVersionsTest.py +++ b/tests/tools/ToolchainVersionsTest.py @@ -80,6 +80,16 @@ def test_qcoro_edit_does_not_invalidate_android_media_or_qt(self): self.assertEqual(before[key], after[key], key) self.assertNotEqual(before["key_apple_deps"], after["key_apple_deps"]) + def test_android_dependency_recipe_edit_invalidates_android_qt(self): + before = toolchain.outputs(self.root, "a" * 40) + recipe = self.root / "tools/android/build-dependencies.sh" + recipe.write_text(recipe.read_text(encoding="utf-8").replace("--with-brotli=no ", "--with-brotli=yes ", 1), + encoding="utf-8") + after = toolchain.outputs(self.root, "a" * 40) + for key in ("key_android_qt", "key_android_deps"): + self.assertNotEqual(before[key], after[key], key) + self.assertEqual(before["key_tvos_qt"], after["key_tvos_qt"]) + def test_guard_rejects_duplicates_literal_versions_and_partial_caches(self): android = self.root / "tools/manifests/qt-android.json" data = toolchain.load(android) diff --git a/tools/toolchain-versions.py b/tools/toolchain-versions.py index ac8e9246..ecfbbbef 100644 --- a/tools/toolchain-versions.py +++ b/tools/toolchain-versions.py @@ -72,7 +72,8 @@ def qt_sources(modules, mirror): # FFmpeg, mpv and QCoro builds in the same prefix. android_qt_key = fingerprint(root, android, streaming_sources["openssl"], android_sources["freetype"], qt_sources(android_qt["modules"], "fauArchiveBaseUrl"), files=( - "tools/android/build-qt6.sh", "tools/android/patches/qt-android-*.patch", + "tools/android/build-qt6.sh", "tools/android/build-dependencies.sh", + "tools/android/patches/qt-android-*.patch", "tools/lib/manifest-sources.sh", )) android_media_sources = {name: source for name, source in android_sources.items() if name != "qcoro"} From 6a9da09e2a129de62db8dafd7b88b62cfd0b4f76 Mon Sep 17 00:00:00 2001 From: Sacha Korban Date: Sat, 28 Nov 2026 17:44:54 +1100 Subject: [PATCH 35/39] fix(android): share the minimum SDK across native builds and APKs (cherry picked from commit 3995525dd9b06f7bfd9aef0370658aa6dd52f231) --- cmake/platform/Android.cmake | 7 +++- tests/platform/MobileTestBundles.cmake | 3 +- tests/tools/ToolchainVersionsTest.py | 26 +++++++++++++++ tests/tools/android-packaging/CMakeLists.txt | 35 ++++++++++++++++++++ tools/android/build-apks.sh | 33 ++++++++++++------ 5 files changed, 92 insertions(+), 12 deletions(-) create mode 100644 tests/tools/android-packaging/CMakeLists.txt diff --git a/cmake/platform/Android.cmake b/cmake/platform/Android.cmake index 04b8ba42..d1020484 100644 --- a/cmake/platform/Android.cmake +++ b/cmake/platform/Android.cmake @@ -77,6 +77,11 @@ function(spool_configure_android_targets native_target core_target) file(COPY "${SPOOL_SPLASH_DIR}/res/" DESTINATION "${android_package_source}/res") + set(toolchain_manifest "${CMAKE_CURRENT_FUNCTION_LIST_DIR}/../../tools/manifests/toolchain.json") + set_property(DIRECTORY APPEND PROPERTY CMAKE_CONFIGURE_DEPENDS "${toolchain_manifest}") + file(READ "${toolchain_manifest}" toolchain_pins) + string(JSON android_min_sdk GET "${toolchain_pins}" android minimumSdk) + # Android rejects versioned sonames, so bundle only plain .so files, and only # from the Android dependency prefix. file(GLOB ANDROID_EXTRA_LIBS "${ANDROID_DEPS_PREFIX}/lib/*.so") @@ -88,7 +93,7 @@ function(spool_configure_android_targets native_target core_target) set_property(TARGET ${native_target} PROPERTY QT_ANDROID_PACKAGE_SOURCE_DIR "${android_package_source}") set_property(TARGET ${native_target} PROPERTY QT_ANDROID_PACKAGE_NAME "${android_package_name}") set_property(TARGET ${native_target} PROPERTY QT_ANDROID_APP_NAME "Spool") - set_property(TARGET ${native_target} PROPERTY QT_ANDROID_MIN_SDK_VERSION 28) + set_property(TARGET ${native_target} PROPERTY QT_ANDROID_MIN_SDK_VERSION "${android_min_sdk}") set_property(TARGET ${native_target} PROPERTY QT_ANDROID_TARGET_SDK_VERSION 36) set_property(TARGET ${native_target} PROPERTY QT_ANDROID_VERSION_NAME "${PROJECT_VERSION}") set_property(TARGET ${native_target} PROPERTY QT_ANDROID_VERSION_CODE "${android_version_code}") diff --git a/tests/platform/MobileTestBundles.cmake b/tests/platform/MobileTestBundles.cmake index 0f400f8a..d9c9e061 100644 --- a/tests/platform/MobileTestBundles.cmake +++ b/tests/platform/MobileTestBundles.cmake @@ -8,6 +8,7 @@ function(spool_add_mobile_test_bundles) if(ANDROID) # Qt requires this in the cache to keep three APK deployment trees apart. set(QT_USE_TARGET_ANDROID_BUILD_DIR TRUE CACHE BOOL "Separate Android deployment trees" FORCE) + get_target_property(android_min_sdk spool QT_ANDROID_MIN_SDK_VERSION) endif() set(traditional_sources ${SPOOL_TRADITIONAL_TEST_SOURCES}) @@ -115,7 +116,7 @@ function(spool_add_mobile_test_bundles) QT_ANDROID_PACKAGE_SOURCE_DIR "${package_dir}" QT_ANDROID_PACKAGE_NAME "${SPOOL_MOBILE_TEST_IDENTIFIER}" QT_ANDROID_APP_NAME "${SPOOL_MOBILE_TEST_NAME}" - QT_ANDROID_MIN_SDK_VERSION 28 + QT_ANDROID_MIN_SDK_VERSION "${android_min_sdk}" QT_ANDROID_TARGET_SDK_VERSION 36 QT_ANDROID_VERSION_NAME "${PROJECT_VERSION}" QT_ANDROID_VERSION_CODE 1 diff --git a/tests/tools/ToolchainVersionsTest.py b/tests/tools/ToolchainVersionsTest.py index b6225344..9052f4eb 100644 --- a/tests/tools/ToolchainVersionsTest.py +++ b/tests/tools/ToolchainVersionsTest.py @@ -5,6 +5,7 @@ import json from pathlib import Path import shutil +import subprocess import tempfile import unittest @@ -90,6 +91,31 @@ def test_android_dependency_recipe_edit_invalidates_android_qt(self): self.assertNotEqual(before[key], after[key], key) self.assertEqual(before["key_tvos_qt"], after["key_tvos_qt"]) + def test_android_min_sdk_pin_updates_all_apk_deployment_settings(self): + for name in ("cmake/platform", "app/android-common", "tests/platform/android"): + shutil.copytree(ROOT / name, self.root / name) + shutil.copy2(ROOT / "tests/platform/MobileTestBundles.cmake", self.root / "tests/platform") + shutil.copy2(Path(__file__).with_name("android-packaging") / "CMakeLists.txt", self.root) + + build = self.root / "build" + manifest = self.root / "tools/manifests/toolchain.json" + pins = toolchain.load(manifest) + + def check_deployment_settings(): + for target in ("spool", "spool-tests", "spool-e2e-tests"): + settings = toolchain.load(build / f"android-{target}-deployment-settings.json") + self.assertEqual(settings["android-min-sdk-version"], pins["android"]["minimumSdk"], target) + + subprocess.run(["cmake", "-S", str(self.root), "-B", str(build)], check=True, stdout=subprocess.PIPE) + check_deployment_settings() + + minimum_sdk = int(pins["android"]["minimumSdk"]) + compile_sdk = int(pins["android"]["compileSdk"]) + pins["android"]["minimumSdk"] = str(minimum_sdk + 1 if minimum_sdk < compile_sdk else minimum_sdk - 1) + manifest.write_text(json.dumps(pins), encoding="utf-8") + subprocess.run(["cmake", "--build", str(build)], check=True, stdout=subprocess.PIPE) + check_deployment_settings() + def test_guard_rejects_duplicates_literal_versions_and_partial_caches(self): android = self.root / "tools/manifests/qt-android.json" data = toolchain.load(android) diff --git a/tests/tools/android-packaging/CMakeLists.txt b/tests/tools/android-packaging/CMakeLists.txt new file mode 100644 index 00000000..4c563dbc --- /dev/null +++ b/tests/tools/android-packaging/CMakeLists.txt @@ -0,0 +1,35 @@ +cmake_minimum_required(VERSION 3.22) +project(AndroidPackaging VERSION 1.0.0 LANGUAGES CXX) + +set(ANDROID ON) +set(BUILD_TESTING ON) +set(SPOOL_SPLASH_DIR "${CMAKE_CURRENT_BINARY_DIR}/splash") +file(MAKE_DIRECTORY "${SPOOL_SPLASH_DIR}/res") + +# Configure the real packaging functions on a host without Android Qt or an NDK. +set(stub_source "${CMAKE_CURRENT_BINARY_DIR}/stub.cpp") +file(WRITE "${stub_source}" "int main() { return 0; }\n") +add_library(MPV::MPV INTERFACE IMPORTED) +add_library(Qt6::Core INTERFACE IMPORTED) +add_library(spool-core STATIC EXCLUDE_FROM_ALL "${stub_source}") +function(qt_add_executable target) + add_executable(${target} EXCLUDE_FROM_ALL "${stub_source}") +endfunction() +function(qt_add_resources) +endfunction() +function(target_sources target) + _target_sources(${target} PRIVATE "${stub_source}") +endfunction() + +include(cmake/platform/Android.cmake) +include(tests/platform/MobileTestBundles.cmake) +qt_add_executable(spool) +spool_configure_android_targets(spool spool-core) +spool_add_mobile_test_bundles() +set_property(TARGET spool-mobile-test-fixtures PROPERTY EXCLUDE_FROM_ALL TRUE) + +# androiddeployqt reads this field to set the APK's Gradle minSdkVersion. +foreach(target IN ITEMS spool spool-tests spool-e2e-tests) + file(GENERATE OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/android-${target}-deployment-settings.json" + CONTENT "{\"android-min-sdk-version\": \"$\"}\n") +endforeach() diff --git a/tools/android/build-apks.sh b/tools/android/build-apks.sh index 4f2fbe2e..7afcd502 100755 --- a/tools/android/build-apks.sh +++ b/tools/android/build-apks.sh @@ -8,6 +8,7 @@ source "$ROOT/tools/lib/manifest-sources.sh" source "$ROOT/tools/android/gradle-mirror.sh" ABI="${ANDROID_ABI:-x86_64}" QT_VERSION="${QT_VERSION:-$(toolchain_field "$ROOT" qt.version)}" +MINIMUM_SDK="$(toolchain_field "$ROOT" android.minimumSdk)" DEPS_PREFIX="${ANDROID_DEPS_PREFIX:-$ROOT/build/android/deps/$ABI}" JOBS="${ANDROID_BUILD_JOBS:-$(nproc)}" # Emulator CI opts in to actual native test APKs; release packaging stays app-only. @@ -50,6 +51,11 @@ QT_PREFIX="${QT_ANDROID_PREFIX:-$ROOT/build/android/qt/$QT_VERSION/$QT_ABI_DIR}" : "${ANDROID_HOME:?run through nix develop .#android}" : "${ANDROID_NDK_ROOT:?run through nix develop .#android}" +AAPT="$ANDROID_HOME/build-tools/$(toolchain_field "$ROOT" android.buildTools)/aapt" +[[ -x "$AAPT" ]] || { + echo "error: Android build tools are missing at $(dirname "$AAPT")" >&2 + exit 1 +} [[ -x "$QT_PREFIX/bin/qt-cmake" ]] || { echo "error: Android Qt is not built at $QT_PREFIX" >&2 exit 1 @@ -94,6 +100,20 @@ build_qcoro() { cmake --install "$build" } +verify_apk_minimum_sdk() { + local apk="$1" badging sdk + [[ -f "$apk" ]] || { + echo "error: APK was not generated at $apk" >&2 + exit 1 + } + badging="$("$AAPT" dump badging "$apk")" + sdk="$(awk -F "'" '$1 == "sdkVersion:" {print $2}' <<<"$badging")" + if [[ "$sdk" != "$MINIMUM_SDK" ]]; then + echo "error: $apk advertises minimum SDK ${sdk:-missing}, expected $MINIMUM_SDK" >&2 + exit 1 + fi +} + build_app() { local developer="${1:-OFF}" local deployment=Release @@ -125,7 +145,7 @@ build_app() { -DQT_ANDROID_DEPLOYMENT_TYPE="$deployment" \ -DSPOOL_WEBOS=OFF \ -DANDROID_ABI="$ABI" \ - -DANDROID_PLATFORM="android-$(toolchain_field "$ROOT" android.minimumSdk)" \ + -DANDROID_PLATFORM="android-$MINIMUM_SDK" \ -DANDROID_DEPS_PREFIX="$DEPS_PREFIX" \ -DQT_ANDROID_SIGN_APK=ON # androiddeployqt scans SOURCE_DIR recursively and does not forward @@ -150,7 +170,6 @@ path.write_text(json.dumps(settings, indent=2) + "\n") PY done configure_android_gradle_mirror - local build_apk_target build_apk_target() { local apk_target="$1" local attempt @@ -180,10 +199,7 @@ PY app_package="$build/android-build-spool" fi local apk="$app_package/spool.apk" - [[ -f "$apk" ]] || { - echo "error: APK was not generated at $apk" >&2 - exit 1 - } + verify_apk_minimum_sdk "$apk" mkdir -p "$ROOT/dist/android" if [[ "$developer" == ON ]]; then # Same production app and ID, packaged by Qt's standard developer mode. @@ -192,10 +208,7 @@ PY for target in spool-tests spool-e2e-tests; do build_apk_target "${target}_make_apk" apk="$build/android-build-${target}/${target}.apk" - [[ -f "$apk" ]] || { - echo "error: test APK was not generated at $apk" >&2 - exit 1 - } + verify_apk_minimum_sdk "$apk" cp -f "$apk" "$ROOT/dist/android/${target}-${ABI}.apk" done else From 054ae39088fb520ae3263acf409b8c865512d9d6 Mon Sep 17 00:00:00 2001 From: Sacha Korban Date: Sat, 28 Nov 2026 21:56:27 +1100 Subject: [PATCH 36/39] test(e2e): read Resume from the rendered primary caption Crop the active details page primary caption before running single-line OCR so the accent fill and focus outline cannot hide Resume from page segmentation. Click the recognized caption when resuming and keep the provider and decoded-frame checks. (cherry picked from commit 9992d8ab7fcaec678a0c21161360be10d529d370) --- qml/pages/ItemDetailsPage.qml | 1 + qml/primitives/ActionButton.qml | 2 ++ src/platform/NativeAppWindow.h | 23 ++++++++++++----------- tests/e2e/AppJourneyTest.cpp | 26 ++++++++++++++++++++------ 4 files changed, 35 insertions(+), 17 deletions(-) diff --git a/qml/pages/ItemDetailsPage.qml b/qml/pages/ItemDetailsPage.qml index 830066aa..3120650b 100644 --- a/qml/pages/ItemDetailsPage.qml +++ b/qml/pages/ItemDetailsPage.qml @@ -1693,6 +1693,7 @@ FocusScope { DetailAction { id: primaryAction + captionObjectName: root.routeActive ? "detailPrimaryCaption" : "" iconName: "play_arrow" label: root.primaryLabel() primary: true diff --git a/qml/primitives/ActionButton.qml b/qml/primitives/ActionButton.qml index f2f9271b..54ece0a6 100644 --- a/qml/primitives/ActionButton.qml +++ b/qml/primitives/ActionButton.qml @@ -8,6 +8,7 @@ T.Control { property string iconName: "" property bool pointerHovered: hover.hovered property string text: "" + property string captionObjectName: "" signal clicked readonly property color foreground: !enabled ? Theme.textMuted : kind === "primary" || kind === "blue" ? Theme.accentText : kind === "danger" ? Theme.errorText : @@ -90,6 +91,7 @@ T.Control { AppText { id: buttonLabel + objectName: root.captionObjectName anchors.left: buttonIcon.visible ? buttonIcon.right : parent.left anchors.leftMargin: buttonIcon.visible ? Metrics.scaled(8) : 0 anchors.right: parent.right diff --git a/src/platform/NativeAppWindow.h b/src/platform/NativeAppWindow.h index 94ce2864..9967e477 100644 --- a/src/platform/NativeAppWindow.h +++ b/src/platform/NativeAppWindow.h @@ -123,11 +123,12 @@ class NativeAppWindow final : public QQuickView { const bool playerDetail = name == QStringLiteral("playerRepeatDetail") || name == QStringLiteral("playerSleepDetail"); const bool relatedRow = name == QStringLiteral("detailSimilarRow"); + const bool detailPrimaryCaption = name == QStringLiteral("detailPrimaryCaption"); const bool libraryRow = name == QStringLiteral("libraryMediaRow"); const bool libraryMenu = name == QStringLiteral("libraryContextMenuPanel"); const bool showHidden = name == QStringLiteral("showHiddenLibrariesButton"); if ((preview || texture || seekBar || playerSettings || playerOptions || playerDetail || relatedRow - || libraryRow || libraryMenu || showHidden) + || detailPrimaryCaption || libraryRow || libraryMenu || showHidden) && item->isVisible()) { QRectF geometry = item->mapRectToScene(item->boundingRect()); if (relatedRow) { @@ -156,16 +157,16 @@ class NativeAppWindow final : public QQuickView { state.insert(QStringLiteral("currentIndex"), item->property("currentIndex").toInt()); state.insert(QStringLiteral("contentX"), item->property("contentX").toDouble()); } - const QString key = preview ? QStringLiteral("preview") - : texture ? QStringLiteral("previewTexture") - : libraryRow ? QStringLiteral("libraryRow") - : libraryMenu ? QStringLiteral("libraryMenu") - : showHidden ? QStringLiteral("showHiddenLibraries") - : playerSettings ? QStringLiteral("playerSettings") - : playerOptions ? QStringLiteral("playerOptions") - : playerDetail ? name - : relatedRow ? QStringLiteral("relatedCard") - : QStringLiteral("seekBar"); + const QString key = preview ? QStringLiteral("preview") + : texture ? QStringLiteral("previewTexture") + : libraryRow ? QStringLiteral("libraryRow") + : libraryMenu ? QStringLiteral("libraryMenu") + : showHidden ? QStringLiteral("showHiddenLibraries") + : playerSettings ? QStringLiteral("playerSettings") + : playerOptions ? QStringLiteral("playerOptions") + : playerDetail || detailPrimaryCaption ? name + : relatedRow ? QStringLiteral("relatedCard") + : QStringLiteral("seekBar"); result.insert(key, state); } const auto children = item->childItems(); diff --git a/tests/e2e/AppJourneyTest.cpp b/tests/e2e/AppJourneyTest.cpp index 1757c174..d0ac661a 100644 --- a/tests/e2e/AppJourneyTest.cpp +++ b/tests/e2e/AppJourneyTest.cpp @@ -615,7 +615,15 @@ class DeviceSession final { QDateTime launchTime; qint64 deviceLaunchEpoch = 0; }; -enum class TextSurface { Window, LibraryRow, RelatedCard, PlayerOptions, PlayerRepeatDetail, PlayerSleepDetail }; +enum class TextSurface { + Window, + LibraryRow, + RelatedCard, + DetailPrimaryCaption, + PlayerOptions, + PlayerRepeatDetail, + PlayerSleepDetail +}; enum class TextPreprocess { Original, Neutral, Inverse, SmoothInverse, NeutralAdaptive, Positive, Adaptive }; struct Words { QString text; @@ -1273,7 +1281,9 @@ class Journey final { QRect found; QRect previous; QString lastObserved; - const bool singleLine = surface == TextSurface::PlayerRepeatDetail || surface == TextSurface::PlayerSleepDetail; + const bool primaryCaption = surface == TextSurface::DetailPrimaryCaption; + const bool singleLine + = primaryCaption || surface == TextSurface::PlayerRepeatDetail || surface == TextSurface::PlayerSleepDetail; const std::string failure = "expected user-visible label was not rendered: " + text.toStdString(); const auto summarize = [](const QList& lines) { QString summary; @@ -1344,6 +1354,7 @@ class Journey final { if (surface != TextSurface::Window) { const QString key = surface == TextSurface::LibraryRow ? QStringLiteral("libraryRow") : surface == TextSurface::RelatedCard ? QStringLiteral("relatedCard") + : primaryCaption ? QStringLiteral("detailPrimaryCaption") : surface == TextSurface::PlayerRepeatDetail ? QStringLiteral("playerRepeatDetail") : surface == TextSurface::PlayerSleepDetail ? QStringLiteral("playerSleepDetail") : QStringLiteral("playerOptions"); @@ -1370,7 +1381,9 @@ class Journey final { "actual rendered region could not be read for caption navigation"); } if (singleLine) { - const auto lines = words(imagePath, 7, region.topLeft(), TextPreprocess::SmoothInverse); + const auto preprocess + = primaryCaption ? TextPreprocess::Positive : TextPreprocess::SmoothInverse; + const auto lines = words(imagePath, 7, region.topLeft(), preprocess); lastObserved = summarize(lines); found = locate(lines); if (found.isEmpty()) @@ -2187,7 +2200,9 @@ SPOOL_TEST_MAIN("app-journey") fixture.setEpisodeDetailsHeld(false); journey.await([&] { return fixture.episodeDetailResponses > responsesBeforeRelease; }, "stale episode detail response was not released"); - journey.label("Resume"); + // Read the rendered caption without the accent button's focus outline + // or the neighboring Start from beginning action in the OCR region. + journey.label("Resume", false, TextSurface::DetailPrimaryCaption); const auto resumeEpisode = [&](qint64 expectedTicks) { fixturePhase = QStringLiteral("episode-resume"); @@ -2197,10 +2212,9 @@ SPOOL_TEST_MAIN("app-journey") journey.click("Journey Series"); journey.await([&] { return fixture.episodeDetailResponses > responsesBeforeReopen; }, "reopened episode details did not fetch stale provider UserData"); - journey.label("Resume"); const int episodesBeforeResume = fixture.episodeRequests; const qsizetype reportsBeforeResume = fixture.reports.size(); - journey.click("Resume", true); + journey.click("Resume", false, false, TextSurface::DetailPrimaryCaption); journey.await( [&] { return fixture.episodeRequests > episodesBeforeResume From 5a7e84a20e15f5d0b84150ab3158434ebf313426 Mon Sep 17 00:00:00 2001 From: Sacha Korban Date: Sat, 28 Nov 2026 22:03:17 +1100 Subject: [PATCH 37/39] test(e2e): stabilize saved movie playback startup Request pause as soon as the saved movie has an active session. Require renderer readiness and observed pause before seeking. Use the Fast picture profile for this phase to reduce rendering load and keep adaptive quality changes out of Apple startup. Verify both paused positions and decoded frames, clock advancement after resume, and the local stop position with the provider unavailable. Retain numeric mpv end reason and error values for early playback failures. (cherry picked from commit 8cb46564882afe5d6d40f62564a56a451d774492) --- src/automation/LocalCommandServer.cpp | 2 + src/player/PlayerController.cpp | 4 + src/player/PlayerController.h | 10 ++ tests/e2e/AppJourneyTest.cpp | 128 ++++++++++++++++++++------ 4 files changed, 115 insertions(+), 29 deletions(-) diff --git a/src/automation/LocalCommandServer.cpp b/src/automation/LocalCommandServer.cpp index 51e97d45..e509ddb2 100644 --- a/src/automation/LocalCommandServer.cpp +++ b/src/automation/LocalCommandServer.cpp @@ -369,6 +369,8 @@ QJsonObject LocalCommandServer::state() const { QStringLiteral("positionSampleAgeMs"), player->positionSampleAgeMs() }, { QStringLiteral("mpvEventAgeMs"), player->mpvEventAgeMs() }, { QStringLiteral("pauseRequestAgeMs"), player->pauseRequestAgeMs() }, + { QStringLiteral("mpvEndReason"), player->mpvEndReason() }, + { QStringLiteral("mpvEndError"), player->mpvEndError() }, { QStringLiteral("position"), player->positionSeconds() }, { QStringLiteral("duration"), player->durationSeconds() }, { QStringLiteral("failed"), !player->errorText().isEmpty() }, diff --git a/src/player/PlayerController.cpp b/src/player/PlayerController.cpp index a7b9489d..56b63f67 100644 --- a/src/player/PlayerController.cpp +++ b/src/player/PlayerController.cpp @@ -1675,6 +1675,8 @@ void PlayerController::playSession( m_mediaKind = nextMediaKind; m_statusText = platformPreparingStatus(needsVideoSurface, embeddedVideo); m_errorText.clear(); + m_mpvEndReason = -1; + m_mpvEndError = 0; const double startSeconds = session.startTimeTicks > 0 ? static_cast(session.startTimeTicks) / 10000000.0 : 0.0; if (m_trickplay) @@ -3775,6 +3777,8 @@ void PlayerController::handleMpvEvent(mpv_event *event, quint64 generation, mpv_ // both success and failure; otherwise a failed manifest stays stuck in // the preparing state forever. postMpvEvent(generation, [this, generation, failed, endFileReason, endFileError]() { + m_mpvEndReason = endFileReason; + m_mpvEndError = endFileError; if (m_localPlaylist) { if (endFileReason != MPV_END_FILE_REASON_REDIRECT) { const bool completed = PlaybackFailurePolicy::classifyFileEnd(failed, endFileReason, diff --git a/src/player/PlayerController.h b/src/player/PlayerController.h index 6f930812..7c33b32a 100644 --- a/src/player/PlayerController.h +++ b/src/player/PlayerController.h @@ -127,6 +127,14 @@ class PlayerController final : public QObject { { return m_mpvEventClock.isValid() ? m_mpvEventClock.elapsed() : -1; } + int mpvEndReason() const + { + return m_mpvEndReason; + } + int mpvEndError() const + { + return m_mpvEndError; + } qint64 pauseRequestAgeMs() const { return m_pauseRequestClock.isValid() ? m_pauseRequestClock.elapsed() : -1; @@ -583,6 +591,8 @@ class PlayerController final : public QObject { QString m_title; QString m_statusText = QStringLiteral("Ready"); QString m_errorText; + int m_mpvEndReason = -1; + int m_mpvEndError = 0; QString m_mediaKind = QStringLiteral("none"); std::atomic_bool m_nightModeEnabled = false; std::atomic_bool m_toneMappingVisualizationEnabled = false; diff --git a/tests/e2e/AppJourneyTest.cpp b/tests/e2e/AppJourneyTest.cpp index d0ac661a..97b11dc1 100644 --- a/tests/e2e/AppJourneyTest.cpp +++ b/tests/e2e/AppJourneyTest.cpp @@ -1862,6 +1862,16 @@ SPOOL_TEST_MAIN("app-journey") journey.launch(app, fixture.origin(), deviceKind); journey.label("Welcome to Spool"); journey.assertControlBoundaries(); + // The first playback phase checks the saved file and its timeline. + // Use the inexpensive renderer profile to avoid a quality step-down + // during startup on a slow CI display. Apply it before sign-in so a + // settings-sync request cannot cross the offline boundary. + const QString renderQualityKey = QStringLiteral("playback/renderQuality"); + const QString initialRenderQuality = journey.command({ "settings", "get", renderQualityKey })["values"] + .toObject()[renderQualityKey] + .toString(); + require(journey.command({ "settings", "set", renderQualityKey, "\"fast\"" })["value"] == "fast", + "saved-media renderer profile was not applied"); const bool television = deviceKind == "tvos" || (deviceKind == "android" && qEnvironmentVariable("SPOOL_E2E_ANDROID_TV") == "1"); journey.click("Jellyfin", true); @@ -2065,6 +2075,27 @@ SPOOL_TEST_MAIN("app-journey") journey.click("Play saved files offline", true); journey.label("Journey Film"); journey.label("Downloaded"); + QString savedItemId; + journey.await( + [&] { + const auto libraries = journey.command({ "items", "libraries" })["items"].toArray(); + for (const auto& value : libraries) { + const auto library = value.toObject(); + if (library["title"] != "Downloads") + continue; + const auto files + = journey.command({ "catalog", library["id"].toString(), "0", "1" })["items"].toArray(); + if (files.isEmpty()) + return false; + const auto file = files[0].toObject(); + require(file["title"] == "Journey Film" && file["playable"].toBool(), + "completed download was not published as the playable saved movie"); + savedItemId = file["id"].toString(); + return !savedItemId.isEmpty(); + } + return false; + }, + "download never appeared in the local catalogue"); fixturePhase = QStringLiteral("movie-offline"); // Every new authenticated request is unavailable, including playback // negotiation, metadata and media. The pre-existing idle event socket @@ -2077,47 +2108,83 @@ SPOOL_TEST_MAIN("app-journey") // activate that focused button through the normal keyboard/remote path. journey.click("Journey Film"); journey.command({ "key", "ok" }); + const auto savedPlayback = [&] { + const auto playback = journey.state(true)["playback"].toObject(); + const int endReason = playback["mpvEndReason"].toInt(-1); + if (playback["failed"].toBool() || endReason >= 0) { + throw std::runtime_error(QStringLiteral("saved movie ended early (failed=%1, reason=%2, error=%3)") + .arg(playback["failed"].toBool()) + .arg(endReason) + .arg(playback["mpvEndError"].toInt()) + .toStdString()); + } + return playback; + }; + const auto savedPlaybackCommand = [&](const QStringList& args) { + QJsonObject response; + try { + journey.command(args, {}, true, {}, &response); + } catch (const std::exception&) { + if (response["error"].toObject()["code"] == "no_playback") + savedPlayback(); + throw; + } + }; journey.await( [&] { - const auto playback = journey.state()["playback"].toObject(); - require(!playback["failed"].toBool(), "saved-media playback failed"); - return playback["loaded"].toBool() && playback["embeddedVideo"].toBool() + const auto playback = savedPlayback(); + return playback["active"].toBool() && playback["title"] == "Journey Film"; + }, + "the Play offline action did not start the saved movie"); + // Request pause during startup. The player carries the intent into + // loadfile if the renderer is still being prepared. + savedPlaybackCommand({ "pause" }); + journey.await( + [&] { + const auto playback = savedPlayback(); + return playback["active"].toBool() && playback["loaded"].toBool() && playback["ready"].toBool() + && playback["paused"].toBool() && playback["embeddedVideo"].toBool() && playback["duration"].toDouble() > 29; }, - "saved download did not enter real embedded playback"); - journey.pauseForObservation("asynchronous pause did not settle before exact paused-frame seeking"); - journey.command({ "seek", "2" }); + "saved movie did not become ready for exact paused-frame seeking"); + savedPlaybackCommand({ "seek", "2" }); journey.await( [&] { - const auto frame = journey.capture(true); - const double position = journey.state()["playback"].toObject()["position"].toDouble(); - return position > 1.5 && position < 2.5 && frameHasBands(frame, 0); + const auto playback = savedPlayback(); + const double position = playback["position"].toDouble(); + return playback["paused"].toBool() && position > 1.5 && position < 2.5 + && frameHasBands(journey.capture(true), 0); }, "exact seek to 2 seconds did not render upright red-over-blue bands"); - journey.command({ "seek", "14" }); - double seekPosition = 0; - bool greenFrame = false; - try { - journey.await( - [&] { - greenFrame = frameHasBands(journey.capture(true), 1); - seekPosition = journey.state()["playback"].toObject()["position"].toDouble(); - return seekPosition > 12 && greenFrame; - }, - "seek did not deliver the requested decoded frame"); - } catch (const std::exception&) { - throw std::runtime_error(QStringLiteral("exact seek14 failed: public position=%1, green-over-blue=%2") - .arg(seekPosition) - .arg(greenFrame) - .toStdString()); - } - journey.command({ "resume" }); - const double before = journey.state()["playback"].toObject()["position"].toDouble(); - journey.await([&] { return journey.state()["playback"].toObject()["position"].toDouble() > before + 0.5; }, + savedPlaybackCommand({ "seek", "14" }); + journey.await( + [&] { + const auto playback = savedPlayback(); + const double position = playback["position"].toDouble(); + return playback["paused"].toBool() && position > 13.5 && position < 14.5 + && frameHasBands(journey.capture(true), 1); + }, + "exact seek to 14 seconds did not render upright green-over-blue bands"); + savedPlaybackCommand({ "resume" }); + journey.await( + [&] { + const auto playback = savedPlayback(); + return !playback["paused"].toBool() && playback["position"].toDouble() > 14.5; + }, "real media clock did not progress after resume"); + journey.pauseForObservation("saved movie did not pause after its clock advanced"); + const double stoppedPosition = savedPlayback()["position"].toDouble(); + require(stoppedPosition > 14.5, "saved movie lost its position before stopping"); journey.command({ "stop" }); journey.await( [&] { return !journey.state()["playback"].toObject()["active"].toBool(); }, "player did not stop"); + journey.await( + [&] { + const auto savedItem = journey.command({ "item-state", savedItemId }); + return !savedItem["played"].toBool() + && std::abs(savedItem["positionSeconds"].toDouble() - stoppedPosition) < 0.5; + }, + "stopping the movie did not save its paused position in the offline library"); require(fixture.playbackNegotiations == negotiationsBeforeOffline, "saved-media playback renegotiated against the unavailable provider"); require(fixture.mediaRequests == remoteRequests, @@ -2134,6 +2201,9 @@ SPOOL_TEST_MAIN("app-journey") } fixture.setNewRequestsAvailable(true); + require(journey.command({ "settings", "set", renderQualityKey, '"' + initialRenderQuality + '"' })["value"] + == initialRenderQuality, + "original renderer profile was not restored"); // Keep server UserData at zero even after accepted stop reports. The // real provider must hydrate details/series rows without rolling back // the app's newer episode stop state. From 2e66ebf91a81907553f331b2d64228aee00cba85 Mon Sep 17 00:00:00 2001 From: Sacha Korban Date: Sat, 28 Nov 2026 22:27:52 +1100 Subject: [PATCH 38/39] test(e2e): wait for sampled offline playback progress The running UI estimate can cross the advance threshold before mpv reports that position. Check a settled mpv sample for progress, refresh it asynchronously on pause, and wait for a fresh paused position before comparing it with the saved stop. (cherry picked from commit b6586535cbde95f29b8a5d36879c16a52a2bd912) --- src/automation/LocalCommandServer.cpp | 3 +++ src/player/PlayerController.cpp | 5 +++-- src/player/PlayerController.h | 6 ++++++ tests/e2e/AppJourneyTest.cpp | 16 +++++++++++++--- 4 files changed, 25 insertions(+), 5 deletions(-) diff --git a/src/automation/LocalCommandServer.cpp b/src/automation/LocalCommandServer.cpp index e509ddb2..699ea77b 100644 --- a/src/automation/LocalCommandServer.cpp +++ b/src/automation/LocalCommandServer.cpp @@ -350,6 +350,7 @@ QJsonObject LocalCommandServer::focusState() const QJsonObject LocalCommandServer::state() const { const auto player = m_app->player(); + const auto sampledPosition = player->sampledPositionSeconds(); // Deliberate allowlist: no URLs, provider properties, credentials, logs or arbitrary QML values. return { { QStringLiteral("instance"), m_instance }, { QStringLiteral("pid"), QCoreApplication::applicationPid() }, { QStringLiteral("initialized"), m_app->initialized() }, { QStringLiteral("route"), m_router->route() }, @@ -372,6 +373,8 @@ QJsonObject LocalCommandServer::state() const { QStringLiteral("mpvEndReason"), player->mpvEndReason() }, { QStringLiteral("mpvEndError"), player->mpvEndError() }, { QStringLiteral("position"), player->positionSeconds() }, + { QStringLiteral("sampledPosition"), + sampledPosition ? QJsonValue(*sampledPosition) : QJsonValue(QJsonValue::Null) }, { QStringLiteral("duration"), player->durationSeconds() }, { QStringLiteral("failed"), !player->errorText().isEmpty() }, { QStringLiteral("embeddedVideo"), player->embeddedVideoOutput() }, diff --git a/src/player/PlayerController.cpp b/src/player/PlayerController.cpp index 56b63f67..a13a6935 100644 --- a/src/player/PlayerController.cpp +++ b/src/player/PlayerController.cpp @@ -2178,8 +2178,9 @@ void PlayerController::applyMpvPauseState(bool paused) return; qInfo() << "player: pause state changed" << paused; m_paused = paused; - if (!m_paused) - requestMpvPositionRefresh("unpause"); + // A pause freezes the UI estimate. Read the final playback position even + // when mpv has no later frames to trigger a time-pos observation. + requestMpvPositionRefresh(paused ? "pause" : "unpause"); notifyPlaybackStateChanged(); } diff --git a/src/player/PlayerController.h b/src/player/PlayerController.h index 7c33b32a..f121cd04 100644 --- a/src/player/PlayerController.h +++ b/src/player/PlayerController.h @@ -119,6 +119,12 @@ class PlayerController final : public QObject { { return m_pauseCommandState; } + std::optional sampledPositionSeconds() const + { + if (!m_fileLoaded || m_pendingSeek || m_seeking || !m_positionTracker.hasPlaybackPosition()) + return std::nullopt; + return m_positionTracker.position(); + } qint64 positionSampleAgeMs() const { return m_positionTracker.sampleAgeMs(); diff --git a/tests/e2e/AppJourneyTest.cpp b/tests/e2e/AppJourneyTest.cpp index 97b11dc1..4798150a 100644 --- a/tests/e2e/AppJourneyTest.cpp +++ b/tests/e2e/AppJourneyTest.cpp @@ -2169,12 +2169,22 @@ SPOOL_TEST_MAIN("app-journey") journey.await( [&] { const auto playback = savedPlayback(); - return !playback["paused"].toBool() && playback["position"].toDouble() > 14.5; + // The playing UI extrapolates beyond mpv's most recent + // sample. Pause freezes that estimate back at the sample. + return !playback["paused"].toBool() && playback["sampledPosition"].toDouble() > 14.5; }, "real media clock did not progress after resume"); journey.pauseForObservation("saved movie did not pause after its clock advanced"); - const double stoppedPosition = savedPlayback()["position"].toDouble(); - require(stoppedPosition > 14.5, "saved movie lost its position before stopping"); + double stoppedPosition = 0; + journey.await( + [&] { + const auto playback = savedPlayback(); + const auto sampleAge = playback["positionSampleAgeMs"].toInteger(-1); + stoppedPosition = playback["sampledPosition"].toDouble(); + return playback["paused"].toBool() && sampleAge >= 0 + && sampleAge <= playback["pauseRequestAgeMs"].toInteger(-1) && stoppedPosition > 14.5; + }, + "saved movie did not report its advanced position after pause"); journey.command({ "stop" }); journey.await( [&] { return !journey.state()["playback"].toObject()["active"].toBool(); }, "player did not stop"); From 3089a260927945bae8817a3b5e2baf0595cb4428 Mon Sep 17 00:00:00 2001 From: Sacha Korban Date: Sat, 28 Nov 2026 23:00:30 +1100 Subject: [PATCH 39/39] test(e2e): keep episode startup on the fast renderer Keep the isolated journey on one picture profile across the offline to online transition. Pause the initial episode as soon as the negotiated file is loaded, and still require the Jellyfin catalogue and playback start receipts before seeking. Export numeric mpv end diagnostics for startup and pause failures while keeping uncontrolled log content private. (cherry picked from commit 42efd7649265c3273ef890bb610becb2f1a3653a) --- tests/e2e/AppJourneyTest.cpp | 39 +++++++++++++++++++---------------- tests/tools/TestDriverTest.py | 13 ++++++++++++ tools/run-device-tests.py | 3 ++- 3 files changed, 36 insertions(+), 19 deletions(-) diff --git a/tests/e2e/AppJourneyTest.cpp b/tests/e2e/AppJourneyTest.cpp index 4798150a..4c32d9a6 100644 --- a/tests/e2e/AppJourneyTest.cpp +++ b/tests/e2e/AppJourneyTest.cpp @@ -1571,7 +1571,9 @@ class Journey final { std::cerr << "app-journey-pause: observations=" << observations << ", timeouts=" << timeouts << ", position_sample_age_ms=" << playback["positionSampleAgeMs"].toInteger(-1) << ", mpv_event_age_ms=" << playback["mpvEventAgeMs"].toInteger(-1) - << ", pause_request_age_ms=" << playback["pauseRequestAgeMs"].toInteger(-1) << '\n'; + << ", pause_request_age_ms=" << playback["pauseRequestAgeMs"].toInteger(-1) + << ", mpv_end_reason=" << playback["mpvEndReason"].toInt(-1) + << ", mpv_end_error=" << playback["mpvEndError"].toInt() << '\n'; throw std::runtime_error(QStringLiteral( "%1 (active=%2, loaded=%3, ready=%4, paused=%5, failed=%6, position=%7, duration=%8, pause=%9, " "observations=%10, timeouts=%11, last_observation_ms=%12, stack_symbols=%13, " @@ -1862,16 +1864,11 @@ SPOOL_TEST_MAIN("app-journey") journey.launch(app, fixture.origin(), deviceKind); journey.label("Welcome to Spool"); journey.assertControlBoundaries(); - // The first playback phase checks the saved file and its timeline. - // Use the inexpensive renderer profile to avoid a quality step-down - // during startup on a slow CI display. Apply it before sign-in so a - // settings-sync request cannot cross the offline boundary. - const QString renderQualityKey = QStringLiteral("playback/renderQuality"); - const QString initialRenderQuality = journey.command({ "settings", "get", renderQualityKey })["values"] - .toObject()[renderQualityKey] - .toString(); - require(journey.command({ "settings", "set", renderQualityKey, "\"fast\"" })["value"] == "fast", - "saved-media renderer profile was not applied"); + // Keep renderer load low for every playback start in this isolated + // profile. A quality step-down during a controlled pause can replace + // the playback session. Set this before sign-in to avoid settings sync. + require(journey.command({ "settings", "set", "playback/renderQuality", "\"fast\"" })["value"] == "fast", + "journey renderer profile was not applied"); const bool television = deviceKind == "tvos" || (deviceKind == "android" && qEnvironmentVariable("SPOOL_E2E_ANDROID_TV") == "1"); journey.click("Jellyfin", true); @@ -2211,9 +2208,6 @@ SPOOL_TEST_MAIN("app-journey") } fixture.setNewRequestsAvailable(true); - require(journey.command({ "settings", "set", renderQualityKey, '"' + initialRenderQuality + '"' })["value"] - == initialRenderQuality, - "original renderer profile was not restored"); // Keep server UserData at zero even after accepted stop reports. The // real provider must hydrate details/series rows without rolling back // the app's newer episode stop state. @@ -2229,13 +2223,23 @@ SPOOL_TEST_MAIN("app-journey") journey.command({ "key", "ok" }); journey.await( [&] { + if (fixture.playbackNegotiations <= negotiationsBeforeOnline) + return false; // A single read-only observation can miss its client deadline // while the new renderer surface starts. Keep the enclosing - // deadline and require real provider negotiation and playback. - return fixture.playbackNegotiations > negotiationsBeforeOnline - && journey.state(true)["playback"].toObject()["loaded"].toBool(); + // deadline and require real playback. + const auto playback = journey.state(true)["playback"].toObject(); + if (playback["failed"].toBool()) { + throw std::runtime_error( + QStringLiteral("episode playback failed (mpv_end_reason=%1, mpv_end_error=%2)") + .arg(playback["mpvEndReason"].toInt(-1)) + .arg(playback["mpvEndError"].toInt()) + .toStdString()); + } + return playback["loaded"].toBool(); }, "online UI play did not negotiate and load real provider media"); + journey.pauseForObservation("episode did not pause before the controlled stop position"); journey.await( [&] { return fixture.episodeDetailRequests > detailsBeforePlayback @@ -2250,7 +2254,6 @@ SPOOL_TEST_MAIN("app-journey") }); }, "real provider playback start for the online item was not reported"); - journey.pauseForObservation("episode did not pause before the controlled stop position"); journey.command({ "seek", "14" }); journey.await( [&] { diff --git a/tests/tools/TestDriverTest.py b/tests/tools/TestDriverTest.py index 12be3f9d..5a210250 100755 --- a/tests/tools/TestDriverTest.py +++ b/tests/tools/TestDriverTest.py @@ -168,6 +168,19 @@ def test_android_product_crash_export_keeps_only_allowed_modules_and_offsets(sel "frames": [{"module": "libspool_x86_64.so", "offset": "a42"}, {"module": "libmpv.so", "offset": "21"}]}) + def test_pause_failure_export_keeps_only_numeric_mpv_end_diagnostics(self): + private = self.report.parent / "private" + private.mkdir() + pause = ("app-journey-pause: observations=1, timeouts=0, position_sample_age_ms=-1, " + "mpv_event_age_ms=768, pause_request_age_ms=4190, mpv_end_reason=4, mpv_end_error=-11") + (private / "host-controller-private.log").write_text( + f"{pause}\n{pause} extra=/private/path\n{pause.replace('=-11', '=private')}\n") + destination = self.report.parent / "public" + self.adapter["export_attempt"](private, destination, {"status": "failed", "exitCode": 1}) + self.assertEqual((destination / "attempt.log").read_text().splitlines(), [ + "status=failed", "exitCode=1", pause, + ]) + if __name__ == "__main__": unittest.main() diff --git a/tools/run-device-tests.py b/tools/run-device-tests.py index a617bdd5..aff9d00b 100755 --- a/tools/run-device-tests.py +++ b/tools/run-device-tests.py @@ -1300,7 +1300,8 @@ def export_attempt(private, destination, result): continue if re.fullmatch(r"app-journey-pause: observations=[0-9]+, timeouts=[0-9]+, " r"position_sample_age_ms=-?[0-9]+, mpv_event_age_ms=-?[0-9]+, " - r"pause_request_age_ms=-?[0-9]+", stripped): + r"pause_request_age_ms=-?[0-9]+, mpv_end_reason=-?[0-9]{1,10}, " + r"mpv_end_error=-?[0-9]{1,10}", stripped): lines.append(stripped) print(stripped, flush=True) continue