Closed spy-reality closed 2 years ago
So I confess I didn't pick through the logs to find the exact problem stated, but when I was using 2.0.3 to test, I found that rotate didn't work correctly: it would go through the list of sources and then stay on the final source (I think that's like "sequence"?)
I went back to 2.0.2 for daily play and rotate behaves as it should in 2.0.2.
I'm also seeing this behaviour.
CC @toots.
Thanks for this report y'all. Looking at it right now.
Hi again!
I'm not sure exactly what to look at here. We have a test for rotate
that seems to work:
jingles = mksafe(playlist(mode="normal", "jingles"))
music = mksafe(playlist(mode="normal", "playlist"))
rounds = 3
played = ref([])
nmusic = ref(0)
njingles = ref(0)
nmusic = ref(0)
def ot(music, m)
fname = m["filename"]
played := [fname, ...!played]
if music then ref.incr(nmusic) else ref.incr(njingles) end
print("\n**** track: #{fname}\n")
if list.length(!played) >= 3 * rounds then
print("PLAYED: #{list.rev(!played)}\n")
if !njingles == rounds and !nmusic == 2 * rounds then
test.pass()
else
print("jingles: #{!njingles} / music : #{!nmusic}")
test.fail()
end
shutdown()
end
end
jingles.on_track(ot(false))
music.on_track(ot(true))
radio = rotate(weights=[2,1], [music,jingles])
output.dummy(fallible=true, radio)
@spy-reality could you share more of your script? What is the definition of the new_meta
and jingle_meta
operator? What are you observing? I can't understand what's going wrong with just the logs.
@Kerosel & @codeofdusk do you have a minimal script I could use to reproduce y'all issue?
@spy-reality could you share more of your script? What is the definition of the new_meta and jingle_meta operator? What are you observing? I can't understand what's going wrong with just the logs.
def new_meta(j)
rewrite_metadata([
("title", 'Новая песня $(if $(artist), " > $(artist) - ", "") $(if $(title), "$(title)", "")'),
("artist", "RADIO"),
("comment", "http://xyz.pro")
], j)
end
def jingle_meta(j)
rewrite_metadata([
("artist", "RADIO"),
("title", "Джингл (xyz.pro)"),
# ("comment","http://xyz.pro")
], j)
end
Thanks for y'all patience and example. I was able to identify an issue when reselecting the next source when the last played source was not the first one in the list. This should be fixed in v2.0.4-preview
and main
. The test was updated to reflect's @spy-reality example:
jingles = mksafe(playlist(id="jingles", mode="normal", "jingles"))
music = mksafe(playlist(id="music", mode="normal", "playlist"))
music2 = mksafe(playlist(id="music2", mode="normal", "playlist"))
rounds = 10
round_len = 8
played = ref([])
njingles = ref(0)
nmusic = ref(0)
nmusic2 = ref(0)
def ot(label, _)
played := [label, ...!played]
if label == "music" then ref.incr(nmusic) end
if label == "music2" then ref.incr(nmusic2) end
if label == "jingles" then ref.incr(njingles) end
print("\n**** track: #{label}\n")
if list.length(!played) == round_len * rounds then
print("PLAYED: #{list.rev(!played)}\n")
if !njingles == rounds and !nmusic == 3 * rounds and !nmusic2 == 4 * rounds then
test.pass()
else
print("jingles: #{!njingles} / music : #{!nmusic} / music2: #{!nmusic2}")
test.fail()
end
shutdown()
end
end
jingles.on_track(ot("jingles"))
music.on_track(ot("music"))
music2.on_track(ot("music2"))
radio = rotate(id="rotate", weights=[3,1], [music,jingles])
radio = rotate(id="rotate2", weights=[1,1], [radio, music2])
clock.assign_new(sync="none",[radio])
output.dummy(fallible=true, radio)
When will 2.0.4-preview hit Opam? I don't see any PRs against the opam package repository...
I plan on releasing it very soon. Meanwhile, you can pin it locally:
git clone https://github.com/savonet/liquidsoap.git
cd liquidsoap && git checkout v2.0.4-preview
opam install -y .
I also receive the "no solution found" error when attempting to pin and install that branch, even with mad and mm pinned to master. See https://github.com/savonet/liquidsoap/issues/2167#issuecomment-1091021387
Hmm that's odd. Do you have anything left pinned? At this point all the deps are in the opam
repo so you should not need to have any pinned dependency.
$ opam list --pinned
# Packages matching: pinned
# No matches found
$ opam pin liquidsoap .
[liquidsoap.2.0.3-1] synchronised from git+file:///home/codeofdusk/liquidsoap#v2.0.4-preview
liquidsoap is now pinned to git+file:///home/codeofdusk/liquidsoap#v2.0.4-preview (version 2.0.4)
Sorry, no solution found: there seems to be a problem with your request.
[NOTE] Pinning command successful, but your installed packages may be out of sync.
What's the OCaml version on this switch? Min version was bumped to 4.12
recently.
That was it – upgrading from 4.11.0 to 4.14.0 fixed it. Thanks!
Glad to hear! Let us know if you're able to confirm the fix!
I can confirm that rotate
works as expected in commit 17c585c56b30c2070eef4409680b5b9f093f2b72!
Dope thanks!
Describe the bug
To Reproduce
Expected behavior Not work rotate in version 2.0.3 in version 2.0.2 all ok
Version details
Install method Opam
Common issues out(%ffmpeg(format="mp3",%audio(codec="libshine", samplerate=44100, b = "192k")), mount = "test", s)