Blackmagic Desktop Video- unable to compile driver

Do you have questions about Desktop Video, Converters, Routers and Monitoring?
  • Author
  • Message
Offline

Chong Yew Lee

  • Posts: 3
  • Joined: Fri Oct 24, 2014 5:47 pm

Blackmagic Desktop Video- unable to compile driver

PostFri Oct 24, 2014 5:55 pm

Hi,

I have a Blackmagic Intensity Pro card and I'm having some issues building and installing the driver.

The card is located in an Ubuntu HTPC. I just upgraded the machine to Utopic Unicorn 14.10. I noticed that the previous 10.1 driver can't build in the system so I grabbed 10.2.2 (apparently 10.2.3 is for Mac OS X only?). Right away I ran into DKMS building issues. Attempting to build the module manually isn't helping.

I'm getting this error:
Code: Select all
/usr/src/blackmagic-io-10.2.2a8/bmio_audio.c: In function ‘bmio_audio_init_sound_card’:
/usr/src/blackmagic-io-10.2.2a8/bmio_audio.c:377:2: error: implicit declaration of function ‘snd_card_create’ [-Werror=implicit-function-declaration]
  r = snd_card_create(-1, "BlackmagicIO", THIS_MODULE, 0, &card);
  ^
cc1: some warnings being treated as errors
scripts/Makefile.build:257: recipe for target '/usr/src/blackmagic-io-10.2.2a8/bmio_audio.o' failed
make[2]: *** [/usr/src/blackmagic-io-10.2.2a8/bmio_audio.o] Error 1
Makefile:1345: recipe for target '_module_/usr/src/blackmagic-io-10.2.2a8' failed
make[1]: *** [_module_/usr/src/blackmagic-io-10.2.2a8] Error 2
make[1]: Leaving directory '/usr/src/linux-headers-3.16.0-23-generic'
Makefile:47: recipe for target 'all' failed
make: *** [all] Error 2

Forgive me because C isn't exactly a programming language I'm accustomed to using, but is there any way I can get the driver to compile?

Any help would be greatly appreciated, thanks in advance.
Offline

Paul Parsons

  • Posts: 27
  • Joined: Wed Apr 30, 2014 10:38 pm

Re: Blackmagic Desktop Video- unable to compile driver

PostSat Oct 25, 2014 11:25 am

Presumably you are building against the linux-3.16 kernel or later. If so then the blackmagic-io-10.2.2a8 driver will not compile because of an internal API change (the inline function snd_card_create() was removed):

https://github.com/torvalds/linux/commit/038b8455db9e08f295cb39cda7bec9c2e8e8674d

I encountered the same compile problem, so after a cursory examination of the blackmagic-io-10.2.2a8 driver code I created the following patch:

Code: Select all
diff -ru a/usr/src/blackmagic-io-10.2.2a8/bmio_audio.c b/usr/src/blackmagic-io-10.2.2a8/bmio_audio.c
--- a/usr/src/blackmagic-io-10.2.2a8/bmio_audio.c   2014-10-07 23:31:11.000000000 +0100
+++ b/usr/src/blackmagic-io-10.2.2a8/bmio_audio.c   2014-10-25 11:26:59.663613626 +0100
@@ -25,6 +25,7 @@
 ** -LICENSE-END-
 */
 #include <linux/module.h>
+#include <linux/pci.h>
 #include <linux/slab.h>
 #include <linux/wait.h>
 #include <linux/version.h>
@@ -374,7 +375,11 @@
    struct snd_card* card;
    int r;
 
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 16, 0)
    r = snd_card_create(-1, "BlackmagicIO", THIS_MODULE, 0, &card);
+#else
+   r = snd_card_new(&aud->drv->pci->pdev->dev, -1, "BlackmagicIO", THIS_MODULE, 0, &card);
+#endif
    if (r < 0)
       return r;
 


This patch is completely untested, though the blackmagic-io-10.2.2a8 driver will now compile.

Since the Intensity Pro uses the older blackmagic.ko driver rather than the newer blackmagic-io.ko and snd_blackmagic-io.ko drivers, this should fix your problem pending an authoritative fix from BM.

Once the blackmagic.ko driver was loaded I found I also needed to update the Intensity Pro firmware.
Offline

Chong Yew Lee

  • Posts: 3
  • Joined: Fri Oct 24, 2014 5:47 pm

Re: Blackmagic Desktop Video- unable to compile driver

PostSat Oct 25, 2014 6:19 pm

Okay, this is pretty weird. I've examined the code in bmio_audio.c and there is a method declaring snd_card_create that technically maps to snd_card_new, but it's blocked by an #IF and seems to only trigger if the kernel module is 2.16.

Thanks for the find tho! I couldn't find anything about the removal (in fact, I was under the impression that it was snd_card_new that was deprecated based on said #IF block). I'll patch the code and see what happens.
Offline

phillipseamore

  • Posts: 32
  • Joined: Sat Sep 08, 2012 7:24 pm

Re: Blackmagic Desktop Video- unable to compile driver

PostTue Oct 28, 2014 9:12 am

Just a +1 here to push this up BMD's todo list. Same issues on 3.16 kernel.

Return to Post Production

Who is online

Users browsing this forum: jameswalker1248 and 27 guests