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.

11 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

  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

Leave a Reply to Szabi Cancel 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 )

Google photo

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

Twitter picture

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

Facebook photo

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

Connecting to %s