Page 1 of 2

Recordings at 192 kHz very faulty

Posted: Sat May 02, 2015 11:54 am
by UweB
Hi everybody,

we designed a USB Audio Class 2 interface for recordings on PC (there is no playback function provided in this interface.) This works correctly with several other recording programs (Cubase, TwistedWave, WavePad) but with Audacity we encounter severe problems on two completely different MACs. BTW, except ours, I don't have any other USB Audio Class 2 signal source.

Up to 96 kHz everything is ok. From 176.4 kHz on, the first signs of the problem appear. At 192 kHz a signal is heavily disturbed as can be seen on this screen shot:
Audacity192kHz.PNG
Errors at 192 kHz
Audacity192kHz.PNG (561.22 KiB) Viewed 1136 times
The signal is recorded correctly for a couple of ms, then a gap follows where either the signal is replaced by zeros or zeros are inserted, afterwards the recording continues and so on. The upper recorded track shows a 10 Hz (left) and a 100 Hz (right) sine wave and the lower track a 10 Hz (left) and a 10 Hz (right) sine wave. (The "hick up" at approx. 10 ms is not too interesting here, but it does not appear with other recording programs either. I can't even exclude that it is created by our interface and just "cut off" by the other programs.) The position of the gaps is always identical, i.e., it is not a coincidence that the gaps in these tracks are aligned underneath each other.

To the best of my belief, for several reasons this can only be explained by a bug in Audacity:
1. All other programs I was able to test did not show any error, even when one signal is recorded synchronously by Audacity and another recording software.
2. When I switch to a project rate of e.g. 48 kHz the recording is perfect, too. (I assume that Audacity does the down sampling.)
3. The behavior is identical on two different PCs. Only the sizes of the gaps vary slightly and become sometimes irregular.

I use the newest Audacity 2.1.0. It was installed by the .dmg. One of the PCs I have for tests is a MacBook with OS X 10.7.5 (Lion) and the other is a Lenovo Think Pad with Mavericks (10.9?).

I would be grateful for any help and should we be able to help to correct the (assumed) error, please let us know, we would be glad. Particularly because I was forced to try out several other programs and had to experience why I definitely would want to stay with Audacity.

Best regards

Uwe

Re: Recordings at 192 kHz very faulty

Posted: Sun May 03, 2015 1:55 am
by Gale Andrews
Developers don't hang out on Audacity Forum, so if you ultimately consider this is an Audacity bug you will need to subscribe to then write to the -developers mailing list https://lists.sourceforge.net/lists/lis ... city-devel.

However I can ask you some basic questions first.

Have you tried on Windows (using Parallels or Boot Camp on the MacBook)? That way you can determine if the problem is specific to Mac. A Lenovo ThinkPad running OS X is basically a Hackintosh so I really think you should try that machine on Windows.

Did you follow Apple's Technical Note TN2274: USB Audio on the Mac?

Have you looked at "Actual Rate" bottom right of Audacity? When recording this should show the rate communicated by the soundcard to Audacity. What rates did you build your device to support?

Have you set your device up in /Applications/Audio MIDI Setup so that the specified sample rate matches with the Audacity project rate?

Does experimenting with "Audio to buffer" in Audacity's Recording Preferences make any difference?


Gale

Re: Recordings at 192 kHz very faulty

Posted: Sun May 03, 2015 8:05 am
by UweB
Hi Gale,

thanks for your answer. I expected to be "closer to the developers" here but that's not the first time that one of my expectations turns out to be wrong :)

Windows: I am a pure Windos user, I borrowed the MacBook and the HackBook for my tests and it is the fist time I have contact to OS X. Thus the first tests were on Windows. But you may know that Windows supports USB Audio Class 1 only so that 192 kHz is not possible. This is why up to 48 kHz our interface acts as a USB Audio Class 1 interface. All sample rates up to 96 kHz work on all systems (Windows up to 48 kHz) fine. BTW, I believe that I was told that it works on Linux, too, but I'm not sure and I can get no confirmation today. It looks like it is specific only to 1. 176.4 kHz and upwards, 2. Audacity and 3. Mac.

Actual rate: Yes, it was always correct. I wonder why it is not visible in the screenshot.

Apple's Technical Note TN2274: Indeed, the guy who designed the interface sent me a link to that technote. Without that he possibly wouldn't have been able to get through with the job.

Project Rate: Yes. The sample Rate of our device cannot be controlled by software (it is an interface between USB and S/PDIF, and you cannot control the sample rate of an independent external digital audio data stream). This is why our interface, when connected, provides only one sample rate. When this sample rate changes, the interface disconnects and re-connects as a different interface. In that case in Audacity you have to rescan and then select the "new" audio device. This, BTW, works fine and must be handled accordingly in other recording programs.

Audio to buffer: I didn't try that and currently it doesn't make sense, because:

I experienced a huge and irritating surprise yesterday evening: In order to examine the error more closely, I made a new 192 kHz recording on the MacBook - and it worked! I tried all sorts of things, but it continued to to work perfectly! I changed to the Thinkpad and, except for the very first recording, all others worked, too! I switched between the PCs, rebooted - nothing happened, it simply continued to work!

Is this good news? No, not at all. It indicates that there is an error that may appear or disappear, and that is not better than an error that is constantly occurs. The tests before were made over several days, the error was "stable and reliable". Nothing was changed - so what do I observe? A pure coincidence that from one day to another it switches from "coincidentally constantly failing" to "coincidentally constantly working" on two PCs? I cannot see any reason!

Uwe

Re: Recordings at 192 kHz very faulty

Posted: Mon May 04, 2015 5:42 am
by Gale Andrews
UweB wrote:But you may know that Windows supports USB Audio Class 1 only so that 192 kHz is not possible. This is why up to 48 kHz our interface acts as a USB Audio Class 1 interface. All sample rates up to 96 kHz work on all systems (Windows up to 48 kHz) fine.
There is no sign yet if Windows 10 will finally add support for USB Audio Class 2.

But USB Audio Class 1 supports up to 96000 Hz as far as I know: http://thewelltemperedcomputer.com/Intr ... _SPDIF.htm.


Gale

Re: Recordings at 192 kHz very faulty

Posted: Mon May 04, 2015 11:07 am
by waxcylinder
@Gale: this couldn't possibly have anything to do with the mis-behavior that You and Bill get on Macs with the experimental scrubbing, could it :?:

Peter

Re: Recordings at 192 kHz very faulty

Posted: Mon May 04, 2015 3:14 pm
by cyrano
Have you tried running Audio/Midi setup? It's in Programs/Utilities/

Core Audio treats devices either as "known", or as "unknown". A device that supports only one sample rate probably is considered "unknown".

Logging out and logging back in, restarting the Mac, or running Audio/Midi setup might change this status.

It's a problem I see with some video digitizers too. Confusing. Some of those old digitizers will only connect if you attach them to the Mac while it's off and power the device before booting the Mac. The problem is really bad with Firewire 400 devices on a FW800 bus. And with USB 1.1 devices on USB3 ports. And a lot of "USB2" audio devices really are only USB 1.1.

And sometimes, it appears as if all settings are correct in Audio/Midi setup, but reaffirming them still fixes it.

Re: Recordings at 192 kHz very faulty

Posted: Mon May 04, 2015 9:34 pm
by UweB
@ Gale:
>There is no sign yet if Windows 10 will finally add support for USB Audio Class 2
That's what the designer of our interface tells me, too.
>But USB Audio Class 1 supports up to 96000 Hz as far as I know: http://thewelltemperedcomputer.com/Intr ... _SPDIF.htm.
Yes, correct. Meanwhile (since yesterday, to be precise) our interface supports 96kHz/24Bit via USB Audio Class 1, too. And 128/24 or 196/16 via USB Audio Class 1 would also be possible, but in one direction only. Bidirectional only half of it is possible. Windows does support that all. Possibly we will implement it, but we don't know yet a simple way how to tell the device whether in case of 192 kHz it needs to act as a USB Audio Class 2 device with 24 bits or a USB Audio Class 1 device with 16 bits.

@ Cyrano:
>And a lot of "USB2" audio devices really are only USB 1.1.
USB 2.0 is not USB Audio Class 2. In fact, many devices, e.g. µCs, are specified to have a USB 2.0 interface, but actually it is only USB 2.0 compatible and supports Low and Full Speed only. That can be very annoying when you search for a true High Speed USB 2.0 µC.

I tried a lot of things, but nothing in Audio/Midi setup. Could I hope for some kind of hint there? I mean, other Programs record correctly, Audacity also records correctly when I change the project rate to 48 kHz, i.e., downsampling - I cannot imagine that somenthing might be to find in the set up. And of course I often restarted the machines without effect.

I already wrote that the problem I described has vanished a couple of days ago, and it has vanished at the same time on two different OS X machines. It is still absent, thus I cannot make test now, but I have to fear that it will reappear when it becomes a huge problem to correct it.

Re: Recordings at 192 kHz very faulty

Posted: Tue May 05, 2015 12:42 am
by cyrano
I test a lot of interfaces. And I just recorded 8 channels of 192 KHz 24 bit audio with Audacity without any problem a few days ago. So I don't think the problem is with Audacity.

I do know interfaces that report being capable of only one sampling frequency usually do not work immediately with OSX. A lot of stuff is being cached in OSX, preferences included. And Core Audio prefs are set in System Preferences and Audio/Midi setup. I've never understood why Apple needs two places for settings when it comes to audio.

Sometimes, everything seems to work, but no audio comes through. And in these rare cases, just launching Audio/Midi setup, changing settings and affirming seems to fix it. Even if settings seem right, I just change something, save and exit.

Core Audio is solid, in general. But it doesn't handle most things that are not by the book very gracefully. And it throws NO errors to the user. Hec, Since Lion it doesn't even log much.

Your problem is gone now. Try it if and when it reappears?

Re: Recordings at 192 kHz very faulty

Posted: Tue May 05, 2015 6:33 am
by Gale Andrews
waxcylinder wrote:@Gale: this couldn't possibly have anything to do with the mis-behavior that You and Bill get on Macs with the experimental scrubbing, could it :?:
I don't think so, Peter. I have the scrubbing problem in 2.1.1-alpha even at 44100 Hz.

Gale

Re: Recordings at 192 kHz very faulty

Posted: Tue May 05, 2015 6:45 am
by Gale Andrews
UweB wrote:I tried a lot of things, but nothing in Audio/Midi setup. Could I hope for some kind of hint there? I mean, other Programs record correctly, Audacity also records correctly when I change the project rate to 48 kHz, i.e., downsampling - I cannot imagine that somenthing might be to find in the set up.
Yes, in the event of problems you should select the device in Audio MIDI setup, as I suggested in my first reply.

Audio MIDI is the only place you can adjust sample rates and bit depths.

As cyrano said, sometimes simply selecting the device there and closing Audio MIDI can correct problems (though you should take the opportunity to choose the same sample rate that you choose in the DAW). Audacity does seem a little more prone to requiring this than some apps, which could be something to do with the PortAudio audio API we use.

It may well be instructive to see what Audio MIDI Setup reports as your device's sample rate choice(s) when first connected, and what happens in Audio MIDI Setup when you open a DAW.


Gale