mpv-player / mpv-player/mpv

wrong audio pts on push-based audio outs due to incorrect driver delay calc

Open
#12,322 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

core:audio
Dominant language
C
Stars
37k
Forks
3.5k
Avg merge
1d 10h
Merged PRs (30d)
22

Description

Important Information

Provide following Information:

  • mpv version e6afc53e7cabf7d36aab4a8b25a6e2688e4449c8
Reproduction steps

Try to play audio-only files with push AOs. I could only test ao=null, ao=pulse, ao=alsa, but this should be reproducible on all of them I believe.

  1. open mpv in play state so it has time to build up the audio queue

  2. seek to EOF, or seek to EOF with --pause --loop (only with gapless audio but it's default)

  3. the audio pts will always be off by +/- 0.2-3s, causing time-remaining to never be exactly zero or in the --loop case, it'll cause the the time-pos to be a negative value on the next loop

This is most likely because of broken delay calculation on push-based AOs.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce with ao=null, ao=pulse, or ao=alsa by building the audio queue, seeking to EOF, and checking the resulting PTS and time-remaining; for looping, check time-pos on the next loop. Trace the push-based audio-output driver delay calculation and consider the issue done when EOF timing is exact and loop positions do not become negative.

Written by the indexing model from the issue text.

Assessment

Tech stack
c
Domain
audio-video-rtc
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.