Sometimes when using a USB-camera with a Linux laptop, the integrated webcam of the laptop may cause some issue that lead to pylon crashing on start-up.

The problem often is caused by pylon trying to enumerate the webcam as an imaging device instead of the correct camera which leads to a crash and error.


In most cases the problem can be solved by disabling the internal webcam from the laptop's BIOS.


However, if the camera either can not be disabled from BIOS, or disabling does not fix the error for some reason, one could try to disable the camera by disabling the internal usb-port that the camera is using on PCI level.


The following guide show how to find and disable the internal USB-port where the webcam is connected to

This guide shows the process on Ubuntu, but one should be able to apply the instructions in other distros as well.


first try to start pylon and see if there's a problem

 

## Try to start pylon, crashes on usb enumeration ##

kimmo@Aspire-4810T:/home/kimmo# /opt/pylon4/bin/PylonViewerApp 
View Help removed
DeviceScanThread started.
Enumerated 'Camera Emulation' and found 0 devices.
Enumerated 'GigE' and found 0 devices.
*** Error in `/opt/pylon4/bin/.PylonViewerApp': malloc(): memory corruption: 0x00007fcc1c012870 ***
Aborted (core dumped)

 


Change to root for the repairs

 

## Change as root for fixing ##
kimmo@Aspire-4810T:~$ sudo su root
[sudo] password for kimmo:

 


Check for active USB cameras from system

 

## Check for webcam ##
root@Aspire-4810T:/home/kimmo# lsusb
Bus 002 Device 003: ID 12d1:1404 Huawei Technologies Co., Ltd. 

## Integrated webcam found ##
Bus 002 Device 002: ID 04f2:b160 Chicony Electronics Co., Ltd 

Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 008 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 002: ID 2676:ba03 Basler AG 
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

 


Find device path for the camera

 

## Find path for integrated webcam ##
root@Aspire-4810T:/home/kimmo# find /sys/ -path "*usb*product*" -exec ls {} \; -exec cat {} \; 2> /dev/null
/sys/bus/usb/drivers_probe
/sys/bus/usb/drivers_autoprobe
1
/sys/bus/usb-serial/drivers_probe
/sys/bus/usb-serial/drivers_autoprobe
1
/sys/devices/pci0000:00/0000:00:1a.0/usb3/product
UHCI Host Controller
/sys/devices/pci0000:00/0000:00:1a.1/usb4/product
UHCI Host Controller
/sys/devices/pci0000:00/0000:00:1a.7/usb1/1-4/product
daA1280-54um
/sys/devices/pci0000:00/0000:00:1a.7/usb1/product
EHCI Host Controller
/sys/devices/pci0000:00/0000:00:1d.0/usb5/product
UHCI Host Controller
/sys/devices/pci0000:00/0000:00:1d.1/usb6/product
UHCI Host Controller
/sys/devices/pci0000:00/0000:00:1d.2/usb7/product
UHCI Host Controller
/sys/devices/pci0000:00/0000:00:1d.3/usb8/product
UHCI Host Controller

## Path for webcam found ##
/sys/devices/pci0000:00/0000:00:1d.7/usb2/2-5/product
CNF9113

/sys/devices/pci0000:00/0000:00:1d.7/usb2/2-7/product
HUAWEI Mobile
/sys/devices/pci0000:00/0000:00:1d.7/usb2/product
EHCI Host Controller

 


Remove the device from the system. Note: must be root for this!

The device will re-appear after reboot

 

## Remove webcam from system until reboot ##

root@Aspire-4810T:/home/kimmo# echo 1 > /sys/devices/pci0000:00/0000:00:1d.7/usb2/2-5/remove

 


Check that camera is no longer listed on lsusb

  

## Check lsusb again ##
root@Aspire-4810T:/home/kimmo# lsusb
Bus 002 Device 003: ID 12d1:1404 Huawei Technologies Co., Ltd. 
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 008 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 007 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 006 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 005 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 001 Device 002: ID 2676:ba03 Basler AG 
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 004 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
Bus 003 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub

## No webcam found! ##

 

 

Now you can change back to normal user and try to start pylon again

 

## Back to normal user
root@Aspire-4810T:/home/kimmo# su kimmo


## Try starting pylon again ##
kimmo@Aspire-4810T:~$ /opt/pylon4/bin/PylonViewerApp 
View Help removed
DeviceScanThread started.
Enumerated 'Camera Emulation' and found 0 devices.
Enumerated 'GigE' and found 0 devices.
Enumerated 'USB' and found 1 devices.
    Found 'daA1280-54um (21685944)'
Object::connect: No such slot StatusBar::update( StatusBar::StatusInfo* )
DeviceScanThread ended

## Pylon starts successfully and enumerares usb-devices! ##
## Check that everything works on GUI ##