My application uses a gstreamer pipeline which requires that CPU is used constantly at ~70% which is causing the iMX6 processor to get heated to about 75°C.
When this temperature is reached, the system tries to compensate by reducing the GPU frequency.
I get this message:
System is too hot. GPU3D will work at 1/64 clock.
This causes the pipeline to slow down(reduced frame-rates and increased lag). This is not acceptable for our application, so I am trying to under-clock the CPU frequency using this article.
I use the following shell script at startup:
#Set CPU governerto userspace (Doing this for multiple CPUs is redundant)
cpufreq-set -c 0 -g userspace
cpufreq-set -c 1 -g userspace
cpufreq-set -c 2 -g userspace
cpufreq-set -c 3 -g userspace
#Underclock the SBC to 0.33 of MAX
cpufreq-set -c 0 -f 396000000
cpufreq-set -c 1 -f 396000000
cpufreq-set -c 2 -f 396000000
cpufreq-set -c 3 -f 396000000
# Set the resolution to 1280x720
xrandr -d :0 --output 'DISP3 BG' --mode S:1280x720p-60 &
# Sleep for 1 second (let the system get ready)
#sleep 1
# Launch the gst-launch-1.0 based application
gst-launch-1.0 imxg2dcompositor name=c \
sink_0::xpos=0 sink_0::ypos=0 sink_0::width=320 sink_0::height=240 \
sink_1::xpos=320 sink_1::ypos=0 sink_1::width=320 sink_1::height=240 \
sink_2::xpos=640 sink_2::ypos=0 sink_2::width=320 sink_2::height=240 \
sink_3::xpos=0 sink_3::ypos=240 sink_3::width=320 sink_3::height=240 \
sink_4::xpos=320 sink_4::ypos=240 sink_4::width=320 sink_4::height=240 \
sink_5::xpos=640 sink_5::ypos=240 sink_5::width=320 sink_5::height=240 \
sink_6::xpos=0 sink_6::ypos=480 sink_6::width=320 sink_6::height=240 \
sink_7::xpos=320 sink_7::ypos=480 sink_7::width=320 sink_7::height=240 \
sink_8::xpos=640 sink_8::ypos=480 sink_8::width=320 sink_8::height=240 \
! "video/x-raw,width=960,height=720" ! overlaysink \
v4l2src norm=PAL device=/dev/video0 ! queue ! c.sink_0 \
v4l2src norm=PAL device=/dev/video1 ! queue ! c.sink_1 \
v4l2src norm=PAL device=/dev/video2 ! queue ! c.sink_2 \
v4l2src norm=PAL device=/dev/video3 ! queue ! c.sink_3 \
multifilesrc location="/home/root/logo%d.jpg" index=0 caps="image/jpeg,framerate=\(fraction\)12/1" loop=1 \
! jpegdec ! videoconvert ! videoscale ! video/x-raw,format=UYVY,width=320,height=240 ! c.sink_4 \
v4l2src norm=PAL device=/dev/video4 ! queue ! c.sink_5 \
v4l2src norm=PAL device=/dev/video5 ! queue ! c.sink_6 \
v4l2src norm=PAL device=/dev/video6 ! queue ! c.sink_7 \
v4l2src norm=PAL device=/dev/video7 ! queue ! c.sink_8 &
Even though this script is executed, the CPUs are still operating at the highest settable frequency.
Here is the output of cpufreq-info while my application is still running:
root@apalis-imx6:~/Desktop# cpufreq-info
cpufrequtils 008: cpufreq-info (C) Dominik Brodowski 2004-2009
Report errors and bugs to cpufreq@vger.kernel.org, please.
analyzing CPU 0:
driver: imx6q-cpufreq
CPUs which run at the same hardware frequency: 0 1 2 3
CPUs which need to have their frequency coordinated by software: 0 1 2 3
maximum transition latency: 109 us.
hardware limits: 396 MHz - 996 MHz
available frequency steps: 396 MHz, 792 MHz, 996 MHz
available cpufreq governors: conservative, ondemand, userspace, powersave, interactive, performance
current policy: frequency should be within 396 MHz and 996 MHz.
The governor "userspace" may decide which speed to use
within this range.
current CPU frequency is 996 MHz (asserted by call to hardware).
cpufreq stats: 396 MHz:61.08%, 792 MHz:0.02%, 996 MHz:38.89% (24)
analyzing CPU 1:
driver: imx6q-cpufreq
CPUs which run at the same hardware frequency: 0 1 2 3
CPUs which need to have their frequency coordinated by software: 0 1 2 3
maximum transition latency: 109 us.
hardware limits: 396 MHz - 996 MHz
available frequency steps: 396 MHz, 792 MHz, 996 MHz
available cpufreq governors: conservative, ondemand, userspace, powersave, interactive, performance
current policy: frequency should be within 396 MHz and 996 MHz.
The governor "userspace" may decide which speed to use
within this range.
current CPU frequency is 996 MHz (asserted by call to hardware).
cpufreq stats: 396 MHz:61.08%, 792 MHz:0.02%, 996 MHz:38.89% (24)
analyzing CPU 2:
driver: imx6q-cpufreq
CPUs which run at the same hardware frequency: 0 1 2 3
CPUs which need to have their frequency coordinated by software: 0 1 2 3
maximum transition latency: 109 us.
hardware limits: 396 MHz - 996 MHz
available frequency steps: 396 MHz, 792 MHz, 996 MHz
available cpufreq governors: conservative, ondemand, userspace, powersave, interactive, performance
current policy: frequency should be within 396 MHz and 996 MHz.
The governor "userspace" may decide which speed to use
within this range.
current CPU frequency is 996 MHz (asserted by call to hardware).
cpufreq stats: 396 MHz:61.08%, 792 MHz:0.02%, 996 MHz:38.89% (24)
analyzing CPU 3:
driver: imx6q-cpufreq
CPUs which run at the same hardware frequency: 0 1 2 3
CPUs which need to have their frequency coordinated by software: 0 1 2 3
maximum transition latency: 109 us.
hardware limits: 396 MHz - 996 MHz
available frequency steps: 396 MHz, 792 MHz, 996 MHz
available cpufreq governors: conservative, ondemand, userspace, powersave, interactive, performance
current policy: frequency should be within 396 MHz and 996 MHz.
The governor "userspace" may decide which speed to use
within this range.
current CPU frequency is 996 MHz (asserted by call to hardware).
cpufreq stats: 396 MHz:61.08%, 792 MHz:0.02%, 996 MHz:38.89% (24)
As you can see the CPU is operating at 996MHz even though it was explicitly set to 396Mhz.
Is the userspace governor increasing the CPU freq on demand? Is there any other way to throttle the CPU frequency such that it is not dynamically increased?