HydrogenAudio

Hosted Forums => foobar2000 => Support - (fb2k) => Topic started by: PelPix on 2012-09-22 06:01:50

Title: Pops and clicks using official ASIO in Windows 8 with foobar, but no p
Post by: PelPix on 2012-09-22 06:01:50
Microsoft seems to have written a new scheduler for handling tasks better in 8, and it works, but the priority settings now mean different things, and anything below the redesigned "Realtime" setting means it's handled in a way that is not suitable for audio playback on some ASIO drivers, so it pops at every latency.  The easiest solution is to add ALL of the priority options to the ASIO component instead of just having a tickbox for "high priority."
Title: Pops and clicks using official ASIO in Windows 8 with foobar, but no p
Post by: PelPix on 2012-10-05 23:04:47
Windows 8 users, if you're experiencing pops, try the fix for yourself!
Open Task Manager and set the ASIO host's priority to real-time.  Problem solved!
Title: Pops and clicks using official ASIO in Windows 8 with foobar, but no p
Post by: fuflo on 2012-10-05 23:54:52
are you using native asio drivers or asio4all? personally, with tascam us-144mkII i had/have no issues with asio at all ( native driver ) on win8.
Title: Pops and clicks using official ASIO in Windows 8 with foobar, but no p
Post by: PelPix on 2012-10-19 03:52:09
are you using native asio drivers or asio4all? personally, with tascam us-144mkII i had/have no issues with asio at all ( native driver ) on win8.


Native.  Setting priority to "Realtime" universally fixes them, and has caused no instability in 10 continuous hours of use (so faR).
Title: Pops and clicks using official ASIO in Windows 8 with foobar, but no p
Post by: neograniceni on 2012-11-15 20:43:03
Would be really nice if such an option to set asio host priority to realtime would be implemented in some future release.
Title: Pops and clicks using official ASIO in Windows 8 with foobar, but no p
Post by: neograniceni on 2012-11-16 13:50:40
Windows 8 users, if you're experiencing pops, try the fix for yourself!
Open Task Manager and set the ASIO host's priority to real-time.  Problem solved!


Well, the problem is that foobar closes/reopens ASIO host every time you start to play song, or when the song is paused/stopped, and it's priority is reset to normal or high which is not enough to work without problems under Win8. So I made a little tray tool to detect and set/keep ASIOhost32.exe or ASIOhost64.exe priority to realtime. Will test it today, and if everything would work I'll share it here.
Title: Pops and clicks using official ASIO in Windows 8 with foobar, but no p
Post by: neograniceni on 2012-11-16 16:53:04
Well, here it is. It works OK for me using foobar 1.1.16, ASIO 2.1.2, Asus Xonar ST with Unixonar driver 1.64 and Windows 8 Pro x64. You can put this to your startup if you want. You can download it from here. (http://www.4shared.com/file/wSeYQmDF/ASIOPRC.html) Disclaimer: use it on your own responsibility.

Edit: just found there could be multiple asiohosts opened at the same time in foobar. e.g. if you open asio properties from settings while playing music through asio out, or vice versa. Only the first (oldest) asiohost process will be set to realtime priority. I have no intention to deal with that 'coz messing with the ASIO settings while playing music is not something we should be doing anyway. Hope foobar will get an option to set ASIO host realtime priority in some future release, so this tool would become unnecessary.
Title: Pops and clicks using official ASIO in Windows 8 with foobar, but no p
Post by: neograniceni on 2012-11-24 20:10:13
BTW be sure to run it as an administrator (give admin privileges to the shortcut or .exe file) !
Title: Pops and clicks using official ASIO in Windows 8 with foobar, but no p
Post by: neograniceni on 2013-02-23 18:28:37
Version 1.1. update: no longer need to run as administrator, now runs through Windows UAC. Link is the same as above.
Title: Pops and clicks using official ASIO in Windows 8 with foobar, but no p
Post by: tato on 2013-09-08 06:33:25
Would be really nice if such an option to set asio host priority to realtime would be implemented in some future release.


This is just to report that I experienced that ASIO host real time priority is crucial for ASIO Lynx driver running in win 7.
Even in a system where latency looks not to be an issue.

Infact, I was looking for a workaround for my Lynx two B card (thanks for the nice piece of software).
I strongly encourage to implement real time priority choice in foobar ASIO tab.
As far as I  checked in my system (Athlon 64x2 3600+) it does not affect stability.
Title: Pops and clicks using official ASIO in Windows 8 with foobar, but no p
Post by: neograniceni on 2013-11-30 14:15:39
Seems the problem no longer exists in Win 8.1. foobar 1.2.9, Asus Xonar ST with latest Asus driver, not a single pop/skip since Win8 -> Win8.1 upgrade.
Title: Pops and clicks using official ASIO in Windows 8 with foobar, but no p
Post by: neograniceni on 2013-12-01 14:26:00
Seems the problem no longer exists in Win 8.1. foobar 1.2.9, Asus Xonar ST with latest Asus driver, not a single pop/skip since Win8 -> Win8.1 upgrade.


Huh, the problem is back  .
Title: Pops and clicks using official ASIO in Windows 8 with foobar, but no p
Post by: Propheticus on 2013-12-01 15:47:51
Check your anti-virus/firewall settings. Some cause high DPC latencies on network interfaces when surfing the web and even more so when torrrenting. This causes the system to be unable to process audio/low latency tasks properly. When you encounter this issue a next time use LatencyMon to see if/which drivers are causing the high DPC latency. In my case Avast Internet Security's Firewall caused ndis.sys (network driver interface) latency to spike. Malwarebytes Anti-Malware's Malicious website blocking feature does as well.
My 'solution' (more like a workaround) was uninstalling the Avast firewall and revert to using Windows 8.1's built in firewall and disabling the malicious website blocking* in MBAM.

Also, the Asus drivers are pretty awful. Try these: http://maxedtech.com/asus-xonar-unified-drivers/ (http://maxedtech.com/asus-xonar-unified-drivers/)

*; Have got features like this already anyway in Chrome itself and via OpenDNS web filtering and Avast browser plugin.
Title: Pops and clicks using official ASIO in Windows 8 with foobar, but no p
Post by: lucian.pescaru on 2014-12-04 14:47:29
Would be really nice if such an option to set asio host priority to realtime would be implemented in some future release.


I subscribe, I'm using an ASUS STX and clicks & pops but dissapears when asio host is set to realtime priority instead of high.
Title: Pops and clicks using official ASIO in Windows 8 with foobar, but no p
Post by: Juha on 2014-12-06 22:40:24
Microsoft seems to have written a new scheduler for handling tasks better in 8, and it works, but the priority settings now mean different things, and anything below the redesigned "Realtime" setting means it's handled in a way that is not suitable for audio playback on some ASIO drivers, so it pops at every latency.  The easiest solution is to add ALL of the priority options to the ASIO component instead of just having a tickbox for "high priority."


Which latency buffer are you talking about ... ASIO I/O buffer or foobar2k playback buffer?

If you set the ASIO I/O buffer to say 50ms does it still give issues (on foobar2k you get the ASIO dialog opened by double clicking the ASIO device name in ASIO drivers list box) ? If it does then have you ever checked if your system is working well for audio streaming? (use tools: http://www.thesycon.de/deu/latency_check.shtml (http://www.thesycon.de/deu/latency_check.shtml) or http://www.resplendence.com/latencymon (http://www.resplendence.com/latencymon))

Title: Pops and clicks using official ASIO in Windows 8 with foobar, but no p
Post by: PelPix on 2015-10-26 04:26:35
The problem still exists in 10. I have more details about it, too: Mirosoft re-programmed the scheduler to move processes around the queue depending on their CPU usage. "Priority settings" are now only biases or, in simplified terms, suggestions. Under this new system, a low-priority application will get moved above a high-priority application in the queue if it's currently using a lot of cycles. The only way around this is to set the ASIO host process to real-time, which bypasses the new dynamic queue. Otherwise, the ASIO host will be benched any time something crunches on the CPU, which will cause the music to stutter severely. This happens most often on my end with Firefox.
Title: Pops and clicks using official ASIO in Windows 8 with foobar, but no p
Post by: kode54 on 2015-10-26 08:13:23
Priority classes have _always_ been base levels, which are then offset by the individual thread priority levels. Check the Windows C headers in the SDK, or in MinGW if you value your ability to contribute to that particular project, but don't trust what you see in their headers, glaring errors can only be corrected by someone who has been told second hand that something is amiss, actual contributors aren't allowed to look at the Windows SDK.

Anyway. Priority Class controls the base priority level, thread priority adds to or subtracts from that level. Process Explorer handily displays threads' effective priority levels.
Title: Pops and clicks using official ASIO in Windows 8 with foobar, but no p
Post by: PelPix on 2015-10-26 08:38:03
Priority classes have _always_ been base levels, which are then offset by the individual thread priority levels. Check the Windows C headers in the SDK, or in MinGW if you value your ability to contribute to that particular project, but don't trust what you see in their headers, glaring errors can only be corrected by someone who has been told second hand that something is amiss, actual contributors aren't allowed to look at the Windows SDK.

Anyway. Priority Class controls the base priority level, thread priority adds to or subtracts from that level. Process Explorer handily displays threads' effective priority levels.


Thinking back, you're right. They were always suggestions. It seems to me that priority classes are considered less important post-W8 than they were pre-W8. I've NEVER seen a Low process straight up steal cycles en masse from a High process in normal use cases in 7 and earlier, but I see it in 8+ all the time. It kind of sucks, because I used to be able to set renders to Low and continue using my PC, but now it messes with UI rendering and other software like the priority class does nothing at all. It's infuriating.

The easiest fix would be to just change the "high" checkbox in the asio plugin to be a dropdown that selects priority class. Then everyone wins. The source isn't available, though.
Title: Re: Pops and clicks using official ASIO in Windows 8 with foobar, but no p
Post by: eio on 2016-10-29 11:19:31
This can be solved by disable UAC completely.

To disable UAC completely, we have to set HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\EnableLUA to 0. Restart. Then foobar2000 can start the ASIOHost process in realtime priority, no gliches anymore, all is good.
Except that metro apps will not work anymore, which is fine to me =)

If you want to keep metro apps, you can change foobar2000.exe's compatibility setting to enable "Run this program as administrator". Same effect as above.
The downside of this method is that explorer's context menus like "Play in foobar2000", as well as drag & drop music files into foobar2000, will not work anymore, since explorer and foobar2000 are not running in the same account now.
Title: Re: Pops and clicks using official ASIO in Windows 8 with foobar, but no p
Post by: Case on 2016-10-29 13:17:11
Disabling UAC is a poor workaround at best. Audio related threads already work with higher priority than anything else and further boosts should be absolutely unnecessary.
If the default 1000 ms playback buffer is not enough try increasing it. ASIO drivers usually have their internal buffer setting that one may need to increase too. It's tiny by default since ASIO is meant for realtime monitoring.
And Latency Monitor (http://www.resplendence.com/latencymon) can help with tracking down drivers that are causing audio issues.
Title: Re: Pops and clicks using official ASIO in Windows 8 with foobar, but no p
Post by: Pollux88 on 2016-10-30 10:50:04
Disabling UAC is a poor workaround at best. Audio related threads already work with higher priority than anything else and further boosts should be absolutely unnecessary.
If the default 1000 ms playback buffer is not enough try increasing it. ASIO drivers usually have their internal buffer setting that one may need to increase too. It's tiny by default since ASIO is meant for realtime monitoring.
And Latency Monitor (http://www.resplendence.com/latencymon) can help with tracking down drivers that are causing audio issues.
Playback buffer does not affect ASIO in any way, because as you've said yourself, it has its own internal buffer. On many devices ASIO buffer can't be set higher than a certain rather low value (80ms for Xonars, for instance). It's usually enough for idle playback with no issues, but attempting to do anything else that is CPU taxing (like opening a browser) on a not-so-hiend PC will result in stutters. And I speak from experience. So setting ASIO host process to realtime indeed does help. neograniceni's little tool from post #6 in this thread saves the day, and I want to thank him for it. I have not tried the UAC method though.
Title: Re: Pops and clicks using official ASIO in Windows 8 with foobar, but no p
Post by: eio on 2016-11-11 05:58:37
Disabling UAC is a poor workaround at best. Audio related threads already work with higher priority than anything else and further boosts should be absolutely unnecessary.
If the default 1000 ms playback buffer is not enough try increasing it. ASIO drivers usually have their internal buffer setting that one may need to increase too. It's tiny by default since ASIO is meant for realtime monitoring.
And Latency Monitor (http://www.resplendence.com/latencymon) can help with tracking down drivers that are causing audio issues.
Microsoft changed scheduler behaviour in late versions of windows (after Vista?), anything other than realtime is not suited for pro audio with tiny buffers.
But just as you said, realtime is a poor and dangerous solution since it can easily hung the entire system if something goes wrong, and windows requires admin privilege to run a process in realtime.
So MMCSS (Multimedia Class Scheduler Service) is introduced specially for this scenario, and foobar2000 does run itself using MMCSS, but it seems the spawned ASIOHost process is not using it?
Title: Re: Pops and clicks using official ASIO in Windows 8 with foobar, but no p
Post by: eio on 2016-11-11 06:26:08
neograniceni's little tool from post #6 in this thread saves the day, and I want to thank him for it.
Great tool! Thanks neograniceni & Pollux88, this is better than disabling UAC.
Title: Re: Pops and clicks using official ASIO in Windows 8 with foobar, but no p
Post by: neograniceni on 2018-04-07 07:40:05
Because the original link to my tool does not work anymore, here is the link to the latest build. Please rename the downloaded file to ASIOhrp.7z and unpack it using asiohrp as a password.
ASIOhrp (https://drive.google.com/open?id=1QcYmM4uy71kNxcHeCTuDph1GRrbZOTeJ)
Title: Re: Pops and clicks using official ASIO in Windows 8 with foobar, but no p
Post by: THX on 2018-04-18 13:07:39
Thank you for the new file.

I have the same probleme !  Does it work with Windows XP ?
Title: Re: Pops and clicks using official ASIO in Windows 8 with foobar, but no p
Post by: daftcombo on 2018-06-06 08:36:50
Hi,

Thank you for your little program. But for me it only sest ASIOhost priority to "high" instead of "real-time" and the clicks in foobar remain.

I'm on Win 10, with foobar 1.3.17 and a recent Asio driver provided by Focusrite for the Scarlett 2i4 soundcard.
Title: Re: Pops and clicks using official ASIO in Windows 8 with foobar, but no p
Post by: Peter on 2018-06-06 10:50:24
Thank you for your little program.
You are welcome.
Quote
But for me it only sest ASIOhost priority to "high" instead of "real-time" and the clicks in foobar remain.
Please clarify. How do you know what ASIOHost priority is in use and how is it related to the clicks?
Title: Re: Pops and clicks using official ASIO in Windows 8 with foobar, but no p
Post by: daftcombo on 2018-06-06 11:09:09
Thank you for your little program.
You are welcome.
Quote
But for me it only sest ASIOhost priority to "high" instead of "real-time" and the clicks in foobar remain.
Please clarify. How do you know what ASIOHost priority is in use and how is it related to the clicks?

I've checked in the Windows Task Manager.
When enabling your program, when I play a track in foobar, the priority is set to "High".
Without your program, it is "Normal".
In all cases, there are clicks audibles when I start a new track, stop a track, go backwards or forwards with shortcuts. Those clicks don't happen with DirectSound.
Title: Re: Pops and clicks using official ASIO in Windows 8 with foobar, but no p
Post by: j7n on 2018-06-11 09:59:24
I elevated ASIO output to realtime priority with a hex patch of foo_out_asio.dll. Choosing High priority will set Realtime instead. An extra exe downloaded from the internet seems superfluous. Tested for over a month and encountered no issues. The asio host consumes a tiny fraction of CPU, and is stable.

I use ASIO output to have the player's output appear on a separate strip on my sound card's mixer, separate from Windows output, which I could choose to mute. Previously, a certain internet application (at Below Normal), and the web browser could interrupt the playback, but now not even games can cause clicks at 10 ms latency (good all-round setting). The latency in E-MU 0404 tops at 100 ms, at which point an audio editor feels laggy.

The plugin should allow for realtime priotity selector like the old Otachan's plugin. I've not used ASIO for several years, because of its unrealiability, until someone else bumped another thread with non-working instructions on setting the priority.

Spoiler (click to show/hide)
Title: Re: Pops and clicks using official ASIO in Windows 8 with foobar, but no p
Post by: Pollux88 on 2018-06-12 09:14:17

Code: [Select]
80060300 ->
80860300 (checksum)

688000000051 ->
680001000051
Didn't work for me for some reason. Or is it Win8 specific?
Title: Re: Pops and clicks using official ASIO in Windows 8 with foobar, but no p
Post by: j7n on 2018-06-12 10:53:40
It is a standard priority class (https://msdn.microsoft.com/en-us/library/windows/desktop/ms686219(v=vs.85).aspx) value. Probably administrator rights are required for Foobar (run as administrator). Works (https://i.imgur.com/tHKlBpE.png) for me. Otachan's plugin (http://i.imgur.com/GZ2wAto.png) had realtime selectable, which is needed.

Do not set Foobar itself to realtime, or your computer will hang if you use converter or other heavy processes. ASIOhost32 uses <1% cpu.
Title: Re: Pops and clicks using official ASIO in Windows 8 with foobar, but no p
Post by: Pollux88 on 2018-06-12 13:16:18
Yeah, that was really it, had to run Foobar as administrator. It is however equally inconvenient due to UAC popping up.
Thanks for an interesting solution, though. I'll have to think what can be done with it.
Title: Re: Pops and clicks using official ASIO in Windows 8 with foobar, but no p
Post by: Vexx23 on 2018-06-19 14:24:20
I've experienced pops/clicks/buzzes with ASIO native driver too, only recently. The ASIO process is set to high priority by default. In contrast, WASAPI (event) is flawless.
Title: Re: Pops and clicks using official ASIO in Windows 8 with foobar, but no p
Post by: j7n on 2018-06-19 22:21:00
Maybe the Realtek ASIO driver is buggy. What is the benefit of using ASIO with an integrated soundcard? If you have ASIO4ALL, then that is pointless, since it is an additional layer above the regular driver.

If this plugin is ever revised, I'd like to request a small change. Upon pressing the Stop button, when the driver is about to be closed, drop priority to Normal. My driver does some work for about 1 second in Time Critical priority (normally locked to 15, but 31 now). I solved this in other applications by not closing the driver (reaper) or using the option to play silence during pause (openmpt). E-MU/Creative added this bug in one of the last 2.xx updates.

Since there is little overhead in playing one audio stream, could the asiohost be optionally configured to play silence, as long as it is selected as an output in Foobar, and keep the device open, and possibly solve the above poster's problem (https://hydrogenaud.io/index.php/topic,116146.0.html), which appears to occur only during pause.
Title: Re: Pops and clicks using official ASIO in Windows 8 with foobar, but no p
Post by: Vexx23 on 2018-06-20 15:44:47
Maybe the Realtek ASIO driver is buggy. What is the benefit of using ASIO with an integrated soundcard? If you have ASIO4ALL, then that is pointless, since it is an additional layer above the regular driver.

If this plugin is ever revised, I'd like to request a small change. Upon pressing the Stop button, when the driver is about to be closed, drop priority to Normal. My driver does some work for about 1 second in Time Critical priority (normally locked to 15, but 31 now). I solved this in other applications by not closing the driver (reaper) or using the option to play silence during pause (openmpt). E-MU/Creative added this bug in one of the last 2.xx updates.

Since there is little overhead in playing one audio stream, could the asiohost be optionally configured to play silence, as long as it is selected as an output in Foobar, and keep the device open, and possibly solve the above poster's problem (https://hydrogenaud.io/index.php/topic,116146.0.html), which appears to occur only during pause.

I think Realtek ASIO is faulty too, and the problems cannot originate from the soundcard, since WASAPI does not exhibit any similar behaviour.
I don't use ASIO4ALL, since my soundcard supports native ASIO driver.

My problem occurs after resuming playback after pause, exactly. Not only I hear awful sounds, but also several tens of seconds of the track are skipped like a damaged tape.
Title: Re: Pops and clicks using official ASIO in Windows 8 with foobar, but no p
Post by: PeterMac on 2018-11-02 00:40:28
Disabling UAC is a poor workaround at best.
Why is poor workaround ? this UAC only bother me, does secure system from anything ?
What is better solution you recomended for using still ASIO ?
Title: Re: Pops and clicks using official ASIO in Windows 8 with foobar, but no p
Post by: PeterMac on 2018-11-09 11:48:53
Version 1.1. update: no longer need to run as administrator, now runs through Windows UAC. Link is the same as above.
Your version 1.1 still need to work to be set to run as administrator ;), without that not work on Win 10 build 1809.
Till now I had disabled UAC in registery to solve glitches in sound on ASIO, but maybe I will turn it on and will be use your app instead :). thank you very much for this liitle app.
Title: Re: Pops and clicks using official ASIO in Windows 8 with foobar, but no p
Post by: Jokanok on 2019-01-05 14:40:45
It works!! Thank you!  :))
Tip: I made a shortcut to startfb2k always as an administrator.
Title: Re: Pops and clicks using official ASIO in Windows 8 with foobar, but no p
Post by: neograniceni on 2019-12-17 11:19:09
Here is the latest version of my tool. I am using it for years and it works OK for me. Requires administrator privileges but you can add it to the Task Scheduler to be started with Windows - this can be done from about/settings panel automatically. There are now some f2k helper functions included to help running f2k constantly on my computers, i.e. force close f2k on crash, crash files folder cleanup after crash and f2k restarter in case it crashes. Useful for HTPCs and in case you use some VST plugins that collapses f2k on closing. Anyway...
Download ASIOhrp (https://drive.google.com/file/d/1V0sgOY2LrYbZTPR9i4iNnK1S0TU8GJoL/view?usp=sharing)
Title: Re: Pops and clicks using official ASIO in Windows 8 with foobar, but no p
Post by: blaHbluBB on 2020-06-30 11:02:30
Download ASIOhrp (https://drive.google.com/file/d/1V0sgOY2LrYbZTPR9i4iNnK1S0TU8GJoL/view?usp=sharing)

thank you very much for this <3