My current project is attempting to use several switch modules to change the path of a video pipeline at run time. I have been able to get the modules themselves to run so long as I"m not switching them around but now that I am trying to switch them I have noticed some odd behavior.The VIP user guide says to either write to the control register or use the output_switch feature. We are using the control register because data is not being supplied to all input ports of the switches at all times and so it seems that it should fail to sync the streams before switching. What I have implemented for testing is to read the status bits, turn off the switches by an IORD() macro to the MM control port and then read the status until it clears. What I have observed is that sometimes the switches are not stopping at all and I loop indefinitely
DebugPrintf("Waiting for usb mixer switch to return status = 0\n\r");
DebugPrintf("counter = %i\n\r",counter);I have tried this with and without the short delays and there doesn't appear to be any difference in performance. When I try and read the various control port registers (go, status, output switch, Dout 0 source, ..etc) I am always getting the same data back so are the Dout source registers write only? There is no discussion of this in the user guide that I have found.
>We are using the control register because data is not being supplied to all input ports of the >switches at all times and so it seems that it should fail to sync the streams before switching.I cannot guarantee this will work but this is probably worth a try. AFAIK, it is possible to sync at any time between the end of an image packet and the beginning of the next packet. An inactive input should not prevent anything.
After working on this issue some more we think that the issue is that we have the mixer output being fed back into the switch. This appears to prevent the switch from turning off possibly due to a race condition. We are going to modify the pipeline arrangement and try again.