DesktopVideo driver crash linux

Ask software engineering and SDK questions for developers working on Mac OS X, Windows or Linux.
  • Author
  • Message
Offline

alatteri

  • Posts: 21
  • Joined: Fri Jul 17, 2020 7:22 pm
  • Real Name: Alan Latteri

DesktopVideo driver crash linux

PostTue Aug 24, 2021 10:59 pm

Hello,

I am trying to use UltraStudio HD/4K Mini on NUC10 platform using Ubuntu/Debian. Anytime I plug the UltraStudios into Thunderbolt on the NUC, the driver crashes and causes system instability. I have tried Ubuntu 20.04/21.04 both Desktop and Server, in addition to Debian 11 Server, and both DesktopVideo driver 12 and 12.1. Any thoughts?



Code: Select all
[   29.991689] pcieport 0000:02:01.0: pciehp: Slot(1): Card present
[   29.991701] pcieport 0000:02:01.0: pciehp: Slot(1): Link Up
[   30.127402] pci 0000:04:00.0: [8086:15c0] type 01 class 0x060400
[   30.127537] pci 0000:04:00.0: enabling Extended Tags
[   30.127842] pci 0000:04:00.0: supports D1 D2
[   30.127846] pci 0000:04:00.0: PME# supported from D0 D1 D2 D3hot D3cold
[   30.128033] pci 0000:04:00.0: 8.000 Gb/s available PCIe bandwidth, limited by 2.5 GT/s PCIe x4 link at 0000:02:01.0 (capable of 31.504 Gb/s with 8.0 GT/s PCIe x4 link)
[   30.128233] pci 0000:04:00.0: Adding to iommu group 21
[   30.128639] pci 0000:04:00.0: bridge configuration invalid ([bus 00-00]), reconfiguring
[   30.128888] pci 0000:05:01.0: [8086:15c0] type 01 class 0x060400
[   30.129021] pci 0000:05:01.0: enabling Extended Tags
[   30.129279] pci 0000:05:01.0: supports D1 D2
[   30.129283] pci 0000:05:01.0: PME# supported from D0 D1 D2 D3hot D3cold
[   30.129569] pci 0000:05:01.0: Adding to iommu group 22
[   30.129938] pci 0000:04:00.0: PCI bridge to [bus 05-38]
[   30.129961] pci 0000:04:00.0:   bridge window [io  0x0000-0x0fff]
[   30.129973] pci 0000:04:00.0:   bridge window [mem 0x00000000-0x000fffff]
[   30.129991] pci 0000:04:00.0:   bridge window [mem 0x00000000-0x000fffff 64bit pref]
[   30.129999] pci 0000:05:01.0: bridge configuration invalid ([bus 00-00]), reconfiguring
[   30.130246] pci 0000:06:00.0: [bdbd:a142] type 00 class 0x040000
[   30.130318] pci 0000:06:00.0: reg 0x10: [mem 0x00000000-0x000fffff 64bit]
[   30.130634] pci 0000:06:00.0: PME# supported from D0 D1 D2 D3hot
[   30.130837] pci 0000:06:00.0: Adding to iommu group 22
[   30.139005] pci 0000:05:01.0: PCI bridge to [bus 06-38]
[   30.139018] pci 0000:05:01.0:   bridge window [io  0x0000-0x0fff]
[   30.139025] pci 0000:05:01.0:   bridge window [mem 0x00000000-0x000fffff]
[   30.139036] pci 0000:05:01.0:   bridge window [mem 0x00000000-0x000fffff 64bit pref]
[   30.139038] pci_bus 0000:06: busn_res: [bus 06-38] end is updated to 06
[   30.139045] pci_bus 0000:05: busn_res: [bus 05-38] end is updated to 06
[   30.139056] pci 0000:04:00.0: BAR 14: assigned [mem 0x40000000-0x55efffff]
[   30.139059] pci 0000:04:00.0: BAR 15: assigned [mem 0x6000000000-0x6021ffffff 64bit pref]
[   30.139060] pci 0000:04:00.0: BAR 13: assigned [io  0x4000-0x4fff]
[   30.139062] pci 0000:05:01.0: BAR 14: assigned [mem 0x40000000-0x55efffff]
[   30.139064] pci 0000:05:01.0: BAR 15: assigned [mem 0x6000000000-0x6021ffffff 64bit pref]
[   30.139065] pci 0000:05:01.0: BAR 13: assigned [io  0x4000-0x4fff]
[   30.139067] pci 0000:06:00.0: BAR 0: assigned [mem 0x40000000-0x400fffff 64bit]
[   30.139093] pci 0000:05:01.0: PCI bridge to [bus 06]
[   30.139097] pci 0000:05:01.0:   bridge window [io  0x4000-0x4fff]
[   30.139106] pci 0000:05:01.0:   bridge window [mem 0x40000000-0x55efffff]
[   30.139111] pci 0000:05:01.0:   bridge window [mem 0x6000000000-0x6021ffffff 64bit pref]
[   30.139122] pci 0000:04:00.0: PCI bridge to [bus 05-06]
[   30.139126] pci 0000:04:00.0:   bridge window [io  0x4000-0x4fff]
[   30.139134] pci 0000:04:00.0:   bridge window [mem 0x40000000-0x55efffff]
[   30.139139] pci 0000:04:00.0:   bridge window [mem 0x6000000000-0x6021ffffff 64bit pref]
[   30.139167] pcieport 0000:02:01.0: PCI bridge to [bus 04-38]
[   30.139170] pcieport 0000:02:01.0:   bridge window [io  0x4000-0x4fff]
[   30.139174] pcieport 0000:02:01.0:   bridge window [mem 0x40000000-0x55efffff]
[   30.139178] pcieport 0000:02:01.0:   bridge window [mem 0x6000000000-0x6021ffffff 64bit pref]
[   30.139216] pcieport 0000:04:00.0: enabling device (0000 -> 0003)
[   30.139534] pcieport 0000:05:01.0: enabling device (0000 -> 0003)
[   30.157472] blackmagic_io: loading out-of-tree module taints kernel.
[   30.157480] blackmagic_io: module license 'Proprietary' taints kernel.
[   30.157481] Disabling lock debugging due to kernel taint
[   30.157947] blackmagic_io: module verification failed: signature and/or required key missing - tainting kernel
[   30.159771] BlackmagicIO: Driver version 12.1a9 loading
[   30.159807] blackmagic-io 0000:06:00.0: enabling device (0000 -> 0002)
[   30.717644] thunderbolt 0-1: new device found, vendor=0x4 device=0xa142
[   30.717648] thunderbolt 0-1: Blackmagic Design Ultrastudio HD Mini
[   32.783343] BlackmagicIO: Enabled device "UltraStudio HD Mini" x2/5 Gbps (113ae029,540600) FW Date: 04-11 08:14
[   32.785591] blackmagic-io 0000:06:00.0: swiotlb buffer is full (sz: 3072000 bytes), total 32768 (slots), used 0 (slots)
[   32.785633] ------------[ cut here ]------------
[   32.785635] WARNING: CPU: 6 PID: 1521 at drivers/iommu/dma-iommu.c:530 __iommu_dma_unmap_swiotlb+0x9c/0xb0
[   32.785652] Modules linked in: blackmagic_io(POE+) rfcomm joydev input_leds hid_generic usbhid hid snd_hda_codec_hdmi cmac algif_hash algif_skcipher af_alg bnep snd_hda_codec_realtek snd_hda_codec_generic snd_sof_pci snd_sof_intel_hda_common intel_rapl_msr snd_soc_hdac_hda intel_rapl_common snd_sof_intel_hda snd_sof_intel_byt x86_pkg_temp_thermal snd_sof_intel_ipc intel_powerclamp snd_sof snd_sof_xtensa_dsp snd_hda_ext_core snd_soc_acpi_intel_match snd_soc_acpi ledtrig_audio coretemp snd_hda_intel snd_intel_dspcfg soundwire_intel soundwire_generic_allocation soundwire_cadence snd_hda_codec snd_hda_core snd_hwdep soundwire_bus btusb snd_soc_core btrtl btbcm btintel snd_compress ac97_bus snd_pcm_dmaengine bluetooth kvm_intel iwlmvm nls_iso8859_1 snd_pcm kvm mac80211 snd_seq_midi snd_seq_midi_event snd_rawmidi ecdh_generic i915 mei_hdcp ecc crct10dif_pclmul ghash_clmulni_intel libarc4 snd_seq drm_kms_helper snd_seq_device snd_timer aesni_intel iwlwifi cec snd crypto_simd mei_me rc_core
[   32.785815]  cryptd glue_helper i2c_algo_bit rapl fb_sys_fops intel_cstate intel_wmi_thunderbolt wmi_bmof efi_pstore soundcore cfg80211 syscopyarea sysfillrect ee1004 mei intel_pch_thermal sysimgblt mac_hid acpi_tad acpi_pad sch_fq_codel msr parport_pc ppdev lp drm parport ip_tables x_tables autofs4 crc32_pclmul thunderbolt nvme intel_lpss_pci sdhci_pci intel_lpss ahci i2c_i801 cqhci idma64 xhci_pci e1000e nvme_core sdhci i2c_smbus libahci virt_dma xhci_pci_renesas wmi video pinctrl_cannonlake
[   32.785919] CPU: 6 PID: 1521 Comm: systemd-udevd Tainted: P           OE     5.11.0-31-generic #33-Ubuntu
[   32.785928] Hardware name: Intel(R) Client Systems NUC10i7FNK/NUC10i7FNB, BIOS FNCML357.0051.2021.0324.1859 03/24/2021
[   32.785932] RIP: 0010:__iommu_dma_unmap_swiotlb+0x9c/0xb0
[   32.785941] Code: ea 4c 89 e6 4c 89 ff 48 8b 48 28 4a 8d 44 29 ff 48 f7 d9 48 21 c1 e8 53 a9 97 ff 48 83 c4 10 5b 41 5c 41 5d 41 5e 41 5f 5d c3 <0f> 0b 48 83 c4 10 5b 41 5c 41 5d 41 5e 41 5f 5d c3 0f 1f 00 0f 1f
[   32.785948] RSP: 0018:ffffbc9240bb34f8 EFLAGS: 00010246
[   32.785955] RAX: 0000000000000000 RBX: 0000000000000000 RCX: 0000000000000000
[   32.785959] RDX: 0000000000000000 RSI: 000fffffffffffff RDI: ffff96e3cb788b00
[   32.785964] RBP: ffffbc9240bb3530 R08: 0000000000000002 R09: 0000000000000000
[   32.785968] R10: ffffbc9240bb3238 R11: 00000000002ee000 R12: ffff96e3c51180c8
[   32.785972] R13: 00000000002ee000 R14: ffffffffffffffff R15: ffff96e3c51180c8
[   32.785977] FS:  00007faa479d48c0(0000) GS:ffff96e770d80000(0000) knlGS:0000000000000000
[   32.785983] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[   32.785988] CR2: 00007fddde0053a0 CR3: 000000010d0ae006 CR4: 00000000003706e0
[   32.785994] Call Trace:
[   32.786002]  iommu_dma_unmap_page+0x4a/0x50
[   32.786013]  dma_unmap_page_attrs+0x181/0x1b0
[   32.786023]  ? __iommu_dma_map_swiotlb.constprop.0+0x14d/0x1b0
[   32.786033]  bm_dma_unmap_buffer+0xab/0xc0 [blackmagic_io]
[   32.786173]  bm_dma_map_kernel_buffer+0x108/0x150 [blackmagic_io]
[   32.786287]  _ZN24IOBufferMemoryDescriptor18getPhysicalSegmentEjPjj+0x81/0xf4 [blackmagic_io]
[   32.786415]  _ZN12IODMACommand10getSegmentEjjRN16IODMACommandBase9Segment64E+0x2c/0x48 [blackmagic_io]
[   32.786541]  _ZN16IODMACommandBase17gen64IOVMSegmentsEPyPNS_9Segment64EPj+0xd0/0x15a [blackmagic_io]
[   32.786694]  _ZN22MemDescriptorBusMapper13genBusAddressEyRN16IODMACommandBase9Segment64E+0x66/0x252 [blackmagic_io]
[   32.786911]  ? _ZN8OSObjectC2EPK11OSMetaClass+0xe/0x20 [blackmagic_io]
[   32.787119]  ? _ZN16IODMACommandBaseC2EPK11OSMetaClass+0xe/0x28 [blackmagic_io]
[   32.787270]  ? _ZN12IODMACommandC1Ev+0x2d/0x32 [blackmagic_io]
[   32.787406]  _ZN10DMAElement10addSegmentEP22MemDescriptorBusMapperyyjb+0x10a/0x342 [blackmagic_io]
[   32.787647]  _ZN10DMAElement10addSegmentEP18IOMemoryDescriptoryyj+0x5f/0x7a [blackmagic_io]
[   32.787863]  ? _ZN22MemDescriptorBusMapper8withDescEP9DMAEngineP18IOMemoryDescriptorb+0xb2/0xb2 [blackmagic_io]
[   32.788057]  _ZN17AudioSampleBuffer12configureDMAEP9DMAEngineR12AutoOSObjectI10DMAElementE+0xa6/0xc4 [blackmagic_io]
[   32.788144]  _ZN17AudioSampleBuffer4initEP19VideoHardwareDeviceP9DMAEngineS3_i+0xfe/0x164 [blackmagic_io]
[   32.788197]  _ZN17AudioSampleBuffer11withOptionsEP19VideoHardwareDeviceP9DMAEngineS3_i+0x4b/0x6a [blackmagic_io]
[   32.788249]  _ZN18BlackmagicIODriver29configureEnginesAndInterfacesEv+0x138/0x544 [blackmagic_io]
[   32.788304]  _ZN18BlackmagicIODriver5startEP9IOService+0x25a/0x302 [blackmagic_io]
[   32.788359]  _ZN23BlackmagicIODriverLinux5startEP9IOService+0x4b/0x60 [blackmagic_io]
[   32.788410]  _ZN22BlackmagicIOSupervisor9addDriverEP18BlackmagicIODriverj+0x67/0x98 [blackmagic_io]
[   32.788467]  ? _ZN23BlackmagicIODriverLinux6createEv+0x2c/0x42 [blackmagic_io]
[   32.788517]  _ZN27BlackmagicIOSupervisorLinux11probeDriverEj+0x34/0x4e [blackmagic_io]
[   32.788566]  _ZN22BlackmagicIOSupervisor23probeAndStartSubdevicesEv+0x85/0x16e [blackmagic_io]
[   32.788626]  ? put_event+0x71/0x80 [blackmagic_io]
[   32.788662]  ? bm_event_wakeup+0x91/0xa0 [blackmagic_io]
[   32.788698]  ? _ZN10IOWorkLoop19signalWorkAvailableEv+0xe/0x10 [blackmagic_io]
[   32.788755]  _ZN22BlackmagicIOSupervisor5startEP9IOService+0x178/0x1be [blackmagic_io]
[   32.788816]  bmio_device_init+0x93/0xed [blackmagic_io]
[   32.788853]  bmio_device_alloc+0x6b/0xb0 [blackmagic_io]
[   32.788886]  bmio_probe+0xe/0x20 [blackmagic_io]
[   32.788918]  local_pci_probe+0x48/0x80
[   32.788923]  pci_call_probe+0x53/0xf0
[   32.788925]  pci_device_probe+0xad/0xf0
[   32.788928]  really_probe+0xff/0x460
[   32.788931]  driver_probe_device+0xe9/0x160
[   32.788934]  device_driver_attach+0xab/0xb0
[   32.788936]  __driver_attach+0x8f/0x150
[   32.788939]  ? device_driver_attach+0xb0/0xb0
[   32.788941]  bus_for_each_dev+0x7e/0xc0
[   32.788944]  driver_attach+0x1e/0x20
[   32.788946]  bus_add_driver+0x135/0x1f0
[   32.788948]  driver_register+0x95/0xf0
[   32.788951]  __pci_register_driver+0x54/0x60
[   32.788953]  bmio_init+0x4c/0x1000 [blackmagic_io]
[   32.788984]  ? 0xffffffffc12fd000
[   32.788985]  do_one_initcall+0x48/0x1d0
[   32.788990]  ? kmem_cache_alloc_trace+0xf6/0x200
[   32.788994]  ? do_init_module+0x28/0x290
[   32.788997]  do_init_module+0x62/0x290
[   32.788999]  load_module+0x6fd/0x780
[   32.789001]  __do_sys_finit_module+0xc2/0x120
[   32.789004]  __x64_sys_finit_module+0x1a/0x20
[   32.789006]  do_syscall_64+0x38/0x90
[   32.789009]  entry_SYSCALL_64_after_hwframe+0x44/0xa9
[   32.789013] RIP: 0033:0x7faa47e8cf6d
[   32.789015] Code: 28 0d 00 0f 05 eb a9 66 0f 1f 44 00 00 f3 0f 1e fa 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d cb de 0c 00 f7 d8 64 89 01 48
[   32.789017] RSP: 002b:00007ffdd8f4a238 EFLAGS: 00000246 ORIG_RAX: 0000000000000139
[   32.789020] RAX: ffffffffffffffda RBX: 0000557ca9a08b80 RCX: 00007faa47e8cf6d
[   32.789021] RDX: 0000000000000000 RSI: 00007faa48032e2d RDI: 0000000000000006
[   32.789023] RBP: 0000000000020000 R08: 0000000000000000 R09: 0000557ca8aa589d
[   32.789024] R10: 0000000000000006 R11: 0000000000000246 R12: 00007faa48032e2d
[   32.789025] R13: 0000000000000000 R14: 0000557ca9a1dab0 R15: 0000557ca9a08b80
[   32.789028] ---[ end trace 680e8fdc5f05e005 ]---
[   32.789030] BlackmagicIO: Failed to get physical address for segment (descLen=3072000 offset=0 segLen=3072000)
[   32.789032] BlackmagicIO: Failed to get physical address for segment (ret=0x3fd descLen=3072000 offset=0)
[   32.789043] BlackmagicIO: init[71]: Failed to configure DMA
[   32.789049] BlackmagicIO: configureEnginesAndInterfaces[168]: Failed to create audio output sample buffer
[   32.789050] BlackmagicIO: start[109]: Failed to configure DMA engines and A/V interfaces
[   32.789080] ------------[ cut here ]------------
[   32.789080] kernel BUG at drivers/pci/msi.c:378!
[   32.789086] invalid opcode: 0000 [#1] SMP NOPTI
[   32.789089] CPU: 6 PID: 1521 Comm: systemd-udevd Tainted: P        W  OE     5.11.0-31-generic #33-Ubuntu
[   32.789091] Hardware name: Intel(R) Client Systems NUC10i7FNK/NUC10i7FNB, BIOS FNCML357.0051.2021.0324.1859 03/24/2021
[   32.789093] RIP: 0010:free_msi_irqs+0x169/0x190
[   32.789096] Code: 85 c0 0f 84 ec fe ff ff 45 31 f6 eb 11 41 83 c6 01 44 39 73 14 0f 86 d9 fe ff ff 8b 7b 10 44 01 f7 e8 db 00 ac ff 84 c0 74 e3 <0f> 0b 49 8b 7e 60 e8 fc 9c a2 ff 49 8b 16 e9 08 ff ff ff 49 8d b5
[   32.789099] RSP: 0018:ffffbc9240bb3a28 EFLAGS: 00010202
[   32.789101] RAX: 0000000000000001 RBX: ffff96e3fe95e300 RCX: 0000000000000000
[   32.789120] RDX: ffff96e3c0496910 RSI: 00000000000000b4 RDI: ffffffff9f753748
[   32.789122] RBP: ffffbc9240bb3a50 R08: ffff96e3c8d95000 R09: 0000000000000000
[   32.789123] R10: 0000000000000000 R11: ffff96e3c0401242 R12: ffff96e3c51182f0
[   32.789125] R13: ffff96e3c5118000 R14: 0000000000000000 R15: 0000000000000048
[   32.789126] FS:  00007faa479d48c0(0000) GS:ffff96e770d80000(0000) knlGS:0000000000000000
[   32.789129] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[   32.789130] CR2: 00007fddde0053a0 CR3: 000000010d0ae006 CR4: 00000000003706e0
[   32.789132] Call Trace:
[   32.789134]  pci_disable_msi+0x107/0x140
[   32.789137]  bm_pci_stop+0x29/0x40 [blackmagic_io]
[   32.789172]  _ZN11IOPCIDevice4stopEP9IOService+0x35/0x3a [blackmagic_io]
[   32.789216]  bmio_device_init+0xc6/0xed [blackmagic_io]
[   32.789252]  bmio_device_alloc+0x6b/0xb0 [blackmagic_io]
[   32.789284]  bmio_probe+0xe/0x20 [blackmagic_io]
[   32.789315]  local_pci_probe+0x48/0x80
[   32.789318]  pci_call_probe+0x53/0xf0
[   32.789321]  pci_device_probe+0xad/0xf0
[   32.789324]  really_probe+0xff/0x460
[   32.789327]  driver_probe_device+0xe9/0x160
[   32.789330]  device_driver_attach+0xab/0xb0
[   32.789333]  __driver_attach+0x8f/0x150
[   32.789335]  ? device_driver_attach+0xb0/0xb0
[   32.789338]  bus_for_each_dev+0x7e/0xc0
[   32.789340]  driver_attach+0x1e/0x20
[   32.789343]  bus_add_driver+0x135/0x1f0
[   32.789345]  driver_register+0x95/0xf0
[   32.789349]  __pci_register_driver+0x54/0x60
[   32.789351]  bmio_init+0x4c/0x1000 [blackmagic_io]
[   32.789381]  ? 0xffffffffc12fd000
[   32.789382]  do_one_initcall+0x48/0x1d0
[   32.789386]  ? kmem_cache_alloc_trace+0xf6/0x200
[   32.789389]  ? do_init_module+0x28/0x290
[   32.789392]  do_init_module+0x62/0x290
[   32.789394]  load_module+0x6fd/0x780
[   32.789396]  __do_sys_finit_module+0xc2/0x120
[   32.789399]  __x64_sys_finit_module+0x1a/0x20
[   32.789402]  do_syscall_64+0x38/0x90
[   32.789404]  entry_SYSCALL_64_after_hwframe+0x44/0xa9
[   32.789407] RIP: 0033:0x7faa47e8cf6d
[   32.789409] Code: 28 0d 00 0f 05 eb a9 66 0f 1f 44 00 00 f3 0f 1e fa 48 89 f8 48 89 f7 48 89 d6 48 89 ca 4d 89 c2 4d 89 c8 4c 8b 4c 24 08 0f 05 <48> 3d 01 f0 ff ff 73 01 c3 48 8b 0d cb de 0c 00 f7 d8 64 89 01 48
[   32.789411] RSP: 002b:00007ffdd8f4a238 EFLAGS: 00000246 ORIG_RAX: 0000000000000139
[   32.789414] RAX: ffffffffffffffda RBX: 0000557ca9a08b80 RCX: 00007faa47e8cf6d
[   32.789416] RDX: 0000000000000000 RSI: 00007faa48032e2d RDI: 0000000000000006
[   32.789418] RBP: 0000000000020000 R08: 0000000000000000 R09: 0000557ca8aa589d
[   32.789419] R10: 0000000000000006 R11: 0000000000000246 R12: 00007faa48032e2d
[   32.789421] R13: 0000000000000000 R14: 0000557ca9a1dab0 R15: 0000557ca9a08b80
[   32.789423] Modules linked in: blackmagic_io(POE+) rfcomm joydev input_leds hid_generic usbhid hid snd_hda_codec_hdmi cmac algif_hash algif_skcipher af_alg bnep snd_hda_codec_realtek snd_hda_codec_generic snd_sof_pci snd_sof_intel_hda_common intel_rapl_msr snd_soc_hdac_hda intel_rapl_common snd_sof_intel_hda snd_sof_intel_byt x86_pkg_temp_thermal snd_sof_intel_ipc intel_powerclamp snd_sof snd_sof_xtensa_dsp snd_hda_ext_core snd_soc_acpi_intel_match snd_soc_acpi ledtrig_audio coretemp snd_hda_intel snd_intel_dspcfg soundwire_intel soundwire_generic_allocation soundwire_cadence snd_hda_codec snd_hda_core snd_hwdep soundwire_bus btusb snd_soc_core btrtl btbcm btintel snd_compress ac97_bus snd_pcm_dmaengine bluetooth kvm_intel iwlmvm nls_iso8859_1 snd_pcm kvm mac80211 snd_seq_midi snd_seq_midi_event snd_rawmidi ecdh_generic i915 mei_hdcp ecc crct10dif_pclmul ghash_clmulni_intel libarc4 snd_seq drm_kms_helper snd_seq_device snd_timer aesni_intel iwlwifi cec snd crypto_simd mei_me rc_core
[   32.789468]  cryptd glue_helper i2c_algo_bit rapl fb_sys_fops intel_cstate intel_wmi_thunderbolt wmi_bmof efi_pstore soundcore cfg80211 syscopyarea sysfillrect ee1004 mei intel_pch_thermal sysimgblt mac_hid acpi_tad acpi_pad sch_fq_codel msr parport_pc ppdev lp drm parport ip_tables x_tables autofs4 crc32_pclmul thunderbolt nvme intel_lpss_pci sdhci_pci intel_lpss ahci i2c_i801 cqhci idma64 xhci_pci e1000e nvme_core sdhci i2c_smbus libahci virt_dma xhci_pci_renesas wmi video pinctrl_cannonlake
[   32.789500] ---[ end trace 680e8fdc5f05e006 ]---
[   32.894268] RIP: 0010:free_msi_irqs+0x169/0x190
[   32.894290] Code: 85 c0 0f 84 ec fe ff ff 45 31 f6 eb 11 41 83 c6 01 44 39 73 14 0f 86 d9 fe ff ff 8b 7b 10 44 01 f7 e8 db 00 ac ff 84 c0 74 e3 <0f> 0b 49 8b 7e 60 e8 fc 9c a2 ff 49 8b 16 e9 08 ff ff ff 49 8d b5
[   32.894292] RSP: 0018:ffffbc9240bb3a28 EFLAGS: 00010202
[   32.894294] RAX: 0000000000000001 RBX: ffff96e3fe95e300 RCX: 0000000000000000
[   32.894295] RDX: ffff96e3c0496910 RSI: 00000000000000b4 RDI: ffffffff9f753748
[   32.894296] RBP: ffffbc9240bb3a50 R08: ffff96e3c8d95000 R09: 0000000000000000
[   32.894297] R10: 0000000000000000 R11: ffff96e3c0401242 R12: ffff96e3c51182f0
[   32.894298] R13: ffff96e3c5118000 R14: 0000000000000000 R15: 0000000000000048
[   32.894299] FS:  00007faa479d48c0(0000) GS:ffff96e770d80000(0000) knlGS:0000000000000000
[   32.894301] CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
[   32.894302] CR2: 00007fddde0053a0 CR3: 000000010d0ae006 CR4: 00000000003706e0
Offline

xzcvczx

  • Posts: 4
  • Joined: Sat Nov 13, 2021 2:10 pm
  • Real Name: Simon Wells

Re: DesktopVideo driver crash linux

PostSat Nov 13, 2021 2:29 pm

I also have the same issue with the ultrastudio recorder 3G

the root issue seems to be that the 3072000 bytes is too big for the single map. when the map fails it then tries to unmap it, but the map failed so it has nothing to unmap.

the only successful workaround I have found so far is to use intel_iommu=nobounce on the kernel command line, however this does introduce security issues,

another workaround that could work is to modify

include/linux/swiotlb.h
IO_TLB_SEGSIZE

in the kernel (so would require building a custom kernel) to allow a swiotlb buffer of 3072000 bytes as required by the blackmagic-io module.

IO_TLB_SEGSIZE is set to 128 in the kernel source which allows buffers of 524160 bytes (128 * 4096). changing this to 1024 would give 4193280 bytes, which would be sufficient for the blackmagic-io module. this workaround wouldn't create the same security issues as the other one, but can lead to exhaustion of the swiotlb buffer space.

i am surprised there are not more people on the forums with this issue as for it to "just work" i believe it would require a distro to patch the kernel IO_TLB_SEGSIZE and i am not aware of any distros that do this
Offline

xzcvczx

  • Posts: 4
  • Joined: Sat Nov 13, 2021 2:10 pm
  • Real Name: Simon Wells

Re: DesktopVideo driver crash linux

PostTue Nov 16, 2021 9:51 am

not sure if blackmagic accepts patches here but a couple of issues in the open source part of blackmagic-io
and only necessary when there is an error.

check return of pci_enable_msi to ensure it succeeded.

EDIT: I think this one is wrong as it might be able to fallback to legacy interrupts, so this patch can probably be ignored.

Code: Select all
--- bm_pci.c.orig   2021-11-14 15:31:01.730923203 +1300
+++ bm_pci.c   2021-11-14 15:49:37.825450296 +1300
@@ -83,7 +83,8 @@
    }
 
    if (strcmp(default_irq_type, "msi") == 0)
-      pci_enable_msi(pci->pdev);
+      if (pci_enable_msi(pci->pdev) < 0)
+         goto bail;
 
    return true;



don't unmap an invalid address

Code: Select all
--- bm_mm.c.orig   2021-11-14 15:31:15.311099165 +1300
+++ bm_mm.c   2021-11-16 22:39:38.718923115 +1300
@@ -248,10 +248,7 @@
 
    dlist->addrs[0] = pci_map_single(pci->pdev, addr, size, dir);
    if (bm_pci_dma_mapping_error(pci->pdev, dlist->addrs[0]))
-   {
-      bm_dma_unmap_buffer(pci, dlist, dir);
       return NULL;
-   }
 
    bm_atomic_add(&statistics.memory_mapped, size);
 




these do not solve all the issues experienced by OP (primarily the 'kernel BUG at drivers/pci/msi.c' which I believe causes most of the major issues and instability), I think any remaining issues are in the closed source part of the module though.
Last edited by xzcvczx on Thu Nov 18, 2021 3:35 am, edited 1 time in total.
Offline

maxikrie

  • Posts: 2
  • Joined: Tue Nov 16, 2021 4:56 pm
  • Real Name: Max Kriegleder

Re: DesktopVideo driver crash linux

PostTue Nov 16, 2021 5:05 pm

I have the same problem on Debian 11 running on a X1 Carbon Gen 9:

Code: Select all
kernel: [ 6339.568170] BlackmagicIO: Driver version 12.2a12 loading
kernel: [ 6339.568198] blackmagic-io 0000:22:00.0: enabling device (0000 -> 0002)
kernel: [ 6339.568552] BlackmagicIO: Enabled device "UltraStudio 4K Mini" x2/5 GT/s (a0c60e38,5a2200) FW Date: 06-12 14:05
kernel: [ 6339.569073] blackmagic-io 0000:22:00.0: swiotlb buffer is full (sz: 3072000 bytes), total 32768 (slots), used 0 (slots)
kernel: [ 6339.569075] blackmagic-io 0000:22:00.0: DMAR: Device bounce map: 2ee000@19cc00010 dir 0 --- failed


My kernel is
Code: Select all
5.10.0-9-amd64 #1 SMP Debian 5.10.70-1 (2021-09-30) x86_64 GNU/Linux


Has this ever worked on previous versions? I am not interested in workarounds that introduce security issues or custom kernels..

Thanks for help!
Offline

xzcvczx

  • Posts: 4
  • Joined: Sat Nov 13, 2021 2:10 pm
  • Real Name: Simon Wells

Re: DesktopVideo driver crash linux

PostThu Nov 18, 2021 4:13 am

this issue may only affect Intel machines (i have not bothered looking to see how AMD handles it)

swiotlb is used as a bounce buffer to protect unrelated memory from being accessed by an untrusted external device. due to security issues discovered using 'Thunderclap'. This was introduced in kernel 5.4 (i am pretty sure this is the correct version but I may be wrong) so 5.3 might work but it doesn't solve the issue without bringing back the same security issue that would be experienced by using intel_iommu=nobounce, swiotlb is limited in its own way as explained in my first reply (limited to only 128 contiguous 4096byte blocks in a single map == 512k).

bounce buffers are only used when the dma address and/or the size of the allocation are misaligned with the iommu page size.

Code: Select all
[   62.371004] blackmagic-io 0000:30:00.0: swiotlb buffer is full (sz: 3072000 bytes), total 32768 (slots), used 4 (slots)
[   62.371007] blackmagic-io 0000:30:00.0: DMAR: Device bounce map: 2ee000@1e5800010 dir 0 --- failed
--- skipped for brevity ---
[   62.371231]  bm_dma_map_kernel_buffer+0xfb/0x150 [blackmagic_io]
[   62.371258]  _ZN24IOBufferMemoryDescriptor18getPhysicalSegmentEjPjj+0x81/0xf4 [blackmagic_io]
[   62.371285]  ? _ZN12IODMACommand10getSegmentEjjRN16IODMACommandBase9Segment64E+0x2c/0x48 [blackmagic_io]
[   62.371317]  ? _ZN16IODMACommandBase17gen64IOVMSegmentsEPyPNS_9Segment64EPj+0xd0/0x15a [blackmagic_io]
[   62.371361]  ? _ZN22MemDescriptorBusMapper13genBusAddressEyRN16IODMACommandBase9Segment64E+0x65/0x284 [blackmagic_io]
[   62.371396]  ? _ZN8OSObjectC2EPK11OSMetaClass+0xe/0x20 [blackmagic_io]
[   62.371427]  ? _ZN16IODMACommandBaseC2EPK11OSMetaClass+0xe/0x28 [blackmagic_io]
[   62.371453]  ? _ZN12IODMACommandC1Ev+0x2d/0x32 [blackmagic_io]
[   62.371496]  ? _ZN10DMAElement10addSegmentEP22MemDescriptorBusMapperyyjb+0x10a/0x342 [blackmagic_io]
[   62.371538]  ? _ZN10DMAElement10addSegmentEP18IOMemoryDescriptoryyj+0x5f/0x7a [blackmagic_io]
[   62.371578]  ? _ZN22MemDescriptorBusMapper8withDescEP9DMAEngineP18IOMemoryDescriptorb+0xbe/0xbe [blackmagic_io]
[   62.371620]  ? _ZN17AudioSampleBuffer12configureDMAEP9DMAEngineR12AutoOSObjectI10DMAElementE+0xa6/0xc4 [blackmagic_io]
[   62.371667]  ? _ZN17AudioSampleBuffer4initEP19VideoHardwareDeviceP9DMAEngineS3_i+0xfe/0x164 [blackmagic_io]
[   62.371705]  ? _ZN17AudioSampleBuffer11withOptionsEP19VideoHardwareDeviceP9DMAEngineS3_i+0x4b/0x6a [blackmagic_io]
[   62.371744]  ? _ZN18BlackmagicIODriver29configureEnginesAndInterfacesEv+0x1b8/0x538 [blackmagic_io]


the allocation here is 3072000 bytes which does align with the (normal) iommu page size of 4096 bytes. however after a number of tests I found the address was always (x*4096)+16. therefore I don't think it will ever align with the iommu page size.

I have got a patch that makes it initialize successfully in 5.10, but as it's only the audio buffer, which I haven't been able to test I still need to ensure it's not breaking audio.

the bounce buffer implementation has changed in 5.11+ so this might solve the issue (i have not tested 5.11+ so this is just a guess), however, I am also running Debian stable (11) which means 5.10 isn't going away any time soon, it is unlikely the implementation changes will be backported to the 5.10 series either.
Offline

maxikrie

  • Posts: 2
  • Joined: Tue Nov 16, 2021 4:56 pm
  • Real Name: Max Kriegleder

Re: DesktopVideo driver crash linux

PostMon Nov 22, 2021 5:39 pm

Thank you for the detailed explanation!

Shouldn't this be fixable on the Blackmagic side?
Offline

xzcvczx

  • Posts: 4
  • Joined: Sat Nov 13, 2021 2:10 pm
  • Real Name: Simon Wells

Re: DesktopVideo driver crash linux

PostMon Dec 13, 2021 9:16 pm

i have just tried desktopvideo 12.2.2 with 5.15 with no issues (without having to use nobounce) i didn't see anything in the desktopvideo changelog so i am not sure if something has changed in the kernel or whether its just not in the changelog
Offline

Entropy512

  • Posts: 9
  • Joined: Wed Jan 19, 2022 3:04 pm
  • Real Name: Andrew Dodd

Re: DesktopVideo driver crash linux

PostWed Jan 19, 2022 3:09 pm

xzcvczx wrote:
I have got a patch that makes it initialize successfully in 5.10, but as it's only the audio buffer, which I haven't been able to test I still need to ensure it's not breaking audio.


Would you mind sharing that so I can take a look?

5.13 + Ubuntu 21.10 is still problematic

I haven't had a chance to test mainline 5.15 yet, but would prefer to remain on 5.13

Also of note - intel_iommu=nobounce appears to be only present in Redhat kernels, not Debian or its derivatives such as Ubuntu. It isn't in mainline, and isn't in Ubuntu 5.13 - it does nothing (and I grepped the kernel source tree to confirm this for 5.13)

Edit: Some additional digging hints that it may have been present in mainline, but then removed at a later date prior to 5.13
Offline

Entropy512

  • Posts: 9
  • Joined: Wed Jan 19, 2022 3:04 pm
  • Real Name: Andrew Dodd

Re: DesktopVideo driver crash linux

PostWed Jan 19, 2022 11:51 pm

In addition to my previous post:

I tested with 5.15.0 mainline, and in my case, 12.2.2a6 + Ultrastudio Monitor 3G still fail on an Asus TUF Dash F15 with the error reported by the OP

I'd prefer to not compile a modified kernel with a much larger IO_TLB_SEGSIZE, and nobounce is no longer an option. (I would be willing to live with the security risks of "untrusted Thunderbolt device could behave badly" given that I have one Thunderbolt peripheral and I trust it... Other than the fact that its current driver causes a kernel panic!)
Offline

_doph_

  • Posts: 1
  • Joined: Wed Jan 26, 2022 9:58 pm
  • Real Name: chrs kenn

Re: DesktopVideo driver crash linux

PostWed Jan 26, 2022 10:16 pm

Also ran into this frustrating failure trying to use UltraStudio HD Mini on Ubuntu 20.04. I tried the 3 most recent desktop video driver versions. I tried kernels 5.11, 5.13, 5.15 and tried a number of kernel parameters related to iommu and swiotlb. Nothing worked - always the same error (except iommu=soft, which allowed the driver to load, but I could get no video off the device).

Then I tried disabling Intel VT-d in BIOS and that finally worked (without any extra kernel parameters). Not an ideal solution, but mentioning it here in case I can save anyone else the headache this gave me.
Offline

tautin

  • Posts: 108
  • Joined: Thu Oct 18, 2018 3:11 pm
  • Real Name: Tim Autin

Re: DesktopVideo driver crash linux

PostFri Mar 04, 2022 12:21 pm

Hello,
Did you get it to work? I'm also trying to use UltraStudio / DeckLink devices with an Intel NUC Enthusiast NUC11PHKi7CAA without success for now. Tried DesktopVideo 12.2.2 with Ubuntu 20.04, 21.04, Fedora 35 workstation, kernels 5.13 to 5.16...
Offline

tautin

  • Posts: 108
  • Joined: Thu Oct 18, 2018 3:11 pm
  • Real Name: Tim Autin

Re: DesktopVideo driver crash linux

PostThu Mar 10, 2022 10:07 pm

Re,
We likely had the same problem and I found a solution, see my 2nd post here: viewtopic.php?f=12&t=156298

Return to Software Developers

Who is online

Users browsing this forum: No registered users and 21 guests