DisplayLink Forum

DisplayLink Forum (https://displaylink.org/forum/index.php)
-   Linux and Open Source (https://displaylink.org/forum/forumdisplay.php?f=29)
-   -   Virtual box (https://displaylink.org/forum/showthread.php?t=65363)

Irene 06-13-2017 11:23 AM

Virtual box
 
2 Attachment(s)
Hello guys,

I am new to this domain, I am working on an application which requires virtual display driver.
I am using VBOX setup (Virtual Box 5.0.12) and running Ubuntu 16.04 (Kernel 4.4.0-79-generic).
Code Output:
Attachment 3228

dmesg Output:
Attachment 3227

If anyone could tell me what i am missing out on. Thank you in advance.

mlukaszek 06-13-2017 02:31 PM

Hi,

Can you attach it as text?
Is it possible to share the code of the program you write, at least partially?
Have you tried sample client code from https://github.com/mlukaszek/evdipp to verify evdi works in the environment?

Cheers,
Michal

Irene 06-14-2017 04:38 AM

Hi,

I am going through those files. Like I said very new to this domain, it is difficult to understand without documentation.

Code :

#include <stdio.h>
#include <stdint.h>
#include <string.h>
#include "evdi_lib.h"
#include <stdlib.h>
#include <unistd.h>

int main(){
int new_node = 0;
int dev_status = 0;
evdi_handle new_handle;
evdi_buffer new_buffer;
const unsigned char* edid;
bool update;
char opt[3];

int *new_rect_num; // buffer description
new_buffer.id=0;
int new_buf_id=new_buffer.id;
new_buffer.width=1920; // Horizontal size
new_buffer.height=1096; // Vertical size
new_buffer.stride=1920;
new_buffer.rect_count=100; // frame count
new_rect_num=&new_buffer.rect_count;

const unsigned char edid_dummy[128]={
0x00, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0x00, 0x58, 0x58, 0x00, 0x00, 0x80, 0x07, 0x48, 0x04,
0x01, 0x00, 0x01, 0x03, 0x80, 0x00, 0x00, 0x78, 0xEE, 0xEE, 0x91, 0xA3, 0x54, 0x4C, 0x99, 0x26,
0x0F, 0x50, 0x54, 0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0x01,
0x01, 0x01, 0x01, 0x01, 0x01, 0x01, 0xBE, 0x31, 0x80, 0x06, 0x70, 0x48, 0x06, 0x40, 0x02, 0x02,
0x02, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xFD, 0x00, 0x00, 0xC8, 0x00,
0xC8, 0x64, 0x00, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x00, 0x00, 0xFC, 0x00, 0x56,
0x42, 0x4F, 0x58, 0x20, 0x6D, 0x6F, 0x6E, 0x69, 0x74, 0x6F, 0x72, 0x0A, 0x00, 0x00, 0x00, 0x10,
0x00, 0x0A, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x20, 0x00, 0x17};

edid=edid_dummy;

evdi_selectable new_selectable;
evdi_event_context node_context;
evdi_event_context* new_context;
new_context=&node_context;

new_node = evdi_add_device(); // Adding new EVDI node
if (new_node>0)
{
printf("\n New EVDI node added\n");

dev_status = evdi_check_device(new_node); // Checking if the above node is available EVDI node for use
printf(" Status of the node : ");

if (dev_status == AVAILABLE)
{
printf(" AVAILABLE\n");
new_handle = evdi_open(new_node);
printf(" Status of the EVDI handle : ");
if (new_handle == EVDI_INVALID_HANDLE)
{
printf(" EVDI_INVALID_HANDLE\n");
}
else
{
printf(" EVDI_VALID_HANDLE\n");

evdi_connect(new_handle,edid,130,1096); // Opening connections
printf(" Opening connections\n");

evdi_register_buffer(new_handle, new_buffer); // Registering Buffers
printf(" Registering Buffers\n");

new_selectable=evdi_get_event_ready(new_handle);
printf(" Event Handler = %d\n",new_selectable);
evdi_handle_events(new_handle, new_context); // Event Handler


update=evdi_request_update(new_handle, new_buf_id); // Requesting screen update
printf(" Screen Update Status : %s\n", update?"TRUE":"FALSE");

evdi_grab_pixels(new_handle, new_buffer.rects, new_rect_num); // Grabbing pixels


evdi_unregister_buffer(new_handle, new_buf_id); // Unregistering Buffers
printf(" Unregistering Buffers\n");

evdi_disconnect(new_handle); // Disconnecting
printf(" Disconnecting\n");

evdi_close(new_handle); // Closing devices
printf(" Closing devices\n \n ");
}
}

else if (dev_status == UNRECOGNIZED)
printf(" UNRECOGNIZED\n \n");
else
printf(" NOT_PRESENT\n \n");
}

else
printf(" Error occurred while adding a new EVDI node \n \n");

return 0;
}



Code Output :

New EVDI node added
Process id : 25308
Match found : 7f93f547f000-7f93f577f000 rw-s 100004000 00:06 463 /dev/dri/card2
fd = 4
IOCTL FAILED AND RETURNED ERROR : Invalid argument
[libevdi] ioctl: drop_master error=-1
Status of the node : AVAILABLE
Process id : 25308
Match found : 7f93f547f000-7f93f577f000 rw-s 100004000 00:06 463 /dev/dri/card2
fd = 5
IOCTL FAILED AND RETURNED ERROR : Invalid argument
[libevdi] ioctl: drop_master error=-1
Status of the EVDI handle : EVDI_VALID_HANDLE
Opening connections
Registering Buffers
Event Handler = 5

Event Handling Loop
No DATA to be read

Screen Update Status : TRUE
IOCTL FAILED AND RETURNED ERROR : Resource temporarily unavailable
[libevdi] ioctl: grabpix error=-1
[libevdi] Grabbing pixels for buffer 0 failed. Should be ignored if caused by change of mode in kernel.
Unregistering Buffers
Disconnecting
Closing devices



Thank you
Regards,
Irene

Irene 06-14-2017 04:49 AM

Hi

dmesg output:

[ 164.078839] evdi: [I] Initialising logging on level 5
[ 172.524122] evdi: [D] add_store:195 Increasing device count to 1
[ 172.525220] evdi: [D] evdi_crtc_init:312 drm_crtc_init: 0
[ 172.530773] evdi: [W] evdi_painter_crtc_state_notify:363 Painter does not exist!
[ 172.530776] evdi: [D] evdi_detect:78 Painter is disconnected
[ 172.530781] evdi evdi.0: No connectors reported connected with modes
[ 172.530783] [drm] Cannot find any crtc or sizes - going 1024x768
[ 172.531782] evdi evdi.0: fb1: evdidrmfb frame buffer device
[ 172.531785] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[ 172.531786] [drm] No driver support for vblank timestamp query.
[ 172.531787] [drm] evdi: evdi_stats_init
[ 172.531793] [drm] Initialized evdi 1.3.43 20170117 on minor 1
[ 172.531936] evdi: [W] evdi_painter_disconnect:462 (dev=0) An unknown connection to ffff8802d9e66e00 tries to close us
[ 172.531938] evdi: [W] evdi_painter_disconnect:463 - ignoring
[ 172.532172] evdi: [W] evdi_painter_disconnect:462 (dev=0) An unknown connection to ffff8802d9e66e00 tries to close us
[ 172.532173] evdi: [W] evdi_painter_disconnect:463 - ignoring
[ 172.534136] evdi: [D] evdi_detect:78 Painter is disconnected
[ 172.534171] evdi: [D] evdi_detect:78 Painter is disconnected
[ 172.534477] evdi: [D] evdi_painter_crtc_state_notify:360 (dev=0) Notifying crtc state: 3
[ 172.534479] evdi: [W] evdi_painter_send_crtc_state:266 Painter is not connected!
[ 172.534484] evdi: [D] evdi_painter_crtc_state_notify:360 (dev=0) Notifying crtc state: 3
[ 172.534486] evdi: [W] evdi_painter_send_crtc_state:266 Painter is not connected!
[ 172.540189] evdi: [D] evdi_detect:78 Painter is disconnected
[ 173.940932] evdi: [D] add_store:195 Increasing device count to 2
[ 173.942171] evdi: [D] evdi_crtc_init:312 drm_crtc_init: 0
[ 173.944008] evdi: [W] evdi_painter_crtc_state_notify:363 Painter does not exist!
[ 173.944016] evdi: [D] evdi_detect:78 Painter is disconnected
[ 173.944025] evdi evdi.1: No connectors reported connected with modes
[ 173.944031] [drm] Cannot find any crtc or sizes - going 1024x768
[ 173.946559] evdi evdi.1: fb2: evdidrmfb frame buffer device
[ 173.946565] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[ 173.946568] [drm] No driver support for vblank timestamp query.
[ 173.946571] [drm] evdi: evdi_stats_init
[ 173.946579] [drm] Initialized evdi 1.3.43 20170117 on minor 2
[ 173.952568] evdi: [D] evdi_detect:78 Painter is disconnected
[ 173.962865] evdi: [W] evdi_painter_disconnect:462 (dev=0) An unknown connection to ffff8802d8aeee00 tries to close us
[ 173.962868] evdi: [W] evdi_painter_disconnect:463 - ignoring
[ 173.963089] evdi: [W] evdi_painter_disconnect:462 (dev=0) An unknown connection to ffff8802d8aeee00 tries to close us
[ 173.963091] evdi: [W] evdi_painter_disconnect:463 - ignoring
[ 173.964430] evdi: [D] evdi_detect:78 Painter is disconnected
[ 173.964467] evdi: [D] evdi_detect:78 Painter is disconnected
[ 173.964755] evdi: [D] evdi_painter_crtc_state_notify:360 (dev=0) Notifying crtc state: 3
[ 173.964758] evdi: [W] evdi_painter_send_crtc_state:266 Painter is not connected!
[ 173.964763] evdi: [D] evdi_painter_crtc_state_notify:360 (dev=0) Notifying crtc state: 3
[ 173.964764] evdi: [W] evdi_painter_send_crtc_state:266 Painter is not connected!
[ 173.967110] evdi: [D] evdi_detect:78 Painter is disconnected
[ 173.968620] evdi: [D] evdi_detect:78 Painter is disconnected
[ 173.968661] evdi: [D] evdi_detect:78 Painter is disconnected
[ 173.971103] evdi: [W] evdi_painter_disconnect:462 (dev=0) An unknown connection to ffff8802d8b9b400 tries to close us
[ 173.971105] evdi: [W] evdi_painter_disconnect:463 - ignoring
[ 173.989708] evdi: [E] evdi_painter_connect:421 Wrong edid size. Expected 128 but is 130
[ 173.989796] evdi: [E] evdi_painter_grabpix_ioctl:555 Scanout buffer not set
[ 174.090577] evdi: [W] evdi_painter_request_update_ioctl:643 (dev=0) Update was already requested - ignoring
[ 174.090621] evdi: [E] evdi_painter_grabpix_ioctl:555 Scanout buffer not set
[ 174.190926] evdi: [W] evdi_painter_disconnect:462 (dev=0) An unknown connection to ffff8802d9b72000 tries to close us
[ 174.190927] evdi: [W] evdi_painter_disconnect:463 - ignoring
[ 174.190932] evdi: [W] evdi_painter_disconnect:462 (dev=0) An unknown connection to ffff8802d9b72000 tries to close us
[ 174.190932] evdi: [W] evdi_painter_disconnect:463 - ignoring
[ 229.080287] evdi: [D] add_store:195 Increasing device count to 3
[ 229.081785] evdi: [D] evdi_crtc_init:312 drm_crtc_init: 0
[ 229.081938] evdi: [W] evdi_painter_crtc_state_notify:363 Painter does not exist!
[ 229.081944] evdi: [D] evdi_detect:78 Painter is disconnected
[ 229.081952] evdi evdi.2: No connectors reported connected with modes
[ 229.081958] [drm] Cannot find any crtc or sizes - going 1024x768
[ 229.085510] evdi evdi.2: fb3: evdidrmfb frame buffer device
[ 229.085516] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[ 229.085519] [drm] No driver support for vblank timestamp query.
[ 229.085523] [drm] evdi: evdi_stats_init
[ 229.085531] [drm] Initialized evdi 1.3.43 20170117 on minor 3
[ 229.104964] evdi: [W] evdi_painter_disconnect:462 (dev=0) An unknown connection to ffff8802d8aef400 tries to close us
[ 229.104967] evdi: [W] evdi_painter_disconnect:463 - ignoring
[ 229.113445] evdi: [E] evdi_painter_connect:421 Wrong edid size. Expected 128 but is 130
[ 229.119879] evdi: [W] evdi_painter_request_update_ioctl:643 (dev=0) Update was already requested - ignoring
[ 229.120949] evdi: [E] evdi_painter_grabpix_ioctl:555 Scanout buffer not set
[ 229.226030] evdi: [W] evdi_painter_request_update_ioctl:643 (dev=0) Update was already requested - ignoring
[ 229.228431] evdi: [E] evdi_painter_grabpix_ioctl:555 Scanout buffer not set
[ 229.342211] evdi: [W] evdi_painter_disconnect:462 (dev=0) An unknown connection to ffff8802d8aef400 tries to close us
[ 229.342217] evdi: [W] evdi_painter_disconnect:463 - ignoring
[ 229.344896] evdi: [W] evdi_painter_disconnect:462 (dev=0) An unknown connection to ffff8802d8aef400 tries to close us
[ 229.344900] evdi: [W] evdi_painter_disconnect:463 - ignoring
[ 238.223905] evdi: [D] add_store:195 Increasing device count to 4
[ 238.224336] evdi: [D] evdi_crtc_init:312 drm_crtc_init: 0
[ 238.225203] evdi: [W] evdi_painter_crtc_state_notify:363 Painter does not exist!
[ 238.225210] evdi: [D] evdi_detect:78 Painter is disconnected
[ 238.225218] evdi evdi.3: No connectors reported connected with modes
[ 238.225224] [drm] Cannot find any crtc or sizes - going 1024x768
[ 238.227377] evdi evdi.3: fb4: evdidrmfb frame buffer device
[ 238.227381] [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
[ 238.227384] [drm] No driver support for vblank timestamp query.
[ 238.227387] [drm] evdi: evdi_stats_init
[ 238.227395] [drm] Initialized evdi 1.3.43 20170117 on minor 4
[ 238.261068] evdi: [W] evdi_painter_disconnect:462 (dev=0) An unknown connection to ffff8802d8aeea00 tries to close us
[ 238.261072] evdi: [W] evdi_painter_disconnect:463 - ignoring
[ 238.274334] evdi: [E] evdi_painter_connect:421 Wrong edid size. Expected 128 but is 130
[ 238.281992] evdi: [W] evdi_painter_request_update_ioctl:643 (dev=0) Update was already requested - ignoring
[ 238.282774] evdi: [E] evdi_painter_grabpix_ioctl:555 Scanout buffer not set
[ 238.385820] evdi: [W] evdi_painter_request_update_ioctl:643 (dev=0) Update was already requested - ignoring
[ 238.388765] evdi: [E] evdi_painter_grabpix_ioctl:555 Scanout buffer not set
[ 238.503011] evdi: [W] evdi_painter_disconnect:462 (dev=0) An unknown connection to ffff8802d8aeea00 tries to close us
[ 238.503016] evdi: [W] evdi_painter_disconnect:463 - ignoring
[ 238.505523] evdi: [W] evdi_painter_disconnect:462 (dev=0) An unknown connection to ffff8802d8aeea00 tries to close us
[ 238.505527] evdi: [W] evdi_painter_disconnect:463 - ignoring
[ 264.832453] evdi: [D] evdi_painter_crtc_state_notify:360 (dev=0) Notifying crtc state: 3
[ 264.832455] evdi: [W] evdi_painter_send_crtc_state:266 Painter is not connected!
[ 264.832458] evdi: [D] evdi_detect:78 Painter is disconnected
[ 264.832467] evdi: [D] evdi_painter_crtc_state_notify:360 (dev=0) Notifying crtc state: 3
[ 264.832468] evdi: [W] evdi_painter_send_crtc_state:266 Painter is not connected!
[ 264.832470] evdi: [D] evdi_detect:78 Painter is disconnected
[ 264.891523] evdi: [W] evdi_painter_disconnect:462 (dev=0) An unknown connection to ffff880035707600 tries to close us
[ 264.891525] evdi: [W] evdi_painter_disconnect:463 - ignoring
[ 264.891834] evdi: [W] evdi_painter_disconnect:462 (dev=0) An unknown connection to ffff880035707600 tries to close us
[ 264.891835] evdi: [W] evdi_painter_disconnect:463 - ignoring
[ 264.894730] evdi: [D] evdi_detect:78 Painter is disconnected
[ 264.894818] evdi: [D] evdi_detect:78 Painter is disconnected
[ 264.895457] evdi: [D] evdi_painter_crtc_state_notify:360 (dev=0) Notifying crtc state: 3
[ 264.895463] evdi: [W] evdi_painter_send_crtc_state:266 Painter is not connected!
[ 264.895473] evdi: [D] evdi_painter_crtc_state_notify:360 (dev=0) Notifying crtc state: 3
[ 264.895476] evdi: [W] evdi_painter_send_crtc_state:266 Painter is not connected!
[ 264.898864] evdi: [W] evdi_painter_disconnect:462 (dev=0) An unknown connection to ffff8802d9a07a00 tries to close us
[ 264.898870] evdi: [W] evdi_painter_disconnect:463 - ignoring
[ 264.899414] evdi: [W] evdi_painter_disconnect:462 (dev=0) An unknown connection to ffff8802d9a07a00 tries to close us
[ 264.899418] evdi: [W] evdi_painter_disconnect:463 - ignoring
[ 264.902454] evdi: [D] evdi_detect:78 Painter is disconnected

Regards
Irene

Irene 06-14-2017 05:50 AM

Hi,

I tried the wrapper program u suggested, not sure if i did it right but this is the output I got.

OUTPUT :

irs1cob@irs1cob-vm:~/target/bin$ sudo ./monitorsim /sys/class/drm/card0/card0-VGA-1/edid
[libevdi] ioctl: drop_master error=-1
[libevdi] ioctl: drop_master error=-1
[libevdi] ioctl: drop_master error=-1
[libevdi] evdi version:1.3.43[libevdi] doesn't match libevdi compatibility one 1.4.0
No usable EVDI found
irs1cob@irs1cob-vm:~/target/bin$ sudo ./example /sys/class/drm/card0/card0-VGA-1/edid
[libevdi] ioctl: drop_master error=-1
Attempting to use device /dev/dri/card5...
[libevdi] ioctl: drop_master error=-1
[libevdi] evdi version:1.3.43[libevdi] doesn't match libevdi compatibility one 1.4.0
No usable EVDI found


Regards,
Irene

mlukaszek 06-14-2017 02:49 PM

To use the wrapper, you need to have fresh evdi from GitHub so the versioning check doesn't stop you. Your evdi is 1.3.x, the library is 1.4.

Have you read https://displaylink.github.io/evdi/ ?

You're passing 130 as the EDID length - why? It should be 128, or more if you have extension block (but you don't).

There are other things which are explained better in the docs, or you could peek at the example client how they're done. Device adding, buffer allocation, connection, registering event handler and handling events - have a look at the example code, you'll see how they should be used in practice.

Cheers,
Michal


All times are GMT. The time now is 10:33 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2024, vBulletin Solutions, Inc.