FFmpeg .net crash: Value cannot be null. (Parameter 'ptr')

Questions about applications and software
Forum rules
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Locked
VocalFan
Level 1
Level 1
Posts: 5
Joined: Mon Oct 05, 2020 10:51 pm

FFmpeg .net crash: Value cannot be null. (Parameter 'ptr')

Post by VocalFan »

Me and the leading developer are confused on why this crash is occurring. In Ryujinx, we use FFmpeg for decoding H264 videos for NVdec emulation, however, it seems that on AMD GPUs on linux, we get an exception of: Value cannot be null. (Parameter 'ptr'). I will try to provide any additional information if requested. All Nvidia GPUs seem to not have to exception, either, from GDK's continuous testing for the issue.

Logs:
https://github.com/Ryujinx/Ryujinx/file ... -26-40.log
https://github.com/Ryujinx/Ryujinx/file ... -28-53.log

Exception:

Code: Select all

Ryujinx.NvdecProcessor Application : Unhandled exception caught: System.ArgumentNullException: Value cannot be null. (Parameter 'ptr')
   at System.Runtime.InteropServices.Marshal.GetDelegateForFunctionPointer(IntPtr ptr, Type t)
   at System.Runtime.InteropServices.Marshal.GetDelegateForFunctionPointer[TDelegate](IntPtr ptr)
   at Ryujinx.Graphics.Nvdec.FFmpeg.FFmpegContext..ctor(AVCodecID codecId)
   at Ryujinx.Graphics.Nvdec.FFmpeg.H264.Decoder..ctor()
   at Ryujinx.Graphics.Nvdec.NvdecDecoderContext.GetH264Decoder()
   at Ryujinx.Graphics.Nvdec.H264Decoder.Decode(NvdecDecoderContext context, ResourceManager rm, NvdecRegisters& state)
   at Ryujinx.Graphics.Nvdec.NvdecDevice.Decode(CodecId codecId)
   at Ryujinx.Common.AsyncWorkQueue`1.DoWork()
   at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
--- End of stack trace from previous location ---
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()
Line of error: https://github.com/Ryujinx/Ryujinx/blob ... ext.cs#L27

inxi:

Code: Select all

System:
  Kernel: 5.11.0-38-generic x86_64 bits: 64 compiler: N/A 
  Desktop: Cinnamon 5.0.6 wm: muffin 5.0.2 dm: LightDM 1.30.0 
  Distro: Linux Mint 20.2 Uma base: Ubuntu 20.04 focal 
Machine:
  Type: Desktop Mobo: ASRock model: B450M Pro4 serial: <filter> 
  UEFI: American Megatrends v: P5.20 date: 06/28/2021 
CPU:
  Topology: 12-Core model: AMD Ryzen 9 3900X bits: 64 type: MT MCP arch: Zen 
  L2 cache: 6144 KiB 
  flags: avx avx2 lm nx pae sse sse2 sse3 sse4_1 sse4_2 sse4a ssse3 svm 
  bogomips: 182395 
  Speed: 2200 MHz min/max: 2200/3800 MHz boost: enabled Core speeds (MHz): 
  1: 2198 2: 2199 3: 2194 4: 2225 5: 2200 6: 2199 7: 2200 8: 2203 9: 2196 
  10: 2198 11: 2199 12: 2201 13: 2200 14: 2199 15: 2200 16: 2206 17: 2199 
  18: 2193 19: 2198 20: 2198 21: 2199 22: 2199 23: 2200 24: 2200 
Graphics:
  Device-1: AMD Navi 10 [Radeon RX 5600 OEM/5600 XT / 5700/5700 XT] 
  vendor: Tul driver: amdgpu v: 5.11.19.21.30 bus ID: 09:00.0 
  chip ID: 1002:731f 
  Display: x11 server: X.Org 1.20.11 driver: amdgpu,ati 
  unloaded: fbdev,modesetting,radeon,vesa resolution: 1920x1080~60Hz 
  OpenGL: renderer: AMD Radeon RX 5700 XT (NAVI10 DRM 3.42.0 
  5.11.0-38-generic LLVM 12.0.1) 
  v: 4.6 Mesa 21.2.4 - kisak-mesa PPA direct render: Yes 
Audio:
  Device-1: AMD Navi 10 HDMI Audio driver: snd_hda_intel v: kernel 
  bus ID: 09:00.1 chip ID: 1002:ab38 
  Device-2: AMD Starship/Matisse HD Audio vendor: ASRock 
  driver: snd_hda_intel v: kernel bus ID: 0b:00.4 chip ID: 1022:1487 
  Device-3: AlfaPlus MPOW Wireless Gaming Headset type: USB 
  driver: hid-generic,snd-usb-audio,usbhid bus ID: 1-5:3 chip ID: 223d:8900 
  Device-4: JMTek LLC. USB2.0 Hub type: USB 
  driver: hid-generic,snd-usb-audio,usbhid bus ID: 3-1.4:5 
  chip ID: 0c76:161f 
  Sound Server: ALSA v: k5.11.0-38-generic 
Network:
  Device-1: Realtek RTL8111/8168/8411 PCI Express Gigabit Ethernet 
  vendor: ASRock driver: r8169 v: kernel port: f000 bus ID: 05:00.0 
  chip ID: 10ec:8168 
  IF: enp5s0 state: up speed: 1000 Mbps duplex: full mac: <filter> 
  IF-ID-1: virbr0 state: down mac: <filter> 
  IF-ID-2: virbr0-nic state: down mac: <filter> 
Drives:
  Local Storage: total: 3.18 TiB used: 387.25 GiB (11.9%) 
  ID-1: /dev/nvme0n1 vendor: Western Digital model: WDS100T2B0C-00PXH0 
  size: 931.51 GiB speed: 31.6 Gb/s lanes: 4 serial: <filter> rev: 211070WD 
  scheme: GPT 
  ID-2: /dev/sda vendor: Seagate model: ST1000DM010-2EP102 size: 931.51 GiB 
  speed: 6.0 Gb/s rotation: 7200 rpm serial: <filter> rev: CC43 scheme: GPT 
  ID-3: /dev/sdb vendor: Smart Modular Tech. model: SHGS31-500GS-2 
  size: 465.76 GiB speed: 6.0 Gb/s serial: <filter> rev: 0Q00 scheme: GPT 
  ID-4: /dev/sdc vendor: Western Digital model: WDS100T2B0B-00YS70 
  size: 931.51 GiB speed: 6.0 Gb/s serial: <filter> rev: 00WD scheme: GPT 
Partition:
  ID-1: / size: 915.40 GiB used: 101.22 GiB (11.1%) fs: ext4 
  dev: /dev/nvme0n1p2 
Sensors:
  System Temperatures: cpu: 44.1 C mobo: N/A gpu: amdgpu temp: 62 C 
  Fan Speeds (RPM): N/A gpu: amdgpu fan: 1296 
Repos:
  No active apt repos in: /etc/apt/sources.list 
  Active apt repos in: /etc/apt/sources.list.d/additional-repositories.list 
  1: deb https://dl.winehq.org/wine-builds/ubuntu/ focal main
  Active apt repos in: /etc/apt/sources.list.d/amdgpu-pro-local.list 
  1: deb [ trusted=yes ] file:/var/opt/amdgpu-pro-local/ ./
  Active apt repos in: /etc/apt/sources.list.d/brave-browser-release.list 
  1: deb [signed-by=/usr/share/keyrings/brave-browser-archive-keyring.gpg arch=amd64] https://brave-browser-apt-release.s3.brave.com/ stable main
  Active apt repos in: /etc/apt/sources.list.d/cappelikan-ppa-focal.list 
  1: deb http://ppa.launchpad.net/cappelikan/ppa/ubuntu focal main
  Active apt repos in: /etc/apt/sources.list.d/kisak-kisak-mesa-focal.list 
  1: deb http://ppa.launchpad.net/kisak/kisak-mesa/ubuntu focal main
  Active apt repos in: /etc/apt/sources.list.d/kritalime-ppa-focal.list 
  1: deb http://ppa.launchpad.net/kritalime/ppa/ubuntu focal main
  Active apt repos in: /etc/apt/sources.list.d/nordvpn.list 
  1: deb https://repo.nordvpn.com/deb/nordvpn/debian stable main
  Active apt repos in: /etc/apt/sources.list.d/obsproject-obs-studio-focal.list 
  1: deb http://ppa.launchpad.net/obsproject/obs-studio/ubuntu focal main
  Active apt repos in: /etc/apt/sources.list.d/official-package-repositories.list 
  1: deb https://plug-mirror.rcac.purdue.edu/mint uma main upstream import backport
  2: deb http://mirror.genesisadaptive.com/ubuntu focal main restricted universe multiverse
  3: deb http://mirror.genesisadaptive.com/ubuntu focal-updates main restricted universe multiverse
  4: deb http://mirror.genesisadaptive.com/ubuntu focal-backports main restricted universe multiverse
  5: deb http://security.ubuntu.com/ubuntu/ focal-security main restricted universe multiverse
  6: deb http://archive.canonical.com/ubuntu/ focal partner
  No active apt repos in: /etc/apt/sources.list.d/oibaf-graphics-drivers-focal.list 
  Active apt repos in: /etc/apt/sources.list.d/rocm.list 
  1: deb [arch=amd64] https://repo.radeon.com/rocm/apt/debian/ ubuntu main
  Active apt repos in: /etc/apt/sources.list.d/steam.list 
  1: deb [arch=amd64,i386] https://repo.steampowered.com/steam/ stable steam
  2: deb-src [arch=amd64,i386] https://repo.steampowered.com/steam/ stable steam
  Active apt repos in: /etc/apt/sources.list.d/teejee2008-ppa-focal.list 
  1: deb http://ppa.launchpad.net/teejee2008/ppa/ubuntu focal main
Info:
  Processes: 499 Uptime: 3m Memory: 31.28 GiB used: 1.58 GiB (5.1%) 
  Init: systemd v: 245 runlevel: 5 Compilers: gcc: 9.3.0 alt: 9 
  clang: 10.0.0-4ubuntu1 Shell: bash v: 5.0.17 running in: gnome-terminal 
  inxi: 3.0.38 
FFmpeg:

Code: Select all

ffmpeg version 4.2.4-1ubuntu0.1 Copyright (c) 2000-2020 the FFmpeg developers
  built with gcc 9 (Ubuntu 9.3.0-10ubuntu2)
  configuration: --prefix=/usr --extra-version=1ubuntu0.1 --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-avisynth --enable-gnutls --enable-ladspa --enable-libaom --enable-libass --enable-libbluray --enable-libbs2b --enable-libcaca --enable-libcdio --enable-libcodec2 --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-librsvg --enable-librubberband --enable-libshine --enable-libsnappy --enable-libsoxr --enable-libspeex --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-libdc1394 --enable-libdrm --enable-libiec61883 --enable-nvenc --enable-chromaprint --enable-frei0r --enable-libx264 --enable-shared
  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
  libavresample   4.  0.  0 /  4.  0.  0
  libswscale      5.  5.100 /  5.  5.100
  libswresample   3.  5.100 /  3.  5.100
  libpostproc    55.  5.100 / 55.  5.100
Last edited by LockBot on Wed Dec 28, 2022 7:16 am, edited 1 time in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
AMD 9 3900X - 5700XT 8GB - 32GB DDR4 - Linux Mint Cinnamon!
vimes666
Level 6
Level 6
Posts: 1230
Joined: Tue Jan 19, 2016 6:08 pm

Re: FFmpeg .net crash: Value cannot be null. (Parameter 'ptr')

Post by vimes666 »

In the github issue you posted about this, you mentioned that it is a recent thing. Does that mean it used to work for those AMD pc's with that specific video? Does it happen with every video now or only that specific one?
If you think the issue is solved, edit your original post and add the word solved to the title.
VocalFan
Level 1
Level 1
Posts: 5
Joined: Mon Oct 05, 2020 10:51 pm

Re: FFmpeg .net crash: Value cannot be null. (Parameter 'ptr')

Post by VocalFan »

It occurs with ALL FFmpeg videos. Megamix crashes on the "Sega" video, NASB crashes on the main menu, Deemo crashes on any videos, some SSBU final smashes crash as well due to being a cutscene video. I was able to play Megamix a few months before this, now they all crash.
AMD 9 3900X - 5700XT 8GB - 32GB DDR4 - Linux Mint Cinnamon!
VocalFan
Level 1
Level 1
Posts: 5
Joined: Mon Oct 05, 2020 10:51 pm

Re: FFmpeg .net crash: Value cannot be null. (Parameter 'ptr')

Post by VocalFan »

Anyone?
AMD 9 3900X - 5700XT 8GB - 32GB DDR4 - Linux Mint Cinnamon!
Locked

Return to “Software & Applications”