Skip to main content
Topic: Thread Priority (Read 10186 times) previous topic - next topic
0 Members and 1 Guest are viewing this topic.

Thread Priority

Hello,

How can I increase Foobars Thread Priority?
I get choppy playback when using a torrent client sametime with Foobar.

Thanks!

~HaiDozo

Thread Priority

Reply #1
Hello,

How can I increase Foobars Thread Priority?
I get choppy playback when using a torrent client sametime with Foobar.

Thanks!

~HaiDozo

Type this into notepad:
Code: [Select]
start /high C:/Progra~1/foobar2000/foobar2000.exe

Save it as "Start Foobar2000 High Priority.cmd" in your Foobar folder or something, and create a shortcut to it. That shortcut will start you command prompt which will start Foobar in high priority.
Les mots d'amour...

Thread Priority

Reply #2
Thanks, I'll do that.
Is there no setting in the GUI then?
I saw a setting for it in the Wiki but I just can't find it in my version of Foobar. Maybe it's only available in a BETA version?

Thanks.

Thread Priority

Reply #3
You can set the priority of the playback thread on the "Advanced" preferences page.

Thread Priority

Reply #4
You can set the priority of the playback thread on the "Advanced" preferences page.

When I look at the advanced page, it says I can choose 1-7...and 7 is "below normal" or am I wrong?
Les mots d'amour...

Thread Priority

Reply #5
I assume you are referring to the base priority table in the Scheduling Priorities article on MSDN. The base priority is not something you can set directly, it is derived from the process priority class and the thread priority level. The "Thread Priority" setting on the "Advanced" page is mapped to a thread priority level, where the default value 7 corresponds to THREAD_PRIORITY_TIME_CRITICAL. Unless you set the process priority class to realtime (not recommended), this will give the playback thread a base priority of 15 which is the highest possible value for non-realtime processes.

Thread Priority

Reply #6
To the OP: Before suspecting a thread priority problem, could you tell us more about your hardware (CPU, chipset, audio and network hardware)?

Thread Priority

Reply #7
My hardware is:
CPU: 2GHz Intel Celeron (Northwood)
Motherboard: ASUSTek P4S8X (rev1)
Chipset: SiS 648 (rev 2)
Audio: Built-in Soundblaster compatible (C-Media AC97[driver 2005-04-12 / v 5.12.1.48]).
Network: Built-in 100Mbit (or gigabit) SiS 900.
Memory: 512MB DDR

It's old, yes, but it shouldn't have any problem playing MP3s.
I'm suspecting Thread Priority because:
WinAmp plays just fine, no breaks or cracks (during the same scenario ofcourse).

I used to get choppy playback in my media player [MPC] (during this same scenario with bittorrent [uTorrent]) and I found a setting called "Process Priority above normal", after applying it in MPC playback hasn't been the least bit choppy since then.

Thread Priority

Reply #8
Hmm.. Could there be some buffer settings or something like that, that might improve playback?

Thread Priority

Reply #9
To the OP: Before suspecting a thread priority problem, could you tell us more about your hardware (CPU, chipset, audio and network hardware)?

Indeed; thread priority is almost never (if not never) the cause of choppy playback and similar problems...decoding. The iPod has a 80Mhz CPU and it can decode mp3's...now I know iPod ? computer, but something must be very messed up if the cause of choppy playback is too little CPU-power...
Les mots d'amour...

Thread Priority

Reply #10
My gf has a somewhat similar setup.

CPU: Celeron 2.67G
Mainboard: don't know Compaq OEM guess it's MSI (base on similar layout).
Chipset: 845GL (845G with no AGP).
Audio: onboard audio (don't remember which brand though).
Network: Intel 100M.
Mem: 512M.

And guess what same problem as the OP (play music with foobar and open Word then stutter). Windows XP is clean right after I install it. The way I install Windows and stuff is the same as for my computer. My computer doesn't have any problem (at that time AMD Sempron 1.5G 2200+ T-bred 512M RAM with VIA KM400A chipset sound VIA onboard) so I think the culprit is the CPU. I borrow a P4 Northwood 1.8G from a friend and replace the thing then everything is ok. Don't know what Intel strip out of Celeron to make it works that bad.

Thread Priority

Reply #11
IIRC Intel whacked the L2 Cache on Celery's. If it is cache-related, you can try increasing the buffer something mighty.

Not-really-related, the thread priority in fub2k's advanced prefs, 1 = lower, and 7 = higher, am I right?

Thread Priority

Reply #12
This quote:

Quote
While Windows has always supported prioritization of CPU usage, it hasn't included the concept of I/O priority. Without I/O priority, background activities like search indexing, virus scanning, and disk defragmenting can severely impact the responsiveness of foreground operations. A user launching an app or opening a document while another process is performing disk I/O, for example, experiences delays as the foreground task waits for disk access. The same interference also affects the streaming playback of multimedia content like songs from a hard disk.


taken from this article:

http://www.microsoft.com/technet/technetma...el/default.aspx

While admittedly this article focuses on hyping Vista's improvements (and under no circumstances am I recommending Vista), it might point to your problem, maybe more ram will solve the problem? just a guess.

Thread Priority

Reply #13
What's interesting is that WinAmp (with all it's bloat) works fine. I'm starting to think that Foobar might be poorly programmed (as in not efficient code).

Thread Priority

Reply #14
Are you using any plug-ins? (like maybe Track info panel 0.8?)
Because it might be (very much more likely) that one of them is programmed poorly.
elevatorladylevitateme

Thread Priority

Reply #15
What's interesting is that WinAmp (with all it's bloat) works fine. I'm starting to think that Foobar might be poorly programmed (as in not efficient code).


Horse hockey. Foobar uses 0% of my cpu most of the time as reported by Task Manager, jumping to 2% at times. That's normal for a broad range of cpu's. I've never had playback problems, going all the way back to the Celeron 566 I had years ago when I first started using Foobar.

If you're getting higher usage, the usual culprit is the Trackinfo plugin. From memory, you need to go into the plugin preferences and change Steps to its lowest setting.
That's so plausible, I can't believe it.

Thread Priority

Reply #16
To be honest, I have experience this behavior not only on one computer but at least 2 computer using the same kind of CPU (Intel's Netburst based Celeron CPU). And yours (DustMagnet's) is certainly a Coppermine based (P3 based) that performs much better at the same core clock as Netburst microarchitecture.

Foobar is not the only one application having this problem h264 also performs poorly on Netburst based Celeron. An 2.67G Celeron can't run 720p h264 with CoreAVC but a 1.8G Northwood or T-bred 1.5 can play it just fine.

Thread Priority

Reply #17
I haven't got TrackInfo but I do have Equalizer and Advanced Limiter active. Maybe those two are causing the slowdown, I'll test it next time I'm using BitTorrent.

I guess it could be that my Celeron isn't compatible with Foobar. I'll be buying a new conputer soon, so that might fix this minor annoyance. Although that's not a good way to fix a problem (patch fix, instead of going to the root and fixing it).

Thread Priority

Reply #18
Foobar is not the only one application having this problem h264 also performs poorly on Netburst based Celeron. An 2.67G Celeron can't run 720p h264 with CoreAVC but a 1.8G Northwood or T-bred 1.5 can play it just fine.
Audio and video decoding are two different leagues regarding the performance that is required for each.

Quote
Not-really-related, the thread priority in fub2k's advanced prefs, 1 = lower, and 7 = higher, am I right?
Correct.

Quote
Hmm.. Could there be some buffer settings or something like that, that might improve playback?
You can set the length of the audio output buffer in the preferences (Playback > Output).

Thread Priority

Reply #19
Ok, I've done further testing under heavy load.
It seems that the Thread Priority that you can set inside and outside Foobar (with various tools and also with the TaskManager "Ctrl+Alt+Del") only affects the GUI.

Setting the priority to 24 "Real time" makes the GUI very responsive, even under heavy load, however the audio still cracks.

It would seem that the decoder part of Foobar is a separate process (plugin?), so there needs to be a way to modify the priority of the decoder (my testing only includes MP3).

The "Thread Priority" setting in Foobar is in this case quite useless as it's the music that's most important. In my opinion the GUI can be slugish as long as the music is stable (not to mention the setting only goes to 7, it should go to 24, it is afterall in the "Advanced" tab).

Is there a "Wish List" or some such feature available?
I would very much like to see a Priority setting for the decoder in the Advanced tab

~HaiDozo

Thread Priority

Reply #20
Ok, I've done further testing under heavy load.
It seems that the Thread Priority that you can set inside and outside Foobar (with various tools and also with the TaskManager "Ctrl+Alt+Del") only affects the GUI.

Setting the priority to 24 "Real time" makes the GUI very responsive, even under heavy load, however the audio still cracks.

It would seem that the decoder part of Foobar is a separate process (plugin?), so there needs to be a way to modify the priority of the decoder (my testing only includes MP3).
The Thread Priority setting in the Playback branch in the Advanced preferences affects only the priority of the playback thread. This thread is used to run the decoder, the DSP effects, and the output.

Have you tried changing the output buffer length or the output mode (DirectSound, Kernel Streaming, ASIO)? If you haven't changed these settings, could you still tell us how you have set them?

The "Thread Priority" setting in Foobar is in this case quite useless as it's the music that's most important. In my opinion the GUI can be slugish as long as the music is stable (not to mention the setting only goes to 7, it should go to 24, it is afterall in the "Advanced" tab).
There is a reason this setting only allows the values 1 to 7. Unless the priority class of a process is set to realtime, the priority level of a thread within that process may only take on seven distinct values. *hint hint nudge nudge*

Thread Priority

Reply #21
Have you tried changing the output buffer length or the output mode (DirectSound, Kernel Streaming, ASIO)? If you haven't changed these settings, could you still tell us how you have set them?

I have played with various Buffer Lenght values (even extreme) but I see no difference.
I haven't touched "Output Device" or "Output Format", they are default, "Primary" and "16bit" rerspectivily. Dither is Off.

There is a reason this setting only allows the values 1 to 7. Unless the priority class of a process is set to realtime, the priority level of a thread within that process may only take on seven distinct values. *hint hint nudge nudge*

Aww.. that sucks. Is it a Windows limitation? Surely there must be a way to increase priority on the decoder only?

Thread Priority

Reply #22
Read more here and its related articles about thread.

Thread Priority

Reply #23
HaiDozo, maybe your HDD is in PIO.
Check your Device manager's Primary IDE Controler's DMA Mode (second tab).
It should be UDMA-3 at least.

 
SimplePortal 1.0.0 RC1 © 2008-2019