Scheduled Maintenance: We are aware of an issue with Google, AOL, and Yahoo services as email providers which are blocking new registrations. We are trying to fix the issue and we have several internal and external support tickets in process to resolve the issue. Please see: viewtopic.php?t=158230

 

 

 

Debian 11, gstreamer1.0-plugins-bad and can't grab v4l video anymore

Graphical Environments, Managers, Multimedia & Desktop questions.
Post Reply
Message
Author
sspphheerraa
Posts: 7
Joined: 2021-09-06 16:15

Debian 11, gstreamer1.0-plugins-bad and can't grab v4l video anymore

#1 Post by sspphheerraa »

Hello. I have old laptop with PCMCIA card adapter on it and AVerMedia (saa7134 chip) Cardbus TV/Radio (E501R) which I use to record video from analog camera. Audio is recording from internal laptop microphone. Here is the 'start record' script:

Code: Select all

#!/usr/bin/env bash

filename=$(date +"%F_%H-%M-%S")
VIDEO_DEVICE="/dev/video0"
VIDEO_CAPABILITIES="video/x-raw, format=UYVY, interlace-mode=interleaved, framerate=25/1, width=720, height=576"
TV_NORM="PAL"
AUDIO_DEVICE="hw:0"
AUDIO_CAPABILITIES="audio/x-raw, rate=44100, channels=2"
ENCODE_VIDEO_CODEC="mpeg2video"
ENCODE_VIDEO_OPTIONS="-qscale:v 2 -aspect 4:3 -flags +ilme+ildct -top 1"
ENCODE_AUDIO_CODEC="aac"
AUDIO_FILTER=""
VIDEO_FILTER=""
ENCODE_AUDIO_OPTIONS="-ac 1"
ENCODE_MUXER_FORMAT="mpegts"
ENCODE_MUXER_OPTIONS=""

v4l2-ctl --set-input=2

ffmpeg \
    -i <(
        gst-launch-1.0 -q \
            v4l2src device="$VIDEO_DEVICE" do-timestamp=true norm="$TV_NORM" pixel-aspect-ratio=1 \
                ! $VIDEO_CAPABILITIES \
                ! queue max-size-buffers=0 max-size-time=0 max-size-bytes=0 \
                ! mux. \
            alsasrc device="$AUDIO_DEVICE" do-timestamp=true \
                ! $AUDIO_CAPABILITIES \
                ! queue max-size-buffers=0 max-size-time=0 max-size-bytes=0 \
                ! mux. \
            matroskamux name=mux \
                ! queue max-size-buffers=0 max-size-time=0 max-size-bytes=0 \
                ! fdsink fd=1
    ) \
                -c:v $ENCODE_VIDEO_CODEC $ENCODE_VIDEO_OPTIONS \
                -c:a $ENCODE_AUDIO_CODEC $ENCODE_AUDIO_OPTIONS \
                -f $ENCODE_MUXER_FORMAT $ENCODE_MUXER_OPTIONS \
                -map 0:v \
                -map 0:a \
                /home/user/Videos/$filename.ts
Gstreamer is used because ffmpeg itself can't do correct audio-video sync. However, It was working pretty well on Debian 10.
After upgrade to 11 the script hangs up:

Code: Select all

$ ./svideo-mpeg2.sh   
Video input set to 2 (S-Video: Camera, no signal, no hsync lock)
libva info: VA-API version 1.10.0
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so
ffmpeg version 4.3.2-0+deb11u2 Copyright (c) 2000-2021 the FFmpeg developers
  built with gcc 10 (Debian 10.2.1-6)
  configuration: --prefix=/usr --extra-version=0+deb11u2 --toolchain=hardened --libdir=/usr/lib/x86_64-linux-gnu --incdir=/usr/include/x86_64-linux-gnu --arch=amd64 --enable-gpl --disable-stripping --enable-avresample --disable-filter=resample --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --enable-libdav1d --enable-libflite --enable-libfontconfig --enable-libfreetype --enable-libfribidi --enable-libgme --enable-libgsm --enable-libjack --enable-libmp3lame --enable-libmysofa --enable-libopenjpeg --enable-libopenmpt --enable-libopus --enable-libpulse --enable-librabbitmq --enable-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --enable-libsrt --enable-libssh --enable-libtheora --enable-libtwolame --enable-libvidstab --enable-libvorbis --enable-libvpx --enable-libwavpack --enable-libwebp --enable-libx265 --enable-libxml2 --enable-libxvid --enable-libzmq --enable-libzvbi --enable-lv2 --enable-omx --enable-openal --enable-opencl --enable-opengl --enable-sdl2 --enable-pocketsphinx --enable-libmfx --enable-libdc1394 --enable-libdrm --enable-libiec61883 --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
libva info: Found init function __vaDriverInit_1_10
libva error: /usr/lib/x86_64-linux-gnu/dri/iHD_drv_video.so init failed
libva info: va_openDriver() returns 1
libva info: Trying to open /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so
  libavutil      56. 51.100 / 56. 51.100
  libavcodec     58. 91.100 / 58. 91.100
  libavformat    58. 45.100 / 58. 45.100
  libavdevice    58. 10.100 / 58. 10.100
  libavfilter     7. 85.100 /  7. 85.100
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  7.100 /  5.  7.100
  libswresample   3.  7.100 /  3.  7.100
  libpostproc    55.  7.100 / 55.  7.100
libva info: Found init function __vaDriverInit_1_8
libva error: /usr/lib/x86_64-linux-gnu/dri/i965_drv_video.so init failed
libva info: va_openDriver() returns -1
And kernel log:

Code: Select all

[ 1776.722708] BUG: kernel NULL pointer dereference, address: 0000000000000000
[ 1776.722723] #PF: supervisor read access in kernel mode
[ 1776.722730] #PF: error_code(0x0000) - not-present page
[ 1776.722735] PGD 0 P4D 0 
[ 1776.722749] Oops: 0000 [#1] SMP PTI
[ 1776.722760] CPU: 0 PID: 2602 Comm: gst-plugin-scan Not tainted 5.10.0-8-amd64 #1 Debian 5.10.46-4
[ 1776.722766] Hardware name: Dell Inc. Latitude D430                   /, BIOS A09 01/04/2010
[ 1776.722781] RIP: 0010:strscpy+0x6a/0x150
[ 1776.722790] Code: 48 bb ff fe fe fe fe fe fe fe eb 1e 48 89 0c 07 4c 89 da 48 83 c0 08 4c 89 d1 48 29 c2 48 29 c1 48 83 fa 07 0f 86 87 00 00 00 <49> 8b 0c 00 48 89 ca 4c 8d 0c 19 48 f7 d2 4c 21 ca 4c 8d 0c 07 48
[ 1776.722798] RSP: 0018:ffffb78d41e4bc58 EFLAGS: 00010246
[ 1776.722806] RAX: 0000000000000000 RBX: fefefefefefefeff RCX: 0000000000000000
[ 1776.722813] RDX: 0000000000000040 RSI: 8080808080808080 RDI: ffffb78d41e4bcbc
[ 1776.722819] RBP: ffff9f24c4799d08 R08: 0000000000000000 R09: ffff9f24ca338d18
[ 1776.722825] R10: 0000000000000040 R11: 0000000000000040 R12: ffff9f24ca338c00
[ 1776.722831] R13: ffffb78d41e4bcb8 R14: 0000000000000001 R15: 000055587ed34980
[ 1776.722840] FS:  00007f400364b740(0000) GS:ffff9f253d400000(0000) knlGS:0000000000000000
[ 1776.722847] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 1776.722853] CR2: 0000000000000000 CR3: 00000000022fe000 CR4: 00000000000006f0
[ 1776.722858] Call Trace:
[ 1776.722889]  media_device_get_topology+0xb8/0x380 [mc]
[ 1776.722904]  ? chrdev_open+0xed/0x230
[ 1776.722915]  ? mntput_no_expire+0x47/0x270
[ 1776.722924]  ? path_openat+0xa5a/0x1080
[ 1776.722934]  ? uevent_show+0xe1/0x100
[ 1776.722942]  ? tomoyo_init_request_info+0x8f/0xb0
[ 1776.722951]  ? tomoyo_path_number_perm+0x66/0x1d0
[ 1776.722960]  ? __check_object_size+0x46/0x150
[ 1776.722968]  ? _copy_from_user+0x28/0x60
[ 1776.722981]  media_device_ioctl+0x16d/0x1a0 [mc]
[ 1776.722994]  ? kmem_cache_free+0x103/0x410
[ 1776.723003]  ? do_sys_openat2+0x82/0x150
[ 1776.723014]  __x64_sys_ioctl+0x83/0xb0
[ 1776.723024]  do_syscall_64+0x33/0x80
[ 1776.723035]  entry_SYSCALL_64_after_hwframe+0x44/0xa9
[ 1776.723043] RIP: 0033:0x7f4003acacc7
[ 1776.723051] Code: 00 00 00 48 8b 05 c9 91 0c 00 64 c7 00 26 00 00 00 48 c7 c0 ff ff ff ff c3 66 2e 0f 1f 84 00 00 00 00 00 b8 10 00 00 00 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d 99 91 0c 00 f7 d8 64 89 01 48
[ 1776.723058] RSP: 002b:00007ffe38ba44c8 EFLAGS: 00000246 ORIG_RAX: 0000000000000010
[ 1776.723068] RAX: ffffffffffffffda RBX: 00007ffe38ba4550 RCX: 00007f4003acacc7
[ 1776.723074] RDX: 00007ffe38ba4550 RSI: 00000000c0487c04 RDI: 0000000000000010
[ 1776.723080] RBP: 0000000000000010 R08: 000055587ed34f60 R09: 00007f4003b94be0
[ 1776.723086] R10: 0000000000000080 R11: 0000000000000246 R12: 0000000000000000
[ 1776.723092] R13: 00007f4003e11b40 R14: 00000000c0487c04 R15: 000055587ecda3f0
[ 1776.723100] Modules linked in: saa7134_alsa rc_avermedia_cardbus ir_kbd_i2c tuner_simple tuner_types tda9887 tda8290 tea5767 tuner saa7134 tveeprom rc_core videobuf2_dma_sg videobuf2_memops videobuf2_v4l2 snd_hda_codec_idt videobuf2_common snd_hda_codec_generic videodev snd_hda_intel snd_intel_dspcfg mc soundwire_intel soundwire_generic_allocation ath5k snd_soc_core snd_compress ath soundwire_cadence dell_rbtn iTCO_wdt snd_hda_codec mac80211 dell_laptop snd_hda_core intel_pmc_bxt ledtrig_audio dell_wmi iTCO_vendor_support coretemp cfg80211 snd_hwdep kvm_intel pcmcia soundwire_bus dell_smm_hwmon kvm yenta_socket watchdog dell_smbios rfkill snd_pcm irqbypass pcmcia_rsrc dcdbas libarc4 snd_timer pcspkr dell_wmi_descriptor joydev pcmcia_core sparse_keymap wmi_bmof snd serio_raw sg ac evdev soundcore rng_core acpi_cpufreq firewire_sbp2 fuse configfs ip_tables x_tables autofs4 ext4 crc16 mbcache jbd2 crc32c_generic hid_generic usbhid hid sd_mod t10_pi crc_t10dif crct10dif_generic i915
[ 1776.723324]  crct10dif_common ata_generic i2c_algo_bit ata_piix drm_kms_helper libata sdhci_pci cqhci sdhci uhci_hcd scsi_mod cec tg3 ehci_pci ehci_hcd psmouse firewire_ohci mmc_core usbcore libphy drm i2c_i801 i2c_smbus lpc_ich firewire_core crc_itu_t usb_common ptp pps_core wmi button battery video
[ 1776.723420] CR2: 0000000000000000
[ 1776.723428] ---[ end trace acc0cb6ecdc1389d ]---
[ 1776.723437] RIP: 0010:strscpy+0x6a/0x150
[ 1776.723445] Code: 48 bb ff fe fe fe fe fe fe fe eb 1e 48 89 0c 07 4c 89 da 48 83 c0 08 4c 89 d1 48 29 c2 48 29 c1 48 83 fa 07 0f 86 87 00 00 00 <49> 8b 0c 00 48 89 ca 4c 8d 0c 19 48 f7 d2 4c 21 ca 4c 8d 0c 07 48
[ 1776.723452] RSP: 0018:ffffb78d41e4bc58 EFLAGS: 00010246
[ 1776.723459] RAX: 0000000000000000 RBX: fefefefefefefeff RCX: 0000000000000000
[ 1776.723465] RDX: 0000000000000040 RSI: 8080808080808080 RDI: ffffb78d41e4bcbc
[ 1776.723472] RBP: ffff9f24c4799d08 R08: 0000000000000000 R09: ffff9f24ca338d18
[ 1776.723478] R10: 0000000000000040 R11: 0000000000000040 R12: ffff9f24ca338c00
[ 1776.723484] R13: ffffb78d41e4bcb8 R14: 0000000000000001 R15: 000055587ed34980
[ 1776.723491] FS:  00007f400364b740(0000) GS:ffff9f253d400000(0000) knlGS:0000000000000000
[ 1776.723498] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[ 1776.723504] CR2: 0000000000000000 CR3: 00000000022fe000 CR4: 00000000000006f0
I have discovered that the problem is - gstreamer1.0-plugins-bad package (version 1.18, I am on stable branch), which installs as dependency of libreoffice package. If I remove gstreamer1.0-plugins-bad - the script works with no problems.
Well, what can I do? I need to record a-v via script and I need libreoffice too.

sspphheerraa
Posts: 7
Joined: 2021-09-06 16:15

Re: Debian 11, gstreamer1.0-plugins-bad and can't grab v4l video anymore

#2 Post by sspphheerraa »

Well, as a workaround I installed libreoffice without gstreamer1.0-plugins-bad dependence.

Code: Select all

apt install libreoffice gstreamer1.0-plugins-bad-

Post Reply