KNOWN ISSUE: [Windows 7 with] 2gb or more RAM

Discussion in 'Bug Reports' started by Temragon, Jul 31, 2009.

  1. patches11

    patches11 New Member

    Joined:
    Apr 24, 2009
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    0
  2. thrillhouse82

    thrillhouse82 New Member

    Joined:
    Aug 13, 2009
    Messages:
    8
    Likes Received:
    2
    Trophy Points:
    0
    I just reviewed the ReactOS implementation and found that it doesn't respect the physical address constraint at all. Hopefully the original MS implementation does a better job there. I then had a look at the MS docs of this method and now I'm unsure if it will really be the solution we're looking for...

    The doc at IDmaChannel::AllocateBuffer says:

    "PhysicalAddressConstraint
    Specifies an optional constraint to place on the physical address of the buffer. If this parameter is non-NULL, only the bits that are set in the constraint address will vary from the beginning to the end of the buffer. For example, to request a buffer that does not cross a 64-kilobyte boundary, specify the physical address constraint 0x000000000000FFFF."

    IOW: You can tell this function which bits may change their values from the beggining to the end of the buffer but you cannot zero-force any bits of the returned physical address as required by the emu10k1/2. I sincerely hope that I'm wrong but imho the wording is quite clear :(
     
  3. Russ

    Russ Well-Known Member

    Joined:
    Jan 17, 2005
    Messages:
    5,722
    Likes Received:
    13
    Trophy Points:
    48
    You are right, it does sound that way, but what useful purpose would that serve? That would seem to only limit the size of the buffer, so then what is the purpose of the BufferSize parameter?
     
  4. patches11

    patches11 New Member

    Joined:
    Apr 24, 2009
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    0
    The purpose that it was thought it could serve was to keep the allocated buffer under the 2GB mark. This information indicates that the function isn't capable of such.

    BufferSize is just how big the buffer is, and has nothing to do with where it is located.

    I wonder how Creative pulls this off in their own driver... Presumably it has to work around the card's limitation as well. Unfortunately, I know almost nothing about reverse engineering (driver speak is already beyond me for the most part).
     
  5. thrillhouse82

    thrillhouse82 New Member

    Joined:
    Aug 13, 2009
    Messages:
    8
    Likes Received:
    2
    Trophy Points:
    0
    You are right, it will indeed limit the maximum size of the buffer. For example, there are certain IDE controllers that require the DMA buffers to not cross a 64KB boundary. Therefore, we would request a DMA buffer with the memory constraint set to 0x000000000000FFFF. This requests a buffer whose upper 48 bits do not change from the buffer's beginning to its end and we have a buffer that doesn't cross the 64K boundary. Otherwise, the memory manager could just as well return a buffer that starts at 0x10000F00 and ends at 0x10010EFF, which would as well be 64K but it would also cross the 64K boundary and therefore it would not fulfill all the requirements of the device. Result would be read/write errors or data corruption :w00t:

    This will also mean that the maximum buffer size is limited to 64K. However, it is still necessary to provide the BufferSize parameter to be able to request smaller sizes that are not powers of 2.

    Bit OT here but maybe it helps us to understand the method better.
     
  6. Russ

    Russ Well-Known Member

    Joined:
    Jan 17, 2005
    Messages:
    5,722
    Likes Received:
    13
    Trophy Points:
    48
    Thanks for the explanation :)

    Does Creative offer a full featured driver for Vista x64 or Windows 7 x64 for these cards?

    MS makes mention of the possibility of using the PcNewDmaChannel function (which I thought I read somewhere can be used to put additional constraints on the buffer, but now I cannot seem to find where I saw that (err, nevermindl)), but also states that it is more complicated to use, is obsolete, and would kill hardware acceleration on 64 bit versions of Windows (except Windows XP and Windows Server 2003).

    Aside from the above, they obviously have more resources (i.e. they can probably afford the cost of using MS support channels to find a solution, etc).
     
    Last edited: Aug 17, 2009
  7. LyyNx

    LyyNx New Member

    Joined:
    Feb 18, 2004
    Messages:
    54
    Likes Received:
    0
    Trophy Points:
    0
    i tried creative's driver for my audigy2 platinum a while back (win7 x64, 4gb ram) and it worked flawlessly. i would probably use it if i didn't need the dsp of kx :)
     
  8. patches11

    patches11 New Member

    Joined:
    Apr 24, 2009
    Messages:
    5
    Likes Received:
    0
    Trophy Points:
    0
    These are the most recent Creative-authored drivers that I've found: http://support.creative.com/downloads/?h=7

    When I had 4GB of RAM installed, those drivers worked without much issue. No audio glitching or crashing like I had seen with the driver that came with Windows 7's beta. But as LyyNx says, gotta have the DSP!
     
    Last edited: Aug 18, 2009
  9. thrillhouse82

    thrillhouse82 New Member

    Joined:
    Aug 13, 2009
    Messages:
    8
    Likes Received:
    2
    Trophy Points:
    0
    I think in the long run it is necessary to implement IDmaChannel if the free-and-reallocate approach doesn't work. If we do this, we are allowed to use MmAllocateContiguousMemory and MmGetPhysicalAddress. While MS doesn't recommend these functions for DMA operations these are the only one that allow us to specify exact memory boundaries. AllocateCommonBuffer - which is the recommended function for DMA buffers - suffers from the same limitations as NewMasterDmaChannel.

    I can provide a sample implementation of IDmaChannel using these functions if that would help. Hell, if I had the driver sources, I would be keen on implementing and testing it right away! :evil: As for the Creative drivers: Besides not being full-featured, they don't seem to support the good old SoundBlaster Live! and Live! Value models, so this is not an option for a lot of users.
     
  10. Eugene Gavrilov

    Eugene Gavrilov kX Project Lead Programmer and Coordinator

    Joined:
    Dec 7, 2002
    Messages:
    3,146
    Likes Received:
    9
    Trophy Points:
    48
    Îòâåò: KNOWN ISSUE: [Windows 7 with] 2gb or more RAM

    thrillhouse82,

    yes, please write a sample implementation and the functions necessary to instantiate the object - this would be very useful. you can test these functions by using any sample WDK driver, e.g. a 'toaster' driver

    all,
    please have a look at the debug logs of 3549-b build, they should dump the physical address of the buffer allocated

    E.
     
  11. Eugene Gavrilov

    Eugene Gavrilov kX Project Lead Programmer and Coordinator

    Joined:
    Dec 7, 2002
    Messages:
    3,146
    Likes Received:
    9
    Trophy Points:
    48
    Îòâåò: KNOWN ISSUE: [Windows 7 with] 2gb or more RAM

    btw, http://www.microsoft.com/whdc/archive/highperf-drv.mspx

    I will have a look at this code later. Please review it, too.

    (Ibid.)

    E.
     
  12. Russ

    Russ Well-Known Member

    Joined:
    Jan 17, 2005
    Messages:
    5,722
    Likes Received:
    13
    Trophy Points:
    48
    The SB16 sample's IDMAChannel implementation appears to just call the base class implementation of each function and does not really implement any of the functionality itself. In any case it should prove useful to show how to get an initial IDMAChannel object to work with, and then you should only need to implement some of the functions (like (I assume) AllocateBuffer) and call the base class implementation for the rest.

    The MSVAD sample also appears to have a partial implementation of a custom IDMAChannel.
     
  13. thrillhouse82

    thrillhouse82 New Member

    Joined:
    Aug 13, 2009
    Messages:
    8
    Likes Received:
    2
    Trophy Points:
    0
    Yes, this is what it does. It is merely an example of how to provide a custom IDmaChannel implementation. BTW: AllocateBuffer doesn't need to be implemented since NewStream doesn't require this. You will see that in my sample code I'm currently preparing; it is done but I want it to at least load once and run a few simple tests before I send it to you guys. Is C++ fine or do you need C wrapper stuff?
     
  14. thrillhouse82

    thrillhouse82 New Member

    Joined:
    Aug 13, 2009
    Messages:
    8
    Likes Received:
    2
    Trophy Points:
    0
    I uploaded the first version of the sample implementation. You can review it at http://home.arcor.de/infolchinger/CDmaChannel.cpp and http://home.arcor.de/infolchinger/CDmaChannel.h

    I did some quick tests on a WinXP 1GB machine and it appears to do what it should. Tonight I will test it on a 4GB Win 7 machine. This will be the moment of truth since on this system, the current driver version will always fail with random noise. If the physical address of CDmaChannel is below 2G there, chances are that we soon have a driver that will work on all systems regardless of available memory.

    Some notes about the source: It is written in C++ and brings its own new/delete operator. If your driver already defines operator new and operator delete, you can just delete the ones of the CDmaChannel class. The class itself can be instantiated by calling CDmaChannel::Create or (if you use C) by calling CreateCDmaChannel. Parameters are size in bytes and highest acceptable physical address. Therefore, it should be possible to replace NewMasterDmaChannel by a call to CDmaChannel::Create and return this object instead of the one created by NewMasterDmaChannel.

    Results of the Win 7 Tests: Returned physical address was good on several tries.
     
    Last edited: Aug 21, 2009
  15. RPGWiZaRD

    RPGWiZaRD New Member

    Joined:
    Dec 29, 2007
    Messages:
    132
    Likes Received:
    1
    Trophy Points:
    0
    It's actually working? :eek: If so you've just extended kX driver's life at least another 10+ years (I hope). ^^
     
    Last edited: Aug 22, 2009
  16. thrillhouse82

    thrillhouse82 New Member

    Joined:
    Aug 13, 2009
    Messages:
    8
    Likes Received:
    2
    Trophy Points:
    0
    I don't know if it will work in the driver's context, but the sample object behaves as expected and returns usable addresses, so chances are quite good :) But usually it is a longer way from a working prototype to a production level driver than most people would expect.

    Therefore, please be patient and give Eugene some time to integrate and test this approach before celebrating ;)
     
    Tyrsonswood likes this.
  17. Lex Nahumury

    Lex Nahumury DH Senior Member

    Joined:
    Jan 5, 2003
    Messages:
    1,944
    Likes Received:
    6
    Trophy Points:
    0
    Hi thrillhouse82,

    If you haven't done so already, it's best to contact Eugene directly through email
    kxproject@yandex.ru in regards to development details such as these.
    Thank you.
     
  18. RPGWiZaRD

    RPGWiZaRD New Member

    Joined:
    Dec 29, 2007
    Messages:
    132
    Likes Received:
    1
    Trophy Points:
    0
    Any updates? I'm so curious to know if this bug gets fixed or not because I'm planning on upgrading comp soon so need to know if I'll have to buy a 2GB ram kit instead of 4GB.
     
  19. MegaByte

    MegaByte New Member

    Joined:
    May 25, 2007
    Messages:
    25
    Likes Received:
    0
    Trophy Points:
    0
    I have upgraded my computer with more 2GB RAM and therefore fallen prey of this bug. Windows Vista x64 does work, but Windows 7 x64 doesn't.
     
  20. powerflux

    powerflux New Member

    Joined:
    Mar 6, 2010
    Messages:
    3
    Likes Received:
    0
    Trophy Points:
    0
    hi, i run an audigy 1394 and an audigy 2 platinum in the same pc. worked perfectly under XP, but now with windows 7-64 (and 4GB of ram) this bug popped up. playback seems to be OK with all buffers set at max. but it still sounds sometimes as if something's wrong.

    also, windows thinks i've got a 8-speaker surround setup, even if i put it on '2.0 stereo' in the kxmanager. can't change it in the windows control panel (greyed out) this gives some irritating issues with gaming.. but that's a problem for later. not very important.

    but, i was just checking for news on the 2GB+ bug, is there any? the changelog for 3350 says it's solved, but it clearly isn't. i love the kx drivers, so please continue the good work!
     

Share This Page

visited