0

I have a Raspberry Pi 4. No camera (nor CSI, nor USB) is plugged.

The Pi comes basically out of the box: installed a fresh raspbian with default /boot/config.txt. I just added an overlay for a (CSI) camera that is not yet plugged.

My blurry understanding at that point is that all video-related stuffs are associated to devices such like video, hidraw and/or media.

I turn the raspberry on without any camera plugged and was surprised to find so many devices:

~ $ libcamera-hello --list-cameras
No cameras available!

~ $ ls -al /dev/video*
crw-rw----+ 1 root video 81,  4 Nov 15 23:05 /dev/video10
crw-rw----+ 1 root video 81,  5 Nov 15 23:05 /dev/video11
crw-rw----+ 1 root video 81,  7 Nov 15 23:05 /dev/video12
crw-rw----+ 1 root video 81,  0 Nov 15 23:05 /dev/video13
crw-rw----+ 1 root video 81,  1 Nov 15 23:05 /dev/video14
crw-rw----+ 1 root video 81,  2 Nov 15 23:05 /dev/video15
crw-rw----+ 1 root video 81,  3 Nov 15 23:05 /dev/video16
crw-rw----+ 1 root video 81,  9 Nov 15 23:05 /dev/video18
crw-rw----+ 1 root video 81, 12 Nov 15 23:05 /dev/video19
crw-rw----+ 1 root video 81,  6 Nov 15 23:05 /dev/video20
crw-rw----+ 1 root video 81,  8 Nov 15 23:05 /dev/video21
crw-rw----+ 1 root video 81, 10 Nov 15 23:05 /dev/video22
crw-rw----+ 1 root video 81, 11 Nov 15 23:05 /dev/video23
crw-rw----+ 1 root video 81, 13 Nov 15 23:05 /dev/video31

~ $ ls -al /dev/media*
crw-rw---- 1 root video 238, 0 Nov 15 23:05 /dev/media0
crw-rw---- 1 root video 238, 1 Nov 15 23:05 /dev/media1
crw-rw---- 1 root video 238, 2 Nov 15 23:05 /dev/media2
crw-rw---- 1 root video 238, 3 Nov 15 23:05 /dev/media3
crw-rw---- 1 root video 238, 4 Nov 15 23:05 /dev/media4

~ $ ls -al /dev/hidraw*
crw------- 1 root root 241, 0 Nov 15 23:05 /dev/hidraw0
crw------- 1 root root 241, 1 Nov 15 23:05 /dev/hidraw1
crw------- 1 root root 241, 2 Nov 15 23:05 /dev/hidraw2
crw------- 1 root root 241, 3 Nov 15 23:05 /dev/hidraw3

Question 1: why is there so many devices by default? What are they supposed to be used for and how? Example: for what purpose can I use /dev/video10, /dev/media0 or /dev/hidraw0 if no camera is plugged?!...

Question 2: can somebody shed some light, roughly speaking, on the different types of devices (video, media, hidraw)? What each type is made for?

2 Answers 2

0

These devices are initialized by default in the anticipation that you might connect corresponding hardware in the future. When you do connect devices, the system will use these nodes to interact with the connected hardware. Until then, they serve as placeholders for potential devices.

1
  • OK, but then, when I have only one camera plugged, how to know the associated device? libcamera-hello --list-cameras doesn't help much as it doesn't print the corresponding /dev/*
    – fghoussen
    Nov 17, 2023 at 7:05
0

These are character devices (as indicated by the leading 'c' on the listing).

They do not indicate physical devices but are a link to the device driver in the kernel.

There are a gazillion of them in /dev (the others which are not character devices are block devices indicated by a leading 'b').

In general user programs can send a character to them and/or receive a character in response depending on the device. A common example of a bidirectional device is /dev/i2c-1. This is loaded by the dtparam=i2c_arm=on entry in config.txt.

The listing of an entry indicates a device driver is active which may or may not have a physical device attached.

E.g i2cdetect 1 on one of my Pi indicates 3 devices at addresses 20, 57, 68 but on other Pi there are no corresponding physical devices attached although both have /dev/i2c-1

1
  • Thanks. In practice, when only one camera is plugged, how to know the associated device?
    – fghoussen
    Nov 18, 2023 at 11:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.