XXHighEnd

Ultimate Audio Playback => Playback Tweaks and Source related subjects => Topic started by: Nick on October 11, 2010, 12:56:24 am



Title: IRQ CPU Affinity Setting
Post by: Nick on October 11, 2010, 12:56:24 am
Trust your ears Nick....Oh boy... Right here we go !

I have been looking at ways to set affinity of drivers after something the Peter said in a post. The basic theory is that if you can arrange the systems IRQ handeling work load across processors then you can give XXHighend and your sound device driver a BIG slice of uninterrupted system resources to be super responsive and make great music.

For about a year I have been playing with 2 CPUs out of 4 because as I add in the extra CPUs sound deteriorates badly. I’m listening now with 4CPUs to sound I find the sound hard to distinguish from a record player. My wife has the most sensertive ears of anyone I know (she can still easily hear bats), the slightest digital distortion makes her literally run from the room. She has just given a big thumbs up to the sound which is a first in years..HOW ?

All of the none music related IRQs on my system are being serviced on CPU 0 alone. CPU 2 is now used for HighEnd Engine 3 and my USB (I use a USB SPDIF interface), RamDisk and Hiface Drivers IRQ requests are running on CPUs 1,2 and 3 (unfortunatly thats all the CPUs I have right now :( ). 3 / 4 of the CPUs are now running only Music related IRQ requests.

The recipe for this setup is a program called IntFiltr which is a .sys driver that allows you to assign IRQs to CPUs. It is not intended for Vista but seems to work fine on my system. You can get the software at this location and installation instruction are also there. Just remember to run the configuretor as Administrator.

http://support.microsoft.com/kb/252867

How to assign IRQs for XXHighEnd Music replay (tested on Vista)

1)   Install the package
2)   Enable all the CPUs you have on your system using normal config options.
3)   Reboot
4)   Set you XXHighEnd to run CPU appointment scheme 2 (Engine3.exe then runs on CPU 1)
5)   Run the IntFiltr configuration application
6)   In IntFilter select one by one each devices in the list [with the exception any devices related to CPU, Disk, PCI bus and your music devices (music devices include USB and Firewire devices if this are used to play)] and click “Add Filter” for the selected device. Then using the “Set Mask” button set the affinity for these devices to CPU 0.
7)   Leave your Disk, CPU and PCI devices and anything else you think should not be touched as they are (don’t create Filters for these).
8)   Now find you connection devices (USB / Firewire) and your sound card and “Add Filter” Filter for each of these. For these use “Set Mask” to use CPUs 1,2,3,,,[Max CPU no].

Notes.
If any of sound replay devices (USB, Firewire, sound card) share IRQs make sure you apply the CPUs 1,2,3,,,[Max CPU no] to the other devices that share the IRQs


That’s it reboot make a cup of tea (well i am  from the UK) and sit back and listen.  :soundsgood:


Nick.


Title: Re: IRQ CPU Affinity Setting
Post by: PeterSt on October 11, 2010, 06:31:23 am
Superb Nick. You picked that up very nicely. Now I'll see what can be done with it from within the program.
Peter


Title: Re: IRQ CPU Affinity Setting
Post by: Nick on October 11, 2010, 09:10:39 am
Peter,

I would happily wait for z09-3 with irq affinity in it. Manually configured the sound is like nothing I have heard from digital.

I think there is a fair amount of testing to get the best from this. The allocation I tried is one I came up with to try to match HighEnds current processor appointment scheme, over night the are more I want  to try out. An internal approach could maybe do much  more.

I had looked at ways of doing irq allocation a long time ago but just gave up. Your comment relit the thought that there was is an easy way to do it and this time was the lucky one. The power of a forum is great.

Would love to have you thoughts on sound.

Best
Nick


Title: Re: IRQ CPU Affinity Setting
Post by: PeterSt on October 11, 2010, 09:49:05 am
Nick,

Right now I'm away from my development cave, but I can tell you I can't wait. Yes, it should matter everything in the world, that is, according to the theories from today.

I (obviously) searched for it too in the past, but didn't find anything. But, maybe I had too much of a developer (hence "in-program") approach, and maybe it can't be done ? Ah, well, we'll make something of it, I'm sure.

Again, thanks.
Peter


Title: Re: IRQ CPU Affinity Setting
Post by: Nick on October 11, 2010, 11:19:15 am
Marcin, Roy, Main,

This is DEFIANTLY one to try as soon as you can. Sorry, I just want to make sure its on your radars. I will not say anything much about the sound except it changes the PC as a platform for music.

Nick.

Ps
I'm really frustrated, I am off today and the local power company has cut power to the house for maintenance won't be back on till 5pm !



Title: Re: IRQ CPU Affinity Setting
Post by: Marcin_gps on October 11, 2010, 12:58:20 pm
Nick, I'd love to try, but I'm running dual-core CPU right now, so I'm not convinced that it'd bring any improvements. Do you? I'd switch to quad core, but I'd have to reinstall the system and make all the tweaks again and I'm pretty much sick of doing it again, so I think I'm gonna pass, especially that I can't imagine further improvements  :xx:


Title: Re: IRQ CPU Affinity Setting
Post by: manisandher on October 11, 2010, 01:35:52 pm
Well I've just tried it, and... even with all the warnings that Nick posted, I've had really problems with it. A couple of blue screens on start-up (had to select 'revert back to last good configuration'), and now I'm struggling to get RAMDisk to work again. It seems that as soon as I add a filter/mask to anything (e.g. mouse), it stops working.

But I'd like to persevere, get it working and try it out. Nick (or anyone), are there any 'obvious' devices/processess that I should be applying a filter to?

Mani.


Title: Re: IRQ CPU Affinity Setting
Post by: tehbah on October 11, 2010, 01:37:07 pm
Here is a newer version for vista+ http://www.microsoft.com/whdc/system/sysperf/intpolicy.mspx

This removes the need for the nt driver/filter, Which will prevent booting on windows 7 x64   :(

As I only have dual core machine @ 3.4ghz I am not sure how much impact this will have, but might give it a try.


Title: Re: IRQ CPU Affinity Setting
Post by: manisandher on October 11, 2010, 01:54:20 pm
Well I've just tried it, and... even with all the warnings that Nick posted, I've had really problems with it. A couple of blue screens on start-up (had to select 'revert back to last good configuration'), and now I'm struggling to get RAMDisk to work again. It seems that as soon as I add a filter/mask to anything (e.g. mouse), it stops working.

Doh! I think I've just had a case of not reading the 'READ ME' file - didn't make the registry changes required.

Mani.


Title: Re: IRQ CPU Affinity Setting
Post by: manisandher on October 11, 2010, 01:55:10 pm
Here is a newer version for vista+ http://www.microsoft.com/whdc/system/sysperf/intpolicy.mspx

Thanks tehbah. Will give this one a go...

Mani.


Title: Re: IRQ CPU Affinity Setting
Post by: Nick on October 11, 2010, 02:18:23 pm
Mani,

The list will vary a not from system to system but just shunt stuff to CPU 0. That you think is not involved in music replay. I'm a bit limited right now as I'm on a smart phone but I will try to do a recipe post this evening. Yesterday I moved about 75% of stuff to CPU 0 and this morning.g after thinking some stuff through got much more adventuros as I was rebooting the power went off !

Stay with it, you will not believe the difference,

Marcin hi,

You can still do this with 2 cpus. Shut system background irqs to CPU 0 and set processor scheduling to scheme 2 in highend. The I would use either 0 and 1 for sound card or just 1, depending on which sounds best. This WILL work I'm prity sure from process affinity setting iv used in the past. 

Cheers,
Nick


Title: Re: IRQ CPU Affinity Setting
Post by: PeterSt on October 11, 2010, 02:35:11 pm
But I think Marcin is pretty much right in that "it will not work". You will soon run into other problems like pauses between tracks or similar. It will depend on the inherent speed of your system though.
If I would have had two cores only, I wouldnd't have known where to begin. Or merely : then it would be way too difficult.

And further ... be careful everybody. It may be better to wait till all has been sorted out by those not being afraid of blue screens or non-responding systems.


At this moment I think I can do it in software, but it's a whole new area for me, and I don't expect any examples to be there anywhere.


Title: Re: IRQ CPU Affinity Setting
Post by: Telstar on October 11, 2010, 02:54:28 pm
Great finding, but i'm on 2 cores too.
I'll try to lower USB priorities and get rid of the network stuff, that should do another big improvent in my system.


Title: Re: IRQ CPU Affinity Setting
Post by: manisandher on October 11, 2010, 03:07:57 pm
Just loaded the software linked by tehbah. It works a treat and is very easy to setup - there's a proper installation package.

As for improved SW, well this is more difficult to figure out. I started by setting a mask just for devices that have interrupt resources (I used Device Manager and viewed by resource type). I really liked the sound.

Like Nick, I then started getting more medieval, and althought everything worked fine, I wasn't sure if the sound had changed. It's very difficult to know for sure. But, it'd be easy to set things back to default.

Will share moe thoughts when I've had more of a play.

Mani.


Title: Re: IRQ CPU Affinity Setting
Post by: Nick on October 11, 2010, 04:13:41 pm
Mani,

Great result !
By the way. I think I should have said use highend CPU appointment scheme 3 not 2 as above (if I remember rightly 2 uses cores 0 and 1 which will conflict with the system irqs set). Give appointment 3 a go. I think this will improve results a lot.

Regards,
Nick


Title: Re: IRQ CPU Affinity Setting
Post by: manisandher on October 11, 2010, 04:30:10 pm
Hey Nick,

Yeah, I'd already figured this out - I'm on scheme 3. But thanks for the reminder.

I've been viewing CPU activity during playback, and it does seem that ordinarily nothing much other than XX gets appointed to CPU1. However, programs like 'Latency Checker' seem to get appointed there also, when running.

I was wondering whether it would be worth creating 8 cores with hyperthreading and 'hogging' a whole one for XX, a whole one for the device driver, etc...

Mani.


Title: Re: IRQ CPU Affinity Setting
Post by: Nick on October 11, 2010, 07:28:35 pm
As promised this is the full list of IntFilters that I am running on my thin Vista Build. I have added more elements to the CPU 0 list after today’s power cut in my village and the sound has improved by a large step again !

As you will see a great deal of stuff is on CPU0 and has to "get by" on just a 3GHz processor  (on my machine) poor processes :)

If you want to try the settings add them say 10 at a time and reboot so that you can fault find if they do not work for you machine. They are not a random selection though so they should be reasonably close straight off I hope.

Nick.

The information is attached in both Word and Excel formats


Title: Re: IRQ CPU Affinity Setting
Post by: Nick on October 11, 2010, 07:36:25 pm
Mani,

For the amount of effort involved it might be fun to try Hyerthreading. I have not had much experience but I used it a few years ago on a single core CPU I had. It worked very well and made a difference to music back then. Reading the IntFilter doc the system seems to support Hyperthreaded CPUs

You could have system stuff on one or two CPUs then XXHighEnd, and your playback drivers on separate CPUs with the rest of them. Not sure how it would sound but its nice to find a use for EIGHT! cpus  :)

Nick.


Title: Re: IRQ CPU Affinity Setting
Post by: manisandher on October 11, 2010, 08:02:38 pm
As promised this is the full list of IntFilters that I am running on my thin Vista Build.

Hey Nick, thanks so mucj for this - I really appreciate it. Will try this later and let you know how it sounds.

Cheers,
Mani.


Title: Re: IRQ CPU Affinity Setting
Post by: Josef on October 11, 2010, 10:26:13 pm
>If you want to try the settings add them say 10 at a time and reboot so that you can fault find if they do not work for you machine.

Nick, isn't this a bit dangerous? According to http://www.microsoft.com/whdc/system/sysperf/intpolicy.mspx :
"generally you should not use IntPolicy on any device sharing interrupts with another device"

Like you, I also have a USB-to-SPDIF and 'USB Host controller' apparently sits on IRQ 20. But that IRQ is shared by 2 other USB Controllers, one of which is 2nd USB port with mouse and external HD on it (and via External Hub to make matters more complicated...)
Is it wise to change affinity then? (I'd rather not risk if there is a chance of problems)

Also, in your Word Doc you suggest to set affinity for sound card i.e. driver: But the sound card itself does not have any IRQ assigned and according to above link:
"Even though all the computer devices appear in the Devices list, we recommend that you use IntPolicy only on devices that have interrupt resources"

They don't say why they recommend it, but it makes me having second thoughts.....

What is the situation in your system: Does your USB controller share IRQ with other devices? Have you then set affinity for _all_ those devices?


Title: Re: IRQ CPU Affinity Setting
Post by: manisandher on October 11, 2010, 10:32:22 pm
Will try this later and let you know how it sounds.

How does it sound? Well, very nice indeed! I've just had my brother over and through headphones (my AKG-1000s are the most revealing I've ever heard), he couldn't tell the difference between vinyl and a 24/192 recording played back on XX. And I'm not sure I can anymore either.

Thanks for all the effort Nick - your tweaks have been superb.

Oh and for anyone who is tempted to try this, it should be totally fine and straight forward - my earlier issues were my own doing and not the SW's. But it is quite laborious setting all the affinities...

Mani.


Title: Re: IRQ CPU Affinity Setting
Post by: Nick on October 12, 2010, 10:44:39 am
>If you want to try the settings add them say 10 at a time and reboot so that you can fault find if they do not work for you machine.
Nick, isn't this a bit dangerous? According to http://www.microsoft.com/whdc/system/sysperf/intpolicy.mspx :
"generally you should not use IntPolicy on any device sharing interrupts with another device"

Like you, I also have a USB-to-SPDIF and 'USB Host controller' apparently sits on IRQ 20. But that IRQ is shared by 2 other USB Controllers, one of which is 2nd USB port with mouse and external HD on it (and via External Hub to make matters more complicated...)
Is it wise to change affinity then? (I'd rather not risk if there is a chance of problems)

Also, in your Word Doc you suggest to set affinity for sound card i.e. driver: But the sound card itself does not have any IRQ assigned and according to above link:
"Even though all the computer devices appear in the Devices list, we recommend that you use IntPolicy only on devices that have interrupt resources"

They don't say why they recommend it, but it makes me having second thoughts.....

What is the situation in your system: Does your USB controller share IRQ with other devices? Have you then set affinity for _all_ those devices?

Josef,
I selected mother board based USB deliberately in order find a port with its own IRQ but I have used PCI based USB cards which had shared IRQs in the past. Try to find a port with its own IRQ if you can but sometimes using a PCI USB board can sound better even with shared IRQs.
You have some valid points regarding the instructions, I looked that the documentation too and decided the key words were “generally” and we “recommend” not don’t do it at all.  So I figured i would try it pushing the configuration and see what happened. My experience has been fine for setting affinity drivers that have IRQs and those that don’t. I did however reason that problems might come if you have two drivers, that share the same IRQ, set to different affinity. I made sure that where there is IRQ sharing all attached drivers get the same mask settings.

One reason that I took the risk of assigning affinity to drivers that do have IRQ is that it seems IntFiltr was developed for tuning servers. Therefore stability is of the upmost concern, for this reason the advice could be a little conservative which is why personally I decided to push the configuration to see what happened. If there is anyone from Microsoft or with deep experience of IntFiltr reading their views would be very welcome.
Ultimately is your call on how you apply IntFiltr but it sounds like you have a good understanding of what it is doing, you just need to be comfortable you can recover from potential problems (eg you have backups and the time to rebuild if something bad does happen).
One last thing, a USB connected drive and mouse are not the best for sound quality if you have a USB sound card. You don’t have a signature set for your posts so I cannot see you setup but if you are not using a laptop, why don’t you use PCI SATA to attach your storage and use a cheap PS/2 mouse ?

Regards,

Nick


Title: Re: IRQ CPU Affinity Setting
Post by: Josef on October 12, 2010, 11:01:48 am
Thanks, Nick.

I _am_ using a laptop, indeed, so I have no option of choosing USB ports - there are only 2 physical ones: 1st for USB-SPDIF (older OffRamp model based on M-Audio Transit driver) and 2nd for external Hub with WD HDD and mouse (no PS/2 connections either...).

I think the important think when it comes to USB is never to have other devices on same port: I have tested this myself and, indeed, if I connect OffRamp via Hub it sounds terrible beyond repair. It works good on its own though, but it's really annoying for Intel to have put all USB ports on same IRQ...

There are, however, multiple 'USB Host Controller' devices in Device Manager: I will try disabling devices that share IRQ with OffRamp and see if Windows will switch HDD/Mouse to other 'Host Controller'....

But before that, I guess I should investigate booting from USB stick: that way, if anything bad happens, only the stick needs to be reformatted....

Oh, BTW: Putting affinities on devices without IRQ IMHO is worthless: as there is no IRQ to begin with those settings are ignored. I tried this with M-Audio Transit driver and can see that DPC calls are always serviced on core 0 regardless of affinity settings...

 


Title: Re: IRQ CPU Affinity Setting
Post by: Nick on October 12, 2010, 11:10:42 am
Will try this later and let you know how it sounds.

How does it sound? Well, very nice indeed! I've just had my brother over and through headphones (my AKG-1000s are the most revealing I've ever heard), he couldn't tell the difference between vinyl and a 24/192 recording played back on XX. And I'm not sure I can anymore either.

Thanks for all the effort Nick - your tweaks have been superb.

Oh and for anyone who is tempted to try this, it should be totally fine and straight forward - my earlier issues were my own doing and not the SW's. But it is quite laborious setting all the affinities...

Mani.

Mani,
Thanks for the feedback, I am really pleased that you have managed to get such significant changes in the sound of your system, credit is also defiantly due to Marcin as well. I am particularly encouraged by your A/B test with vinyl, that for me is a most significant finding. My system is also has a wonderfully analogue sound but the comparison for me is from memory as my LP12 went a year or two ago (god rest its soul ;) ).

I have been doing some testing on the affinity setting of the three important types of service:
1) Sound card and connection,
2) Storage RAM Disk,
3)and XXHighEnd.

Finding are that generally the sound fills out and tone becomes more “right” when each of these processes has more that one CPU to run on. The improvement very nice to have BUT for maximum resolution one process per CPU seems the best (this is in line with the theory that each software processes should get uncontended immediate access to CPU the moment is called for).

So conflicting dynamics:
Better general sound with more CPUs set but lower resolution
vs
Best resolution with one CPU per process but not the best possible overall presentation.

Conclusion I want more CPUs than I have to test giving each key process 2 or more CPUs ! If you have time (or can pull yourself away from listening to the new setup ;-) ) it would be useful if you could run the hyperthreaded test we talked about on you i5 processer. Something tells me there could be a real sweet spot here wait to be found.

Regards,

Nick.


Title: Re: IRQ CPU Affinity Setting
Post by: Nick on October 12, 2010, 11:15:26 am

Oh, BTW: Putting affinities on devices without IRQ IMHO is worthless: as there is no IRQ to begin with those settings are ignored. I tried this with M-Audio Transit driver and can see that DPC calls are always serviced on core 0 regardless of affinity settings...


Josef

Thats intesting, if USB connected drivers without IRQs are defaulting to CPU 0 maybe it would be better to shunt all of the systems background IRQs off to CPU3 then and assign 0,1 and 2 for the music. Hummmm....

Nick.


Title: IRQ and Cores
Post by: PeterSt on October 12, 2010, 11:15:32 am
I spent some time observing the 4 core cpu behaviour, and tried to "balance out" things as much as possible. Just a technical approach, but I also think what I ended up with sounds the most normal to me.

So, 2.9GHz per core, Core Appointment Scheme = 3, Player Prio to Low and Thread Prio to Real Time.
Kernel Streaming Special Mode, Driver Buffer Size of sound card = 1024, Device Buffer Size in XX = 1024, Q1 = (1) latency of 32 samples.

Important :
What I now noticed, is that the driver runs in Core #3. IOW, I wouldn't bother much about those interrupt settings, because this is just how it works out with a 4 core processor. Besides that, all the loading stuff is in Core#1 (incurred for by Scheme-3), the Playback Thread in in Core#2 (ditto), and any additional whatever Vista stuff pops up in Core#4. Notice though this does not count for things you start during playback, because at that moment this is not under my control. So that appears "everywhere" (Affinity and "the more stuff" is to all Cores by default).

So ... What you see below in Driver09 is the most balanced and low cpu useage I could find in two hours of time (the combinations are endless of course). Also notice that this is 16/44100 Octo Arc Predition Upsampled (to 32/352800), and the 32 bits internal latency may not be reachable by you even at a lower output sample rate. Don't think "ok, then I make 64 of that 32 samples", because everything changes; not only the Playback Core, but also the Driver Core.
The "Update Speed" in TaskManager is to be set to "High", because otherwise the Driver Core is flattened too much and the various settings won't differentiate (much).

Again, just some technical approach, but as said, I imagine that things sound the most normal at the same time.

Lastly, notice that I used Special Mode because of the additional detail that brings, but also because Adaptive Mode won't bring such a nice cpu graph.
Engine#3 can bring even better pictures, but because of the different working of Q1 *and* the subjectiveness to sound for a certain Q1 setting, I don't think it is useful to approach this in this technical fashion.


Some additional remarks :

Although Scheme-3 appoints Affinity to all processors there's more under the hood, which dictates things to certain processors anyhow. But, for the Driver09 picture I manually put Affinity for TaskManager to Core #1 (careful, because "technically" this is Core#0 but I don't speak like that in here). So, this makes sure it doesn't interfere with the Playback and Driver Core for these pictures and story. But now look at Driver10 below;

What I suddenly learned is that this behaves the same as W7, and the updating of the TaskManager Graph stalls at a track load. This *also* makes comparison with W7 graphs and Vista Graphs tedious, because in the normal situation (TaskManager has affinity to all Cores) it looks like Driver11 below. So, it looks like the loading takes longer, but it is really the Graph which keeps on being updated.
This, while I at first thought it really took longer under Vista, which for me went along with the change of processor (from E6600 to i7/870). Also notice that I applied Nick's "priority tweaks", which *thus* don't end up in W7 behaviour (this needs a bit of upside down thinking), and W7's priorities just *are* dealt with differently.


Hope this is beneficial to someone.
Peter


Title: Re: IRQ CPU Affinity Setting
Post by: manisandher on October 12, 2010, 11:23:40 am
If you have time (or can pull yourself away from listening to the new setup ;-) ) it would be useful if you could run the hyperthreaded test we talked about on you i5 processer. Something tells me there could be a real sweet spot here wait to be found.

i5? F-off. It's an i7. (Sorry, a particular scene in 'The Life of Brian' sprang to mind.)

Yeah, I don't think I'm going to be able to stop myself from trying this. It's interesting looking at the Performance Monitor - few IRQs get shunted to CPU1. For example, before setting affinities, Latency Checker ran on CPU1 - now it runs on CPU0. Whatever, the sound is crystal clean now.

Mani.


Title: Re: IRQ CPU Affinity Setting
Post by: Josef on October 12, 2010, 01:30:30 pm
Thats intesting, if USB connected drivers without IRQs are defaulting to CPU 0 maybe it would be better to shunt all of the systems background IRQs off to CPU3 then and assign 0,1 and 2 for the music. Hummmm....

Yes - In theory, it makes a lot of sense because IRQ is only part of the story - In fact, IRQs most times won't actually _do_ much but rather schedule a DPC call which 'does the real job'.

Unfortunately, AFAIK DPC affinity cannot be influenced by user - it is set in driver code :(

Still, practice shows (at least for Transit driver) that DPC goes to core 0 all the time and it is sound-driver DPC we care most about as it probably makes sense to make sure it's _not_ interrupted ever!
 
Hence, sound-card IRQ should be 'solo' (because it generates most interrupts by far - assuming you have already made your setup 'quiet') and on a dedicated core but not on core0 because we want sound driver DPC to be un-interrupted at all times.

Again, this is all in theory and just trying to make sense of what is going on: I wish I had a quad & six-core to experiment :)
 


Title: Re: IRQ CPU Affinity Setting
Post by: PeterSt on October 12, 2010, 02:30:34 pm
I only now realized that my earlier post ended up in the wrong topic. So I merged it in here now. See a three posts back.


Quote
Yes - In theory, it makes a lot of sense because IRQ is only part of the story - In fact, IRQs most times won't actually _do_ much but rather schedule a DPC call which 'does the real job'

Something similar or the same (:scratching:) ... won't a task be scheduled on the same core the IRQ went to ?
This is what I anticipated on a bit with my previous post.

Peter


Title: Re: IRQ CPU Affinity Setting
Post by: Josef on October 12, 2010, 04:11:35 pm
... won't a task be scheduled on the same core the IRQ went to ?
This is what I anticipated on a bit with my previous post.

Peter

That would be best but unfortunately is not what I saw last night: Most active IRQ was well-balanced between cores 0 & 1, while all DPC calls to MAudioTransit happened on core 0....(It might be specific to this driver though.)

And same thing happened with Foobar so it does not look it's XX-related...

I think I will have to disable all USBs apart from OffRamp connection, apply Nick's affinity tricks and see what happens in that case....


Title: Re: IRQ CPU Affinity Setting
Post by: PeterSt on October 12, 2010, 04:23:55 pm
Ah, no, wait ...

You have two cores, right ? Well, I before had too. So, my actual message in the before post was : "Hey ! the driver goes to Core#3 !" (#2 in technical terms). An you know, I don't do anything for that (I wish I could at this moment).
Similarly, all other OS stuff seems to go to Core#4.

So ... It seems that -including the stuff I *do* apply- the OS thinks that #3 and #4 are completely free, and next thinks that driver stuff better goes on its own core while it's available anyway. All in other words :

I don't see what can - or should be improved on this (but keep in mind, Scheme-3), and the only thing is it needs 4 cores. Or more (but I can test that by switching on HyperThreading).

But also : I don't see the actual interrupt requests, but I assume (and this is the other way around as how I presented it in the last post) that the process takes place on the core which receives the request.
I guess this can be checked too, but then I must apply some IRQ appointment. Hey, wasn't I about to implement that some two hours back ? hehe

Peter


Title: Re: IRQ CPU Affinity Setting
Post by: PeterSt on October 12, 2010, 06:20:34 pm
Hmm ... Is this more complicated than it looks, or doesn't it work, or what ?

I possibly did the other way around of what you all did, and I only appointed my Audio Device. To the first Core in this case. With IntFiltr.
The Audio Device couldn't be restarted, so I rebooted.
After that the third Core (where I found the driver to run in), was at near 100%, while no process could be dedicated to that (hence was not te be found). Thus, "something" was doing it, and I bet it was the driver, because there wasn't sound either.
After this I appointed the driver to the 2nd Core, (rebooted) but no difference.
Then I removed the filter, and luckily after a reboot all was right again.

Next I tried IntPolicy;
Specified irqPolicySpecifiedProcessors, ticked the first "CPU", and rebooted.
All ok this time, but all showed the same as before during playback (driver runs its task in the 3rd Core).
So, maybe the interrupts go to the first Core now, but what I'm interested in is where the driver takes its CPU cycles; As said earlier, that's on the 3rd Core and in consistency with the other stuff exactly what I would want. But for a two-Core machine, I'm sure (by now) that the driver runs in the 2nd Core, which is the same where the playback is going on. And this is *not* what I'd want. On the other hand, if that would be moved to the first Core (if possible at all), the loading may interfere with SQ (because it interferes with the driver).

2c for now.
Peter


Title: Re: IRQ CPU Affinity Setting
Post by: manisandher on October 12, 2010, 06:39:02 pm
Silly question - did you read the 'READ ME' file? There are a couple of things you need to do manually to get IntFiltr working properly.

Mani.


Title: Re: IRQ CPU Affinity Setting
Post by: PeterSt on October 12, 2010, 06:55:16 pm
You better ask whether I read your earlier post about that. Yes I did.
If not I would have tripled over that one. :)


Title: Re: IRQ CPU Affinity Setting
Post by: Marcin_gps on October 12, 2010, 10:13:07 pm
I managed to play with 4 cores on my thin Vista build, but it sounds very bad compared to dual core cfg. I don't know whether it is driver related and my card likes two cores better than four or is it because of some optimisations, but I don't recall anything like that (besides win32separation...)

But I discovered sth interesting regarding SFS - completely reverse situation - smaller values like mani's 50MB works much better than very large like my favourite 450MB. Anyway I'm back to 2 cores again and it souns so freaking awesome.

I'll check this on my new machine that I'm building next month. This time it will be intel, so maybe that will shed some light on the sfs and multicores case.

have a nice night
Marcin


Title: Re: IRQ CPU Affinity Setting
Post by: Nick on October 12, 2010, 10:19:34 pm
Hi Marcin,

Interesting results, glad the 2 core build is running so well though.

What Intel based machine do you have in mind ?

Nick.


Title: Re: IRQ CPU Affinity Setting
Post by: Josef on October 12, 2010, 11:01:21 pm
Ok, I braved to try this affinity trick but it does not work :(
The tool displays a weird error message - see screenshot. I rebooted, looked in registry and see that values are indeed there (screen2) - But if I start tool again I get same error: WTF?


Title: Re: IRQ CPU Affinity Setting
Post by: PeterSt on October 13, 2010, 12:03:50 am
With a bit of mangling, I think I copied this, although I didn't awaiten the real error (hence made my mangling undone before more worse things happen).

I too now have a same situation like you, with N/A for the current assignment, while clicking Advanced comes up with 4 (specifiedprocessors).
I did this by asking for this 4 with another device, and next delete the mask for this other device. Now somehow this 4 acts as a default, and I think it's really in the Registry for this next device now. But, current assignment shows N/A. Remedy ? I think an explicit Delete Mask. And then start over for the device in question.

But it all looks a bit tricky. Similarly, IntFiltr always shows N/A right from the start, while IntPolicy clearly shows something is there. So, before you know it, with IntFiltr you removed something which really was there (an explicit "all processors"), without notice.

Be careful.
Peter


Title: Re: IRQ CPU Affinity Setting
Post by: Marcin_gps on October 13, 2010, 12:12:26 am
Hi Marcin,

Interesting results, glad the 2 core build is running so well though.

What Intel based machine do you have in mind ?

Nick.


Title: Re: IRQ CPU Affinity Setting
Post by: PeterSt on October 13, 2010, 12:14:26 am
Quote
But I discovered sth interesting regarding SFS - completely reverse situation - smaller values like mani's 50MB works much better than very large like my favourite 450MB. Anyway I'm back to 2 cores again and it souns so freaking awesome.

Marcin, thanks.

Mani, are you still running on 2 cores ? (you did before, I know).
Just asking, in an(other) attempt to get my finger behind this.

Peter


Title: Re: IRQ CPU Affinity Setting
Post by: manisandher on October 13, 2010, 10:59:58 am
Peter, I'm on 4 cores, with no HT.

I'm interested in what you think might be going on...

Mani.


Title: Re: IRQ CPU Affinity Setting
Post by: PeterSt on October 13, 2010, 12:11:07 pm
You tell me ! haha

The only hope I have is that 0.9z-3 solves it. Well, the variation in SQ. Next is : did I choose the right setup.
But I think that from 0.9z-3 better conclusions can be drawn. We'll see.
If I ever upload it of course.

Peter


Title: Re: IRQ CPU Affinity Setting
Post by: Nick on October 13, 2010, 07:31:10 pm
Guys,

Just thinking out loud here, I read the ms doc again and it mentions that from vista sp1 onwards there is explicit support for setting interrupt affinity. I am on vista sp0 without this support and using intfilter has not results in errors or problems.

Mani your install was also straight forward what 2008 sp level are you running ? It would be good to understand what is causing the inconsistent installation behavior.

I have had a couple of days off but am planning to take a look as well at processes too. I looks like we are all getting some unexplained logic on where process end up.

Peter out of interest did you get the sound improvements that Mani and I experienced ?
Nick.


Title: Re: IRQ CPU Affinity Setting
Post by: PeterSt on October 13, 2010, 10:38:36 pm
Nick - Vista SP1 here. Sound improvements ? I am not sure (honestly). All I know is that I'm completely satisfied, and applied more "tweaks" at the same time than I usually like (for good judgement). I also recognize that albums sounding great before but didn't lately, do that again now. But it's a bit apples and oranges because I must be comparing Engine#3 from before to Engine#4 from today - and even do that with Special Mode (which goes the direction of Engine#3 but still is very different).

Notice though I couldn't proceed on IRQ Affinity, but also "see" it's not necessary for a 4 core system, as explained.
What I do know more and more is that W7 is total sh*t; In there actually nothing wants to work, and it's all tradeoffs. Not so here (Vista). It really feels like good old days, never mind it wasn't all that long ago. Man, you don't want to know how important it is (for me) to improve on things, rather than trying to get rid of annoyances. W7 just comprised of the latter. Not good, I know now. I hope we all do. a

Stay away from power-outs now Nick.
Best,
Peter


Title: Re: IRQ CPU Affinity Setting
Post by: manisandher on October 13, 2010, 11:37:04 pm
Mani your install was also straight forward what 2008 sp level are you running ?

Hi Nick, I'm running W2008 SP1 (Build 6001).

As for improvements in SQ - well, I'm pretty certain that the IRQ tweaks did help towards an even 'cleaner' sound (even if Peter doesn't think they can/should make any difference with 4 cores). Certainly, the 'bloating' or excessive bass that many people (me included) have noticed on switching to Vista/W2008 has been eliminated. KS-Adaptive sounds great - I don't have to switch to KS-Special or Engine#3 to 'fix' anything, because there is nothing to fix.

As I've mentioned before, I'm running a trial version of W2008 and will be installing a licensed copy at some point. I'll try to document the affect (if any) of each tweak after it's been applied and figure out which ones really make a difference.

Mani.


Title: Re: IRQ CPU Affinity Setting
Post by: Nick on October 14, 2010, 10:38:04 am
So IntFiltr install glitches are not likely to be service pack related I guess.

Peter,
Thankfully I’m running nothing on SSD at the moment so I hope power cuts will just remain a simple annoyance not a data nightmare (I feel your pain).

Regarding sound changes, I wonder if your DAC electronics being so optimised means  that the OS changes do not make the same level of difference. If your electronics are well clocked and locked on the stream it might be your system has better tolerance to OS induced jitter and timing errors. Just thinking out loud.

Mani,

After reading Peters earlier XX internal settings, I thought I would try special mode again (At last I have understood how to set buffers size and latency for special mode correctly). What I found was I could get 95%+ of the organic quality of Adaptive mode with much better resolution and rightness of tone. Even more like vinyl.

On the HiFace I set the XX buffer size to 2048 but found that the lowest Q1 latency was definatly not where the sweet spot is;

Set Q1 to get 2 sample latency and played with SFS arround 70 - 90 = Much too thin souding and  hyperdetailed

at 4 samples latency and SFS between 70 and 90 = better but nowhere near right

8 samples approaching adaptive mode sound only losing a tiny amount of resolution (or it might be that the forwardness of the lower latency settings is dropping out of the sound)

16 samples hit the sweet spot ! – organic, detailed, smooth and engaging. The surprising thing was just how sensitive getting the sound right was to SFS setting. I had to spend a lot of time on SFS at each latency to get the best sound. In the end I was making changes of 1 and 2 Mb and getting subtle but very important changes in the sound. The end result is all the Adaptive quality but with the resolving power and wonderful presence of Special Mode.

I know you are a fan of Adaptive Mode but it may be that the OS changes enable Special Mode to do this.
Nick.


Title: Re: IRQ CPU Affinity Setting
Post by: PeterSt on October 14, 2010, 11:10:05 am
Hi Nick - Thanks.

On the Special Mode : I certainly think the OS (Vista) allows for this now. A bit difficult to judge for me, because the processor (spread !) power is different for me at the same time, although net that power (of one core) should be less compared to what I had.

Quote
Regarding sound changes, I wonder if your DAC electronics being so optimised means  that the OS changes do not make the same level of difference. If your electronics are well clocked and locked on the stream it might be your system has better tolerance to OS induced jitter and timing errors. Just thinking out loud.

Nah, don't think so;
It is more important (for me, or for you to get my "message") that I changed too many things within a too small period of time to really judge it to its merits. So, I'm not saying I don't hear the difference, all I'm saying is that I can't dedicate it to those "timing" tweaks. I just don't know !
BUT, as I said, it looks like I'm completely satisfied.

But also, like Flecko just pointed out in the other topic (With RAMDisk and Special Mode: Scheme 3 or Scheme 2 ? (http://www.phasure.com/index.php?topic=1419.msg13600#msg13600)): change the Appointment Scheme and you again will know there's more to do (or again more to it).
Too many variables. haha.

Peter


Title: Re: IRQ CPU Affinity Setting
Post by: manisandher on October 14, 2010, 12:04:34 pm
I know you are a fan of Adaptive Mode but it may be that the OS changes enable Special Mode to do this.

The issue I have with Special mode is that I can't use low buffer sizes - pretty much the whole point of using Special. You see, I've recently switched to using a Weiss AFI1 interface, which uses a firewire connection. I can't use it below 256 samples with Special and Quad Arc Prediction. (Even if I switched QAP off, I doubt I'd get down to 64 samples.) Certainly, my preference is Adaptive over Special-at-256-samples. In this respect, my RME card is much better - perhaps I should give it a go with Special mode...

Mani.


Title: Re: IRQ CPU Affinity Setting
Post by: manisandher on October 14, 2010, 12:30:08 pm
Too many variables. haha.

I think this happened when you first introduced Q1... haha.

I don't want to sound like a broken record (pun intended), but this is why I've adopted my system of comparing the sound of playback to that of vinyl. But not in a haphazard way, rather a more systematic way. The method requires a good analogue source (I would love a top-end open-reel machine, but use instead a reasonably good turntable) and also a good ADC/DAC (fortunately, I have one of the best ever made).

So, here are the steps:
1. make a digital recording from a good LP (preferably 45rpm) - I usually make three different recordings at 16/44.1, 24/88.2 and 24/176.4
2. listen to the vinyl being played back through the ADC/DAC, set to one of the recording resolutions, say, 16/44.1
3. listen to the same resolution recording, in this case 16/44.1, being played back through XX
4. adjust parameters in XX until the playback sounds as close to vinyl as possible

It sounds like I'm doing AB comparisons, but I'm not (actually, switching between DAC and ADC modes on the Model Two takes a few seconds). In any event, I tend to play a whole track one way and then listen to it again the other way.

Now, I concede that this is not a totally scientific way of doing things (e.g. is the vinyl source good enough?, is the recording software good enough?, is the rest of my system up to resolving any minor nuances?, etc) BUT...

... I would have gone mad changing all the XX parameters ad infinitum were it not for this method. My method lets me know where I am now and how far I still have to go.

Mani.


Title: Re: IRQ CPU Affinity Setting
Post by: PeterSt on October 14, 2010, 08:21:58 pm
Hmm ... Back on Adaptive Mode here ...
I won't change my sig yet, but there's too much that still sounds "stressy" here, and I can't miss the bass ... :no:


Title: Re: IRQ CPU Affinity Setting
Post by: Marcin_gps on October 20, 2010, 09:28:35 pm
Hi guys,

Finally I tried this tweak on my machine and I'm not sure if like it. I get more details and clarity but I got a feeling that the sound is somehow sharp/bright. I have to listen more and maybe fine-tune Nick's recommended settings.

Thanks a lot for your effort Nick!

Cheers
Marcin

-EDIT

I hope that Peter's announcement about fixing the SFS is going to do the trick, because I like the increased level of details, deeper soundstage, but I miss the body and punch. Now I can listen at about 20% louder levels whitout any sense of fatigue, which is a good thing  (I guess).


-EDIT2

Nick, so what's your present XXHE settings (Q1, buffer size and SFS)?


Title: Re: IRQ CPU Affinity Setting
Post by: Nick on October 20, 2010, 11:37:21 pm

Nick, so what's your present XXHE settings (Q1, buffer size and SFS)?


Marcin hi,


I have updated my signature after reading Mani's reminder  :)

EDIT

SFS is at 83 at the moment for me which gives a balance of detail without sound becoming too thin. Sounds like Peter has some suprises for us though regarding SFS  :)

EDIT


Nick.


Title: Re: IRQ CPU Affinity Setting
Post by: Marcin_gps on October 20, 2010, 11:45:03 pm
Thanks, maybe increasing the buffer size is a good thing now, I'll check that.
I have to tell you, that after playing with IRQ affinity tool, I checked my sound card resources in device manager and I was amazed to see that it uses dedicated IRQ now - 11. (previously 23). I'm not sure it was the IRQ affinity settings though, because I haven't checked the IRQ of my card for a while now and in the mean time I applied a lot of tweaks, including disabling the whole bunch of devices - 'regular', system and hidden.


Title: Re: IRQ CPU Affinity Setting
Post by: Nick on October 21, 2010, 12:10:27 am
Marcin,

Weird but good news.

Out of interest you use PCI Lock (Control Panel > Administrative Tools > System configuration > Boot > Advanced Options)

http://www.osronline.com/ddkx/ddtools/bootini_419v.htm

Nick.


Title: Re: IRQ CPU Affinity Setting
Post by: Marcin_gps on October 21, 2010, 10:22:17 am
No, I don't use it, I tried it, but didn't work. Windows assigned virtual IRQ to my sound card at first startup and I couldn't do anything about it.


Title: Re: IRQ CPU Affinity Setting
Post by: Marcin_gps on October 21, 2010, 12:45:26 pm
After many hours of listening, I'm disappointed with these affinity tweaks. The sound is to bright. I went back to my reference settings and the magic is back :)

IRQ8Priority=1
Win32Separation=28(40)

I tried IRQ11Priority, which is the IRQ of my sound card, but I didn't like the sound. (of course not parallel with Nick's affinity tweaks)


Title: Re: IRQ CPU Affinity Setting
Post by: Marcin_gps on October 22, 2010, 06:46:59 am
I wouldn't be myself if I hadn't checked this again - yep, I'm crazy  :grazy: Anyway, this time I decided not to stick to Nick's settings and went a little bit wild applying almost everything to CPU0 (I left CPU, motherboard resources untouched though) and for sound card as well as PCI bus, I set mask to use two cores.  The result exceeded my expectations. So many details, but what struck me the most was the level of background information. I was listening to Diana Krall (24/96) and I couldn't believe my ears, I asked myself - 'is this noise'? Yep, noise from a mic is very clear now, later I played other hi-resolution stuff and I got the same feeling. This time nothing sharp about the sound. I think these settings could be fine-tuned, but I have to do a little research or perhaps you could tell me, what devices 'need  juice' during XXHE playback for PCI card. Maybe 'ati i/o communications processor pci bus controller'?

Cheers,
Marcin


Title: IRQ and Cores (2)
Post by: PeterSt on October 23, 2010, 01:48:47 pm
Referring to this post : IRQ and Cores (http://www.phasure.com/index.php?topic=1410.msg13527#msg13527) (look at the first picture in there) ...

I changed nothing to anything, except for that I changed the soundcard from PCI slot, that by itself causing the driver to (automatically) reinstall.
Now the driver is running in the 4th core, while before it was in the 3rd.

This will (?) tell that there's some "division" of Cores over PCI dealt-with slots, which may go over (via) the interrupt assignment to PCI slots.
Fact is, that if we are as far that the IRQ stuff for the soundcard (and/or the possibly related Core the driver code runs in) matters for SQ - the PCI slot used will matter to sound quality. Maybe if I change the card to another slot again, it will run in the same Core as the Sound Engine runs in ?

Anyway, where I said earlier that all automatically goes "just as I want with 4 Cores", this can't be said anymore.
This definitely makes the IRQ subject an important subject (again).

Peter





Title: Re: IRQ CPU Affinity Setting
Post by: Marcin_gps on October 23, 2010, 03:01:30 pm
And from my experience once you apply your own affinity settings, there is no guarantee that system asign that same values if you decide to go back and remove your masks. I could swear that after messing with that settings, going back resulted in different sound.


Title: Re: IRQ CPU Affinity Setting
Post by: Josef on October 23, 2010, 03:37:07 pm
Quote
This will (?) tell that there's some "division" of Cores over PCI dealt-with slots, which may go over (via) the interrupt assignment to PCI slots.

Cores are oblivious to both slots & interrupts.

AFAIK every PCI slot has multiple interrupts assigned (think 4) and each PCI card can use as many as it needs. But those interrupts are not what you see in OS. Hardware PCI IRQs are mapped via IRQ router on your motherboard into IRQs you see in OS.

In theory, you may be able to fix PCI IRQs mappings from your BIOS but that is not guaranteed to work as Windows is Plug-n-Play OS and can shift IRQs around as it sees fit. You may try disabling PnP of course, but that could lead to all kinds of other problems and in any case there is no need for any of this.

I may be wrong on some of the above (not my field) but it really is not that important for our needs as there is not much we can do about that process except to keep in mind that different PCI slots by design get mapped to different IRQs (as you just found out) so if you move stuff inside your machine you may need to re-visit Interrupt Affinity tool.

What is important from our perspective is where IRQs are handled in the end as, by they nature, they will _interrupt_ anything that is going on at the moment. And we probably don't want music player process being interrupted just when it is busy filling sound card's buffer especially if we are using ultra low latency do we?...
What follows is that higher latencies (=Adaptive mode) may not be as much affected as Special mode (may not even be perceptible although I believe it is) but as a matter of principle it makes sense to move everything possible out of time-sensitive process i.e. particular CPU core.

Since Windows by default will not give any guarantee which CPU will handle particular IRQs (as it tries to balance it out evenly between cores theoretically it could even switch it _during_ playback) that is the reason why we need Interrupt Affinity tool: to bring order to chaos and make sure time-sensitive things are not needlessly interrupted all the time.
 

 


Title: Re: IRQ CPU Affinity Setting
Post by: Marcin_gps on October 29, 2010, 11:56:23 am
Peter, could you tell me how to assign affinities of processes other than Engine3 to CPU0, so they wouldn't go back to CPU0,CPU1 and CPU3 every time I start Engine3? I don't want other processes to collide with my sound card driver, which occupies CPU2 and CPU3. Can I do this myself?

Greets,
Marcin


Title: Re: IRQ CPU Affinity Setting
Post by: PeterSt on October 29, 2010, 12:07:21 pm
I think your only option would be to use Scheme "Nothing" and do it all yourself. But I'm afraid there's nothing available for that (like it is for the IRQs). So it would be a manual thing after each reboot plus you'd have to do XXEngine3.exe each time. Nothing much workable ...


Title: Re: IRQ CPU Affinity Setting
Post by: blaine78 on March 27, 2011, 11:48:39 am
Thanks for this advice. Has really made a BIG difference for the better here. much cleaner and focused, and yes, less jittery sound. Am using an i3 intel 2 core cpu with hyper threading disabled and having 2 real cores to play with. I have my audio player, USB audio driver and USB composite driver all running on the same one core rather than being split over 2. the difference is HUGE.


Title: Re: IRQ CPU Affinity Setting
Post by: PeterSt on March 27, 2011, 11:54:33 am
Ha, nice wakeup of this topic;

Quote from: PeterSt
But I'm afraid there's nothing available for that

Well, since we're talking about 24 core systems by now (or 12 to keep it more "normally") this for sure will be in a next version now.
It's only one of the things which can be done ...

Peter


Title: Re: IRQ CPU Affinity Setting
Post by: Nick on March 27, 2011, 10:43:18 pm
Ha, nice wakeup of this topic;

Quote from: PeterSt
But I'm afraid there's nothing available for that

It's only one of the things which can be done ...

Peter

Hi Peter,

Your proberbly aware but PCIE latency may be also be good place to focus in code as well. I'm finding a pcie latency of about 128 on the Jul@ card ( or usb interface for a hi face ) is worthwhile. Using a utility you can set the audio device to a different latency to other devices which run at BIOS default (often 32).

Nick.