Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No output from MMAL #126

Closed
Ironboltx opened this issue May 31, 2020 · 9 comments
Closed

No output from MMAL #126

Ironboltx opened this issue May 31, 2020 · 9 comments
Labels
not a bug This doesn't seem right

Comments

@Ironboltx
Copy link

Describe The Bug: When I try viewing a camera, the log starts spamming with
[5/30/2020, 9:44:48 PM] [SimpliSafe] [h264_mmal @ 0x3bb7de0] Did not get output frame from MMAL.
Error while decoding stream #0:0: Unknown error occurred

To Reproduce: View a camera on simplisafe and have debug mode enabled.

Expected behavior: I can view the camera

Logs:

[5/30/2020, 9:44:48 PM] [SimpliSafe] [h264_mmal @ 0x3bb7de0] Did not get output frame from MMAL.
Error while decoding stream #0:0: Unknown error occurred


Homebridge Config:

        {
            "name": "SimpliSafe",
            "auth": {
                "username": "******@******.net",
                "password": "*************************"
            },
            "cameras": true,
            "debug": true,
            "sensorRefresh": 1,
            "persistAccessories": false,
            "resetSimpliSafeId": false,
            "cameraOptions": {
                "enableHwaccelRpi": true
            },
            "platform": "homebridge-simplisafe3.SimpliSafe 3"
        },

Screenshots:

Environment:

  • Plugin version:
  • Node.js Version: v10.20.1
  • NPM Version: v6.14.4
  • Homebridge Version: v1.1.0
  • Operating System: Rasbian

Extra: I am using a pi 4 with 8 gigs of ram

@Ironboltx Ironboltx added the bug Something isn't working label May 31, 2020
@shamoon
Copy link
Collaborator

shamoon commented May 31, 2020

@Ironboltx Can you please include the entire log output and make sure you have homebridge debug enabled, there should be a lot more than that which would be helpful.

@Ironboltx
Copy link
Author

Ironboltx commented May 31, 2020

Hi @nikonratm. This is the log.

[5/30/2020, 11:45:33 PM] [SimpliSafe] Input #0, flv, from 'https://redacted/v1/bfb497772e6287009b993a9ec01d549c/flv?x=1280':
  Duration: N/A, start: 0.000000, bitrate: N/A

[5/30/2020, 11:45:33 PM] [SimpliSafe]     Stream #0:0: Video: h264 (Main), yuvj420p(pc, bt709, progressive), 1280x720 [SAR 1:1 DAR 16:9], 20 fps, 15 tbr, 1k tbn, 40 tbc
    Stream #0:1: Audio: speex, 16000 Hz, mono, s16, 13 kb/s

[5/30/2020, 11:45:33 PM] [SimpliSafe] Stream mapping:
  Stream #0:0 -> #0:0 (h264 (h264_mmal) -> h264 (h264_omx))
  Stream #0:1 -> #1:0 (speex (libspeex) -> opus (libopus))
Press [q] to stop, [?] for help

[5/30/2020, 11:45:33 PM] [SimpliSafe] Output #1, rtp, to 'srtp://redacted:58127?rtcpport=58127&localrtcpport=58127&pkt_size=1316':
  Metadata:
    encoder         : Lavf58.29.100
    Stream #1:0: Audio: opus (libopus), 16000 Hz, mono, flt, 24 kb/s
    Metadata:
      encoder         : Lavc58.54.100 libopus

[5/30/2020, 11:45:33 PM] [SimpliSafe] [h264_mmal @ 0x3c55270] MMAL error 9 on control port

[5/30/2020, 11:45:34 PM] [SimpliSafe] frame=    0 fps=0.0 q=0.0 size=       0kB time=00:00:00.62 bitrate=   0.0kbits/s speed=1.24x    
[5/30/2020, 11:45:34 PM] [SimpliSafe] frame=    0 fps=0.0 q=0.0 size=       0kB time=00:00:01.12 bitrate=   0.0kbits/s speed=1.12x    
[5/30/2020, 11:45:34 PM] [SimpliSafe] [h264_mmal @ 0x3c55270] Did not get output frame from MMAL.
Error while decoding stream #0:0: Unknown error occurred

@shamoon
Copy link
Collaborator

shamoon commented May 31, 2020

Hey sorry but there should also be some lines before this, everything from the “prepare stream with request...”

Those are weird errors have you tried re-installing?

@Ironboltx
Copy link
Author

Ironboltx commented May 31, 2020

Sorry for the late response. Here is the log from prepare stream with request.

[5/31/2020, 11:09:27 AM] [SimpliSafe] Prepare stream with request: {
  sessionID: 'redacted',
  targetAddress: 'redacted',
  addressVersion: 'ipv4',
  video: {
    port: redacted,
    srtpCryptoSuite: 0,
    srtp_key: redacted,
    srtp_salt: redacted
  },
  audio: {
    port: redacted,
    srtpCryptoSuite: redacted,
    srtp_key: redacted
    srtp_salt: redacted
  }
}
[5/31/2020, 11:09:27 AM] [SimpliSafe] Start streaming video for camera 'Central View'
[5/31/2020, 11:09:27 AM] [SimpliSafe] /usr/lib/node_modules/homebridge-simplisafe3/node_modules/ffmpeg-for-homebridge/ffmpeg -re -headers Authorization: Bearer gdcXe/PUCZaFGbUALeSvb9ZumUz5ntgLYvOlHLwgmDg= -vcodec h264_mmal -i https://redacted/v1/redacted/flv?x=redacted -map 0:0 -vcodec h264_omx -pix_fmt yuv420p -r 20 -f rawvideo -vf scale=1280:-2 -b:v 284k -bufsize 568k -maxrate 284k -payload_type 99 -ssrc 1569358 -f rtp -srtp_out_suite AES_CM_128_HMAC_SHA1_80 -srtp_out_params 9UqqdwMEm155hm1p7h+f597gumeLoyJAYx40qrGT srtp://redacted:redacted?rtcpport=63461&localrtcpport=63461&pkt_size=1316 -map 0:1 -acodec libopus -flags +global_header -ac 1 -filter:a volume=20.0 -ar 16k -b:a 24k -bufsize 48k -payload_type 110 -ssrc 2469709 -f rtp -srtp_out_suite AES_CM_128_HMAC_SHA1_80 -srtp_out_params XNV2RFwUo7PewEjGrJoj0QVQ1Y06nYtfa/s9pWVm redacted://redacted:redacted?rtcpport=56182&localrtcpport=56182&pkt_size=1316
[5/31/2020, 11:09:27 AM] [SimpliSafe] FFMPEG received first frame
[5/31/2020, 11:09:27 AM] [SimpliSafe] ffmpeg version 4.2.2-d1e8be3
[5/31/2020, 11:09:27 AM] [SimpliSafe]  Copyright (c) 2000-2019 the FFmpeg developers
  built with gcc 6.3.0 (Raspbian 6.3.0-18+rpi1+deb9u1) 20170516
  configuration: --pkgconfigdir=/build/workspace/lib/pkgconfig --prefix=/build/workspace --pkg-config-flags=--static --extra-cflags=-I/build/workspace/include --extra-ldflags=-L/build/workspace/lib --extra-libs='-lpthread -lm' --enable-static --disable-debug --disable-shared --disable-ffplay --disable-doc --enable-openssl --enable-gpl --enable-version3 --enable-nonfree --enable-pthreads --enable-libvpx --enable-libmp3lame --enable-libopus --enable-libtheora --enable-libvorbis --enable-libx264 --enable-runtime-cpudetect --enable-libfdk-aac --enable-avfilter --enable-libopencore_amrwb --enable-libopencore_amrnb --enable-filters --enable-decoder=h264 --enable-network --enable-protocol=tcp --enable-libspeex --enable-demuxer=rtsp --enable-omx-rpi --enable-mmal --enable-indev=alsa --enable-outdev=alsa

[5/31/2020, 11:09:27 AM] [SimpliSafe]   libavutil      56. 31.100 / 56. 31.100
  libavcodec     58. 54.100 / 58. 54.100
  libavformat    58. 29.100 / 58. 29.100
  libavdevice    58.  8.100 / 58.  8.100
  libavfilter     7. 57.100 /  7. 57.100
  libswscale      5.  5.100 /  5.  5.100

[5/31/2020, 11:09:27 AM] [SimpliSafe]   libswresample   3.  5.100 /  3.  5.100
  libpostproc    55.  5.100 / 55.  5.100

[5/31/2020, 11:09:27 AM] [SimpliSafe] [https @ 0x3263af0] No trailing CRLF found in HTTP header. Adding it.

[5/31/2020, 11:09:31 AM] [SimpliSafe] Input #0, flv, from 'https://redacted/v1/redacted/flv?x=1280':
  Duration: N/A, start: 0.000000, bitrate: N/A

[5/31/2020, 11:09:31 AM] [SimpliSafe]     Stream #0:0: Video: h264 (Main), yuvj420p(pc, bt709, progressive), 1280x720 [SAR 1:1 DAR 16:9], 20 fps, 20 tbr, 1k tbn, 40 tbc
    Stream #0:1: Audio: speex, 16000 Hz, mono, s16, 17 kb/s

[5/31/2020, 11:09:31 AM] [SimpliSafe] Stream mapping:
  Stream #0:0 -> #0:0 (h264 (h264_mmal) -> h264 (h264_omx))
  Stream #0:1 -> #1:0 (speex (libspeex) -> opus (libopus))
Press [q] to stop, [?] for help

[5/31/2020, 11:09:31 AM] [SimpliSafe] [h264_mmal @ 0x3275de0] MMAL error 9 on control port

[5/31/2020, 11:09:31 AM] [SimpliSafe] Output #1, rtp, to 'redacted://redacted:redacted?rtcpport=56182&localrtcpport=56182&pkt_size=1316':
  Metadata:
    encoder         : Lavf58.29.100

[5/31/2020, 11:09:31 AM] [SimpliSafe]     Stream #1:0: Audio: opus (libopus), 16000 Hz, mono, flt, 24 kb/s
    Metadata:
      encoder         : Lavc58.54.100 libopus

[5/31/2020, 11:09:32 AM] [SimpliSafe] frame=    0 fps=0.0 q=0.0 size=       0kB time=00:00:00.62 bitrate=   0.0kbits/s speed=1.25x    
[5/31/2020, 11:09:32 AM] [SimpliSafe] [h264_mmal @ 0x3275de0] Did not get output frame from MMAL.
Error while decoding stream #0:0: Unknown error occurred

I have not tried re-installing. Should I try?

@shamoon shamoon added not a bug This doesn't seem right and removed bug Something isn't working labels May 31, 2020
@shamoon
Copy link
Collaborator

shamoon commented May 31, 2020

So I dug out my RPi to test this and can confirm that it works. The error you got is weird enough that it makes me wonder if there was either an error installing the plugin or maybe even if your RPi SD card is experiencing file corruption or something pretty unexpected. I would try re-installing the plugin to start. Does it work if you disable hardware encoding?

The only other thing is I have a Pi 3b not a 4 but im not aware of any issue between these. The ffmpeg build we use now comes from https://github.com/homebridge/ffmpeg-for-homebridge so if there really is an issue with the build we may have to raise there.

@Ironboltx
Copy link
Author

I re-installed homebridge simplisafe and restarted homebridge but I still got the same error. I am now going to try to do it without hardware acceleration.

@Ironboltx
Copy link
Author

I turned off hardware acceleration and it works now. Will there be any way for me to use it with hardware acceleration?

@shamoon
Copy link
Collaborator

shamoon commented Jun 1, 2020

Again, this seems to work just fine for me and Im not aware of any issues like this but I can ask. Im not sure if anyone else out there has a RPi4 to check with. Unfortunately if that device isnt supported by ffmpeg-for-homebridge then obviously it wont work here. As for your options:

  1. Google around with this specific bug. Im not sure if theres something specific to your setup causing this but other things I found include: [h264_mmal @ 0xa882cba0] MMAL error 2 on control port CESNET/UltraGrid#33 (comment) . And actually some things seem to suggest there is an issue with the RPi4 but cant confirm this. https://raspberrypi.stackexchange.com/questions/108613/rpi-4-ffmpeg-how-to-get-hardware-h-264-decoding-to-work https://www.raspberrypi.org/forums/viewtopic.php?t=245761
  2. Try to compile your own ffmpeg build, I know you had trouble with this before
  3. Use without hardware acceleration
  4. Get a RPi 3b =)

@shamoon shamoon added unconfirmed Issue has not been verified bug Something isn't working and removed not a bug This doesn't seem right labels Jun 1, 2020
@Ironboltx
Copy link
Author

Issue solved! I had to give some more memory to the gpu. I originally had 64 gigabytes reserved for the gpu. Now I gave it 256 gigabytes and it works awesomely (if that is a word). Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
not a bug This doesn't seem right
Projects
None yet
Development

No branches or pull requests

2 participants