[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

Re: [pygame] Pygame Mixer Crackle noise not an SDL_Mixer problem



Ah, that sounds like it could be a good thing to use.  Is it easy
enough to make a version check for directx first?
We would need to test it a fair bit, in case that's a crashy path I think.

I remember directx version checking being a bit hard... They don't
just have a get_version() function... you need to do weird hacks...


Well there is a function in the directx samples for getting the direct
x version:
"Rather than provide a detailed list here of each version's
characteristic interfaces and objects, you should refer to the
DirectXsoftware development kits (SDKs) sample section. One of the
samples is a function, GetDXVersion, that includes tests for all
DirectX versions. GetDXVersion returns an integer that corresponds to
the DirectX version that is present on the system. As long as this
integer is greater than or equal to your desired version number, your
application will run normally. You can find the sample code under your
SDK root folder at \Samples\Multimedia\DXMisc\GetDXVer."
-- http://msdn.microsoft.com/archive/default.asp?url=/archive/en-us/directx9_c/directx/intro/program/version/versioncheck.asp

According to that page win98 came with directx 5.1

Anyone have access to the directx samples?  I found this one:
http://www.worldfoundry.org/doxygen/html/getdxver_8cc-source.html

But looking at that GetDXVersion function(there's all sorts of
weirdness in there), it might be safer to just enable the option?




On Thu, Apr 24, 2008 at 3:06 PM, Lenard Lindstrom <len-l@xxxxxxxxx> wrote:
> There is a feature I can enable in SDL's DirectX driver. It uses event
>  notification to tell when a buffer is free. The default is a DirectX 5
>  compatible semi-busy wait. I tried it while debugging and it did clear up the
>  sound somewhat. It went from slow and crackly to just crackly. Maybe this would
>  take care of any problems that still exist after increasing the chunk size.
>
>
>  Lenard
>
>
>  Quoting René Dudfield <renesd@xxxxxxxxx>:
>
>
>
> > nice one :)
>  >
>  > Since this is a fairly recent change, I don't think it will fix
>  > everyones crackling sound problems... since that problem was around
>  > way before that change was made.
>  >
>  > Or does it fix it for everyone now after all?
>  >
>  >
>  >
>  > On Thu, Apr 24, 2008 at 1:51 PM, Brian Fisher <brian@xxxxxxxxxxxxxxxxxxx>
>  > wrote:
>  > > On Wed, Apr 23, 2008 at 7:24 PM, Lenard Lindstrom <len-l@xxxxxxxxx> wrote:
>  > >
>  > > > ==== From around line 160 in mixer.c ===============
>  > > >     /*make chunk a power of 2*/
>  > > >     for (i = 0; 1 << i < chunk; ++i); //yes, semicolon on for loop
>  > > >     chunk = MAX (1 << i, 256);
>  > > > ==== To around line 167 ============================
>  > > >     /*make chunk a power of 2*/
>  > > >     for (i = 0; 1 << i < chunk; ++i) {
>  > > >     chunk = MAX (1 << i, 256);
>  > > >     }
>  > > >
>  > >
>  > > wow... the way I read the broken code, it means that pygame 1.8 is always
>  > > using 256 for the chunksize argument to Mix_OpenAudio (would be setting
>  > > chunk to 256 when i=0) meaning it always played from a 256 byte buffer...
>  > > it's pretty impressive that neither the waveout backend nor many computers
>  > > have a problem with such a small number...
>  > >
>  > > Also, the fixed code means the default chunksize of 3072 is actually 4096.
>  > >
>  >
>
>
>