Skip to content

Added changes that I might be useful for a device with DisplayPort #8

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

vasilake-v
Copy link

Added changes that I might be useful for a device with DisplayPort
Also on my environment the udev directive ENV{HOTPLUG} wasn't available on my environment so I thought it might be useful to let others know about it

@luizoti
Copy link
Contributor

luizoti commented Jun 5, 2021

Added changes that I might be useful for a device with DisplayPort
Also on my environment the udev directive ENV{HOTPLUG} wasn't available on my environment so I thought it might be useful to let others know about it

And did everything work even without the ENV{HOTPLUG} directive?

@vasilake-v
Copy link
Author

What I meant was that

Added changes that I might be useful for a device with DisplayPort
Also on my environment the udev directive ENV{HOTPLUG} wasn't available on my environment so I thought it might be useful to let others know about it

And did everything work even without the ENV{HOTPLUG} directive?

No, it didn't work.

What I meant was that on my environment was no ENV{HOTPLUG} directive. And I had to find a solution for this.

I found one and i posted this solution here as a PR for review

@luizoti
Copy link
Contributor

luizoti commented Jun 8, 2021

But which rule worked in your system?

The first time I read I didn't notice the stackexchange link, I thought the PR was just about DisplayPort.

@vasilake-v
Copy link
Author

Oh, i guess i ommited the "rules file" that i am using. I excluded that directive completely. And here is my trouble shoot path:

My system

root@HP-ProBook-470-G5:/etc/udev/rules.d# cat /etc/lsb-release 
DISTRIB_ID=Ubuntu
DISTRIB_RELEASE=20.10
DISTRIB_CODENAME=groovy
DISTRIB_DESCRIPTION="Ubuntu 20.10"

I tried to monitor the events with udevd, but failed.

root@HP-ProBook-470-G5:/etc/udev/rules.d# udevd
udevd: command not found

so I used the udevadm monitor to verify the event

root@HP-ProBook-470-G5:/etc/udev/rules.d# udevadm monitor
monitor will print the received events for:
UDEV - the event which udev sends out after rule processing
KERNEL - the kernel uevent

KERNEL[42303.933768] change   /devices/pci0000:00/0000:00:02.0/drm/card0 (drm)
UDEV  [42304.066600] change   /devices/pci0000:00/0000:00:02.0/drm/card0 (drm)
KERNEL[42304.364653] add      /devices/pci0000:00/0000:00:14.0/usb1/1-2 (usb)
KERNEL[42304.365857] add      /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0 (usb)
KERNEL[42304.369941] bind     /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0 (usb)
KERNEL[42304.370093] bind     /devices/pci0000:00/0000:00:14.0/usb1/1-2 (usb)
UDEV  [42304.554444] add      /devices/pci0000:00/0000:00:14.0/usb1/1-2 (usb)
UDEV  [42304.646693] add      /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0 (usb)
UDEV  [42304.726060] bind     /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2:1.0 (usb)
UDEV  [42304.813698] bind     /devices/pci0000:00/0000:00:14.0/usb1/1-2 (usb)
KERNEL[42305.382477] add      /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2.3 (usb)
KERNEL[42305.387848] add      /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2.3/1-2.3:1.0 (usb)
KERNEL[42305.388163] bind     /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2.3 (usb)
KERNEL[42305.726932] add      /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2.4 (usb)
KERNEL[42305.727885] add      /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2.4/1-2.4:1.0 (usb)
KERNEL[42305.732438] bind     /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2.4/1-2.4:1.0 (usb)
KERNEL[42305.732565] bind     /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2.4 (usb)
UDEV  [42305.842233] add      /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2.4 (usb)
UDEV  [42305.859561] add      /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2.3 (usb)
UDEV  [42305.960310] add      /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2.4/1-2.4:1.0 (usb)
UDEV  [42306.044268] add      /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2.3/1-2.3:1.0 (usb)
UDEV  [42306.184810] bind     /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2.4/1-2.4:1.0 (usb)
UDEV  [42306.213116] bind     /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2.3 (usb)
UDEV  [42306.275536] bind     /devices/pci0000:00/0000:00:14.0/usb1/1-2/1-2.4 (usb)

In the end i came up with a "rules" file that don't include the ENV{HOTPLUG}=="1".

Maybe i am mising something here, but it works :)

ACTION=="change"
SUBSYSTEM=="drm"
RUN+="/home/user/monitor-hotplug.sh"

@luizoti
Copy link
Contributor

luizoti commented Jun 8, 2021

In the end i came up with a "rules" file that don't include the ENV{HOTPLUG}=="1".

By my tests, everything worked on 20.04, maybe it's a difference between the distros.

In the next version of the script it might be worth adding the two udev rules or a way to install the correct one for each distro.

In any case, it is possible to add 2 or more rules to the same file, I think it's valid that you edit the PR and modify the rules file including the version your version.

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