2

I am running Ubuntu 18.04.2 LTS on a DELL XPS13 9343 and seem to be suffering from a kernel bug (reference: https://www.spinics.net/lists/linux-media/msg135812.html), which leads to the problem that I now have media0 - media255 all occupied under dev, which in turn leads to the following problem (media: could not get a free minor):

dmesg | tail -13
[ 5068.870529] uvcvideo: Found UVC 1.00 device Integrated_Webcam_HD (0c45:670c)
[ 5068.911713] uvcvideo 2-5:1.0: Entity type for entity Extension 4 was not initialized!
[ 5068.911716] uvcvideo 2-5:1.0: Entity type for entity Extension 3 was not initialized!
[ 5068.911717] uvcvideo 2-5:1.0: Entity type for entity Processing 2 was not initialized!
[ 5068.911719] uvcvideo 2-5:1.0: Entity type for entity Camera 1 was not initialized!
[ 5068.911722] media: could not get a free minor
[ 5069.249598] usb 2-5: USB disconnect, device number 56
[ 5069.556176] usb 2-5: new high-speed USB device number 57 using xhci_hcd
[ 5069.767923] usb 2-5: New USB device found, idVendor=0c45, idProduct=670c
[ 5069.767929] usb 2-5: New USB device strings: Mfr=2, Product=1, SerialNumber=0
[ 5069.767934] usb 2-5: Product: Integrated_Webcam_HD
[ 5069.767938] usb 2-5: Manufacturer: CN09GTFM7248753ABDZMA00
[ 5069.779009] uvcvideo: Found UVC 1.00 device Integrated_Webcam_HD (0c45:670c)

Although this bug has been fixed, it looks like it's not yet back-ported to my LTS version (for reference: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1836654, entry media: uvcvideo: Fix driver reference counting).

My questions now are however:
1) how can I clean up these media controller devices (device controller nodes) manually (ideally from terminal) in a proper way?
2) in general, how can I figure out which items under /dev are inactive / obsolete and purge those?


Additional information:

Under /sys/devices/pci0000:00/0000:00:14.0/usb2 it keeps trying to add but afterwards removing a 2-5 directory.

Under /sys/dev/char I have lots of broken links of two sorts now:

lrwxrwxrwx 1 root root 0 Aug 15 09:52 13:256 -> ../../devices/pci0000:00/0000:00:14.0/usb2/2-5/2-5:1.0/input/input42/event256
lrwxrwxrwx 1 root root 0 Aug 15 09:52 13:257 -> ../../devices/pci0000:00/0000:00:14.0/usb2/2-5/2-5:1.0/input/input43/event257
............
lrwxrwxrwx 1 root root 0 Aug 15 09:52 13:495 -> ../../devices/pci0000:00/0000:00:14.0/usb2/2-5/2-5:1.0/input/input281/event495
lrwxrwxrwx 1 root root 0 Aug 15 09:52 13:496 -> ../../devices/pci0000:00/0000:00:14.0/usb2/2-5/2-5:1.0/input/input282/event496

lrwxrwxrwx 1 root root 0 Aug 15 09:52 241:0 -> ../../devices/pci0000:00/0000:00:14.0/usb2/2-5/2-5:1.0/media0
lrwxrwxrwx 1 root root 0 Aug 15 09:52 241:1 -> ../../devices/pci0000:00/0000:00:14.0/usb2/2-5/2-5:1.0/media1
lrwxrwxrwx 1 root root 0 Aug 15 09:52 241:10 -> ../../devices/pci0000:00/0000:00:14.0/usb2/2-5/2-5:1.0/media10
............
lrwxrwxrwx 1 root root 0 Aug 15 09:52 241:98 -> ../../devices/pci0000:00/0000:00:14.0/usb2/2-5/2-5:1.0/media98
lrwxrwxrwx 1 root root 0 Aug 15 09:52 241:99 -> ../../devices/pci0000:00/0000:00:14.0/usb2/2-5/2-5:1.0/media99

Then there is also /dev/char and /dev/input to consider (?)

5
  • I would suggest taking a closer look at your device orchestration mechanism, I believe it's a mixture between systemd and udev in your case.
    – Yaron
    Aug 15, 2019 at 8:33
  • 1
    You need to fix the bug and the answer would be to show you the fix on the bug report for this. From your link "Thank you for the report. I'm sorry about that :-S It's a known issue, and a fix is already present in Linus' tree, on its way to v4.18-rc1." What kernel do you use? Get 4.18 or higher. If you do have 4.18+ I would suggest to post in the link you provided as those people need to fix this.
    – Rinzwind
    Aug 15, 2019 at 9:10
  • @Rinzwind so just to get you right, you are saying that once I obtain the fix, that should also take care of the clean-up, yes?
    – RolandASc
    Aug 15, 2019 at 11:11
  • 1
    Yes /dev/ is recreated on every boot based on what configs tell the system. uvcvideo tells the system to make N entries H N entries are made until the system complains there are too many. How about you install kernel 5 and test that? Is not that difficult if you use uuku for that.
    – Rinzwind
    Aug 15, 2019 at 11:30
  • update - so following @Rinzwind hint, I have installed the HWE hardware enablement stack sudo apt install --install-recommends linux-generic-hwe-18.04 xserver-xorg-hwe-18.04, which has allowed me to bring the kernel from the base 4.15 up to the recent 5.0. With a reboot this has indeed not only upgraded my kernel, but also cleaned up all the issues I mentioned in the question, e.g. the media0-255 are all gone etc. Still I would love to get an answer to the general question(s), even if it is "sorry that's not really possible, instead you would use udev to ..."
    – RolandASc
    Aug 15, 2019 at 12:29

1 Answer 1

2

1) how can I clean up these media controller devices (device controller nodes) manually (ideally from terminal) in a proper way?

You can remove all you want in /dev/ but on the next reboot it is all recreated. Basically that is how Linux can get away with a system that is as universal as possible: those /dev/ entries are created on the fly and as needed by the system so you take out the hard disk and put it into another machine ... next reboot /dev/ is created for THAT system. Works perfect except for 3rd party drivers where the other system does not have that 3rd party devive.

2) in general, how can I figure out which items under /dev are inactive / obsolete and purge those?

/dev/ is created based on what packages need as a device so all -should- be needed (though I will not be able to tell you what entry in /dev/ is needed for what purpose for all of them).

In theory a package should have a limited amount of /dev/ entries. When uvcvideo has a bug that creates lots of /dev/ entries we can not do a lot about it unless you consider removing uvcvideo an option. The problem is not with /dev/ ... that is the effect of the bug. Fixing uvcvideo is what should be done.

You could remove /dev/ entries manually but that is 1 time per reboot. And to do this with a script... I would hesitate to advice that. It will likely break things. Besides that: I would expect the system to start throwing errors during boot (so before your clean up).

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .