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

Fix for RTSP functionality on 4.36.2.5 #37

Closed
virmaior opened this issue May 14, 2022 · 23 comments
Closed

Fix for RTSP functionality on 4.36.2.5 #37

virmaior opened this issue May 14, 2022 · 23 comments

Comments

@virmaior
Copy link
Contributor

virmaior commented May 14, 2022

wz_mini'd 4.36.2.5 running over USB direct.
with

  • RTSP_ENABLED=true
  • RTSP_ENABLE_AUDIO=true

in run_mmc.log, I'm getting:

VIDIOC_REQBUFS: Inappropriate ioctl for device
VIDIOC_STREAMOFF: Inappropriate ioctl for device
VIDIOC_REQBUFS: Inappropriate ioctl for device

and no video

if I do

  • RTSP_ENABLED=true
  • RTSP_ENABLE_AUDIO=false

the same error message and no RTSP

ffmpeg output for video only:

ffmpeg version a4e1dd6 Copyright (c) 2000-2021 the FFmpeg developers
built with gcc 8 (Raspbian 8.3.0-6+rpi1)
configuration: --extra-cflags=-I/usr/local/include --extra-ldflags=-L/usr/local/lib --extra-libs='-lpthread -lm -latomic' --arch=armel --enable-gmp --enable-gpl --enable-libaom --enable-libass --enable-libdav1d --enable-libdrm --enable-libfdk-aac --enable-libfreetype --enable-libkvazaar --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopus --enable-librtmp --enable-libsnappy --enable-libsoxr --enable-libssh --enable-libvorbis --enable-libvpx --enable-libzimg --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-mmal --enable-nonfree --enable-omx --enable-omx-rpi --enable-version3 --target-os=linux --enable-pthreads --enable-openssl --enable-hardcoded-tables
libavutil 56. 70.100 / 56. 70.100
libavcodec 58.134.100 / 58.134.100
libavformat 58. 76.100 / 58. 76.100
libavdevice 58. 13.100 / 58. 13.100
libavfilter 7.110.100 / 7.110.100
libswscale 5. 9.100 / 5. 9.100
libswresample 3. 9.100 / 3. 9.100
libpostproc 55. 9.100 / 55. 9.100
[tcp @ 0x1f91ce0] Connection to tcp://192.168.5.103:8554?timeout=0 failed: Connection refused
rtsp://admin:test@192.168.5.103:8554/unicast: Connection refused

ffmpeg output for video+audio:

ffmpeg version a4e1dd6 Copyright (c) 2000-2021 the FFmpeg developers
built with gcc 8 (Raspbian 8.3.0-6+rpi1)
configuration: --extra-cflags=-I/usr/local/include --extra-ldflags=-L/usr/local/lib --extra-libs='-lpthread -lm -latomic' --arch=armel --enable-gmp --enable-gpl --enable-libaom --enable-libass --enable-libdav1d --enable-libdrm --enable-libfdk-aac --enable-libfreetype --enable-libkvazaar --enable-libmp3lame --enable-libopencore-amrnb --enable-libopencore-amrwb --enable-libopus --enable-librtmp --enable-libsnappy --enable-libsoxr --enable-libssh --enable-libvorbis --enable-libvpx --enable-libzimg --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxml2 --enable-mmal --enable-nonfree --enable-omx --enable-omx-rpi --enable-version3 --target-os=linux --enable-pthreads --enable-openssl --enable-hardcoded-tables
libavutil 56. 70.100 / 56. 70.100
libavcodec 58.134.100 / 58.134.100
libavformat 58. 76.100 / 58. 76.100
libavdevice 58. 13.100 / 58. 13.100
libavfilter 7.110.100 / 7.110.100
libswscale 5. 9.100 / 5. 9.100
libswresample 3. 9.100 / 3. 9.100
libpostproc 55. 9.100 / 55. 9.100
[udp @ 0x33bf7d0] attempted to set receive buffer to size 393216 but it only ended up set as 360448
[udp @ 0x33cfb10] attempted to set receive buffer to size 393216 but it only ended up set as 360448
Guessed Channel Layout for Input Stream #0.0 : mono
Input #0, rtsp, from 'rtsp://admin:test@192.168.5.103:8554/unicast':
Metadata:
title : LIVE555 Streaming Media v2022.04.15
comment : LIVE555 Streaming Media v2022.04.15
Duration: N/A, start: 0.000000, bitrate: 705 kb/s
Stream #0:0: Audio: pcm_s16be, 44100 Hz, mono, s16, 705 kb/s

=only an audio feed.

Do I need to upgrade the base version of the firmware or is something else busted?

@gtxaspec
Copy link
Owner

gtxaspec commented May 14, 2022

if you type cmd video on do you get any output over ssh?

@virmaior
Copy link
Contributor Author

I just gave that a shot and no effect.
after that went ahead and tried
cmd video off
and then
cmd video on
and then checking for good measure.

output remains as is

  • audio there if audio on (though to be honest I haven't checked the sound itself)
  • nothing at all if just rtsp enabled

@gtxaspec
Copy link
Owner

gtxaspec commented May 14, 2022

can you do
logread | grep inject
and
logread | grep callback

to get the best logs try this within a short time after boot.

@virmaior

This comment was marked as outdated.

@gtxaspec
Copy link
Owner

gtxaspec commented May 14, 2022

strange, i never tested with that firmware version. i would recommend upgrading to at least 4.36.3.19, if not the latest. They have improved the software by a lot.

i will do more research on that older version later

@virmaior
Copy link
Contributor Author

I will probably upgrade them soon ... but for right now, I'm just glad to have it running without wifi.

Just got the app running again on that camera. will test it against the cron jobs I've got set up for tonight and then move the other cameras to wz_mini

it's amazing how much easier it is to use them via SSH than telnet

@gtxaspec
Copy link
Owner

ssh = good :)

@gtxaspec
Copy link
Owner

gtxaspec commented May 14, 2022

can you share the output of ps w with rtsp on?

@virmaior

This comment was marked as resolved.

@gtxaspec
Copy link
Owner

it's possible that the old version of wyzehacks running is interfering, because the iCamera executable is not running the way it should... you should have 262 root 1h11 /opt/wz_mini/tmp/.storage/iCamera in there too. Are you using the recent version of wz_mini?

@virmaior
Copy link
Contributor Author

I'm using the version 2022-05-12 of wz_mini

maybe it is wyzehacks that is the problem ...

or maybe it's the firmware version

ps | grep iCamera
  232 root      0:00 dmon --stderr-redir --max-respawns 0 --environ LD_PRELOAD=libsetunbuf.so /system/bin/iCamera -- dslog --priority DEBUG --facility USER iCamera
  236 root     11:03 /system/bin/iCamera
  237 root      0:00 dslog --priority DEBUG --facility USER iCamera
 3714 root      0:00 grep iCamera

@gtxaspec
Copy link
Owner

i dont have that FW version and its no longer posted, do you still have the demo.bin?

@virmaior
Copy link
Contributor Author

@gtxaspec
Copy link
Owner

ok flashing now to test

@gtxaspec
Copy link
Owner

can you cat /opt/wz_mini/tmp/.storage/rcS and share it?

@virmaior
Copy link
Contributor Author

virmaior commented May 14, 2022

#!/bin/sh

# Set mdev
echo /sbin/mdev > /proc/sys/kernel/hotplug
/sbin/mdev -s && echo "mdev is ok......"

echo " __________________________________
|                                  |
|                                  |
|                                  |
|                                  |
| _   _             _           _  |
|| | | |_   _  __ _| |     __ _(_) |
|| |_| | | | |/ _| | |  _ / _| | | |
||  _  | |_| | (_| | |_| | (_| | | |
||_| |_|\__,_|\__,_|_____|\__,_|_| |
|                                  |
|                                  |
|_____2020_WYZE_CAM_V3_@HUALAI_____|
"
set -x

# create console and null node for nfsroot
#mknod -m 600 /dev/console c 5 1
#mknod -m 666 /dev/null c 1 3

# Set Global Environment
export PATH=/bin:/sbin:/usr/bin:/usr/sbin:/opt/wz_mini/bin
export PATH=/system/bin:$PATH
export LD_LIBRARY_PATH=/system/lib:/opt/wz_mini/lib
export LD_LIBRARY_PATH=/thirdlib:$LD_LIBRARY_PATH

# networking
ifconfig lo up
#ifconfig eth0 192.168.1.80

# Set the system time from the hardware clock
#hwclock -s

# Mount driver partition
mount -t squashfs /dev/mtdblock3 /system

/opt/wz_mini/etc/init.d/v3_post.shn
# Mount configs partition
mount -t jffs2 /dev/mtdblock6 /configs

# Run init script
if [ -f /configs/wyze_hack.sh ]; then
    /configs/wyze_hack.sh &
elif [ -f /system/init/app_init.sh ]; then
    /system/init/app_init.sh &
fi

# Run liteOta upgrade app
#/liteOta &

@gtxaspec
Copy link
Owner

looks like theres a bug in the v3_init.sh script, one sec

@gtxaspec
Copy link
Owner

looks like that fw version is broken, the scripts don't run correctly because the busybox version doesn't work as it should. the scripts should run even on an old version of busybox...

so the solution for now is to upgrade the FW

@gtxaspec
Copy link
Owner

gtxaspec commented May 14, 2022

add this under GPIO=63 in the file /opt/wz_mini/etc/init.d/v3_init.sh
mount --bind /opt/wz_mini/bin/busybox /bin/busybox

and see if that fixes things.

@virmaior
Copy link
Contributor Author

virmaior commented May 14, 2022

fully operational wz_mini'd camera !
Will put upgrading on the todo list.

@gtxaspec
Copy link
Owner

gtxaspec commented May 14, 2022

note that with that fix, wifi won't work because iCamera needs an older busybox. I'll try figure out how to include this into the release to make it work across all fw versions... with working wifi lol

@virmaior
Copy link
Contributor Author

fortunately since I'm doing usb direct, I don't actually want/need the wifi support!

But it seems like we should start invoicing wyze

@virmaior virmaior changed the title RTSP and firmware versions Fix for RTSP functionality on 4.36.2.5 May 14, 2022
@gtxaspec
Copy link
Owner

latest version has the fixes built in. hope the new version with bit rate settings works well for you

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants