NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

kern/54230: mpv drops video frames with `--ao=oss' (probably after isaki-audio2 merge)



>Number:         54230
>Category:       kern
>Synopsis:       mpv drops video frames with `--ao=oss' (probably after isaki-audio2 merge)
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    kern-bug-people
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sat May 25 13:20:00 +0000 2019
>Originator:     Leonardo Taccari
>Release:        NetBSD 8.99.41
>Organization:
Università Politecnica delle Marche
>Environment:
	
	
System: NetBSD boh 8.99.41 NetBSD 8.99.41 (GENERIC) #1: Sat May 25 12:45:15 CEST 2019 leot@abacus:/usr/obj/sys/arch/amd64/compile/GENERIC amd64
Architecture: x86_64
Machine: amd64
>Description:
	Probably since isaki-audio2 merge mpv started to drop several frames
	making video playback hard to follow.
>How-To-Repeat:
	Taking a 1080p video as an example:
	 
	 <https://static.fsf.org/nosvn/FSF30-video/FSF_30_1080p.webm>

	Downloading it, e.g. it /tmp:

	 % ftp https://static.fsf.org/nosvn/FSF30-video/FSF_30_1080p.webm

	...and then playing via:

	 % mpv FSF_30_1080p.webm

	...for a couple of seconds should be enough to see dropped frames, e.g.
	(for ~5 seconds):

	 Playing: FSF_30_1080p.webm
	  (+) Video --vid=1 (*) 'Video' (vp8 1920x1080)
	  (+) Audio --aid=1 --alang=eng (*) 'Audio' (vorbis 2ch 44100Hz)
	 [vo/xv] Warning: this legacy VO has bad quality and performance, and will in particular result in blurry OSD and subtitles. You should fix your graphics drivers, or not force the xv VO.
	 AO: [oss] 44100Hz stereo 2ch s32
	 VO: [xv] 1920x1080 yuv420p
	 FSF_30_1080p.webm
	 AV: 00:00:05 / 00:02:53 (2%) A-V: -0.000 Dropped: 57


	 Exiting... (Quit)

	With 8.99.38 and having `hw.hdafg0.latency=16' in sysctl.conf
	no frames were dropped.

	Output of a couple of seconds playing of
	`mpv --quiet --msg-level=ao=trace' in 8.99.38:

	 <https://www.NetBSD.org/~leot/tmp/mpv-fsf-8.99.38.txt>

	...and 8.99.41:

	 <https://www.NetBSD.org/~leot/tmp/mpv-fsf-8.99.41.txt>

	Lines that seems to differ (- is on 8.99.38, + is on 8.99.41):

	  [ao/oss] using 44100 Hz samplerate
	 -[ao/oss] frags:   4/4  (16384 bytes/frag)  free:  65536
	 -[ao/oss] device buffer: 8192 samples.
	 +[ao/oss] frags:   4/4  (14112 bytes/frag)  free:  56448
	 +[ao/oss] device buffer: 7056 samples.
	  [ao/oss] using soft-buffer of 8820 samples.

	...and in 8.99.38 the buffer seems to be consumed as follows (please
	notice the samples that from 8820 goes to 2048):

	 [ao/oss] device buffer: 8192 samples.
	 [ao/oss] using soft-buffer of 8820 samples.
	 AO: [oss] 44100Hz stereo 2ch s32
	 [ao/oss] in=0 flags=0 space=8192 r=0 wa/pl=0/0 needed=8820 more=1
	 [ao/oss] buffer inactive.
	 VO: [xv] 1920x1080 yuv420p
	 [ao/oss] samples=8820 flags=0 r=8820
	 FSF_30_1080p.webm
	 [ao/oss] in=8820 flags=0 space=8192 r=8192 wa/pl=1/1 needed=8192 more=1
	 [ao/oss] in=628 flags=0 space=8192 r=0 wa/pl=0/1 needed=8192 more=1
	 [ao/oss] buffer inactive.
	 [ao/oss] samples=8192 flags=0 r=8192
	 [ao/oss] in=8820 flags=0 space=8192 r=8192 wa/pl=1/1 needed=6208 more=1
	 [ao/oss] in=628 flags=0 space=6144 r=0 wa/pl=0/1 needed=6208 more=1
	 [ao/oss] buffer inactive.
	 [ao/oss] samples=6208 flags=0 r=6208
	 [ao/oss] in=6836 flags=0 space=6144 r=6144 wa/pl=1/1 needed=2048 more=1
	 [ao/oss] in=692 flags=0 space=2048 r=0 wa/pl=0/1 needed=2048 more=1
	 [ao/oss] buffer inactive.
	 [ao/oss] samples=2048 flags=0 r=2048
	 [ao/oss] in=2740 flags=0 space=2048 r=2048 wa/pl=1/1 needed=0 more=0
	 [ao/oss] in=692 flags=0 space=0 r=0 wa/pl=1/1 needed=0 more=0
	 [ao/oss] in=692 flags=0 space=2048 r=0 wa/pl=0/1 needed=2048 more=1
	 [ao/oss] buffer inactive.
	 [ao/oss] samples=2048 flags=0 r=2048
	 [ao/oss] in=2740 flags=0 space=2048 r=2048 wa/pl=1/1 needed=2048 more=1
	 [ao/oss] in=692 flags=0 space=2048 r=0 wa/pl=0/1 needed=2048 more=1
	 [ao/oss] buffer inactive.

	...while in 8.99.41 the buffer seems to always have 8756 frames:

	 [ao/oss] device buffer: 7056 samples.
	 [ao/oss] using soft-buffer of 8820 samples.
	 AO: [oss] 44100Hz stereo 2ch s32
	 [ao/oss] in=0 flags=0 space=7056 r=0 wa/pl=0/0 needed=8820 more=1
	 [ao/oss] buffer inactive.
	 VO: [xv] 1920x1080 yuv420p
	 [ao/oss] samples=8820 flags=0 r=8820
	 FSF_30_1080p.webm
	 [ao/oss] in=8820 flags=0 space=7056 r=7056 wa/pl=1/1 needed=7056 more=1
	 [ao/oss] in=1764 flags=0 space=7056 r=1764 wa/pl=1/1 needed=7120 more=1
	 [ao/oss] in=0 flags=0 space=5292 r=0 wa/pl=0/1 needed=7120 more=1
	 [ao/oss] buffer inactive.
	 [ao/oss] samples=7120 flags=0 r=7120
	 [ao/oss] in=7120 flags=0 space=5292 r=5292 wa/pl=1/1 needed=0 more=0
	 [ao/oss] in=1828 flags=0 space=0 r=0 wa/pl=1/1 needed=0 more=0
	 [ao/oss] in=1828 flags=0 space=1764 r=1764 wa/pl=1/1 needed=8756 more=1
	 [ao/oss] in=64 flags=0 space=7056 r=0 wa/pl=0/1 needed=8756 more=1
	 [ao/oss] buffer inactive.
	 [ao/oss] samples=8756 flags=0 r=8756
	 [ao/oss] in=8820 flags=0 space=7056 r=7056 wa/pl=1/1 needed=64 more=0
	 [ao/oss] in=1764 flags=0 space=0 r=0 wa/pl=1/1 needed=64 more=0
	 [ao/oss] samples=64 flags=0 r=64
	 [ao/oss] in=1828 flags=0 space=0 r=0 wa/pl=1/1 needed=0 more=0
	 [ao/oss] in=1828 flags=0 space=1764 r=1764 wa/pl=1/1 needed=8756 more=1
	 [ao/oss] in=64 flags=0 space=7056 r=0 wa/pl=0/1 needed=8756 more=1
	 [ao/oss] buffer inactive.
	 [ao/oss] samples=8756 flags=0 r=8756
	 [ao/oss] in=8820 flags=0 space=7056 r=7056 wa/pl=1/1 needed=64 more=0
	 [ao/oss] in=1764 flags=0 space=0 r=0 wa/pl=1/1 needed=64 more=0
	 [ao/oss] samples=64 flags=0 r=64
	 [ao/oss] in=1828 flags=0 space=0 r=0 wa/pl=1/1 needed=0 more=0
	 [ao/oss] in=1828 flags=0 space=1764 r=1764 wa/pl=1/1 needed=8756 more=1
	 [ao/oss] in=64 flags=0 space=7056 r=0 wa/pl=0/1 needed=8756 more=1
	 [ao/oss] buffer inactive.

	However, I am not sure if that can be related or not to the video frames
	dropped (it was the only difference that I was able to spot in the
	two traces).

	This is with:

	 hdaudio1 at pci0 dev 27 function 0: HD Audio Controller
	 hdaudio1: interrupting at msi1 vec 0
	 hdafg0 at hdaudio1: vendor 14f1 product 510f
	 hdafg0: DAC00 2ch: Speaker [Built-In]
	 hdafg0: ADC01 2ch: Mic In [Built-In]
	 hdafg0: ADC02 2ch: Mic In [Jack]
	 hdafg0: DAC03 2ch: HP Out [Jack]
	 hdafg0: 2ch/2ch 44100Hz 48000Hz 96000Hz PCM16 PCM20 PCM24
	 audio0 at hdafg0: full duplex, playback, capture, mmap, independent
	 audio0: slinear_le:16 2ch 48000Hz, blk 40ms for playback
	 audio0: slinear_le:16 2ch 48000Hz, blk 40ms for recording

>Fix:
	No idea, sorry.

	As a possible workaround, instead of using `--ao=oss'
	rebuilding mpv with `sdl2' option and using `--ao=sdl' solves it (no
	frame are dropped).  Thanks <nia>!

>Unformatted:
 	
 	


Home | Main Index | Thread Index | Old Index