Virtual Loopback Audio Driver for PC DSP - diyAudio
Go Back   Home > Forums > Source & Line > PC Based

PC Based Computer music servers, crossovers, and equalization

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 Search this Thread
Old 22nd May 2012, 08:48 PM   #1
boris81 is offline boris81  United States
diyAudio Member
 
Join Date: Oct 2009
Location: white plains, ny
Default Virtual Loopback Audio Driver for PC DSP

The most popular solution for a PC crossover seems to be using 2 sound cards. All sound applications output to SoundCard1. SoundCard1 routes the stream internally and makes it available at its inputs. A software that runs continuously on the PC picks up the stream from SoundCard1 and does the necessary processing. Usually that is done in a VST host that runs several plug-ins. Then the software sends the processed sound to SoundCard2 which outputs it to the amplifiers.

Media Player -> SoundCard1 -> DSP software -> SoundCard2 -> Amplifier

The hardware of SoundCard1 is not necessary, the sound stream is usually routed in the driver and never reaches the card itself. Another popular solution is the DAW Reaper. It has a very good virtual audio driver called ReaRoute and a VST host simplifying this type of work.

Media Player -> Reaper ReaRoute -> Reaper VST DSPs -> Sound Card -> Amplifier


----
It should be possible to create a standalone Virtual Loopback Audio Driver without attaching it to hardware. It could receive all audio streams, process them and transfer them to the actual Sound Card Driver to output. It can be optimized for minimum overhead and since it's a driver it will run continuously in the background. Windows comes with a Virtual Loopback Network Adapter, why not an Audio one? Does anyone here have experience with writing Audio Drivers in Windows?
  Reply With Quote
Old 22nd May 2012, 11:43 PM   #2
diyAudio Member
 
Join Date: Feb 2009
Location: UK
Quote:
Originally Posted by boris81 View Post
The most popular solution for a PC crossover seems to be using 2 sound cards. All sound applications output to SoundCard1. SoundCard1 routes the stream internally and makes it available at its inputs. A software that runs continuously on the PC picks up the stream from SoundCard1 and does the necessary processing. Usually that is done in a VST host that runs several plug-ins. Then the software sends the processed sound to SoundCard2 which outputs it to the amplifiers.

Media Player -> SoundCard1 -> DSP software -> SoundCard2 -> Amplifier

The hardware of SoundCard1 is not necessary, the sound stream is usually routed in the driver and never reaches the card itself. Another popular solution is the DAW Reaper. It has a very good virtual audio driver called ReaRoute and a VST host simplifying this type of work.

Media Player -> Reaper ReaRoute -> Reaper VST DSPs -> Sound Card -> Amplifier


----
It should be possible to create a standalone Virtual Loopback Audio Driver without attaching it to hardware. It could receive all audio streams, process them and transfer them to the actual Sound Card Driver to output. It can be optimized for minimum overhead and since it's a driver it will run continuously in the background. Windows comes with a Virtual Loopback Network Adapter, why not an Audio one? Does anyone here have experience with writing Audio Drivers in Windows?
I wish I had seen this thread before I started on this sort of thing myself - it would have saved me a lot of head scratching wondering if I was alone in thinking of this as a problem!

I can't quite get my head around the idea of using two sound cards, without there being a problem, somewhere along the line, of their using different sample clocks and a need to resample somewhere in the system. In one experiment I used two sound cards, but went from one to the other via SPDIF - Creative cards are happy to resample from any sample rate to any other, but it's not 'bit perfect'. I also considered removing the crystal from one card and locking its sample master clock to that of the other - I have no reason to think this would not work.

I notice that in the release notes for the commercial product Virtual Audio Cable there is a line
Quote:
Clock correction precision increased to 0.0000001% (1E-8%).
suggesting that in order to do what it does (very cleverly), it has to do some form of clock matching, implying re-sampling and/or jitter of some kind? (I know that it will be utterly, utterly inaudible, but some posters on here manage to instil in me a fear of any deviation from 'bit-perfect'-ness). I wish I had known of Reaper's ReaRoute as well.

But it turns out that the Creative X-Fi card, at least, will allow you to pick up a stream from it, process it, and route it to the outputs, all locked together and 'bit perfect'. I'm happy to work with that for the time being.
  Reply With Quote
Old 23rd May 2012, 02:34 PM   #3
boris81 is offline boris81  United States
diyAudio Member
 
Join Date: Oct 2009
Location: white plains, ny
Maybe I am wrong but I was under the impression that jitter is strictly a DAC related hardware clock issue. All processing that happens before the DAC would be irrelevant because it's buffered and processed frame-by-frame.
There is of course a problem with resampling but we could do all processing at the sampling rate of the source and if we need to, resample right before the DAC.
  Reply With Quote
Old 23rd May 2012, 03:58 PM   #4
diyAudio Member
 
Join Date: Feb 2009
Location: UK
Quote:
Originally Posted by boris81 View Post
Maybe I am wrong but I was under the impression that jitter is strictly a DAC related hardware clock issue. All processing that happens before the DAC would be irrelevant because it's buffered and processed frame-by-frame.
There is of course a problem with resampling but we could do all processing at the sampling rate of the source and if we need to, resample right before the DAC.
Maybe wrongly, I was thinking along the lines of there being two types of re-sampling. One is a straightforward file conversion from 44.1 kHz to 48 kHz for example. But another is where I have to do it on a real time stream, and go from 44.098-ish to 44.101-ish kHz, having to measure the relative sample rates in real time and prevent a buffer from emptying or filling excessively. My measurement errors can be suppressed by averaging, but there will always be an error in the sample rate measurement that gives a resampling error which is the direct equivalent of jitter, even if the literal jitter in timing at the DAC is zero. (Not saying it's actually going to be audible, or even measurable, however).
  Reply With Quote
Old 23rd May 2012, 07:29 PM   #5
diyAudio Member
 
Join Date: Mar 2011
Location: Rochester, MN
J River media center has a loopback function. It grabs the audio sent to the default soundcard (say the mobo sound), processes it, and sends it to a soundcard set within JR (in my case a firewire interface). Within its DSP section is a solid PEQ, a convolution engine, and it can host vst plugins. IMO much simpler than rearoute, vac, etc. It's quite a capable media player as well.
  Reply With Quote
Old 17th June 2012, 07:39 AM   #6
fb is offline fb  Australia
diyAudio Member
 
Join Date: Apr 2005
Location: Brisbane, Aus
Try JACK: JACK | connecting a world of audio

It's not always the easiest to set up but seems to work ok.
  Reply With Quote
Old 28th June 2012, 10:20 PM   #7
GDO is offline GDO  Spain
diyAudio Member
 
Join Date: Jul 2009
Quote:
Originally Posted by boris81 View Post
The most popular solution for a PC crossover seems to be using 2 sound cards.
Much better is 2 PCs.
  Reply With Quote
Old 29th June 2012, 08:09 AM   #8
diyAudio Member
 
Join Date: Feb 2009
Location: UK
Quote:
Originally Posted by GDO View Post
Much better is 2 PCs.
Surely the best solution has got to be a single sound card so no re-sampling is necessary. From my experience, the Creative X-Fi will do this, 'bit perfect' i.e. the stream being received at the input to the card can be picked up by your xover software, processed and then fed to the six or eight DAC outputs with everything locked to the same sample clock. The supplied applet allows you to disable any direct link from the input to the outputs ('Audio Creation mode').

It would be useful to know which other cards are also capable of this. However, it doesn't seem to be something that you can necessarily deduce from the cards' specs and advertising blurb. Could we assemble a list of cards which can do this?
  Reply With Quote
Old 29th June 2012, 09:51 AM   #9
phofman is offline phofman  Czech Republic
diyAudio Member
 
Join Date: Apr 2005
Location: Pilsen
Quote:
Originally Posted by CopperTop View Post
It would be useful to know which other cards are also capable of this. However, it doesn't seem to be something that you can necessarily deduce from the cards' specs and advertising blurb. Could we assemble a list of cards which can do this?
All envy24-based cards with spdif input can do that physically - they can switch the clock from internal to external - the clock recovered from the spdif input stream. Of course the proprietary driver can be buggy. But it should work at least in linux.

I am not sure about usb soundcards with spdif input since the input can behave independent of the outputs, depending on the usb receiver chip. Most inputs run isochronous asynchronous (which is a must for spdif input), most outputs run isochronous adaptive - two different clock domains.
  Reply With Quote
Old 29th June 2012, 10:57 AM   #10
GDO is offline GDO  Spain
diyAudio Member
 
Join Date: Jul 2009
Quote:
Originally Posted by CopperTop View Post
Surely the best solution has got to be a single sound card so no re-sampling is necessary.
Many people use now a player in the pc as their one and only source, and yes i agree with your point in this case. If it's not the case, as in my case, all this is moot, and for this reason i prefer to use a second PC as standalone DSP machine as others use a DCX or whatever, and a player PC as one of my sources . But, i admit i'm not a bit obsessed purist...
  Reply With Quote

Reply


Hide this!Advertise here!
Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
A bare bones framework for audio DSP on a PC CopperTop PC Based 48 9th August 2012 08:20 AM
FS: Frequency Allocator PC crossover and DSP program jdubs Swap Meet 2 16th May 2012 03:28 AM
Audio Garage Sale (real not virtual) Timn8ter Swap Meet 16 1st September 2008 11:39 PM
PC DSP crossover. Anyone interested in testing? Thunau Multi-Way 0 26th February 2006 11:14 PM
sound card loopback software? george a Everything Else 3 31st May 2005 07:17 AM


New To Site? Need Help?

All times are GMT. The time now is 10:57 AM.


vBulletin Optimisation provided by vB Optimise (Pro) - vBulletin Mods & Addons Copyright © 2014 DragonByte Technologies Ltd.
Copyright 1999-2014 diyAudio

Content Relevant URLs by vBSEO 3.3.2