<div dir="ltr"><div>I'm running into an issue playing back H.264 video on my laptop with Mobility Radeon HD 3650 (rv635) using vdpau through mpv or vlc. I'm using debian 9 (stretch)'s included mesa 13.0.6.</div><div><br></div><div>The problem:<br></div><div><br></div><div>Usually I get this: The first row of macroblocks in the keyframe is fine, and the rest is a green mess -- like the keyframe is getting truncated/corrupted.<br></div><div><br></div><div>Sometimes I get normal video playback.  I can't tell what factor causes the difference.</div><div><br></div><div><div>It seems like the same r600 issue reported here, based on the description and the example garbled output:</div><div><a href="https://bugs.freedesktop.org/show_bug.cgi?id=73457">https://bugs.freedesktop.org/show_bug.cgi?id=73457</a></div></div><div><br></div><div><div>I'm not sure how to proceed. Should I try building a different version of mesa from source? Is there some logging I can turn on and investigate? Is there more info I should collect?  Is there a spec for r600/uvd I can compare against the code to look for problems?  Should I try to find another rv635 somewhere to confirm this isn't a hardware problem?</div></div><div><br></div><div>My further investigations so far:</div><div><br></div><div>The problem is inconsistent from login session to login session, after a certain amount of activity in a login session the problem sometimes goes away, but a simple logout/login makes the problem reappear again.</div><div><br></div><div>Testing with Twitch streams via libmpv in Orion <a href="https://github.com/alamminsalo/orion">https://github.com/alamminsalo/orion</a> (/plug ;), to easily get a number of different resolutions of h.264 stream, I found that in a given login session, the problem affects all the resolutions from a given resolution down, sometimes all the way from the source stream, and sometimes not.</div><div><br></div><div>Based on the discussion of dpb_size on that bug 73457, I rebuilt mesa from the source package and then added output with of the selected dpb_size and a hack to override it from an env var. Using a higher dpb_size sometimes makes the problem go away. Bisecting dpb_size values, I have found that in some login sessions there is a consistent boundary down to the byte between an increased dpb_size that gives working video playback and the one lower dpb_size that gives the green mess; however in other login sessions the behaviour for given dpb_size values is not consistent so there is no bisectable boundary, and even when there is a consistent boundary in a given session it isn't consistent with other login sessions.  This seems like a bit of a red herring in that maybe the dpb_size is actually fine in the absence of whatever the underlying fault is (maybe a missing initialisation somewhere?)</div><div><br></div><div>-AT</div><div><br></div><div><br></div><br></div>