Score:0

Connect SPDIF digital input to PCM output using JACK

at flag

I'm using an external soundcard (Aureon 7.1 USB). On that soundcard, I receive audio on a digital SPDIF input, and I'd like to reroute that audio to 5.1 PCM output on that same card.

I'm trying to use JACK with Alsa as a backend to achieve this, but I'm a bit lost.

I can play a 6-channels WAV file using aplay without issue, and each channel is correct.

~ $ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: Headphones [bcm2835 Headphones], device 0: bcm2835 Headphones [bcm2835 Headphones]
  Subdevices: 8/8
  Subdevice #0: subdevice #0
  [...]
card 1: USB [Aureon 7.1 USB], device 0: USB Audio [USB Audio]
  Subdevices: 0/1
  Subdevice #0: subdevice #0
card 2: vc4hdmi [vc4-hdmi], device 0: MAI PCM i2s-hifi-0 [MAI PCM i2s-hifi-0]
  Subdevices: 1/1
  Subdevice #0: subdevice #

My PCM output is on card 1 and works fine.

~ $ arecord -l
**** List of CAPTURE Hardware Devices ****
card 1: USB [Aureon 7.1 USB], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

And I see the card as a capture device too.

This is reported in the USB mixer info:

Unit: 16
    Control: name="IEC958 In Capture Switch", index=0
    Info: id=16, control=1, cmask=0x0, channels=1, type="INV_BOOLEAN"
    Volume: min=0, max=1, dBmin=0, dBmax=0

And I believe it is my digital input. I'm a bit afraid of the channels=1 though.

So then I start a jack deamon:

~$ jackd -n jack-server --no-realtime -d alsa -d hw:1 --duplex
jackdmp 1.9.17
Copyright 2001-2005 Paul Davis and others.
Copyright 2004-2016 Grame.
Copyright 2016-2021 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
JACK server starting in non-realtime mode
self-connect-mode is "Don't restrict self connect requests"
audio_reservation_init
Acquire audio card Audio1
creating alsa driver ... hw:1|hw:1|1024|2|48000|0|0|nomon|swmeter|-|32bit
configuring for 48000Hz, period = 1024 frames (21.3 ms), buffer = 2 periods
ALSA: final selected sample format for capture: 16bit little-endian
ALSA: use 2 periods for capture
ALSA: final selected sample format for playback: 16bit little-endian
ALSA: use 2 periods for playback

I use --no-realtime as my OS doesn't seem to support it, hw:1 as the hardware device and duplex for input/output.

Now I can list the ports:

~ $ jack_lsp -s jack-server -tAc
system:capture_1
   alsa_pcm:hw:1:out1
    32 bit float mono audio
system:capture_2
   alsa_pcm:hw:1:out2
    32 bit float mono audio
system:playback_1
   alsa_pcm:hw:1:in1
    32 bit float mono audio
system:playback_2
   alsa_pcm:hw:1:in2
    32 bit float mono audio
system:playback_3
   alsa_pcm:hw:1:in3
    32 bit float mono audio
system:playback_4
   alsa_pcm:hw:1:in4
    32 bit float mono audio
system:playback_5
   alsa_pcm:hw:1:in5
    32 bit float mono audio
system:playback_6
   alsa_pcm:hw:1:in6
    32 bit float mono audio
system:playback_7
   alsa_pcm:hw:1:in7
    32 bit float mono audio
system:playback_8
   alsa_pcm:hw:1:in8
    32 bit float mono audio

And here I am stuck. What's the next step ? It looks like jack list each individual PCM channel independently, but I only have two input capture ports (one of which may be the line input which I don't use).

What are the next steps to connect the digital input to the PCM output ?

guiverc avatar
cn flag
You've omitted the basic starting point, what OS/product/release are you using? If it's a Ubuntu LTS release, which kernel stack option did you opt to use? (*set by installation media; so telling us that will tell us unless you changed the default*)
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.