Boss Katana + Linux = ❤️

Disclaimer: Since you are modifying your kernel, things can go wrong and you might end up with a system that is not bootable. Make a backup of your important data. You have been warned.

So you got this great amp, you hooked it up to your Linux machine, and then… silence. Well, it’s about time to change that.

In this guide, I will walk you through the process of making your Katana and Linux like each other. In order to do that, you will have to tweak the included USB audio driver in your kernel. It sounds complicated, but it actually is not.

I won’t go into much detail of what we are changing and why, there is an ongoing discussion here, if you want to read more.

I’ve tested this workaround on a few different kernel versions, and it seems to be working. I am also assuming that you’re using an Ubuntu-derivative.

Here is the gist of what you will have to do

  1. Install the tools and dependencies required for building the kernel from source
  2. Download the kernel sources
  3. Prepare the kernel sources for building
  4. Patch the USB audio module
  5. Build the new USB audio module
  6. Install the new USB audio module

Installing the tools and dependencies

Open a terminal and run these commands:

sudo apt install build-essential -y
sudo apt build-dep linux -y

Getting the kernel sources

I created a folder called katana in my home directory and downloaded the sources there.

mkdir ~/katana
cd ~/katana
apt source linux

After running the commands above, you should see several archive files and one folder that begins with linux and ends with a version number. You don’t have to worry about the version number, the command above will always download the source code of the latest available kernel for your distribution, which you should be running if you do updates regularly.

Preparing the kernel sources

Navigate to the single directory created in your katana folder:

cd linux-*

You want to use the same configuration as the currently running kernel, which you can do by copying these files over to the root of the source directory.

cp /lib/modules/`uname -r`/build/.config . -v
cp /lib/modules/`uname -r`/build/Module.symvers . -v

Then you need to update the Makefile according to the currently running kernel.

For that, you need to find the version of the kernel you are currently using:

uname -r

On my system, this command gives the following output:

5.0.0-16-lowlatency

If I were to dissect the output, I would get the following parts:

Version: 5
Patch level: 0
Sub level: 0
Extra version: -16-lowlatency

You will find similar variables in your Makefile. In my case the sub level was always different in the Makefile than the output of uname -r, and if the numbers don’t match, you will get errors.

Open your Makefile in any text editor and you should see lines similar to these at the beginning of the file:

VERSION = 5
PATCHLEVEL = 0
SUBLEVEL = 18
EXTRAVERSION =

Make sure that the variables reflect the output of uname -r

My Makefile looked like this after the changes:

VERSION = 5
PATCHLEVEL = 0
SUBLEVEL = 0
EXTRAVERSION = -16-lowlatency

Save the file and run the following command:

make modules_prepare

If nothing threw an error, you are ready for the next step.

Patching the USB audio module

For this, you will need to connect your Katana to your machine and find out the USB identifiers:

lsusb | grep Roland

This will list the connected USB devices, and filter the output to entries that contain the word Roland, which is the company behind Boss and therefore your amp.

You should get one line, something like this:

Bus 001 Device 004: ID 0582:01d8 Roland Corp.

You are interested in the 0582:01d8 part. That is the USB Vendor and Product identifier. You will have to use those numbers when patching the USB audio driver.

If you get no input, check your USB cable, or try a different USB port.

Now you are going to patch the USB audio driver.

This part will be different for each kernel version, but stick with me. Open the pcm.c file in the sound/usb folder with a text editor. The changes that you will have to make will be around line 355.

This is the part of the code that you are looking for:

case USB_ID(0x1397, 0x0002): /* Behringer UFX1204 */
    ep = 0x81;
    ifnum = 1;
    goto add_sync_ep_from_ifnum;
}

if (attr == USB_ENDPOINT_SYNC_ASYNC &&

You will have to add some extra code right after goto add_sync_ep_from_ifnum;. The affected part of the file should look something like this:

case USB_ID(0x1397, 0x0002): /* Behringer UFX1204 */
    ep = 0x81;
    ifnum = 1;
    goto add_sync_ep_from_ifnum;

case USB_ID(0x0582, 0x01d8): /* Boss Katana 100 */
    return 0;
}

if (attr == USB_ENDPOINT_SYNC_ASYNC &&

Save the file.

Building the USB audio module

make M=sound/usb

If everything goes executes without an error, you have successfully built a patched version of the USB audio module.

Installing the patched module

It’s a good idea to make a backup before you make any changes to your current kernel.

sudo cp /lib/modules/`uname -r`/kernel/sound/usb/snd-usb-audio.ko /lib/modules/`uname -r`/kernel/sound/usb/snd-usb-audio.ko.old -v

You have to make sure that the module is not in use before installing our own.

sudo rmmod snd-usb-audio

Then overwrite current module with the patched one:

sudo cp ./sound/usb/snd-usb-audio.ko /lib/modules/`uname -r`/kernel/sound/usb/snd-usb-audio.ko -v

Then you need to refresh the modules:

sudo depmod -a

And finally load the module

sudo modprobe snd-usb-audio

You should be able to record your Katana on Linux now.

Final thoughts

Since you are patching the currently running kernel, it means that every time there is a new kernel update, you will have to do the same on that new kernel or your Katana will stop working.

One day this workaround might make its way into the Linux kernel, in which case this guide will become obsolete.

Advertisement

24 thoughts on “Boss Katana + Linux = ❤️

  1. Is this just to record on Linux? I’m trying to get the Tone Studio software to work. I’m also a programmer, but have little knowledge of Linux.

    Like

  2. Any idea, in which kernel version the changes will be included? Trying to build the module as described, but it’s constantly failing with WARNING: ”dev_warn” [sound/usb/snd-usb-audio.ko] undefined! error messages on 5.0.0-37-generic.

    Like

      1. Just updated to Ubuntu 19.10, running on 5.3.0-26-generic. Confirming that Boss Katana is automatically detected and can be used with e.g. QJackCTL. Thanks for your efforts!

        Liked by 1 person

  3. Do you get completely clean output with this fix? I was able to get sound working on my Boss GT-1 using this patch (by adding the GT-1 device ID). I get frequent audio dropouts, though, even at high buffer sizes, which leads me to believe that it is still not *quite* configured correctly.

    Like

    1. Hey, I get quiet input. I’m using a low latency kernel. This is more of a workaround than an actual fix, so it might not work that well for your particular device.

      Like

      1. Thanks for the quick response. The GT-1 USB implementation seems very similar to the Katana, but it must be different enough to cause issues.

        Like

  4. Do you get completely clean output using this patch? I successfully got my Boss GT-1 to work using this method (by adding the GT-1 device ID). I get frequent audio dropouts, though, even using large buffer sizes, which leads me to believe that it is still not *quite* configured properly.

    Like

    1. I have no way of telling or verifying that but I would not get my hopes up. The amp is most likely not class compliant which causes it to need a special driver. The manufacturer could have altered the USB implementation in any number of ways which would need either a quirk in the audio driver or a custom driver.

      Like

  5. @Szabi Thanks a lot for this. I was wandering if the changes have been already integrated officially in the Linux kernel (see comment of Laadron). Since I am not an expect, can you please give me the Kernel release number which contains this patch. Again, thanks a lot for helping the Linux user community 😀

    Like

      1. you are right. Thanks. With the kernel 5.12.0, everything works like a charm.

        Like

  6. hi, im serching the way to control my boss katana mk2 with my midi pedalboard. i have no idea about programmig.
    but im able to learn the necesary to make it work.

    Like

    1. Hey!

      The manual describes some MIDI messages that the amp can take.

      The problem is that only the Artist and the Head models have a physical MIDI in.

      The rest of the models can only take MIDI messages from the USB.

      Like

  7. Thanks for this thread. Now it’s 2022 and I’m running Ubuntu Studio jammy (22.04). The kernel is 5.15.0-52-lowlatency. When I plug in the Katana USB, it is recognized (as USB3,0,0) with 4 audio ins/outs in Carla and can be routed to audio applications (I’m using Sooperlooper and Audacity). However the gain is really high and the sample rate is stuck at 44100. I wonder if things regressed since 2021?

    Like

    1. They could have. I know that things changed a lot since I documented this hack here. The code looked a lot different last time I checked.

      If you want to investigate this, I’d start with FX Floorboard and look at the USB levels configured for the amp.

      I don’t have a Katana amp anymore so I haven’t been following the state of the Linux driver.

      Like

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s