• WANTED: Happy members who like to discuss audio and other topics related to our interest. Desire to learn and share knowledge of science required. There are many reviews of audio hardware and expert members to help answer your questions. Click here to have your audio equipment measured for free!

Variable sample rate through win11

rspa

New Member
Joined
Dec 30, 2023
Messages
4
Likes
1
I have a wiim pro transmitting variable sample rate up to 192khz via toslink into my win11 pc via Cubilux UCSTR-B3 spdif to usb converter which supports up to 192khz.

I also have a soncoz la-qxd1 dac which also supports variable sample rate up to 192khz connected to same pc via usb as output.

I have no problems with variable sample rates if wiim is directly connected to the Soncoz which auto detects and adjusts.

I want to use the pc only for dirac live room correction and have tried a couple different daw apps (waveform, vsthost). Dirac supports up to 192khz.

I can't figure out any way to process a variable sample rate coming out of the wiim when routing through the pc/dsp. Everything seems to require fixing the sample rate to a single value regardless of driver (asio, wasapi, etc).

I would hate to set the wiim to downsample everything to 44.1 and I'm googled out. Anyone know if there is a solution for this?
 
Last edited:

bachatero

Member
Joined
Dec 25, 2023
Messages
83
Likes
63
This is a limitation of the current audio APIs available in today's OSes, and unless somebody develops something better, you're going to be stuck with a single sample rate. The reason this isn't as much of an issue on your devices is because those handle audio in a more raw way and can control the subsystems in a direct manner, allowing for variable sample rate.
 
OP
R

rspa

New Member
Joined
Dec 30, 2023
Messages
4
Likes
1
Thanks bachatero. Guess I'm back to looking at the minidsp.
 

audio_tony

Addicted to Fun and Learning
Joined
Feb 24, 2019
Messages
576
Likes
697
Location
Leeds, UK
This is a limitation of the current audio APIs available in today's OSes
It's a limitation of Windows.

I use Linux, and it sends whatever rate I play to the DAC - it's totally transparent. I believe MAC is the same.

Quite why Windows hasn't mastered this yet, I don't know...
 

bachatero

Member
Joined
Dec 25, 2023
Messages
83
Likes
63
I use Linux, and it sends whatever rate I play to the DAC - it's totally transparent. I believe MAC is the same.
This is technically true, and ALSA is pretty flexible with switching sample rates, but to do so seamlessly doesn't seem possible unless a program "disconnects" from an audio device and reconnects with the new sample rate. I've used the ALSA API a couple times and you have to specify the sample rate when opening the device.

Example:
C:
    snd_pcm_t* device;
    if (snd_pcm_open(&device, "default", SND_PCM_STREAM_PLAYBACK, 0) < 0) std::_Exit(EXIT_FAILURE);
    snd_pcm_hw_params_t* params;
    snd_pcm_hw_params_alloca(&params);
    snd_pcm_hw_params_any(device, params);
    snd_pcm_hw_params_set_access(device, params, SND_PCM_ACCESS_RW_INTERLEAVED);
    snd_pcm_hw_params_set_format(device, params, SND_PCM_FORMAT_S16_LE);
    snd_pcm_hw_params_set_channels(device, params, 2);
    snd_pcm_hw_params_set_rate(device, params, 44100, 0);
    snd_pcm_hw_params_set_periods(device, params, 16, 0);
    snd_pcm_hw_params_set_period_time(device, params, 1024, 0);
    snd_pcm_hw_params(device, params);

    snd_pcm_writei(device, &(samples[0]), samples.size() / 2);

    snd_pcm_drain(device);

    snd_pcm_close(device);
 

audio_tony

Addicted to Fun and Learning
Joined
Feb 24, 2019
Messages
576
Likes
697
Location
Leeds, UK
I've used the ALSA API a couple times and you have to specify the sample rate when opening the device.
If I queue a bunch of audio files of varying rates and begin playback, the DAC receives the rate specified.

I presume that the audio device is opened and closed between tracks anyway. This is seamless.

The same thing with the Sox utility - send a 96k signal and the DAC receives a 96k signal. It's all seamless.

Whereas with Windows, each time you want to play a track with a different sample rate, you have to go into the device settings and select it.

As I said in my previous post - quite why one still has to do this with Windows in 2023 (almost 2024!) beggars belief.
 

HenrikEnquist

Member
Joined
Jul 1, 2021
Messages
82
Likes
110
Whereas with Windows, each time you want to play a track with a different sample rate, you have to go into the device settings and select it.

As I said in my previous post - quite why one still has to do this with Windows in 2023 (almost 2024!) beggars belief.
This can be done just fine in Windows too, as long as the application uses Wasapi exclusive mode.
But that's not at all what the question was about. It's about receiving different sample rates on a split spdif (thanks autocorrect!) input, and there is simply no good solution for it. Doesn't matter if you use Windows, MacOS or Linux.
 
OP
R

rspa

New Member
Joined
Dec 30, 2023
Messages
4
Likes
1
I don't seem to have issue with windows app source (roon) for which I just use the dirac standalone device set to 192khz output.

It's the external spdif source. Wiim gets me more streaming sources than roon.

Appreciate knowing I can stop banging my head before I paid for the dirac license.
 

phofman

Addicted to Fun and Learning
Joined
Apr 13, 2021
Messages
502
Likes
326
IMO the problem is the PC/USB host specifies the samplerate at which it opens the capture device, requesting samples coming via SPDIF into the soundcard. But the SPDIF stream is the master which determines the samplerate which the PC should specify.

In linux alsa drivers for some SPDIF receivers provide specific alsa controls which notify the alsa client about momentary rate of the incoming SPDIF stream (with 0 corresponding to no incoming stream) https://github.com/torvalds/linux/b...f884a2835a/sound/i2c/other/ak4114.c#L519-L522 https://github.com/torvalds/linux/b...f884a2835a/sound/i2c/other/ak4114.c#L216-L223. The client can then subscribe to the control notifications and upon receiving the momentary rate info it can open the capture device at correct samplerate.

I do not know if some USB sound cards with SPDIF capture provide a similar mechanism.

No idea about a feature like that on windows which AFAIK does not offer general audio control elements like alsa ctl elems.
 

TaxTime

Member
Joined
Mar 27, 2023
Messages
48
Likes
18
Could it be software related, and not Windoze?

For PC to DAC (I also use a Pi4 embedded in an Okto DAC8), I have used JRiver for many years. I have also used JRiver on the Pi4, but have been using Moode ever since I installed it into the Okto.

JRiver has, and never had, any problem sending bit-perfect data (in bit-depth and sample rate) using either Asio or Wasapi to any DAC I have used it with, without having to manually adjust anything when the bit depth/sample rate changes from track to track.

In all cases with JRiver, I have used it to send music files stored locally and in my NAS to my DACS, as well as renderer for Qobuz streams - no problems. I have also used other freeware in the past on the PC - MediaMonkey, MusicBee, etc. - and never had a problem with those as well.

Could it be something to do with Dirac's interaction/software? I have never used Dirac, as I'm too much of a tight@ss to shell out the dough.
 
OP
R

rspa

New Member
Joined
Dec 30, 2023
Messages
4
Likes
1
Could it be software related, and not Windoze?

For PC to DAC (I also use a Pi4 embedded in an Okto DAC8), I have used JRiver for many years. I have also used JRiver on the Pi4, but have been using Moode ever since I installed it into the Okto.

JRiver has, and never had, any problem sending bit-perfect data (in bit-depth and sample rate) using either Asio or Wasapi to any DAC I have used it with, without having to manually adjust anything when the bit depth/sample rate changes from track to track.

In all cases with JRiver, I have used it to send music files stored locally and in my NAS to my DACS, as well as renderer for Qobuz streams - no problems. I have also used other freeware in the past on the PC - MediaMonkey, MusicBee, etc. - and never had a problem with those as well.

Could it be something to do with Dirac's interaction/software? I have never used Dirac, as I'm too much of a tight@ss to shell out the dough.

The problem is receiving input from an external spdif source not a local app.

I ordered a minidsp.
 
Top Bottom