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

Setting updates cut out the playback #736

Closed
1 task done
Reiji777 opened this issue Feb 5, 2022 · 1 comment · Fixed by #788
Closed
1 task done

Setting updates cut out the playback #736

Reiji777 opened this issue Feb 5, 2022 · 1 comment · Fixed by #788
Assignees
Labels

Comments

@Reiji777
Copy link

Reiji777 commented Feb 5, 2022

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

On any device regardless its spec, setting updates will always cut out the playback abruptly for a short period of time.

  • I know that you mentioned this potential problem in the issue below, but wanna follow up a little bit.
    Setting update becomes laggy #657

  • I'm reporting it because this behavior is likely to be obvious (especially when adjusting volumes, which users would often do) on every device regardless of its spec, due to the current implementation. It was quite obvious on my Macbook and iPhone, which are supposed to be more than powerful to handle such playback.

Expected Behavior

Playback shouldn't be cut out abruptly when updating settings

Steps To Reproduce

  1. Open project website alphatab.net
  2. play the sample
  3. Adjust volumes of any track, and you will notice the cut out

Link to jsFiddle, CodePen, Project

No response

Found in Version

1.3-alpha

Platform

Web

Environment

- **OS**: MacOS
- **Browser**: Safari 15.2 (17612.3.6.1.6)

Also can reproduce the issue on iPhone X.

Anything else?

Not sure if below makes sense -- I could imagine two possible approaches to possibly optimize this behavior:

  1. Instead of immediately clearing all audio buffers and re-generating the audio, is it possible to still keep playing the old buffers until the new buffer becomes ready? I assume this way there won't be abrupt cut out, and thus the setting update should feel smoother.
  2. We expose the buffer size as a setting property, so that users can customize it based on their devices. We set the buffer size of version 1.2.1 as the default value, which has turned out to work for most devices except for those with very poor specs. This way only users with poorly performing devices will experience the delay of the setting updates -- not the best, but I assume it'd be better than impacting all users.
@Danielku15
Copy link
Member

Danielku15 commented Mar 12, 2022

I added a setting for now which controls the buffering time. I put some thoughts into a more dynamic update/transition between audio buffers with regeneration but the current architecture hardly allows this. As of today synth outputs are not aware of the timestamps of the samples they are requesting or receiving. They are rather dumb sinks with ring buffers. This makes any synchronization with regeneration hard to impossible.

I would need to think of a bigger architectural redesign if this area. But having a 500ms delay (like now default) should be OK for all users. If we face again issues with crackling noises, we might again rather start from this side.

https://alphatab.net/docs/reference/settings/player/buffertimeinmilliseconds#description

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

Successfully merging a pull request may close this issue.

2 participants