geoffreybennett / scarlett-gen2

Linux kernel source tree with additional Focusrite Scarlett and Clarett support ("Scarlett2 USB Protocol Mixer Driver")
185 stars 6 forks source link

Scarlett 18i20 3rd gen: Switch digital I/O mode to optical S/PDIF #9

Closed rekado closed 3 weeks ago

rekado commented 3 months ago

The manual for the Scarlett 18i20 3rd gen says:

The Scarlett 18i20 supports three Digital I/O modes: these are selected from the Device Settings pane of Focusrite Control.

By default "Mode 1: Coaxial (RCA) S/PDIF" is selected, where at 44.1/48kHz Optical out 1 and 2 are each assigned to ADAT 1-8. The manual mentions that alternatively "Mode 2: Optical S/PDIF" can be selected where Optical out 1 carries ADAT 1-8, and Optical out 2 carries S/PDIF.

Quoth the manual:

Mode 2: Optical S/PDIF Select this mode when you are working at 44.1/48 or 88.2/96 kHz sample rate and you need to send or receive an S/PDIF signal via an optical port. Also use this mode if you want to use a clock source sent as an optical S/PDIF signal.

I have not been able to find mention of this mode in the driver code. Is it possible with this driver to switch to mode 2?

There is also a third mode: "Dual ADAT". The manual says:

Select this mode when you need more than four ADAT input and/or output channels when working at 88.2/96 kHz sample rate.

geoffreybennett commented 3 months ago

Hi @rekado,

Thanks for your question. The answer is currently no, the driver does not support this. It would be possible to add, but I don't have all the stuff needed to test all three modes. Only one person has asked for this before, and it didn't end up being necessary for them. If you need this, do let me know & I'll see what I can do. If you have the facilities and skills to test if every mode works, that would be super, otherwise I'll have to find something that can output optical S/PDIF and buy another optical cable.

Regards, Geoffrey.

rekado commented 3 months ago

Hi Geoffrey, thank you for the quick response!

Unfortunately, I only have hardware that can receive optical S/PDIF. I don't have anything that can send it, nor do I have ADAT hardware to test the other modes. (I could test changes to the driver, though.)

Best, Ricardo

amazingidiot commented 3 months ago

Hi, I do have the hardware, I could test. As long as you don't expect me to do it instantly 😅

geoffreybennett commented 2 months ago

Hi all, I've looked into this a bit further. It seems that the Scarlett 3rd Gen 18i8/18i20 and Clarett 2Pre/4Pre/8Pre all have some sort of optical I/O selection, and except for the 4Pre/8Pre they're all configured slightly differently. So I've found & ordered an ADC with optical S/PDIF output. If that works then I'll be able to add support for all of them with some confidence.

geoffreybennett commented 2 months ago

Okay, the kernel side is done now :crossed_fingers:. You can try it out with the code I uploaded to https://github.com/geoffreybennett/scarlett-gen2/releases/tag/v6.9-v1.1

I also submitted it upstream, maybe in time for Linux 6.10.

Usage:

As far as I can tell, these new Linux controls work as per the Focusrite documentation. I did a little testing with every option and didn't find any issues.

img_2115

geoffreybennett commented 2 months ago

Fixed in https://github.com/geoffreybennett/scarlett-gen2/commit/480eafc2d57158b29e8e5efa5b1ac8b5e5a01af8.

rekado commented 3 weeks ago

Thank you, @geoffreybennett! I have only just been able to test this---and with success!

I compiled the kernel with the sources from https://github.com/geoffreybennett/scarlett-gen2/releases/tag/v6.9-v1.1, set the Digital I/O Mode control to S/PDIF Optical (via alsamixer) and restated the device (3rd Gen 18i20).

I connected the first optical output to the amplifier. (I kept the wiring of the coaxial S/PDIF, too.)

Sound is received both on the amplifier's optical and the coaxial S/PDIF input. (I set the soundcard to generate a clock signal internally.)

Thanks again!

geoffreybennett commented 3 weeks ago

That's great news! For reference, the code did make it in to 6.10.