Line6 toneport kb37 + zynthian

Hi, I build a headless zynthyan on my raspberry Raspberry Pi 3 Model B Plus and I would like to add an old line6 toneport kb37 ( Line 6 Legacy Products) i own, as sound card and midi keyboard.
Do you think is possible? Any guide to install it on the raspy and let it use by zynthian?

Hi @nojarec, welcome.

This toneport kb37 looks so sweet, I hope you will get it to work with Zynthian. It’s really in the Zynthian spirit’s imho: compact and versatile …

Usually, most of the USB sound cards are so called “class compliant” wich means pratically : should work out of the box.
So if you already have a running Zynthian OS you can just plug the keyboard and see how Linux reacts (make the use of “demesg” command before and after plugin in the keyboard. If you get some kernel reactions you’re on the good way.
Then use commands “aplay -L”, “arecord -L” to identify the USB peripherical name you will have to use in jackd soundserver configuration.

But before going headless I suggest you to start with a display (any HDMI display is Okay). It’s much more easier to get started this way.

Don’t hesitate to ask for any help when needed.

Yet check and test Zynthian with a hdmi display and now I’m accessing it on wifi
Yesterday Kb37 seems to not to power on when connected to USB (on mac you should install the drivers first to have power on it).

I tried this:
http://www.ubuntugeek.com/how-to-install-a-line6-guitarport-or-toneport-ux1-or-gx.html

and this:

but without success

How can i access jackd soundserver configuration?

This has to be done within webconf under “Hardware audio”.

Did you investigate as I explain above. Having logs from the system will help a lot

Ok, I briefly check the links you’ve provided.
The one on ubuntugeek is really old and not accurate anymore.
But next one is pretty good.

So these Line6 products needs a dedicatd kernel module to be build. You’ve done that but “it doesn’t work”. Okay, but as already said, without some kernel logs it will be hard to debug

Also, check if the kernel module (=driver) you have built is loaded at startup using command “lsmod”

This device is not class compliant so needs drivers to work on any OS. There is a guide here on how to compile drivers for this device on Linux. This guide is for Ubuntu but should work on Zynthian too.

[Edit] The subversion repository for this is no longer valid. I will look to see if it is hosted elsewhere…

Hi @riban , as I understand so far, driver is in linux kernel source but is not available “as is” (precompiled) in RBPi Os.

The driver source is available from Debian repo but does not build on a Raspberry Pi with error:

arch/arm/Makefile:57: *** Recursive variable 'KBUILD_CFLAGS' references itself (eventually).  Stop.

I have limited time to look at this and no way to test it. It would be great to add this as a supported device in Zynthian but at the moment it doesn’t work.

Line6 Linux software / Code / [r1110] this repository could work?

No, it’s totally outdated. The INSTALL procedure talk from kernel version 2.6, Zynthian runs 5.10 !

And now the driver is in mainline linux tree, see here: linux/sound/usb/line6 at master · torvalds/linux · GitHub
and is also in the raspberrypi Os: linux/sound/usb/line6 at rpi-5.10.y · raspberrypi/linux · GitHub

And I even found this: Can you please add Toneport UX1 Line 6 driver (USB soundcard) into kernel? · Issue #4562 · raspberrypi/linux · GitHub
so since the 3th of september, a simple apt upgrade or apt dist-upgrade could do the trick ?

Nope! Although the repo is available, I tried to compile from it with errors. It may be the same repo from which the Debian source package is derived which also fails to compile.

On the other hand…

root@zynthian1:~# modinfo snd-usb-line6
filename:       /lib/modules/5.10.63-v7l+/kernel/sound/usb/line6/snd-usb-line6.ko
license:        GPL
description:    Line 6 USB Driver
author:         Markus Grabner <grabner@icg.tugraz.at>
srcversion:     63439B218A50E79F266F08C
depends:        snd-pcm,snd-rawmidi,snd,snd-hwdep
intree:         Y
name:           snd_usb_line6
vermagic:       5.10.63-v7l+ SMP mod_unload modversions ARMv7 p2v8

This suggests that Zynthian should support the Line6 device but the driver may need to be loaded.

Please open a terminal on the Zynthian and run dmesg -w to start the kernel logger output then plug in the device and paste the resulting output here.

You can then remove the device, run the command modprobe snd-usb-line6, run dmesg -w, plug in the device and paste the resulting output here.

You may then run aplay -l (that is a lower case L) and paste the result here.

yeah !
on my ubuntu studio 21.04 desktop:

ls /lib/modules/5.11.0-40-lowlatency/kernel/sound/usb/line6/
snd-usb-line6.ko snd-usb-podhd.ko snd-usb-pod.ko snd-usb-toneport.ko snd-usb-variax.ko

on Zynthian:

ls /lib/modules/5.10.63-v7l+/kernel/sound/usb/line6/
snd-usb-line6.ko snd-usb-toneport.ko

What i’ve done (no success):

sudo apt install git bc bison flex libssl-dev make

git clone --depth=1 https://github.com/raspberrypi/linux

git clone --depth=1 --branch <branch> https://github.com/raspberrypi/linux

cd linux
KERNEL=kernel
make bcmrpi_defconfig

sed -ri "/CONFIG_SND_USB_TONEPORT/ { s/# (\w+).*/\1=m/; i CONFIG_SND_USB_LINE6=m }" .config

make -j4 zImage modules dtbs
sudo make modules_install
sudo cp arch/arm/boot/dts/*.dtb /boot/
sudo cp arch/arm/boot/dts/overlays/*.dtb* /boot/overlays/
sudo cp arch/arm/boot/dts/overlays/README /boot/overlays/
sudo cp arch/arm/boot/zImage /boot/$KERNEL.img

THEN:
dmesg -w
------------output:
[ 135.019323] usb 1-1.2: new full-speed USB device number 7 using dwc_otg
[ 135.193468] usb 1-1.2: New USB device found, idVendor=0e41, idProduct=4143, bcdDevice= 0.01
[ 135.193486] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 135.193493] usb 1-1.2: Product: TonePort KB37
[ 135.193500] usb 1-1.2: Manufacturer: Line 6

THEN:
modprobe snd-usb-line6
dmesg -w
------------output:
[ 226.926078] usb 1-1.2: new full-speed USB device number 7 using dwc_otg
[ 227.100296] usb 1-1.2: New USB device found, idVendor=0e41, idProduct=4143, bcdDevice= 0.01
[ 227.100313] usb 1-1.2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 227.100320] usb 1-1.2: Product: TonePort KB37
[ 227.100327] usb 1-1.2: Manufacturer: Line 6 Ăą

THEN:
aplay -l
------------output: **** List of PLAYBACK Hardware Devices ****
card 0: Headphones [bcm2835 Headphones], device 0: bcm2835 Headphones [bcm2835 Headphones]
Subdevices: 8/8
Subdevice #0: subdevice #0
Subdevice #1: subdevice #1
Subdevice #2: subdevice #2
Subdevice #3: subdevice #3
Subdevice #4: subdevice #4
Subdevice #5: subdevice #5
Subdevice #6: subdevice #6
Subdevice #7: subdevice #7
root@zynthian://zynthian# aplay-

THEN:
lsmod
------------output:
cfg80211 761856 1 brcmfmac
rfkill 32768 6 bluetooth,cfg80211
bcm2835_codec 40960 0
raspberrypi_hwmon 16384 0
bcm2835_isp 32768 0
bcm2835_v4l2 45056 0
v4l2_mem2mem 36864 1 bcm2835_codec
snd_soc_bcm2835_i2s 16384 0
bcm2835_mmal_vchiq 32768 3 bcm2835_isp,bcm2835_codec,bcm2835_v4l2
videobuf2_dma_contig 20480 2 bcm2835_isp,bcm2835_codec
snd_soc_core 225280 1 snd_soc_bcm2835_i2s
videobuf2_vmalloc 16384 1 bcm2835_v4l2
videobuf2_memops 16384 2 videobuf2_dma_contig,videobuf2_vmalloc
i2c_bcm2835 16384 0
videobuf2_v4l2 32768 4 bcm2835_isp,bcm2835_codec,bcm2835_v4l2,v4l2_mem2mem
videobuf2_common 61440 5 bcm2835_isp,bcm2835_codec,bcm2835_v4l2,v4l2_mem2mem,videobuf2_v4l2
snd_compress 20480 1 snd_soc_core
snd_bcm2835 24576 0
snd_pcm_dmaengine 16384 1 snd_soc_core
snd_pcm 110592 5 snd_compress,snd_pcm_dmaengine,snd_soc_bcm2835_i2s,snd_bcm2835,snd_soc_core
videodev 249856 6 bcm2835_isp,bcm2835_codec,videobuf2_common,bcm2835_v4l2,v4l2_mem2mem,videobuf2_v4l2
snd_timer 32768 1 snd_pcm
spi_bcm2835 20480 0
mc 45056 6 bcm2835_isp,bcm2835_codec,videobuf2_common,videodev,v4l2_mem2mem,videobuf2_v4l2
snd 77824 5 snd_compress,snd_timer,snd_bcm2835,snd_soc_core,snd_pcm
vc_sm_cma 32768 2 bcm2835_isp,bcm2835_mmal_vchiq
uio_pdrv_genirq 16384 0
uio 20480 1 uio_pdrv_genirq
fixed 16384 0
i2c_dev 20480 0
ip_tables 28672 0
x_tables 32768 4 ip_tables,nft_compat,xt_tcpudp,xt_DSCP
ipv6 495616 30

ls /lib/modules/5.10.82-v7+/kernel/sound/usb/line6/
snd-usb- snd-usb-line6.ko snd-usb-toneport.ko
root@zynthian://zynthian# modinfo snd-usb-toneport
filename: /lib/modules/5.10.82-v7+/kernel/sound/usb/line6/snd-usb-toneport.ko
license: GPL
description: TonePort USB driver
srcversion: 52589F8A3BD64DE56231748
alias: usb:v0E41p4142ddcdscdpiciscipin00
alias: usb:v0E41p4141ddcdscdpiciscipin
alias: usb:v0E41p4147ddcdscdpiciscipin
alias: usb:v0E41p4151ddcdscdpiciscipin00
alias: usb:v0E41p4150ddcdscdpiciscipin
alias: usb:v0E41p4153ddcdscdpiciscipin
alias: usb:v0E41p4750ddcdscdpiciscipin
depends: snd-usb-line6,snd
intree: Y
name: snd_usb_toneport
vermagic: 5.10.82-v7+ SMP mod_unload modversions ARMv7 p2v8
root@zynthian://zynthian#

modprobe snd-usb-toneport
root@zynthian://zynthian# modprobe snd-usb-line6
root@zynthian://zynthian# lsmod
Module Size Used by
snd_usb_toneport 16384 0
snd_usb_line6 36864 1 snd_usb_toneport
snd_hwdep 16384 1 snd_usb_line6
snd_rawmidi 32768 1 snd_usb_line6
snd_seq_device 16384 1 snd_rawmidi

root@zynthian://zynthian# lsusb -t
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=dwc_otg/1p, 480M
|__ Port 1: Dev 2, If 0, Class=Hub, Driver=hub/4p, 480M
|__ Port 1: Dev 3, If 0, Class=Hub, Driver=hub/3p, 480M
|__ Port 1: Dev 6, If 0, Class=Vendor Specific Class, Driver=lan78xx, 480M
|__ Port 2: Dev 5, If 0, Class=Human Interface Device, Driver=usbhid, 12M
|__ Port 2: Dev 5, If 1, Class=Human Interface Device, Driver=usbhid, 12M
|__ Port 2: Dev 4, If 0, Class=Vendor Specific Class, Driver=, 12M
|__ Port 2: Dev 4, If 1, Class=Vendor Specific Class, Driver=, 12M
root@zynthian://zynthian#

lsusb
Bus 001 Device 004: ID 0e41:4143 Line6, Inc.
Bus 001 Device 005: ID 248a:ff0f Maxxter
Bus 001 Device 006: ID 0424:7800 Standard Microsystems Corp.
Bus 001 Device 003: ID 0424:2514 Standard Microsystems Corp. USB 2.0 Hub
Bus 001 Device 002: ID 0424:2514 Standard Microsystems Corp. USB 2.0 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
root@zynthian://zynthian#

echo snd-usb-toneport > /etc/modules-load.d/snd-usb-toneport.conf

echo “0e41 4143” | sudo tee /sys/bus/usb/drivers/snd_usb_toneport/new_id
0e41 4143

I was able to power it and have sound
BUT
I need to write on console on every boot: echo “0e41 4143” | sudo tee /sys/bus/usb/drivers/snd_usb_toneport/new_id
0e41 4143
AND
midi is not working

ldmof
raspberrypi_hwmon 16384 0
bcm2835_codec 40960 0
i2c_bcm2835 16384 0
bcm2835_isp 32768 0
v4l2_mem2mem 36864 1 bcm2835_codec
bcm2835_v4l2 45056 0
bcm2835_mmal_vchiq 32768 3 bcm2835_isp,bcm2835_codec,bcm2835_v4l2
videobuf2_dma_contig 20480 2 bcm2835_isp,bcm2835_codec
videobuf2_vmalloc 16384 1 bcm2835_v4l2
videobuf2_memops 16384 2 videobuf2_dma_contig,videobuf2_vmalloc
videobuf2_v4l2 32768 4 bcm2835_isp,bcm2835_codec,bcm2835_v4l2,v4l2_mem2mem
snd_soc_bcm2835_i2s 16384 0
videobuf2_common 61440 5 bcm2835_isp,bcm2835_codec,bcm2835_v4l2,v4l2_mem2mem,videobuf2_v4l2
snd_soc_core 225280 1 snd_soc_bcm2835_i2s
videodev 249856 6 bcm2835_isp,bcm2835_codec,videobuf2_common,bcm2835_v4l2,v4l2_mem2mem,videobuf2_v4l2
snd_compress 20480 1 snd_soc_core
spi_bcm2835 20480 0
mc 45056 6 bcm2835_isp,bcm2835_codec,videobuf2_common,videodev,v4l2_mem2mem,videobuf2_v4l2
snd_bcm2835 24576 0
snd_pcm_dmaengine 16384 1 snd_soc_core
vc_sm_cma 32768 2 bcm2835_isp,bcm2835_mmal_vchiq
uio_pdrv_genirq 16384 0
uio 20480 1 uio_pdrv_genirq
fixed 16384 0
snd_usb_toneport 16384 0
snd_usb_line6 36864 4 snd_usb_toneport
snd_hwdep 16384 1 snd_usb_line6
snd_rawmidi 32768 1 snd_usb_line6
snd_seq_device 16384 2 snd_seq,snd_rawmidi
snd_pcm 110592 8 snd_compress,snd_pcm_dmaengine,snd_soc_bcm2835_i2s,snd_usb_line6,snd_bcm2835,snd_soc_c
ore
snd_timer 32768 3 snd_seq,snd_hrtimer,snd_pcm
snd 77824 16 snd_compress,snd_hwdep,snd_seq,snd_timer,snd_rawmidi,snd_usb_line6,snd_seq_device,snd
_bcm2835,snd_soc_core,snd_pcm,snd_usb_toneport
i2c_dev 20480 0
ip_tables 28672 0
x_tables 32768 4 ip_tables,nft_compat,xt_tcpudp,xt_DSCP
ipv6 495616 34
root@zynthian://zynthian#

I don’t think you needed to recompile the kernel. You will see in my last post that these drivers are already part of the ZynthianOS distribution. Hopefully you haven’t broken anything else in the kernel. (I tend to find that happens when I compile a kernel!)

Well done for getting the audio working but it is odd that you need to reassert the USB config each boot. Are you able to test this with the stock ZynthianOS image?

It would be good to get the audio working out-of-the-box and then look at MIDI.

I worked on the ZynthiaOS image. I’m testing on ZynthianOS

Yes, but you then recompiled the kernel. I expect this should work with the stock ZynthianOS kernel and would like to know its behaviour without changing the kernel.