driver crashes when using Realtime Linux Kernel (Debian 11)

Questions about ATEM Switchers, Camera Converter and everything live!
  • Author
  • Message
Offline

ericfont

  • Posts: 2
  • Joined: Thu Jun 17, 2021 5:32 am
  • Real Name: Eric Fontaine

driver crashes when using Realtime Linux Kernel (Debian 11)

PostThu Jun 17, 2021 5:47 am

I can run the kernel module with my Blackmagic Design DeckLink Mini Recorder just fine one Debian 11's default kernel (linux 5.10.40), however if I install Debian's corresponding realtime kernel, whatever application that tries to use the blackmagic kernel module (such as when I add a new BlackMagic source in OBS) will freeze when it tries to load the module. Here is the relevant output of /var/log/messages

Jun 17 01:20:13 efjz kernel: [ 7150.573671] blackmagic: Loading driver (version: 12.1a9)
Jun 17 01:21:36 efjz kernel: [ 7231.849743] PGD 1890c9067 P4D 1890c9067 PUD 178590067 PMD 0
Jun 17 01:21:36 efjz kernel: [ 7231.849747] Oops: 0002 [#1] PREEMPT_RT SMP NOPTI
Jun 17 01:21:36 efjz kernel: [ 7231.849749] CPU: 4 PID: 604 Comm: blackmagic Tainted: P OE 5.10.0-7-rt-amd64 #1 Debian 5.10.40-1
Jun 17 01:21:36 efjz kernel: [ 7231.849752] Hardware name: System manufacturer System Product Name/ROG STRIX B350-F GAMING, BIOS 5603 07/28/2020
Jun 17 01:21:36 efjz kernel: [ 7231.849753] RIP: 0010:rt_spin_lock+0x10/0x40
Jun 17 01:21:36 efjz kernel: [ 7231.849758] Code: c3 89 c6 48 89 df e8 2f b6 80 ff 66 90 5b c3 cc cc cc cc cc cc cc cc cc cc cc 0f 1f 44 00 00 31 c0 65 48 8b 14 25 40 7c 01 00 <f0> 48 0f b1 57 18 48 85 c0 75 0a e8 40 d3 82 ff e9 5b a1 7d ff e8
Jun 17 01:21:36 efjz kernel: [ 7231.849760] RSP: 0018:ffffae7f8075fcb8 EFLAGS: 00010246
Jun 17 01:21:36 efjz kernel: [ 7231.849762] RAX: 0000000000000000 RBX: ffff9c459ec48d80 RCX: 0000000000000003
Jun 17 01:21:36 efjz kernel: [ 7231.849763] RDX: ffff9c44818fb180 RSI: ffffae7f8075fcd8 RDI: 0000000000000000
Jun 17 01:21:36 efjz kernel: [ 7231.849764] RBP: ffffae7f8075fd10 R08: 0000000000000000 R09: 0000000000000000
Jun 17 01:21:36 efjz kernel: [ 7231.849765] R10: 0000000000000000 R11: 0000000000000000 R12: ffff9c45f3dc0b10
Jun 17 01:21:36 efjz kernel: [ 7231.849766] R13: 0000000000000003 R14: 0000000000000000 R15: 0000000000000000
Jun 17 01:21:36 efjz kernel: [ 7231.849767] FS: 0000000000000000(0000) GS:ffff9c4b7e900000(0000) knlGS:0000000000000000
Jun 17 01:21:36 efjz kernel: [ 7231.849769] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
Jun 17 01:21:36 efjz kernel: [ 7231.849770] CR2: 0000000000000018 CR3: 00000001890fc000 CR4: 00000000003506e0
Jun 17 01:21:36 efjz kernel: [ 7231.849772] Call Trace:
Jun 17 01:21:36 efjz kernel: [ 7231.849776] bmio_notify_add+0x6c/0xa4 [blackmagic_io]
Jun 17 01:21:36 efjz kernel: [ 7231.849814] ? rt_spin_unlock+0x13/0x40
Jun 17 01:21:36 efjz kernel: [ 7231.849816] ? bmio_client_notify+0x14/0x40 [blackmagic_io]
Jun 17 01:21:36 efjz kernel: [ 7231.849846] ? _ZN20UserClientClassLinux19notifyClientOfEventEjjjjj+0x71/0x9a [blackmagic_io]
Jun 17 01:21:36 efjz kernel: [ 7231.849890] ? _ZN19AudioInputInterface22handlePrimaryInterruptEy+0x36/0x36 [blackmagic_io]
Jun 17 01:21:36 efjz kernel: [ 7231.849934] ? _ZN19VideoInputInterface19videoFrameCompletedEP10VideoFrameh+0xc2/0x13c [blackmagic_io]
Jun 17 01:21:36 efjz kernel: [ 7231.849973] ? _ZN10IOWorkLoop9runActionEPFiP8OSObjectPvS2_S2_S2_ES1_S2_S2_S2_S2_+0x66/0x66 [blackmagic_io]
Jun 17 01:21:36 efjz kernel: [ 7231.850003] ? _ZN19VideoInputInterface25videoFrameCompletedStaticEP8OSObjectP10VideoFrameh+0xc/0xe [blackmagic_io]
Jun 17 01:21:36 efjz kernel: [ 7231.850036] ? _ZN15VideoInputFrame21videoFrameDMACallbackEP8OSObjectP10DMAElementj+0x164/0x1a6 [blackmagic_io]
Jun 17 01:21:36 efjz kernel: [ 7231.850074] ? _ZN15VideoInputFrame27videoFrameDMACallbackStaticEP8OSObjectP10DMAElementj+0x11/0x13 [blackmagic_io]
Jun 17 01:21:36 efjz kernel: [ 7231.850106] ? _ZN10DMAElement14signalCallbackEj+0x53/0x88 [blackmagic_io]
Jun 17 01:21:36 efjz kernel: [ 7231.850150] ? _ZN8DMAQueue14dequeueElementEv+0x4f/0x58 [blackmagic_io]
Jun 17 01:21:36 efjz kernel: [ 7231.850194] ? _ZN9DMAEngine24handleSecondaryInterruptEv+0x40/0x48 [blackmagic_io]
Jun 17 01:21:36 efjz kernel: [ 7231.850238] ? _ZN18BlackmagicIODriver24handleSecondaryInterruptEP22IOInterruptEventSourcei+0x6f/0x682 [blackmagic_io]
Jun 17 01:21:36 efjz kernel: [ 7231.850277] ? _ZN33BlackmagicIOSupervisorEventSource12checkForWorkEv+0x39/0x48 [blackmagic_io]
Jun 17 01:21:36 efjz kernel: [ 7231.850317] ? _ZN10IOWorkLoop15runEventSourcesEv+0x53/0xa4 [blackmagic_io]
Jun 17 01:21:36 efjz kernel: [ 7231.850347] ? _ZN10IOWorkLoop10threadMainEv+0x21/0x5a [blackmagic_io]
Jun 17 01:21:36 efjz kernel: [ 7231.850377] ? _raw_spin_lock_irqsave+0x26/0x50
Jun 17 01:21:36 efjz kernel: [ 7231.850379] ? _raw_spin_unlock_irqrestore+0x20/0x60
Jun 17 01:21:36 efjz kernel: [ 7231.850380] ? _ZN10IOWorkLoop22threadMainContinuationEPS_+0xd/0x12 [blackmagic_io]
Jun 17 01:21:36 efjz kernel: [ 7231.850410] ? kthread+0x186/0x1a0
Jun 17 01:21:36 efjz kernel: [ 7231.850413] ? __kthread_parkme+0xa0/0xa0
Jun 17 01:21:36 efjz kernel: [ 7231.850415] ? ret_from_fork+0x22/0x30
Jun 17 01:21:36 efjz kernel: [ 7231.850418] Modules linked in: blackmagic(POE) snd_seq_dummy snd_seq_midi snd_seq_midi_event snd_hrtimer snd_seq igb_avb(OE) nft_chain_nat xt_MASQUERADE nf_nat nf_conntrack_netlink xfrm_user xfrm_algo br_netfilter bridge stp llc sctp overlay binfmt_misc joydev edac_mce_amd snd_hda_codec_realtek snd_hda_codec_generic ledtrig_audio snd_hda_codec_hdmi kvm_amd kvm irqbypass ghash_clmulni_intel snd_hda_intel snd_bebob snd_intel_dspcfg aesni_intel snd_firewire_lib soundwire_intel libaes soundwire_generic_allocation snd_rawmidi eeepc_wmi crypto_simd asus_wmi cryptd snd_seq_device glue_helper snd_soc_core battery sparse_keymap snd_compress rapl soundwire_cadence rfkill snd_hda_codec video wmi_bmof snd_hda_core snd_hwdep soundwire_bus pcspkr snd_pcm ccp k10temp sg blackmagic_io(POE) snd_timer rng_core snd sp5100_tco soundcore watchdog evdev squashfs acpi_cpufreq nf_log_ipv6 ip6t_REJECT nf_reject_ipv6 xt_hl ip6_tables ip6t_rt nf_log_ipv4 nf_log_common ipt_REJECT nf_reject_ipv4 xt_LOG nft_limit
Jun 17 01:21:36 efjz kernel: [ 7231.850458] xt_limit xt_addrtype xt_tcpudp xt_conntrack nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 nft_compat nft_counter loop nf_tables firewire_sbp2 parport_pc libcrc32c nfnetlink ppdev lp parport fuse configfs ip_tables x_tables autofs4 ext4 crc16 mbcache jbd2 crc32c_generic hid_generic usbhid hid uas usb_storage sd_mod amdgpu crc32_pclmul gpu_sched crc32c_intel ttm drm_kms_helper cec ahci dca firewire_ohci nvme xhci_pci ptp i2c_piix4 libahci firewire_core drm pps_core xhci_hcd crc_itu_t i2c_algo_bit nvme_core libata t10_pi usbcore crc_t10dif scsi_mod crct10dif_generic crct10dif_pclmul usb_common crct10dif_common wmi gpio_amdpt gpio_generic button [last unloaded: igb]
Jun 17 01:21:36 efjz kernel: [ 7231.850492] CR2: 0000000000000018
Jun 17 01:21:36 efjz kernel: [ 7231.850494] ---[ end trace 0000000000000002 ]---
Jun 17 01:21:36 efjz kernel: [ 7233.834911] RIP: 0010:rt_spin_lock+0x10/0x40
Jun 17 01:21:36 efjz kernel: [ 7233.834919] Code: c3 89 c6 48 89 df e8 2f b6 80 ff 66 90 5b c3 cc cc cc cc cc cc cc cc cc cc cc 0f 1f 44 00 00 31 c0 65 48 8b 14 25 40 7c 01 00 <f0> 48 0f b1 57 18 48 85 c0 75 0a e8 40 d3 82 ff e9 5b a1 7d ff e8
Jun 17 01:21:36 efjz kernel: [ 7233.834921] RSP: 0018:ffffae7f8075fcb8 EFLAGS: 00010246
Jun 17 01:21:36 efjz kernel: [ 7233.834923] RAX: 0000000000000000 RBX: ffff9c459ec48d80 RCX: 0000000000000003
Jun 17 01:21:36 efjz kernel: [ 7233.834925] RDX: ffff9c44818fb180 RSI: ffffae7f8075fcd8 RDI: 0000000000000000
Jun 17 01:21:36 efjz kernel: [ 7233.834926] RBP: ffffae7f8075fd10 R08: 0000000000000000 R09: 0000000000000000
Jun 17 01:21:36 efjz kernel: [ 7233.834927] R10: 0000000000000000 R11: 0000000000000000 R12: ffff9c45f3dc0b10
Jun 17 01:21:36 efjz kernel: [ 7233.834927] R13: 0000000000000003 R14: 0000000000000000 R15: 0000000000000000
Jun 17 01:21:36 efjz kernel: [ 7233.834929] FS: 0000000000000000(0000) GS:ffff9c4b7e900000(0000) knlGS:0000000000000000
Jun 17 01:21:36 efjz kernel: [ 7233.834930] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033
Jun 17 01:21:36 efjz kernel: [ 7233.834931] CR2: 0000000000000018 CR3: 00000001890fc000 CR4: 00000000003506e0


The line that says rt_spin_lock seems suggestive.

I should note that it is important for me to use realtime kernel since I need it for low-latency audio. So I would like to be able to use blackmagic with realtime kernel.

other relevant system output:

uname -a:
Linux efjz.in 5.10.0-7-rt-amd64 #1 SMP PREEMPT_RT Debian 5.10.40-1 (2021-05-28) x86_64 GNU/Linux


dkms status -m blackmagic -k `uname -r`
blackmagic, 12.1a9, 5.10.0-7-rt-amd64, x86_64: installed


dkms status -m blackmagic-io -k `uname -r`
blackmagic-io, 12.1a9, 5.10.0-7-rt-amd64, x86_64: installed
Offline

ericfont

  • Posts: 2
  • Joined: Thu Jun 17, 2021 5:32 am
  • Real Name: Eric Fontaine

Re: driver crashes when using Realtime Linux Kernel (Debian

PostThu Jun 17, 2021 4:15 pm

And I notice in the Readme.txt of the Blackmagic_Desktop_Video_Linux_12.1.tar download that:

* Driver fails to build against certain version of linux-rt

Some versions of the linux-rt patchset may be incompatible with the
driver.


So I understand that realtime kernel is is not officially supported, though may be possible with certain linux versions. Does anyonoe know of a particular linux-rt version that works?

And I'm noting that a couple others have had the same issue...if I google search for blackmagic "rt_spin_lock" I get:

viewtopic.php?f=3&t=20086 (4K Extreme Card on Arch Linux x86_64 3.12.13-rt21)
viewtopic.php?f=12&t=136187 (Decklink Intensity Pro 4k on a computer running the Ubuntu 20.04 Real-time kernel 5.4.47-rt28)
viewtopic.php?f=12&t=36457 (DeckLink 4K Extreme custom-build 3.18.13-rt10 kernel on Ubuntu 14.04)

Return to Live Production

Who is online

Users browsing this forum: No registered users and 53 guests