kmssink on two spearate display

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|

kmssink on two spearate display

Matteo Valdina
Hi,
I'm trying to drive two separate display with kmssink (intel driver).

I created two separate pipelines:
 pipeline 1 v4l2src device=/dev/video0 ! kmssink conncetor-id=63
 pipeline 1 v4l2src device=/dev/video0 ! kmssink conncetor-id=58

My problem is that the second pipeline encounter and error on accessing DRM resources.
So, I implemented a simple test application that runs the two pipelines inside a single process.
Only the first pipeline works, the second encounters these error:

0:00:00.124567628  6195 0x7f31400028a0 ERROR                kmssink gstkmssink.c:498:configure_mode_setting:<kmssink1> Failed to set mode: Permission denied
0:00:00.124603970  6195 0x7f31400028a0 WARN                 kmssink gstkmssink.c:1058:gst_kms_sink_set_caps:<kmssink1> error: failed to configure video mode

I'm using GStreamer 1.14 and it using an i915.

Can kmssink work concurrently run on two different display but the same video card?

Best
Matteo




--
“There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies. The first method is far more difficult.”
- Tony Hoare

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: kmssink on two spearate display

Nicolas Dufresne-5


Le mer. 4 avr. 2018 20:41, Matteo Valdina <[hidden email]> a écrit :
Hi,
I'm trying to drive two separate display with kmssink (intel driver).

I created two separate pipelines:
 pipeline 1 v4l2src device=/dev/video0 ! kmssink conncetor-id=63
 pipeline 1 v4l2src device=/dev/video0 ! kmssink conncetor-id=58

My problem is that the second pipeline encounter and error on accessing DRM resources.
So, I implemented a simple test application that runs the two pipelines inside a single process.
Only the first pipeline works, the second encounters these error:

0:00:00.124567628  6195 0x7f31400028a0 ERROR                kmssink gstkmssink.c:498:configure_mode_setting:<kmssink1> Failed to set mode: Permission denied
0:00:00.124603970  6195 0x7f31400028a0 WARN                 kmssink gstkmssink.c:1058:gst_kms_sink_set_caps:<kmssink1> error: failed to configure video mode

I'm using GStreamer 1.14 and it using an i915.

Can kmssink work concurrently run on two different display but the same video card?

No, this would require the same FD being shared among kmssink, which is not implemented (or a cookie?). Obviously you could sudo it, but overall, kmssink need to be ported to atomic APIs to work smoothly.


Best
Matteo




--
“There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies. The first method is far more difficult.”
- Tony Hoare
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: kmssink on two spearate display

Matteo Valdina
Thanks,

If I can pass the fd from the first pipeline to the second (in the same process) should works?

From the code, it doesn't look complicated.

Best
Matteo

On Wed, Apr 4, 2018 at 8:07 PM, Nicolas Dufresne <[hidden email]> wrote:


Le mer. 4 avr. 2018 20:41, Matteo Valdina <[hidden email]> a écrit :
Hi,
I'm trying to drive two separate display with kmssink (intel driver).

I created two separate pipelines:
 pipeline 1 v4l2src device=/dev/video0 ! kmssink conncetor-id=63
 pipeline 1 v4l2src device=/dev/video0 ! kmssink conncetor-id=58

My problem is that the second pipeline encounter and error on accessing DRM resources.
So, I implemented a simple test application that runs the two pipelines inside a single process.
Only the first pipeline works, the second encounters these error:

0:00:00.124567628  6195 0x7f31400028a0 ERROR                kmssink gstkmssink.c:498:configure_mode_setting:<kmssink1> Failed to set mode: Permission denied
0:00:00.124603970  6195 0x7f31400028a0 WARN                 kmssink gstkmssink.c:1058:gst_kms_sink_set_caps:<kmssink1> error: failed to configure video mode

I'm using GStreamer 1.14 and it using an i915.

Can kmssink work concurrently run on two different display but the same video card?

No, this would require the same FD being shared among kmssink, which is not implemented (or a cookie?). Obviously you could sudo it, but overall, kmssink need to be ported to atomic APIs to work smoothly.


Best
Matteo




--
“There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies. The first method is far more difficult.”
- Tony Hoare
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel




--
“There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies. The first method is far more difficult.”
- Tony Hoare

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: kmssink on two spearate display

Nicolas Dufresne-5


Le mer. 4 avr. 2018 23:12, Matteo Valdina <[hidden email]> a écrit :
Thanks,

If I can pass the fd from the first pipeline to the second (in the same process) should works?

From the code, it doesn't look complicated.

That is the easiest. Then you need to make sure mode is set, other the two kmssink will both try to set something, and one will fail. Performance whose though, you'll likely get low framerate as we still use legacy DRM API.


Best
Matteo

On Wed, Apr 4, 2018 at 8:07 PM, Nicolas Dufresne <[hidden email]> wrote:


Le mer. 4 avr. 2018 20:41, Matteo Valdina <[hidden email]> a écrit :
Hi,
I'm trying to drive two separate display with kmssink (intel driver).

I created two separate pipelines:
 pipeline 1 v4l2src device=/dev/video0 ! kmssink conncetor-id=63
 pipeline 1 v4l2src device=/dev/video0 ! kmssink conncetor-id=58

My problem is that the second pipeline encounter and error on accessing DRM resources.
So, I implemented a simple test application that runs the two pipelines inside a single process.
Only the first pipeline works, the second encounters these error:

0:00:00.124567628  6195 0x7f31400028a0 ERROR                kmssink gstkmssink.c:498:configure_mode_setting:<kmssink1> Failed to set mode: Permission denied
0:00:00.124603970  6195 0x7f31400028a0 WARN                 kmssink gstkmssink.c:1058:gst_kms_sink_set_caps:<kmssink1> error: failed to configure video mode

I'm using GStreamer 1.14 and it using an i915.

Can kmssink work concurrently run on two different display but the same video card?

No, this would require the same FD being shared among kmssink, which is not implemented (or a cookie?). Obviously you could sudo it, but overall, kmssink need to be ported to atomic APIs to work smoothly.


Best
Matteo




--
“There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies. The first method is far more difficult.”
- Tony Hoare
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel




--
“There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies. The first method is far more difficult.”
- Tony Hoare
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel
Reply | Threaded
Open this post in threaded view
|

Re: kmssink on two spearate display

Matteo Valdina
Thanks,
I submitted a patch ( https://bugzilla.gnome.org/show_bug.cgi?id=795023 ) for set/get the FD.

If I force the mode setting for each connector-id and it worked.

About the performance, I noticed that is not ultra fast and the set of supported format is not the best for my scenario (I prefer 4:2:0 format like I420, NV12 but supported are ARGB, YUY2).

Do you have some documentation about DRM API migration to newer API or some brief introduction?

Best
Matteo

On Thu, Apr 5, 2018 at 6:11 AM, Nicolas Dufresne <[hidden email]> wrote:


Le mer. 4 avr. 2018 23:12, Matteo Valdina <[hidden email]> a écrit :
Thanks,

If I can pass the fd from the first pipeline to the second (in the same process) should works?

From the code, it doesn't look complicated.

That is the easiest. Then you need to make sure mode is set, other the two kmssink will both try to set something, and one will fail. Performance whose though, you'll likely get low framerate as we still use legacy DRM API.


Best
Matteo

On Wed, Apr 4, 2018 at 8:07 PM, Nicolas Dufresne <[hidden email]> wrote:


Le mer. 4 avr. 2018 20:41, Matteo Valdina <[hidden email]> a écrit :
Hi,
I'm trying to drive two separate display with kmssink (intel driver).

I created two separate pipelines:
 pipeline 1 v4l2src device=/dev/video0 ! kmssink conncetor-id=63
 pipeline 1 v4l2src device=/dev/video0 ! kmssink conncetor-id=58

My problem is that the second pipeline encounter and error on accessing DRM resources.
So, I implemented a simple test application that runs the two pipelines inside a single process.
Only the first pipeline works, the second encounters these error:

0:00:00.124567628  6195 0x7f31400028a0 ERROR                kmssink gstkmssink.c:498:configure_mode_setting:<kmssink1> Failed to set mode: Permission denied
0:00:00.124603970  6195 0x7f31400028a0 WARN                 kmssink gstkmssink.c:1058:gst_kms_sink_set_caps:<kmssink1> error: failed to configure video mode

I'm using GStreamer 1.14 and it using an i915.

Can kmssink work concurrently run on two different display but the same video card?

No, this would require the same FD being shared among kmssink, which is not implemented (or a cookie?). Obviously you could sudo it, but overall, kmssink need to be ported to atomic APIs to work smoothly.


Best
Matteo




--
“There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies. The first method is far more difficult.”
- Tony Hoare
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel




--
“There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies. The first method is far more difficult.”
- Tony Hoare
_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel




--
“There are two ways of constructing a software design: One way is to make it so simple that there are obviously no deficiencies, and the other way is to make it so complicated that there are no obvious deficiencies. The first method is far more difficult.”
- Tony Hoare

_______________________________________________
gstreamer-devel mailing list
[hidden email]
https://lists.freedesktop.org/mailman/listinfo/gstreamer-devel