thanks for this, netxshare.
i noticed some functions like getTemp() weren't working that well (value was set only when setIndex() was called), so i updated it a little.
i also added the setFanAuto() function to reset the fan speed to automatic..i know aticonfig pplib-cmd set fanspeed doesn't quite work, so this turned out to be a nice solution.
don't think i can upload attachments so here's the patch inline.
--- pyADL.cpp 2011-06-09 12:45:32.000000000 -0700
+++ pyADL-new.cpp 2011-08-17 21:47:14.967520700 -0700
@@ -70,6 +70,7 @@
if (adl->GetSupportedFeatures() & ADL::FEAT_GET_ACTIVITY)
{
+ adl->UpdateData();
Results = Py_BuildValue("i", adl->mODActivity.iActivityPercent);
return Results;
}
@@ -85,6 +86,7 @@
PyObject *Results;
if (adl->GetSupportedFeatures() & ADL::FEAT_GET_TEMPERATURE)
{
+ adl->UpdateData();
Results = Py_BuildValue("f", (float)adl->mTemperature.iTemperature/1000.0);
return Results;
}
@@ -102,6 +104,7 @@
PyObject *Results;
if ((adl->GetSupportedFeatures() & ADL::FEAT_GET_FANSPEED_INFO) && (adl->GetSupportedFeatures() & ADL::FEAT_GET_FANSPEED))
{
+ adl->UpdateData();
Results = Py_BuildValue("i", adl->mCurrentFanSpeed.iFanSpeed * 100 / adl->mFanSpeedInfo.iMaxRPM);
return Results;
}
@@ -120,6 +123,7 @@
if ((adl->GetSupportedFeatures() & ADL::FEAT_GET_FANSPEED_INFO) && (adl->GetSupportedFeatures() & ADL::FEAT_GET_FANSPEED))
{
+ adl->UpdateData();
Results = Py_BuildValue("i", adl->mCurrentFanSpeed.iFanSpeed);
return Results;
}
@@ -139,6 +143,7 @@
if (adl->GetSupportedFeatures() & ADL::FEAT_GET_OD_PARAMETERS)
{
+ adl->UpdateData();
Results = Py_BuildValue("i", adl->mpODPerformanceLevels->aLevels[adl->mODActivity.iCurrentPerformanceLevel].iEngineClock/100);
return Results;
}
@@ -157,6 +162,7 @@
if (adl->GetSupportedFeatures() & ADL::FEAT_GET_OD_PARAMETERS)
{
+ adl->UpdateData();
Results = Py_BuildValue("i", adl->mpODPerformanceLevels->aLevels[adl->mODActivity.iCurrentPerformanceLevel].iMemoryClock/100);
return Results;
}
@@ -173,6 +179,7 @@
PyObject *Results;
if (adl->GetSupportedFeatures() & ADL::FEAT_GET_OD_PARAMETERS)
{
+ adl->UpdateData();
Results = Py_BuildValue("f", (float)adl->mpODPerformanceLevels->aLevels[adl->mODActivity.iCurrentPerformanceLevel].iVddc/1000.0);
return Results;
}
@@ -221,6 +228,29 @@
}
+static PyObject *setFanAuto(PyObject *self, PyObject *noargs)
+{
+ if (adl->GetSupportedFeatures() & ADL::FEAT_GET_FANSPEED)
+ {
+ if(SAVE_CALL(adl->ADL_Overdrive5_FanSpeedToDefault_Set)(adl->GetGPUIndex(), 0)
+!= ADL_OK)
+ {
+ Py_INCREF(Py_False);
+ return Py_False;
+ }
+ else
+ {
+ ACT_LOG("Fan speed set to AUTO");
+ Py_INCREF(Py_True);
+ return Py_True;
+ }
+
+ }
+
+ Py_INCREF(Py_False);
+ return Py_False;
+}
+
static PyObject *setCoreClockSpeed(PyObject *self, PyObject *args)
{
int Level,CoreSpeed;
@@ -373,6 +403,7 @@
{"getMemoryClockSpeed", getMemoryClockSpeed, METH_NOARGS, "Returns Current Memory Clock Speed."},
{"getVoltage", getVoltage, METH_NOARGS, "Returns Current Voltage."},
{"setFanSpeed", setFanSpeed, METH_VARARGS, "Sets The Fan Speed."},
+ {"setFanAuto", setFanAuto, METH_NOARGS, "Sets The Fan Speed To Automatic."},
{"setCoreClockSpeed", setCoreClockSpeed, METH_VARARGS, "Sets The Core Clock Speed."},
{"setMemoryClockSpeed", setMemoryClockSpeed, METH_VARARGS, "Sets The Memory Clock Speed."},
{"setVoltage", setVoltage, METH_VARARGS, "Sets The GPU Voltage."},