Topic: Fireface 400 + ASIO + wrong samplerate information

I like to feed the spdif input by an external source with different samplerates.
Thus I set the clock source to spdif. In this mode the samplerate combo of the control panel should have no meaning.
But now playing a 96 kHz tracks gives a picture as shown in the example http://img171.imageshack.us/img171/7319 … erates.png

So the input status shows a correct value of 96000. The clock mode is shown as currently set to 48000.

The ASIO interface reports also a samplerate of 48000 (ASIOGetSampleRate). Thus I get a wrong information

When I set the samplerate combo of the control panel to 96000 then the reported samplerate is correct (=96000).
But when I play then a 44100 track then the input status is correctly reported as 44100 but again the clock mode displays a current samplerate of 88200.
Also the ASIO interface then reports a wrong samplerate 88200.

So how to get the correct information as shown in the input status area of the control panel by the ASIO interface?
Why does the control panel display two different samplerates?

IMO the soundcard should simply sync to the incoming samplerate and also report the correct value.

Any comment or help?

BR
Uli

2

Re: Fireface 400 + ASIO + wrong samplerate information

The soundcard should (and will) not screw up the settings that you set in your software. And that is exactly the error here. The card has to be set to the correct sample rate first (by ASIO or WDM), then can be synced to lock to that sample rate.

If you want to track changes you have to measure the time it needs for the samples to arrive and calculate the sampling rate from that, then set the sample rate via WDM or ASIO again.

Regards
Matthias Carstens
RME

Re: Fireface 400 + ASIO + wrong samplerate information

I'm sorry but I do not understand why I have to set the correct samplerate first. As I simply do not know it in advance.
In my understanding I set the soundcard to sync for the spdif input. Indeed the input status shows the correct samplerate.
So how do I get the input status samplerate information by the ASIO interface? I do not need to set the samplerate by myself but just to follow the samplerate reported by the soundcard for further processing.

Why to measure the time it needs for the samples when the soundcard already has the information available?

4

Re: Fireface 400 + ASIO + wrong samplerate information

You have to set the correct sample rate because this is how it works. Everywhere. You have an audio software - then it sets the sample rate. It would have to do so anyway as there is no way to identify SMUX formats correctly, so the hardware can not self-set reliably. Recording unknown sample frequencies un-attended is not how our interfaces work (and I doubt you will find others that do so). For such a purpose you would use a sample rate converter in front of the interface - that should work.

Regards
Matthias Carstens
RME

Re: Fireface 400 + ASIO + wrong samplerate information

Your answer sounds very restricted.

Anyway it seems that your ASIO interface does not follow the Steinberg ASIO SDK 2.2 specification:

ASIOError ASIOGetSampleRate(ASIOSampleRate *currentRate);
Purpose:
Get the current sample Rate.
--> reports the wrong samplerate

Purpose:
Set the hardware to the requested sample Rate. If sampleRate == 0, enable external sync.
--> does not allow to select sampleRate = 0, it returns ASE_NoClock

The spdif interface is not a SMUX multiplexed interface (of course with ADAT your argument maybe/is ok).

A samplerate converter introduces a signal weakening by additional brickwall filtering. Thus IMO it should be avoided if not really necessary. Furthermore also the samplerate converter has to detect the correct input samplerate, so you just shift the problem to another device.

The FF400 control panel shows the correct samplerate in the input status. Thus it must have already detected the samplerate. You have not answered why the information is not available for the host application. It should be at least valid in case of selecting spdif as an external clock source.

How do usual "stupid" DA-converters connected to the spdif output of the FF400 detect the current samplerate for the correct conversion? They show the detected samplerate on the display and the user has not to set the samplerate first.

BTW I remember that with Linux and ALSA also the correct samplerate is shown (e.g. with HDSP9652 soundcard by amixer cget iface=MIXER,name='External Rate'). Isn't there a way with Windows?

Thanks for your patience.

BR
Uli

Re: Fireface 400 + ASIO + wrong samplerate information

Do you know what happens when you change the audio device's sample rate while an ASIO software is running / recording? It will stop and report that the sample rate has changed.

Your proposed setup will not work simply because you need to decide for one sample rate your audio project to run at. Even if some programs (Samplitude) will be able to import samples at other sample rates (e.g. 48k audio into a 44k project), this will involve sample rate conversion. There is simply no way I know of to have an ASIO software running and reacting correctly to the "unknown" sample rate changes of the external source and create individual chunks of audio at the original sample rate...
Whichever way, you will at some point need to convert sample rates to intergrate all audio into a common project, e.g. for burning to  CD.

An external SRC does not "weaken" signal any more than on-the-fly conversion in software would (or SRC in Windows/WDM does).

uli_bru wrote:

The spdif interface is not a SMUX multiplexed interface (of course with ADAT your argument maybe/is ok).

It is ok indeed, because the device can not behave entirely differently with SPDIF or ADAT signals - or possible combinations thereof....

Furthermore also the samplerate converter has to detect the correct input samplerate, so you just shift the problem to another device.

No, the converter will simply sync to the incoming source (i.e. run in slave mode at the input), then convert to the frequency set internally or received from another clock source (e.g. Word Clock). Therefore, the SRC could sync to the FF400 as far as the output is concerned, and to the SPDIF source for the input. Problem solved, not shifted.

Of course, another alternative would be to simply avoid digital transfer here and go DA-AD. Then you will have all files at one sample rate as well, with no hardware or software SRC involved.

The FF400 control panel shows the correct samplerate in the input status. Thus it must have already detected the samplerate. You have not answered why the information is not available for the host application. It should be at least valid in case of selecting spdif as an external clock source.

The application sets the sample rate. Not the other way round. As explained above by MC.

How do usual "stupid" DA-converters connected to the spdif output of the FF400 detect the current samplerate for the correct conversion? They show the detected samplerate on the display and the user has not to set the samplerate first.

Of course, but this has nothing to do with all this. The converter does not interact with ASIO software.


Regards
Daniel Fuchs
RME

Regards
Daniel Fuchs
RME

Re: Fireface 400 + ASIO + wrong samplerate information

1. Let's forget for a moment ASIO. Let's try to use the FF400 just as a DA converter. So I can select spdif as clock source and forward the spdif input to an analog output. Finally the setup is stored in the flash memory. Then no further computer is in the game. An external spdif source is connected. Does the FF400 now support all samplerates for DA conversion? Like a usual DA converter?

2. Of course an ASIO recording must stop when the samplerate changes. No doubt about. This is exactly my question. I like to detect the samplerate change and to stop the recording of course and finally to restart it with the new correct samplerate (basically the task is to filter the input data and to send them to the outputs, e.g. multi-way crossover application. The filter kernel must change according to the samplerate).

When the input samplerate is 48 kHz first and then 96 kHz actually the ASIO driver does not detect a samplerate change. ASIOGetSampleRate still reports 48 kHz. The control panel shows 96 kHz as input status. So if I could get this information correctly then I can do all the proper actions to restart the filter job correctly.

Is it so difficult to understand or to carry out? Your control panel already proves that the soundcard knows about the correct samplerate.

BR
Uli

PS: I cannot force a user to use AD/DA instead of a digital input signal, indeed the additional conversion will produce additional faults.

Re: Fireface 400 + ASIO + wrong samplerate information

RME Support wrote:

The FF400 control panel shows the correct samplerate in the input status. Thus it must have already detected the samplerate. You have not answered why the information is not available for the host application. It should be at least valid in case of selecting spdif as an external clock source.

The application sets the sample rate. Not the other way round. As explained above by MC.

Just for completeness:

You can simply test it. Set clock source to spdif in control panel. Select a samplerate 44100 in the combobox. Connect a 96 kHz signal to the spdif imput. No other application is running.
The control panel will show 48 kHz in the Clock Mode box AND 96 kHz as input status.

The real application shall run in slave mode and thus simply know about the correct samplerate.  As the external source will set the sample rate. Not the application.

BR
Uli

Re: Fireface 400 + ASIO + wrong samplerate information

This morning I have carried out a simple test by creating two logsweeps with 48 kHz and 96 kHz samplerate (sweep from 10 Hz to fs/2). The sweeps are fed to the spdif input of the FF400 by an external player. The sync is set to spdif and the clock mode samplerate to 48000. In the matrix the spdif input is directly connected to the phones output. So no other application is in the game.

Result 1: playing the 48 kHz sweep is ok. The input status shows 48 kHz. Everything fine
Result 2: playing the 96 kHz sweep leads to clearly audible aliasing in the high frequency range. The input status shows 96 kHz. But the DA-conversion is still done @48 kHz. That's why the aliasing occurs.
Result 3: setting the clock mode to 96000 and playing the 96 kHz sweep does not create the aliasing.

Summary 1: the soundcard is not able to run as a true slave. It expects to have set the clock mode samplerate correctly. Thus the soundcard cannot run as an unattended standalone DA-converter !
Summary 2: the soundcard still detects the input samplerate and displays it in the control panel. But it cannot switch itself to this samplerate. It seems that RME cannot escape because of the design principles (SMUX with ADAT including the change of channel numbers).
Summary 3: thus it is mandatory (with all RME soundcards?) to set the clock mode samplerate by the user or by the application (as already nailed down by MC and DF)
Summary 4: if an application does not know of the input samplerate in advance it will set a wrong clock mode by 100% chance (as long as the source is not restricted to a certain range of samplerates). To get a correct behaviour the application must know about the actual samplerate (as reported in the input status). Then the application can stop the recording, set the correct clock mode samplerate and restart the recording.
Summary 5: the application cannot detect the correct input samplerate by itself. It must get the information from the soundcard. The soundcard has the information at least (see input status). This leads to the final big question: how can the application get the correct samplerate information from the soundcard driver?

Regards
Uli

Re: Fireface 400 + ASIO + wrong samplerate information

uli_bru wrote:

Summary 1: the soundcard is not able to run as a true slave. It expects to have set the clock mode samplerate correctly. Thus the soundcard cannot run as an unattended standalone DA-converter!
Summary 2: the soundcard still detects the input samplerate and displays it in the control panel. But it cannot switch itself to this samplerate. It seems that RME cannot escape because of the design principles (SMUX with ADAT including the change of channel numbers).

Had you done your test with 44/48 k signals, your result would have been different. Indeed the FF400 does switch correctly, but not between sampole rate ranges, and for a good reason.

Summary 3: thus it is mandatory (with all RME soundcards?) to set the clock mode samplerate by the user or by the application (as already nailed down by MC and DF)

This is not RME specific, this is how it works. There is no "master/slave" relation between software and audio interface, and no "slave mode" for audio software like Cubase etc. You have that backwards.

Summary 4: if an application does not know of the input samplerate in advance it will set a wrong clock mode by 100% chance (as long as the source is not restricted to a certain range of samplerates). To get a correct behaviour the application must know about the actual samplerate (as reported in the input status). Then the application can stop the recording, set the correct clock mode samplerate and restart the recording.

It will not work that way. The application is not supposed to "know" and then follow the sample rate. It is the user who decides which sample rate to use within a project. The application then communicates the desired sample rate to the audio device and expects it to follow, not the other way round. If the audio device happens to be set or synced to another sample rate, the application complains.

The idea of stopping recording and restarting after a sample rate range simply will not work... As explained above, you can only set one sample rate withing one project, audio with other sample rates will have to be sample rate converted in one way or another, be it on-the fly or destructively, which I thought you wanted to avoid.

If your idea (stopping/starting) worked, then what about playback? The application would have to keep telling the audio device to change sample rates with every new file or section, to avoid audio being played at incorrect pitch - but how would that agree with your concept of the application being "slave"? And what would happen during overdubbing (recording and playback at the same time)?


Summary 5: the application cannot detect the correct input samplerate by itself.

It is not supposed to. Please face it - your idea with constantly changing "unknown" incoming sample rates is a rather exotic and unusual way of working. It will require unusual solutions, like a hardware SRC device, which will just do away with the problem in your setup once and for all... The RME ADI-192 DD will do this for you with no audible "weakening" of the signal...

It must get the information from the soundcard. The soundcard has the information at least (see input status). This leads to the
    final big question: how can the application get the correct samplerate information from the soundcard driver?

Maybe the ASIO SDK has the answer for you - and you can program an ASIO application that will actually switch along with external sample rate changes. But this is likely to cause more problems than it will solve, see above.

Regards
Daniel Fuchs
RME

Regards
Daniel Fuchs
RME

Re: Fireface 400 + ASIO + wrong samplerate information

Hello Daniel,

please imagine a following setup:

The task is to establish an active crossover network with a PC. The PC has a soundcard. You may consider it as a blackbox with spdif input and 6 analog outputs (3-way stereo setup).

Thus the blackbox will receive a spdif signal from an external source. The signal gets filtered by the application in the blackbox. The result will be sent to the outputs. That's all.
Is this task so unusual?

Our problem is the samplerate of the spdif signal. The blackbox shall/must allow all samplerates. The application takes care about and applies the correct XO filters. IMHO this is not a very special requirement.

The task can be easily solved if the application knows about the true samplerate.

So the communication protocol between the soundcard driver and the application must allow to share the information. The ASIO protocol has commands like ASIOGetSamplerate for this purpose. But the RME ASIO driver sends the wrong information. This is what I'm complaining about. I do not have access to the driver software and so I cannot correct it by myself.

Of course stopping and restarting is my problem then. It does not create a problem as it works fine already e.g. with a samplerate switch between 44.1 and 48 kHz.
I simply cannot use the application for all samplerates as I do not get the correct info for all samplerate switches.

Best regards
Uli

PS:
Please accept that the described task is different from other applications like Cubase and Samplitude.
Please accept that a blackbox user likes to feed the blackbox with 44/16 music but also with 96/24 tracks.
Please accept that the users do not want to buy an ADI192DD for each setup but just use the soundcard.

12

Re: Fireface 400 + ASIO + wrong samplerate information

Your example of the limitation of a stand-alone DAC application is valid, but is not what costumers use (and buy) the 400 (or any other interface) for. Nor do they switch between 44.1 and 96 repeatedly. Even on the UFX you will have to enter the front display and change the sample rate in that case.

ASIOGetSampleRate shows the current sample rate, and that is not the one of whatever input, but the one the system is currently working with. There is no direct way to get the SPDIF input sample rate information to the application.

We might change this behavior, but as it would be a special condition for SPDIF slave mode only it would screw up some other routines, therefore might need quite some time to make its way into the driver. The stand-alone function will not change, sorry.

Regards
Matthias Carstens
RME

13 (edited by uli_bru 2012-08-17 13:41:29)

Re: Fireface 400 + ASIO + wrong samplerate information

I have feared your answer as it may kill an application.

Obviously the Fireface Settings displays the input status, it must connect to the soundcard. Is there a chance for the application to connect in a similar way just to get the missed information? A very bad but possible solution is to run Fireface Settings concurrently with the application, to read its window content by EnumChildWindows and to extract the samplerate (I've tried it, it is possible. But the window has to be kept open and the samplerate has to be listed with each soundcard. This is not safe anyway). A direct communication API would be much better. It even does not screw up other routines as it just takes the missed samplerate info.

Regards
Uli

BTW just another example what users might expect but reality is different:
Take Foobar with ASIO and create a playlist with tracks of mixed samplerates. A user simply expects that all tracks are played correctly. Foobar also knows about the required samplerate as the track info contains it. So Foobar also tries to switch the samplerate. Even from 44.1 to 96. But then the output stops. You can only start it by stopping the playback and restarting. The fault now is on the side of Foobar. The application programmer must know that simply switching the samplerate of RME soundcards does not work. The ASIO driver has to be stopped and restarted.
Of course its only non-professional customers using Foobar ;-)

14

Re: Fireface 400 + ASIO + wrong samplerate information

I am pretty sure your last example would not work with any other ASIO audio interface as well. But on the software side, JRiver's Media Center would do it.

BTW, what you want (SPDIF sync lets the card follow over sample rate range borders) is available with the HDSP9632, HDSPe AIO and the Multiface I and II (via PCI and PCIe).

Regards
Matthias Carstens
RME

Re: Fireface 400 + ASIO + wrong samplerate information

uli_bru wrote:

BTW just another example what users might expect but reality is different:
Take Foobar with ASIO and create a playlist with tracks of mixed samplerates. A user simply expects that all tracks are played correctly. Foobar also knows about the required samplerate as the track info contains it. So Foobar also tries to switch the samplerate. Even from 44.1 to 96. But then the output stops. You can only start it by stopping the playback and restarting. The fault now is on the side of Foobar. The application programmer must know that simply switching the samplerate of RME soundcards does not work. The ASIO driver has to be stopped and restarted.
Of course its only non-professional customers using Foobar ;-)

I have this exact problem.  Anyone find a solution?