How to compile/patch kernel with custom ALSA driver?

Hello all, I’ve got a MOTU 1248 audio interface that misbehaves under every Linux distro I’ve tried. I’ve hopped on Manjaro in the hopes that newer kernels (with USB implicit feedback support) would help to no avail. However some enterprising individuals over at linuxmusicians dot com have managed to (at least mostly) suss out the problems and have produced an ALSA driver that is purported to work.

How do I go about patching this in on a Manjaro system? I see no kernel source packages in the GUI package manager so I can’t replace the existing .c file to compile and patch. I tried to clone the gitlab /core/linux58 project but that didn’t seem to yield the results I wanted. I can always download from kernel dot org but I imagine there are some Manjaro-specific patches to deal with? I can’t seem to find anything in Wiki about compiling custom kernels in Manjaro.

Thank you!

Try reading this:

1 Like

Thanks, that helps me with the compiling aspect, it looks like I’ll have to write a .patch file to integrate it during the automated build process.

*OK, that plus the Arch Wiki page for patching packages has got me started, thank you.

makepkg --nobuild

was the magic command to get the source downloaded.

The process was a little different for me due to patching and already having the source downloaded at compile time. So for patching a kernel from Gitlab I did the following:

  1. Clone the desired kernel from the Manjaro Gitlab as described in realmain’s link above. Do not run compile yet.

  2. Instead of makepkg -s, run makepkg --nobuild to retrieve sources

  3. Create patch file as described in the Arch Wiki page ‘Patching Packages’. Be sure to make copies of directories, etc. as described so paths are correct. Edit the .patch file you create and double check the paths!

  4. Now skip step 7 of the first section, we don’t want to apply the patch manually, we want to use the compile-time patch system so proceed to the next section and add your .patch to the PKGBUILD file. All I had to do was add my motuavb.patch to the ‘sources’ section.

  5. Run updpkgsums to generate new checksums

  6. Run makepkg -Csf to clean the directory and compile with patches

  7. Run sudo pacman -U on the .tar.xz packages that makepkg created.

  8. Reboot and enjoy your new patched kernel

2 Likes

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.