Zynthian set-up using Steinberg UR22 mkII

After following the forum for a while I decided to try Zynthian for myself using some hardware I have laying around: a Pi 3 b+, WaveShare 10.1" IPS touchscreen and a Steinberg UR22 mkII USB audio and midi interface.

I have the screen working correctly, I set the wiring layout to DUMMIES, and the soundcard to USB audio, but I keep getting an error screen. When I checked aplay -l the UR22 is listed correctly. When I try running the /zynthian/zynthian-sys/sbin/zynthian.sh script, it gets into an eternal loop full of errors:

The first error seems to be the line ‘ALSA lib pcm_hw.c:1667: (_snd_pcm_hw_open) Invalid value for card’. Does this mean that I have to change something in the audio configuration, or could there be another problem?

Jack would seem to be at the root of the problems…

the output of aplay -l & aplay -L would see what is being seen from the alsa end.

Try firing up qjackctl via the Putty terminal and see how far it gets.

Thanks for your help!

qjackctl returns the error ‘qjackctl: cannot connect to X server’

You want to select the Putty/Connection/SSH/X11 Enable X11 forwarding…

This will allow the Xwindow server to run on your desktop and see the qjackctl interface window…

Ok, I got X11 forwarding working (for which I also had to install Xming) and now I’m in the connections window, but both the audio and midi tabs are empty and the ALSA tab only shows the UR22 midi ports:


How to find out why Jack doesn’t recognise the audio ports?

Sorry I haden’t thought you might be on windows.

Presumably qjackctl reports not started?

Does the USB port exist as alsa devices? (output of aplay -l)

Unless I understand the output wrongly, it seems to me that it exists:

Ok try playing audio via the mpg123 command line command…

> cd /zynthian/zynthian-data/audio/
> mpg123 test.mp3

You should hear the test audio file . . . .

Card 1 ( I suspect that should be card 0) ?

Don’t know if this stuff is relevant or a bit of a wild goose chase . . .

Sadly I’ve not used USB…

Playing audio via mpg123 doesn’t work:

Do I understand it correctly that it is trying to play over Jack?

I think I’ll have to do some reading on ALSA and Jack to understand what is going on - I don’t have too much Linux experience…

Yes it’s involved.

Alsa handles the physical ports and provides a virtual framework with software audio handling and a good deal else as well. Jack handles the movement of data between the ports and provides a low latency environment that is designed for ‘professional’ (whatever that means) but they are different beasts. There are programmes for moving between the two different worlds like a2jmidi and a2j.
By in large USB does seem to just work, but you will need to turn off all the jack components to get the alsa stuff to play a sound file.You need to be able to see the device you are using in the jack world, I don’t know how this works for your specific USB device, but if we can get it playing files under Alsa we ‘should’ be able to get it to do something useful.

As you noted before, the problem seems to be related to the card number set to 1 instead of 0, because that is exactly the error speaker-test returns:

Continuing my investigation…

I managed to get a sound by calling speaker-test with option -Dplug:hw:1

By the way: I’m also only able to start alsamixer with the option -Dhw:1

Since there aplay -l doesn’t list any card number 0, only 1, which is the UR22mkII, I changed hw:0 into hw:1 in the Jackd options (web configuration), however, if I start up the RB Pi, it now most of the time gets stuck showing this (and after a minute or so the the error screen appears, which every now and then turns black and appears again):

Or sometimes it gets stuck in the following loop (during which the web configuration works normally):

If i run /zynthian/zynthian-sys/sbin/zynthian.sh the error messages are exactly the same as before, meaning that it is still trying to open hw:0. How to force it to open hw:1 instead?

As you say you should be able to alter the Audio conf in the webconf interface (zynthian.local by default). Here you can supply specific start up options for the jack daemon.

You will need to turn on Advanced to see the option…

jackd options

Anyone elese got any ideas …? :smiley:

I already tried setting the jackd options to ‘hw:1’, but it doesn’t help. I have given up on trying to get the UR22mkII working and I’m now playing around with another Raspberry Pi equipped with an IQAudio DigiAMP+ and an Edirol (Roland) UM-2EX USB midi interface. Here no problem (except that the volume is a bit low using this amp). If anybody has an idea how else to force Zynthian (Jack) to use hw:1, or how to force the USB audio adapter to become hw:0, I will give it another try.

If it’s on card1 you’ll need to alter the dbus security as well. Audio Setup.WE NEED YOUR INPUT

Thanks Baggypants for the suggestion. I’ve tried it, but it still doesn’t work.

I’ve set the jackd options to “-P 70 -t 2000 -s -d alsa -d hw:1 -r 44100 -p 256 -n 2 -X raw” and I’ve edited /etc/dbus-1/system-local.conf to look like:

<!DOCTYPE busconfig PUBLIC “-//freedesktop//DTD D-Bus Bus Configuration 1.0//EN” “http://www.freedesktop.org/standards/dbus/1.0/busconfig.dtd”>

<policy user=“root”>
    <allow own=“org.freedesktop.ReserveDevice1.Audio1”/>


If I now run /zynthian/zynthian-sys/sbin/zynthian.sh I see a “bad image size” error:

root@zynthian:~# /zynthian/zynthian-sys/sbin/zynthian.sh

X.Org X Server 1.18.4
Release Date: 2016-07-19
X Protocol Version 11, Revision 0
Build Operating System: Linux 4.4.26-v7+ armv7l Raspbian
Current Operating System: Linux zynthian 4.14.94-v7+ #1193 SMP Tue Jan 22 15:34:30 GMT 2019 armv7l
Kernel command line: 8250.nr_uarts=1 bcm2708_fb.fbwidth=1280 bcm2708_fb.fbheight=800 bcm2708_fb.fbswap=1 vc_mem.mem_base=0x3ec00000 vc_mem.mem_size=0x40000000 dwc_otg.lpm_enable=0 console=tty1 root=/dev/mmcblk0p2 rootfstype=ext4 elevator=deadline fsck.repair=yes rootwait
Build Date: 11 November 2016 11:59:59AM
xorg-server 2:1.18.4-2+rpi1 (Debian -- User Support)
Current version of pixman: 0.33.3
Before reporting problems, check http://wiki.x.org
to make sure that you have the latest version.
Markers: (–) probed, (**) from config file, (==) default setting,
(++) from command line, (!!) notice, (II) informational,
(WW) warning, (EE) error, (NI) not implemented, (??) unknown.
(==) Log file: “/var/log/Xorg.0.log”, Time: Sat Jan 26 15:10:17 2019
(==) Using config directory: “/etc/X11/xorg.conf.d”
(==) Using system config directory “/usr/share/X11/xorg.conf.d”
INFO:root:No Wiring Layout configured. Only touch interface is available.
DEBUG:root:ZYNCODER A: [0, 0, 0, 0]
DEBUG:root:ZYNCODER B: [0, 0, 0, 0]
DEBUG:root:SWITCHES layout: [0, 0, 0, 0]
DEBUG:root:ENABLED_MIDI_OUT = [‘ttymidi:MIDI_out’, ‘QmidiNet:in_1’]
WARNING:root:Using default ENABLED MIDI FB ports
Traceback (most recent call last):
File “./zynthian_gui.py”, line 39, in
import zynautoconnect
File “/zynthian/zynthian-ui/zynautoconnect/init.py”, line 5, in
from zynautoconnect.zynthian_autoconnect import *
File “/zynthian/zynthian-ui/zynautoconnect/zynthian_autoconnect.py”, line 35, in
from zyngui import zynthian_gui_config
File “/zynthian/zynthian-ui/zyngui/init.py”, line 27, in
import zyngui.zynthian_gui_config as zynthian_gui_config
File “/zynthian/zynthian-ui/zyngui/zynthian_gui_config.py”, line 364, in
pil_frame2 = pil_frame.resize((fw2, fh2), Image.ANTIALIAS)
File “/usr/lib/python3/dist-packages/PIL/Image.py”, line 1550, in resize
im = self.im.resize(size, resample)
ValueError: bad image size

What is this about?

It’s trying to convert /img/zynthian_gui_loading.gif to a TkInter PhotoImage object but for some reason the “size” is bad. It gets the size from the image itself, implying the gif is corrupt / missing? Or possibly the values it gathering from for the resize are unexpected.

It mayyyybe useful to reformat and start the testing from the top.

1 Like

I did a fresh new install and now the error screen is gone :slight_smile: Thanks!

One annoyance: after updating Zynthian the file /etc/dbus-1/system-local.conf has been reset to its default, so it needs to be adjusted again…

1 Like

Good to know that fixed it. I’ll open a bug about zynth & dbus expecting only card0. I feel it’s partly a symptom of getting systems that are expecting things to be run as a normal user but are running as root.

1 Like