Help needed to resample to 48000

Hello, I’m new here,
I discovered Zynthian not so long ago but have been spending a lot of time on it the last couple of week and have to say how much I appreciate it !

This being said,

I am trying to use my Soundcraft UI24r which is only 48000 capable. But when I use it I experience a sound crack precisely every second (No Xrun messages in the UI Log).

So I used a soundcard both 44100 and 48000 capable (Rubix22) the sound is perfect and the instrument (PianoTeq Steinway D) is perfectly in tune (tested on my Korg Rack tuner) using a sample rate of 44100 but whenever I use a sample rate of 48000, the instrument is out of tune (no cracks though).

I figured that there was no resampling done.

I found this thread online discussing Jack resampling issues

In summary, Jack doesn’t care what sample rate is specified if the sound card is not capable of the requested sample rate and will fallback to the one supported by the sound card without resampling.

A solution is to use the dummy driver and route the sound to zita-a2j or alsa_in/alsa_out.

First problem here is that zita-a2j/zita-j2a fails to start with segmentation fault.
Second problem is that if I use the dummy driver zynthian fails to starts, using this :

jackd -d dummy -r 44100

have to use the Dummy preset which uses the alsa driver pointing to a dummy device.

So I used that dummy preset and created the two alsa_in/alsa_out like this:

alsa_in -j USB_in -d hw:CARD=Rubix22 -r 48000 & alsa_out -j USB_out -d hw:CARD=Rubix22 -r 48000 &

But I never managed to route the sound from jack to alsa_in/alsa_out as described
here

Because there is no jack sink from which I could patch to my USB_in and USB_out (probably because zynthian uses jack and not jackdbus ??)

Could somebody help me to figure out how to use a 48000 sample rate without affecting the tune nor experiencing cracks ?

Thanks a lot !

Can somebody help ? @jofemodo maybe ? I would be surprised to be the first one having this issue.

What line are you using when the UI24r is the zynthian soundcard?

How are you trying to perform the routing?

The Ui24R isn’t a typical device to jam into a raspberry pi.

Hi @jhordies welcome!

Will you please plug in the Ui24R then connect to the Zynthian via ssh or via webconf: INTERFACE->Terminal and issue this command and paste the results here?

aplay -l

Also

lsusb

and

aplay -L

We can start to diagnose the issue.

Also, you don’t want to be using alsa_in. It resamples and adds significant processing load leading to higher risk of xrun.

48000 samples per second is not the problem. I can run soundcards at that rate. How do you know there are no xruns? Clicks every second sounds like a clocking issue with xruns or maybe a mis-match of buffers. (I just spent too much time tracking down an issue where an application seemed to required a specific buffer size in Windows 10 but not in Windows 7.Stoopid Windows!!!)

Do you have an option within the Ui24 to define its audio clock source? It may be running from a different clock to the Zynthian. If there is an option to use USB clock then try that.

I assume you are using the Ui24’s DAW USB to connect to Zynthian. (It has lots of USB which each behave differently.)

Thanks @Baggypants
I’m using this Audio config line

-P 70 -t 2000 -s -d alsa -d hw:CARD=Ui24 -r 48000 -p 512 -n 3 -X raw

I will lower the buffer later when the sound won’t be cracking anymore to avoid chasing the wrong issue.

The only problem with using the card name instead of the it’s index is

Aug 09 10:13:54 zynthian startx[479]: Invalid card number.
Aug 09 10:13:54 zynthian startx[479]: ERROR:zynthian_engine_mixer.get_mixer_zctrls: Command 'amixer -M -c CARD=Ui24' returned non-zero exit status 1.

Though it is better than chasing the usb index that might change.
(I tried both with no impact on my issue)

As for the routing, I use patched the USB 1 and 2 outputs to Channel 23 and 24.
Thanks @riban

aplay -L
null
    Discard all samples (playback) or generate zero samples (capture)
default:CARD=Ui24
    Soundcraft Ui24, USB Audio
    Default Audio Device
sysdefault:CARD=Ui24
    Soundcraft Ui24, USB Audio
    Default Audio Device
front:CARD=Ui24,DEV=0
    Soundcraft Ui24, USB Audio
    Front speakers
surround21:CARD=Ui24,DEV=0
    Soundcraft Ui24, USB Audio
    2.1 Surround output to Front and Subwoofer speakers
surround40:CARD=Ui24,DEV=0
    Soundcraft Ui24, USB Audio
    4.0 Surround output to Front and Rear speakers
surround41:CARD=Ui24,DEV=0
    Soundcraft Ui24, USB Audio
    4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=Ui24,DEV=0
    Soundcraft Ui24, USB Audio
    5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=Ui24,DEV=0
    Soundcraft Ui24, USB Audio
    5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=Ui24,DEV=0
    Soundcraft Ui24, USB Audio
    7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=Ui24,DEV=0
    Soundcraft Ui24, USB Audio
    IEC958 (S/PDIF) Digital Audio Output
dmix:CARD=Ui24,DEV=0
    Soundcraft Ui24, USB Audio
    Direct sample mixing device
dsnoop:CARD=Ui24,DEV=0
    Soundcraft Ui24, USB Audio
    Direct sample snooping device
hw:CARD=Ui24,DEV=0
    Soundcraft Ui24, USB Audio
    Direct hardware device without any conversions
plughw:CARD=Ui24,DEV=0
    Soundcraft Ui24, USB Audio
    Hardware device with all software conversions
default:CARD=GRAND
    Default Audio Device
sysdefault:CARD=GRAND
    Default Audio Device
lsusb
**** List of PLAYBACK Hardware Devices ****
card 1: Ui24 [Soundcraft Ui24], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
aplay -l
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 004: ID 9516:2015  
Bus 001 Device 003: ID 05fc:0010 Harman Soundcraft Si MADI combo card
Bus 001 Device 002: ID 2109:3431 VIA Labs, Inc. Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Unfortunately there is no option to set the clock source on the Ui24r it is fixed (only one sample rate 48000)

I can tell that the XRuns are not the issue by looking at the UI Log in the Zynthian web interface. They do come up from time to time but not using 3 buffers of 512 on the Ui24 at least not every second like the cracks I hear.

Aug 09 10:17:36 zynthian startx[479]: WARNING:zynthian_autoconnect.cb_jack_xrun: Jack Audio XRUN!
Aug 09 10:20:32 zynthian startx[479]: WARNING:zynthian_autoconnect.cb_jack_xrun: Jack Audio XRUN!
Aug 09 10:23:25 zynthian startx[479]: WARNING:zynthian_autoconnect.cb_jack_xrun: Jack Audio XRUN!
Aug 09 10:26:19 zynthian startx[479]: WARNING:zynthian_autoconnect.cb_jack_xrun: Jack Audio XRUN!

Thanks a lot for your help guys !

J

I don’t know if this might bring some additional insights: I also have a Ui24r since a few years. And I am frustrated, that it is has no 100% stable audio when working with Linux. I am using Linuxmint as on my private PC and always switched to the latest Linuxmint version.
The phenomenon that you described, that there are some crackling spontaneously pops and clicks seems to be the same on my Linuxmint PC. My PC is running with an older i7, 16GB RAM and nearly 4GHz. So performance should be no problem. My latest experience is, that when running Reaper and Jack audio with 48kHz, 128 buffer size, there seem to be no audio problem. But when just plug’n’play the Ui24r and running some audio without Jack, there are the pops and clicks again. When there is loud music, you nearly hear no clicks but when there are some quieter parts, you can hear those nasty clicks. They only appear randomly, perhaps 10 clicks/pops per minute or so, sometimes more sometimes less.
And I tried different Linux OSses and PC hardware, it was always the same problem.
Soundcraft unfortunately only supports Windows and Mac. Maybe there are some hidden tricks coded into their software drivers…

I don’t know if this could be helpful for the Zynthian or vice versa. Maybe there are some technical insiders with some further tips and tricks on how to get a Ui24r running stable audio in DAW mode on a Linux system.