Kodi Community Forum

Full Version: ATV1, ArchLinux, CrystalHD: Insufficent memory/resources
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I'm running Arch on kernel 3.4.9 on an AppleTV 1. I'm trying to use a CrystalHD (BCMxxx15) and am having issues, which I think are to do with the amount of memory.

After a clean boot the ATV reports:
Code:
[htpc@luna ~]$ free
             total       used       free     shared    buffers     cached
Mem:        248032     244020       4012          0       9520      72280
-/+ buffers/cache:     162220      85812
Swap:       244120       5520     238600
and after sitting for a few minutes it reports:
Code:
[htpc@luna ~]$ free
             total       used       free     shared    buffers     cached
Mem:        248032     161012      87020          0       1172      36648
-/+ buffers/cache:     123192     124840
Swap:       244120      53424     190696

Occasionally when I try to play an HD file the CHD isn't used and dmesg reports:
Code:
[   87.566367] crystalhd 0000:02:00.0: Insufficient Memory For RX
[   87.730048] crystalhd 0000:02:00.0: Closing user[0] handle via ioctl with mode 417a00
[   87.730059] crystalhd 0000:02:00.0: crystalhd_dioq_fetch: Invalid arg
[   87.730066] crystalhd 0000:02:00.0: ioq not initialized

Sometimes rebooting solves the issue, sometimes just restarting XBMC does it.

I found discussions about this and tried recompiling the driver with 8 DMA RX rings, and dmesg reported
Code:
[   95.546367] crystalhd 0000:02:00.0: Insufficient resources
I tried 12 rings to the same effect.

It seems the issue is the lack of RAM on the ATV, but I'm pretty stumped on how to reduce my usage and am loathe to move to crystalbuntu (even though that seems to work). Any cunning ideas/ways to make the driver work properly with 8 DMA rings?

Tom
make sure you setup the nvidia driver to NOT steal any system ram.
That seems to have done it. For posterity I added:
Code:
Option "RegistryDwords" "RMDisableRenderToSysmem=1"
to my xorg.conf. Is that what you meant?

I'll run some more tests (watch more Community) but hopefully that's it. Thanks.
I spoke too soon- it failed again, but this time at least after much more abuse. Does Crystalbuntu/OpenELEC suffer from this, and if so do they solve it in a clever way?

Is it simply a problem with my install of linux using too much ram on the ATV? Does my xorg line not actually do anything useful?

One avenue I'm planning to investigate tomorrow is using older versions of the drivers. Possibly http://aur.archlinux.org/packages.php?ID=45506 rather than http://aur.archlinux.org/packages.php?ID=34308. Am I barking up the wrong tree?

[edit1]
I tried the older driver, got the "insufficient resources" error again (it was set to 8 DMA). Any solution for that particular error known?

It appears that I need to cut down ram usage from the kernel and XBMC (the only two big things that are running)- I can compile a chilled out kernel, but does anyone know compile flags to persuade XBMC to use less memory? Or I guess a light weight skin....

Code:
[htpc@luna ~]$ free
             total       used       free     shared    buffers     cached
Mem:        248032     241364       6668          0        660      18268
-/+ buffers/cache:     222436      25596
Swap:       244120      40732     203388
[/edit1]

[edit2]
I think the video driver is lying to me. Its reporting 128mb in nvidia-settings, while the ATV has 64mb on the 7300go. Either I have the wrong setting in xorg or driver 304 ignores that setting... more to follow.
[/edit2]

[edit3]
Driver 173 reported the same memory usage as 304, and the CHD died after one episode. Did seem to have slightly (~10MB) lower memory usage
[/edit3]