Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug: Static noise appears over a long period of audio processing #224

Closed
1 task done
nodeful opened this issue Apr 19, 2020 · 83 comments
Closed
1 task done

Bug: Static noise appears over a long period of audio processing #224

nodeful opened this issue Apr 19, 2020 · 83 comments

Comments

@nodeful
Copy link
Collaborator

nodeful commented Apr 19, 2020

Issuehunt badges

Disclaimer:
Please go through existing issues to avoid creating duplicates. If you found a similar issue please post a comment there. If you are uncertain your issue is related to others then create the issue. Obvious ignorance of this rule might get you blocked from posting new issues. Please tick the box below to show that you have followed the guideline.

  • I have checked for a similar issue and sure it hasn't been reported before.

Describe the bug
Reported in issues: #36 #79 #152 #174 #180 #187 #199 #210

I (the developer) have never actually seen this problem occur to me, probably due to the specific hardware setup that I have. However, many users have reported and this is a critical issue to fix.

In #180 user @ekarlo have done a lot of work to mitigate the issue with the old eqMac2 release.
Most likely issue relies in the Sampling Rate mismatch and the slow drift of the Ring Buffer when processing the audio.

Probably also related to the sync loss and audio latency added reported in: #118 #144 #212
Need to look into it more.

Steps to Reproduce
Waiting for users to report their hardware setups to achieve a similar setup for reproduction.

Expected behaviour
The Audio should stay clear no matter how long eqMac process is running for.

Setup information:
Waiting for feedback from users about the setup that they use.


IssueHunt Summary

darrenw2112 darrenw2112 has been rewarded.

Backers (Total: $100.00)

Submitted pull Requests


Tips

@nodeful
Copy link
Collaborator Author

nodeful commented Apr 19, 2020

The bug is likely related to #225 and probably fixing one of these will fix the other.

@mwmrshll
Copy link

@nodeful, I'm getting this bug running through a Thunderbolt 3 port into a Caldigit TS3+ dock with speakers plugged into its 3.5mm jack. As others said on the previous issue, it goes away temporarily if I switch audio source away and then back to eqMac, and then returns after a couple of minutes.

@NielsCodes
Copy link

NielsCodes commented Apr 22, 2020

@nodeful I'm running into the same issue with my Revonext QT2S headphones, my KZ ZS10 Pro's and when I use my Bose QC 35 in wired mode. I might be wrong, but it seems like the issue gets worse (appears sooner, progresses quicker) when the bass levels are boosted significantly. I'm running a 2019 15" MacBook Pro.

@nodeful
Copy link
Collaborator Author

nodeful commented Apr 22, 2020

What Sample rate are you guys using on the output devices? You can find that in the Audio MIDI Setup.app on your mac

@NielsCodes
Copy link

eqMac is at 44.1K the rest is all at 48K

@nodeful
Copy link
Collaborator Author

nodeful commented Apr 22, 2020

What if you set everything to 44.1K before running eqMac?

@rome3ro
Copy link

rome3ro commented Apr 22, 2020

I did that setting up to 44 before installing actually is happening anyway I'm using iTunes on Catalina and if you leave the music running it comes worse the noise

@rome3ro
Copy link

rome3ro commented Apr 22, 2020

Switching between output the noise go away immediately however after a while comes again

@rome3ro
Copy link

rome3ro commented Apr 22, 2020

Maybe I'm wrong but on eqmac2 I could it switch on the mac (top bar -> sound icon) switch between output with this new version I can do it but after select for example from "eqmac" option to "Macbook Pro Speakers" nothing sounds even if I increase the volume, not sure if this is a bug or not, but as I said on previous version I was able to do that and the sound coming out from the selection

@NielsCodes
Copy link

@nodeful Tried switching to 44.1K before starting eqMac. Same issue still appeared after a while, although the crackling seemed to be of a higher frequency, although that might be unrelated. Let me know if there's anything else I can try or if there's any info that would help you.

@mwmrshll
Copy link

Thanks for the response. I switched the speaker to 44.1k with Audio MIDI Setup. This seemed to help at first, but the problem came back (maybe it gained me an extra minute or so). I've noticed that eqMac is set at 44.1k (or 48k) 2 ch 32-bit float, while my speakers can only be set to 44.1k/48k 2 ch 16/24-bit integer. So could the problem arise as eqMac is trying to convert the float sound stream to int? (forgive me if I'm nowhere in the ballpark, not really my area!)

@mwmrshll
Copy link

Furthermore, when listening through my Sony WH-1000XM3 headphones, there is no static build up. The headphones' format is 48k 2 ch 32-bit float. Even with eqMac set to 44.1k 2 ch 32-bit float, it works fine. So the issue only seems to arise with the float/int difference.

@kimbeejay
Copy link

Same here as @NielsKersic has described

@isdaves
Copy link

isdaves commented Apr 28, 2020

Experiencing the same symptoms on a MBP 15" 2018 on Mojave, using the integrated speakers of my external LG display (connected via HDMI to Thunderbold3 port)

  • Slight latency increase
  • Crackling

Output devices:

  • eqMac: 2ch 32bit float - 44.1Khz
  • LG: 2ch 24bit integer - 48Khz

As others mentioned, it goes away if I switch sources. Also, this never happened to me with eqMac2, which I was using up until now.

@darrenw2112
Copy link

darrenw2112 commented Jun 12, 2020

@nodeful, I figured out and have a fix for this issue (I created an app similar to this years ago and had to solve this issue then). I am not a Swift guy, so you will probably have to remove some semicolons. I should have a chance in the next few days to upload it. How would you like me to post it (I have no idea what IssueHunt is)?

@AcidSlide
Copy link

AcidSlide commented Jun 15, 2020

I would like to add my config to the list, I've encountered this even just having/using the built-in speakers.. (using eq 0.2.2), this somehow didn't happen when I was using "0.2.0" version (or might not have noticed it).

Also happened while using an external headphone.

image

[UPDATE]
Yup it's consistent, the sound degrades after playing audio for around 30+ mins.. clicking the "resync" button in eqMac UI fixes it temporary.

If you actually leave it playing, as it degrades over time, the music/sounds becomes robotic in nature. And more static noise is introduced as it degrades more.

@nodeful
Copy link
Collaborator Author

nodeful commented Jun 19, 2020

@darrenw2112 that's awesome man!
Just go here: https://issuehunt.io/r/bitgapp/eqMac/issues/224 (login with GitHub)
And click Submit Pull Request on the right column!

Edit: And don't worry about formatting, just want the bug to be fixed.

@jeffconsi
Copy link

jeffconsi commented Jun 22, 2020

Downloaded 0.3 today. Sounds great thank you. But, this issue is still happening only this time the sound gets slightly distorted but doesn't cut out. It just maintains a crackly sound. Clicking 'Reset Playback' fixes the issue, but it comes back after 15-20mins of continuous play. Also, the Balance L/R fader/slider doesn't do anything. I am on latest Catalina with headphones.

@AcidSlide
Copy link

AcidSlide commented Jun 22, 2020

I can confirm that the crackling sound still happens after some time.. I haven't logged how long yet.. but issue is still there.

Clicking the reset/resync button fixes the issue temporarily.

By the way, i'm already using eqMac 0.3.1 with 1.1.0 drivers.

[UPDATE 1]
Crackling sound started around 13mins+.. I'll keep the timer running and see how bad the crackling/static noise becomes..

[UPDATE 2]
16mins+.. crackling sound has definitely worsened since update#1

[UPDATE 3]
18mins+.. sound quality has degraded big time, sounds like my speakers was broken.. will stop here for now.. my ears are hurting from the worsening quality and static/crackling noises

[UPDATE 4]
After quitting eqMac.. i'm not sure if it's just an after effect but my speaker sounds like somethings wrong with it.. i will try to restart..

@darrenw2112
Copy link

@nodeful I will try to post this today.

@darrenw2112
Copy link

@nodeful I submitted the pull request. For some reason it shows a lot has changed. The only changes are in:
CARubuffer.swift -> clipTimeBounds
Output.swift -> init
Output.swift -> outputRenderCallback
Output.swift -> a few class variables

@nodeful
Copy link
Collaborator Author

nodeful commented Jun 24, 2020

@darrenw2112 I will take a look this evening, my laptop has died unfortunately waiting for a replacement at the moment so wont be able to test for a little bit

@nodeful
Copy link
Collaborator Author

nodeful commented Jun 24, 2020

Hey everyone 👋
I have created a pre-release candidate with the fixes by @darrenw2112 that will potentially fix this issue!
Please download it here: https://github.com/bitgapp/eqMac/releases/tag/v0.3.2
And report back if it solved this issue for you

@darrenw2112
Copy link

darrenw2112 commented Jun 24, 2020 via email

@AcidSlide
Copy link

AcidSlide commented Jun 24, 2020

Hey everyone 👋
I have created a pre-release candidate with the fixes by @darrenw2112 that will potentially fix this issue!
Please download it here: https://github.com/bitgapp/eqMac/releases/tag/v0.3.2
And report back if it solved this issue for you

I'm currently running in 25+ mins already and so far I haven't noticed any crackling or static noises. I will do another update at around 1+ hr mark.

Checking CPU usage, Activity Monitor is reporting an average of 3.5% with average of 15 threads running (main process only).
image
I'm just not sure why CPU Time is reporting more than 1hr. I just installed 0.3.2 about 30mins ago (previously uninstalled 0.3.1 yesterday).

@AcidSlide
Copy link

AcidSlide commented Jun 24, 2020

Hey everyone 👋
I have created a pre-release candidate with the fixes by @darrenw2112 that will potentially fix this issue!
Please download it here: https://github.com/bitgapp/eqMac/releases/tag/v0.3.2
And report back if it solved this issue for you

Ok after doing some additional checking in the Activity Monitor, I noticed CPU usage on 2 out my 16 hyperthread cores was at more than 10% so I went to find it. (NOTE: No music/audio is playing while I was checking)

1st... "coreaudiod" was spiking between 10% and 20%, is this normal??
image

2nd... After quitting eqMac "coreaudiod" went back to 0-0.2% usage and at the same time the audio driver was not removed from the enabled audio devices
image

@darrenw2112
Copy link

I have been running for several hours and coreaudiod < 3% with eqMac around 5% (same as in Xcode).

@AcidSlide
Copy link

I have been running for several hours and coreaudiod < 3% with eqMac around 5% (same as in Xcode).

Hmmm mine is at 10-11% average (for coreaudiod) CPU usage with or without music playing.

MBP Processor: 2.3Ghz 8-Core Core i9

What's your processor?

@AcidSlide
Copy link

AcidSlide commented Jun 24, 2020

By the way, I'm already at 45mins mark with music playing using Spotify and MacBook Pro Speaker.. (i'll test using headphones after a couple of hours)

So far, no crackling or static noises heard.. audio quality is still at 100% for me..

@darrenw2112
Copy link

MBP: 2017 -> 2.9 Ghz Quad-Core i7.
coreaudiod is a fickle one

@nodeful
Copy link
Collaborator Author

nodeful commented Jun 24, 2020

Currently the way eqMac works is it processes audio all the time, even if it's silence, there's no real nice way to fix that without going absolutely crazy in to optimisation, which is not something I would like to focus on right now personally. For me on my 2.3 GHz Dual-Core Intel Core i5 eqMac together with CoreAudio uses around 5-7% CPU on average which is totally acceptable for me. You have to take into consideration other apps that might be interacting with CoreAudio in any way, even if it's not apparent straight away. Also higher Sampling Rate devices and more complex protocols like Thunderbolt can increase the load on CoreAudio in unknown ways. Regarding this issue, let's see what some more people will report, but so far looks very promising. Congrats and thanks @darrenw2112 couldn't do it without you. Would be nice to chat with you in https://discord.eqmac.app to understand how you fixed the problem in more detail :)

@AcidSlide
Copy link

AcidSlide commented Jun 24, 2020

Currently the way eqMac works is it processes audio all the time, even if it's silence, there's no real nice way to fix that without going absolutely crazy in to optimisation, which is not something I would like to focus on right now personally. For me on my 2.3 GHz Dual-Core Intel Core i5 eqMac together with CoreAudio uses around 5-7% CPU on average which is totally acceptable for me. You have to take into consideration other apps that might be interacting with CoreAudio in any way, even if it's not apparent straight away. Also higher Sampling Rate devices and more complex protocols like Thunderbolt can increase the load on CoreAudio in unknown ways. Regarding this issue, let's see what some more people will report, but so far looks very promising. Congrats and thanks @darrenw2112 couldn't do it without you. Would be nice to chat with you in https://discord.eqmac.app to understand how you fixed the problem in more detail :)

Thanks for the update, I do understand the possible intricacies of coreaudiod. If I can find extra time next or next next month, I might try to help out on the optimizations. 😁

Thanks @nodeful for creating such a great app and thanks to @darrenw2112 for finding a fix to the audio crackling/noise.

So far, running at more than 1hr mark, audio quality still at 100% 😊

@AcidSlide
Copy link

AcidSlide commented Jun 25, 2020

Hey everyone 👋
I have created a pre-release candidate with the fixes by @darrenw2112 that will potentially fix this issue!
Please download it here: https://github.com/bitgapp/eqMac/releases/tag/v0.3.2
And report back if it solved this issue for you

Oh no! I think a new bug was introduced... no sound coming out of my external port using a headphones.

It also stopped working while trying to switch between "MacBookPro Speaker" and "External Headphones"
image

NOTE: Using internal speakers past 2hr mark, still no crackling or static noises observed.

@HerrTamm
Copy link

For me static noise always started after 5 seconds and sound was a total robot mess in just 10 seconds. Updated app to 0.3.2 and driver to 1.1.1 and so far so good, no problems anymore. CPU usage is 2-4% (i7 8750H)

@darrenw2112
Copy link

darrenw2112 commented Jun 25, 2020

I occasionally (seems to happen much less anymore) have a crash when switching inputs (I believe this is in the init function). Also it would be great if the program would not switch the output device when a new one becomes available.

@HerrTamm
Copy link

I occasionally (seems to happen much less anymore) have a crash when switching inputs (I believe this is in the init function). Also it would be great if the program would not switch the output device when a new one becomes available.

You should probably create a new issue or find a more relevant one: https://github.com/bitgapp/eqMac/issues

@darrenw2112
Copy link

I know, I was just responding to the comment earlier about it stopping.

@Xardas220
Copy link

Xardas220 commented Jun 25, 2020

Hi, I installed the new Version and driver and what should I say - it's gone. The crackling is gone completely. I listen now 3h to music, YouTube and other things and all works as aspected. Thank you, @darrenw2112 for the fix and @nodeful for the implementation. :)
I compared the CPU usage before and after and saw no difference. I am on a hackintosh (R7 3700X, 16GB, 5700XT), so plenty of horsepower. The usage was before and after between 0.8% and 1.4%. 15 Threads running in within the eqMac process. Coreaudiod is pinned on 0.7% for the whole time, running 14 Threads. Nothing special in summary.

@nodeful
Copy link
Collaborator Author

nodeful commented Jun 26, 2020

Thanks for the feedback everyone. I made the v0.3.2 release public now. Seems like this specify issue can now be finally closed.

@issuehunt-oss
Copy link

issuehunt-oss bot commented Jun 26, 2020

@nodeful has rewarded $90.00 to @darrenw2112. See it on IssueHunt

  • 💰 Total deposit: $100.00
  • 🎉 Repository reward(0%): $0.00
  • 🔧 Service fee(10%): $10.00

@issuehunt-oss issuehunt-oss bot added the 🎁 Rewarded on Issuehunt This issue has been rewarded on Issuehunt label Jun 26, 2020
@nodeful nodeful closed this as completed Jun 26, 2020
@nodeful nodeful unpinned this issue Jun 26, 2020
@ghost
Copy link

ghost commented Mar 8, 2021

I've been using eqMac for the last few years and I've never had any issues with it up until very recently.

I'm having this issue on Mac OS High Sierra - the audio starts crackling after about an hour of using eqMac and it would only resolve itself if I quit and restart the app.

I had to recently reset my PRAM and eqMac is completely unusable (noise crackling when changing the volume up or down, bass is constantly crackling and the Advanced equalizer makes everything worse.

Mac OS Audio devices Format 48,000 Hz.
eqMac version 0.3.7
UI version 1.2.2
Driver version: 1.2

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests