Go Back   Home > Forums > >

Equipment & Tools From test equipment to hand tools

DIY Audio Analyzer with AK5397/AK5394A and AK4490
DIY Audio Analyzer with AK5397/AK5394A and AK4490
Please consider donating to help us continue to serve you.

Ads on/off / Custom Title / More PMs / More album space / Advanced printing & mass image saving
Reply
 
Thread Tools
Old 23rd November 2020, 08:34 PM   #3021
Edmond Stuart is offline Edmond Stuart  Netherlands
diyAudio Member
 
Edmond Stuart's Avatar
 
Join Date: Nov 2003
Location: Amsterdam
What does it mean (and do) this so called "Safe Mode"?

Cheers,
E.
Attached Images
File Type: png RTX Save Mode.png (4.7 KB, 248 views)
__________________
http://www.data-odyssey.nl/
  Reply With Quote
Old 24th November 2020, 09:38 AM   #3022
JensH is online now JensH  Denmark
diyAudio Member
 
Join Date: Jul 2009
DIY Audio Analyzer with AK5397/AK5394A and AK4490
From Thesycons documentation:

Quote:
3.1.2 Safe Mode
Because the isochronous packet transfer on USB is driven by USB clock (not sample clock), the driver
is not able to exactly reproduce every ASIO processing interval. The trigger events (callbacks)
delivered by the ASIO driver at the beginning of each interval are subject to jitter. If an application
(such as a DAW) performs extensive computations in the driver callback, the current processing
interval can be extended and overlap with the next interval. In this case a drop-out in the playback path
might occur because the driver is not able to deliver isochronous packets in time.
To compensate for lengthy processing performed by a DAW in the ASIO callback, the driver supports
a “Safe Mode”. If safe mode is turned on then the driver tolerates that a processing interval extends
and overlaps with the next interval.
If audio processing in a DAW causes high CPU usage (e.g. because many effects are used) and drop-
outs occur in the playback path then Safe Mode should be used.
  Reply With Quote
Old 24th November 2020, 10:21 AM   #3023
phofman is online now phofman  Czech Republic
diyAudio Member
 
Join Date: Apr 2005
Location: Pilsen
IIUC the safe mode allows to finish processing of the previous ASIO frame after a new frame has already started. Since ASIO flips between just two memory frames (one being processed by the software, another being written/read by the sound device), a larger overlap will cause the read/write soundcard DMA pointer to clash with the driver write/read pointer, resulting in glitches anyway.
  Reply With Quote
Old 24th November 2020, 10:32 AM   #3024
Edmond Stuart is offline Edmond Stuart  Netherlands
diyAudio Member
 
Edmond Stuart's Avatar
 
Join Date: Nov 2003
Location: Amsterdam
Default Save mode; latency

Hi Jens,

First, thank you for response.
So as far as DiAna concerns, I don't have to worry about this kind of dropouts because computations in the driver callback routine are reduced to the absolute minimum (on my PC with a buffer size of 256 samples and a sampling rate of 192kHz, it takes only 3.8µs).

BTW, I've one more question: The control panel reports a latency of 2.83+1.50=4.33ms. In reality however I measured a little more. Also, that is after each new startup, I got not always the same latency. Instead, it varies from 5.42 to 6.30ms. Why? Is this a quirk of Windows? Note that my Lynx PCI audio interfaces doesn't show this variability. So I guess it has something to do how Windows deals with an USB audio stream, right?

Cheers,
E.
__________________
http://www.data-odyssey.nl/
  Reply With Quote
Old 24th November 2020, 11:01 AM   #3025
JensH is online now JensH  Denmark
diyAudio Member
 
Join Date: Jul 2009
DIY Audio Analyzer with AK5397/AK5394A and AK4490
Good question! Unfortunately I don't know the answer.
  Reply With Quote
Old 24th November 2020, 08:00 PM   #3026
phofman is online now phofman  Czech Republic
diyAudio Member
 
Join Date: Apr 2005
Location: Pilsen
PCI driver talks directly to the soundard, and latency of starting its DMA transfer varies mostly by scheduling capability of windows.

USB-audio driver talks to core usb driver which merges data from all other usb-device drivers for devices connected to the USB controller. Even though the RTX sends/receives data every USB microframe (125us), the USB-core driver accepts data in URBs - chunks with granularity of 1ms How to transfer data to USB isochronous endpoints - Windows drivers | Microsoft Docs - look at the table in item "What are the restrictions on the number of packets for each bus speed". The device driver must specify when the packets submitted to the core driver should be transferred. Even if using flag USBD_START_ISO_TRANSFER_ASAP (see the ms doc page), the core driver will schedule the submitted packets for the next 1ms block of 8 microframes.

IMO this explains the varying latency by about 1ms - sometimes the 1ms frame starts very early after submitting the first URB of the stream, sometimes the usb-audio driver just missed the start and the first packets will have to wait almost whole 1ms.
  Reply With Quote
Old 24th November 2020, 09:21 PM   #3027
chris719 is online now chris719  United States
diyAudio Member
 
Join Date: Jun 2004
Location: Connecticut
DIY Audio Analyzer with AK5397/AK5394A and AK4490
I'm really tired of the poor quality of the USB interfaces and drivers out there. The XMOS is definitely one of the best, but I wish a big player would come out with a bridge that has lower power consumption and free (full featured) drivers. Jens has made the most reasonable choice and I haven't had any issues with my RTX.

If I had spare time I would try to design a Thunderbolt (PCIe) interface. The problem is, who wants to write, test, and support their own drivers for all 3 major platforms? It might be interesting to try to create hardware that exposes the same registers as a widely supported PCIe chip, but there are not many of those (CMI8788, etc.) and most of them lack modern high sample rate support.
  Reply With Quote
Old 24th November 2020, 10:20 PM   #3028
phofman is online now phofman  Czech Republic
diyAudio Member
 
Join Date: Apr 2005
Location: Pilsen
What's wrong with that USB driver? What would a constant latency every run be beneficial for? IMO the issue was just "why", not that it hurts anything. This is a measurement device, not an interactive musical instrument or a DAW interface. A latency of several hundred ms would not hurt any measurements, IMO.
  Reply With Quote
Old 24th November 2020, 10:26 PM   #3029
chris719 is online now chris719  United States
diyAudio Member
 
Join Date: Jun 2004
Location: Connecticut
DIY Audio Analyzer with AK5397/AK5394A and AK4490
I wasn't really speaking to this application in particular, just complaining in general. I could conceive of some applications beyond audio rates, though.
  Reply With Quote
Old 25th November 2020, 08:39 AM   #3030
phofman is online now phofman  Czech Republic
diyAudio Member
 
Join Date: Apr 2005
Location: Pilsen
IMO UAC2 is fully capable of serving the measurement device needs.

Linux supports any UAC2 samplerate/sample width/channel count. Should anything not work, a new kernel is issued every few months.

Windows - since v. 1703 Win10 have support for UAC2 in WASAPI. The specs look OK, incl. 32bit samples USB Audio 2.0 Drivers - Windows drivers | Microsoft Docs . I do not know about max samplerate, but these guys talk about running Topping E30 at 768kHz with WASAPI Topping E30 DAC - Audio Formats - Audirvana .

Unfortunately the UAC2 implicit feedback is not supported (yet), RTX being an example. The fact is that implicit-feedback devices have started to appear more recently, previously the explicit feedback endpoint was basically a rule. Proper handling of implicit feedback made it to linux only recently.

I am planning on some testing of Win10 WASAPI UAC2 stack using UAC2 gadget based on RPi4 in the coming months.

OSX - I have not tested maximum samplerate, but the official example at Technical Note TN2274: USB Audio on the Mac - 192 kHz / 32-bit / 10 channels - basically maxes out isochronous highspeed capacity (without using multiple packets per microframe). Clearly the driver can do the bitrate, just a question of samplerates in some enum/list. I have no OSX device to test but I will ask someone who does and is able to handle the RPi linux configuration for help.
  Reply With Quote

Reply


DIY Audio Analyzer with AK5397/AK5394A and AK4490Hide this!Advertise here!
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
New AKM Stereo ADC AK5397 announced JensH Digital Source 20 24th December 2014 01:05 PM
New AKM Stereo ADC AK5397 ??? HpW Equipment & Tools 6 16th May 2014 05:26 PM
NTi Audio XL2 Handheld Audio Analyzer Fredenando Equipment & Tools 0 18th April 2010 04:04 AM
AKM AK5394a TobWen Digital Source 41 31st December 2003 07:18 PM


New To Site? Need Help?

All times are GMT. The time now is 09:20 AM.


Search Engine Optimisation provided by DragonByte SEO (Pro) - vBulletin Mods & Addons Copyright © 2021 DragonByte Technologies Ltd.
Resources saved on this page: MySQL 14.29%
vBulletin Optimisation provided by vB Optimise (Pro) - vBulletin Mods & Addons Copyright © 2021 DragonByte Technologies Ltd.
Copyright ©1999-2021 diyAudio
Wiki