On Mon, Jan 03, 2022 at 01:33:00PM +0100, Rafael Sadowski wrote:
On Tue, Dec 21, 2021 at 10:43:37AM +0300, Andrew Krasavin wrote:
Unfortunately, I have not yet been able to figure out exactly what
the problem is with seek + mpv with ao_sndio from #9298.

First of all, I would like to apologise if my first email was too rude.


I didn't find your letter rude, but thank you for your concern.
Anyway, feel free to express your thoughts as you feel comfortable,
I'm not sensitive.


I deleted all entries from my ~/.config/mpv/config, created
~/.config/mpv/input.conf which is an exact copy of yours.

Next, I tried playing different videos (mp4[*] and webm) and then
moving through them in large segments in different directions
randomly.
I didn't notice any weirdness.

Then I built mpv 0.34 with ao_sndio from #8314 (the original version
of the patch from Ivan Rozhuk) and roughly repeated my steps.

Notice the difference could not.

I probably just don't understand what exactly I'm talking about.

If it's not too much trouble:

1) Please describe in more detail exactly how the problem manifests
itself. What exactly should I see? What exactly is the difference
from the previous version?

If you seek fast (hold the seek key pressed all the time) then you shouldn't
see such hard breaks.


2) If you delete all mpv settings except the input.conf you quoted,
does the problem reproduce?

Yes, see below. Instead using "j" I have to use ">" aka. AXIS_LEFT.


3) Does the problem play on any videos or any specific videos? If
the second, please give examples.

Some are a little better and some are worse. But in general, the patch has made
them worse. (Not an show stopper for me)


I don't care where I get feedback from you - by mail or on github
- whichever is more convenient for you. Thank you in advance.

I wasn't at the keyboard over the change of year. So I apologise for my late
reply.


There is nothing to apologize for, I understand everything and just
as you do not always have the opportunity to respond quickly.
It's okay. Thank you.


[*] : When seeking in some mp4 videos with hjkl, there were
messages like "[ffmpeg/video] h264: mmco: unref short failure"
in the mpv log, but it had no effect on smoothness of work, audio
and video synchronization or anything like that.

My test case, to be honest a bit harsh:

$ mpv The\ Future\ of\ Intelligence,\ Artificial\ and\ Natural\ \ \ _\ \ \ Ray\ 
Kurzweil\ \(USA\)\ .\ \[JbKNbMgRbJA\].webm
(+) Video --vid=1 (*) (vp9 1280x720 25.000fps)
(+) Audio --aid=1 --alang=eng (*) (opus 2ch 48000Hz)
AO: [sndio] 48000Hz stereo 2ch s16
VO: [gpu] 1280x720 yuv420p
AV: 00:22:01 / 01:02:57 (35%) A-V: -0.000

and hold pressed "j" key (j seek  2) and don't release the j key.

Tested with: yt-dlp https://www.youtube.com/watch?v=JbKNbMgRbJA
(multimedia/yle-dl)

All in all, it's not a big issue. I only use it when I want to "slide" through
the entire video.

Thanks for working and caring on the topic.

Rafael

Thanks for the answer and for the clarification, Rafael!

Unfortunately, I still can't reproduce the problem or don't fully
understand what the problem is.

I'll describe what I did:

1) Download https://www.youtube.com/watch?v=JbKNbMgRbJA
(cmd: yt-dlp -f "bestvideo+bestaudio" --no-sponsorblock \
--no-sponskrub --no-part --no-mtime --restrict-filenames -c -o \
"/home/noiseless/video/%(title)s-%(id)s.%(ext)s" \
"https://www.youtube.com/watch?v=JbKNbMgRbJA";)

2) Next, I built mpv 0.34.1 with the original patch from
@rozhuk-im (https://github.com/mpv-player/mpv/pull/8314) and tried
to reproduce the problem in the way you described. I have recorded
the result on video: https://disk.yandex.ru/i/DJyMJGBRwxeKqQ

3) Next I built mpv 0.34.1 with my patch
(https://github.com/mpv-player/mpv/pull/9298) and tried again to
reproduce the problem. I also recorded the result on video:
https://disk.yandex.ru/i/7mPvvNuEn1ZTGA

Unfortunately, I can't see a noticeable difference between the old
and new patch and I hope my videos demonstrate that.
To make it clear what's going on in the video, I first press and
hold down 'j' and move forward in the video. Then I release 'j' and
press 'k' and similarly move backward in the video. Then I press 'j'
again.
Towards the end of both screencasts I release 'j' and press ('j')
again N times, but not by holding, but at some random intervals.

Maybe it's about some settings in mpv.conf? For example, I have the
cache enabled. If I turn it off, though, I still don't see anything
like a freeze on 'seek 2', but it's like a couple of times moving
through the video worked a little worse than the last time.
That said, it's probably because my system isn't idle right now.
Anyway, I think it makes sense to check the included options in
mpv.conf.
My config:

$ cat ~/.config/mpv/config
cache=yes
demuxer-max-bytes=32768KiB
demuxer-readahead-secs=90

ao=sndio
audio-channels=2
vo=gpu

sub-codepage = utf-8

volume-max=200

Can you also record on video what your problem looks like? Maybe
that would make it easier for me to understand the problem.

From what I can still think of, I can mention the following idea: to
take the "original" patch and put only the required fixes into it,
without 'cosmetic' improvements, namely to put needed code into
get_state(). If the problem persists, then it's probably the fix
itself, which I made, and then it will be necessary to understand
in what situations the problem occurs and why I can't reproduce it.
If the problem disappears, then it is roughly clear where in the
code to look for it.

Required fix for loop function:
https://github.com/mpv-player/mpv/blob/5319731526fb9f7ba6ce7ee5bbb71b03f228ceae/audio/out/ao_sndio.c#L292-L304

A place for the fix in the original patch:
https://github.com/rozhuk-im/mpv/blob/edf0039d762198b4dfea0a9355bac56244118a9a/audio/out/ao_sndio.c#L302

I hope we can get to the bottom of this situation.
Thank you very much for your bug report and for the detailed
description of the problem!

--
Wbr, Andrew Krasavin

Reply via email to