Demon
Register | User Profile | Member List | F.A.Q | Privacy Policy | New Blog | Search Forums | Forums Home
Doomworld Forums : Powered by vBulletin version 2.2.5 Doomworld Forums > Classic Doom > Source Ports > Running SDL ports on multicore processors
 
Author
All times are GMT. The time now is 06:06. Post New Thread    Post A Reply
Quasar
Moderator


Posts: 5956
Registered: 08-00


If you have a multicore processor, the Windows versions of SDL-based DOOM ports may suffer random sound-related crashes.

To fix this, you need to check out the instructions on this page:

http://articles.techrepublic.com.co...11-6168870.html

This will enable you to set the processor affinity for the port in question, allowing it to behave like it is executing on a single-core processor. This appears to eliminate SDL_mixer's unexplained problems with running on a separate core.

Addendum:

For port authors, it may be prudent to look up information on the SetProcessAffinityMask Windows API function:
http://msdn2.microsoft.com/en-us/li...223(VS.85).aspx

Last edited by Quasar on 03-01-08 at 05:11

Old Post 03-01-08 05:04 #
Quasar is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
fraggle
Filled with the code of Doom


Posts: 7480
Registered: 07-00


PrBoom-plus and Chocolate Doom already have a fix for this that entryway developed :-)

Old Post 03-01-08 05:10 #
fraggle is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
Quasar
Moderator


Posts: 5956
Registered: 08-00



fraggle said:
PrBoom-plus and Chocolate Doom already have a fix for this that entryway developed :-)

Care to share the details? ;)

Old Post 03-01-08 05:11 #
Quasar is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
fraggle
Filled with the code of Doom


Posts: 7480
Registered: 07-00



Quasar said:

Care to share the details? ;)

This is the commit to the Chocolate Doom svn.

Old Post 03-01-08 05:19 #
fraggle is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
entryway
Forum Staple


Posts: 2711
Registered: 01-04


http://www.doomworld.com/vb/showthr...2425#post692425

http://pastebin.com/m69510e52

Last edited by entryway on 03-01-08 at 09:17

Old Post 03-01-08 08:46 #
entryway is offline Profile || Blog || PM || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
Quasar
Moderator


Posts: 5956
Registered: 08-00


Thanks guys ;)

Old Post 03-01-08 18:02 #
Quasar is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
Csonicgo


Posts: 4430
Registered: 03-04


Has this been added to EE yet?

Old Post 05-21-08 18:37 #
Csonicgo is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
Quasar
Moderator


Posts: 5956
Registered: 08-00


Not yet, it'll be in the next official release though.

Old Post 05-21-08 18:44 #
Quasar is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
entryway
Forum Staple


Posts: 2711
Registered: 01-04



Quasar said:
Not yet, it'll be in the next official release though.

You should fix such things more quickly IMHO (immediately?), because it is impossible to use your port on all up to date (most?) systems. 3.33.33.1 would be cool in the same day you got to know it.

Look at this and replace "prboom" with "Eternity"
http://www.doomworld.com/vb/showthr...9166#post699166

Last edited by entryway on 05-22-08 at 11:43

Old Post 05-22-08 10:02 #
entryway is offline Profile || Blog || PM || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
Quasar
Moderator


Posts: 5956
Registered: 08-00


I should ;)

One question I have is still outstanding, however. It is possible for Windows machines to have access denied to particular users to run processes on a given CPU. If this is the case, then the system processor affinity mask may not be "1" or "2" or any other particular value. While it is unlikely that this would affect the vast majority of DOOM source port users, I'd like to know why the approach of just using "1" as the process's affinity mask is valid when MSDN docs demand that you make certain the mask you set is a subset of the system mask. :)

I can imagine that the consequences of setting the affinity mask to an invalid value would be an application stall or crash, or at the least, failure to actually do anything at all.

Old Post 05-22-08 18:33 #
Quasar is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
entryway
Forum Staple


Posts: 2711
Registered: 01-04


I do not use 1 as constant, I use process_affinity_mask variable from cfg and you can set it to any value. 1 is by default and it means the first processor. Is it possible when the first processor is not allowed, but some other is allowed? I assumed there is no such possibility. In any case if SetProcessAffinityMask failed you can see it in stdout.txt:

code:
M_LoadDefaults: Load system defaults. default file: D:\games\Doom2/glboom-plus.cfg found D:\games\Doom2/prboom-plus.wad I_SetAffinityMask: failed to set process affinity mask (errorcode: 87)


With wrong process_affinity_mask GetLastError() will return 87 - "The parameter is incorrect"

Last edited by entryway on 05-22-08 at 21:27

Old Post 05-22-08 21:16 #
entryway is offline Profile || Blog || PM || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
Quasar
Moderator


Posts: 5956
Registered: 08-00


Ahh, ok. Thanks.

Old Post 05-23-08 07:20 #
Quasar is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
fraggle
Filled with the code of Doom


Posts: 7480
Registered: 07-00


I'm bumping an old thread here, but hopefully with good reason. There seems to have been a lot of development activity on SDL_mixer in recent months - Mac OS X native MIDI playback has now been fixed, for example. Looking through the logs, I stumbled across this. Is this possibly related to the SDL multicore lockups? Perhaps someone with a multicore system could try disabling the affinity workaround and running the game with a recent version of SDL_mixer to see if it makes any difference? (I ask because I don't currently have access to a multicore system)

Old Post 12-18-09 22:37 #
fraggle is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
entryway
Forum Staple


Posts: 2711
Registered: 01-04



fraggle said:
Perhaps someone with a multicore system could try disabling the affinity workaround and running the game with a recent version of SDL_mixer

I tried it 2 months ago (with a few timedemos of cybersky max run) and did not get that crash, but I know it is not easy to get it intentionally

Old Post 12-18-09 22:45 #
entryway is offline Profile || Blog || PM || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
fraggle
Filled with the code of Doom


Posts: 7480
Registered: 07-00


I think my testing process was something like: start a level, set IDDQD, get some monsters to start attacking me (so that sounds are constantly generated; the more monsters the better) and leave the game running for several hours.

Old Post 12-19-09 11:48 #
fraggle is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
entryway
Forum Staple


Posts: 2711
Registered: 01-04


SDL_mixer related crash did not occur with -nomusic. At least with prboom-plus.

Old Post 12-19-09 11:54 #
entryway is offline Profile || Blog || PM || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
Quasar
Moderator


Posts: 5956
Registered: 08-00


Eternity doesn't use any of the functions mentioned in that bug tracker and yet is still subject to the multicore crash bugs. The only parts of SDL_mixer that EE uses are the postmix callback and the music playing.

Old Post 12-19-09 19:47 #
Quasar is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
Quasar
Moderator


Posts: 5956
Registered: 08-00


http://bugzilla.libsdl.org/show_bug.cgi?id=629

Recently updated after I caught the crash on my Windows 7 quad core box. Yes, it's still there. Yes, it's still random. Yes, it's definitely to do with MIDI.

However what is not explained is how this could possibly affect Linux, because the crash occurred in the winmm subsystem, which makes me look in the general direction of SDL_mixer's MCI callback in the win32 native midi module.

Old Post 01-08-10 01:31 #
Quasar is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
DaniJ
Senior Member


Posts: 2075
Registered: 08-03


Apologies for the necro bump but I'd like an update from the other port authors as to how they're getting on with this problem.

I'm currently looking at doing something about this in Doomsday but I'd really prefer not to limit everything to a single core.

Old Post 05-09-10 15:06 #
DaniJ is offline Profile || Blog || PM || Search || Add Buddy IP || Edit/Delete || Quote
Quasar
Moderator


Posts: 5956
Registered: 08-00



DaniJ said:
Apologies for the necro bump but I'd like an update from the other port authors as to how they're getting on with this problem.

I'm currently looking at doing something about this in Doomsday but I'd really prefer not to limit everything to a single core.


No change in the situation as far as I know. It's as crappy as it ever was.

Old Post 05-09-10 20:20 #
Quasar is offline Profile || Blog || PM || Email || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
DaniJ
Senior Member


Posts: 2075
Registered: 08-03


Bummer. Ok, I'll need to do some reorganising of our plugin loading in that case as we shouldn't restrict if the user is using say DirectSound.

Old Post 05-10-10 22:46 #
DaniJ is offline Profile || Blog || PM || Search || Add Buddy IP || Edit/Delete || Quote
GhostlyDeath
Forum Retard


Posts: 1027
Registered: 08-05


I just dumped SDL_Mixer completely and implemented Win32 MIDI and Linux OSS MIDI Support, it's limited but it saves time from fixing something you might not have control over.

Old Post 05-11-10 15:39 #
GhostlyDeath is offline Profile || Blog || PM || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
Graf Zahl
Why don't I have a custom title by now?!


Posts: 7694
Registered: 01-03



GhostlyDeath said:
Win32 MIDI


This doesn't work well on most modern systems. If you want to remove something that's broken do not replace it with something else that's also broken.

Old Post 05-11-10 15:50 #
Graf Zahl is offline Profile || Blog || PM || Email || Search || Add Buddy IP || Edit/Delete || Quote
GhostlyDeath
Forum Retard


Posts: 1027
Registered: 08-05



Graf Zahl said:


This doesn't work well on most modern systems. If you want to remove something that's broken do not replace it with something else that's also broken.



The midiOut* functions worked perfectly fine for me, at least on Vista.

Old Post 05-11-10 15:53 #
GhostlyDeath is offline Profile || Blog || PM || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
Graf Zahl
Why don't I have a custom title by now?!


Posts: 7694
Registered: 01-03


What sound card do you have? On my onboard chip the volume is so low that it's totally unusable and Microsoft in their infinite wisdom have removed the volume control so there's nothing I can do. Any program that uses system MIDI for music is worthless for me.

Old Post 05-11-10 16:09 #
Graf Zahl is offline Profile || Blog || PM || Email || Search || Add Buddy IP || Edit/Delete || Quote
GhostlyDeath
Forum Retard


Posts: 1027
Registered: 08-05



Graf Zahl said:
What sound card do you have? On my onboard chip the volume is so low that it's totally unusable and Microsoft in their infinite wisdom have removed the volume control so there's nothing I can do. Any program that uses system MIDI for music is worthless for me.


Was some onboard AC97 Nvidia. afaik.

Old Post 05-12-10 01:15 #
GhostlyDeath is offline Profile || Blog || PM || Homepage || Search || Add Buddy IP || Edit/Delete || Quote
All times are GMT. The time now is 06:06. Post New Thread    Post A Reply
 
Doomworld Forums : Powered by vBulletin version 2.2.5 Doomworld Forums > Classic Doom > Source Ports > Running SDL ports on multicore processors

Show Printable Version | Email this Page | Subscribe to this Thread

 

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are OFF
[IMG] code is ON
 

< Contact Us - Doomworld >

Powered by: vBulletin Version 2.2.5
Copyright ©2000, 2001, Jelsoft Enterprises Limited.