Acer Aspire TimelineX 3820TG mods/tweaks ONLY!

Discussion in 'Acer' started by prikolchik, Mar 16, 2011.

Thread Status:
Not open for further replies.
  1. Just_a_Nick

    Just_a_Nick Notebook Deity

    Reputations:
    280
    Messages:
    922
    Likes Received:
    0
    Trophy Points:
    30
    Nando4s guide doesn't work for me.

    I was not able to enable the ATI again.
     
  2. inteks

    inteks Notebook Evangelist

    Reputations:
    168
    Messages:
    372
    Likes Received:
    0
    Trophy Points:
    30
    it work for me by disable the pci exress root port 45 vie devicemanager.

    BUT it does not saves power !!! it looks like the ati device is still powered.
     
  3. _InKr_

    _InKr_ Notebook Guru

    Reputations:
    11
    Messages:
    72
    Likes Received:
    0
    Trophy Points:
    15
    Could you please check one thing with 3820tray. Add following code to you software:
    Code:
            
    while (true) {
                    unsigned char val = [B][COLOR="Red"]YourClass[/COLOR][/B]::ReadEC(0x93);
                    if (val != 0x04) {
    // any code to notify: dialog or write to file, whatever
                            LOG_WRITE("Error reading EC, expected 0x04, got=0x%x\n", int(val));
                    }
                    Sleep(9);
            }
    
    Then run RWEverything with EC opened and 3820tray.
    I have tested this on my system and very often get incorrect value from EC. With RWEverything closed - its all much better.

    @inteks

    O. And one more thing. It seems code you use to read EC is not quite correct:


    Code:
            private static bool WaitEC(ushort iPort, byte bVal) {
                for (int i = 0; i < 300; i++) {
                    var result = ols.ReadIoPortByte(iPort);
                    if (!Convert.ToBoolean(result & bVal)) return true;
                    Thread.Sleep(1);
                }
                return false;
            }
    
            private static bool WaitReadEC() {
                return WaitEC(0x66, 0x1);
            }
    
    it should be:

    Code:
            private static bool WaitEC[B][COLOR="Red"]Full[/COLOR][/B](ushort iPort, byte bVal) {
                for (int i = 0; i < 300; i++) {
                    var result = ols.ReadIoPortByte(iPort);
                    [B][COLOR="Red"]// ! is removed[/COLOR][/B]
                    if (Convert.ToBoolean(result & bVal)) return true;
                    [COLOR="Red"][B]//Thread.Sleep(1); //on linux here was udelay(10) - delay for 10microseconds, so under windows even Sleep(1) makes this code work incorrect[/B][/COLOR]
                }
                return false;
            }
    
            private static bool WaitReadEC() {
                return WaitEC[B][COLOR="Red"]Full[/COLOR][/B](0x66, 0x1);
            }
    
    Here is the source: http://tracker.coreboot.org/trac/coreboot/browser/trunk/src/ec/acpi/ec.c?rev=6442

    But even this code fails for me with RWEverything on background :(
     
  4. prikolchik

    prikolchik Notebook Evangelist

    Reputations:
    259
    Messages:
    362
    Likes Received:
    3
    Trophy Points:
    30
    It doesn't fail just with RWEverything running. It also fails with any CPU intensive task in the background. I tested it with Prime95 and your program simply chocked up and kept throwing assertion error. In fact, with Prime95 using 100% of my CPU, the system was still very responsive, but if I had your program open, it seemed to make my system freeze.

    I think the problem is that you poll EC way too often. Have you tried polling it every 1 second instead? I am not sure if you can, but assign a higher priority to the EC polling component? If I remember correctly, by default acerhdf reads temperature from EC every 1.5 second. As for the source code above, I think you can access EC more often on Linux, because you have better control over the hardware.

    If I had source code, I could probably test it :rolleyes:
     
  5. _InKr_

    _InKr_ Notebook Guru

    Reputations:
    11
    Messages:
    72
    Likes Received:
    0
    Trophy Points:
    15
    Actually, I do poll EC once a second. But you need to understand that it seems proper way to read EC is:
    1. Address = [EC_SC]
    2. Wait EC free
    3. Write 0x80 to [EC_SC]
    4. Wait IBF free
    5. Write Address to [EC_DATA]
    6. Wait IBF free
    7. Wait OBF full
    8. Read Data from [EC_DATA]

    The problem is on stage 7. OBF becomes full just few microseconds after step 5. So even Sleep(1) is not an option here and you forced to constantly read port in cycle and wait until OBF bit is set to true. Of course when CPU is 100% busy system will interrupt your thread leading to odd behavior: Windows user ring is not truly real-time system, so this is main concern when working with EC from here :(.

    I've attached ECTest sources in next message.

    Sources are attached.
     

    Attached Files:

  6. inteks

    inteks Notebook Evangelist

    Reputations:
    168
    Messages:
    372
    Likes Received:
    0
    Trophy Points:
    30
    i dont use ReadEC on my code. on the 1810tray version i saw that it not working correct any time so i use the MSR to get CPU temp.
    for ATI temp (to implement GPU Fan control) all my hope goes to Guru3D.com Forums - View Single Post - MSI Afterburner .NET Class Library

    ;)





    PS:
    here some code (winring0 required)

    Code:
      public static int tjMax;
            public static byte GetCoreTemp(){
            //var tjmax = 105;
                
    
            uint dwEAX = 0, dwEDX = 0;
    
            ols.RdmsrPx(0x19C, ref dwEAX, ref dwEDX, pz1 );
    
            dwEAX = dwEAX & 0xFF0000;
            dwEAX = dwEAX >> 16;
            var core1 =  (byte) (tjMax - dwEAX);
            if (corecount == 1) return core1;
    
    
            dwEAX = 0; dwEDX = 0;
    
            ols.RdmsrPx(0x19C, ref dwEAX, ref dwEDX, pz2);
    
            dwEAX = dwEAX & 0xFF0000;
            dwEAX = dwEAX >> 16;
            var core2 =  (byte) (tjMax - dwEAX);
    
    
            ols.RdmsrPx(0x19C, ref dwEAX, ref dwEDX, pz3);
    
            dwEAX = dwEAX & 0xFF0000;
            dwEAX = dwEAX >> 16;
            var core3 = (byte)(tjMax - dwEAX);
    
            ols.RdmsrPx(0x19C, ref dwEAX, ref dwEDX, pz4);
    
            dwEAX = dwEAX & 0xFF0000;
            dwEAX = dwEAX >> 16;
            var core4 = (byte)(tjMax - dwEAX);
    
                byte coremax = 0;
                if (core1 > coremax) coremax = core1;
                if (core2 > coremax) coremax = core2;
                if (core3 > coremax) coremax = core3;
                if (core4 > coremax) coremax = core4;
                return coremax;
          
    
        }
    
     
  7. inteks

    inteks Notebook Evangelist

    Reputations:
    168
    Messages:
    372
    Likes Received:
    0
    Trophy Points:
    30
    have you tryed this:

    Code:
     private static bool WaitEC(ushort iPort, byte bVal) {
                for (int i = 0; i < 300; i++) {
                    var result = ols.ReadIoPortByte(iPort);
                    if (!Convert.ToBoolean(result & bVal)) return true;
                    var start = DateTime.Now; while((DateTime.Now -start).Ticks < 100){}
                    
                }
                return false;
            }
    
     
  8. User Retired 2

    User Retired 2 Notebook Nobel Laureate NBR Reviewer

    Reputations:
    4,127
    Messages:
    7,892
    Likes Received:
    9
    Trophy Points:
    0
    Disabling pci express port via device manager is required first. Then disable the x16 port via r-w everything or baredit at 0:0.0 54 bit 1=0. Then can do a device manager rescan and the ATI device will be gone. Confirm if there are power savings or not. I'm assuming the ATi device will go into a power savings mode when not on the PCI BUS.

    If it's not power saving then would need to capture a dump of it's pci space (4KB) when it is power saving. Load that into the ATI card after disabling it in Device Manager, then disabling the x16 link.

    I believe that will do the trick. Just needs a nice r-w everything script + batch file to manage it all OR Inteks could consider doing the equivalent steps in 3820TGTray.
     
  9. _InKr_

    _InKr_ Notebook Guru

    Reputations:
    11
    Messages:
    72
    Likes Received:
    0
    Trophy Points:
    15
    Do you mean you do not read EC in 3820tray? Only write? Or I misunderstand?
     
  10. inteks

    inteks Notebook Evangelist

    Reputations:
    168
    Messages:
    372
    Likes Received:
    0
    Trophy Points:
    30
    yepp. only write.
     
Loading...
Thread Status:
Not open for further replies.

Share This Page