DIY Zynthian with KT USB Audio card

Dear All,
I’m new here, and I ask for some help. I just assembled a DIY zynthian and I ran into a problem with my cheap Ugreen KT USB Audio card. If I set it under the Generic usb audio tab with its number I get a bootloop.

The cat command returns with the following:

root@zynthian:~# cat /proc/asound/cards
0 [Headphones ]: bcm2835_headpho - bcm2835 Headphones
bcm2835 Headphones
1 [vc4hdmi0 ]: vc4-hdmi - vc4-hdmi-0
vc4-hdmi-0
2 [vc4hdmi1 ]: vc4-hdmi - vc4-hdmi-1
vc4-hdmi-1
3 [fmidi ]: MIDI Gadget - f_midi
MIDI Gadget
4 [Audio ]: USB-Audio - KT USB Audio
KTMicro KT USB Audio at usb-0000:01:00.0-1.3, full speed

Jackd Options as follows:
-P 70 -t 2000 -s -d alsa -d hw:4 -r 44100 -p 256 -n 2 -X raw

What am I missing here?
Thank you for your advice in advance!

When using an external USB sound card, you may find that jack does not work properly. What does the command jack_wait -c return?

I am now on the internal soundcard with a fresh install to avoid the bootloop. You mean I should set back to the usb sound card and check jack_wait -c? If I get a bootloop can I still SSH the zynthian via zynthian.local?

If it is a bootloop, then SSH won’t help you. BUT if the loop is only of Zynthian, then you can. Nevertheless, to debug, you can:

  1. Set it with a dummy audio device, just to boot.
  2. Enter with SSH, and stop the service: systemctl stop zynthian.
  3. Set the faulty config using the webconf.
  4. Launch manually the Zynthian service: go to /zynthian/zynthian-ui and run ./zynthian_main.py.

You may see the problem in the console. Check it out!

Returns with the following:

root@zynthian:/zynthian/zynthian-ui# ./zynthian_main.py
ERROR:zynthian_gui_config.: ERROR initializing Tkinter graphic framework => no display name and no $DISPLAY environment variable
ZynCore: Setting-up 8 x Zynswitches…
ZynCore: Setting-up 4 x Zynpots (zyncoders)…
ZynCore->setup_zyncoder(0, 0, 0): Can’t configure zyncoder on a single pin!
ZynCore->setup_zyncoder(1, 0, 0): Can’t configure zyncoder on a single pin!
ZynCore->setup_zyncoder(2, 0, 0): Can’t configure zyncoder on a single pin!
ZynCore->setup_zyncoder(3, 0, 0): Can’t configure zyncoder on a single pin!
Cannot read socket fd = 20 err = Success
CheckRes error
JackSocketClientChannel read fail
Cannot read socket fd = 6 err = Success
CheckRes error
JackSocketClientChannel read fail
Jack server was closed but clients are still allocated, cleanup…
Cleanup client ref = 11
Server is not running
Server is not running
Cleanup client ref = 12
Server is not running
Server is not running
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jackdmp 1.9.14
Copyright 2001-2005 Paul Davis and others.
Copyright 2004-2016 Grame.
Copyright 2016-2019 Filipe Coelho.
jackdmp comes with ABSOLUTELY NO WARRANTY
This is free software, and you are welcome to redistribute it
under certain conditions; see the file COPYING for details
`default’ server already active
Failed to open server
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
Started libzynmixer
Started libzynseq
Traceback (most recent call last):
File “./zynthian_main.py”, line 46, in
zyngui.create_screens()
File “/home/pi/zynthian-ui/zyngui/zynthian_gui.py”, line 510, in create_screens
self.screens[‘info’] = zynthian_gui_info()
File “/home/pi/zynthian-ui/zyngui/zynthian_gui_info.py”, line 44, in init
self.main_frame = tkinter.Frame(zynthian_gui_config.top,
AttributeError: module ‘zyngui.zynthian_gui_config’ has no attribute ‘top’
root@zynthian:/zynthian/zynthian-ui#

If I set back Audio to RBPi Headphones after a reboot the system loads again without any issues.

root@zynthian:~# jack_wait -c
Cannot connect to server socket err = No such file or directory
Cannot connect to server request channel
jack server is not running or cannot be started
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unloc k
JackShmReadWritePtr::~JackShmReadWritePtr - Init not done for -1, skipping unloc k
not running

I think I got the root cause. The order of the devices are changing at every reboot. So my only question is how shoul I call it by it’s name in the Jackd Options line, when there are two spaces in the name of the device (KT USB Audio)?

A suggestion from the peanut gallery: You might be able to use Blokas Patchbox os:

to help you troubleshoot-setup your audio.

A few years ago before I had begun using HATs-GPIO-I2S attached ADCs-DACs-Codecs I found it useful to get various undocumented Amazon-eBay-AliBaba-etc USB audio devices working on Patchbox first, and then use the info learned from that, such as sample rate, USB info, what chip is inside to inform my Zynthian parameters-setup.

Patchbox is more forgiving of errors-mismatches and has a nice little wizard that steps you through the process of setting up-figuring out the parameters for your audio interface.

And as another way to approach Audio-PureData-Synths on the Pi it can function as a nice ‘sanity check’ or ‘existence proof’ for troubleshooting hardware-software-audio issues.

edit: And although I think the above is good general advice, so I’m not deleting it, @oscaracena 's post below is a much more direct answer-solution to your issue.

You may check this: docs/zynthian/reterminal-install.md at main · oscaracena/docs · GitHub

1 Like

Generally the device should be ok. Sometimes if the device id is the same as set I got a stable running zynthian with very low latency and good sound. But after a reboot, when the device id changes I got the restarting UI issue. So please help me out, how to refer the card by its name instead of the device id.

I tried it many times, but unfortunately if I connect my usb audio it wont get the specified number. What else could I do?
PS: Thank you for your extensive help!

Try the advice from these threads

2 Likes

Thank you guys, you’re just awesome!
The solution was so very simple, with aplay -l you can see the following in my case:

card 4: Audio [KT USB Audio], device 0: USB Audio [USB Audio]
Subdevices: 1/1
Subdevice #0: subdevice #0

I had to set not the bracketed name, but the one before it, so simply Audio:

-P 70 -t 2000 -s -d alsa -d hw:Audio -r 44100 -p 256 -n 2 -X raw

Thank you for all again!

4 Likes