Giter Site home page Giter Site logo

Comments (15)

Ferruck avatar Ferruck commented on August 21, 2024

I investigated the problem a bit further and it seems that the number of elements to be written by fwrite are incorrect. sizeof(devices_to_add) is passed as the argument, which is 2, though only one char should be written.

I opened a pull request (#55) that fixes the problem. If it's to hacky, please let me know.

from evdi.

displaylink-mlukaszek avatar displaylink-mlukaszek commented on August 21, 2024

Thanks for pointing this out. I think it is actually a documentation being wrong there. It should say 0 when there was a problem, and a non-zero value otherwise (without worrying what the exact number is).

from evdi.

Ferruck avatar Ferruck commented on August 21, 2024

OK, so the pull request is obsolete. But I still wonder, do you really need to write the \0 into the file as well?

from evdi.

displaylink-mlukaszek avatar displaylink-mlukaszek commented on August 21, 2024

No, probably not. The value is interpreted by evdi_add_store in the kernel module code, and it should be fine without the terminator.
Btw, if you intend to play with evdi and the library (which I encourage you to do), you might find this useful as an example: https://github.com/mlukaszek/evdipp

from evdi.

Ferruck avatar Ferruck commented on August 21, 2024

Indeed I want to play with evdi in the next days so your repo is a great ressource, thanks!

from evdi.

Ferruck avatar Ferruck commented on August 21, 2024

I'm not opening a new issue as I'm probably just holding it wrong.

I tried out your C++ examples and wrote one myself, but neither work. Calling evdi_check_device on the different cards in /dev/dri/ lead to different errors:

  • card0 returns a UNRECOGNIZED and on the terminal I get the additional error

    [libevdi] ioctl: drop_master error=-1
    

    I guess this is intended and correct, because this is the default device that is present without the evdi driver, as well.

  • Every other device I tried (I added devices up to card10 with evdi_add_device which actually works) returns NOT_PRESENT. This seems strange to me.

This is what I get from journalctl when adding a new card (trying to access an already created card gives no output at all):

Nov 14 18:43:24 TP_Trommler kernel: evdi: [D] add_store:195 Increasing device count to 2
Nov 14 18:43:24 TP_Trommler kernel: evdi: [D] evdi_crtc_init:312 drm_crtc_init: 0
Nov 14 18:43:24 TP_Trommler kernel: evdi: [W] evdi_painter_crtc_state_notify:377 Painter does not exist!
Nov 14 18:43:24 TP_Trommler kernel: evdi: [D] evdi_detect:72 Painter is disconnected
Nov 14 18:43:24 TP_Trommler kernel: evdi evdi.1: No connectors reported connected with modes
Nov 14 18:43:24 TP_Trommler kernel: [drm] Cannot find any crtc or sizes - going 1024x768
Nov 14 18:43:24 TP_Trommler kernel: evdi evdi.1: fb2: evdidrmfb frame buffer device
Nov 14 18:43:24 TP_Trommler kernel: [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
Nov 14 18:43:24 TP_Trommler kernel: [drm] No driver support for vblank timestamp query.
Nov 14 18:43:24 TP_Trommler kernel: [drm] evdi: evdi_stats_init
Nov 14 18:43:24 TP_Trommler kernel: [drm] Initialized evdi 1.2.64 20161003 on minor 2
Nov 14 18:43:24 TP_Trommler gnome-shell[508]: Failed to apply DRM plane transform 0: Keine Berechtigung
Nov 14 18:43:24 TP_Trommler gnome-shell[508]: Failed to apply DRM plane transform 0: Keine Berechtigung

(Sorry for the German locale)

I'm running Arch Linux on a ThinkPad X230, uname -a gives the following output:

Linux TP_Trommler 4.8.6-1-ARCH #1 SMP PREEMPT Mon Oct 31 18:51:30 CET 2016 x86_64 GNU/Linux

Am I just dumb and missing some dependencies? Is there just a simple reason why this doesn't work (and probably won't ever)? Or is this a bug in the driver?

I'd really like to work with evdi and hope that I'm just holding it wrong.

Thanks in advance!

from evdi.

mlukaszek avatar mlukaszek commented on August 21, 2024

Could you paste a snippet of code that you're trying?

from evdi.

Ferruck avatar Ferruck commented on August 21, 2024

I can give you the whole code I tried, see here.

But I also tried your C++ examples which give me the same errors.

from evdi.

mlukaszek avatar mlukaszek commented on August 21, 2024

Just to double check - are you running as root? Note the docs says "when the device does not exist or cannot be opened to check". This could be a permission problem, you need to use sudo to be able to send IOCTL from the library to the kernel module.

from evdi.

Ferruck avatar Ferruck commented on August 21, 2024

Of course I tried as root with sudo. Running without superuser permissions lead to different errors.

from evdi.

 avatar commented on August 21, 2024

Can you change log level to VERBOSE? The easiest way is to write 6 to /sys/devices/evdi/loglevel.
references [1] [2]

from evdi.

Ferruck avatar Ferruck commented on August 21, 2024

OK, the verbose debug output is as follows:

Nov 15 11:36:23 TP_Trommler kernel: evdi: [D] add_store:195 Increasing device count to 1
Nov 15 11:36:23 TP_Trommler kernel: evdi: [V] evdi_platform_probe:119 
Nov 15 11:36:23 TP_Trommler kernel: evdi: [V] evdi_driver_load:25 
Nov 15 11:36:23 TP_Trommler kernel: evdi: [V] evdi_driver_load:37 
Nov 15 11:36:23 TP_Trommler kernel: evdi: [V] evdi_modeset_init:361 
Nov 15 11:36:23 TP_Trommler kernel: evdi: [V] evdi_crtc_init:306 
Nov 15 11:36:23 TP_Trommler kernel: evdi: [D] evdi_crtc_init:312 drm_crtc_init: 0
Nov 15 11:36:23 TP_Trommler kernel: evdi: [V] evdi_flip_workqueue_init:324 
Nov 15 11:36:23 TP_Trommler kernel: evdi: [V] evdi_crtc_disable:112 
Nov 15 11:36:23 TP_Trommler kernel: evdi: [W] evdi_painter_crtc_state_notify:377 Painter does not exist!
Nov 15 11:36:23 TP_Trommler kernel: evdi: [V] evdi_detect:67 
Nov 15 11:36:23 TP_Trommler kernel: evdi: [D] evdi_detect:72 Painter is disconnected
Nov 15 11:36:23 TP_Trommler kernel: evdi evdi.0: No connectors reported connected with modes
Nov 15 11:36:23 TP_Trommler kernel: [drm] Cannot find any crtc or sizes - going 1024x768
Nov 15 11:36:23 TP_Trommler kernel: evdi evdi.0: fb1: evdidrmfb frame buffer device
Nov 15 11:36:23 TP_Trommler kernel: [drm] Supports vblank timestamp caching Rev 2 (21.10.2013).
Nov 15 11:36:23 TP_Trommler kernel: [drm] No driver support for vblank timestamp query.
Nov 15 11:36:23 TP_Trommler kernel: evdi: [V] evdi_painter_init:677 
Nov 15 11:36:23 TP_Trommler kernel: [drm] evdi: evdi_stats_init
Nov 15 11:36:23 TP_Trommler kernel: [drm] Initialized evdi 1.2.64 20161003 on minor 1
Nov 15 11:36:23 TP_Trommler gnome-shell[506]: Failed to apply DRM plane transform 0: Keine Berechtigung
Nov 15 11:36:23 TP_Trommler gnome-shell[506]: Failed to apply DRM plane transform 0: Keine Berechtigung

from evdi.

mlukaszek avatar mlukaszek commented on August 21, 2024

Have you been modifying the evdi kernel module or library code at all?

What evdi_check_device does is quite simple:

  • it checks e.g. /dev/dri/card1 exists at all,
  • then tries to open it (which in your case must have succeeded as you see messages about failed drop master IOCTL),
  • then checks that the device is EVDI - by using DRM_IOCTL_VERSION ioctl to get the version, and comparing the name of the device with "evdi".

I guess your next logical step is to attach a debugger and step through the calls, to figure out which of the above steps fail.

from evdi.

Ferruck avatar Ferruck commented on August 21, 2024

No, I have neither modified the kernel module nor the library. I'll debug the program in the next days.

from evdi.

Ferruck avatar Ferruck commented on August 21, 2024

Sorry for the really late response. I hadn't have access to the laptop I used while encountering this issue any more. On another machine I can't reproduce the problem so I'm closing it now. Thanks for your support.

from evdi.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.