bitgapp / eqMac

macOS System-wide Audio Equalizer & Volume Mixer 🎧
https://eqmac.app
Apache License 2.0
5.68k stars 334 forks source link

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

Closed nodeful closed 4 years ago

nodeful commented 4 years ago

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.

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](https://issuehunt.io/u/darrenw2112) has been rewarded. ### Backers (Total: $100.00) - [nodeful nodeful](https://issuehunt.io/u/nodeful) ($100.00) ### Submitted pull Requests - [#322 Updates For Static Issue](https://issuehunt.io/r/bitgapp/eqMac/pull/322) --- ### Tips - Checkout the [Issuehunt explorer](https://issuehunt.io/r/bitgapp/eqMac/) to discover more funded issues. - Need some help from other developers? [Add your repositories](https://issuehunt.io/r/new) on IssueHunt to raise funds.
nodeful commented 4 years ago

I've improved the dev documentation in the README but would have to spend some more time explaining how the code is structured. I will do this at a later date, but if you have any questions regarding development ask on https://discord.eqmac.app

darrenwinslow commented 4 years ago

I also am having this issue. It probably takes an hour or two before this happens (distortion). If I do a reset it will go away for a while. Running at 48kHz using an external USB audio device.

fbcd4f50ea5350f051450323b5abfd0b commented 4 years ago

For me it always takes just a few seconds.

IvanTurgenev commented 4 years ago

macbook air retina vanilla catalina affected headphones, eq highs low mids low bass normal, after maybe 30 minutes? then distortion increases fast

darrenwinslow commented 4 years ago

Note that changing volume or disabling the eq (slide switch to the left) has no effect on the static. Also, running within Xcode produced no additional output when this happens. Also, it does take about 2 hours for the static to become audible, and it gradually gets worse over time to the point when it is just static.

artem-kobets-qa commented 4 years ago

Got similar issue.

Here is my configuration: image image

Screenshot 2020-06-11 at 13 35 01
darrenw2112 commented 4 years ago

@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 commented 4 years ago

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 commented 4 years ago

@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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

@nodeful I will try to post this today.

darrenw2112 commented 4 years ago

@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 commented 4 years ago

@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 commented 4 years ago

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 commented 4 years ago

Note that I changed your init back to the way you had it because the rates that were reported in your new way (using the mix bus) did not reflect what the input was set to. It always reported 44.1.

On Jun 24, 2020, at 3:10 PM, Roman Kisil notifications@github.com wrote:

ο»Ώ 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

β€” You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub, or unsubscribe.

AcidSlide commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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

AcidSlide commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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

nodeful commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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 commented 4 years ago

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

Xardas220 commented 4 years ago

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 commented 4 years ago

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[bot] commented 4 years ago

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

ghost commented 3 years ago

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