VOGONS


Reply 20 of 24, by darry

User metadata
Rank l33t
Rank
l33t

I just tested one of the ADS Tech Instant Music devices in Loopback with a U2 (both through Pipewire and JACK/Zita). I also did a recording test of an RMAA generated test file . The results are virtually identical to those with a CM6206 in all cases, which is not unexpected .

On another note, having given some more thought to the latency aspect, it struck me that the U2 (based on the XMOS XU208) is a UAC2 class USB audio device which runs in USB high speed mode (UAC2 allows the use of high speed mode but does not make it mandatory, so being UAC2 compliant does not guarantee use of high speed mode, AFAICT). This probably helps explain why I can set a period size as low as 32, or even 8 on the U2, but am limited to 45 (for 44.1KHz) or 48 (for 48KHz) for all UAC1 class 1 devices that I have tried setting low period sizes on (SPS-25, CM106, InstantMusic, UCA202). Additionally, UAC2 exposes information about device clock domains to the host, which may alleviate the need for resampling due to different clocks, at least in a scenario where there is only one source and one sink, if my understanding of http://visa.lab.asu.edu/gitlab/fstrace/androi … b1456a3cef310f0 is correct .

All this brings up the interesting questions

a) Would using UAC2/high-speed captures devices yield lower latency while also avoiding all my previously worked-around USB 1.1 issues ?
b) Would doing a) change my results in Pipewire ?
c) Are there any UAC2/high-speed captures devices with S/PDIF input available and, hopefully, affordable ?

I am willing to test a) and b) for myself, if I can answer c) . The ONLY possible answer to c) that I have found, so far, is https://www.minidsp.com/products/usb-audio-in … ace/usbstreamer . At 95 $US a pop, this is not eye-wateringly expensive (and certainly very reasonable for a niche product), but with duties, taxes and shipping, I would be looking at adding over half a grand $US to the BOM for 4 units . Obviously, I could just get one to test first, but if it works well, the temptation to get a few more would be hard to resist . Anyway, I will keep searching for cheaper alternatives .

EDIT : I installed and updated the latest Raspbian/Raspberry Pi OS 64-bit beta release and managed to compile a modern RT patched kernel for it (5.10.27) . I gave up on trying to run with Ubuntu Budgie's 5.11.0 kernel source (couldn't get it to patch successfully, maybe I was doing something wrong).

Anyway, public service announcement for anyone interested in compiling a Real-Time ( Fully Preemptible) patched kernel for an ARM64 platform:

Since somewhere around the 5.9 kernel version, to choose a Real-Time kernel preemption model, one must

a) Make sure to first complete the step that involves running "make bcm2711_defconfig" BEFORE running b) and c) or your changes will be overridden (you will end up with a non RT kernel)
b) Run make menuconfig and Disable Virtualization
c) while still running make menuconfig , make sure Configure standard kernel features (expert users) is enabled and exit/save settings

After that, following http://robskelly.com/2020/10/14/raspberry-pi- … and-preempt_rt/ and https://www.raspberrypi.org/documentation/lin … nel/building.md works fine as long as you are cross-compiling . If you are compiling locally on a Pi , the instructions in the second link will need to be modified as they are specific to building a 32-bit kernel (basically replacing zImage with Image and KERNEL=kernel7l with KERNEL=kernel8 )

It took me a while to find information pointing to points b) and c) .

EDIT2: Everything seems to work on newest Raspbian 64-bit beta with the RT patched 5.10.27 kernel . My search concentrates now on finding inexpensive UAC2 capable S/PDIF input devices that run in high-speed mode . If I manage to find some that are affordable, it could, as alluded to before, potentially simplify and cost reduce the setup by allowing use of a standard low cost PSU and a single low-cost USB 2.0 or 3.0 hub rather than having to resort to a USB PD capable hub and and a multi-TT hub, both of which are relatively expensive and and the second of which is additionally getting harder to find .

That all being said, if 12 milliseconds worth of latency and cheap shoddily built CM6206 (but sill functional) USB interfaces (or more expensive, harder to find, better built InstantMusic ones) are acceptable in someone's use case scenario (they are in mine), this solution is perfectly usable as is .

EDIT3: I have managed to find what I believe is a candidate for USB 2.0 highspeed UAC2 capture device with S/PDIF input at reasonable-ish price . It is based on the BRAVO/Savitech SA9226 https://datasheetspdf.com/pdf-file/1306864/SAVITECH/SA9226/1 , which I cannot even find on https://www.savitech.co/usb-products , which suggests that it might be discontinued (not an issue for me if availability is good). Anyway, I will test for suitability when I receive the unit that I have ordered .

Reply 21 of 24, by darry

User metadata
Rank l33t
Rank
l33t

I decided to go deeper down the rabbit hole.
I ordered :

- a Pi 4 compute module
- a CMIO4 breakout board which has a PCI Express slot
- a PCI Express bridge board with 4 PCI Express slots
- 4 Creative SB1040 sound cards (based on the CA0110 chip). EDIT : Spec sheet for CA0110 : https://web.archive.org/web/20100215044637/ht … hips/CA0110.pdf

It is easy to imagine where this is going...

Reply 22 of 24, by darry

User metadata
Rank l33t
Rank
l33t

Long story short : everything works, including the PCI Express bridge, EXCEPT for the sound cards.
Typically, kernel module loads (or can be loaded manually using modprobe), but no ALSA devices are available (nothing in /proc/asound/card* for the device). Using the aforementioned bridge (ASM1184E) and also a Startech PCI Express to PCI one , I tried :

SB1040 PCI Express (also tried this one directly in the PCI Express slot without using a bridge and got the same results)
SB0410 PCI
SB0610PCI
generic CM8738 based PCI card

Am I missing something really obvious ?

P.S. For the SB1040/CA0110 , I also tried compiling as kernel driver rather than a module and got the same results .

EDIT : I got the SB1040 to work, but only when connected directly to the PI's PCI Express slot . It does not work through my ASM1184E based bridge/switch . See https://www.raspberrypi.org/forums/viewtopic. … 306055#p1854874 for more details .

Reply 23 of 24, by darry

User metadata
Rank l33t
Rank
l33t

I finally did get the 4 SB1040 cards working off of the ASM1184E PCI Express switch, but not on a Pi 4 . I did get everything to work on an x86-64 machine (HP Compaq 6200 Pro SFF) under Ubuntu 21.04. Along the way I found out that, at least on this x86-64 setup, the SB1040 cards would not work through the ASM1184E if using an RT patched (Fully preemptible) kernel. Using a low latency (Preemptible) kernel did allow the SB1040 cards to work through the ASM1184E on the x86-64 setup . On the Pi 4, I never got the cards to work through the ASM1184E, no matter the kernel type . I am still using the USB Douk U2 for output . P.S. I had some issues with SB1040 cards in the beginning, but adding this to alsa-base.conf fixed them : options snd-hda-intel index=1,2,3,4 enable_msi=1 bdl_pos_adj=2,2

Effective latency through the mixer on the x84-64 setup with the SB1040 cards and the U2 is about 9.7 milliseconds .

I also tried Pipewire on this x86-64 setup, but got the same intermodulation distortion issues as on the Pi 4 .

Oh, and as an added benefit of SB1040 cards, 24-bit input now works (Zita resampling of the synthetic test samples used, I theorize, seems to be causing noise levels to go impossibly low, which is probably a measuring/calculation artifact of some kind) :

24bit.png
Filename
24bit.png
File size
40.42 KiB
Views
170 views
File license
Public domain

At this point, for my needs, it looks as though I am going to settle on running this on the x86-64 machine, at least for the time being . I will do more testing on the Pi 4 when I receive some of the Pericom based PCI Express switches that I have on order .

The good news, for someone wanting to do this, is that using a cheap and quiet SFF PC that is likely easy to find can be a decent alternative to a Pi 4 based setup (albeit bigger and more power hungry), especially if lower latency and/or 24-bit support is desired .

EDIT: Total power draw when running my x86-64 setup is 51 watts at AC wall socket (not including monitor/screen)

Reply 24 of 24, by darry

User metadata
Rank l33t
Rank
l33t

I decided to run some comparison tests between resampling done by Zita-a2j in the DIY mixer setup versus the internal hardware resampling done by an SB Live! CT4830 .

In one case, the signal went through one of the 4 SB1040 cards in the input bank, was resampled in software (Zita) and was output through a Douk U2 .
In the other case, the signal went into an SB Live! , was resampled in hardware and was output by the same SB Live!

In both cases, 44.1KHz was input digitally (S/PDIF), converted to 48KHz, was received digitally (S/PDIF) and was analyzed by RMAA .

comparison.png
Filename
comparison.png
File size
40.02 KiB
Views
132 views
File license
Public domain

Detailed RMAA comparison tests :

Filename
tests_rmaa.zip
File size
176.34 KiB
Downloads
4 downloads
File license
Public domain