The image is standard Ubuntu for Pi, 22.04.5, with other kernel.
Indeed, 24.04 fails during set up (Wifi fails to set up during to a failing systemd service on first boot).
That’s why I have not provided a distro of that release.
The image is standard Ubuntu for Pi, 22.04.5, with other kernel.
Indeed, 24.04 fails during set up (Wifi fails to set up during to a failing systemd service on first boot).
That’s why I have not provided a distro of that release.
You can also change the gobernor in the up right corner once logged in
Yep I noticed that you can switch between Power Saver and Balanced… I think the Performance profile missing might be a bug in the powerprofilesctl tool, because it seems like you can’t use performance on a regular pi either.
First things first, thank you for the Ubuntu image.
I currently use the Non-LowPower variant.
I have the same problem with frequency scaling like others here.
I also tried to change the power plan via GUI. But the governor does not change.
Once I set it to ondemand via terminal in /sys/devices/system/cpu/cpufreq/policy0/scaling_governor, then there is frequency variation. But after reboot it reverts back to powersave even when I clearly had selected Balanced in the GUI the whole time.
Is there a script, that (re)sets the governor on boot?
It would be great if the GUI setting would set ondemand while the powerplan is at Balanced and powersave while the powerplan ist at Powersave and ideal if this would be honoured after reboot.
Furthermore, I would like to ask what the difference between the LowPower and the Non-LowPower version is. Which settings are affected and how?
Thank you in advance for your answer and a possible solution.
I have complementary questions regarding the image.
In the Debian Image for uConsole , there is an apt repository for the additional stuff and kernel.
How will the kernel be updated in the Ubuntu image? Is there an automated way?
Currently this is a custom kernel with no upstream support I assume, therefore the are no updates via Ubuntu standard repositories, is that correct?
Could one integrate the same repository used in the Debian image in your image?
What do you recommend or do you have plans regarding this issue?
I created a workaround via cron by adding the following:
@reboot echo ondemand > /sys/devices/system/cpu/cpufreq/policy0/scaling_governor
This can be done via
sudo crontab -e
and seems to working fine for me so far.
Has anyone created an IMG file ? For those who are not good at compiling kernels? What doesn’t work?
The situation is the opposite; there ISN’T any script, and the kernel is setting to default.
You have to introduce, in a terminal:
sudo apt install -y cpufreqd cpufrequtils
Then edit sudo nano /etc/init.d/cpufrequtils
Then in this lines:
# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_governors
# cat /sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies
# This will enable max speed, no throttling down, performance gov.
ENABLE="true"
GOVERNOR="performance"
MAX_SPEED="1500000"
MIN_SPEED="1500000"
# Note: MIN_SPEED="600000",
# along with GOVERNOR="ondemand" would be wiser:
# Because you don't need 1.8Ghz just to be idling, and the batt will last longer.
# With "ondemand" governor, you'll get the max cpu freq
# _just only and always_ you're needing it.
Then sudo /etc/init.d/cpufrequtils restart
.
To update the kernel, you must compile @Rex’s kernel from source, preferably generating the .deb packages just in case you need them later.
DON’T PANIC, it is easy
These are te instructions to do it:
# Prepare dir and download.
mkdir -p /usr/local/src/linux && cd /usr/local/src/linux
### To date, no other branch than rpi-6.6.y is present in the repo.
git clone -b rpi-6.6.y https://github.com/ak-rex/ClockworkPi-linux.git
cd ClockworkPi-linux
### Install kernel dependencies
sudo apt build-dep -y linux linux-image-unsigned-6.8.0-49-generic linux-image-unsigned-6.8.0-49-lowlatency
sudo apt install -y libncurses-dev gawk flex bison openssl libssl-dev dkms libelf-dev libudev-dev libpci-dev libiberty-dev autoconf \
curl llvm git qemu-user-static gcc-12 g++-12 qemu-user-static binfmt-support
sudo apt install -y bc bison flex libssl-dev make libc6-dev libncurses5-dev debhelper-compat
sudo apt install -y crossbuild-essential-arm64
#ENV_VARS
export $(dpkg-architecture -aarm64)
export CROSS_COMPILE=aarch64-linux-gnu-
# COMPILE KERNEL
KERNEL=kernel8
make bcm2711_defconfig
make -j6 deb-pkg LOCALVERSION=-raspi
Correct. Kernel updates requires recompiling a patched kernel. The patch can be obtained here:
https://github.com/raspberrypi/linux/compare/rpi-6.6.y...ak-rex:ClockworkPi-linux:rpi-6.6.y.diff
Then it can be applied to other kernel versions, with some edits.
Better delete that cron line editing again with crontab -e
and install cpufrequtils as I indicate above.
Thank you for your reply.
Sadly the cpufreqd approach does not work.
It does not matter what governor I choose or what frequency I set in the config file. Neither has an effekt. Also cpufreq-set seems to haave any impact.
My crontab workaround is the superior option still, as it scales frequencies and actually uses ondemand as governor.
This scaling works correct out of the box when using the RPi 24.04 image from the Ubuntu.com page, so it seems to be related to the patches.
Regarding the patches: At what point did you integrate the display? As per my other thread, I got 24.04 running on the uConsole with working WiFi, just not with a working internal display. Maybe the efforts could be combined to create fully working 24.04 image.
You can try now again the script I made to build the image. I commited a near to final version for 22.04.5 and should work out of the box from a arm64 host with Ubuntu 22.04.
The package is cpufrequtils
, not cpufreqd
. This package is /etc/init.d/ script that will take care of calling cpufreq-set based on CPU useage and configured governor.
The instructions provided are the way to do, and it works. After restarting the service, you can check it has effect by using cpufreq-info
. Just remember calling systemctl daemon-reload
after editing it.
I used cpufrequtils exactly for that and it did not work. By the way, you yourself mentioned cpufreqd in your “apt install” commandline. Obviously I edited the init.d script but to no avail, see my prevoius post.
As I also mentioned cpufreq-set, which is another tool from the set did exactly nothing, which could be observed with cpufreq-info.
I also did a complete reboot of the system and nothing changed.
Also it has to be said, that in the official Ubuntu images, neither cpufrequtils nor cpufreqd is installed and scaling, ondemand, etc. works just fine. So this is obviously totally not mandatory.
My cron approach uses the built-in capabilities and just set the correct default governor, hence returning the standard behaviour of the standard image.
That was also the reason I asked you, if there were any custom script or settings, as the fixed 600Mhz are not standard in the official image at all.
Therefore I assumed that these settings come with the custom kernel, as the stock kernel does not have this limitation.
As it seems, Ubuntu by default uses cpupower (since 24.04?), which has it own set of commands and power-profile-daemon, which can be controlled via powerprofilesctl (also present in 22.04).
Also, in this/your image, the GNOME power settings are inoperative, another user also stated, as these settings do not change the governor. So there must be root cause for all of this
Therefore there should be absolutely no need to install cpufrequtils.
I do not want to argue with you. I just want to get these methods working as expected.
And currently, my little cron workaround restores the standard functionality, at least for the balanced power plan, without any additional software, using the whole frequency spectrum from 600MHz to 1,5GHz, which can be checked with:
cat /sys/devices/system/cpu/cpufreq/policy0/stats/time_in_state
After configuring /etc/init.d/cpufrequtils
with this settings, and restarting it:
ENABLE="true"
GOVERNOR="ondemand"
MAX_SPEED="600000"
MIN_SPEED="1500000"
Running cpufreq-info
shows it is running perfectly:
Report errors and bugs to cpufreq@vger.kernel.org, please.
analyzing CPU 0:
driver: cpufreq-dt
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: 0.97 ms.
hardware limits: 600 MHz - 1.50 GHz
available frequency steps: 600 MHz, 700 MHz, 800 MHz, 900 MHz, 1000 MHz, 1.10 GHz, 1.20 GHz, 1.30 GHz, 1.40 GHz, 1.50 GHz
available cpufreq governors: conservative, ondemand, userspace, powersave, performance, schedutil
->**current policy: frequency should be within 600 MHz and 1.50 GHz. **
** The governor "ondemand" may decide which speed to use**
** within this range. **<-
current CPU frequency is 600 MHz.
cpufreq stats: 600 MHz:89.11%, 700 MHz:1.19%, 800 MHz:0.26%, 900 MHz:0.28%, 1000 MHz:0.37%, 1.10 GHz:0.35%, 1.20 GHz:0.29%, 1.30 GHz:0.21%, 1.40 GHz:0.32%, 1.50 GHz:7.60% (2784)
analyzing CPU 1:
driver: cpufreq-dt
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: 0.97 ms.
hardware limits: 600 MHz - 1.50 GHz
available frequency steps: 600 MHz, 700 MHz, 800 MHz, 900 MHz, 1000 MHz, 1.10 GHz, 1.20 GHz, 1.30 GHz, 1.40 GHz, 1.50 GHz
available cpufreq governors: conservative, ondemand, userspace, powersave, performance, schedutil
->current policy: frequency should be within 600 MHz and 1.50 GHz.
The governor "ondemand" may decide which speed to use
within this range.
current CPU frequency is 600 MHz.
cpufreq stats: 600 MHz:89.11%, 700 MHz:1.19%, 800 MHz:0.26%, 900 MHz:0.28%, 1000 MHz:0.37%, 1.10 GHz:0.35%, 1.20 GHz:0.29%, 1.30 GHz:0.21%, 1.40 GHz:0.32%, 1.50 GHz:7.60% (2784)
analyzing CPU 2:
driver: cpufreq-dt
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: 0.97 ms.
hardware limits: 600 MHz - 1.50 GHz
available frequency steps: 600 MHz, 700 MHz, 800 MHz, 900 MHz, 1000 MHz, 1.10 GHz, 1.20 GHz, 1.30 GHz, 1.40 GHz, 1.50 GHz
available cpufreq governors: conservative, ondemand, userspace, powersave, performance, schedutil
->current policy: frequency should be within 600 MHz and 1.50 GHz.
The governor "ondemand" may decide which speed to use
within this range.
current CPU frequency is 600 MHz.
cpufreq stats: 600 MHz:89.11%, 700 MHz:1.19%, 800 MHz:0.26%, 900 MHz:0.28%, 1000 MHz:0.37%, 1.10 GHz:0.35%, 1.20 GHz:0.29%, 1.30 GHz:0.21%, 1.40 GHz:0.32%, 1.50 GHz:7.60% (2784)
analyzing CPU 3:
driver: cpufreq-dt
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: 0.97 ms.
hardware limits: 600 MHz - 1.50 GHz
available frequency steps: 600 MHz, 700 MHz, 800 MHz, 900 MHz, 1000 MHz, 1.10 GHz, 1.20 GHz, 1.30 GHz, 1.40 GHz, 1.50 GHz
available cpufreq governors: conservative, ondemand, userspace, powersave, performance, schedutil
->current policy: frequency should be within 600 MHz and 1.50 GHz.
The governor "ondemand" may decide which speed to use
within this range.
current CPU frequency is 600 MHz.
cpufreq stats: 600 MHz:89.11%, 700 MHz:1.19%, 800 MHz:0.26%, 900 MHz:0.28%, 1000 MHz:0.37%, 1.10 GHz:0.35%, 1.20 GHz:0.29%, 1.30 GHz:0.21%, 1.40 GHz:0.32%, 1.50 GHz:7.60% (2784)
You can observe also that intermediate speeds has the less percentage in the stats, being 600MHz when idling, and 1.5GHz when the CPU has load the ones with more uptime percentage.
In other words, there’s nothing to fix, it works perfectly as expected.
I think we are talking past one another.
And one question is, does your cpufrequtils approach fixes the non-functioning power plan menu?
My point is, that per default, there is no need for this additional software (cpufrequtils).
If one changes one parameter in /sys/devices/system/cpu/cpufreq/policy0/scaling_governor (to ondemand) the default behaviour can be achieved, without having to install this software.
Therefore the question is still, what introduces this deviation from the default.
My second point is, that the normal controls (e.g. power plan selection) should function as expected.
My third point is, and this is one you mentioned on the very top of the post, to get 24.04 running on the device with working WiFi, which I did get to run, just the internal display was/is not working yet. But this likely can be fixed by integrating the mentioned patch files for the 4G module and the display with the stock kernel. I would refrain from using Rex’s kernel, as the other stuff seemed to work out of the box on 24.04 with the current 6.8.0 kernel.
Either if you use your crontab method or cpufrequtils, the Gnome option setting will be overriden (you can’t use both metods; either it is your crontab setting the governor, or cpufrequtils, or Gnome, but not two of them at the same time).
You can do as you please; I showed you the method that works for me.
With the provided image builder script,
change git kernel’s branch from rpi-6.9.y
to rpi-6.8.y
, then apply @Rex patch (the script will do for you, just edit line 32
).
If you want to select another Ubuntu version, change also line 60
, changing the download link, and then renaming all occurences of ubuntu-22.04.5-preinstalled-desktop-arm64+raspi.img
accordingly.
Run the script as root and wait about 3hrs. Then flash the .xz image and test it.
Tell me how it goes later.
I will again try to clarify:
Even without applying any kind of change or workaround to your image, the GNOME power menu has no effect, so there is a problem from the get go.
My cron workaround just sets the default balanced setting to the correct governor, which in turn act then normally.
This issue should be fixed in my opinion. And yes, the cron workaround as well as the cpufrequtils approach is no solution but a workaround for this.
Then ask in Ubuntu forums, the image is just base vanilla Ubuntu 22.04 with a custom kernel, whose developer is @Rex .
Not a single change but replacing the kernel is done to the image. I cannot and won’t “fix” Ubuntu, that’s Canonycal’s job.
If you want to change the governor, I already told you how I do. If you want to do it in a particular specific way, and that particular specific way is flawed (Gnome settings just have two of all the governors available), I won’t do anything in respect.
I hope you understand I just did a script to create an image for my personal use, that I later shared here, as I wanted to use Ubuntu in the uConsole. But that was all my part there, for support on Ubuntu, ask ubuntu, for support with the kernel, ask @Rex , then just an only for support on creating an image, or general Ubuntu / Debian way to do that do not require that I fix something, ask me.
Hi there.
Is there a way to activate the 4G modem?
I found the file uconsole-4g-cm4.py at /usr/local/bin/uconsole-4g-cm4.py.
Of course, it didn’t run because there was no shebang. That was easy to fix—I added the following at the beginning:
#! /usr/bin/env python3
Unfortunately, when I try to run it, I get an error related to GPIO ports:
~ uconsole-4g-cm4.py enable
Power on 4G module on uConsole cm4
Traceback (most recent call last):
File "/usr/local/bin/uconsole-4g-cm4.py", line 56, in <module>
enable4g()
File "/usr/local/bin/uconsole-4g-cm4.py", line 16, in enable4g
h = lgpio.gpiochip_open(0)
File "/usr/lib/python3/dist-packages/lgpio.py", line 648, in gpiochip_open
return _u2i(handle)
File "/usr/lib/python3/dist-packages/lgpio.py", line 461, in _u2i
raise error(error_text(v))
lgpio.error: 'can not open gpiochip'
Do you have any suggestions?
The correct way to invoke the script is:
~ sudo python3 /usr/local/bin/uconsole-4g-cm4.py enable
The output will take a little to end, but it works. After you execute that command, you can enable and disable the mobile network under ubuntu settings [[ please note, takes around 1 minute to refresh the interface and show or not the Mobile Network section ]]. You can disable it either by turning mobile network off in ubuntu settings, or running with the disable
argument.
Note that there exists a service unit under /etc/systemd/system/uconsole-4g-cm4.service
to manage it at boot and poweroff.
Those scripts belongs to the gpio package my script builds during the image creation. The package is under /usr/local/src/
.
It consists only in text files and can be unpacked and repacked as follows:
#Unpack
dpkg-deb -R original.deb tmp
#Repack
dpkg-deb -b tmp fixed.deb
To fix WiFi issues, I patched brcm in /usr/lib/firmware/
, recompiled and installed the kernel… but no luck.
dmesg
Direct firmware load for brcm/brcmfmac43455-sdio.raspberrypi,4-model-b.txt failed with error -2
Direct firmware load for brcm/brcmfmac43455-* failed with error -2
...Patch brcm/BCM4345C0.hcd not found
...
The kernel boot, but the screen doesn’t work—looks like a DSI panel issue.
Just stick on 22.04 a moment, before new Ubuntu LTS (LTS🤔). there are a lot of legacy and compatible issues.