×

INDI Library v2.0.6 is Released (02 Feb 2024)

Bi-monthly release with minor bug fixes and improvements

Image capture fails indi_v4l2_ccd

  • Posts: 10
  • Thank you received: 0
After a few seconds to a few minutes, indi_v4l2_ccd driver fails with:
indi_v4l2_ccd: VIDIOC_STREAMON error 16, Device or resource busy
after which cannot restart the driver and clear the error.
Sometimes runs ok for several minutes; no other video software is running.
System is Ubuntu 14.04.
Program that starts capture is:
void MyClient::takeExposure()
{
INumberVectorProperty *ccd_exposure = NULL;
if ( ccd_simulator)
{
ccd_exposure = ccd_simulator->getNumber("CCD_EXPOSURE");
if (ccd_exposure == NULL)
{
IDLog("Error: unable to find CCD Simulator CCD_EXPOSURE property...\n");
return;
}
// Take a 1 second exposure
// IDLog("Taking a 1 second exposure.\n");
//was: ccd_exposure->np[0].value = 1;
if ( my_exposure < 0.01) my_exposure = 0.01;
ccd_exposure->np[0].value = my_exposure;
blob_ready = false;
sendNewNumber(ccd_exposure);
}
}
After running a few seconds to a few minutes get error:
2014-07-14T17:07:16: Driver indi_v4l2_ccd: VIDIOC_STREAMON error 16, Device or resource busy
On starting indiserver with:
indiserver indi_v4l2_ccd
When starting indi client:
2014-07-14T17:24:49: startup: indiserver indi_v4l2_ccd
2014-07-14T17:24:57: Driver indi_v4l2_ccd: Driver uvcvideo (version 3.13.9)
2014-07-14T17:24:57: Driver indi_v4l2_ccd: card; DMK 23U445
2014-07-14T17:24:57: Driver indi_v4l2_ccd: bus; usb-0000:00:1d.0-1.1
2014-07-14T17:24:57: Driver indi_v4l2_ccd: Driver capabilities:
2014-07-14T17:24:57: Driver indi_v4l2_ccd: V4L2_CAP_VIDEO_CAPTURE
2014-07-14T17:24:57: Driver indi_v4l2_ccd: V4L2_CAP_STREAMING
2014-07-14T17:24:57: Driver indi_v4l2_ccd: Available Inputs:
2014-07-14T17:24:57: Driver indi_v4l2_ccd: 0. Camera 1 (type Composite/S-Video)
2014-07-14T17:24:57: Driver indi_v4l2_ccd: Current Video input: 0
2014-07-14T17:24:57: Driver indi_v4l2_ccd: Crop capabilities: bounds = (top=0, left=0, width=1280, height=960)
2014-07-14T17:24:57: Driver indi_v4l2_ccd: Crop capabilities: defrect = (top=0, left=0, width=1280, height=960)
2014-07-14T17:24:57: Driver indi_v4l2_ccd: Crop capabilities: pixelaspect = 1 / 1
2014-07-14T17:24:57: Driver indi_v4l2_ccd: Resetting crop area to default
2014-07-14T17:24:57: Driver indi_v4l2_ccd: VIDIOC_S_CROP: Inappropriate ioctl for device
2014-07-14T17:24:57: Driver indi_v4l2_ccd: VIDIOC_G_CROP: Inappropriate ioctl for device
2014-07-14T17:24:57: Driver indi_v4l2_ccd: Available Capture Image formats:
2014-07-14T17:24:57: Driver indi_v4l2_ccd: 0. Greyscale 8-bit (Y800) (GREY)
2014-07-14T17:24:57: Driver indi_v4l2_ccd: Available Frame sizes/rates for this format:
2014-07-14T17:24:57: Driver indi_v4l2_ccd: 0. (Discrete) width 1280 x height 960
2014-07-14T17:24:57: Driver indi_v4l2_ccd: Frame intervals:1/15 s, 1/10 s, 2/15 s, 1/5 s, 4/15 s,
2014-07-14T17:24:57: Driver indi_v4l2_ccd: 1. Greyscale 16-bit (Y16 ) (Y16 )
2014-07-14T17:24:57: Driver indi_v4l2_ccd: Available Frame sizes/rates for this format:
2014-07-14T17:24:57: Driver indi_v4l2_ccd: 0. (Discrete) width 1280 x height 960
2014-07-14T17:24:57: Driver indi_v4l2_ccd: Frame intervals:2/15 s, 1/5 s, 4/15 s,
2014-07-14T17:24:57: Driver indi_v4l2_ccd: width: 1280 - height: 960
2014-07-14T17:24:57: Driver indi_v4l2_ccd: pixel format: V4L2_PIX_FMT_GREY
2014-07-14T17:24:57: Driver indi_v4l2_ccd: V4L2 Check: All successful, returning
2014-07-14T17:24:57: Driver indi_v4l2_ccd: Current Video input(0.): Camera 1
2014-07-14T17:24:57: Driver indi_v4l2_ccd: Current Capture format is (0.) GREY
2014-07-14T17:24:57: Driver indi_v4l2_ccd: Current capture size is (0.) 1280x960
2014-07-14T17:24:57: Driver indi_v4l2_ccd: Control Gain
2014-07-14T17:24:57: Driver indi_v4l2_ccd: integer
2014-07-14T17:24:57: Driver indi_v4l2_ccd: Control Exposure (Absolute)
2014-07-14T17:24:57: Driver indi_v4l2_ccd: integer
2014-07-14T17:24:57: Driver indi_v4l2_ccd: Adding Gain -- min: 174 max: 1023 step: 1 value: 174
2014-07-14T17:24:57: Driver indi_v4l2_ccd: Adding Exposure (Absolute) -- min: 1 max: 300000 step: 1 value: 50
2014-07-14T17:25:19: Driver indi_v4l2_ccd: VIDIOC_STREAMON error 16, Device or resource busy

Any suggestions to prevent /dev/video0 from having problem appreciated. Or how to recover via software. This is to run stand-alone application.

Thanks. Joe
9 years 8 months ago #1505

Please Log in or Create an account to join the conversation.

  • Posts: 226
  • Thank you received: 88
Hi,

Did you succeed to make any captures with your program, or directly in Kstars? When you talk about seconds and minutes, is this when your program is running ?
By the way, the VIDIOC_STREAMON V4L2 call arises when capturing a frame (subsequent to your sendNewNumber call), I have sometimes the same issue with a webcam which claims all the USB bandwith when it starts capturing, and should connect it to a free USB bus for it to work. It does not use the uvcvideo driver so I don't know if this is related.
You may try to disconnect/reconnect the cam in Indi if you want to recover from this error in software.
Regards,
Jean-Luc.
9 years 8 months ago #1544

Please Log in or Create an account to join the conversation.

  • Posts: 10
  • Thank you received: 0
Jean-Luc,

Thanks for the information. Yes, I have had more success; but found that saving the image as indicated in the sample causes the problem. Apparently, the Client::newBlob() method in the tutorial_six sample needs a blocking mechanism so that an application doesn't do another "takeExposure()" until the newBlob() callback completes. Further, the file should be saved in the user program, not in the callback.
I have an updated sample program what takes sequential pictures for longer periods, but still fails eventually. Thinking of posting the sample program asking for help for anyone to make suggestions.

Thanks again...
Joe
9 years 8 months ago #1545

Please Log in or Create an account to join the conversation.

Time to create page: 0.701 seconds