All times are UTC+02:00




Post new topic  Reply to topic  [ 45 posts ]  Go to page Previous 1 2 3 4 5 Next
Author Message
PostPosted: Tue Jul 18, 2023 8:27 am 

Joined: Thu Jan 15, 2015 11:19 am
Posts: 193
BTW renaming of the binaries works with the latest 9.x release, too.


Top
   
PostPosted: Tue Jul 18, 2023 8:17 pm 

Joined: Fri Aug 26, 2022 1:44 am
Posts: 91
You are very kind to offer help.

I'll summarize what I'm trying to do.

1. Run two instances of ST under Ubuntu 22.04 (preferred because LTS) or 23.04 (if I must).
2. Both to share the same input card.
3. Each instance to output to its own separate card.

I don't care whether this is an ALSA or a JACK or a hybrid solution, but because this setup will be used in a live radio broadcast situation it has to be stable 24/7, and there must be some way to have all the settings and programs load up automatically at reboot. So no arbitrary re-enumeration of cards, no forgetting the connections, just BOOM and things are back to normal.

That's a tall order! If it's too ambitious we can survive with the normal setup of one ALSA ST on one I/O card, under Pulseaudio or Pipewire and forego the two-instances idea (we want to provide loud aggressive processing for the FM broadcast, and gentler processing for the station's live stream).


Top
   
PostPosted: Tue Jul 18, 2023 9:46 pm 

Joined: Thu Jan 15, 2015 11:19 am
Posts: 193
Maybe I was lucky in my tests because I used Ubuntu Studio, which is tuned for low latency audio performance and has lots of useful tools pre-installed and pre-configured.

Other than using Pipewire, a JACK-only solution could be possible:

Run jackd on your input soundcard
Run two instances of alsa-jack bridge to bring the two output cards into your JACK session.
Use two stereotool-jack binaries, each having an own distinctive file name
Use aj-snapshot after you have connected everything and store the connections

Then create systemd-services for each part (jack, the alsa bridges, stereootools and aj-snapshot).
This wil make everything fire up on boot and, my recommendation, set all the processes other than jackd to restart automatically on failure.
So for instance, if on ST instance crashes, systemd takes care of it and restarts after a couple of seconds. aj-snapshot will automagically reconnect all the ports.

The reason why I would aim for pipewire is that it simplifies the bridging of the additional audio devices. You don't have to care about two extra processes shoveling the audio back and forth between your jack session and the audio devices. The jack docs explain in detail why this bridging is needed (in short: multiple sound cards WILL run out of sync, which in a digital audio domain will cause audible clicks because sampling rates drift. The bridges do a resampling, much like a wire between your audio cards. But that comes at a cost, ie. CPU power and latency).

Finally, I think you are on the right track with your setup idea.
You might want to tweak the setup by only using a single audio device with enough i/o to stay within the clock domain of that device. Much less to worry and less to fail. Like the RME HDSP AIO: https://www.rme-audio.de/de_hdspe-aio.html with the expansion to give you more analogue outputs.

I can say from experience that multiple instances of ST in a Jack environment have always worked fine for me as long as there was plenty CPU power available.


Top
   
PostPosted: Tue Jul 18, 2023 9:52 pm 

Joined: Thu Jan 15, 2015 11:19 am
Posts: 193
Oh, just saw the AIO is no longer in production.
Could use a USB device instead. I'm successfully running a Behringer UMC1820 in 24/7 without problems. (Similar setting, two stereo DSP chains, one chain using stereotool, the other just a bunch of plugins)


Top
   
PostPosted: Wed Jul 19, 2023 12:41 am 

Joined: Fri Aug 26, 2022 1:44 am
Posts: 91
Hi Minetti -- Thank you for the advice!

I'm going to need to find a tutorial on how to do the "Run two instances of alsa-jack bridge to bring the two output cards into your JACK session" part of your how-to. The googles aren't coming up with anything super-clear.


Top
   
PostPosted: Wed Jul 19, 2023 7:24 am 

Joined: Thu Jan 15, 2015 11:19 am
Posts: 193
Here is the relevant link:
https://jackaudio.org/faq/multiple_devices.html


Top
   
PostPosted: Wed Jul 19, 2023 3:23 pm 

Joined: Fri Aug 26, 2022 1:44 am
Posts: 91
Thank you.

By "alsa-jack bridge" are we talking about alsa-in and alsa-out?


Top
   
PostPosted: Thu Jul 20, 2023 12:19 pm 

Joined: Thu Jan 15, 2015 11:19 am
Posts: 193
Yes. There is an alternative called Zita ajbridge, consisting of two programs, one for input, one for output.
In the past the jack implementation had less quality resampling


Top
   
PostPosted: Fri Jul 21, 2023 3:13 am 

Joined: Fri Aug 26, 2022 1:44 am
Posts: 91
Thank you. Okay, hacking my way through this after a reboot.

Identified the second output device which will be used by the second instance of ST JACK. aplay -L shows it as
Code:
hw:CARD=CODEC,DEV=0
    USB Audio CODEC, USB Audio
    Direct hardware device without any conversions
So, I launch QjackCtl and it loads with the System input and output cards, showing in Graph. I know I can launch an instance of ST and connect to them and it works and is stable.

Back to terminal:
Code:
$ /usr/bin/alsa_out -j Card_2 -d hw:CARD=Device,DEV=0 -q 1 2>&1> /dev/null & 
[1] 3612
$ 
That looks about right.

Back to QjackCtl and Graph does not show the second card, "Card_2." (This is just Part 1 of the suggestion that I "Run two instances of alsa-jack bridge to bring the two output cards into your JACK session.") I can't even bring the one card into my JACK session. No doubt I am not seeing a step.


Top
   
PostPosted: Fri Jul 21, 2023 2:18 pm 

Joined: Fri May 27, 2022 9:33 pm
Posts: 35
In ST you can set the inputs to one of something unused like stereo_tool_fm if you don't use fm, or the other one if you do. Then of course connect manually. I used to use this workaround successfully before.
When devices dissppear, if you have pulseaudio turn them off from the mixer manager (pavucontrol if your desktop lacks that option), this way jackd can use them exclusively. In pipewire-pulse they will be disabled completely so don't do that there.
///
I'm yet to test my method but most likely will need ubuntu 23.04, so i hope you can solve it with jackd, if you don't i'll guide you then.


Top
   
Display posts from previous:  Sort by  
Post new topic  Reply to topic  [ 45 posts ]  Go to page Previous 1 2 3 4 5 Next

All times are UTC+02:00


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
cron
Powered by phpBB® Forum Software © phpBB Limited