Commit Graph
50 Commits
Author SHA1 Message Date
zarzet 7aa2f37496 chore: remove comments that restate the code
One-line doc comments and inline comments that only repeat the name, the
type or the next statement of what they describe, in the Dart, Kotlin and
desktop runner sources. Comments that state a reason, a constraint, a
unit, a value set or a platform quirk stay. No code changes.
2026-11-17 02:06:37 +07:00
zarzet 9e5313ff22 feat(playback): apply speed and pitch in every deck
Every deck now multiplies its rate by playbackSpeed and applies
playbackPitch at once, also mid-song and while paused, and reports
what it can do through PlaybackDeck.tempoSupport.

- audioplayers: effective rate, and a per-player setPitch on the forks'
  channel, sent only when it differs from the default and again for
  each source so a refusal reports speed only for that source. Direct
  output ignores both; Windows and Linux report speed only.
- Old Android engine: setPitch in the vendored audioplayers_android,
  applied through MediaPlayer playback parameters with the speed.
- media3: setPlaybackParameters (speed and pitch) replaces setRate; the
  AudioTrack buffer is sized for 2.5x.
- libmpv: speed and audio-pitch-correction, and a semitone shift in the
  equalizer's af chain: a lavfi rubberband filter where the build has
  one, otherwise resampling with mpv's scaletempo.
- Cast reports none; switching decks report their active deck.
2026-11-11 01:52:25 +07:00
zarzet 5c513133f7 fix(android): size the media3 audio buffer for 2x speed
With AudioTrack playback parameters media3 sizes the PCM buffer for 8x
speed, about 3 s at normal speed. Once a song's end is in that buffer the
track is told to play out, so a song queued later (for example after a
seek near the end) made the handoff open a new AudioTrack with a short
gap. Size the buffer for 2x instead, a quarter of the size and still at
least the normal buffer's time up to 2x, above the app's 1.2x maximum.
Volume, speed and the session equalizer act after the buffer.

Add an instrumentation test that measures queued handoffs with an
analytics listener: audio tracks opened, underruns and total play time.
2026-11-08 00:17:44 +07:00
zarzet 884864745d feat(android): add a media3 ExoPlayer playback engine channel
Add com.zarz.mornye/media3_player with per-player event channels for
ordinary mixer playback through media3 1.9.2, the version
video_player_android already bundles. Players live on one owned
HandlerThread looper; create replies after its event channel is
registered. Offload, audio focus and becoming-noisy handling are off,
the session id is set before the first source, and the wake mode follows
the source type.

SAF leases are duplicated and read through media3's
FileDescriptorDataSource, closed once the item has left the playlist and
its last reader closed. queueNext appends to the same playlist for
gapless playback and reports the transition; a queued item whose load
fails is dropped so the current one plays out, then reported as the
failed current item. High-resolution PCM uses float output with platform
playback parameters for speed. The DynamicsProcessing equalizer is
copied from the audioplayers fork.
2026-11-08 00:17:44 +07:00
zarzet bf2d72a395 fix(android): register player events before create replies
Since player operations moved off the UI thread, create replied before
the event channel's main-thread registration ran. Dart listened to a
stream with no handler, lost the prepared event, and playback loaded
forever. Reply after the registration instead.
2026-11-05 17:05:36 +07:00
zarzet c065e4ebeb fix(android): move player operations off the UI thread 2026-11-05 15:52:38 +07:00
zarzet 335ae95ff3 fix(android): keep media controls responsive during artwork reads 2026-11-04 02:25:16 +07:00
zarzet 66ffc89987 fix(android): size notification mark for the status bar 2026-11-02 19:25:54 +07:00
zarzet e1c497aafe fix(android): promote download service before queue preparation
Enter foreground before reading queue payloads or recovering ReplayGain, and handle missing covers during download completion prewarming.
2026-11-02 19:21:04 +07:00
zarzet f2cf97a3de perf(player): bound the Android notification art cache
audio_service kept every decoded cover in an LruCache sized one eighth
of the Java heap (16 to 64 MB) that only onDestroy emptied, so a long
shuffle session filled it after 8 to 15 covers and held it through
background playback. Its decode used a power-of-two sample size toward
512 px, so an 800 px Library thumbnail stayed 2.4 MiB and a 1000 px
cover 3.8 MiB, although the session only takes 512 px copies.

The service now keeps the current cover and the two before it
(RecentArtCache), and onTrimMemory at TRIM_MEMORY_RUNNING_LOW or above
(UI_HIDDEN and BACKGROUND on Android 14 and later) drops all but the
current one. Eviction never recycles, so the notification and session
keep what they show. Each decoded cover is scaled to 512 px with the
same createScaledBitmap call the session copy made, so the session's
512 px copies keep their pixels; the 256 px notification icon is now
scaled from 512 px (owner-approved).

Retained art goes from up to 16 to 64 MB to at most three 1 MiB
bitmaps, one after a trim. Recorded in MORNYE_PATCHES.md; JUnit
RecentArtCacheTest, and the instrumented MediaControlMetadataTest
covers the 512 px bound.
2026-10-31 22:17:26 +07:00
zarzet 2000cabd62 fix(android): resolve audio service lint warnings 2026-10-30 00:00:09 +07:00
zarzet 22e3536dd5 fix(android): guard media artwork against recycled bitmaps 2026-10-29 23:46:29 +07:00
zarzet 500f884018 fix(downloads): hide temporary SAF audio from media scanners 2026-10-29 01:23:43 +07:00
zarzet 23d6bb44a0 fix(metadata): export cover and lyrics for local library files
Offer cover and LRC export for accessible imported songs. Publish Android SAF sidecars beside the audio document without requiring download history, reuse cached artwork when needed, and clean temporary outputs on every exit path.

Validation: 36 Flutter tests, one Android SAF instrumentation test, scoped analysis, formatting checks, and git diff --check passed.
2026-10-28 22:02:24 +07:00
zarzet 2fe3bf7ab8 fix(link): recover remote covers and retire cancelled playback errors 2026-10-27 17:55:36 +07:00
zarzet 4bdd22d2e8 fix(android): preserve audio routing during player initialization
Preserve the system audio mode and speakerphone route when only player settings change. Apply explicit global routing changes using the incoming context instead of the previous defaults.

Verified with three native routing regression tests and 34 Dart player tests. The Android build and audioplayers lint checks pass. Related to #721.
2026-10-24 10:30:12 +07:00
zarzet 463c2ce938 fix(android): refresh media controls when track metadata changes
Publish metadata and artwork on the main looper, then refresh the playback media ID while preserving position and playback controls. Cover delayed metadata with playing and paused Android session tests.
2026-10-23 02:48:04 +07:00
zarzet 11a9b9a4ec chore: remove redundant comments across the codebase 2026-10-22 01:41:09 +07:00
zarzet c9732fe440 fix(downloads): keep finalized FLAC paths and container names consistent 2026-10-21 01:48:14 +07:00
zarzet 37e21b5712 feat(branding): rename app and native backend to Mornye
Rename the Dart package, Android and iOS identifiers, Rust crates, native libraries, and Discord plugin. Preserve legacy data readers and compatibility aliases.

Update localized branding, documentation, artwork, build tooling, and release artifacts. Route Telegram release notifications to @mornyeupdates and link @mornyecommunity.
2026-10-20 12:00:44 +07:00
zarzet 66d480dbdc fix(storage): retain legacy Android cipher migration support 2026-10-18 04:09:16 +07:00
zarzet 3dc2d69051 fix(audio): preserve FLAC precision in Android bit-perfect playback 2026-10-15 00:28:17 +07:00
zarzet c0fd506c78 fix(storage): preserve audio MIME when publishing SAF downloads
Honor the requested MIME across publication paths, retain the audio suffix in temporary names, and exclude unfinished documents from full and incremental scans. Verify MIME and byte integrity across four formats and publication modes.
2026-10-13 19:38:11 +07:00
zarzet 186c66aeb8 fix(lyrics): refresh LRC sidecars in their actual SAF folder
Resolve opaque SAF document ancestry before writing adjacent lyrics. Propagate failed requested LRC writes and cover native word-synced refresh in regression tests.
2026-10-13 19:38:00 +07:00
zarzet e3b69a25ef fix(download): probe M4A streams before preserving requested FLAC
Provider and decryption extensions describe the downloaded container, not
its audio codec. A decrypted M4A/MP4 can still carry FLAC, so a requested
FLAC output now reaches the codec probe instead of being preserved early.
Lossy streams keep their native container and still receive metadata.
2026-10-13 18:27:16 +07:00
zarzet 1b9c35f322 fix(downloads): preserve browser verification and queues across restarts 2026-10-09 18:07:49 +07:00
zarzet 37258a6160 fix(setup): recover folder permissions after Android restarts 2026-10-09 18:07:38 +07:00
zarzet c7b1d0b0ec fix(metadata): preserve original artwork resolution for SAF files 2026-10-09 10:34:49 +07:00
zarzet c69f2cef9f perf(library): scan SAF CUE audio through live descriptors 2026-10-04 01:41:35 +07:00
zarzet 541bfc4002 perf(media): shrink FFmpeg while preserving HTTPS motion artwork 2026-10-04 01:35:48 +07:00
zarzet e35a3cbb84 fix(library): scan remote SAF folders when root metadata is unavailable 2026-10-03 13:40:39 +07:00
zarzet bbe2caa754 fix(android): preserve remote SAF descriptors for audio and artwork 2026-10-03 02:14:06 +07:00
zarzet fbf479c102 fix(download): stop crashing native finalization on Android regex
Android's regex engine rejects Pattern.UNICODE_CHARACTER_CLASS, so NativeFinalizationPolicy failed to initialize and every native download crashed while writing metadata. List Unicode spaces explicitly and cover the separator with a device test.
2026-10-02 01:24:26 +07:00
zarzet c5789df87d fix(storage): retain document access for library metadata and covers 2026-09-30 21:42:53 +07:00
zarzet 88508c806a perf(library): reuse bounded artwork thumbnails during scans 2026-09-30 20:57:59 +07:00
zarzet e61e54f93f fix(download): align native metadata preparation and ReplayGain support 2026-09-28 12:21:15 +07:00
zarzet 4c2c356763 fix(download): detect mislabeled MP4 before native metadata writes 2026-09-28 12:13:17 +07:00
zarzet e0f5a96564 fix(player): distinguish AAudio access and decoder failures 2026-09-27 15:26:11 +07:00
zarzet d92bcf7716 feat(player): add AAudio hi-res, WavPack DSD and DAC volume 2026-09-27 15:26:11 +07:00
zarzet 608675a255 feat(player): add direct USB audio and DSD transport 2026-09-27 15:26:10 +07:00
zarzet 4e464b5b6b feat(player): add verified USB bit-perfect PCM output 2026-09-27 12:22:42 +07:00
zarzet 728d179d69 refactor(discord): remove rich presence and bundled SDK
Remove the presence setting, platform bridge, SDK archive, and SDK preparation from local and CI builds. Reject leftover Discord native libraries in release APK audits.
2026-09-26 03:07:04 +07:00
zarzet 040c328479 feat(widgets): add native Android and iOS home screen players
Publish artwork, metadata, and transport state through a shared Dart bridge. Add configurable Android RemoteViews and iOS WidgetKit players with controls and links into the full player.

Serialize widget commands and session restoration, and share one headless-capable iOS Flutter engine with the foreground scene. Include native integration tests, Dart bridge tests, and widget setup documentation.
2026-09-25 01:22:58 +07:00
zarzet 054041e40d perf(extensions): collect unreachable JavaScript cycles after idle bursts 2026-09-17 18:27:46 +07:00
zarzet a9a395b9f8 perf(metadata): preserve typed values across the Rust extension bridge 2026-09-17 18:07:56 +07:00
zarzet 2c4e391643 perf(extensions): validate JSON without allocating argument trees 2026-09-17 18:07:22 +07:00
zarzet 91ef538c87 perf(cue): parse SAF previews without copying audio 2026-09-17 17:38:49 +07:00
zarzet 1387a28d66 perf(android): batch SAF library recovery metadata queries 2026-09-17 17:38:15 +07:00
zarzet c868aac2cc perf(android): batch SAF lookups during download publication 2026-09-17 03:30:30 +07:00
zarzet f0ed293d48 feat: add opt-in Discord Rich Presence on Android
Use the official Discord Social SDK through JNI to share built-in player activity, clear presence when playback stops, and guard against late callbacks after disabling. Package the SDK optionally through SPOTIFLAC_DISCORD_SDK_DIR with license notices.

Credit: @itsmegaaa for the Rich Presence initiative and contribution in #575 and #576.

Validation: 15 Dart tests, scoped Flutter analysis, and one Android 16 ARM64 SDK/JNI instrumentation test passed. Visible presence on a signed-in Discord profile remains unverified.
2026-09-17 02:12:24 +07:00