camera_test --highest-device isn't effective at picking the external webcam

Bug #956885 reported by Brendan Donegan
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Checkbox
Fix Released
High
Brendan Donegan

Bug Description

Seems we made an oversight when deciding that simply choosing the highest numbered /dev/videoX device would always yield the external webcam. When the webcam is plugged in at boot time it ends up with being /dev/video0 and the internal one is /dev/video1, much like when a USB stick is installed at boot time. The lesson? Never trust the kernel.

We need to find a concrete way to find the external camera. Either that or we need to assume the camera is plugged at boot time and choose /dev/video0

Related branches

Revision history for this message
Javier Collado (javier.collado) wrote :

I know that for network cards it's possible to edit a file under /udev/rules/ to make sure that they always get the same device.

Maybe is worth to spend some time to investigate if something similar is possible for video devices.

Revision history for this message
Brendan Donegan (brendan-donegan) wrote :

Looks like on my main laptop it puts the external USB camera as /dev/video1 even if inserted at boot time. I'm going to check this is the case again on the other laptop I have.

Revision history for this message
Brendan Donegan (brendan-donegan) wrote :

This seems to be system specific somehow. Perhaps the ordering is done by the model name of the devices, so depending on the name of the built-in camera.

Revision history for this message
Brendan Donegan (brendan-donegan) wrote :

So yeah, we can create udev rules file in the preseed such as:

/etc/udev/rules.d/70-persistent-webcam.rules

and put:

SUBSYSTEM=="video4linux", ENV{ID_MODEL_ID}=="3450", SYMLINK+="external_webcam", ENV{GENERATED}="1"

We may or may not need to expand on the criteria (I think putting 3450 for the model should be good enough. We could also add the manufacturer) but the principle should work.

This would all have to be done in checkbox-satellite, then we would just update the jobs to specify '--device=/dev/external_webcam' instead of '--highest-device'. Alternatively we could leave the jobs as is and set:

KERNEL="video1"

but I haven't tested if this works yet

Changed in checkbox:
assignee: nobody → Brendan Donegan (brendan-donegan)
status: New → In Progress
importance: Undecided → High
Revision history for this message
Brendan Donegan (brendan-donegan) wrote :

To be accurate - it should be NAME="video1"

Revision history for this message
Brendan Donegan (brendan-donegan) wrote :

I think the first one could be better as fiddling around with the actual name of the device may affect other tests and it looks clearer to explicitly name the device.

Changed in checkbox:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.