User avatar
HermannSW
Posts: 1651
Joined: Fri Jul 22, 2016 9:09 pm
Location: Eberbach, Germany
Contact: Website Twitter YouTube

raspivid issues, against which repo to report?

Wed Nov 20, 2019 2:40 am

Samples:

raspivid hangs indefinitely (v1 camera):

Code: Select all

$ time raspivid --mode 2 -w 320 -h 2400 -o tst.h264 -t 400

raspivid wrong exit code on error, 0 should be returned only for successful execution.

Correct:

Code: Select all

$ echo $((2/0))
-bash: 2/0: division by 0 (error token is "0")
$ echo $?
1
$ echo $((2/1))
2
$ echo $?
0
$ 
Wrong:

Code: Select all

$ raspivid --mode 2 -w 1714 -h 1285 -o tst.h264 -t 400
Too many macroblocks/s: Increasing H264 Level to 4.2
mmal: mmal_vc_port_enable: failed to enable port vc.ril.video_encode:in:0(OPQV): EINVAL
mmal: mmal_port_enable: failed to enable connected port (vc.ril.video_encode:in:0(OPQV))0x1d60d10 (EINVAL)
mmal: mmal_connection_enable: output port couldn't be enabled
mmal: main: Failed to connect camera video port to encoder input
mmal: Argument is invalid
mmal: Failed to run camera app. Please check for firmware updates

$ echo $?
0
$
⇨https://stamm-wilbrandt.de/en/Raspberry_camera.html

https://github.com/Hermann-SW/Raspberry_v1_camera_global_external_shutter
https://stamm-wilbrandt.de/github_repo_i420toh264
https://github.com/Hermann-SW/fork-raspiraw
https://twitter.com/HermannSW

tjlusco
Posts: 12
Joined: Sun Feb 12, 2017 3:32 am

Re: raspivid issues, against which repo to report?

Wed Nov 20, 2019 4:26 am

That would depend on whether your issue is
raspivid hangs indefinitely (v1 camera):
https://github.com/raspberrypi/firmware/issues

or
$ echo $?
0
For the latter, might I suggest making a pull request against https://github.com/raspberrypi/userland/pulls. adding the necessary modifications to return the correct code. This particular error is caused when connect ports fails https://github.com/raspberrypi/userland ... id.c#L2576.

Code: Select all

// Now connect the camera to the encoder
         status = connect_ports(camera_video_port, encoder_input_port, &state.encoder_connection);

         if (status != MMAL_SUCCESS)
         {
            state.encoder_connection = NULL;
            vcos_log_error("%s: Failed to connect camera video port to encoder input", __func__);
            
            // ADD RETURN CODE
            exit_code = EX_SOFTWARE;
            
            goto error;
         }
There are 10 other locations where "goto error" is used without setting "exit_code", so it could be useful to add these as well, especially the 5 "connect_ports" calls. I could see this as being useful for automated regression testing against firmware changes, but in reality most firmware bugs seem to be uncovered by people doing obscure things with MMAL such as 1000 FPS cameras, which aren't using raspivid ;)

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 24129
Joined: Sat Jul 30, 2011 7:41 pm

Re: raspivid issues, against which repo to report?

Wed Nov 20, 2019 6:22 am

Userland repo.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed. Here's an example...
“I think it’s wrong that only one company makes the game Monopoly.” – Steven Wright

6by9
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 7527
Joined: Wed Dec 04, 2013 11:27 am
Location: ZZ9 Plural Z Alpha, aka just outside Cambridge.

Re: raspivid issues, against which repo to report?

Wed Nov 20, 2019 11:29 am

-h 2400 is just invalid. The width and height both have a max of 1920.

As to return codes, not too bothered. Feel free to create a PR if it bothers you that much.
Software Engineer at Raspberry Pi Trading. Views expressed are still personal views.
I'm not interested in doing contracts for bespoke functionality - please don't ask.

Return to “Camera board”