All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thomas Richter <thor@math.tu-berlin.de>
To: linux-kernel@vger.kernel.org
Subject: ALSA: Midi on emu10k1 broken for more than 2GB memory
Date: Tue, 14 Sep 2010 16:22:41 +0200	[thread overview]
Message-ID: <4C8F8531.8000006@math.tu-berlin.de> (raw)

Hi folks, (please forward replies to thor@math.tu-berlin.de - thanks)

the following is a question and a quick dirty fix for midi problems on 
the emu10k1 (Soundblaster) cards for 64 bit systems
with more than 2GB memory. Problem of this card is, as the alsa team is 
definitely aware of, that the card can only DMA into
the lowest 2GB of memory, PCI DMA seems to use only 31 bit of the 
available 32 bit. The current emu10k1 driver is aware of
this problem and uses the following strategy to allocate DMA memory for 
the card:

i) Get regular memory,
- if the result has bits 31 or above set,
ii) fall back to the ISA (16MB) memory zone.

Unfortunately, the ISA memory zone runs out of memory pretty early - 
this means that it is for typical configurations not
possible to load soundfonts, they simply won't fit. As a result, midi 
output is broken.

Many linux distributions work around this by offering a timidity based 
midi-server, but this is in so far unsatisfactory as it causes
additional CPU load, besides the problem lies a bit deeper in the kernel 
memory management and its unability to allocate
memory for such broken hardware flexible enough.

A possible quick workaround would be a kernel option (probably under 
"kernel hacking") to make the 32bit DMA zone a 31bit DMA
zone, i.e. in

arch/x86/include/asm/dma.h

make this line

#define MAX_DMA32_PFN ((4UL * 1024 * 1024 * 1024) >> PAGE_SHIFT)

configurable. I'm currently running a custom-patched 2.6.32.21 with this 
configuration active, and run the same modification on
several kernels before without observing any major drawback from that, 
the system runs stable (and of course, with emu10k1 midi).

I'm not really competent enough to provide a patch that would integrate 
nicely into the configuration mechanism, but it seems easy
enough to do until a better memory management becomes available.

The system here is a Asus M2N with 6GB memory and an 
emu10k1/soundblaster card, though the board shouldn't really matter, it
is a emu10k1 problem that appears whenever more than 2GB are in the system.

Comments, suggestions, activities?

Thanks,

Thomas


                 reply	other threads:[~2010-09-14 14:32 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4C8F8531.8000006@math.tu-berlin.de \
    --to=thor@math.tu-berlin.de \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.