# intermittent buzzing



## tOsYZYny (Feb 23, 2021)

I started having intermittent buzzing through my headphones, either connected through the stereo out jack or the USB ones.  It seems to last for a few seconds before going away to return a little while later.

I thought at first it was the USB headphones going bad as that is when I first noticed it, but then I also noticed it with my audio / 3.5mm stereo jack headphones plugged directly into the computer.  Muting the sound fixes the issue, so it seems like a software and not a hardware problem.  I have this problem with pianobar, google voice calls in chromium, etc.  It also consistently effects the right-channel only for both the analog and USB headphones.


----------



## kpedersen (Feb 23, 2021)

I used to have this on one of my machines. I recall it was due to a power saving feature. After turning it off, it solved the buzzing:

This was a while ago and I can't remember the details. Perhaps something here is useful?

https://wiki.freebsd.org/TuningPowerConsumption#A7._HDA_sound


----------



## Mjölnir (Feb 23, 2021)

But when it's only on the right audio channel, I would guess it's the audio hardware. There must be some DAC & an analog amplifier.  I can imagine that the latter wears out after some time.  Is that an old machine?


----------



## tOsYZYny (Feb 23, 2021)

I would agree but it is odd that muting it kills the buzzing.  Depends on what you mean by "old", it is a 3rd generation i7, so around 2013-era?  It isn't new, but it isn't ancient either.  Hmm, I was thinking about piping the audio out a different audio card, but I already did that when piped it out through the USB headset.  The problem was still there, so I'd bet that if I also try the Nvidia video card, I'd have the issue there too.


----------



## shkhln (Feb 23, 2021)

tOsYZYny said:


> The problem was still there, so I'd bet that if I also try the Nvidia video card, I'd have the issue there too.


Try it. USB headphones are powered by a computer PSU, while monitor obviously isn't.


----------



## drhowarddrfine (Feb 23, 2021)

tOsYZYny said:


> it seems like a software and not a hardware problem. I have this problem with pianobar, google voice calls in chromium, etc. It also consistently effects the right-channel only for both the analog and USB headphones.


Then it's a hardware problem, not a software one.


----------



## tOsYZYny (Feb 23, 2021)

I am trying that now - so, if I don't hear any buzzing, then you're thinking it could be the PSU?  I haven't noticed it yet.


----------



## obsigna (Feb 23, 2021)

Turn your cell phone off. I assume, it is not sitting on your e-guitar, otherwise the buzzing would not be intermittent:-D





_View: https://www.youtube.com/watch?v=XTiatPUKTrM_
Anyway, cell phones produce intermittent buzzing in audio devices. Most famous is the GSM sound, however this might happen with G3 as well. I sometimes hear this in the sound system of my car when I stow the iPhone near the sound amplifier.


----------



## drhowarddrfine (Feb 24, 2021)

Muting it kills the amplifier which is what feeds your speakers or earphones. Wiggle the earphones at the connector to the computer just for grins to see if anything changes. Take a pencil with an eraser or a wooden stick or dowel and tap, in some multitude of places, on your board, motherboard, connectors, power supply ,etc. inside your box and see if you hear anything change. Wiggle wires in there, too.


----------



## tOsYZYny (Feb 24, 2021)

That sounds like it could be something from Pink Floyd ...

The sound seemingly works fine going through the monitor.  I'll fiddle around with the other settings...


----------



## mark_j (Feb 24, 2021)

tOsYZYny said:


> I started having intermittent buzzing through my headphones, either connected through the stereo out jack or the USB ones.  It seems to last for a few seconds before going away to return a little while later.
> 
> I thought at first it was the USB headphones going bad as that is when I first noticed it, but then I also noticed it with my audio / 3.5mm stereo jack headphones plugged directly into the computer.  Muting the sound fixes the issue, so it seems like a software and not a hardware problem.  I have this problem with pianobar, google voice calls in chromium, etc.  It also consistently effects the right-channel only for both the analog and USB headphones.


It sounds like RFI. If it was me, I would wind the cable of the headphones over an RF choke and see if it removed or abated the sound. If it does, bingo.
It's most likely a power source issue, either from mains or your computer. I've seen fans also exhibit this issue.
If you have an AC Filter now would be a good time to use it. Something like this. (Though they're by no means foolproof and I'm not endorsing this particular unit).


----------



## tOsYZYny (Feb 24, 2021)

All of my computers are on battery backup.  This particular one is on one that should smooth out power as well.  So, the power should be "clean".


----------



## Mjölnir (Feb 24, 2021)

tOsYZYny said:


> All of my computers are on battery backup.  This particular one is on one that should smooth out power as well.  So, the power should be "clean".


But the PSU (it's capacitors) can wear out.  And/or the VR unit (in the PSU, on main board, on-chip), IIRC these do have capacitors, too.  Concerning electronic parts -- IIRC -- in general, capacitors belong to the parts that wear out the fastest.  Another issue: some nerds think it's cool to have an open housing - given the story above with interference from radio waves, that's not a good idea.  Since it's only one channel, I'm 98% shure it's a hardware issue.  If that box ran often for 7 years, maybe sometimes with insufficient cooling, you might see the 1st signs of dieing hw.


----------



## obsigna (Feb 24, 2021)

Can you tell us something about the tone (frequency) of the buzzing, is it really 60 Hz, the frequency of the power line?

Compare it to this 60 Hz test tone below. If your buzzing is on another frequency, then power line issues may safely be ruled out.





_View: https://www.youtube.com/watch?v=GqwFimG3X3w_


----------



## tOsYZYny (Feb 24, 2021)

I'm now getting the buzzing through the monitor too .

It's not 60Hz, 60Hz would be pleasant to the ear compared to this.  It is a bit higher.  I'm too slow to capture it with my audio recorder, but I don't know if you guys are from the US, but the sound reminds me of the hearing tests we had in elementary school where they'd play a buzzing tone at various frequencies.  The tone is upper middle if that helps, it's certainly much higher than 60Hz, but definitely nowhere near 20kHz.  I listened to some random tones on youtube, and I'd guess it is somewhere around 2kHz.  But, the problem is that it isn't a nice clean sine wave, maybe that is why it hurts the ears so much...


----------



## Mjölnir (Feb 24, 2021)

If you have more than one boxes, you could take the PSU of one of these, if it matches.  Not only the connectors, the design power, too.  Sorry, for shure you know that.


----------



## tOsYZYny (Feb 24, 2021)

Thanks - yes, my limitation will be the power.  I have other PSUs, but they're rated a bit lower and with the graphics card I have in here, I'm already at the minimum.  Time for a new box !  I will try downgrading the PSU and temporarily using the onboard video ...


----------



## Snurg (Feb 24, 2021)

There is no mention which kind of audio cables are being used.

A few years ago I had a similar problem, and it resulted in throwing away almost all of my audio cables.

The reason is that with the cheap cables usually delivered with PC or (low cost) sound card hardware are no longer "shielded" in the sense I was accustomed to.
When I finally boiled down to physically destructively examine the cables, I found out that the core, consisting of a barely visible thin wire, was not surrounded with a wire mesh, instead there was only another thin wire, no mesh at all.

Shocked, I opened more and more cables, only to find out that of these characteristic black audio cables with the plastic plugs molded on, maybe one of five actually was shielded. But even these were not shielded well, particularly the plugs were not covered at all, inviting all kinds of RFI.

In disgust I purchased a handful of quality plugs (metallic, shielded) and a few meters of quality cable with thicker wires and good mesh insulation, just to make the few cables I need myself in professionally accepable quality.


----------



## tOsYZYny (Feb 24, 2021)

Hmm, good food for thought.  I will try the PSU first.  I can tolerate running on the system's onboard video for a bit ...


----------



## Snurg (Feb 24, 2021)

Well, 2kHz is not common with PSUs. These usually work in the range 100-140kHz.
And the capacitor problems mentioned here result in ripple/spikes in this frequency range.
But it is always good to watch out for bulgy caps.

Regarding the "battery backup", I would be very wary of that.
Most of the temporary UPS have a stairwave waveform, which would correlate with the frequency you describe.
This is an extremely dirty way to feed PSUs, causing thousands instead of only 50/60 surges/sec that seep through to the PSU output.
Maybe you hear the noise just when laptop switches from battery to PSU to recharge...?


----------



## olli@ (Feb 24, 2021)

Wait … This appears _both_ when using the 3.5mm analog jack, _and_ when using USB audio output? And it’s only on the right channel, not on the left?
Then it cannot be the hardware. It must be a software issue, I’m afraid.

How can a defective power supply cause a buzzing sound only on the right channel of a digital audio stream sent through an USB port? I really cannot imagine how that could be possible.


----------



## shkhln (Feb 24, 2021)

olli@ said:


> only on the right channel


Well, there might be a difference in hearing between left and right ears. As far as I can tell, this wasn't checked.


----------



## Snurg (Feb 24, 2021)

olli@ said:


> Wait … This appears _both_ when using the 3.5mm analog jack, _and_ when using USB audio output? And it’s only on the right channel, not on the left?
> Then it cannot be the hardware. It must be a software issue, I’m afraid.
> 
> How can a defective power supply cause a buzzing sound only on the right channel of a digital audio stream sent through an USB port? I really cannot imagine how that could be possible.


The description of the configuration is not 100% clear to me. If it is actually digital audio (for which the 3.5mm stereo connector is not really common), then it is definitely an issue in the analog part of the audio chipset, be it caused by hardware or software. Clipping would have to be ruled out, too.

It could even be possible that only the first channel gets completely initialized and some bad NID wirings on the others have been left active, and this being noticed only much later because of increasing noise due power quality decrease over time.

If the OP could show how the signal looks on an oscilloscope, that would be nice.


----------



## tOsYZYny (Feb 24, 2021)

Well, I couldn't easily swap PSUs, so I moved the hard drives over to an older machine ... There is no buzzing there, yet ...

I don't have an oscilloscope.  If it were software, wouldn't I expect to hear the buzzing already?


----------



## olli@ (Feb 24, 2021)

tOsYZYny said:


> Well, I couldn't easily swap PSUs, so I moved the hard drives over to an older machine ... There is no buzzing there, yet ...
> 
> I don't have an oscilloscope.  If it were software, wouldn't I expect to hear the buzzing already?


Does that older machine have a different audio chip? (The mainboard’s manual should mention what kind of audio chip it has.)
I suspect it’s a bug in FreeBSDs driver for the audio chip of the 1st machine.
Uhm, wait, it can’t be the driver, because then it wouldn’t affect the USB headphones (those use a different driver, namely snd_uaudio(4)).

It could be a problem with the snd(4) kernel framework, or with a userland framework (e.g. Alsa, Pulseaudio, whatever). But in that case the problem should persist when you move the hard drive to a different machine. Also, other people should have similar problems, but this is the first time I hear something like that.

Do you have any special sound-related settings in /boot/loader.conf, /etc/sysctl.conf or elsewhere?

Anyway – As I said before, if the buzzing sound is clearly only on the right channel, then it’s certainly not the power supply causing this.

PS: How often does that buzzing appear? Every minute, once per hour, …?


----------



## tOsYZYny (Feb 24, 2021)

It was working fine with no issues for the past year.  I recently discovered that I had a bug in my system update logic that caused a few issues, but I think I sorted that out by doing freebsd-update and stopping pkg update and pkg upgrade.

The old box I am on now is using:
NM10/ICH7 Family High Definition Audio Controller
and the video card's audio chip is GP107GL High Definition Audio Controller (which I also moved over to the old box).

I haven't put the new box back together, but will do that this afternoon.


----------



## olli@ (Feb 24, 2021)

Two questions:

Do you have any special sound-related settings in /boot/loader.conf, /etc/sysctl.conf or elsewhere?
How often does that buzzing appear? Every minute, once per hour, …? Is it regularly or random?


----------



## kpedersen (Feb 24, 2021)

Following on from olli@'s questions does that buzzing stop as soon as you play some i.e very quiet music? Again that one is symtomatic of the power saving stuff I mentioned.


----------



## drhowarddrfine (Feb 24, 2021)

The problem was described as buzzing but now it seems to be a tone. If it's a tone, then my solution earlier is not worth doing. And it won't be the power supply or any hardware at all.


----------



## tOsYZYny (Feb 24, 2021)

It seems to be once per minute, enough that if I'm listening to music, I take the right-side of my headphones off ...


----------



## tOsYZYny (Feb 24, 2021)

In my /etc/sysctl.conf, I set the default unit.  In my /boot/loader.conf, I have set some power-saving options:



> hint.p4tcc.0.disabled=1
> hint.acpi_throttle.0.disabled=1
> hint.apic.0.clock=0
> kern.hz=100
> ...



I will boot up the machine that had the problem later today once I get it back together.


----------



## tOsYZYny (Feb 24, 2021)

I booted up the machine ... it is a 7 Series C216 which is different from what this old machine is running.  I should also note that the machine that had the issues had a 275W PSU with an Nvidia 1050 Ti.  I think the PS was already underrated for the box.  The current box I am running has a 375W PS and has the 1050 Ti in it currently.


----------



## tOsYZYny (Feb 24, 2021)

Ok, so now I have it on the old desktop and it was on both channels.  Phew it just went away.  It seems like perhaps it could somehow be connected with chromium / my work there as no sooner I logged in, it started.  Luckily, it went away.


----------



## Factor (Feb 24, 2021)

This isn't the buzzing you are looking for...  you want to let the buzzing move along..


----------



## obsigna (Feb 24, 2021)

Have you ever heard of Tinnitus?  https://en.wikipedia.org/wiki/Tinnitus

This is a very common stress syndrome, and it may be triggered by an extremely high level of noise as well, for example a bang, or very high levels of sound by e.g. ear phones. Intermittent is also well known, because it can be linked to blood pressure and high levels of adrenaline.

Almost everybody experienced it sometimes in their lives. I had it also for short periods, and the perceived frequency lies in the range of 1 to 5 kHz. Usually it goes away together with the stress and coming silence. In addition we can learn to relax the muscles in the neck and below the ears, which helps a lot.


----------



## tOsYZYny (Feb 24, 2021)

Haha, thanks, I am loosing it.


----------



## a6h (Feb 24, 2021)

* Use a live CD/USB (FreeBSD, Linux, etc). Same problem?
* Disable all power-saving settings in FreeBSD
* Do you have same problem in CLI mode i.e. system/virtual console?

* Do you have any power saving feature/settings in your BIOS? disable them.

* PSU's capacitor can produce noises, but you should hear them from the PSU itself -- I'm not suggesting exclusively!
* Although fade-out noise strikes me as capacitor discharging, but evidently it's not the case.
* It's not continuous noise, thus(probably) it can't be some sort of grounding/shielding issue somewhere, or "60 cycle hum"-like noise (**)
(**) Similar to the humbucker e-guitars -- though, hum and buzz are not the same, there's a difference between the two.


----------



## tOsYZYny (Feb 24, 2021)

I am putting the parts back into the original PC, and will report back.


----------



## Snurg (Feb 25, 2021)

I find it interesting that you get the buzzing on all of your computers.
So, did you examine the cables? Without making sure the cables are actually shielded, all this experimenting might be of no use.



vigole said:


> * PSU's capacitor can produce noises, but you should hear them from the PSU itself -- I'm not suggesting exclusively!


This will become more and more of an issue in future due to the spread of MLCC caps, which have a special property called "microphone effect".
I guess in the future particularly vulnerable hardware might be abused as sound listening devices, even without having an actual microphone.



vigole said:


> * It's not continuous noise, thus(probably) it can't be some sort of grounding/shielding issue somewhere, or "60 cycle hum"-like noise (**)


Intermittent noise can be very typical for EMI problems.
Radar produces very regular intervals. I once lived near to an airport, and some very distant (weak) TV stations regularly got "buzzed" when the signal was very weak due to atmospheric/weather situation.
Other things that regularly are observed are motors that aren't sufficiently decoupled, refrigerators for example.


----------



## tOsYZYny (Feb 25, 2021)

I have the drives back in the original PC, but I didn't move the video card over Nvidia 1050 Ti.  I haven't noticed the issue while playing pianobar @ full blast for the past few minutes.  Time to move the video card back and see if that is the culprit.  Even if it isn't 275W is a bit low, especially with the 1050 Ti.


----------



## shkhln (Feb 25, 2021)

tOsYZYny said:


> Even if it isn't 275W is a bit low, especially with the 1050 Ti.


1050 Ti is around 60 W. Your whole computer requires < 200 W even under full load. Now, typing into "275W" into Google brings "Dell Optiplex" and that, certainly, isn't high quality hardware.


----------



## Snurg (Feb 25, 2021)

shkhln said:


> 1050 Ti is around 60 W. Your whole computer requires < 200 W even under full load. Now, typing into "275W" into Google brings "Dell Optiplex" and that, certainly, isn't high quality hardware.


That was a good find, shkhln  
Well that says all.

When I find Dell computers/workstations, I normally gut them for parts, because of their PSUs.
They are utter crap imho, the inside is so cramped that maintenance, even only cleaning, is an absolute hassle, not to even think of recapping.
Due to the heat in the cramped space, you usually find bulgy caps everywhere inside.

And because of the non-ATX pinout, boards and PSUs are useless, I just salvage RAM and CPU and ditch the rest.






106 W combined isn't that much.
I'd love to see the ripple.


----------



## richardtoohey2 (Feb 25, 2021)

Snurg said:


> When I find Dell computers/workstations, I normally gut them for parts, because of their PSUs.
> They are utter crap imho,


Well, they are definitely a case of you get what you paid for.  If you go for their cheapest home/office computers, then yes, you get the low-quality stuff.  HP/Compaq etc. the same.


----------



## shkhln (Feb 25, 2021)

Snurg said:


> 106 W combined isn't that much.


12 V * 17 A -> 204 W, all other numbers are not important. Anyway, let's wait for the confirmation from OP.


----------



## tOsYZYny (Feb 25, 2021)

That isn't my power supply, but anyways, I booted back up to the system mostly - I don't have it in the same exact configuration (driving 2 monitors, 1x 3440x1440, 1x 1680x1050).  It is only driving the 1680x1050 right now and so far, no buzzing.

I have it in the original configuration and no buzzing yet.

Is it possible that my system just needed rebooted ...


----------



## Mjölnir (Feb 25, 2021)

@Olli@, I do not understand your logic (only one channel -> must be software).  It's the other way around: the audio hardware - however small it is nowadays - has physical dimensions.  The parts that make up tne one channel might be nearer to some source of inference than the other.  It can even shield the other channel from inferences.  Besides that, it's well known that one shall not run the PSU @ it's limits for a longer period.


----------



## tOsYZYny (Feb 25, 2021)

I have not had an issue since putting everything back into the PC.  Like I said, perhaps something needed rebooted even though I recently rebooted after running freebsd-update ...


----------



## Snurg (Feb 25, 2021)

Hmm, maybe we need to learn something from the Windows world...
There the first step would be to reboot. I once had a colleague who rebooted his computer several times a day, stating it is to make sure that it does not start to act funny.


----------



## olli@ (Feb 25, 2021)

Mjölnir said:


> @Olli@, I do not understand your logic (only one channel -> must be software).  It's the other way around: the audio hardware - however small it is nowadays - has physical dimensions.  The parts that make up tne one channel might be nearer to some source of inference than the other.  It can even shield the other channel from inferences.  Besides that, it's well known that one shall not run the PSU @ it's limits for a longer period.


Well, then please explain to me exactly how the PSU can cause a regular buzz on just one channel that appears both on an analog 3.5mm jack _and_ on the digital signal of an USB port (and it obviously affects USB audio only, but not USB keyboard, mouse or other protocols).

For example: Does the PSU have anything to do with USB? Does it “know” how to dissect the various layers of the USB audio protocol, and replace just the sample bytes of the right channel with bytes that represent a buzzing sound, and recalculate the CRC checksums of the USB packets? I think this is extremely unlikely. Unless your PSU comes from the NSA, of course.

Note that there are _no_ analog parts involved when using USB audio, the path is completely digital, so the PSU would have to inject digital „buzzing bytes“ at some point into this path, where ever that may be.

Also note that the data paths for the 3.5mm jack and for USB audio are completely different. The former comes from the audio hardware chip on the mainboard, goes through a DAC (which is often – but not always – inside the audio chip), and then through a small amp (which is usually separate). Conversely, USB audio does _not_ come from the audio hardware on the mainboard. It comes from the USB controller (which can be inside the processor, inside the chipset {sometimes called north bridge or south bridge}, or it can be a separate chip on the mainboard), goes through one or more  USB hubs, and finally reaches an USB port.

So what do analog audio and USB audio have in common? Almost nothing. It’s even unlikely that they’re on the same PCI bus (although it is possible). The last thing that they have in common is the snd(4) framework inside the kernel – After that, they go their separate ways.

Therefore I’m positive that it must be a software problem.


----------



## tOsYZYny (Feb 25, 2021)

So, I recently had an issue with my system updates...

I was running pkg update and then pkg upgrade nightly.  This caused my system to be partially hosed (couldn't start X).  I was able to rectify that after doing freebsd-update.  Could it be related?  I did restart after freebsd-update though.


----------



## drhowarddrfine (Feb 25, 2021)

tOsYZYny said:


> Is it possible that my system just needed rebooted


No. But this all sounds like my original suggestion of tapping on everything. You've now wiggled everything around by taking it all apart and putting it back together.


----------



## Mjölnir (Feb 25, 2021)

We have an idiom for this: _"Da staunt der Laie und der Fachmann wundert sich"_.  Loosely translated: _"You must be pulling my leg!"_.  Literally it would be: _"The layman marvels and the expert is surprised"._


----------



## tOsYZYny (Feb 25, 2021)

Well, since I have yet to have this issue again since moving everything back, shall I close this as resolved?  Then, whenever it occurs again, I can repost my findings?

On a side note, I was convinced I had a PSU failure, so I was excited to upgrade my hardware to something less old .  But ... after I was running on something older and hardly noticed any difference, I'll wait until it goes up in smoke.


----------



## tOsYZYny (Feb 25, 2021)

Well, it came back, that was short-lived.  It is out of just the left channel now.


----------



## Mjölnir (Feb 25, 2021)

tOsYZYny said:


> Well, it came back, that was short-lived.  It is out of just the left channel now.


The universe doesn't like you... :/


----------



## tOsYZYny (Feb 25, 2021)

I captured it as an audio file, but cannot upload audio files to youtube.  It is an m4a.


----------



## Mjölnir (Feb 25, 2021)

Recode to mp3 (multimedia/ffmpeg) or use another upload service?


----------



## tOsYZYny (Feb 25, 2021)

I recoded it with ffmpeg and added an image to make it a "video", but youtube still didn't like it .

I think I will reluctantly pull the PSU from the older box that has a bigger PSU, 375 versus 275, and pray that that is the problem.  I will do this when I hear buzzing again.  I accidentally power cycled the machine when pulling an unused drive, so my machine has only been up for a day and a half and no buzzing yet.  When I first restarted it, it lasted for about a day.


----------



## a6h (Feb 27, 2021)

tOsYZYny said:


> I recoded it with ffmpeg and added an image to make it a "video", but youtube still didn't like it .


AFAIR uploading m4a to LBRY is possible. Not sure, though!


----------



## tOsYZYny (Mar 9, 2021)

Well, in any case, I haven't done anything else to my system except for the accidental reboot on February 25 and I haven't had any buzzing since.  I'll report back if/when it happens again and try to upload the audio again.


----------



## tOsYZYny (Mar 10, 2021)

Ok, I think I know what causes it now.  I haven't switched the default audio device for the past 2 weeks, hence no buzzing.  I'm trying to just use my phone for calls.  I only switch it so that I can make calls on my computer using my USB headset.  Upon switching it (and waiting a little while), the buzzing came back.


----------



## Snurg (Mar 10, 2021)

I am not sure whether I understand you correctly.
Are you saying that you powered off your cellphone except when making calls, and the buzzing comes back when the phone is turned on (not in airplane mode)?


----------



## tOsYZYny (Mar 10, 2021)

No.

For the past 2 weeks, I have been using my cell phone for making calls and avoiding using my desktop for making calls (through google voice).  As a result, I haven't been switching the default audio unit from 1 to 5 (in my case).  I used my desktop today and after switching from 1 to 5 for the default audio unit, the buzzing came back in the USB headset.  Oddly enough though, after finishing my call and reverting to 1 for the default audio unit, the buzzing hasn't reappeared.

I am baffled by this.


----------

