Skip to contentSkip to conversation

bttv 2.6.26 problem

DISCUSSION Linos 3 participants 6 messages Oct 20, 2008 Media (V4L/DVB)

lore
Share & tools
lore

Linos

author
#0 lore raw

Hello, i have upgraded a debian machine from kernel 2.6.24 to 2.6.26 and now i have this error when try to launch helix producer on the capture input.

producer -vc /dev/video0 -ad 128k -vp "0" -dt -vm sharp -o /tmp/test.rm
Helix DNA(TM) Producer 11.0 Build number: 11.0.0.2013
Info: Starting encode
Error: Could not set image size to 352x288 for color format I420 (15) (VIDIOCMCAPTURE: buffer 0)
Warning: Capture Buffer is empty at 445090329ms for last 61 times
Warning: Capture Buffer is empty at 445091549ms for last 61 times

exactly the same producer version with the same command line works ok in 2.6.24, previously i have saw this error when i was trying to use from 2 different capture programs the same video input but this is not the case, it is the only program using /dev/video0, what can be happening?

Regards,
Miguel Angel.

--
video4linux-list mailing list
Unsubscribe mailto:[email protected]?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

#1 lore raw
Quoted 2 lines · Linos

Error: Could not set image size to 352x288 for color format I420 (15) (VIDIOCMCAPTURE: buffer 0)

The problem is that the v4l1-compat code for VIDIOCMCAPTURE calls VIDIOC_S_FMT. At the beginning of bttv_s_fmt_vid_cap the call to bttv_switch_type fails because the buffers have already been mmap'ed by the application. I'd say this is a bug in bttv.

In which case does the videobuf_queue_is_busy test prevent bad things from happening?

A workaround is to set the resolution and image format before the buffers are mapped, f.ex. with this small program:
--------------
#include <sys/ioctl.h>
#include <fcntl.h>
#include <unistd.h>
#include <linux/videodev.h>

void main()
{
struct video_mmap vmm;
vmm.height=352;
vmm.width=288; vmm.format=VIDEO_PALETTE_YUV420P; vmm.frame=0; ioctl(open("/dev/video",O_RDWR),VIDIOCMCAPTURE,&vmm);
}
--------------

Daniel

--
video4linux-list mailing list
Unsubscribe mailto:[email protected]?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

author
#2 lore raw
Quoted 31 lines · Daniel Glöckner
Quoted 1 line · Linos

Error: Could not set image size to 352x288 for color format I420 (15) (VIDIOCMCAPTURE: buffer 0)

The problem is that the v4l1-compat code for VIDIOCMCAPTURE calls VIDIOC_S_FMT. At the beginning of bttv_s_fmt_vid_cap the call to bttv_switch_type fails because the buffers have already been mmap'ed by the application. I'd say this is a bug in bttv.

In which case does the videobuf_queue_is_busy test prevent bad things from happening?

A workaround is to set the resolution and image format before the buffers are mapped, f.ex. with this small program:
--------------
#include <sys/ioctl.h>
#include <fcntl.h>
#include <unistd.h>
#include <linux/videodev.h>

void main()
{
struct video_mmap vmm;
vmm.height=352;
vmm.width=288; vmm.format=VIDEO_PALETTE_YUV420P; vmm.frame=0; ioctl(open("/dev/video",O_RDWR),VIDIOCMCAPTURE,&vmm);
}
--------------

Quoted 2 lines

Daniel

Hi Daniel,
thanks for help, i have tried the code you have posted, but it does not works
or i have not understand you correctly, i have compiled the code, i have tried directly with /dev/video (like your example) or changing it with /dev/video0 (the video dev i am using), after compile it and execute it i launch the helix producer but still the same error.

webcontrol:~# gcc -o test_video test_video.c
test_video.c: In function 'main':
test_video.c:7: warning: return type of 'main' is not 'int'
webcontrol:~# ./test_video
webcontrol:~# producer -vc /dev/video0 -ad 128k -vp "0" -dt -vm sharp -o /tmp/test.rm
Helix DNA(TM) Producer 11.0 Build number: 11.0.0.2013
Info: Starting encode
Error: Could not set image size to 352x288 for color format I420 (15) (VIDIOCMCAPTURE: buffer 0)
Warning: Capture Buffer is empty at 455505251ms for last 61 times

do i am doing anything wrong?

Regards,
Miguel Angel.

--
video4linux-list mailing list
Unsubscribe mailto:[email protected]?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

#3 lore raw
Quoted 57 lines · Linos
Quoted 34 lines · Daniel Glöckner
Quoted 3 lines · Linos

Error: Could not set image size to 352x288 for color format I420 (15) (VIDIOCMCAPTURE: buffer 0)

The problem is that the v4l1-compat code for VIDIOCMCAPTURE calls VIDIOC_S_FMT. At the beginning of bttv_s_fmt_vid_cap the call to bttv_switch_type fails because the buffers have already been mmap'ed by the application. I'd say this is a bug in bttv.

In which case does the videobuf_queue_is_busy test prevent bad things from happening?

A workaround is to set the resolution and image format before the buffers are mapped, f.ex. with this small program:
--------------
#include <sys/ioctl.h>
#include <fcntl.h>
#include <unistd.h>
#include <linux/videodev.h>

void main()
{
struct video_mmap vmm;
vmm.height=352;
vmm.width=288; vmm.format=VIDEO_PALETTE_YUV420P; vmm.frame=0; ioctl(open("/dev/video",O_RDWR),VIDIOCMCAPTURE,&vmm);
}
--------------

Quoted 2 lines

Daniel

Hi Daniel,
thanks for help, i have tried the code you have posted, but it does
not works or i have not understand you correctly, i have compiled the code, i have tried directly with /dev/video (like your example) or changing it with /dev/video0 (the video dev i am using), after compile it and execute it i launch the helix producer but still the same error.

webcontrol:~# gcc -o test_video test_video.c
test_video.c: In function 'main':
test_video.c:7: warning: return type of 'main' is not 'int'
webcontrol:~# ./test_video
webcontrol:~# producer -vc /dev/video0 -ad 128k -vp "0" -dt -vm sharp -o
/tmp/test.rm
Helix DNA(TM) Producer 11.0 Build number: 11.0.0.2013
Info: Starting encode
Error: Could not set image size to 352x288 for color format I420 (15)
(VIDIOCMCAPTURE: buffer 0)
Warning: Capture Buffer is empty at 455505251ms for last 61 times
Quoted 5 lines

do i am doing anything wrong?

Regards,
Miguel Angel.

Miguel,

I believe the changes Daniel suggested would have to be applied to the source of helix producer in order to work. None the less, the proper fix would be to fix the associated bug in the driver which is the real cause of the problem.

Regards,

David Ellingsworth

--
video4linux-list mailing list
Unsubscribe mailto:[email protected]?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

#4 lore raw
Quoted 4 lines · David Ellingsworth
Quoted 3 lines · Linos
Quoted 2 lines · Daniel Glöckner

vmm.height=352;
vmm.width=288;

D'oh!
I swapped width and height..

Quoted 2 lines

I believe the changes Daniel suggested would have to be applied to the source of helix producer in order to work.

I didn't test helix producer, but with my simple test app and correct width and height it works.

Quoted 3 lines

None the less, the proper
fix would be to fix the associated bug in the driver which is the real cause of the problem.

Agreed

Daniel

--
video4linux-list mailing list
Unsubscribe mailto:[email protected]?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list

author
#5 lore raw
Quoted 15 lines · Daniel Glöckner
Quoted 4 lines · David Ellingsworth
Quoted 3 lines · Linos
Quoted 2 lines · Daniel Glöckner

vmm.height=352;
vmm.width=288;

D'oh!
I swapped width and height..

Quoted 2 lines

I believe the changes Daniel suggested would have to be applied to the source of helix producer in order to work.

I didn't test helix producer, but with my simple test app and correct width and height it works.

Quoted 8 lines
Quoted 3 lines

None the less, the proper
fix would be to fix the associated bug in the driver which is the real cause of the problem.

Agreed

Daniel

Yes now works, thanks Daniel, i should have try to read the source anyway, the name can not be clearer hehehe.

Regards,
Miguel Angel.

--
video4linux-list mailing list
Unsubscribe mailto:[email protected]?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list