Audio device underruns with PulseAudio over local network are detected and cause dropped frames
Nobody has claimed this yet.
- Dominant language
- C
- Stars
- 37k
- Forks
- 3.5k
- Avg merge
- 1d 10h
- Merged PRs (30d)
- 22
Description
Important Information
Provide following Information:
- mpv 0.33
- NixOS (nixos-unstable channel)
- mpv is built by NixOS
- Problem appears to have begun after an upgrade to mpv 0.33.0
- WM: Sway 1.5.1
- GPU driver: i915 shipped with 5.9.12
- Don't have a video or recording of issues
Reproduction steps
Will need a pulse audio server with TCP socket on a remote machine first. Then run mpv with a following command:
mpv $SOME_STREAM --ao=pulse --pulse-host=$REMOTE_MACHINE --no-config --log-file=/tmp/log
The latency between remote machine and localhost looks like this:
rtt min/avg/max/mdev = 0.642/0.910/4.307/0.460 ms
0 apparent packet loss during the test.
Expected behavior
Audio device underruns are not detected or if detected, mpv does not drop frames. 0.32.0 with the following invocation appears to work fine:
/nix/store/f2p2swdykh510a21pfj0zl15jpdggary-mpv-0.32.0/bin/mpv 'something' --ao=pulse --pulse-host=192.168.1.5 --no-config
As in, there are no detected underruns, no dropped frames and no jarring experience that is now experienced with 0.33.0.
Actual behavior
When run the same way with mpv 0.33.0 mpv detects audio underruns and mpv drops frames as a result.
Audio device underrun detected.
AV: 01:44:45 / 01:44:46 (100%) A-V: 0.000 Dropped: 5 Cache: 1.7s/1MB
Audio device underrun detected.
AV: 01:44:45 / 01:44:46 (100%) A-V: -0.001 Dropped: 5 Cache: 1.4s/1MB
Audio device underrun detected.
AV: 01:44:45 / 01:44:46 (100%) A-V: 0.000 Dropped: 7 Cache: 1.3s/1MB
Audio device underrun detected.
AV: 01:44:45 / 01:44:46 (100%) A-V: 0.001 Dropped: 12 Cache: 0.9s/692KB
Audio device underrun detected.
AV: 01:44:46 / 01:44:46 (100%) A-V: -0.001 Dropped: 13 Cache: 0.7s/538KB
Audio device underrun detected.
AV: 01:44:46 / 01:44:46 (100%) A-V: -0.000 Dropped: 14 Cache: 0.5s/351KB
Audio device underrun detected.
AV: 01:44:46 / 01:44:46 (100%) A-V: 0.073 Dropped: 14 Cache: 0.3s/216KB
Audio device underrun detected.
AV: 01:44:46 / 01:44:46 (100%) A-V: 0.001 Dropped: 16 Cache: 0.0s/2KB
Audio device underrun detected.
AV: 01:44:46 / 01:44:48 (100%) A-V: -0.001 Dropped: 16 Cache: 1.8s/1MB
Audio device underrun detected.
AV: 01:44:47 / 01:44:48 (100%) A-V: 0.001 Dropped: 16 Cache: 1.6s/1MB
Audio device underrun detected.
AV: 01:44:47 / 01:44:48 (100%) A-V: -0.001 Dropped: 16 Cache: 1.4s/1MB
Audio device underrun detected.
AV: 01:44:47 / 01:44:48 (100%) A-V: 0.014 Dropped: 20 Cache: 1.2s/895KB
Audio device underrun detected.
The actual experience is jarring because mpv suddenly starts playing parts of the video or stream at an increased speed and audio be heard to break for 100s of milliseconds at a time. This lasts about a second or two before playback resumes normally.
Log file
Sample files
N/A
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Reproduce the regression with mpv 0.33 using --ao=pulse, --pulse-host and --no-config, then compare it with the supplied 0.32.0 invocation. Start with the attached log.txt and the PulseAudio playback path; done means remote playback no longer reports repeated underruns, drops frames, or produces the described audio and speed glitches.
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
- Quiet
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100