# Problems with voxl-uvc-server

Source: https://forum.modalai.com/topic/1578/problems-with-voxl-uvc-server
Category: Flight Core and Legacy VOXL (https://forum.modalai.com/category/9/flight-core-and-legacy-voxl)
Tags: voxl
Posted: 2022-11-28 14:35:28 UTC by amitga
Replies: 2 · Views: 932

## amitga · 2022-11-28 14:35:28 UTC

Hi.
I'm using voxl-uvc-server (v0.1.3) on system image v3.8.

I have experienced a few problems:

1. When two different cameras are attached via USB hub (either powered or unpowered) to debug board's USB, voxl-uvc-server usually fails at opening the device.
If I boot with only one camera attached to the USB hub, it works on the first try. With two cameras attached, it fails (`uvc_open failed`) around two to three consecutive tries, until its successful. 
In this scenario I was only running one instance of voxl-uvc-server. No other software was accessing UVC (AFAIK) on the VOXL.

2. I'm trying to use voxl-uvc-server for both cameras. From the docs it should be possible, as they are different brand/type of cameras, and I'm giving each one a unique frame rate.
![5aa30359-0a5f-445d-9718-e5c1c09e8ba5-image.png](https://forum.modalai.com/assets/uploads/files/1669645988622-5aa30359-0a5f-445d-9718-e5c1c09e8ba5-image.png) 
But in practice, it doesn't work: The code for voxl-uvc-server prevents two instances from running simultaneously:

```
int main(int argc, char *argv[]) {

    ////////////////////////////////////////////////////////////////////////////////
    // gracefully handle an existing instance of the process and associated PID file
    ////////////////////////////////////////////////////////////////////////////////

    // make sure another instance isn't running
    // if return value is -3 then a background process is running with
    // higher privaledges and we couldn't kill it, in which case we should
    // not continue or there may be hardware conflicts. If it returned -4
    // then there was an invalid argument that needs to be fixed.
    if(kill_existing_process(SERVER_NAME, 2.0)<-2) return -1;

    // start signal handler so we can exit cleanly
    if(enable_signal_handler()==-1){
        fprintf(stderr,"ERROR: failed to start signal handler\n");
        return -1;
    }

    // make PID file to indicate your project is running
    // due to the check made on the call to rc_kill_existing_process() above
    // we can be fairly confident there is no PID file already and we can
    // make our own safely.
    make_pid_file(SERVER_NAME);
```

How can I run two instances on the VOXL ?

Thanks.

## Reply by amitga · 2022-12-04 15:07:26 UTC

Any help about running 2 USB cameras ?
Can I just remove the code that limits this in UVC-server ?
Thanks

## Reply by Eric Katzfey (ModalAI staff) · 2022-12-04 21:15:28 UTC (in reply to amitga)

@amitga Yes you can. That code shouldn't be there since it prevents the exact use case that you are trying to run.
