2 audio interfaces, 2 sample rates and Ardour

I am looking for a hint where to start debugging:

  • There is a band recording containing several wav files with 48000 sample rate, resampling is no option
  • I have a build in sound card with 48000 (sc48000) but my workstation has an USB audio interface which can only handle 44100 (sc44100)
  • I need sc44100 for MIDI input and DAW remote control so I activated Pipewire 1.2.3
  • I created a 48000 project in Ardour with sc48000, no problem
  • As soon as sc44100 is turned on or is already running Ardour crashes
  • I can’t open the project when sc44100 is turned on, choosing the right default sink makes no difference
  • I configured Wireplumber and allowed for sc44100 only 44100 as a sample rate with no effect

Is this a setup that should work? Where should I start debugging?

This sounds like it may be a job for zita-resampler but I don’t know if it works with PipeWire’s JACK implementation. Unfortunately I can’t speak to the 2 devices question but in the past I had a USB Bluetooth interface that worked with JACK and only supported the BT standard 48000 and all my Ardour sessions were 44100 so in order to use the BT device on the fly and hear Ardour through my BT speakers I had to use zita-resampler, hopefully bigger brains show up to assist and say whether this is an option at all…

If you skip all the Audio backends there may be some way to tie the devices together at the ALSA level but I think the different sample rates are going to throw a wrench in the works.

Lastly the obvious point… A USB Audio device locked at 44100 seems kind of unimaginable in this day and age, is a hardware upgrade, or rental, or borrowing from that good buddy who has all the gear but doesn’t know how to use it not an option?

If you don’t need audio from that interface, then use it for midi only and don’t connect to the audio graph.
If you didn’t need to route audio between applications, then use the alsa backend. If you do need to route audio and that is why you want to use pipewire, then use the audio configuration application to configure pipewire to ignore the 44.1-only interface.

Thanks for the quick answers. Switching to ALSA as the backend does the trick for this type of projects. MIDI works and I connected the audio outputs from sc44100 with the inputs from sc48000 to be able to record audio.

A quick test with Tracktion showed that my Pipewire setup works with both sound cards so I hope my configuration is not the culprit. I can not find an option to turn off the audio part from an interface. Is this an Pipewire or Wireplumber feature?

Pipewire claims to resample if necessary. But Ardour crashes immediately so I will test this again with later versions.

There are, for example, synthesizers, which can also act as an USB audio interface (with inputs and outputs), that only support a 44100 Hz sampling rate.

I have such a synthesizer, the Yamaha MODX, which provides a 44100 Hz, 10 ch input, 4 ch output interface. Using this audio interface, in addition to my main interface, is very handy to record the MODX digitally, without any unnecessary DA->AD conversion and without taking up inputs on my main interface. I have been using zita-a2j/-j2a to integrate the MODX interface into my JACK2 setup. And in spite of the strong recommendations against this, e.g. in the FAQ article by Paul, this has been working very well for me. I can add the interface to my running JACK graph on-the-fly as needed.

1 Like

Unfortunately, still the case and, particularly with Linux where a lot of older hardware is still supported, functional and, in many ways, better than currently available gear, very common.

I reckon around 50% of the kit I regularly use is still locked to 44.1kHz. And I, personally, wish to see 44.1kHz die a fiery death as there is, increasingly, no longer a reason for it to exist (although the nostalgia-for-obsolete-technology trend is, apparently, now on the CD bandwagon - at least there’s more logic to it than compact cassettes).

Cheers,

Keith

My reason to prefer 44.1kHz:

find /music -name \*.ogg -o -name \*.mp3 | wc -l
16241

obvious counter: they’re lossily compressed, dude! Chillax!

Haha, on that note I fished out my Tascam US-122 from behind the door it had been holding open since 2013 or so… It’s officially dead even on Linux, I summoned all the udev hackery, alsa-firmware, lsusb mojo I had and I did get the little green light to go on and the capture ports to show up but no output ports (several Reddit threads confirmed this is the current best-case state of affairs). Linux don’t let 'em die very easily but this one’s time has come… :cry:

I have at least 2 devices which are current products still being sold (one was released in 2020) which only support 44.1kHz.

Cheers,

Keith

There is progress with Ardour 8.10 and Pipewire 1.2.6: Ardour does not crash anymore, but it claims running with the sample rate 44100 while showing 48000 (see screenshot). When I close the window with the warning, it reappears immediately and I can not reconfigure anything.
ardour

Any hints what to do now are appreciated.

Why not use Audio System ALSA (instead of jack/pipewire)? Do you need inter application connections?

–

Setting up Ardour to use multiple soundcards at different rates requires setting the ARDOUR_ALSA_EXT environment variable, but it works reliably.

e.g. to use 3 soundcards run
ARDOUR_ALSA_EXT="hw:2@48000/512*3;hw:3@44100" Ardour8
and then configure Ardour to use hw1 (which also provides the clock, hw:2 and hw:3 are resampled.

1 Like

And you load all those into Ardour? :slight_smile:

How about:

find /music/ -iname "*.mp3" -print0 | xargs -0 -L 1 ffprobe -show_streams 2>/dev/null | grep codec_time_base | grep 48000 | wc -l
1 Like

Thank you for this hint. Unfortunately I run into another problem. As soon as I select sc44100 with ALSA as an input or output device the whole project only allows 44100 as a sampling rate and all my tracks are resampled. What I don’t get: when I force the PipeWire graph to 48000, why does Ardour claim running on 44100?

Yes, a project runs at only one sample rate. If you want to use 48k sample rate then use the ARDOUR_ALSA_EXT environment variable as Robin suggested above. You would use that for the sc44100 card, and select the sc48000 card in the audio setup window to use as the main audio interface.

Impossible to answer since you have not described the way you attempted to set the PipeWire sample rate.
The most obvious answer is that likely you did not actually accomplish what you intended, and the main PipeWire engine is still running at 44100.

Thanks for your reply, I tried several ways:

  1. pw-metadata -n settings 0 clock.force-rate 48000
  2. With configuration files, “pw-metadata -n settings” states:
update: id:0 key:'log.level' value:'2' type:''
update: id:0 key:'clock.rate' value:'48000' type:''
update: id:0 key:'clock.allowed-rates' value:'[ 48000 ]' type:''
update: id:0 key:'clock.quantum' value:'1024' type:''
update: id:0 key:'clock.min-quantum' value:'32' type:''
update: id:0 key:'clock.max-quantum' value:'2048' type:''
update: id:0 key:'clock.force-quantum' value:'0' type:''
update: id:0 key:'clock.force-rate' value:'48000' type:''
  1. With environment variables: “PIPEWIRE_LATENCY=256/48000 pw-jack Ardour8”

The ALSA way “ARDOUR_ALSA_EXT=“hw:1@44100/256”; /usr/local/bin/Ardour8” does not work as I described. sc44100 is the input device, sc48000 the output. As soon as I choose sc44100 the in the dialog I am forced to use 44100 as a sample rate.

Yes, that should set the rate to 48k, as confirmed by the settings.
I am not sure how you configure a second device to be resampled and synchronized to the main interface, though. Presumably only the device you describe as sc48000 can have the sample rate set to 48000, so you still need to configure pipewire to use that as the primary interface, and use sc44100 as a secondary device resampled to the primary rate.

The behavior you describe of attempting to force pipewire to 48000, but Ardour reporting 44100 seems to indicate that perhaps you are using sc44100 as the primary pipewire device, and so even though 48000 is requested pipewire is still running at 44100 because that is the only rate the device supports.

Yes, the point of that command line setting is that you choose sc48000 in the audio settings dialog, and sc44100 (assuming that is the device discovered as hw:1) will show up as an extra signal source that can be routed in the audio routing window.
You do need to verify which device is hw:1 and which is hw:2, they are not always enumerated in the same order.

Thanks a lot for looking into my problem. I checked the primary device with “pactl get-default-sink”.
Regardless of setting the primary device by GUI or by “pactl set-default-sink alsa_output.pci-0000_08_03.0.analog-stereo” the problem persists.

Further tests with trying to close the small window with the warning showed that Ardour sometimes toggles randomly between 48kHz and 44.1kHz in the top right display.

I found a solution that works at least for me. Disabling all sinks (output nodes) from sc44100 and keeping its sources (input nodes) did the trick.
Ardour is now working with sc48000 as the output device and I can record from sc41000 with automatic resampling.

Very short Howto:

Thanks a lot for all the help and suggestions