Go Back   Home > Forums > >
Home Forums Rules Articles diyAudio Store Blogs Gallery Wiki Register Donations FAQ Calendar Search Today's Posts Mark Forums Read

PC Based Computer music servers, crossovers, and equalization

Virtual balanced in/out from regular soundcard in linux - results
Virtual balanced in/out from regular soundcard in linux - results
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 29th August 2018, 11:35 AM   #1
phofman is offline phofman  Czech Republic
diyAudio Member
 
Join Date: Apr 2005
Location: Pilsen
Default Virtual balanced in/out from regular soundcard in linux - results

Regular soundcards have only single-ended inputs/outputs. For longer runs/measurements/avoiding ground loops a balanced connection is needed.

This is what happens if stereo single-ended inputs/outputs of a regular internal soundcard are converted into dual-mono balanced ones by simple alsa configuration in .asoundrc.

Code:
pcm.balanced_in {
         type route
         slave {
                 pcm "hw:0"
                 channels 2
         }

	 ttable {
		 0.0= 0.485571
		 0.1= -0.49
		 1.0= 0.485571
		 1.1= -0.49
	 }
}

pcm.balanced_out {
         type route
         slave {
                 pcm "hw:0"
                 channels 2
         }
	 ttable {
		 0.0= 1
		 0.1= -1
	 }
}
pcm.balanced
{
    type asym
    playback.pcm
    {
        type plug
        slave.pcm "balanced_out"
    }
    capture.pcm 
    {
        type plug
        slave.pcm "balanced_in"
    }
}
Device balanced_out - right channel of the virtual device is inverted to the soundcard left output channel

Device balanced_in - input channels of the soundcard are subtracted into identical right/left channels of the virtual device. To avoid clipping with full-scale signal, each input channel contributes < 50% to the result.

To optimize common-mode rejection I measured transfer of each in/out chain:

1) recording stereo signal (hw:0 -> hw:0) and

2) measuring RMS in each channel by sox

Code:
sox out.wav -n remix 1 stat
sox out.wav -n remix 2 stat
The ratio of listed RMS amplitudes gives the channel difference and corresponding coffecient of one channel in balanced_in definition must be multiplied with. In my case the default 0.49 coefficient was calibrated to 0.485571 for the other channel.

Measured results:

Line-in jack on PC front panel was hooked with line-out jack on back panel with a regular thin long curly stereo jack cable. Older power-consuming workstation producing lots of EMI/RFI (Dell Precision, 2 x dual Xeon, 72GB RAM), internal Intel HDA with 24bit codec AD1984A.

Measured in arta under wine (wine must be configured to offer alsa software devices)

Code:
winetricks sound=alsa
Sound - WineHQ Wiki

Useful Registry Keys - WineHQ Wiki


Measured results show that even a simple integrated soundcard in the extremely noisy environment of a loaded PC offers very good CMRR (70dB).

With a stereo soundcard such setup can enable measuring bridged amps and/or significantly reducing ground loop effects in measuring.

A multichannel soundcard can be configured to provide stereo balanced output for longer runs and/or reducing the ground-loop issues.
Attached Images
File Type: png single-ended-1200Hz.png (118.5 KB, 161 views)
File Type: png virtual-balanced-1200Hz.png (108.3 KB, 153 views)
File Type: png single-ended-13+14kHz.png (116.1 KB, 154 views)
File Type: png virtual-balanced-13+14kHz.png (112.2 KB, 154 views)
File Type: png calibrated-cmmr.png (109.0 KB, 154 views)
File Type: png calibrated-cmrr-13+14kHz.png (108.3 KB, 23 views)

Last edited by phofman; 29th August 2018 at 07:41 PM.
  Reply With Quote
Old 29th August 2018, 02:02 PM   #2
PMA is offline PMA  Europe
diyAudio Member
 
PMA's Avatar
 
Join Date: Apr 2002
Location: Prague
Good job, it is a nice way how to get balanced input from conventional sound card single-ended inputs and thus avoid ground loops that are inevitable in single-ended loop measurements.
  Reply With Quote
Old 29th August 2018, 04:36 PM   #3
voltwide is offline voltwide  Ireland
diyAudio Member
 
Join Date: Jan 2010
USB soundcards like EMU202 offer symm inputs and are affordable.
  Reply With Quote
Old 29th August 2018, 05:25 PM   #4
DPH is online now DPH  United States
diyAudio Member
 
Join Date: Dec 2008
Location: Portland, OR
Quote:
Originally Posted by PMA View Post
Good job, it is a nice way how to get balanced input from conventional sound card single-ended inputs and thus avoid ground loops that are inevitable in single-ended loop measurements.
x2 on the praise. Clever trick worth keeping in mind. Thanks, PHofman
__________________
Happy DIYing, Daniel
  Reply With Quote
Old 31st August 2018, 09:26 PM   #5
miero is offline miero  Czech Republic
diyAudio Member
 
Join Date: Jun 2011
Location: Prague
I'd like to show measurements of two amplifiers giving 1Vrms into a real loudspeaker using this method.

Measurement equipment:
- virtual balanced input on line-in of internal soundcard [Realtek ALC892, ADC with 90dB(A) SNR] in a PC with ATX supply
- Linux+Wine and ARTA measurement software

Both measurements are direct input from loudspeaker terminal into L+R wires of line-in input - no divider (ground wire was not connected). Voltage on a speaker terminal 1Vrms.

Notice: without virtual balanced input measurements would show much more power line frequencies and their intermodulations with a signal.


Amplifier #1: NAD D3020, USB input [Class-D]
Click the image to open in full size.


Amplifier #2: DPA222mk2 fast SSE [Class-AB, designed by Pavel Dudek (Upupa Epops), built by me from DIY kit]

In this case I used internal sound card as a signal source. It has a higher noise floor at least by 3dB than it would have with a better signal source.
Click the image to open in full size.
__________________
BeagleBone Black with I2S, DSD and SPDIF interface (Linux driver)
http://bbb.ieero.com/
  Reply With Quote
Old 31st August 2018, 09:34 PM   #6
phofman is offline phofman  Czech Republic
diyAudio Member
 
Join Date: Apr 2005
Location: Pilsen
Miero, thanks for the measurements. Is the DPA amp earthed (class I)?
  Reply With Quote
Old 31st August 2018, 09:40 PM   #7
miero is offline miero  Czech Republic
diyAudio Member
 
Join Date: Jun 2011
Location: Prague
Yes, both measured amplifiers are earthed. There was no hum in the loudspeaker, so I guess the line input of the sound card has capacitors on signal lines.
__________________
BeagleBone Black with I2S, DSD and SPDIF interface (Linux driver)
http://bbb.ieero.com/

Last edited by miero; 31st August 2018 at 09:42 PM.
  Reply With Quote
Old 17th September 2018, 08:55 PM   #8
phofman is offline phofman  Czech Republic
diyAudio Member
 
Join Date: Apr 2005
Location: Pilsen
Comparision of virtual vs. native balanced input of ESI Juli@ in my measurement station Headless Amplifier Measurement Workstation

The poor CMRR (-50dB) of native balanced inputs suggests Juli uses a fake balanced input similar to one described in Audio Note

Click the image to open in full size.

When shorting the corresponding SE (cinch) input, the cold balanced input sensitivity drops down to -50dB.

IMO the performance of calibrated virtual input is clearly better than that of native fake balanced inputs of Juli.

Of course a proper balanced input with good differential amp does offer a significantly better CMMR (e.g. -100dB for Lynx22 with standard INAxxx).
Attached Images
File Type: png no-signal-virtual-balanced.png (41.8 KB, 20 views)
File Type: png no-signal-native-balanced.png (42.0 KB, 16 views)
File Type: png cmrr-virtual-balanced-192kHz.png (41.3 KB, 13 views)
File Type: png cmrr-native-192kHz.png (38.7 KB, 14 views)
File Type: png fr-virtual-balanced-192kHz.png (37.9 KB, 13 views)
File Type: png fr-native-balanced-192.png (35.4 KB, 11 views)
  Reply With Quote

Reply


Virtual balanced in/out from regular soundcard in linux - resultsHide 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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
UCD180 balanced via soundcard mlihl Class D 5 18th December 2007 10:37 PM
Which soundcard with balanced outs has the best SQ and is less than $250? MikeHunt79 Digital Source 7 28th October 2007 05:19 PM
Modify soundcard, unbalanced to balanced. Llafriel Parts 6 16th May 2006 03:12 PM
Soundcard test results IanHarvey Digital Source 2 23rd January 2004 11:08 AM
got my ESI WT2496 soundcard today - results :) ergo Digital Source 3 30th October 2003 07:24 PM


New To Site? Need Help?

All times are GMT. The time now is 10:21 PM.


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