This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Switching between TVP5146 and internal CMOS camera (dm355)

Other Parts Discussed in Thread: TVP5146

Hello all,

It seems to me that the davinci video driver is written such that you have state which device_type you want to use at boot up time.

This is fine. I can set the device_type to 1, reboot, and get video from an analogue camera (via TVP5146).  Or, I can set device_type to 2, reboot, and get video from the CMOS camera.

My question is, how can I switch between them in run-time?

I tried VIDIOC_STREAMOFF then VIDIOC_STREAMON. I tried close() then open(). But, after the switch, I get either a 'kernel panic' (null pointer somewhere), or the the kernel hangs, presumably because it can't re-sync to a frame....

Please help. I'm very very confused!!!

Thank you,

Amjad.

  • Looking at the driver source code, it appears the device type is only set during driver initialization.  Therefore you have two options, 1) modify the driver code yourself to allow switching between device_types at run time, or 2) load drivers dynamically (insmod, rmmod) and passing different device_type values whenever you want to switch (pretty sure you can invoke insmod and rmmod from within your application if necessary).