Page 1 of 1

raspivid issues, against which repo to report?

Posted: Wed Nov 20, 2019 2:40 am
by HermannSW
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
$

Re: raspivid issues, against which repo to report?

Posted: Wed Nov 20, 2019 4:26 am
by tjlusco
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 ;)

Re: raspivid issues, against which repo to report?

Posted: Wed Nov 20, 2019 6:22 am
by jamesh
Userland repo.

Re: raspivid issues, against which repo to report?

Posted: Wed Nov 20, 2019 11:29 am
by 6by9
-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.