mirror of
https://github.com/jpochyla/psst.git
synced 2026-04-27 07:25:52 +03:00
[GH-ISSUE #251] Buggy track switching #180
Labels
No labels
api
bug
build
documentation
duplicate
enhancement
good first issue
help wanted
idea
invalid
linux
lowprio
macos
pull-request
upstream
windows
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/psst#180
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @jforberg on GitHub (Jan 8, 2022).
Original GitHub issue: https://github.com/jpochyla/psst/issues/251
Describe the bug
I noticed a regression in current master (
2961c05a) compared to the version I was previously running (105f6cc2).When switching tracks, the sound flakes out for a moment. This is the case in both versions, but the behaviour in current master is worse IMO.
In
105f6cc2, there is just a pop artefact.In
2961c05a, it sounds like if the current track is first paused, then played again for a short time, then the next track starts playing.Please see attached video samples.
To Reproduce
Play one track, then start playing another one.
Expected behavior
Clean switch from one track to the next.
Screenshots
105f6cc2
2961c05a
(The visual artefacts are caused by my screen recorder, not seen in real usage.)
Environment
Additional context
Please let me know what additional info would be helpful and I can provide it.
@jpochyla commented on GitHub (Jan 9, 2022):
@jforberg Should be fixed in latest master, can you confirm?
@jforberg commented on GitHub (Jan 11, 2022):
@jpochyla No, the issue is still there in
8f142a3232unfortunately@jacksongoode commented on GitHub (Feb 4, 2022):
I can also confirm this behavior on my system.
@instinctualjealousy commented on GitHub (Aug 28, 2022):
This is still the case.
@oleggtro commented on GitHub (Nov 1, 2022):
Hate to be the "+1" guy, but the problem introduced in
2961c05still persists@arch-btw commented on GitHub (Dec 4, 2022):
Ah I thought I was going crazy, I have this issue too. I noticed that it's specifically bad when it's a track that's not cached.
@Insprill commented on GitHub (Dec 17, 2022):
This looks to be caused by
AudioSink#resume's StreamMsg to resume arriving before CallbackMsg's PlaySource and Resume messages. This is the order in which things end up being executed:github.com/jpochyla/psst@d70ed81045/psst-core/src/audio/output/cpal.rs (L118-L120)github.com/jpochyla/psst@d70ed81045/psst-core/src/audio/output/cpal.rs (L127-L130)Start playing audio:github.com/jpochyla/psst@d70ed81045/psst-core/src/audio/output/cpal.rs (L193-L199)Set the audio to be played:github.com/jpochyla/psst@d70ed81045/psst-core/src/audio/output/cpal.rs (L241-L243)github.com/jpochyla/psst@d70ed81045/psst-core/src/audio/output/cpal.rs (L250-L252)Unfortunately, I've looked around a bit and can't see a clear way to fix the issue, but maybe this can point someone in the right direction.@wjp commented on GitHub (May 18, 2023):
I'm also getting this on Linux with cpal's ALSA backend. While debugging this I tried switching cpal to the Jack backend, and that seems to avoid this issue. (Or possibly make it small enough not be noticable.)
Also, looking at the runtime behaviour of the stream callback on my system, the possible explanation given by @Insprill above doesn't seem to be happening here.
That makes me wonder if it could be due to samples remaining in an alsa or hardware buffer, since cpal doesn't seem to let us specify if it should drop any remaining samples in buffers after resuming from the paused state. See https://github.com/RustAudio/cpal/issues/284 .
@SO9010 commented on GitHub (Aug 4, 2024):
This is still an issue but for me it's hardly noticeable.
@oleggtro commented on GitHub (Aug 5, 2024):
I'm currently using psst on macOS (built from
2d9bdcbon 2024-07-30 22:50) and can't notice the issue.@jacksongoode commented on GitHub (Nov 5, 2024):
I don't think its apparent on macOS, but maybe just Linux and Windows?