Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error when using delay with single #4265

Closed
918483 opened this issue Dec 13, 2024 · 13 comments
Closed

error when using delay with single #4265

918483 opened this issue Dec 13, 2024 · 13 comments
Labels

Comments

@918483
Copy link

918483 commented Dec 13, 2024

Description

In version 2.2.5, the delay was used together with the single and with that the metadata was updated normally, however, in version 2.3.0, the metadata is no longer updated.

Steps to reproduce

test = single("arquivo.mp3")
radio = delay(180.,teste)

Expected behavior

I would like to know how to display it again

Liquidsoap version

Liquidsoap 2.3.0+dev
Copyright (c) 2003-2024 Savonet team
Liquidsoap is open-source software, released under GNU General Public License.
See <http://liquidsoap.info> for more information.

Liquidsoap build config

* Liquidsoap version  : 2.3.0+dev

 * Compilation options
   - Release build       : false
   - Git SHA             : (none)
   - OCaml version       : 4.14.0
   - OS type             : Unix
   - Libs versions       : angstrom=0.16.1 base=v0.16.3 base.base_internalhash_types=v0.16.3 base.caml=v0.16.3 base.shadow_stdlib=v0.16.3 bigarray=[distributed with Ocaml] bigstringaf=0.10.0 bytes=[distributed with OCaml 4.02 or above] camlp-streams camomile.lib=2.0 cry=1.0.3 curl=0.9.2 domain_shims dtools=0.4.5 dune-build-info=3.17.0 dune-private-libs.dune-section=3.17.0 dune-site=3.17.0 dune-site.private=3.17.0 duppy=0.9.4 fdkaac=0.3.3 ffmpeg-av=1.2.1 ffmpeg-avcodec=1.2.1 ffmpeg-avdevice=1.2.1 ffmpeg-avfilter=1.2.1 ffmpeg-avutil=1.2.1 ffmpeg-swresample=1.2.1 ffmpeg-swscale=1.2.1 fileutils=0.6.4 flac=0.5.0 gen=1.1 lame=0.3.7 liquidsoap-lang=2.3.0 liquidsoap-lang.console=2.3.0 liquidsoap_builtins liquidsoap_core liquidsoap_fdkaac liquidsoap_ffmpeg liquidsoap_flac liquidsoap_lame liquidsoap_mad liquidsoap_optionals liquidsoap_oss liquidsoap_runtime liquidsoap_samplerate liquidsoap_ssl liquidsoap_xmlplaylist mad=0.5.3 magic-mime=1.3.1 mem_usage=0.1.1 menhirLib=20240715 metadata=0.3.0 mm=0.8.6 mm.audio=0.8.6 mm.base=0.8.6 mm.image=0.8.6 mm.midi=0.8.6 mm.video=0.8.6 ppx_compare.runtime-lib=v0.16.0 ppx_hash.runtime-lib=v0.16.0 ppx_sexp_conv.runtime-lib=v0.16.0 re=1.12.0 samplerate=0.1.6 saturn_lockfree=0.4.1 sedlex=3.3 seq=[distributed with OCaml 4.07 or above] sexplib0=v0.16.0 ssl=0.7.0 stdlib-shims=0.3.0 str=[distributed with Ocaml] stringext=1.6.0 threads=[distributed with Ocaml] threads.posix=[internal] unix=[distributed with Ocaml] uri=4.4.0 xmlm=1.4.0 xmlplaylist=0.1.5
   - architecture        : amd64
   - host                : x86_64-pc-linux-gnu
   - target              : x86_64-pc-linux-gnu
   - system              : linux
   - ocamlopt_cflags     : -O2 -fno-strict-aliasing -fwrapv -pthread -fPIC
   - native_c_compiler   : gcc -O2 -fno-strict-aliasing -fwrapv -pthread -fPIC -D_FILE_OFFSET_BITS=64
   - native_c_libraries  : -lm

 * Configured paths
   - mode              : default
   - standard library  : (set by dune-site)
   - scripted binaries : (set by dune-site)
   - rundir            : (set by dune-site)
   - logdir            : (set by dune-site)
   - user cache        : $HOME/.cache/liquidsoap (override with $LIQ_CACHE_USER_DIR)
   - system cache      : (set by dune-site) (override with $LIQ_CACHE_SYSTEM_DIR)
   - camomile files    : (set by dune-site)

 * Supported input formats
   - MP3               : yes
   - AAC               : no (requires faad)
   - Ffmpeg            : yes
   - Flac (native)     : yes
   - Flac (ogg)        : no (requires ogg)
   - Opus              : no (requires opus)
   - Speex             : no (requires speex)
   - Theora            : no (requires theora)
   - Vorbis            : no (requires vorbis)
   - WAV/AIFF          : yes (native)

 * Supported output formats
   - FDK-AAC           : yes
   - FFmpeg            : yes
   - MP3               : yes
   - MP3 (fixed-point) : no (requires shine)
   - Flac (native)     : yes
   - Flac (ogg)        : no (requires ogg)
   - Opus              : no (requires opus)
   - Speex             : no (requires speex)
   - Theora            : no (requires theora)
   - Vorbis            : no (requires vorbis)
   - WAV/AIFF          : yes (native)

 * Tags
   - AAC               : no (requires faad)
   - FFmpeg            : yes
   - FLAC (native)     : yes
   - Flac (ogg)        : no (requires ogg)
   - Native decoder    : yes
   - Vorbis            : no (requires vorbis)

 * Input / output
   - ALSA              : no (requires alsa)
   - AO                : no (requires ao)
   - FFmpeg            : yes
   - JACK              : no (requires bjack)
   - NDI               : no (requires ctypes-foreign)
   - OSS               : yes
   - Portaudio         : no (requires portaudio)
   - Pulseaudio        : no (requires pulseaudio)
   - SRT               : no (requires srt)

 * Audio manipulation
   - FFmpeg            : yes
   - LADSPA            : no (requires ladspa)
   - Lilv              : no (requires lilv)
   - Samplerate        : yes
   - SoundTouch        : no (requires soundtouch)
   - StereoTool        : no (requires ctypes-foreign)

 * Video manipulation
   - camlimages        : no (requires camlimages)
   - FFmpeg            : yes
   - frei0r            : no (requires frei0r)
   - ImageLib          : no (requires imagelib)
   - SDL               : no (requires tsdl-image & tsdl-ttf)

 * MIDI manipulation
   - DSSI              : no (requires dssi)

 * Visualization
   - GD                : no (requires gd)
   - Graphics          : no (requires graphics)
   - SDL               : no (requires tsdl-image & tsdl-ttf)

 * Additional libraries
   - FFmpeg filters    : yes
   - FFmpeg devices    : yes
   - inotify           : no (requires inotify)
   - irc               : no (requires irc-client-unix)
   - jemalloc          : no (requires jemalloc)
   - lastfm            : no (requires lastfm)
   - lo                : no (requires lo)
   - memtrace          : no (requires memtrace)
   - osc               : no (requires osc-unix)
   - ssl               : yes
   - sqlite3           : no (requires sqlite3)
   - tls               : no (requires tls-liquidsoap)
   - posix-time2       : no (requires posix)
   - windows service   : no (requires winsvc)
   - YAML support      : no (requires yaml)
   - XML playlists     : yes

 * Monitoring
   - Prometheus        : no (requires prometheus)

Installation method

From OPAM

Additional Info

No response

@918483 918483 added the bug label Dec 13, 2024
@918483
Copy link
Author

918483 commented Dec 16, 2024

????

@vitoyucepi
Copy link
Collaborator

Hi @918483,
Your issue may be similar to #4262.
May I ask you to test the latest version from the main branch?

@918483
Copy link
Author

918483 commented Dec 16, 2024

How would you do that? @vitoyucepi

@brenc
Copy link

brenc commented Dec 18, 2024

This is happening for me too (v2.3.0 Docker). Seems any source when paired with delay() will not produce metadata when active.

@brenc
Copy link

brenc commented Dec 18, 2024

Here's my minimal repro:

# This does not generate metadata:
let autodj = delay(1.0, single("some.mp3"))
# This generates metadata as expected:
# let autodj = single("some.mp3")

autodj = mksafe(autodj)

let o = output.dummy(autodj)

let metadata = ref([])
# Metadata is empty when using delay()!
o.on_track(fun (m) -> begin
  if list.length(m) == 0 then
    log("XXX METADATA IS EMPTY")
  else
    log("metadata: #{m}")
  end
  metadata := m
end)

thread.run(every=1.0, {print("current metadata: #{metadata()}")})

@toots
Copy link
Member

toots commented Dec 19, 2024

Thanks y'all I'm gonna have a look shortly.

@brenc
Copy link

brenc commented Dec 20, 2024

Seems this isn't limited to delay. Today I experimented with adding crossfade to a source and lost all metadata.

@vitoyucepi
Copy link
Collaborator

This problem was introduced by 77cf76e, similar to #4262, but not fixed in #4270.

Bisecting made me feel miserable.
--- a/dune-project
+++ b/dune-project
@@ -45,18 +45,18 @@
   (name liquidsoap-core)
   (depends
     (ocaml (>= 4.14.0))
-    (dtools (>= 0.4.5))
-    (duppy (>= 0.9.3))
-    (mm (>= 0.8.4))
-    (re (>= 1.11.0))
-    (ocurl (>= 0.9.2))
-    (cry (>= 1.0.0))
-    (camomile (>= 2.0.0))
+    (dtools (= 0.4.5))
+    (duppy (= 0.9.3))
+    (mm (= 0.8.4))
+    (re (= 1.11.0))
+    (ocurl (= 0.9.2))
+    (cry (= 1.0.0))
+    (camomile (= 2.0.0))
     uri
     fileutils
     menhirLib
-    (saturn_lockfree (>= 0.4.1))
-    (metadata (>= 0.2.0))
+    (saturn_lockfree (= 0.4.1))
+    (metadata (= 0.2.0))
     dune-build-info
     (liquidsoap-lang (= :version))
     (ppx_string :build))

@toots
Copy link
Member

toots commented Dec 28, 2024

Happy to report that this is fixed by: #4289 thanks for the patience y'all.

@vitoyucepi
Copy link
Collaborator

vitoyucepi commented Dec 28, 2024

Hi @toots,
I'm not 💯 sure, but in my test the delay function stopped working since #4289.

test = single("music/1.mp3")
radio = mksafe(delay(20., test))
output.dummy(radio)
thread.run({print(metadata.cover.remove(radio.last_metadata() ?? []))}, every=1.)

settings.request.deprecated_on_air_metadata := true
ffmpeg -f lavfi -i "sine=frequency=200:duration=10" -b:a 320k -c:a mp3 1.mp3

Should be 20 seconds of blank, 10 seconds of 1.mp3.

@vitoyucepi
Copy link
Collaborator

test = single("music/1.mp3")
radio = mksafe(delay(10., test))
output.dummy(radio)
thread.run({print("#{time.up()} #{metadata.cover.remove(radio.last_metadata() ?? [])}")}, every=1.)

settings.init.allow_root := true

%ifversion >= 2.3
settings.request.deprecated_on_air_metadata := true
%endif
rolling-release-v2.2.x, 528bd6d
2025/01/04 03:32:29 [decoder.ffmpeg:3] Requested content-type for "music/1.mp3": {audio=pcm(stereo)}
2025/01/04 03:32:29 [decoder.ffmpeg:3] FFmpeg recognizes "music/1.mp3" as audio: {codec: mp3, 44100Hz, 1 channel(s)}
2025/01/04 03:32:29 [decoder.ffmpeg:3] Decoded content-type for "music/1.mp3": {audio=pcm(mono)}
2025/01/04 03:32:29 [safe_blank:3] Content type is {audio=pcm(stereo)}.
2025/01/04 03:32:29 [music/1_mp3:3] Prepared "music/1.mp3" (RID 0).
2025/01/04 03:32:29 [video.converter:3] Using preferred video converter: ffmpeg.
6.44361901283 []
2025/01/04 03:32:29 [audio.converter:3] Using samplerate converter: ffmpeg.
2025/01/04 03:32:29 [clock.main:3] Streaming loop starts in auto-sync mode
2025/01/04 03:32:29 [clock.main:3] Delegating synchronization to CPU clock
2025/01/04 03:32:29 [video.text:3] Using native implementation
2025/01/04 03:32:30 [mksafe:3] Switch to delay.
[mp3float @ 0x7a683c004ec0] Could not update timestamps for skipped samples.
7.44439506531 [("on_air_timestamp", "1735961550.00"), ("kind", "{audio=pcm(stereo)}"), ("decoder", "ffmpeg"), ("filename", "music/1.mp3"), ("temporary", "false"), ("initial_uri", "music/1.mp3"), ("status", "playing"), ("encoder", "Lavf60.16.100"), ("on_air", "2025/01/04 03:32:30"), ("rid", "0")]
8.45145797729 [("on_air_timestamp", "1735961550.00"), ("kind", "{audio=pcm(stereo)}"), ("decoder", "ffmpeg"), ("filename", "music/1.mp3"), ("temporary", "false"), ("initial_uri", "music/1.mp3"), ("status", "playing"), ("encoder", "Lavf60.16.100"), ("on_air", "2025/01/04 03:32:30"), ("rid", "0")]
9.45814800262 [("on_air_timestamp", "1735961550.00"), ("kind", "{audio=pcm(stereo)}"), ("decoder", "ffmpeg"), ("filename", "music/1.mp3"), ("temporary", "false"), ("initial_uri", "music/1.mp3"), ("status", "playing"), ("encoder", "Lavf60.16.100"), ("on_air", "2025/01/04 03:32:30"), ("rid", "0")]
10.4642751217 [("on_air_timestamp", "1735961550.00"), ("kind", "{audio=pcm(stereo)}"), ("decoder", "ffmpeg"), ("filename", "music/1.mp3"), ("temporary", "false"), ("initial_uri", "music/1.mp3"), ("status", "playing"), ("encoder", "Lavf60.16.100"), ("on_air", "2025/01/04 03:32:30"), ("rid", "0")]
11.4706120491 [("on_air_timestamp", "1735961550.00"), ("kind", "{audio=pcm(stereo)}"), ("decoder", "ffmpeg"), ("filename", "music/1.mp3"), ("temporary", "false"), ("initial_uri", "music/1.mp3"), ("status", "playing"), ("encoder", "Lavf60.16.100"), ("on_air", "2025/01/04 03:32:30"), ("rid", "0")]
12.4775521755 [("on_air_timestamp", "1735961550.00"), ("kind", "{audio=pcm(stereo)}"), ("decoder", "ffmpeg"), ("filename", "music/1.mp3"), ("temporary", "false"), ("initial_uri", "music/1.mp3"), ("status", "playing"), ("encoder", "Lavf60.16.100"), ("on_air", "2025/01/04 03:32:30"), ("rid", "0")]
13.4805831909 [("on_air_timestamp", "1735961550.00"), ("kind", "{audio=pcm(stereo)}"), ("decoder", "ffmpeg"), ("filename", "music/1.mp3"), ("temporary", "false"), ("initial_uri", "music/1.mp3"), ("status", "playing"), ("encoder", "Lavf60.16.100"), ("on_air", "2025/01/04 03:32:30"), ("rid", "0")]
14.4810941219 [("on_air_timestamp", "1735961550.00"), ("kind", "{audio=pcm(stereo)}"), ("decoder", "ffmpeg"), ("filename", "music/1.mp3"), ("temporary", "false"), ("initial_uri", "music/1.mp3"), ("status", "playing"), ("encoder", "Lavf60.16.100"), ("on_air", "2025/01/04 03:32:30"), ("rid", "0")]
15.482336998 [("on_air_timestamp", "1735961550.00"), ("kind", "{audio=pcm(stereo)}"), ("decoder", "ffmpeg"), ("filename", "music/1.mp3"), ("temporary", "false"), ("initial_uri", "music/1.mp3"), ("status", "playing"), ("encoder", "Lavf60.16.100"), ("on_air", "2025/01/04 03:32:30"), ("rid", "0")]
[mp3float @ 0x7a683c004ec0] Could not update timestamps for discarded samples.
2025/01/04 03:32:39 [decoder:2] Decoding "music/1.mp3" ended: Ffmpeg_decoder.End_of_file.
16.4850451946 [("on_air_timestamp", "1735961550.00"), ("kind", "{audio=pcm(stereo)}"), ("decoder", "ffmpeg"), ("filename", "music/1.mp3"), ("temporary", "false"), ("initial_uri", "music/1.mp3"), ("status", "playing"), ("encoder", "Lavf60.16.100"), ("on_air", "2025/01/04 03:32:30"), ("rid", "0")]
2025/01/04 03:32:40 [music/1_mp3:3] Prepared "music/1.mp3" (RID 0).
2025/01/04 03:32:40 [mksafe:3] Switch to safe_blank with forgetful transition.
17.4886901379 [("on_air_timestamp", "1735961550.00"), ("kind", "{audio=pcm(stereo)}"), ("decoder", "ffmpeg"), ("filename", "music/1.mp3"), ("temporary", "false"), ("initial_uri", "music/1.mp3"), ("status", "playing"), ("encoder", "Lavf60.16.100"), ("on_air", "2025/01/04 03:32:30"), ("rid", "0")]
18.490773201 [("on_air_timestamp", "1735961550.00"), ("kind", "{audio=pcm(stereo)}"), ("decoder", "ffmpeg"), ("filename", "music/1.mp3"), ("temporary", "false"), ("initial_uri", "music/1.mp3"), ("status", "playing"), ("encoder", "Lavf60.16.100"), ("on_air", "2025/01/04 03:32:30"), ("rid", "0")]
19.492249012 [("on_air_timestamp", "1735961550.00"), ("kind", "{audio=pcm(stereo)}"), ("decoder", "ffmpeg"), ("filename", "music/1.mp3"), ("temporary", "false"), ("initial_uri", "music/1.mp3"), ("status", "playing"), ("encoder", "Lavf60.16.100"), ("on_air", "2025/01/04 03:32:30"), ("rid", "0")]
20.4936749935 [("on_air_timestamp", "1735961550.00"), ("kind", "{audio=pcm(stereo)}"), ("decoder", "ffmpeg"), ("filename", "music/1.mp3"), ("temporary", "false"), ("initial_uri", "music/1.mp3"), ("status", "playing"), ("encoder", "Lavf60.16.100"), ("on_air", "2025/01/04 03:32:30"), ("rid", "0")]
21.4969091415 [("on_air_timestamp", "1735961550.00"), ("kind", "{audio=pcm(stereo)}"), ("decoder", "ffmpeg"), ("filename", "music/1.mp3"), ("temporary", "false"), ("initial_uri", "music/1.mp3"), ("status", "playing"), ("encoder", "Lavf60.16.100"), ("on_air", "2025/01/04 03:32:30"), ("rid", "0")]
22.4982380867 [("on_air_timestamp", "1735961550.00"), ("kind", "{audio=pcm(stereo)}"), ("decoder", "ffmpeg"), ("filename", "music/1.mp3"), ("temporary", "false"), ("initial_uri", "music/1.mp3"), ("status", "playing"), ("encoder", "Lavf60.16.100"), ("on_air", "2025/01/04 03:32:30"), ("rid", "0")]
23.5003170967 [("on_air_timestamp", "1735961550.00"), ("kind", "{audio=pcm(stereo)}"), ("decoder", "ffmpeg"), ("filename", "music/1.mp3"), ("temporary", "false"), ("initial_uri", "music/1.mp3"), ("status", "playing"), ("encoder", "Lavf60.16.100"), ("on_air", "2025/01/04 03:32:30"), ("rid", "0")]
24.5009970665 [("on_air_timestamp", "1735961550.00"), ("kind", "{audio=pcm(stereo)}"), ("decoder", "ffmpeg"), ("filename", "music/1.mp3"), ("temporary", "false"), ("initial_uri", "music/1.mp3"), ("status", "playing"), ("encoder", "Lavf60.16.100"), ("on_air", "2025/01/04 03:32:30"), ("rid", "0")]
25.5020711422 [("on_air_timestamp", "1735961550.00"), ("kind", "{audio=pcm(stereo)}"), ("decoder", "ffmpeg"), ("filename", "music/1.mp3"), ("temporary", "false"), ("initial_uri", "music/1.mp3"), ("status", "playing"), ("encoder", "Lavf60.16.100"), ("on_air", "2025/01/04 03:32:30"), ("rid", "0")]
2025/01/04 03:32:50 [mksafe:3] Switch to delay with transition.
2025/01/04 03:32:50 [replay_metadata:3] Content type is {audio=pcm(stereo)}.
26.502874136 [("on_air_timestamp", "1735961550.00"), ("kind", "{audio=pcm(stereo)}"), ("decoder", "ffmpeg"), ("filename", "music/1.mp3"), ("temporary", "false"), ("initial_uri", "music/1.mp3"), ("status", "playing"), ("encoder", "Lavf60.16.100"), ("on_air", "2025/01/04 03:32:30"), ("rid", "0")]
After #4296, 0b02cee.
2025/01/04 03:19:39 [decoder.ffmpeg:3] Requested content-type for "music/1.mp3": {audio=pcm(stereo)}
2025/01/04 03:19:39 [decoder.ffmpeg:3] FFmpeg recognizes "music/1.mp3" as audio: {codec: mp3, 44100Hz, 1 channel(s)}
2025/01/04 03:19:39 [decoder.ffmpeg:3] Decoded content-type for "music/1.mp3": {audio=pcm(mono)}
2025/01/04 03:19:39 [single_actual:3] Content type is {audio=pcm(stereo)}.
2025/01/04 03:19:39 [single_actual:3] Prepared "music/1.mp3" (RID 0).
2025/01/04 03:19:39 [delay:3] Content type is {audio=pcm(stereo)}.
2025/01/04 03:19:39 [mksafe:3] Content type is {audio=pcm(stereo)}.
[mp3float @ 0x7ab590048940] Could not update timestamps for skipped samples.
2025/01/04 03:19:39 [output.dummy:3] Content type is {audio=pcm(stereo)}.
2025/01/04 03:19:39 [dummy:3] Content type is {audio=pcm(stereo)}.
2025/01/04 03:19:39 [mksafe:3] Switch to delay.
1.48373913765 [("encoder", "Lavf60.16.100"), ("filename", "music/1.mp3"), ("initial_uri", "music/1.mp3"), ("on_air", "2025/01/04 03:19:39"), ("on_air_timestamp", "1735960779.60"), ("rid", "0"), ("temporary", "false")]
2.48946213722 [("encoder", "Lavf60.16.100"), ("filename", "music/1.mp3"), ("initial_uri", "music/1.mp3"), ("on_air", "2025/01/04 03:19:39"), ("on_air_timestamp", "1735960779.60"), ("rid", "0"), ("temporary", "false")]
3.49536919594 [("encoder", "Lavf60.16.100"), ("filename", "music/1.mp3"), ("initial_uri", "music/1.mp3"), ("on_air", "2025/01/04 03:19:39"), ("on_air_timestamp", "1735960779.60"), ("rid", "0"), ("temporary", "false")]
4.50239515305 [("encoder", "Lavf60.16.100"), ("filename", "music/1.mp3"), ("initial_uri", "music/1.mp3"), ("on_air", "2025/01/04 03:19:39"), ("on_air_timestamp", "1735960779.60"), ("rid", "0"), ("temporary", "false")]
5.50398302078 [("encoder", "Lavf60.16.100"), ("filename", "music/1.mp3"), ("initial_uri", "music/1.mp3"), ("on_air", "2025/01/04 03:19:39"), ("on_air_timestamp", "1735960779.60"), ("rid", "0"), ("temporary", "false")]
6.50641322136 [("encoder", "Lavf60.16.100"), ("filename", "music/1.mp3"), ("initial_uri", "music/1.mp3"), ("on_air", "2025/01/04 03:19:39"), ("on_air_timestamp", "1735960779.60"), ("rid", "0"), ("temporary", "false")]
7.51395606995 [("encoder", "Lavf60.16.100"), ("filename", "music/1.mp3"), ("initial_uri", "music/1.mp3"), ("on_air", "2025/01/04 03:19:39"), ("on_air_timestamp", "1735960779.60"), ("rid", "0"), ("temporary", "false")]
8.52146601677 [("encoder", "Lavf60.16.100"), ("filename", "music/1.mp3"), ("initial_uri", "music/1.mp3"), ("on_air", "2025/01/04 03:19:39"), ("on_air_timestamp", "1735960779.60"), ("rid", "0"), ("temporary", "false")]
9.52538704872 [("encoder", "Lavf60.16.100"), ("filename", "music/1.mp3"), ("initial_uri", "music/1.mp3"), ("on_air", "2025/01/04 03:19:39"), ("on_air_timestamp", "1735960779.60"), ("rid", "0"), ("temporary", "false")]
[mp3float @ 0x7ab590048940] Could not update timestamps for discarded samples.
2025/01/04 03:19:49 [decoder:2] Decoding "music/1.mp3" ended: Ffmpeg_decoder.End_of_file.
[mp3float @ 0x7ab590048940] Could not update timestamps for skipped samples.
2025/01/04 03:19:49 [single_actual:3] Prepared "music/1.mp3" (RID 0).
2025/01/04 03:19:49 [mksafe:3] Switch to safe_blank with transition.
10.5338490009 []
11.5343420506 []
12.5352740288 []
13.5364022255 []
14.5375440121 []
15.5402030945 []
16.5405011177 []
17.5462141037 []
18.5468571186 []
19.5472102165 []

@toots
Copy link
Member

toots commented Jan 4, 2025

The script behavior appears correct to me:

  1. It sets 10s of delay not 20, which is what we observe.
  2. last_metadata implementation was changed to clear the metadata on track marks. This more inline with what users would expect when expecting last_metadata to be the metadata of the current track.

You can still revert to the old behavior using the reset_last_metadata_on_track source method.

Thus, this script appears correct w.r.t to the two points above:

)]
test = single("music/1.mp3")
radio = mksafe(delay(20., test))
output.dummy(radio)
thread.run({print("#{time.up()} #{metadata.cover.remove(radio.last_metadata() ?? [])}")}, every=1.)

settings.init.allow_root := true

%ifversion >= 2.3
settings.request.deprecated_on_air_metadata := true
radio.reset_last_metadata_on_track := false
%endif

I added a new migration note for this in e262927

@toots toots closed this as completed Jan 4, 2025
@brenc
Copy link

brenc commented Jan 5, 2025

The better test would be:

test = single("music/1.mp3")
radio = mksafe(delay(10., test))
o = output.dummy(radio)
thread.run({print("#{time.up()} #{metadata.cover.remove(o.last_metadata() ?? [])}")}, every=1.)
settings.init.allow_root := true

Similar to how I did it above. This wasn't working in 2.3. Once this fix hits the rolling release I can test it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants