Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 13 Feb 1999 00:03:11 +0100 (CET)
From:      Oliver Fromme <olli@dorifer.heim3.tu-clausthal.de>
To:        freebsd-hackers@FreeBSD.ORG
Subject:   ISA DMA problems if >= 512 Mb RAM?
Message-ID:  <199902122303.AAA05641@dorifer.heim3.tu-clausthal.de>

next in thread | raw e-mail | index | archive | help
Hi,

I submitted a PR regarding this last month, but it seems like
that was rather inappropriate (and obviously it didn't get any
attention).  Admittedly, I'm not that much of a VM expert, so
maybe the information that I provide is insufficient.  In that
case please let me know what I can do to help fixing this
problem.

This is the situation:  ASUS P2B-LS mainboard with 512 Mb RAM,
Soundblaster AWE64 PnP.  (This is NOT a problem with PnP or
the sound drivers!).  We're running 3.0-stable of 1999-01-28.
This is what happens (dmesg excerpt):

hermes /kernel: real memory  = 536870912 (524288K bytes)
hermes /kernel: avail memory = 519753728 (507572K bytes)
hermes /kernel: snd0: <SoundBlaster 16 4.16> 
hermes /kernel: sbxvi0 at drq 5 on isa
hermes /kernel: snd0: <SoundBlaster 16 4.16> 
hermes /kernel: soundcard buffer alloc failed 
hermes /kernel: snd: Unable to allocate 131072 bytes of buffer
hermes /kernel: sbmidi0 at 0x330 on isa
hermes /kernel: snd0: <SoundBlaster MPU-401> 
hermes /kernel: awe0 at 0x620 on isa
hermes /kernel: awe0: <SoundBlaster EMU8000 MIDI (RAM512k)>
hermes /kernel: opl0 at 0x388 on isa
hermes /kernel: snd0: <Yamaha OPL3 FM> 

It looks like the driver is unable to allocate its DMA buffers.
Needless to say, audio playback doesn't work.  With Luigi's pcm
driver, no error messages appear during boot, but when I try to
play audio, the result is a panic: "isa_dmacheck: no physical
page present".

I noticed that the difference between "real" and "avail" memory
(reported during boot) is about 16.3 Mb.  Therefore my guess is
that the kernel allocates that memory at the lower end of the
RAM for some internal bookkeeping related to physical RAM (page
tables?  Remember, I'm not a VM expert).  The sound drivers try
to allocate their DMA buffers in the lower 16 Mb, too, because
the rest is not accessible by ISA DMA (someone correct me if
I'm wrong), which fails, of course.  (It's probably a bug in
the pcm driver not to check for this case, which leads to the
panic, but that's a different story.)

When I came to that conclusion, I tried to remove some of the
RAM, reducing the total amount to 256 Mb.  Voilà:  No error
messages, and playing audio works fine!  This time, dmesg says:

hermes /kernel: real memory  = 268435456 (262144K bytes)
hermes /kernel: avail memory = 258564096 (252504K bytes)

The difference is only about 9.5 Mb now.  Enough space left for
the sound drivers.  Out of curiosity, I also tryed 384 Mb RAM:

hermes /kernel: real memory  = 402653184 (393216K bytes)
hermes /kernel: avail memory = 389107712 (379988K bytes)

That's 13 Mb difference, audio playback still works fine.
However, reducing the amount of RAM is not really a solution.
After all, we got that much for a reason.  ;-)

Has anyone an idea how to solve the problem?  Is there a way
to tell the kernel to leave some space available in the lower
16 Mb?  Or is the problem caused by something completely
different?

Regards
   Oliver

PS:  Hmm...  thinking about it, doesn't the floppy driver also
use ISA DMA?  The floppy drive seems to work fine, even with
512 Mb RAM.  (Does the 16 Mb limitation not apply to onboard
FD controllers?)

PPS:  No need to Cc: me, I'm reading the list through a news
gateway.

-- 
Oliver Fromme, Leibnizstr. 18/61, 38678 Clausthal, Germany
(Info: finger userinfo:olli@dorifer.heim3.tu-clausthal.de)

"In jedem Stück Kohle wartet ein Diamant auf seine Geburt"
                                         (Terry Pratchett)

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199902122303.AAA05641>