Official V4L2 driver


493 posts   Page 14 of 20   1 ... 11, 12, 13, 14, 15, 16, 17 ... 20
by 6by9 » Tue May 27, 2014 12:56 pm
REGRESSION
My apologies, but I introduced accidentally a moderately serious regression with my latest change to the V4L2 driver that was released on Friday in commit c889591. This stops video encode working for resolutions above 720P. :oops:

I've pushed the patch to my development tree at https://github.com/6by9/linux, and the rebuilt kernel module is available at https://github.com/6by9/RPiTest/blob/ma ... 35-v4l2.ko (NB This kernel module will ONLY work against 3.12.20+, so rpi-update first).
I'm just looking to add a workaround for a Gstreamer bug, and will then make a pull request to Dom to get both picked up.

My apologies for this - it's always the trivial changes that couldn't possibly change anything that cause the major breakages.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
Please don't send PMs asking for support - use the forum.
I'm not interested in doing contracts for bespoke functionality - please don't ask.
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 4193
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.
by dom » Tue May 27, 2014 6:00 pm
6by9 wrote:I'm just looking to add a workaround for a Gstreamer bug, and will then make a pull request to Dom to get both picked up.


rpi-update firmware is updated with 6x9's fixes.
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5084
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge
by Miguel22 » Wed May 28, 2014 8:22 pm
Hello!

Is there anybody using latest v4l2 driver with PiNoir camera module and motion from official raspian respository? In my setup, motion restarts permanently:

May 28 20:19:44 picamera motion: [0] Processing thread 0 - config file /etc/motion/motion.conf
May 28 20:19:44 picamera motion: [0] Motion 3.2.12 Started
May 28 20:19:44 picamera motion: [0] Created process id file /var/run/motion/motion.pid. Process ID is 3422
May 28 20:19:44 picamera motion: [0] Motion running as daemon process
May 28 20:19:44 picamera motion: [0] ffmpeg LIBAVCODEC_BUILD 3482368 LIBAVFORMAT_BUILD 3478785
May 28 20:19:44 picamera motion: [0] Thread 1 is from /etc/motion/motion.conf
May 28 20:19:44 picamera motion: [1] cap.driver: "bm2835 mmal"
May 28 20:19:44 picamera motion: [1] cap.card: "mmal service 15.1"
May 28 20:19:44 picamera motion: [1] cap.bus_info: "platform:bcm2835-v4l2"
May 28 20:19:44 picamera motion: [1] cap.capabilities=0x85000005
May 28 20:19:44 picamera motion: [1] - VIDEO_CAPTURE
May 28 20:19:44 picamera motion: [1] - VIDEO_OVERLAY
May 28 20:19:44 picamera motion: [1] - READWRITE
May 28 20:19:44 picamera motion: [1] - STREAMING
May 28 20:19:44 picamera motion: [1] Test palette YU12 (1024x576)
May 28 20:19:44 picamera motion: [1] Using palette YU12 (1024x576) bytesperlines 1536 sizeimage 884736 colorspace 00000007
May 28 20:19:44 picamera motion: [1] found control 0x00980900, "Brightness", range 0,100
May 28 20:19:44 picamera motion: [1] #011"Brightness", default 50, current 50
May 28 20:19:44 picamera motion: [1] found control 0x00980901, "Contrast", range -100,100
May 28 20:19:44 picamera motion: [1] #011"Contrast", default 0, current 0
May 28 20:19:44 picamera motion: [1] found control 0x00980902, "Saturation", range -100,100
May 28 20:19:44 picamera motion: [1] #011"Saturation", default 0, current 0
May 28 20:19:44 picamera motion: [1] found control 0x0098090e, "Red Balance", range 1,7999
May 28 20:19:44 picamera motion: [1] #011"Red Balance", default 1000, current 1000
May 28 20:19:44 picamera motion: [1] found control 0x0098090f, "Blue Balance", range 1,7999
May 28 20:19:44 picamera motion: [1] #011"Blue Balance", default 1000, current 1000
May 28 20:19:44 picamera motion: [1] Resizing pre_capture buffer to 1 items
May 28 20:19:49 picamera motion: [1] Closing video device /dev/video0
May 28 20:19:51 picamera motion: [0] Motion thread 1 restart
May 28 20:19:51 picamera motion: [1] cap.driver: "bm2835 mmal"
May 28 20:19:51 picamera motion: [1] cap.card: "mmal service 15.1"
May 28 20:19:51 picamera motion: [1] cap.bus_info: "platform:bcm2835-v4l2"
May 28 20:19:51 picamera motion: [1] cap.capabilities=0x85000005
May 28 20:19:51 picamera motion: [1] - VIDEO_CAPTURE
May 28 20:19:51 picamera motion: [1] - VIDEO_OVERLAY
May 28 20:19:51 picamera motion: [1] - READWRITE
May 28 20:19:51 picamera motion: [1] - STREAMING
May 28 20:19:51 picamera motion: [1] Test palette YU12 (1024x576)
May 28 20:19:51 picamera motion: [1] Using palette YU12 (1024x576) bytesperlines 1536 sizeimage 884736 colorspace 00000007
May 28 20:19:51 picamera motion: [1] found control 0x00980900, "Brightness", range 0,100
May 28 20:19:51 picamera motion: [1] #011"Brightness", default 50, current 50
May 28 20:19:51 picamera motion: [1] found control 0x00980901, "Contrast", range -100,100
May 28 20:19:51 picamera motion: [1] #011"Contrast", default 0, current 0
May 28 20:19:51 picamera motion: [1] found control 0x00980902, "Saturation", range -100,100
May 28 20:19:51 picamera motion: [1] #011"Saturation", default 0, current 0
May 28 20:19:51 picamera motion: [1] found control 0x0098090e, "Red Balance", range 1,7999
May 28 20:19:51 picamera motion: [1] #011"Red Balance", default 1000, current 1000
May 28 20:19:51 picamera motion: [1] found control 0x0098090f, "Blue Balance", range 1,7999
May 28 20:19:51 picamera motion: [1] #011"Blue Balance", default 1000, current 1000
May 28 20:19:51 picamera motion: [1] Resizing pre_capture buffer to 1 items
May 28 20:20:12 picamera motion: [1] Closing video device /dev/video0
May 28 20:20:13 picamera motion: [0] Motion thread 1 restart
May 28 20:20:13 picamera motion: [1] cap.driver: "bm2835 mmal"
May 28 20:20:13 picamera motion: [1] cap.card: "mmal service 15.1"
May 28 20:20:13 picamera motion: [1] cap.bus_info: "platform:bcm2835-v4l2"
May 28 20:20:13 picamera motion: [1] cap.capabilities=0x85000005
May 28 20:20:13 picamera motion: [1] - VIDEO_CAPTURE
May 28 20:20:13 picamera motion: [1] - VIDEO_OVERLAY
May 28 20:20:13 picamera motion: [1] - READWRITE
May 28 20:20:13 picamera motion: [1] - STREAMING
May 28 20:20:13 picamera motion: [1] Test palette YU12 (1024x576)
May 28 20:20:13 picamera motion: [1] Using palette YU12 (1024x576) bytesperlines 1536 sizeimage 884736 colorspace 00000007
May 28 20:20:13 picamera motion: [1] found control 0x00980900, "Brightness", range 0,100
May 28 20:20:13 picamera motion: [1] #011"Brightness", default 50, current 50
May 28 20:20:13 picamera motion: [1] found control 0x00980901, "Contrast", range -100,100
May 28 20:20:13 picamera motion: [1] #011"Contrast", default 0, current 0
May 28 20:20:13 picamera motion: [1] found control 0x00980902, "Saturation", range -100,100
May 28 20:20:13 picamera motion: [1] #011"Saturation", default 0, current 0
May 28 20:20:13 picamera motion: [1] found control 0x0098090e, "Red Balance", range 1,7999
May 28 20:20:13 picamera motion: [1] #011"Red Balance", default 1000, current 1000
May 28 20:20:13 picamera motion: [1] found control 0x0098090f, "Blue Balance", range 1,7999
May 28 20:20:13 picamera motion: [1] #011"Blue Balance", default 1000, current 1000
May 28 20:20:13 picamera motion: [1] Resizing pre_capture buffer to 1 items
May 28 20:20:18 picamera motion: [1] Closing video device /dev/video0
May 28 20:20:20 picamera motion: [0] Motion thread 1 restart

Any help would be greatly appreciated...

Michal
Posts: 3
Joined: Wed May 28, 2014 8:15 pm
by kandrea » Sat Jun 14, 2014 10:48 pm
Thank you again for the support with this driver. I'm having deeper issues with OpenCV than I previously had realized and was wondering if anyone might have any insight on the interactions with this v4l2 driver.

Previously I mentioned modifying the VideoCapture constructor to allow for capture; this was due to the video device being locked into a busy state and reporting back as such on requests to change resolution within OpenCV.

My testing was originally done in standalone programs, which exited once finished with each capture run. The problem my users are facing is that they cannot ever release the camera device in the same process once VideoCapture has been executed. They've been using OpenCV functions in a dedicated thread, releasing it, closing the thread, then restarting it, but VideoCapture reports back with device busy and errors out.

My project is an autonomous robotic platform and being able to shutdown the capture device and later restart it is a high priority. Once VideoCapture executes once, the device locks into use and does not release until the entire process terminates.

lsmod:
Code: Select all
Module                  Size  Used by
bcm2835_v4l2           37611  1

On a capture.release(), I get:
Code: Select all
Unable to stop the stream.: Bad file descriptor


Attempting to restart with a new VideoCapture object yields:
Code: Select all
HIGHGUI ERROR: V4L2: Pixel format of incoming image is unsupported by OpenCV


I've set the LD_PRELOAD to v4l2convert.so, but doing so only adds in the following error:
Code: Select all
libv4l2: error setting pixformat: Device or resource busy


This is the v4l2 setup I've been using:
Code: Select all
sudo modprobe bcm2835-v4l2
v4l2-ctl --set-fmt-video=width=640,height=480,pixelformat=3
v4l2-ctl --set-ctrl horizontal_flip=1,vertical_flip=1
v4l2-ctl --set-ctrl white_balance_auto_preset=0


I've updated and upgraded apt and am at latest rpi-update on firmware.

Any insight into what may be locking this up would be greatly appreciated. I have no issues at tweaking any of their code to get around this; I simply have no background as to where to begin to investigate.

Thank you again for all of the support,
Kevin
Posts: 4
Joined: Mon May 19, 2014 10:07 pm
by BBUK » Sat Jun 21, 2014 3:36 pm
Hi there, great work on this driver. No real problems getting it working with Arch. I do, however, have a query and a request.

My application requires overlaying real-time video with text and graphics whilst processing the content of occasional image snapshots from the video stream. The output is to a low-res LCD (320x240).

I thought it would be handy to use the GPU preview/overlay facility for the real-time video but I could not get
Code: Select all
v4l2-ctl --set-fmt-overlay=
to work properly. Whatever I set for the top, left, width and height parameters resulted in no change to the driver defaults (50,150,1024,768) (confirmed by
Code: Select all
v4l2-ctl --get-fmt-overlay
. Now for my application I could easily solve the issue by just changing the driver defaults in bcm2835-camera.c but I was wondering whether anyone else is seeing this behaviour?

The second bit is related, I would like this driver to be able to configure the alpha for the preview overlay. I set the alpha at 128 manually in bcm2835-camera.c (from 255) and this is now perfect for my application as all text/graphics written to the Linux framebuffer is visible through the preview (so I now can see text from my application behind the preview which is VERY CPU efficient).

6by9, I had a look at your github on this and I could not immediately see the problem with --set-fmt-overlay. I can see what to do to make the alpha configurable and would be happy to implement the change (if you are accepting pull requests) BUT I think --set-fmt-overlay should be fixed first (unless someone can point me to user error).

Have fun

BBUK
Posts: 124
Joined: Tue Dec 18, 2012 10:34 am
by danger89 » Sat Jun 21, 2014 10:30 pm
For a good tutorial check-out this website:
http://www.linux-projects.org/modules/s ... e&artid=16

It worked for me.. :)
Posts: 6
Joined: Sat Jun 21, 2014 10:27 pm
by 6by9 » Sun Jun 22, 2014 11:19 am
BBUK wrote:I thought it would be handy to use the GPU preview/overlay facility for the real-time video but I could not get
Code: Select all
v4l2-ctl --set-fmt-overlay=
to work properly. Whatever I set for the top, left, width and height parameters resulted in no change to the driver defaults (50,150,1024,768) (confirmed by
Code: Select all
v4l2-ctl --get-fmt-overlay
. Now for my application I could easily solve the issue by just changing the driver defaults in bcm2835-camera.c but I was wondering whether anyone else is seeing this behaviour?

Not an area that had too much testing. Just looking at it, the issue would appear to be that vidioc_s_fmt_vid_overlay calls vidioc_try_fmt_vid_overlay, which has the lovely comment (at least it was commented!)
Code: Select all
/* Only support one format so get the current one. */

try_fmt_vid_overlay needs to do some basic sanity checking of settings but otherwise not manipulate the window values provided.

BBUK wrote:The second bit is related, I would like this driver to be able to configure the alpha for the preview overlay. I set the alpha at 128 manually in bcm2835-camera.c (from 255) and this is now perfect for my application as all text/graphics written to the Linux framebuffer is visible through the preview (so I now can see text from my application behind the preview which is VERY CPU efficient).

The parameters to vidioc_s_fmt_vid_overlay do appear to include a global_alpha parameter, which is a u8. Sounds perfect for feeding in to the alpha field of the display region (may need to do (255-x) first - need to read the detail again from http://hverkuil.home.xs4all.nl/spec/media.html)

BBUK wrote:6by9, I had a look at your github on this and I could not immediately see the problem with --set-fmt-overlay. I can see what to do to make the alpha configurable and would be happy to implement the change (if you are accepting pull requests) BUT I think --set-fmt-overlay should be fixed first (unless someone can point me to user error).

The main repo is the raspberrypi/linux one. My github is only to make life easy in producing PRs to popcornmix (dom), rather than me emailing him patches.
If you make a change and PR it to there, then popcornmix normally asks me to check it, but otherwise is very open to PRs. I'm all for others helping out and implementing extra features (as long as they are to the V4L2 spec), as my time on this is quite limited at the moment.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
Please don't send PMs asking for support - use the forum.
I'm not interested in doing contracts for bespoke functionality - please don't ask.
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 4193
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.
by 6by9 » Mon Jun 23, 2014 1:12 pm
danger89 wrote:For a good tutorial check-out this website:
http://www.linux-projects.org/modules/s ... e&artid=16

It worked for me.. :)

Please note that that article is written around the UV4L2 driver written by RpiName, and NOT the V4L2 driver written and maintained by the Foundation (which is the subject of this thread).

All of the v4l2-ctl lines should also work against the V4L2 driver, but any of the lines starting uv4l2 are not applicable - they're command line options to that driver.

I won't go into the differences between the two, except to say that the Foundation (and hence the Broadcom engineers who lurk on these forums) are not responsible for the UV4L2 driver in any way shape or form. It is closed source, so we can't support it even if we wanted to.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
Please don't send PMs asking for support - use the forum.
I'm not interested in doing contracts for bespoke functionality - please don't ask.
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 4193
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.
by mike632t » Wed Aug 20, 2014 11:31 pm
First thanks for all the great work in producing an official V4L driver for the Pi. Using the latest formware and kernel ('rpi-update; apt-get update; apt-get upgrade') I had no trouble in getting it to work.

Previously I have had no issues when using 'motion' with a USB webcam and have had it running for days with no problem (apart from running out of disk space!), but unfortunatly when I replaced the USB webcam with the Raspberry Pi Camera and loaded the 'bcm2835-v4l2' kernel module in '/etc/rc.local' using 'modprobe bcm2835-v4l2' I found that the whole machine locks up solid after between 5 minutes and about two hours, with no clues as to why on the console or in output 'motion' itself.

I'm using the same settings in 'motion.conf' with both cameras, so I don't think the problem is with 'motion' and was was wondering if there is any way to get the 'bcm2835-v4l2' kernel module to print some extra diagnostic information on the console as I'm reasonably that the problem lies with the pi camera hardware or possibly the 'bcm2835-v4l2' module itself.

I've configured 'motion' to capture one frame every 4 seconds at 1280x720. I have tried changing the resolution up and down but it makes very little difference.

Thanks.

Mike T.
User avatar
Posts: 66
Joined: Sat May 19, 2012 7:56 pm
Location: UK
by ahoeben » Thu Aug 21, 2014 11:50 am
Is it possible to set a ROI for the V4L2 (eg using a v4l2-cfg control)?
Posts: 7
Joined: Mon Jan 21, 2013 10:41 am
by 6by9 » Thu Aug 21, 2014 12:40 pm
ahoeben wrote:Is it possible to set a ROI for the V4L2 (eg using a v4l2-cfg control)?

Not yet. It's been on the list for a while but not got done yet.

Please note the content of viewtopic.php?f=43&t=83353 first post.
As the firmware already support ROIs, and the V4L2 driver is in the kernel, it doesn't have to be done before the deadline. That means it will wait a bit longer and I might have a play come d-day. Or anyone in the community is welcome to do it ;)
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
Please don't send PMs asking for support - use the forum.
I'm not interested in doing contracts for bespoke functionality - please don't ask.
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 4193
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.
by ahoeben » Thu Aug 21, 2014 1:12 pm
Rats, I missed all that. Thanks for the prompt reply (and the glimmer of hope)
Posts: 7
Joined: Mon Jan 21, 2013 10:41 am
by sej7278 » Thu Oct 30, 2014 6:27 pm
where are we at regarding streaming - do we have a way to stream h264 to a html5 browser yet, perhaps using ffmpeg or gstreamer? i'm not interested in mjpeg.

all the tutorials seem to be for the old raspivid or uv4l2 implementations, is nobody using the official v4l2 driver?
Posts: 243
Joined: Tue Jan 22, 2013 6:43 pm
by War_Archer » Mon Dec 08, 2014 5:28 am
I'm following the tutorial on the first page of this post. However, when I try to make, I get the following error. I have searched on the internet but could not find anything.

Code: Select all
make[3]: Entering directory '/home/pi/v4l-utils/utils/v4l2-compliance'
  CXX    v4l2-test-input-output.o
v4l2-test-input-output.cpp: In function ‘int checkInput(node*, const v4l2_input&, unsigned int)’:
v4l2-test-input-output.cpp:368:3: error: expected primary-expression before ‘.’ token
v4l2-test-input-output.cpp:369:3: error: expected primary-expression before ‘.’ token
v4l2-test-input-output.cpp: In function ‘int checkOutput(node*, const v4l2_output&, unsigned int)’:
v4l2-test-input-output.cpp:733:3: error: expected primary-expression before ‘.’ token
v4l2-test-input-output.cpp:734:3: error: expected primary-expression before ‘.’ token
Makefile:438: recipe for target 'v4l2-test-input-output.o' failed
make[3]: *** [v4l2-test-input-output.o] Error 1
make[3]: Leaving directory '/home/pi/v4l-utils/utils/v4l2-compliance'
Makefile:373: recipe for target 'all-recursive' failed
make[2]: *** [all-recursive] Error 1
make[2]: Leaving directory '/home/pi/v4l-utils/utils'
Makefile:470: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/pi/v4l-utils'
Makefile:398: recipe for target 'all' failed
make: *** [all] Error 2
Posts: 7
Joined: Thu Aug 21, 2014 2:51 pm
by 6by9 » Mon Dec 08, 2014 8:24 am
War_Archer wrote:I'm following the tutorial on the first page of this post. However, when I try to make, I get the following error. I have searched on the internet but could not find anything.

There's no need now to manually rebuild v4l2-ctl as the version shipped with Raspbian is sufficiently up to date(*). You just need the "sudo modprobe bcm2835-v4l2" line to load the driver, and then should be able to do any v4l2-ctl commands that you fancy.
I'll nudge Dom to edit that post.

(*) You may need to do a "sudo apt-get install v4l2-utils" if it can't find the command v4l2-ctl, but I think it is preloaded.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
Please don't send PMs asking for support - use the forum.
I'm not interested in doing contracts for bespoke functionality - please don't ask.
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 4193
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.
by dom » Mon Dec 08, 2014 12:32 pm
6by9 wrote:There's no need now to manually rebuild v4l2-ctl as the version shipped with Raspbian is sufficiently up to date(*). You just need the "sudo modprobe bcm2835-v4l2" line to load the driver, and then should be able to do any v4l2-ctl commands that you fancy.
I'll nudge Dom to edit that post.

I'll consider myself nudged. I've added a line indicating that rpi-update and building the v4l2 utils is not required with a recent raspbian image.
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 5084
Joined: Wed Aug 17, 2011 7:41 pm
Location: Cambridge
by ghans » Mon Dec 08, 2014 12:42 pm
Can you make it in bold/huge please ?

ghans
• Don't like the board ? Missing features ? Change to the prosilver theme ! You can find it in your settings.
• Don't like to search the forum BEFORE posting 'cos it's useless ? Try googling : yoursearchtermshere site:raspberrypi.org
Posts: 7275
Joined: Mon Dec 12, 2011 8:30 pm
Location: Germany
by 6by9 » Mon Dec 08, 2014 2:51 pm
dom wrote:I'll consider myself nudged. I've added a line indicating that rpi-update and building the v4l2 utils is not required with a recent raspbian image.

Thanks Dom :) I didn't know if you were watching this thread/forum closely still, and it wasn't the highest job on my list this morning.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
Please don't send PMs asking for support - use the forum.
I'm not interested in doing contracts for bespoke functionality - please don't ask.
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 4193
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.
by Forzaferrarileo » Wed Dec 24, 2014 4:18 pm
Hi all , I'm trying to load the module with
Code: Select all
sudo modprobe bcm2835-v4l2

but it reports
Code: Select all
ERROR: could not insert 'bcm2835_v4l2': Operation not permitted
.

I updated raspbian with apt-get update , upgrade , dist-upgrade , and rpi-update , but the error is still here.

lsmod log :
Code: Select all
Module                  Size  Used by
videobuf2_vmalloc       2926  0
videobuf2_memops        2099  1 videobuf2_vmalloc
videobuf2_core         31320  0
v4l2_common             7801  0
videodev              121196  2 v4l2_common,videobuf2_core
media                  14559  1 videodev
i2c_dev                 5769  0
snd_bcm2835            19496  0
snd_soc_tas5713         5573  0
snd_soc_wm8804          7932  0
snd_soc_pcm512x         9034  0
snd_soc_bcm2708_i2s     6210  0
regmap_mmio             2818  1 snd_soc_bcm2708_i2s
snd_soc_core          128465  4 snd_soc_pcm512x,snd_soc_wm8804,snd_soc_tas5713,snd_soc_bcm2708_i2s
snd_compress            8259  1 snd_soc_core
regmap_i2c              1661  4 snd_soc_pcm512x,snd_soc_wm8804,snd_soc_core,snd_soc_tas5713
snd_pcm_dmaengine       5505  1 snd_soc_core
regmap_spi              1913  3 snd_soc_pcm512x,snd_soc_wm8804,snd_soc_core
snd_pcm                83845  3 snd_bcm2835,snd_soc_core,snd_pcm_dmaengine
snd_page_alloc          5132  1 snd_pcm
snd_seq                55484  0
snd_seq_device          6469  1 snd_seq
snd_timer              20998  2 snd_pcm,snd_seq
leds_gpio               2079  0
led_class               4118  1 leds_gpio
snd                    62252  7 snd_bcm2835,snd_soc_core,snd_timer,snd_pcm,snd_seq,snd_seq_device,snd_compress
i2c_bcm2708             4943  0
spi_bcm2708             4964  0
Posts: 12
Joined: Sun Sep 22, 2013 8:36 am
by DirkS » Wed Dec 24, 2014 4:50 pm
See viewtopic.php?t=62364&p=475441#p475278
Could be that your camera is not configured or there is something wrong with the connections.

What does 'vcgencmd get_camera' report?

Gr.
Dirk.
Posts: 7124
Joined: Tue Jun 19, 2012 9:46 pm
Location: Essex, UK
by Forzaferrarileo » Sat Dec 27, 2014 1:26 pm
The problem was the flat cable :roll: . Ty
Posts: 12
Joined: Sun Sep 22, 2013 8:36 am
by jhb » Mon Feb 16, 2015 7:28 pm
Hello,

thank you first of all for the v4l2 driver and all the work you put into it! :-)

I use it on raspbian with a current build of motion.
It works very well except for a brightness / auto-exposure issue:
When running motion the picam stops at a point in time to do correct auto exposure, which results in over/underexposed video.
The exposure setting seems to lock up.

Here is a thread of people experiencing the same problem:
https://github.com/ccrisan/motionPie/issues/20
(They are using the motionPie image, but my problem is exactly the same on raspbian.)
Some have resorted to using a special MMAL build of motion in stills mode to avoid the problem ( https://github.com/ccrisan/motionPie/issues/69 ), but I would like to stick to the v4l2 driver.

As for me, motion is configured to leave the brightness adjustments to the camera.
However when I restart motion, the exposure is (temporarily) correct again, until the next auto-exposure lockup.
I am suspecting a problem within the v4l2 driver.

I hope you can help.

My settings for the v4l2 driver are:

1296 x 960 (set in motion.conf)

and
v4l2-ctl --set-ctrl=exposure_dynamic_framerate=1
v4l2-ctl --set-ctrl=scene_mode=8
v4l2-ctl -p 16

(which I set from an @reboot cronjob before starting motion)

I'm ready to do some more testing, if you let me know where to start.

Cheers Henry
Posts: 2
Joined: Mon Feb 16, 2015 6:59 pm
by 6by9 » Mon Feb 16, 2015 8:46 pm
jhb wrote:Hello,

thank you first of all for the v4l2 driver and all the work you put into it! :-)

I use it on raspbian with a current build of motion.
It works very well except for a brightness / auto-exposure issue:
When running motion the picam stops at a point in time to do correct auto exposure, which results in over/underexposed video.
The exposure setting seems to lock up.

<snip>

viewtopic.php?f=43&t=77581&p=552873#p553628

Use
Code: Select all
sudo modprobe bcm2835-v4l2 max_video_width=2592 max_video_height=1944

or similar when loading the V4L2 driver.
The default switch point between the stills and video point is 1280x720 and you're above that. There is a known issue where capturing successive stills all have the exposure fixed - it's on my list of things to look at.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
Please don't send PMs asking for support - use the forum.
I'm not interested in doing contracts for bespoke functionality - please don't ask.
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 4193
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.
by jhb » Wed Feb 18, 2015 12:34 pm
Thank you very much!

Seems to run perfectly now. :-)
Posts: 2
Joined: Mon Feb 16, 2015 6:59 pm
by SandroM » Mon Mar 30, 2015 8:26 am
Hi,
I am making some tests with the camera if it’s possible to use it in a commercial application. Therefore it is necessary to use constant light and camera settings. For my tests I have disabled white_balance_auto_present, set the auto_exposure to manual and set the scene_mode to none.
Now when I change the shutter value, especially setting it to 0 and then increasing it, I get an almost white image with a lot of noise.
In the net I have found a spec of the image sensor. I have seen that the chip has an auto gain control and a night mode. I think that these features are making me problems.
I have tried to disable these features by setting the chip registers but it didn’t work. I had a look in the source of the V4L2 driver and it seems that the feature, to set a chip register, is not implemented. When I am wrong please correct me.
So is it possible to disable the auto gain control and night mode?
Cheers,
SandroM
Posts: 3
Joined: Fri Mar 27, 2015 8:48 am