Re: [alsa-devel] emu10k1 driver can't allocate memory
At Sun, 20 May 2012 03:04:14 +0200, Mikael Magnusson wrote:
Hi, (please CC me on replies, not subscribed)
I recently upgraded to 3.3.6 from 2.6.33.15 (yeah, I know). Since then I noticed sometimes sounds were sometimes missing, then I noticed thousands of these in dmesg, [37280.283484] max memory size is 0x7fffffff (addr = 0x1d5d70071038000)!!
I guess you are enabling IOMMU? I guess it translates the address somehow in a way emu10k1 doesn't like. There are really little changes in emu10k1 driver itself, so if the kernel upgrade changes the behavior, it must be in the core part such like IOMMU handling.
Try to boot without iommu and see whether it changes the behavior again.
Takashi
[37280.283486] emu: failure page = 32 I also checked asfxload -M output, right after boot it shows all the synth memory free as you would expect, but after a while of usage, it is close to 0 (around 50KiB or so). Trying to run a simple program that writes to /dev/audio fails with write(3</dev/audio>, "\32\21\t\3\0\0\4\n\23\34&/6:;94,#\31\17\10\2\0\0\4\v\24\36(07"..., 4096) = -1 ENOMEM (Cannot allocate memory) You can also note the output from asfxload -M dropping rapidly while the program is making sound before it fails. Native alsa apps seem to fare slightly better as the memory decrease caused by them is actually returned when they close the device again.
Loading and unloading soundfonts seem to work as normal, the memory is returned when the soundfont is unloaded afaict. (I have the patch applied that makes it possible to load soundfonts (changes the DMA32 zone to 2GB). I don't think this is the cause of my problem since the given addresses are way way outside the 4GB range as well.)
Note that even well before the reported memory is at 0, apps randomly fail to open the sound output and are silent. Curiously espeak when successful doesn't cause a decrease in available memory, but when it fails, it causes about 100KiB drop.
I can't (don't dare) bisect because this is my production machine, but I can test patches, or check the major releases between 2.6.33 and 3.3.6 if you have no idea what causes this.
I'm not the only one with the problem either, http://www.google.com/search?nfpr=1&tbs=li:1&q=emu%3A+failure+page+%...
-- Mikael Magnusson
T
Hi, (please CC me on replies, not subscribed)
I recently upgraded to 3.3.6 from 2.6.33.15 (yeah, I know). Since then I noticed sometimes sounds were sometimes missing, then I noticed thousands of these in dmesg, [37280.283484] max memory size is 0x7fffffff (addr = 0x1d5d70071038000)!!
I guess you are enabling IOMMU? I guess it translates the address somehow in a way emu10k1 doesn't like. There are really little changes in emu10k1 driver itself, so if the kernel upgrade changes the behavior, it must be in the core part such like IOMMU handling.
Try to boot without iommu and see whether it changes the behavior again.
This is *not* a IOMMU configuration issue. It is an issue of where the emu10k1 allows DMA, and what the kernel does about it. If you have more than 2GB of memory, and the system runs out of 16MB ISA space, you see exactly this happening.
There is a kernel patch for this:
https://bugs.launchpad.net/ubuntu/+source/awesfx/+bug/183456
Greetings,
Thomas
At Wed, 27 Jun 2012 13:41:03 +0000 (UTC), Thomas Richter wrote:
T
Hi, (please CC me on replies, not subscribed)
I recently upgraded to 3.3.6 from 2.6.33.15 (yeah, I know). Since then I noticed sometimes sounds were sometimes missing, then I noticed thousands of these in dmesg, [37280.283484] max memory size is 0x7fffffff (addr = 0x1d5d70071038000)!!
I guess you are enabling IOMMU? I guess it translates the address somehow in a way emu10k1 doesn't like. There are really little changes in emu10k1 driver itself, so if the kernel upgrade changes the behavior, it must be in the core part such like IOMMU handling.
Try to boot without iommu and see whether it changes the behavior again.
This is *not* a IOMMU configuration issue. It is an issue of where the emu10k1 allows DMA, and what the kernel does about it. If you have more than 2GB of memory, and the system runs out of 16MB ISA space, you see exactly this happening.
There is a kernel patch for this:
https://bugs.launchpad.net/ubuntu/+source/awesfx/+bug/183456
Did you see the address value in the above original report? It's the address returned from dma_alloc_coherent(). Certainly the same problem won't happen on 2GB memory system without IOMMU. It's a completely different thing.
Takashi
Takashi Iwai <tiwai <at> suse.de> writes:
There is a kernel patch for this:
https://bugs.launchpad.net/ubuntu/+source/awesfx/+bug/183456
Did you see the address value in the above original report? It's the address returned from dma_alloc_coherent(). Certainly the same problem won't happen on 2GB memory system without IOMMU. It's a completely different thing.
Thanks, I guess you are right - especially in so far as the mentioned patch seem to have been applied by the OP already.
So long, Thomas
participants (2)
-
Takashi Iwai
-
Thomas Richter