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

[v4l2-sink] Broken since last update #3870

Closed
2 tasks done
ManuLinares opened this issue Mar 27, 2023 · 12 comments
Closed
2 tasks done

[v4l2-sink] Broken since last update #3870

ManuLinares opened this issue Mar 27, 2023 · 12 comments

Comments

@ManuLinares
Copy link

ManuLinares commented Mar 27, 2023

  • I have read the FAQ.
  • I have searched in existing issues.

Environment

  • OS: Linux Arch
  • scrcpy version: 2.0
  • installation method: pacman -S scrcpy
  • device model: Device: Google Pixel 6a (Android 13)
  • Android version: 13

Describe the bug

Trying v4l2loopback device, it doesn't fail but I can't see the output on the new device.

user@pc ~ $ sudo modprobe v4l2loopback devices=1 video_nr=10 card_label="Virtual_Webcam"

user@pc ~ $ scrcpy --v4l2-sink=/dev/video10  --max-size=1024 --lock-video-orientation=3
scrcpy 2.0 <https://github.com/Genymobile/scrcpy>
/usr/share/scrcpy/scrcpy-server: 1 file pushed, 0 skipped. 483.5 MB/s (52867 bytes in 0.000s)
[server] INFO: Device: Google Pixel 6a (Android 13)
INFO: Renderer: opengl
INFO: OpenGL version: 4.6.0 NVIDIA 530.41.03
INFO: Trilinear filtering enabled
INFO: Initial texture: 1024x464
INFO: v4l2 sink started to device: /dev/video10

This hangs: ffplay /dev/video10
After a while ffprobe outputs: Failed to reallocate parser buffer to -2146536384

@rom1v
Copy link
Collaborator

rom1v commented Mar 27, 2023

Thank you for your report.

On which commit? #3795 fixed it after 2.0.

git pull on master.

@ManuLinares
Copy link
Author

ManuLinares commented Mar 27, 2023

Thank you for your report.

On which commit? #3795 fixed it after 2.0.

git pull on master.

yeah, I'm using latest git: scrcpy-git 2.0.r18.g21df2c24-1

edit: v4l2loopback-dkms 0.12.7-2

@rom1v
Copy link
Collaborator

rom1v commented Mar 27, 2023

yeah, I'm using latest git: scrcpy-git

installation method: pacman -S scrcpy

🤔

You must compile the latest master version: https://github.com/Genymobile/scrcpy/blob/master/doc/linux.md#latest-version

@ManuLinares
Copy link
Author

yeah, I'm using latest git: scrcpy-git

installation method: pacman -S scrcpy

thinking

You must compile the latest master version: https://github.com/Genymobile/scrcpy/blob/master/doc/linux.md#latest-version

I did (just didn't edited my original post)

I built latest master from git according to your comment, and retested. Still not working.

upmost entry in the git log where I'm building.

commit 21df2c240e544b1c1eba7775e1474c1c772be04b (HEAD -> master, origin/tmp, origin/master, origin/HEAD)
Author: Romain Vimont <rom@rom1v.com>
Date:   Thu Mar 23 19:02:14 2023 +0100

    Mention necessary reboot
    
    After setting "USB debugging (security settings)", a reboot is
    necessary.

Clarification: First tried https://aur.archlinux.org/cgit/aur.git/tree/PKGBUILD?h=scrcpy-git which builds from master, then I just compiled myself from master.

@rom1v
Copy link
Collaborator

rom1v commented Mar 27, 2023

OK, weird. I could not reproduce.

@rom1v
Copy link
Collaborator

rom1v commented Mar 27, 2023

scrcpy 2.0 https://github.com/Genymobile/scrcpy
/usr/share/scrcpy/scrcpy-server

It still uses the version installed by the package manager, if you build manually it is installed in /usr/local/…

Uninstall your package.

@ManuLinares
Copy link
Author

ManuLinares commented Mar 27, 2023

image

I'm building manually, and executing the binary from the built binary in 'build/app'

sha256sum /usr/share/scrcpy/scrcpy-server
9e241615f578cd690bb43311000debdecf6a9c50a7082b001952f18f6f21ddc2  /usr/share/scrcpy/scrcpy-server

the "install_release.sh" just downloads the prebuilt server, its the same sha256.

@ManuLinares
Copy link
Author

ManuLinares commented Mar 27, 2023

I also executed with SCRCPY_SERVER_PATH=~/scripts/scrcpy-git/src/scrcpy/build/server/scrcpy-server ./app/scrcpy --v4l2-sink=/dev/video10 but the scrcpy-server sha256 is the same as installed so I don't think this changes anything

(maybe it helps) ffplay sometimes outputs nothing and sometimes some errors:

ffplay version n6.0 Copyright (c) 2003-2023 the FFmpeg developers
  built with gcc 12.2.1 (GCC) 20230201
  configuration: --prefix=/usr --disable-debug --disable-static --disable-stripping --enable-amf --enable-avisynth --enable-cuda-llvm --enable-lto --enable-fontconfig --enable-gmp --enable-gnutls --enable-gpl --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libdav1d --enable-libdrm --enable-libfreetype --enable-libfribidi --enable-libgsm --enable-libiec61883 --enable-libjack --enable-libjxl --enable-libmfx --enable-libmodplug --enable-libmp3lame --enable-libopencore_amrnb --enable-libopencore_amrwb --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librav1e --enable-librsvg --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libsvtav1 --enable-libtheora --enable-libv4l2 --enable-libvidstab --enable-libvmaf --enable-libvorbis --enable-libvpx --enable-libwebp --enable-libx264 --enable-libx265 --enable-libxcb --enable-libxml2 --enable-libxvid --enable-libzimg --enable-nvdec --enable-nvenc --enable-opencl --enable-opengl --enable-shared --enable-version3 --enable-vulkan
  libavutil      58.  2.100 / 58.  2.100
  libavcodec     60.  3.100 / 60.  3.100
  libavformat    60.  3.100 / 60.  3.100
  libavdevice    60.  1.100 / 60.  1.100
  libavfilter     9.  3.100 /  9.  3.100
  libswscale      7.  1.100 /  7.  1.100
  libswresample   4. 10.100 /  4. 10.100
  libpostproc    57.  1.100 / 57.  1.100
[h264 @ 0x7f2c08001a80] non-existing PPS 5 referenced    0B f=0/0   
[h264 @ 0x7f2c08001a80] non-existing PPS 0 referenced
[h264 @ 0x7f2c08001a80] data partitioning is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented.
[h264 @ 0x7f2c08001a80] If you want to help, upload a sample of this file to https://streams.videolan.org/upload/ and contact the ffmpeg-devel mailing list. (ffmpeg-devel@ffmpeg.org)
[h264 @ 0x7f2c08001a80] non-existing PPS 5 referenced
[h264 @ 0x7f2c08001a80] decode_slice_header error
[h264 @ 0x7f2c08001a80] data partitioning is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented.
[h264 @ 0x7f2c08001a80] If you want to help, upload a sample of this file to https://streams.videolan.org/upload/ and contact the ffmpeg-devel mailing list. (ffmpeg-devel@ffmpeg.org)
[h264 @ 0x7f2c08001a80] no frame!
[video4linux2,v4l2 @ 0x7f2c08000c80] Could not find codec parameters for stream 0 (Video: h264, none, 720x400): unspecified pixel format
Consider increasing the value for the 'analyzeduration' (0) and 'probesize' (5000000) options
Input #0, video4linux2,v4l2, from '/dev/video10':
  Duration: N/A, bitrate: N/A
  Stream #0:0: Video: h264, none, 720x400, 30 fps, 30 tbr, 1000k tbn
[h264 @ 0x7f2c080d1680] data partitioning is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented.
[h264 @ 0x7f2c080d1680] If you want to help, upload a sample of this file to https://streams.videolan.org/upload/ and contact the ffmpeg-devel mailing list. (ffmpeg-devel@ffmpeg.org)
[h264 @ 0x7f2c080d1680] non-existing PPS 5 referenced
[h264 @ 0x7f2c080d1680] decode_slice_header error
[h264 @ 0x7f2c080d1680] data partitioning is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented.
[h264 @ 0x7f2c080d1680] If you want to help, upload a sample of this file to https://streams.videolan.org/upload/ and contact the ffmpeg-devel mailing list. (ffmpeg-devel@ffmpeg.org)
[h264 @ 0x7f2c080d1680] no frame!
[h264 @ 0x7f2c080cf9c0] A non-intra slice in an IDR NAL unit.
[h264 @ 0x7f2c080cf9c0] decode_slice_header error
[h264 @ 0x7f2c080cf9c0] no frame!
[NULL @ 0x7f2c08001a80] non-existing PPS 95 referenced   0B f=0/0   
[NULL @ 0x7f2c08001a80] non-existing PPS 27 referenced   0B f=0/0   
[h264 @ 0x7f2c080c8900] data partitioning is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented.
[h264 @ 0x7f2c080c8900] If you want to help, upload a sample of this file to https://streams.videolan.org/upload/ and contact the ffmpeg-devel mailing list. (ffmpeg-devel@ffmpeg.org)
[h264 @ 0x7f2c080c8900] data partitioning is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented.
[h264 @ 0x7f2c080c8900] If you want to help, upload a sample of this file to https://streams.videolan.org/upload/ and contact the ffmpeg-devel mailing list. (ffmpeg-devel@ffmpeg.org)
[h264 @ 0x7f2c080c8900] data partitioning is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented.
[h264 @ 0x7f2c080c8900] If you want to help, upload a sample of this file to https://streams.videolan.org/upload/ and contact the ffmpeg-devel mailing list. (ffmpeg-devel@ffmpeg.org)
[h264 @ 0x7f2c080c8900] non-existing PPS 95 referenced
[h264 @ 0x7f2c080c8900] decode_slice_header error
[h264 @ 0x7f2c080c8900] data partitioning is not implemented. Update your FFmpeg version to the newest one from Git. If the problem still occurs, it means that your file has a feature which has not been implemented.
[h264 @ 0x7f2c080c8900] If you want to help, upload a sample of this file to https://streams.videolan.org/upload/ and contact the ffmpeg-devel mailing list. (ffmpeg-devel@ffmpeg.org)
[h264 @ 0x7f2c080c8900] no frame!
[h264 @ 0x7f2c081c06c0] A non-intra slice in an IDR NAL unit.
[h264 @ 0x7f2c081c06c0] decode_slice_header error
[h264 @ 0x7f2c081c06c0] no frame!

ffmpeg version 2:6.0-4.1

@rom1v
Copy link
Collaborator

rom1v commented Mar 28, 2023

Could you please build v1.25 (you could use the prebuilt server from release 1.25) and dev branch (you need to build the server manually, or I can provide one)?

@ManuLinares
Copy link
Author

You'd want me to test this
https://github.com/Genymobile/scrcpy/releases/tag/v1.25

and this
https://github.com/Genymobile/scrcpy/tree/dev
and for the "dev" build I'll need to compile the server or you provide one.

am I understanding correctly?

The answer is yes, I can test them.

@ManuLinares
Copy link
Author

ManuLinares commented Mar 28, 2023

My compilation rundown to see if I commit any mistake:

mkdir temp
git clone -b dev --single-branch https://github.com/Genymobile/scrcpy.git
cd scrcpy/
export ANDROID_SDK_ROOT=~/Android/Sdk
meson setup x --buildtype=release --strip -Db_lto=true
ninja -Cx

SCRCPY_SERVER_PATH=~/temp/scrcpy/x/server/scrcpy-server x/app/scrcpy --v4l2-sink=/dev/video10 --lock-video-orientation=1

ffplay /dev/video10

The 1.25 ver I downloaded from https://github.com/Genymobile/scrcpy/archive/refs/tags/v1.25.tar.gz

edit: I have to make some more tests, did something, it worked, sorry need time to debug

edit2: both the dev build and the 1.25 build worked. I also tried building from master and it also worked. So it is just the arch prebuilt community/scrcpy 2.0-1 that doesn't.

@rom1v
Copy link
Collaborator

rom1v commented Mar 28, 2023

OK, thank you for your tests 👍

So it's fixed by cbca79b on master (#3795).

@rom1v rom1v closed this as completed Mar 28, 2023
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