Setting max_cstate
#1
I have an AppleTV running Ubuntu 9.1 with the CrystalHD decoder installed. All of the guides mention setting max_cstate to C2. I have no way to successfully make this change.

I have tried using an options file in modprobe.d and using boot parameters. Nothing seem to change the setting from C8. What am I missing?

xbmc@appletv:/etc/modprobe.d$ cat /proc/acpi/processor/CPU0/poweractive state: C0
max_cstate: C8
maximum allowed latency: 16000 usec
states:
C1: type[C1] promotion[--] demotion[--] latency[001] usage[00003595] duration[00000000000000000000]
C2: type[C2] promotion[--] demotion[--] latency[001] usage[12331846] duration[00000000001866215477]
C3: type[C3] promotion[--] demotion[--] latency[057] usage[217598046] duration[00000000715541300796]

xbmc@appletv:/etc/modprobe.d$ cat options.conf
options processor max_cstate=C2
Reply
#2
Hi, I'm on 8.04 so it may be different, but I have:

Code:
more /etc/modprobe.d/options
# Enable double-buffering so gstreamer et. al. work
options quickcam compatible=2

# Default hostap to managed mode
options hostap_pci iw_mode=2
options hostap_cs iw_mode=2
options processor max_cstate=2

notice, no c in the processor options line.

I'm also thinking of doing a minimal 9.10. I'm interested in how you are finding it, performance-wise? Did you do it via the atv-bootloader method, with the 9.10 disk image on a second partition on the patchstick? I was going to try this as per the 7.10 guide on the atv-bootloader wiki, but was wondering about the differences regarding grub2 - is it just a case of making a symlink to menu.lst? Appreciate your insights!

Jim
Reply
#3
Still didn't appear to work using the options file in modprobe.d.

I'd be happy to answer any specific questions you have. It has been a while since I did the install so I forget some of the details. I did use the atv-bootloader method. The only problem I remember running into was all the examples had kexec executing a specific kernel image out of boot where I had to just point it at the vmlinuz symlink in the root.
Reply
#4
I put it in the boot_linux.sh script on the HFS drive.

I'm running ubuntu 9.10 on that box, so the default scripts don't work anyway. You have to manually edit that file to run kexec.

If you're running ubuntu 8.04 with the older version of grub, you should be able to add the options into the kernel line in your menu.lst file. I believe the default scripts actually start the kernel based off of your grub configuration.

Mine looks like this. Since it's grub 2, this is essentially doing what grub would do, bypassing grub completely.

Code:
mount /dev/sda4 /tmp
kexec --load /tmp/vmlinuz --initrd=/tmp/initrd.img --command-line="root=/dev/sda4 initrd=initrd.img vga=normal vesa video=vesafb processor.max_cstate=2"
umount /tmp
kexec -e
Reply
#5
Thanks guys, I figured that running the kexec by script on boot would be the simplest thing in the end. Nice to know it works though!

Have either of you tried something newer? Lucid or maverick? I have heard that there are problems since the NetBoot installer is slightly different in Lucid and above.... would be interested to hear your feedback.

Jim
Reply
#6
Tonight I just decided to try installing 8.04 instead of 9.10 and evetyhing is working perfectly now. I was able to set the max_cstate with no issue.

I was also having issues with the proper decoding of HD content with the CrystalHD card but now everything is working flawlessly.

I would have to say that I recommend sticking with the 8.04.
Reply
#7
Which rev xbmc and crystalhd were you using on karmic? Also, which rev nvidia drivers?

I would be interested in hearing from dan1son if he has the same issues, or if his install is running smoothly....

I plan to do the install to a spare 2.5" drive I have laying around, so it's no worries if it doesn't pan out, but I'd like to know if it can be made to work satisfactorily at all!?

Thanks for the info....

Jim
Reply
#8
Just wanted to report back (if anyone cares!?) that I have Dharma RC1, CrystalHD r161 and Karmic working fine on my ATV. Only thing is loss of HDMI audio, but I had long since stopped using that on Hardy anyway - preferring to use the optical on my amp...

One thing to note - I originally tried to recompile the mach_kernel (both on an OS X box and on Hardy and Karmic using the Darwin Cross-compiler) but couldn't get it to work - just would not pick up on my hand-made menu.lst....

....However the very same kernel parameters from my menu.lst work without issue using the kexec jump - so go figure! I'd still like to hear from anyone who's managed to successfully recompile to mach_kernel for Karmic. Perhaps they can point out a common pitfall that I've overlooked?

FatCat, I wonder if your performance issues were cstate related? Since this is the one factor that you couldn't get going on your Karmic install... I did like Dan1son and passed it as a kernel parameter - I can confirm this approach works without issues.

Jim
Reply
#9
Jimmer Wrote:Thanks guys, I figured that running the kexec by script on boot would be the simplest thing in the end. Nice to know it works though!

Have either of you tried something newer? Lucid or maverick? I have heard that there are problems since the NetBoot installer is slightly different in Lucid and above.... would be interested to hear your feedback.

Jim


I have managed to get a 2.6 Gig install of Mint 10 (ubuntu 10.10) up and running. I had to use grub legacy though, as I could not get Grub2 to work at all with the ATV bootloader. I added the max_cstate line to grub.lst and for the first time I heard the Mint desktop startup sound that was not chopped up or stuttering


So far so good now I think my last battles are HDMI audio and suspend or hibernate from XBMC, but I think the suspend/hibernate will never work. In fact when I tried some stuff I found on the net, it only made matters worse. Thank god for back - ups.

I have been working hard on this it will boot an ATV with or without internal HD and you could even copy to internal ATV HD , as I did last week, by booting to a separate copy (two copies of the same) and imaging one to the disk then expanding the linux partition on the internal HD.

I did this mostly for noobs who want an easy to use solution. This allows anyone to easily add USB peripherals with minimal linux knowledge on ATV1.

It includes XBMC and repositories add on, ATV remote support (easy third party remote support too as I have been testing with my PS3 Blue Ray remote after having lost the tiny apple remote).

I call it MiXBMCu (Mint XBMC Universal) as it also boots a PC with no issues when there is no internal HD. I suppose for a PC one might want to remove the max_cstate line from menu.lst.

I have it running off of an an 8 Gig Kingston memory stick and boot time on ATV is about 2 minutes, which I think can still be speed up. I think it boots faster than crystalbuntu too.

Have not tested with Broadcomm card (dont have one) but pretty sure that Mint will install them prug and pray, so only need to reboot to the Mint Gnome desktop.

I feel this also solves the problem of supporting multiple OSs and Distros, and allows one to USE XBMC easier.

MiXBMCu
Reply
#10
Just an upodate. Although max_cstate=2 made the start up auidio cleaner on Mint 10.10 , I have concluded that it is detrimental to videos like icefilms. Of the three tested videos the audio started jumping back and forth repeating words.

This is not somehthing I had seen before so I think it is fair to assume tha it does not work on Mint 10
Reply
#11
MarkosJal Wrote:I have managed to get a 2.6 Gig install of Mint 10 (ubuntu 10.10) up and running. I had to use grub legacy though, as I could not get Grub2 to work at all with the ATV bootloader. I added the max_cstate line to grub.lst and for the first time I heard the Mint desktop startup sound that was not chopped up or stuttering


So far so good now I think my last battles are HDMI audio and suspend or hibernate from XBMC, but I think the suspend/hibernate will never work. In fact when I tried some stuff I found on the net, it only made matters worse. Thank god for back - ups.

I have been working hard on this it will boot an ATV with or without internal HD and you could even copy to internal ATV HD , as I did last week, by booting to a separate copy (two copies of the same) and imaging one to the disk then expanding the linux partition on the internal HD.

I did this mostly for noobs who want an easy to use solution. This allows anyone to easily add USB peripherals with minimal linux knowledge on ATV1.

It includes XBMC and repositories add on, ATV remote support (easy third party remote support too as I have been testing with my PS3 Blue Ray remote after having lost the tiny apple remote).

I call it MiXBMCu (Mint XBMC Universal) as it also boots a PC with no issues when there is no internal HD. I suppose for a PC one might want to remove the max_cstate line from menu.lst.

I have it running off of an an 8 Gig Kingston memory stick and boot time on ATV is about 2 minutes, which I think can still be speed up. I think it boots faster than crystalbuntu too.

Have not tested with Broadcomm card (dont have one) but pretty sure that Mint will install them prug and pray, so only need to reboot to the Mint Gnome desktop.

I feel this also solves the problem of supporting multiple OSs and Distros, and allows one to USE XBMC easier.

MiXBMCu

There is no suspend/resume on an atv: it doesn't support it....

HDMI audio will never work with kernels newer than those found in Hardy.

If you do have a crystalhd card, it will run out of steam with RX errors on these newer kernels (ie Karmic and above). The only solution is a reboot: it's gets real old, real fast.....

You really are better off with Hardy on an ATV, that's just my personal opinion of course, but one reinforced by hands-on experience!

Jim
Reply

Logout Mark Read Team Forum Stats Members Help
Setting max_cstate0