Skip to content

Conversation

@rr-
Copy link
Member

@rr- rr- commented Apr 13, 2015

This pull request introduces new video output, vo_drm. It uses Direct Rendering Manager (DRM) and Kernel Mode Setting (KMS) to enable watching videos on Linux systems, where neither X window system nor wayland server are available. Its only dependency is libdrm (it doesn't even need OpenGL) and thus I draw a bold conclusion that in terms of dependencies, it is the most lightweight video renderer for Linux.

Because of this, it doesn't use hardware acceleration at all, and heavy videos / old hardware will experience performance problems. This was tested on a 5-year-old netbook equipped with AMD C-50 (1gHz) and Radeon 6250. Old movies were played acceptably, while 720p action videos with rich ass subtitles experienced massive frame drops. This behavior could be fixed to some extent with extreme --vf=scale=-1:180 --sws-scaler=point.

I have no idea how it performs on better hardware. I'm going to purchase a powerful computer within one month.

Additionally, I (eventually) plan to develop a renderer for DRM that utilizes hardware acceleration, but it will need libegl and almost surely libgbm that come with their own (remarkable) chain of dependencies. In my opinion, these dependencies are what makes vo_drm attractive.

Marcin Kurczewski added 14 commits April 10, 2015 22:27
For now, it displays noise. Obviously this is just a placeholder for
real draw functions.
With this implementation I experienced all sorts of problems, such as
lags and tearing. But it's a good starting point for future
improvements.
Rather than assuming the first connector to be the one that's currently
connected, we iterate and choose first connector that is truly
available.
@rr-
Copy link
Member Author

rr- commented Apr 13, 2015

What I have tested:

  • 4:3 video
  • 16:9 video
  • 720p
  • 360p
  • ass subtitles on 720p, and on 720p with --vf-scale
  • screenshots

What I haven't tested:

  • "vertical" videos with aspect ratio X:Y such that X < Y
  • "ultra wide" videos with aspect ratio greater than device's aspect ratio
  • anamorphic videos
  • subtitle moving, video panning, video cropping and other things I'm not aware of and you could possibly do
  • installation on completely clean Linux

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe talloc_ptrtype(vo->priv, dev)?

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also, for defensive programming, talloc_zero(vo->priv, struct modeset_dev) would be better.

@ghost
Copy link

ghost commented Apr 13, 2015

Looks pretty good. I made some comments about mostly minor issues. I don't know the DRM API, so I can't say anything about that part.

@rr-
Copy link
Member Author

rr- commented Apr 13, 2015

Thanks. I'll fix all of these tomorrow.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of this, you can just write struct drm_mode_create_dumb creq = {0};.

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PS: or actually struct drm_mode_create_dumb creq = { .width = buf->width, ....

@ghost
Copy link

ghost commented Apr 15, 2015

I added some more comments. There are just some minor things, and I'd say it's ready for merge. The OSD redrawing thing is possibly a bit more complicated, but optional.

@rr-
Copy link
Member Author

rr- commented Apr 15, 2015

@wm4 I'll fix these ASAP I get home.

@Gusar321
Copy link
Contributor

I gave this a test. The image appeared, but in the next moment the monitor turned itself off. Switching to a different VT and back, the monitor was on again, showing a segmentation fault. Then I figured, I used a 16/9 video, let's try a 4/3 one. This time it worked great.

I have a 16/10 monitor. So there's an issue when the video has a wider aspect than the monitor.

@rr-
Copy link
Member Author

rr- commented Apr 15, 2015

@Gusar321: Can you please provide me with a video that has aspect ratio 2:1 so I can fix things? (This was on the list of things I mentioned I haven't tested, mainly due lack of test material.)

@ghost
Copy link

ghost commented Apr 15, 2015

Just use --vf=crop:200:100 or so.

@rr-
Copy link
Member Author

rr- commented Apr 15, 2015

Crash confirmed, I suspect the culrpit to be shift and priv->y.

@ghost
Copy link

ghost commented Apr 16, 2015

So is it basically done?

@rr-
Copy link
Member Author

rr- commented Apr 16, 2015

Yep, I don't plan on adding anything unless someone discovers more bugs, which I'm unable to.
I've watched two episodes last night and I was quite satisfied with the result.

@ghost
Copy link

ghost commented Apr 16, 2015

Squashed and merged.

@ghost ghost closed this Apr 16, 2015
@rr- rr- deleted the drm branch April 16, 2015 20:45
This pull request was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants