This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Linux/DRA756: dmabuftest fail on wayland

Part Number: DRA756

Tool/software: Linux

Hello.

I'm working on Jacinto6 with PSDK 3.02.

When I excute command for camera preview, "Broken pipe" error is happen after some minute.(It crashed within 20min of operation)

The operating time always seems be the same(usually 10min, sometime 20min)

I just change "for loop" to "while loop" of capture_loop() of dmabuftest.c to remove preview time limit.

It working fine in kms mode(dmabuftest -s 32:1920x1200 -d /dev/video1 -c 1280x720@YUYV)

I can't not judge, this error is from wayland framework or dmabuftest application.

Could you check it or make me understand about this issue?

Error message:

./testcam.sh
Opening Display..
wayland display opened

wayland registries obtained

Opening V4L2..
Exported buffer fd = 18

Exported buffer fd = 19

Exported buffer fd = 20

Exported buffer fd = 21

Exported buffer fd = 22

Exported buffer fd = 23

Error sending request: Broken pipe
./testcam.sh: line 1: 21389 Aborted                 (core dumped) ./dmabuftest -w 1280x720 -d /dev/video1 -c 1280x720@YUYV


Command:
The TI developement guide include "--pos" option but it looks not support now
"dmabuftest -w 640x480 --pos 100x400 /dev/video1 -c 1280x720@YUYV"
so, I used below command

dmabuftest -w 640x480 -d /dev/video1 -c 1280x720@YUYV

Modification:
diff --git a/dmabuftest.c b/dmabuftest.c
index bebe9dd..eb0bb79 100644
--- a/dmabuftest.c
+++ b/dmabuftest.c
@@ -76,7 +76,7 @@ capture_loop(void *arg)
                return NULL;
        }

-       for (i = 1; i < CNT; i++) {
+       while(1) {

                capt = v4l2_dqbuf(v4l2);
                ret = disp_post_vid_buffer(disp, capt,

  • Hi Yangwoo,

    I have forwarded your question to the graphics experts.

    Regards,
    Yordan
  • Hello Yordan

    Could you check or update this issue? I'm waiting answer.

    Regards,

    Yangwoo

  • Hi Yang Woo,

    I'm trying to reproduce the issue and so far I haven't been able to recreate it.

    Still trying to check the scenario once again.

    Could you please let me know what is the contents of testcam.sh?

    I'm just starting weston and running the dmabuftest.

    Regards

    Karthik

  • Hello Karthik.

    testcam.sh is just doing below command.
    dmabuftest -w 640x480 -d /dev/video1 -c 1280x720@YUYV

    I heard from wayland guy (in wayland community), he said that dmabuftest need dispatching mechanism.
    For example, in case of dmabuftest, It just toss event to wayland without any dispatching mechanism.
    It means, if wayland buffer is filled up by client, server will disconnect. The problem was it is.

    So I tried change dmabuftest using dispatching, and the issue is looks not happen now.
    Could you check and try with weston example "weston/client/simple-dmabuf-v4l.c"?
    I think it can be solution of my question.

    Thank you.
  • Hi Yang Woo,

    Thank you for the feedback.

    Just an update, I was able to reproduce the issue on my setup, it just takes a little more time on my side.
    Will check your update and come back to you about the result.

    Can you please confirm that the issue is not reproduced any further at your end?

    Regards
    Karthik
  • Hi Yang Woo,

    Alternately, if you have resolved the problem in the dmabuftest with your implementation you can submit your patch and we can review and integrate the same into the dmabuftest.. That's definitely a possibility.

    Regards
    Karthik
  • Hi Karthik.

    Yes, It was not reproduced with my fix at least on my side.
    To make patch for omapdrmtest package, I need some time because I already extract code from that package for only wayland support.
    (As you know, omapdrmtest supporting kms, kmscube, wayland ...)
    If you want submit it by my, please give me some time.

    Thank you.
  • Hi Karthik.

    I have checked dmabuftest for modification.

    I could not fix it because it already structured for various functions(supporting kms, kmscube, wayland...)

    I think TI is better at fixing this code.

    Thank you.

  • Hi YangWoo,

    Yes, we have fixed the problem and it will be pushed to the omapdrmtest repository shortly.
    We are doing some reviews and tests, will update on this thread shortly.

    Regards
    Karthik
  • Thank you Karthik.

    Today, I read the display-wayland.c code again.

    At present, my solution is simply just add wl_display_roundtrip() after wl_display_flush() of post_vid_buffer function.

    Client need to wait processing server about pending request before request next request.

    @@ -234,6 +234,7 @@ post_vid_buffer(struct display *disp, struct buffer *buf,
            wl_surface_attach(disp_wl->surface, buf_wl->wl_buf, 0, 0);
            wl_surface_commit(disp_wl->surface);
            wl_display_flush(disp_wl->display);
    +       wl_display_roundtrip(disp_wl->display);

    Regards

    Yangwoo