Commit Graph
361 Commits
Author SHA1 Message Date
nvrl c320dbd528 chore(release): bump version to 2.7.0 2026-11-29 21:50:07 +01:00
nvrl 54287fdbcd fix(android): log the decoder line once per change
hwdec-current changes several times while MediaCodec starts, and again
on every surface re-attach, so one 4K AV1 file logged the same
"video: ... decoder mediacodec" line ten times per decoder start. Log
it only when it differs from the last line, and again for a new file.
The B80 guard still runs on every change.
2026-11-29 21:50:06 +01:00
nvrl 5a579a5b18 perf(android): the poller's reads no longer hold up the controls
Every JNI call went through one ReentrantLock that guards the Player
against destruction. The poller held it through nativeState,
nativeTracks and nativeChapters, synchronous property reads that wait on
mpv's core lock while the demuxer fetches a block. A pause, a seek or a
volume step from the UI then waited behind that fetch.

Those three reads change nothing, so they now take only the shared side
of a read-write lock that destruction takes exclusively, after setting
`closed`. A reader either sees `closed` or keeps the Player alive until
it returns. Everything else keeps the exclusive lock.
2026-11-29 21:50:06 +01:00
nvrl 8046d2f109 perf(android): relative seeks for taps, keys and skip buttons
Every ten-second jump (double tap, D-pad, remote transport keys, the
skip buttons and the media session's nudge) seeked to a position the app
had read up to 250 ms earlier, precisely, and synchronously on the UI
thread. Holding a D-pad key fired a seek per repeat, each one cancelling
the block the last one was fetching, and the base position lagged, so
fast presses moved less than they should.

They now send mpv a relative seek, asynchronously. mpv adds a relative
seek to one still queued, so ten presses are one jump of a hundred
seconds from mpv's own position. A held key's repeats land on
keyframes; a single press stays exact.
2026-11-29 21:50:05 +01:00
nvrl 5e9b765edf feat(android): buffer sized to the phone, and a frame-rate hint
The demuxer read-ahead was a fixed 48 MiB, about 10 seconds of 4K at
40 Mbps against a 30-second target. It is now sized from the device's
RAM: 192 MiB at 5 GiB and up (phones sold as 6 GB or more), 96 MiB at
3 GiB, and the old 48 MiB below that or on a low-RAM device. The
seek-back buffer is a quarter of it, below mpv's 50 MiB default, so small
devices hold less than before.

The player now hands the file's container frame rate to the display with
Surface.setFrameRate (FIXED_SOURCE, seamless switches only), so 24 and
30 fps episodes get a refresh rate they divide evenly instead of the
phone's 90 or 120 Hz. The hint is cleared when the episode ends.
2026-11-29 21:50:05 +01:00
nvrl 5f62f9c135 feat(android): zero-copy MediaCodec decoding, AV1 back on hardware
hwdec is now mediacodec,mediacodec-copy with every codec allowed. The
direct decoder goes through mpv's aimagereader interop, which loads with
the render context and needs no SurfaceView: frames arrive as
AHardwareBuffers sampled through EGLImages, never copied through memory.

On a Pixel 6 the 4K AV1 file that leaked a frame per frame in copy mode
(B80) now plays in hardware at flat memory, without the green line, and
with a sixth of dav1d's dropped frames.

The copy path stays as the fallback for devices whose interop fails. An
AV1 file that lands there switches to software, since that path leaks.
B49's reasoning (no window, so copy only) is corrected.
2026-11-29 21:50:04 +01:00
nvrl 2b59216f01 feat(android): log the decoder per file, and debug-build mpv knobs
Every file now logs one line naming its codec, size, pixel format and
decoder, in release builds too. B80 needed a phone restart to find because
nothing said mediacodec-copy.

Debug builds read mpv option overrides from debug.pstr.mpv.* system
properties (adb shell setprop), so decoder and buffer experiments on a
phone need no rebuild: hwdec, hwdec-codecs, gpu-hwdec-interop, the demuxer
limits, a free-form extra list, the log level that reaches logcat, and a
ten-second drop and cache line. mpv log levels below warn map to the
matching logcat priority.
2026-11-29 21:50:04 +01:00
nvrl dd9ae19fcf Merge pull request #64 from narrrl/fix/android-av1-copy-leak
fix(android): decode AV1 in software, MediaCodec's copy path leaks
2026-11-29 17:07:21 +01:00
nvrl 27e74c5373 fix(android): decode AV1 in software, MediaCodec's copy path leaks
On a Pixel 6, 4K AV1 through av1_mediacodec in copy mode lost about one
frame-sized buffer per frame below the app. MemAvailable fell from 4.3 GB
to 67 MB in 18 seconds, the system server died and the phone restarted.
The copy path also drew a green line along the bottom of the picture.

Set hwdec-codecs to mpv's default list without av1, so AV1 goes to dav1d.
Other codecs keep the hardware decoder. See docs/BUGS.md B80.
2026-11-29 14:47:33 +01:00
Nils Pukropp 691d99ae38 chore(aur): update packages to 2.6.0 2026-11-29 12:32:41 +00:00
nvrl 2bbe17276a Merge pull request #62 from narrrl/release/2.6.0
chore(release): 2.6.0
v2.6.0
2026-11-29 12:51:17 +01:00
nvrl c8b37d6bcf chore(release): bump version to 2.6.0 2026-11-29 12:48:50 +01:00
nvrl 6d7e0ee2cd chore(deps): proton-sdk 0.12.11 and proton-media-rs 0.2.1 2026-11-29 12:47:43 +01:00
nvrl 606614f3be Merge pull request #55 from narrrl/perf/android-readahead
perf(android,ios): no block read-ahead under mpv on the phones either
2026-11-28 20:28:57 +01:00
nvrl 2316f6fc69 Merge pull request #56 from narrrl/perf/android-idle
perf(android): stop working at full rate when nothing changes or shows
2026-11-28 20:28:23 +01:00
nvrl ba58ffd179 Merge pull request #57 from narrrl/perf/desktop-vaapi
perf(desktop): give mpv the display so VAAPI can hand frames to GL
2026-11-28 20:27:58 +01:00
nvrl 6664825d8d Merge pull request #58 from narrrl/perf/desktop-frame-timing
perf(desktop): steadier frame timing, and no decoding behind other pages
2026-11-28 20:27:21 +01:00
nvrl e185a93f35 Merge pull request #59 from narrrl/perf/share-session-fresh
perf(core): a share's session stays fresh while its requests work
2026-11-28 20:27:10 +01:00
nvrl 7c6f6b8b15 Merge pull request #60 from narrrl/perf/desktop-open-path
perf(desktop): don't hold a loaded file for its subtitle files
2026-11-28 20:26:46 +01:00
nvrl 6e87051bbd perf(desktop): give mpv the display so VAAPI can hand frames to GL
mpv's render API needs the windowing system's display connection to set
up hardware decoding that hands frames to GL on Intel and AMD
(render_gl.h: MPV_RENDER_PARAM_WL_DISPLAY / X11_DISPLAY). The render
context was created with neither, so hwdec=auto-safe fell back to
software decoding or copied every frame back to system memory.

The display under eframe's window is now passed through VideoSurface
into VideoRenderer, and the decoder in use is logged once per file as
hwdec-current.

B76.
2026-11-28 19:25:03 +01:00
nvrl e7e33f9d19 perf(desktop): steadier frame timing, and no decoding behind other pages
- The Wayland frame cap sleeps against a fixed schedule. Measured from
  the end of each sleep, overshoots added up and the cap ran below its
  rate, so 59.94 fps video lost frames. The default cap is 144, so a
  59.94 fps film is not right at the ceiling and 120/144 Hz panels are
  not held at 60; frames are still only drawn on demand.
- Position and buffer events no longer ask for a frame of their own
  while the picture is on screen. mpv offers a picture for the same
  video frame, and the extra frame landed at another moment with no new
  picture, which on Wayland made the pacer hold the real one back. A
  250 ms tick still moves the clock when no picture comes.
- Behind another page, mpv's frames were never rendered: each was
  decoded, waited on and dropped, and the picture caught up with a
  stutter on return. The video track is now off while hidden and put
  back on return; audio plays on.

B77.
2026-11-28 19:25:03 +01:00
nvrl b9fc506279 perf(core): a share's session stays fresh while its requests work
SessionAges only counted a refresh as proof of a live visitor session,
so after SESSION_FRESH_FOR (5 min) every open began with a public-link
handshake: info and SRP auth on new connections, then a new session
client with a cold pool. The next episode after any episode paid it
before its first byte, and so did the warm of the next episode near the
credits, moving the playing episode onto cold connections. A successful
operation now marks the session fresh too; a session that died anyway
still gets its refresh and retry when the next request fails.

B78.
2026-11-28 19:25:03 +01:00
nvrl 5f73f0db7f perf(desktop): don't hold a loaded file for its subtitle files
On FileLoaded the player thread waited for every subtitle file beside
the episode to open, each a round trip, before restoring the remembered
tracks. Meanwhile no event was read and no command ran, so the clock
froze and clicks waited, and a remembered audio track switched audibly
once they came. The tracks are restored at once now, and the subtitle
files are added as soon as they are open, with the remembered subtitle
restored again in case it is one of them.

B79.
2026-11-28 19:25:03 +01:00
nvrl 78557fde93 perf(android): stop working at full rate when nothing changes or shows
- The media session gets a new playback state only when the status, the
  actions or the clock's course change, and new metadata only when the
  episode, duration or poster change. It was rebuilt with the poster on
  every 250 ms poll, so SystemUI and the lock screen redrew four times a
  second.
- The poll runs every second while paused, stopped or ended and only
  reports changes then; transport calls wake it at once. The track list
  is read when mpv says it or the pick changed, not every second.
- Without a surface, vid=no stops video decoding (iOS already does);
  attaching a surface turns it back on.
- surfaceChanged only redraws instead of re-creating the EGL surface,
  and a new surface draws the current picture, so a paused picture no
  longer stays black after a rotation.
- The resume point is mpv's start option, set before loadfile, instead
  of a time-pos seek after the file loaded.

B75.
2026-11-28 19:24:08 +01:00
nvrl 1c9e5872fe perf(android,ios): no block read-ahead under mpv on the phones either
B8 turned the block layer's read-ahead off under mpv on the desktop:
12 blocks cost 5.5 s to the first frame and 3.6 s to resume a seek,
against 2.5 s and 1.5 s with none. The mobile bridge, which iOS links
too, built its StreamSource from StreamConfig::default() and kept the
12 blocks. The value is now pstr_stream::MPV_READAHEAD_BLOCKS, passed by
every player (B74).
2026-11-28 18:27:55 +01:00
nvrl 47ea4c73b8 Merge pull request #54 from narrrl/chore/sdk-0.12.10
chore(deps): proton-sdk and proton-drive-rs 0.12.10
2026-11-28 17:46:12 +01:00
nvrl ce09664d9a chore(deps): proton-sdk and proton-drive-rs 0.12.10
The SDK now reports how many times each API call was sent, so
`pstr bench --requests` shows transport attempts instead of
"unavailable".
2026-11-28 17:45:32 +01:00
nvrl d7070b49ac Merge pull request #52 from narrrl/feat/bench-attempts
feat(cli): report the transport attempts behind a benchmark's calls
2026-11-28 17:05:14 +01:00
nvrl c7d8369389 feat(cli): report the transport attempts behind a benchmark's calls
SDK 0.12.10 puts an `attempts` attribute on each `http_request` event:
the first send, retries and the replay after a token refresh. The
request counter adds them up beside the calls and prints the total and
each route's repeated sends. Calls without the attribute are counted
apart, so an older SDK reads "unavailable" rather than a wrong number.
2026-11-28 16:46:13 +01:00
nvrl 82ec1e9c51 feat(cli): count a benchmark's Drive requests by route
`pstr bench --requests` gives the bench its own telemetry sink and
prints, per phase, the API calls by route, the block downloads and the
SDK operations they belong to. Only the share holding the file is
opened, so the share-open count is that share's alone.

Routes keep their shape with ids replaced by `{id}`, and nothing else
from an event is stored, so the report holds no URL, name or token.
The SDK reports one event per logical call, so retries inside a call
are not counted; the report says so.

Moves proton-sdk and proton-drive-rs to 0.12.9, which reports the
public-link handshake to telemetry with fixed endpoint labels.
2026-11-28 15:59:37 +01:00
nvrl d9767518b7 Merge pull request #50 from narrrl/chore/sdk-0.12.8
chore(deps): proton-sdk and proton-drive-rs 0.12.8
2026-11-28 15:07:26 +01:00
nvrl 2ad97de709 chore(deps): proton-sdk and proton-drive-rs 0.12.8
Both crates move together from 0.12.2. 0.12.8 labels each instrumented
HTTP operation with its endpoint, the base the request benchmarks in
PLAN.md count against. No Stream code changes. This commit is the
pre-optimisation baseline.
2026-11-28 13:58:44 +01:00
Nils Pukropp 84333cbd5e chore(aur): update packages to 2.5.1 2026-11-25 03:50:35 +00:00
nvrl cf367e2a8c Merge pull request #49 from narrrl/release/2.5.1
chore(release): 2.5.1
v2.5.1
2026-11-25 04:07:36 +01:00
nvrl 943db5a6d7 Merge pull request #48 from narrrl/fix/duplicate-copies
fix(core,android): list a copied episode once, and keep recovered mpv errors off the player
2026-11-25 04:07:25 +01:00
nvrl 4157d1f884 chore(release): bump version to 2.5.1 2026-11-25 04:05:47 +01:00
nvrl aec39e3961 fix(core,android): list a copied episode once, and keep recovered mpv errors off the player
A file copied into a second folder became a second episode: Inuyasha listed
episodes 1 and 2 twice. Library::build now keeps one of each file a title holds
more than once (same name, same size), preferring the copy played last and
otherwise the one in the folder holding more of the title, where an
ordered-chapters episode finds its opening and ending.

Android showed the first error-level line mpv logged as soon as it arrived,
so a High 10 episode that falls back to software decoding put "Could not open
codec." over a playing picture, and a copy without its opening and ending put
the missing timeline there. The error is now held until the file actually
ends with an error, as on iOS, and mpv's warnings and errors go to logcat
under pstr-mpv.
2026-11-25 04:04:59 +01:00
Nils Pukropp 938f34658e chore(aur): update packages to 2.5.0 2026-11-25 01:52:35 +00:00
nvrl a14151a706 Merge pull request #47 from narrrl/release/2.5.0
chore(release): 2.5.0
v2.5.0
2026-11-25 02:11:03 +01:00
nvrl 53c7e62b8e docs: retake the phone screenshots on the new design 2026-11-25 02:00:46 +01:00
nvrl 52398a3e3c chore(release): bump version to 2.5.0
Desktop screenshots are retaken on the new design, and the Flathub
screenshots point at the v2.5.0 tag.
2026-11-25 01:24:26 +01:00
nvrl c58892b565 Merge pull request #46 from narrrl/feat/season-art
feat(core,meta,app,android,ios): show each season's own poster, name and synopsis
2026-11-25 00:54:30 +01:00
nvrl 1d5fb8ada7 feat(core,meta,app,android,ios): show each season's own poster, name and synopsis
AniList files every season as an entry of its own, and a title matches the
first, so picking season three of The Apothecary Diaries still showed
season one's cover and synopsis.

Enrichment already walks the sequel chain to find the episodes; the
relations query now also asks each entry for its cover, banner, name,
synopsis and year. A library season takes the art of the entry that
answers its lowest-numbered file, and the result is stored as JSON in a
new season_art column (schema 16), kept across a refresh of the match the
same way the chain is.

Desktop shows the picked season's poster, name and synopsis in the title
header; Android (phone and TV) and iOS show its name, cover and synopsis
above the episodes. Seasons the match itself answers keep the title's art.
2026-11-25 00:50:46 +01:00
nvrl 57eca91fb5 Merge pull request #45 from narrrl/fix/android-screenshots
test(android): re-record the screenshot baselines the redesign changed
2026-11-25 00:38:19 +01:00
nvrl f1ed172d42 Merge pull request #44 from narrrl/feat/ordered-chapters
feat: play ordered-chapters openings and endings from beside the episode
2026-11-25 00:37:55 +01:00
nvrl 219ac7038c test(android): re-record the screens the redesign changed
The design overhaul in #39 changed every screen with a card, a focus ring
or a scrim, but the Roborazzi baselines were not retaken, so
verifyRoborazziDebug failed 17 of them on main once #42 got the
Robolectric jars past Maven Central's 429s.
2026-11-25 00:37:02 +01:00
nvrl 18e2b78b2a Merge branch 'main' into feat/ordered-chapters 2026-11-24 23:56:18 +01:00
nvrl 76c2c70be1 feat(core,stream,app,cli,android,ios): play ordered-chapters openings and endings from beside the episode
An ordered-chapters episode links its opening and ending from other files
by SegmentUID. mpv looks for those in the episode's directory, which a
stream does not have, so the chapters were skipped.

Before an episode loads, read which segments it links to, read the
SegmentUID of the unnumbered files in the same folder, and hand mpv the
matching streams as an inline ordered-chapters-files playlist. A
candidate's SegmentUID is remembered by revision for the life of the
process.

On mobile, mpv re-opens the main URL while resolving references and
closes it again; native streams are now reference-counted per open so
that close no longer releases the stream that is playing.

Openings and endings on their own are no longer listed as episodes of a
numbered series.
2026-11-24 23:47:32 +01:00
nvrl db46dfea49 Merge pull request #43 from narrrl/fix/meta-airing-season
fix(core,meta): a show airs while the latest season the library holds does
2026-11-24 23:10:07 +01:00
nvrl 4b86a4f3fc Merge pull request #42 from narrrl/fix/ci-robolectric-download
fix(ci): get Maven Central artifacts past its 429s
2026-11-24 23:09:51 +01:00