Author Topic: USB noise or ground loop?  (Read 6378 times)

0 Members and 1 Guest are viewing this topic.

Offline drummerdimitriTopic starter

  • Frequent Contributor
  • **
  • Posts: 532
  • Country: lb
USB noise or ground loop?
« on: March 23, 2019, 10:57:48 am »
I have a USB DAC/Headhpone AMP that also supports TOSLINK connection and with very sensitive IEMs on USB I can hear a lot of nasty noise when no music is playing at any volume level.

When I switch over to the TOSLINK connection, all that noise goes away. I have found two devices that eliminates USB noise by filtering or by disconnecting the 5V rail since my DAC is mains powered.

The only issue is I'm not sure how to differentiate a noisy USB connection vs a ground loop. If I can identify the problem then there are products that do both.
 

Offline jonroger

  • Regular Contributor
  • *
  • Posts: 72
  • Country: us
Re: USB noise or ground loop?
« Reply #1 on: March 23, 2019, 01:54:21 pm »
I would just go on ebay and pay $17 for a USB isolator that isolates everything.
I am available for custom hardware/firmware development.
 

Offline Nominal Animal

  • Super Contributor
  • ***
  • Posts: 7192
  • Country: fi
    • My home page and email address
Re: USB noise or ground loop?
« Reply #2 on: March 23, 2019, 02:55:49 pm »
a noisy USB connection
USB is a digital protocol, with data encapsulated in packets with error checking.  If the data is garbled, the audio will cut off and click; it won't just have some background noise or hiss.  (Jitter might occur with USB audio, but not as background noise/hiss.)

a ground loop
That is what you have. The cheap USB isolators operate only on USB 1.1 Full Speed, or 12 Mbit/s, so you need to use an isolator on the audio USB link only.  (Some isolators have a switch to choose between 1.2 Mbit/s and 12 Mbit/s data rate.)

They are based on Analog Devices' dedicated ADuM4160 or ADuM3160 chips, and their reference design.  The only thing that varies is the DC-DC converter used; it must be isolated for the device to work correctly.  When you get one, just check the largest component on the board; that will be the DC-DC converter.  Mornsun B0505S series is commonly used (they vary by the amount of power they pass), and work fine for ground loop isolation.  Find its data sheet, and verify that it is an isolated one (minimum 1 kV isolation), and passes sufficient current for your device. (For powered USB devices, 100mA is usually enough.)

1 kV isolation means that if the two sides are powered by different 240 VAC mains circuits, there can be about 300 volts potential difference between the zero potentials and the isolator will still work, even if the two circuits are not synchronized in any way.  So, I personally use one when I ground loops are a possibility between two devices powered from the same building or "fuse box", but possibly from different circuits.  If the two sides are powered by e.g. different buildings, I use Ethernet (which is magnetically isolated) or an optical connection.

Any proper elechicken can explain this better, I'm sure.
 
The following users thanked this post: drummerdimitri

Offline GeoffreyF

  • Regular Contributor
  • *
  • Posts: 234
  • Country: us
Re: USB noise or ground loop?
« Reply #3 on: March 23, 2019, 04:05:19 pm »
Did you probe the differential between the devices and other grounds with a DVM or an oscilloscope?   That would answer your question completely. Getting a choke (ferite core) around the USB cable would possibly be a remedy as well.   If all that reveals nothing, then it's not what you speculate.
US Amateur Extra W1GCF.
 

Offline drummerdimitriTopic starter

  • Frequent Contributor
  • **
  • Posts: 532
  • Country: lb
Re: USB noise or ground loop?
« Reply #4 on: March 23, 2019, 05:49:33 pm »
Did you probe the differential between the devices and other grounds with a DVM or an oscilloscope?   That would answer your question completely. Getting a choke (ferite core) around the USB cable would possibly be a remedy as well.   If all that reveals nothing, then it's not what you speculate.


What do you mean by differential? What exacly should I be probing with my scope?

Will try your suggestion of a choke even though I'm almost sure it won't solve my problem.
 

Offline drummerdimitriTopic starter

  • Frequent Contributor
  • **
  • Posts: 532
  • Country: lb
Re: USB noise or ground loop?
« Reply #5 on: March 24, 2019, 10:19:52 am »
I tried using the choke but that didn't work unsurprisingly.

I cut a USB extension in half and soldering all the wires back except the ground and Vcc wires and although it solved the ground loop I could still a slight buzzing sound.

How is that possible since as mentioned above USB should have no noise as it is a digital signal?

I'm thinking of switching back to TOSLINK as that connection is electrically isolated.



 

Offline Nominal Animal

  • Super Contributor
  • ***
  • Posts: 7192
  • Country: fi
    • My home page and email address
Re: USB noise or ground loop?
« Reply #6 on: March 24, 2019, 11:47:47 am »
I cut a USB extension in half and soldering all the wires back except the ground and Vcc wires and although it solved the ground loop I could still a slight buzzing sound.
It can still be similar to a ground loop, except the noise being conducted through the D+ and D- lines to the DAC.

The only way you can be sure is to get an USB isolator and see, for example this one for under $10 USD.

How is that possible since as mentioned above USB should have no noise as it is a digital signal?
The D+ and D- lines are still electrical, and may have common-mode noise.  Depending on how the USB receiver is implemented, that common mode noise may affect the DAC, essentially the same way a low-voltage noisy ground loop would.

That is, I do not believe the noise is inherent in the data itself.  USB is a reliable protocol (except on faulty devices like Raspberry Pi's), with each data packet having checksums; there is even a facility for resending missing/broken packets, but that depends on the devices and available bandwidth. The only difference between the USB and TOSLINK connections, as far as I understand, is that USB passes electrical noise (such as common-mode noise in the data lines, or ground loop due to voltage potential differences in the circuits), whereas TOSLINK does not, as it is purely optical.

I'm thinking of switching back to TOSLINK as that connection is electrically isolated.
Well, in many ways TOSLINK is superior to USB.  For one, the cables are just plastic, and not that expensive, so they're easier/more user-friendly; you only need to avoid too tight bends.
 

Offline drummerdimitriTopic starter

  • Frequent Contributor
  • **
  • Posts: 532
  • Country: lb
Re: USB noise or ground loop?
« Reply #7 on: March 24, 2019, 12:11:57 pm »
I cut a USB extension in half and soldering all the wires back except the ground and Vcc wires and although it solved the ground loop I could still a slight buzzing sound.
It can still be similar to a ground loop, except the noise being conducted through the D+ and D- lines to the DAC.

The only way you can be sure is to get an USB isolator and see, for example this one for under $10 USD.

How is that possible since as mentioned above USB should have no noise as it is a digital signal?
The D+ and D- lines are still electrical, and may have common-mode noise.  Depending on how the USB receiver is implemented, that common mode noise may affect the DAC, essentially the same way a low-voltage noisy ground loop would.

That is, I do not believe the noise is inherent in the data itself.  USB is a reliable protocol (except on faulty devices like Raspberry Pi's), with each data packet having checksums; there is even a facility for resending missing/broken packets, but that depends on the devices and available bandwidth. The only difference between the USB and TOSLINK connections, as far as I understand, is that USB passes electrical noise (such as common-mode noise in the data lines, or ground loop due to voltage potential differences in the circuits), whereas TOSLINK does not, as it is purely optical.

I'm thinking of switching back to TOSLINK as that connection is electrically isolated.
Well, in many ways TOSLINK is superior to USB.  For one, the cables are just plastic, and not that expensive, so they're easier/more user-friendly; you only need to avoid too tight bends.


Ok so I found this company that sells items that may solve my issue: https://ifi-audio.com/home/digital/

Would you recommend any of these products or should i not bother and just get that USB isolator you mentioned?

Thanks!
 

Offline Nominal Animal

  • Super Contributor
  • ***
  • Posts: 7192
  • Country: fi
    • My home page and email address
Re: USB noise or ground loop?
« Reply #8 on: March 24, 2019, 12:55:40 pm »
Ok so I found this company that sells items that may solve my issue: https://ifi-audio.com/home/digital/

Would you recommend any of these products or should i not bother and just get that USB isolator you mentioned?

Of those, only iGalvanic is an isolator, with a 3 kV isolation barrier. However, because it is specified for USB 3.0 Super Speed, you'll have to pay upwards of $350 USD for it.
If we ignore the data rate difference and the isolation barrier (because they do not matter for you, assuming you use e.g. 96kHz 32-bit 2-channel audio, or less -- that would take about half the 12 Mbit/s Full Speed USB bandwidth the cheapie isolators support), it does the same thing as the cheapie.

(The rest are basically +5V and ground filters and powered hubs, based on their specifications; or equivalent audiophole mumbo-jumbo.)

For you, I actually recommend using TOSLINK instead.  But, if you want, get the cheapie.  Personally, I'd only buy an iGalvanic or similar with other peoples money, not for myself.  I do have that cheapie (or a clone; I got it a few years ago, but it looks exactly like many of the cheapies now on fleabay).

If the iGalvanic would get rid of the noise, so would the cheapie as well.



I just realized that it is possible the hum/noise is generated in the DAC box itself, as a byproduct of the USB transfers.  Essentially, the USB receiver side, when transferring data, may generate noise that gets coupled to the DAC itself.  Perhaps the USB receiver side has insufficient Vcc/GND filtering, compared to the TOSLINK receiver circuitry?  If so, even an isolator will not help you; only using TOSLINK will.

If you can tell me the make and model of your DAC box, I could try and find out?
 

Offline drummerdimitriTopic starter

  • Frequent Contributor
  • **
  • Posts: 532
  • Country: lb
Re: USB noise or ground loop?
« Reply #9 on: March 24, 2019, 02:27:55 pm »
Ok so I found this company that sells items that may solve my issue: https://ifi-audio.com/home/digital/

Would you recommend any of these products or should i not bother and just get that USB isolator you mentioned?

Of those, only iGalvanic is an isolator, with a 3 kV isolation barrier. However, because it is specified for USB 3.0 Super Speed, you'll have to pay upwards of $350 USD for it.
If we ignore the data rate difference and the isolation barrier (because they do not matter for you, assuming you use e.g. 96kHz 32-bit 2-channel audio, or less -- that would take about half the 12 Mbit/s Full Speed USB bandwidth the cheapie isolators support), it does the same thing as the cheapie.

(The rest are basically +5V and ground filters and powered hubs, based on their specifications; or equivalent audiophole mumbo-jumbo.)

For you, I actually recommend using TOSLINK instead.  But, if you want, get the cheapie.  Personally, I'd only buy an iGalvanic or similar with other peoples money, not for myself.  I do have that cheapie (or a clone; I got it a few years ago, but it looks exactly like many of the cheapies now on fleabay).

If the iGalvanic would get rid of the noise, so would the cheapie as well.



I just realized that it is possible the hum/noise is generated in the DAC box itself, as a byproduct of the USB transfers.  Essentially, the USB receiver side, when transferring data, may generate noise that gets coupled to the DAC itself.  Perhaps the USB receiver side has insufficient Vcc/GND filtering, compared to the TOSLINK receiver circuitry?  If so, even an isolator will not help you; only using TOSLINK will.

If you can tell me the make and model of your DAC box, I could try and find out?

I have a Questyle CMA400i.

Will stick to optical for now since the galvanic isolator is ridiculously overpriced.

The only reason I slightly prefer to use USB is for its supposedly lower jitter specifications and asynchronous clock.

Will order that cheapie isolator to give it a try.
 

Offline Nominal Animal

  • Super Contributor
  • ***
  • Posts: 7192
  • Country: fi
    • My home page and email address
Re: USB noise or ground loop?
« Reply #10 on: March 24, 2019, 03:34:58 pm »
Questyle CMA400i.
The core DAC chip in that one is an AKM Semiconductor Inc. (AkashiKasei) AK4490EQ chip.  It has separate analog and digital supplies and grounds.  It is quite possible that the board in the CMA400i combines them, and the noise is indeed generated by the USB receiver circuitry.

(One of my pet peeves is a similar design "stupidity" in stepper motor controller boards.  All the good driver chips, from Allegro A4988 to Trinamic TMC series, have separate digital and motor grounds.  Very few (none of the cheaper hobbyist ones) keep the motor side completely isolated, however.  It makes me very disappointed, because digital isolators are cheap (especially at the frequencies of DIR/STEP control signals -- even optocouplers can be used if you want to keep it real cheap), and using them at right spots would make the boards so much more robust, and easy to use in cases where the motors have their own separate supply.  It is basically the same situation as with audio, except that it's the motors that cause problems to the digital side.  Both suffer from ground loops, and bad design.)

Will stick to optical for now since the galvanic isolator is ridiculously overpriced.
The only reason I slightly prefer to use USB is for its supposedly lower jitter specifications and asynchronous clock.
Right.  I suspect you'd get best results if the male side is to the computer, and you use a cable where the GND and VCC lines are cut near the DAC connector for the isolator-dac section.  That way you should avoid any noise from the switch-mode DC-DC supply in the isolator.  The reason for cutting the VCC/GND off from near the DAC USB connector is to ensure it won't act like an antenna, introducing noise to the DAC USB circuitry.  Verify the switch is in the 12 Mbit/s position.

For those who do not understand the difference, SPDIF/TOSLINK is one-directional.  The computer will send a digital audio signal at a fixed frequency, and the DAC simply has to try to keep in sync.  For say 48000 kHz audio sample rate, if the computer and DAC clock differ by just 1 Hz or 0.002%, each second there is either an extra sample, or a sample is missing.  That is what jitter is; timing error.  The DAC cannot just buffer the data, because there is no way for it to signal back to the computer that it needs more data (DAC clock is fast compared to computer) or that the computer should wait for it to play it back first (DAC clock is slow compared to computer).

With USB data, the audio signal is transferred in short blocks (up to 1023 data bytes for full-speed USB, 12 Mbit/s), with header and checksum data (typically the overhead is less than 25%). Each successfully sent data block is acknowledged.  Essentially, the computer does not need to have an internal clock, and provides the data asynchronously to the DAC; it simply sends audio data whenever the DAC is ready for it.
 

Offline ogden

  • Super Contributor
  • ***
  • Posts: 3731
  • Country: lv
Re: USB noise or ground loop?
« Reply #11 on: March 26, 2019, 09:12:08 am »
It is easy to test source of the noise - you need just laptop running on batteries, disconnected from mains, no other connections besides DAC. If no noise in this case - then it is groundloop. I bet it is BTW. Do you use XLR or RCA for amp connection? Using XLR may help minimize conducted noise problems.

For those who do not understand the difference, SPDIF/TOSLINK is one-directional. The computer will send a digital audio signal at a fixed frequency, and the DAC simply has to try to keep in sync.  For say 48000 kHz audio sample rate, if the computer and DAC clock differ by just 1 Hz or 0.002%, each second there is either an extra sample, or a sample is missing.  That is what jitter is; timing error.

Jitter is cycle-to-cycle clock irregularities. Clock frequency difference is just frequency difference or clock wander.

https://statics.cirrus.com/pubs/whitePaper/WP_Specifying_Jitter_Performance.pdf

Digital audio receivers recover clock from incoming stream and DAC usually is made as clock slave to the receiver. Particular DAC have professional digital audio AES/EBU input - I doubt that it's digital audio receiver may be inferior to USB receiver by any stretch of imagination. Not in this grade of hardware. I would just use TOSLINK optical to isolate PC from audio equipment and forget about the problem. PC is noisy piece of [censored] and you better isolate it from your analog audio no matter what.
 

Offline pwlps

  • Frequent Contributor
  • **
  • Posts: 372
  • Country: fr
Re: USB noise or ground loop?
« Reply #12 on: March 28, 2019, 08:43:28 am »
With USB data, the audio signal is transferred in short blocks (up to 1023 data bytes for full-speed USB, 12 Mbit/s), with header and checksum data (typically the overhead is less than 25%). Each successfully sent data block is acknowledged.  Essentially, the computer does not need to have an internal clock, and provides the data asynchronously to the DAC; it simply sends audio data whenever the DAC is ready for it.

Data acknowledgement and error correction is used in bulk mode but not in isochronous mode.
The Audio Device Class uses isochronous transfers, see e.g. https://www.edn.com/design/consumer/4376143/Fundamentals-of-USB-Audio, https://www.silabs.com/documents/public/application-notes/AN295.pdf.  Even at the highest audio sampling rates USB would be fast enough for buffering and error correction but as I understand they do it this way because for musicians minimizing latency is more important than correcting errors.

Quoted from
https://www.silabs.com/documents/public/application-notes/AN295.pdf
Quote
Unlike other transfer types, isochronous transfers have no hardware-controlled handshaking or error-checking
ability, so errors may occur occasionally. Systems must be able to recover from occasional errors without the help
of hardware.

Would that mean that any corrupted data byte will appear as noise? Unless the DAC software employs some intelligent algorithm to detect corrupted bytes and replace them with some interpolated values (but maybe not in a cheap headphone DAC). 
High-quality equipment often use some proprietary protocols like ASIO instead of the standard USB audio class, but I don't know what type of error checking they use.
 
« Last Edit: March 28, 2019, 09:12:33 am by pwlps »
 

Offline Nominal Animal

  • Super Contributor
  • ***
  • Posts: 7192
  • Country: fi
    • My home page and email address
Re: USB noise or ground loop?
« Reply #13 on: March 28, 2019, 02:54:53 pm »
Jitter is cycle-to-cycle clock irregularities. Clock frequency difference is just frequency difference or clock wander.
I stand corrected.  I did intend to refer to wander and not jitter.  As that paper defines, "Jitter is the dynamic deviation of event instants in a stream or signal from their ideal positions in time, excluding modulation components below 10 Hz."  (Some others define it as excluding components below 1 Hz.)

Digital audio receivers recover clock from incoming stream and DAC usually is made as clock slave to the receiver.
That particular chip is pretty funky, and requires a 8 to 37 MHz master clock.  I imagine it is very nontrivial to try and sync that frequency master clock from a 44.1 kHz to 192 kHz signal, with minimal jitter and wander.

Data acknowledgement and error correction is used in bulk mode but not in isochronous mode.
Even isochronous transfer packets have a checksum, so errors can definitely be detected; but as you correctly pointed out, there is no ack/resend mechanism.

Would that mean that any corrupted data byte will appear as noise? Unless the DAC software employs some intelligent algorithm to detect corrupted bytes and replace them with some interpolated values (but maybe not in a cheap headphone DAC).
You cannot detect which samples are corrupted in a corrupted isochronous packet, so such an algorithm would have to rely on examining the data; and detecting "out-of-place" samples in PCM is hard.

I would expect the errors are typically random single-bit flips, which sound more like crackle than a background hiss, depending on how often the errors occur.
 

Offline Bassman59

  • Super Contributor
  • ***
  • Posts: 2501
  • Country: us
  • Yes, I do this for a living
Re: USB noise or ground loop?
« Reply #14 on: March 28, 2019, 05:17:49 pm »
Quote
Unlike other transfer types, isochronous transfers have no hardware-controlled handshaking or error-checking
ability, so errors may occur occasionally. Systems must be able to recover from occasional errors without the help
of hardware.

Would that mean that any corrupted data byte will appear as noise? Unless the DAC software employs some intelligent algorithm to detect corrupted bytes and replace them with some interpolated values (but maybe not in a cheap headphone DAC).

It's up to the device how it handles corrupt or missing data. It's best to mute the output, I think.
 
Quote
High-quality equipment often use some proprietary protocols like ASIO instead of the standard USB audio class, but I don't know what type of error checking they use.

ASIO still relies on isochronous transfers. There is no way to resend data if those data are live samples coming from microphones! I suppose you could have a buffer and attempt retries from it, but the latency might be intolerable, and how big should that buffer be, and anyway that would be a custom device class and your digital-audio workstations and all probably won't be able to talk to that hardware.

A better question is: how often does one see errors in USB transmission? In my experience, it either works perfectly or it fails miserably, and the problem is usually solved by replacing the cable.
 

Offline ogden

  • Super Contributor
  • ***
  • Posts: 3731
  • Country: lv
Re: USB noise or ground loop?
« Reply #15 on: March 28, 2019, 05:27:19 pm »
Digital audio receivers recover clock from incoming stream and DAC usually is made as clock slave to the receiver.
That particular chip is pretty funky, and requires a 8 to 37 MHz master clock.  I imagine it is very nontrivial to try and sync that frequency master clock from a 44.1 kHz to 192 kHz signal, with minimal jitter and wander.

It is not like that. Fact that you can't understand how they do it, does not mean that they don't :) Receiver does not sync to sample rate but SPDIF/TOSLINK/AES3 biphase clock which is much faster. Using VCO with PLL one can recover original clock of digital interface pretty damn well. Further reading: http://www.ti.com/product/DIR9001.

 

Offline Nominal Animal

  • Super Contributor
  • ***
  • Posts: 7192
  • Country: fi
    • My home page and email address
Re: USB noise or ground loop?
« Reply #16 on: March 28, 2019, 06:07:20 pm »
Digital audio receivers recover clock from incoming stream and DAC usually is made as clock slave to the receiver.
That particular chip is pretty funky, and requires a 8 to 37 MHz master clock.  I imagine it is very nontrivial to try and sync that frequency master clock from a 44.1 kHz to 192 kHz signal, with minimal jitter and wander.
It is not like that.
You completely missed my point.  You might wish to disengage strutting mode, too.

If you sync to the SPDIF clock like that, you regenerate the source clock wander.  Essentially, your DAC will have the same timing characteristics as whatever the cheap PC SPDIF hardware has.

The hard part is how to adjust the high-frequency clock, balancing between the sample buffer depth and latency, without audible effects. 

This is exactly the same problem as clock synchronization across domains, for example when NTP is used.

Simple algorithms and implementations are suspect to oscillation (around the proper clock rate), especially when the SPDIF clock is not very stable.  UARTs avoid the problem by using stop bit(s) for resynchronization.  In audio, that would lead to audible issues; changes in pitch are noticeable.

Receiver does not sync to sample rate but SPDIF/TOSLINK/AES3 biphase clock which is much faster.
Right.  Unfortunately, it does not make the hard problem any easier, since there is no quarantee that the SPDIF clock is at all stable.  The same problem applies to isochronous USB transfers.
 

Offline ogden

  • Super Contributor
  • ***
  • Posts: 3731
  • Country: lv
Re: USB noise or ground loop?
« Reply #17 on: March 28, 2019, 07:02:43 pm »
It is not like that.
You completely missed my point.

What?  :-//

You said it straight w/o any hint of hidden meaning: "it is very nontrivial to try and sync that frequency master clock from a 44.1 kHz to 192 kHz signal, with minimal jitter and wander".

Quote
If you sync to the SPDIF clock like that, you regenerate the source clock wander.

Sure. So what? We do not talk about jitter/wander cleaning. Origial question was: is it so that TOSLINK jittrer/wander specs are as good as USB interface. Answer: it is.

Quote
Receiver does not sync to sample rate but SPDIF/TOSLINK/AES3 biphase clock which is much faster.
Right.  Unfortunately, it does not make the hard problem any easier, since there is no quarantee that the SPDIF clock is at all stable.  The same problem applies to isochronous USB transfers.

Again: so what? Unstable source clock is not a subject of discussion. Anyway even cheapest crystal oscillator solutions used in PC and it's audio devices are good enough for audio.
 

Offline Bassman59

  • Super Contributor
  • ***
  • Posts: 2501
  • Country: us
  • Yes, I do this for a living
Re: USB noise or ground loop?
« Reply #18 on: March 28, 2019, 08:02:13 pm »
The hard part is how to adjust the high-frequency clock, balancing between the sample buffer depth and latency, without audible effects. 

This is exactly the same problem as clock synchronization across domains, for example when NTP is used.

Simple algorithms and implementations are suspect to oscillation (around the proper clock rate), especially when the SPDIF clock is not very stable.  UARTs avoid the problem by using stop bit(s) for resynchronization.  In audio, that would lead to audible issues; changes in pitch are noticeable.

... since there is no quarantee that the SPDIF clock is at all stable.  The same problem applies to isochronous USB transfers.

For USB transfers, the usual solution is to do asynchronous mode transfers. This completely decouples the USB clock domain from the DAC domain. This works because the design knows the sample rate and knows how many samples are consumed by the sink in a USB frame and how many are sent in the frame, and it can control the latter using the feedback endpoint. The USB transfer rate is much greater than the sample rate, so this works and the FIFO to the DAC is never starved nor overrun. On the DAC side, a low-jitter clock is used to clock the DAC and deal with reading the data from the FIFO.

For S/PDIF where the recovered clock might have more jitter than one might wish, the usual solution is to use asynchronous sample-rate conversion with the DAC side clocked by a low-jitter oscillator.

It should be noted that strictly speaking, the S/PDIF receiver generates a sample-rate clock. The DAC needs a modulator clock, at 128, 256, 512 times the sample rate, and that clock is generated by a PLL that uses the recovered sample-rate clock as a reference. That PLL is included in the usual S/PDIF receiver chips from TI, AKM and Cirrus. That PLL output can be very good, but whether it's "good enough" depends on the application.
 

Offline bloguetronica

  • Frequent Contributor
  • **
  • !
  • Posts: 354
  • Country: pt
Re: USB noise or ground loop?
« Reply #19 on: March 29, 2019, 04:24:08 pm »
As others have said, most probably it is a ground loop. USB is immune to noise, since it consists of digital data transmitted through a shielded differential pair. Plus, the USB protocol allows for CRC verification of bulk transfers and subsequent correction. What happens is that you are breaking the ground loop when you switch to TOSLINK. You can achieve the same effect by disconnecting the 5V rail, presumably because you are also disconnecting the ground there and therefore you also break the loop, albeit on a different point.

You can break the loop on the USB side if you break and then reconnect the ground using two diodes in anti-parallel and a small 10nF capacitor in parallel with the diodes. This is to remedy the fact that probably, on your end device (headphones) the USB shield is probably tied to the USB ground (it should be tied only on the host side). However, there might be other factor at play here: the power supply injecting noise and facilitating a ground loop via the protective earth (your DAC is mains powered, right?).

You can see some attached schematics, to see how it is possible to break ground loops on end devices. Notice the capacitor and the resistor coupling the shield to the ground on the USB function generator. Also, on the pre-amplifier, you can see another approach that allows current going to the protective earth in case there is an isolation failure on the transformer.

Kind regards, Samuel Lourenço
« Last Edit: March 30, 2019, 02:33:51 am by bloguetronica »
 

Offline Nominal Animal

  • Super Contributor
  • ***
  • Posts: 7192
  • Country: fi
    • My home page and email address
Re: USB noise or ground loop?
« Reply #20 on: March 29, 2019, 06:41:35 pm »
So what? We do not talk about jitter/wander cleaning.
Reading difficulties, eh?

The only reason I slightly prefer to use USB is for its supposedly lower jitter specifications and asynchronous clock.

Nevermind; one more to the ignore list.
 

Offline ogden

  • Super Contributor
  • ***
  • Posts: 3731
  • Country: lv
Re: USB noise or ground loop?
« Reply #21 on: March 29, 2019, 06:58:04 pm »
So what? We do not talk about jitter/wander cleaning.
Reading difficulties, eh?

Did I miss where OP asked for jitter/wander cleaning? Please be so kind and remind me.

Oh, this?

The only reason I slightly prefer to use USB is for its supposedly lower jitter specifications and asynchronous clock.

Nevermind; one more to the ignore list.

LOL  :-DD

It is

Origial question was: is it so that TOSLINK jittrer/wander specs are as good as USB interface. Answer: it is.

And not jitter cleaning, you  |O
« Last Edit: March 29, 2019, 07:00:49 pm by ogden »
 

Offline Nominal Animal

  • Super Contributor
  • ***
  • Posts: 7192
  • Country: fi
    • My home page and email address
Re: USB noise or ground loop?
« Reply #22 on: March 29, 2019, 07:08:43 pm »
For USB transfers, the usual solution is to do asynchronous mode transfers.
I know; I didn't even realize USB Audio uses isochronous transfers.

Similar issues do occur elsewhere, too.  One is when you have more than one DAQ (because you are measuring many things at once), at high sample rates, and you want to synchronize the data.  I am not at all familiar with USB audio, but I do have experience on the software side on similar issues. OP mentioned jitter, and that made me think about how I would solve the clock discrepancies, based on my experience in the software side with sensor data.

For S/PDIF where the recovered clock might have more jitter than one might wish, the usual solution is to use asynchronous sample-rate conversion with the DAC side clocked by a low-jitter oscillator.
VLC (the video player) has a feature that allows one to resample audio to the achieved display frame rate.  It is surprising how small changes in the actual pitch are perceptible -- in that case, because the video frame rate was not stable, so the resampling ended up changing the audio pitch by accident.  It is a surprisingly easy to notice very small changes, if the display frame rate is not rock solid stable.

It should be noted that strictly speaking, the S/PDIF receiver generates a sample-rate clock. The DAC needs a modulator clock, at 128, 256, 512 times the sample rate, and that clock is generated by a PLL that uses the recovered sample-rate clock as a reference.
I would assume a separately controlled high-frequency clock, compared to the SPDIF clock, would yield a much better result from not-very-good-quality SPDIF sources.

Algorithmically, the idea is to decouple the generated clock from the original clock source, but control it to run stably at the average rate of the original source.  This kind of synchronization issue is surprisingly common in high data rate networked computation.  Mathematically, you can describe the follower as a damped oscillator -- which is a pretty good description of a PLL based on the SPDIF clock --, but unless you deliberately add some latency, maybe just a few dozen samples worth, there always will be patterns that lead the follower to oscillate.  In the algorithmic sense, it is very interesting and surprisingly difficult problem; and from the benefits of that latency (or "temporal slop"), I know that a PLL cannot be the best option here.

Adjusting properties according to human perception, or psychoacoustic modeling in this case, is very interesting.  Many people do not realize that even MP3 compression involves psychoacoustic modeling: the quantization noise is shaped to follow the equal-loudness contour.
 

Offline ogden

  • Super Contributor
  • ***
  • Posts: 3731
  • Country: lv
Re: USB noise or ground loop?
« Reply #23 on: March 29, 2019, 07:35:35 pm »
For USB transfers, the usual solution is to do asynchronous mode transfers.
I know; I didn't even realize USB Audio uses isochronous transfers.

Apparently you do not know. Next time before explaining how stuff works, make sure you understand subject well. Especially embarrassing is to start "for those who do not understand..." and provide BS (about USB audio) in explanation:

For those who do not understand the difference, SPDIF/TOSLINK is one-directional.  The computer will send a digital audio signal at a fixed frequency, and the DAC simply has to try to keep in sync.  For say 48000 kHz audio sample rate, if the computer and DAC clock differ by just 1 Hz or 0.002%, each second there is either an extra sample, or a sample is missing.  That is what jitter is; timing error.  The DAC cannot just buffer the data, because there is no way for it to signal back to the computer that it needs more data (DAC clock is fast compared to computer) or that the computer should wait for it to play it back first (DAC clock is slow compared to computer).

With USB data, the audio signal is transferred in short blocks (up to 1023 data bytes for full-speed USB, 12 Mbit/s), with header and checksum data (typically the overhead is less than 25%). Each successfully sent data block is acknowledged.  Essentially, the computer does not need to have an internal clock, and provides the data asynchronously to the DAC; it simply sends audio data whenever the DAC is ready for it.
 

Offline bloguetronica

  • Frequent Contributor
  • **
  • !
  • Posts: 354
  • Country: pt
Re: USB noise or ground loop?
« Reply #24 on: March 30, 2019, 02:48:24 am »
I'm noticing some confusion here between asynchronous USB transfers, that don't exist, and isochronous transfers. As far USB is concerned, there are two types of transfers for massive data: bulk and isochonous. Both have CRC verification, but only bulk guarantees correction (i.e.: data is delivered, if not, rinse and repeat until it is). Other types of transfer exist for control and signaling: control and interrupt transfers. Hope this little bit of information is useful.

Just a tidbit regarding my previous post. It didn't occurred to me that audio uses isochronous transfers, and I should have known better. Still, what I've said is pretty much right. In a nutshell, USB noise will not translate to noise in audio, but in lost packets, and that is the absolute worst case. USB communication is very stable and you would need something like an EMP generator to corrupt it. The OP is experimenting the symptom of a ground loop.

Having said that, there is no need to perpetuate the snake oil myth that USB needs "filtering" or needs to be "improved" in a audiophilic (say more audiophobic) way, or in any other way. The engineers that developed the USB protocol know better, much better when asleep, than the audiophiles that came up with the idea of "improving" the USB by creating "audio-grade filters".

Kind regards, Samuel Lourenço
« Last Edit: March 30, 2019, 02:51:51 am by bloguetronica »
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf