Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Odroid N2 | Testing and developing #5039

Closed
MichaIng opened this issue Dec 7, 2021 · 68 comments
Closed

Odroid N2 | Testing and developing #5039

MichaIng opened this issue Dec 7, 2021 · 68 comments

Comments

@MichaIng
Copy link
Owner

MichaIng commented Dec 7, 2021

EDIT new image available for testing: https://dietpi.com/downloads/images/

Finally I have an Odroid N2+ 4 GiB here, many thanks to Hardkernel for providing it.

The included eMMC module contained an Ubuntu image and I verified that kernel and /boot/boot.ini both match ours precisely. Okay not 100%, we only allocate the device tree overlay RAM address when any overlays are actually enabled, which are as well not in our case (no second UART, no SPI and I2C enabled by default) and we do not set overclocking settings to the kernel command line but leave them empty so that the system can fall back to the default. However verified that this all works as expected, and otherwise all bootloader/kernel/firmware wise our image matches the official Hardkernel image, which is intended for now.

First boot

First of all I needed to tinker a bit before I was able to login/do input via debug UART /dev/ttyS0, but now it works fine (NB: Flow control: None!), as an alternative to SSH and for watching/debugging early boot logs.

There are some kernel errors at boot. So far I see no negative impact, but while this is not uncommon, I don't like it, but it doesn't seem to cause issues:

dmesg -l emerg,alert,crit,err
[    0.000000]  7f800000 - 80000000,     8192 KB, linux,meson-fb
[    0.000000]  e5800000 - ed800000,   131072 KB, linux,ion-dev
[    0.000000]  e3000000 - e5800000,    40960 KB, linux,di_cma
[    0.000000]  e3000000 - e3000000,        0 KB, linux,ppmgr
[    0.000000]  cfc00000 - e3000000,   315392 KB, linux,codec_mm_cma
[    0.000000]  cfc00000 - cfc00000,        0 KB, linux,codec_mm_reserved
[    0.000000]  05000000 - 05400000,     4096 KB, linux,secmon
[    0.321811] codec_mm_module_init
[    0.326557] clkmsr ffd18004.meson_clk_msr: failed to get msr ring reg0
[    0.341014] cvbs_out: chrdev devno 264241152 for disp
[    0.473832] dmi: Firmware registration failed.
[    0.840325] meson-pwm ff802000.pwm: pwm pinmux : can't get pinctrl
[    0.840591] meson-pwm ffd1b000.pwm: pwm pinmux : can't get pinctrl
[    0.846499] mtdoops: mtd device (mtddev=name/number) must be supplied
[    0.867599] meson_cpufreq_init:don't find the node <dynamic_gp1_clk>
[    0.869620] meson_cpufreq_init:don't find the node <dynamic_gp1_clk>
[    0.871789] ff803000.serial: clock gate not found
[    3.008701] meson-fb meson-fb: create ion_client ffffffc0676479c0, handle=ffffffc067668dc0
[    3.008705] meson-fb meson-fb: ion memory(0): created fb at 0x00000000e5800000, size 75 MiB
[    3.273889] di_get_vpu_clkb: get clk vpu error.
[    3.479325] Reserved memory: failed to init DMA memory pool at 0x00000000e3000000, size 0 MiB
[    3.703736] meson-mmc: >>>>>>>>hostbase ffffff8008593000, dmode
[    3.768102] meson-mmc: >>>>>>>>hostbase ffffff800859c000, dmode
[    3.820022] cectx ff80023c.aocec: cec driver date:2019/10/22: finetune ARB rising time

[    3.830588] cectx ff80023c.aocec: compatible:amlogic, aocec-g12a
[    3.836508] cectx ff80023c.aocec: cecb_ver:0x1
[    3.841056] cectx ff80023c.aocec: line_reg:0x1
[    3.845726] cectx ff80023c.aocec: line_bit:0x3
[    3.850296] cectx ff80023c.aocec: ee_to_ao:0x1
[    3.860771] cectx ff80023c.aocec: not find 'port_num'
[    3.865873] cectx ff80023c.aocec: using cec:1
[    4.024311] cectx ff80023c.aocec: no hdmirx regs
[    4.029057] cectx ff80023c.aocec: no hhi regs
[    4.033568] cectx ff80023c.aocec: not find 'output'
[    4.042094] cectx ff80023c.aocec: wakeup_reason:0x0
[    4.047035] cectx ff80023c.aocec: cev val1: 0x0;val2: 0x0
[    4.052546] cectx ff80023c.aocec: aml_cec_probe success end
[    4.191782] defendkey ff630218.defendkey: Reserved memory is not enough!
[    4.217350] Error: Driver 'spdif-dit' is already registered, aborting...
[    4.523157] aml_codec_T9015 ff632000.t9015: ASoC: no source widget found for Left DAC
[    4.527049] aml_codec_T9015 ff632000.t9015: ASoC: Failed to add route Left DAC -> LOLP_SEL_DACL -> Lineout left P switch
[    4.538063] aml_codec_T9015 ff632000.t9015: ASoC: no source widget found for Left DAC
[    4.546032] aml_codec_T9015 ff632000.t9015: ASoC: Failed to add route Left DAC -> LOLP_SEL_DACL_INV -> Lineout left P switch
[    4.557386] aml_codec_T9015 ff632000.t9015: ASoC: no source widget found for Left DAC
[    4.565361] aml_codec_T9015 ff632000.t9015: ASoC: Failed to add route Left DAC -> LOLN_SEL_DACL_INV -> Lineout left N switch
[    4.576712] aml_codec_T9015 ff632000.t9015: ASoC: no source widget found for Left DAC
[    4.584686] aml_codec_T9015 ff632000.t9015: ASoC: Failed to add route Left DAC -> LOLN_SEL_DACL -> Lineout left N switch
[    4.595694] aml_codec_T9015 ff632000.t9015: ASoC: no source widget found for Right DAC
[    4.603752] aml_codec_T9015 ff632000.t9015: ASoC: Failed to add route Right DAC -> LORP_SEL_DACR -> Lineout right P switch
[    4.614932] aml_codec_T9015 ff632000.t9015: ASoC: no source widget found for Right DAC
[    4.622992] aml_codec_T9015 ff632000.t9015: ASoC: Failed to add route Right DAC -> LORP_SEL_DACR_INV -> Lineout right P switch
[    4.634521] aml_codec_T9015 ff632000.t9015: ASoC: no source widget found for Right DAC
[    4.642579] aml_codec_T9015 ff632000.t9015: ASoC: Failed to add route Right DAC -> LORN_SEL_DACR_INV -> Lineout right N switch
[    4.654128] aml_codec_T9015 ff632000.t9015: ASoC: no source widget found for Right DAC
[    4.662166] aml_codec_T9015 ff632000.t9015: ASoC: Failed to add route Right DAC -> LORN_SEL_DACR -> Lineout right N switch
[    4.706571] aml_codec_T9015 ff632000.t9015: ASoC: mux Lineout left P switch has no paths
[    4.714775] aml_codec_T9015 ff632000.t9015: ASoC: mux Lineout left N switch has no paths
[    4.723007] aml_codec_T9015 ff632000.t9015: ASoC: mux Lineout right P switch has no paths
[    4.731329] aml_codec_T9015 ff632000.t9015: ASoC: mux Lineout right N switch has no paths
[    5.125427] thermal thermal_zone0: binding zone soc_thermal with cdev thermal-cpufreq-0 failed:-22
[    5.189521] pm-meson aml_pm: Can't get switch_clk81
[    5.877359] cgroup: cgroup2: unknown option "nsdelegate"
  • cgroup2 is among it, and this is expected since this kernel Linux 4.4 does not really have cgroup2 support.
  • Many are obviously informational only, so the question is why they are shown with error (or worse) severity.
  • Interesting is the 75 MiB allocated for the meson framebuffer, but more on that later.

Benchmarks

Benchmark done, and... this is a monster! 😱

cat /var/lib/dietpi/dietpi-benchmark/results
# -------------------------
# DietPi-Benchmark
# -------------------------
BENCH_VERSION=2
BENCH_HW_MODEL=15
BENCH_CPU='3.92'
BENCH_ROOTFS_WRITE='47'
BENCH_ROOTFS_READ='138'
BENCH_RAM_WRITE='1142'
BENCH_RAM_READ='1618'
BENCH_CUSTOMFS_WRITE='Not tested'
BENCH_CUSTOMFS_READ='Not tested'
BENCH_CPU_TEMP_START='29'
BENCH_CPU_TEMP_END='38'
BENCH_NET_LAN_SPEED='Not tested'
  • No overclocking done
  • Booting from bundled 16 GiB eMMC
  • CPU score is a new record in our survey 😄: https://dietpi.com/survey/#benchmark
  • The other scores around average, probably for more reliable RAM R/W results we need a larger test file for a systems with this speed 🤔.

Headless mode

As mentioned, interesting is the RAM allocated for the framebuffer. I assured this is still done when every video based config in /boot/boot.ini is disabled, which is. The framebuffer device is located at /proc/device-tree/meson-fb, so let's create a device tree overlay to disable it:

cat << '_EOF_' > headless.dts
/dts-v1/;
/plugin/;
/ {
	compatible = "brcm,bcm2835";
	fragment@0 {
		target-path = "/soc/fb";
		__overlay__ {
			status = "disabled";
		};
	};
};
_EOF_
G_AGI device-tree-compiler
dtc -I dts -O dtb -o /boot/overlays/odroidn2/headless.dtbo headless.dts
overlays=$(mawk -F\" '/^setenv overlays "/{print $2}' /boot/boot.ini)
[[ $overlays =~ (^| )headless( |$) ]] || G_CONFIG_INJECT 'setenv overlays "' "setenv overlays \"${overlays:+$overlays }headless\"" /boot/boot.ini
free -m
reboot

Prior to reboot:

# free -m
               total        used        free      shared  buff/cache   available
Mem:            3713         131        3481           5         100        3463
Swap:              0    

After reboot:

# free -m
               total        used        free      shared  buff/cache   available
Mem:            3713          52        3574           5          85        3549
Swap:              0           0           0
# cat /proc/device-tree/meson-fb/status
disabled

Quite precisely the 75 MiB less.

But why that complicated, we are on U-Boot with a /boot/boot.ini where we can remove whole parts of the device tree right form the start: I removed/disabled the overlay again and instead added the device tree removals close to the end of /boot/boot.ini so that it looks like that:

# Load device tree overlays
if test "x${overlays}" != "x"; then
        setenv dtbo_addr_r "0x11000000"
        fdt resize "16384"
        for overlay in ${overlays}; do
                fatload mmc ${devno}:1 ${dtbo_addr_r} overlays/${board}/${overlay}.dtbo && fdt apply ${dtbo_addr_r}
        done
fi

# Headless
fdt rm /meson-fb

# Unzip the kernel
unzip ${k_addr} ${loadaddr}

# Boot
booti ${loadaddr} ${initrd_loadaddr} ${dtb_loadaddr}

Works, but some drivers then fail, expectedly. I tried to remove more video/codec related devices, but this either leads to various additional kernel errors or even renders the system unbootable since parts of the kernel expect them, some drivers, or one device references the other. Could be tuning by carefully checking cross-dependencies. However, same result:

# free -m
               total        used        free      shared  buff/cache   available
Mem:            3713          52        3574           5          87        3549
Swap:              0           0           0

Probably it would be possible to lower this to 40 MiB idle RAM, but the framebuffer module only is the major part. Btw, while the serial console keeps working without the framebuffer, it has a limited size of 640x480 (or so) 😄. SSH of course is completely unaffected.

We'll add this as headless mode with DietPi v8.0 I'd say, probably with v7.9 already when I find time to do some more tests. If someone could verify that this works the same way on Odroid C4, that would be awesome! I'm not sure whether on HC4 this is disabled by default, would make sense at least, otherwise also a test on this would be good, so we can add it for all of them as headless mode. I'll likely go with the device tree overlay, which feels somehow nice and safer compared to simply removing the device completely.


Tomorrow, video tests are on the plate, of course with framebuffer again enabled 😉. Then the Armbian ~upstream kernel will be tested.

@MichaIng
Copy link
Owner Author

MichaIng commented Dec 21, 2021

Now benchmarked fully overclocked, and while RAM is significantly faster (likely unrelated), CPU is even a little slower and I'm not able to reach the 3.92 seconds anymore (repeated several times) 🤔. Probably related to the upgrade from Bullseye to Bookworm I made, not sure:

BENCH_VERSION=2
BENCH_HW_MODEL=15
BENCH_CPU='4.03'
BENCH_ROOTFS_WRITE='48'
BENCH_ROOTFS_READ='130'
BENCH_RAM_WRITE='1399'
BENCH_RAM_READ='2821'
BENCH_CUSTOMFS_WRITE='Not tested'
BENCH_CUSTOMFS_READ='Not tested'
BENCH_CPU_TEMP_START='30'
BENCH_CPU_TEMP_END='41'
BENCH_NET_LAN_SPEED='Not tested'

We really need to raise the iteration counts/sizes for fast devices, else relative variations are too large. However, nice is that the CPU temperature goes down to 30 °C in a seconds with the default metal heat spreader the PCB sits on. And it works very stable (given a sufficient PSU). Idle frequencies stay the same, so this additional power is only used when required, and as long as you have no long term full CPU load, there is no additional risk for overheating.

@mrbluecoat
Copy link

Thanks for working on this version. Waiting for mine to arrive.. Any ETA on a DietPi release?

@Joulinar
Copy link
Collaborator

Joulinar commented Jan 4, 2022

you mean for DietPi v8? If yes, have a look to #5059

@MichaIng
Copy link
Owner Author

Further testing with GUI:

  • On Bullseye Kodi is broken since there is no fbdev Kodi build for Bullseye (yet), unless installing an X server and starting via xinit, which was known. Also xserver-xorg-video-fbdev needs to be installed for running an X application via framebuffer driver. This was however known.
  • I ran into subsequent system crashes with highest CPU frequencies during load peaks, in this case while installing Kodi with all its dependencies. Resetting to default clocks solved this.
  • I somehow fail to fully use my 1920x1200x60Hz HDMI monitor. Auto-detection results in a black border/overscan issue, with parts of the console outside of the visible rectangle. Interestingly the console seems to actually start at the physical screen dimensions, but the borders are hidden. The overscan setting in boot.ini has somehow no effect at all. Tried with different boot.ini settings combination but wasn't able to solve with, aside of using a lower resolution so that only part of the screen is used.
  • I tried to use the n2_drm device tree, but this doesn't work, no screen output at all. I guess the kernel image needs to fit as well and I'm also not sure whether its for both, N2 and N2+, though it probably doesn't make any difference since there are no additional hardware devices, only more performance 🙂.
  • I also failed to find out what the monitor_onoff setting actually does 😄. I forgot to test whether its about screen blanking, "powering" on/off the monitor instead of just showing black content, similar to the RPi hdmi_blanking setting.

Now trying to upgrade to the Armbian Linux 5.10 image, device tree and U-Boot. Interestingly they use the same boot.ini while for mainline kernel I'd have expected boot.cmd/boot.src. The same Hardkernel specific settings are revealed but I'm wondering whether they are effective. Probably its just to have one boot.ini for both, legacy and mainline kernel. Both kernel stacks can be installed concurrently, though the /etc/kernel pre/post inst/rm script conflict, probably the reason why my first boot attempt failed. Diagnosing via serial console now, would be great if we could provide a migration guide, aside of fresh images. The major question is whether the Armbian packages deal well with the /boot FAT partition, as actually dpkg fails to directly replace on FAT, i.e. package upgrades and reinstalls can fail.

@MichaIng
Copy link
Owner Author

MichaIng commented Jan 23, 2022

With Armbian/mainline kernel, while CPU speed is a little faster, the RAM R/W benchmark is much lower, and eMMC read speed is as well repeatable significantly lower 🤔:

                        │ Benchmarks completed:                                                                                                │
                        │  - CPU Performance : Duration = 3.67 seconds (lower is faster)                                                       │
                        │  - CPU Temp        : Idle = 30'c | Full load = 37'c                                                                  │
                        │  - RootFS          : Write = 34 MiB/s | Read = 123 MiB/s                                                             │
                        │  - RAM             : Write = 384 MiB/s | Read = 710 MiB/s  

Need to check back what the reason can be.

None of the Odroid/boot.ini kernel command-line arguments works, just default Linux arguments. CPUs however run at max clocks of what is possible with the Hardkernel kernel, and one can use CPUFreq API (dietpi-config > Performance Options) to limit min and max frequencies, so that is not an issue. Since there are two different core types, resulting in two CPUFreq policies, we need to split the freq limits menu into sub menus for each policy.

Also I cannot get HDMI audio to work. I see only one audio card, which seems to be the 3.5mm jack.

@MichaIng
Copy link
Owner Author

Summing up with Armbian mainline kernel testing:

  • Old images cannot be converted reasonably. The Armbian kernel/dtb/bootloader stack requires everything to be located on an ext4 partition, else it fails with "unknown filesystem" errors. Furthermore it requires the boot.ini to be located in the /boot directory, which is not the case with a dedicated boot partition. It is possible to move the boot.ini into /boot/boot/boot.ini, respectively a /boot directory within the boot partition, and reformat the boot partition as ext4, but this is really not great for end users 😉. In theory, the bootloader could be patched, but since Armbian ships a package (not flashed automatically, but good to have the possibility), we do not want to mess with this.
  • I guess some features like CEC and WOL do not work anymore, the HDMI/output and CPU freq/count settings were not very helpful anyway. The issues with the ancient kernel finally become greater than the ones with mainline kernel, IMO, this steps needs to be done anyway.
  • Major regressions are HDMI audio and less than half RAM R/W speeds (testing via dd > /tmp (dietpi-benchmark)). I asked about this on Armbian forum already, lets see whether someone has an idea.

I will also test Armbian's "next" kernel version and Meveric's new mainline kernel image (both kernel should match, Meveric's image is still in testing, lacks device tree overlay and U-Boot packaging, but nice is some additional overlays for fan/PWM control): https://oph.mdrjr.net/meveric/images/Bullseye/

@MichaIng
Copy link
Owner Author

I found the reason for the low RAM/tmpfs I/O benchmark: The two little cores stay at minimum 100 MHz CPU frequency, even with ondemand + io_is_busy=1 instead of schedutil CPU governor. This seems affect RAM/tmpfs I/O massively. Applying performance governor to the little cores solves it.

Since we want to measure full RAM I/O performance here, unaffected by current CPU frequency, I'll change the benchmark to apply performance governor temporarily. This is done after the CPU benchmark, so has no effect on CPU temperature results.

MichaIng added a commit that referenced this issue Jan 25, 2022
- DietPi-Benchmark | Apply performance CPU governor when running RAM I/O benchmark to avoid low frequency affecting RAM I/O results: #5039 (comment)
- DietPi-Benchmark | A bunch of wording and coding enhancements, not affecting benchmark results
@MichaIng
Copy link
Owner Author

Figured out how to toggle HDMI and 3.5mm audio: https://forum.armbian.com/topic/19579-some-experiences-with-odroid-n2-on-debian-bullseye/?do=findComment&comment=135005
All implemented + Amlogic serial console toggles.

@MichaIng MichaIng added this to the v8.1 milestone Jan 29, 2022
@MichaIng MichaIng added the Solution available 🥂 Definite solution has been done label Jan 29, 2022
@MichaIng
Copy link
Owner Author

New image up and ready for testing: https://dietpi.com/downloads/images/testing/
cc @StephanStS

@paradix
Copy link

paradix commented Jan 31, 2022

@MichaIng is there any reason why I can't move RootFS to an external SSD drive connected over USB?

@Joulinar
Copy link
Collaborator

What is the file system format of the attached USB drive?

@paradix
Copy link

paradix commented Jan 31, 2022

What is the file system format of the attached USB drive?

It's ext4

@MichaIng
Copy link
Owner Author

MichaIng commented Jan 31, 2022

This is generally only offered on systems which do have and need a dedicated /boot partition. As long as USB boot does generally work, it doesn't make sense in any other case. Simply flash the whole image to the external USB drive, format or unplug eMMC module and SD card (since priority is eMMC > SD card > USB) and you are good to go. I haven't tested USB boot on the N2+ to be true, IMHO doesn't make much sense over eMMC, but I see in UART console output that it does try to read from USB when eMMC and SD card do not contain a (valid) bootloader.

@MichaIng
Copy link
Owner Author

MichaIng commented Feb 5, 2022

Marking as closed, but please keep testing and reporting if any issue or missing feature appears. I'll recreate the image tomorrow to ship with now stable DietPi v8.1 master branch and move it to stable.

@MichaIng MichaIng closed this as completed Feb 5, 2022
@MichaIng MichaIng unpinned this issue Feb 5, 2022
@manilx
Copy link

manilx commented Feb 8, 2022

I've been running the new N2+ test image for a couple of weeks now and for the first time the board is running without reboots, freezes etc.

I've just noted one issue:

I have the N2 fan installed and it's turning on and off all the time, without the cpu being used a lot and the ambient temp being OK.
Is there a way to change the trip temperatures for the fan?

@manilx
Copy link

manilx commented Feb 8, 2022

root@Odroid:/sys/devices/virtual/thermal/thermal_zone0# ls -la
total 0
drwxr-xr-x 4 root root    0 Jan  1  1970 .
drwxr-xr-x 8 root root    0 Jan  1  1970 ..
-r--r--r-- 1 root root 4096 Feb  8 22:18 available_policies
lrwxrwxrwx 1 root root    0 Feb  8 22:18 cdev0 -> ../cooling_device0
-r--r--r-- 1 root root 4096 Feb  8 22:18 cdev0_trip_point
-rw-r--r-- 1 root root 4096 Feb  8 22:18 cdev0_weight
lrwxrwxrwx 1 root root    0 Feb  8 22:18 cdev1 -> ../cooling_device0
-r--r--r-- 1 root root 4096 Feb  8 22:18 cdev1_trip_point
-rw-r--r-- 1 root root 4096 Feb  8 22:18 cdev1_weight
lrwxrwxrwx 1 root root    0 Feb  8 22:18 cdev2 -> ../cooling_device1
-r--r--r-- 1 root root 4096 Feb  8 22:18 cdev2_trip_point
-rw-r--r-- 1 root root 4096 Feb  8 22:18 cdev2_weight
lrwxrwxrwx 1 root root    0 Feb  8 22:18 cdev3 -> ../cooling_device1
-r--r--r-- 1 root root 4096 Feb  8 22:18 cdev3_trip_point
-rw-r--r-- 1 root root 4096 Feb  8 22:18 cdev3_weight
lrwxrwxrwx 1 root root    0 Feb  8 22:18 cdev4 -> ../cooling_device2
-r--r--r-- 1 root root 4096 Feb  8 22:18 cdev4_trip_point
-rw-r--r-- 1 root root 4096 Feb  8 22:18 cdev4_weight
lrwxrwxrwx 1 root root    0 Feb  8 22:18 cdev5 -> ../cooling_device2
-r--r--r-- 1 root root 4096 Feb  8 22:18 cdev5_trip_point
-rw-r--r-- 1 root root 4096 Feb  8 22:18 cdev5_weight
lrwxrwxrwx 1 root root    0 Feb  8 22:18 cdev6 -> ../cooling_device2
-r--r--r-- 1 root root 4096 Feb  8 22:18 cdev6_trip_point
-rw-r--r-- 1 root root 4096 Feb  8 22:18 cdev6_weight
--w------- 1 root root 4096 Feb  8 22:18 emul_temp
drwxr-xr-x 3 root root    0 Jan  1  1970 hwmon0
-rw-r--r-- 1 root root 4096 Feb  8 22:18 integral_cutoff
-rw-r--r-- 1 root root 4096 Feb  8 22:18 k_d
-rw-r--r-- 1 root root 4096 Feb  8 22:18 k_i
-rw-r--r-- 1 root root 4096 Feb  8 22:18 k_po
-rw-r--r-- 1 root root 4096 Feb  8 22:18 k_pu
-rw-r--r-- 1 root root 4096 Feb  8 22:18 mode
-rw-r--r-- 1 root root 4096 Feb  8 22:18 offset
-rw-r--r-- 1 root root 4096 Feb  8 22:18 policy
drwxr-xr-x 2 root root    0 Feb  8 21:44 power
-rw-r--r-- 1 root root 4096 Feb  8 22:18 slope
lrwxrwxrwx 1 root root    0 Jan  1  1970 subsystem -> ../../../../class/thermal
-rw-r--r-- 1 root root 4096 Feb  8 22:18 sustainable_power
-r--r--r-- 1 root root 4096 Feb  8 21:44 temp
-rw-r--r-- 1 root root 4096 Feb  8 22:18 trip_point_0_hyst
-rw-r--r-- 1 root root 4096 Feb  8 22:18 trip_point_0_temp
-r--r--r-- 1 root root 4096 Feb  8 22:18 trip_point_0_type
-rw-r--r-- 1 root root 4096 Feb  8 22:18 trip_point_1_hyst
-rw-r--r-- 1 root root 4096 Feb  8 22:18 trip_point_1_temp
-r--r--r-- 1 root root 4096 Feb  8 22:18 trip_point_1_type
-rw-r--r-- 1 root root 4096 Feb  8 22:18 trip_point_2_hyst
-rw-r--r-- 1 root root 4096 Feb  8 22:18 trip_point_2_temp
-r--r--r-- 1 root root 4096 Feb  8 22:18 trip_point_2_type
-rw-r--r-- 1 root root 4096 Feb  8 22:18 trip_point_3_hyst
-rw-r--r-- 1 root root 4096 Feb  8 21:44 trip_point_3_temp
-r--r--r-- 1 root root 4096 Feb  8 22:18 trip_point_3_type
-r--r--r-- 1 root root 4096 Feb  8 21:44 type
-rw-r--r-- 1 root root 4096 Jan  1  1970 uevent

@manilx
Copy link

manilx commented Feb 8, 2022

Important thing is that the fan is working as set: above 40º it turns on and below turns off!

@MichaIng
Copy link
Owner Author

MichaIng commented Feb 8, 2022

Not sure what changes then. Without the postboot.d script it definitely remains? I still think it is most likely related to reaching the trip point. You could try to debug, using the script, checking whether the sensors work, then check cpu for when 40°C is reached or listen to when the fan starts , then check back whether sensors are still working. If they do still work, check back again until the fan did its job and probably lowered the temperature again below 40°C and check whether sensors are still working.

@manilx
Copy link

manilx commented Feb 8, 2022

No, I meant that initially it remained with the postboot.d script. For hours. Then suddenly it was gone.
I tested by running tasks to max the cpu, fan running and stopping as expected. And netdata showing the sensors-fan.... Then suddenly the netdata sensors-fan entry was gone.

@manilx
Copy link

manilx commented Feb 8, 2022

On the positive side I can confirm that this is the first image than runs on the N2+ top stable!

@MichaIng
Copy link
Owner Author

MichaIng commented Feb 8, 2022

Then suddenly the netdata sensors-fan entry was gone.

Probably when the CPU temperature dropped again below 40 °C?

@manilx
Copy link

manilx commented Feb 8, 2022

No. It always showed: when the temp got above 40 (fan started) and when it got below (fan stopped). All the time netdata showed the fan. It disappeared out of the blue.

@MichaIng
Copy link
Owner Author

MichaIng commented Feb 8, 2022

Okay, very strange.

@manilx
Copy link

manilx commented Feb 8, 2022

P.S. uninstalling netdata (and deleting the /etc/netdata folder) and then reinstalling from scratch doesn't help. Fan does not show again.

@manilx
Copy link

manilx commented Feb 9, 2022

Hi,

this morning (after a good night´s sleep ;) ) Netdata is again showing the fans! Did not do anything, just reappeared.....

This is without the postboot.d script! But the
echo 'SUBSYSTEM=="thermal", KERNEL=="thermal_zone0", ACTION=="add", ATTR{trip_point_3_temp}="40000"' | sudo tee /etc/udev/rules.d/fan_temp.rules
sudo rm /var/lib/dietpi/postboot.d/fan_temp.sh

@manilx
Copy link

manilx commented Feb 9, 2022

spoke to soon. The fan graph shows but it does not update....

@Kreeblah
Copy link

Kreeblah commented Feb 13, 2022

@MichaIng - I can't seem to get any audio out from this image on the 3.5mm jack. According to the documentation, it looks like hw:0,1 should be the DAC, but even choosing that in dietpi-config (or the 3.5mm option in there), unmuting everything in alsamixer and turning things up, I get nothing. Is this anything you've run into with the mainline kernel?

Though, that's probably better than what I'm seeing with the vendor kernel in the current 8.1 release, where it doesn't respect the volume controls at all, and just plays everything at full blast when it's enabled.

@MichaIng
Copy link
Owner Author

Please use the hardcoded OdroidN2_3.5mm option in dietpi-config sound card selection. The association between the internal I2S device and the ALSA output device needs to be setup from ground before it works, and the hardcoded onboard 3.5mm and HDMI options will do that. Basically it is explained here: https://forum.armbian.com/topic/19579-some-experiences-with-odroid-n2-on-debian-bullseye/?do=findComment&comment=135005

@MichaIng
Copy link
Owner Author

Recreated the image based on stable DietPi release, with minor fine tuning to our boot configs and moved to stable.

@manilx
Copy link

manilx commented Feb 13, 2022

@MichaIng How do we get the final updates/tunings to a running beta image?

Thx in advance.

@MichaIng
Copy link
Owner Author

When you are at latest beta release, the code is identical to master. I fixed enabling the correct serial console on image creation, but did that manually for the previous image, so when you didn't disable it anyway, /dev/ttyAML0 should be the only enabled serial console, which is the white 4-pin UART port on the PCB. Otherwise it is only a very minor change in boot.cmd: 7c87b38

  • extraboardargs is never set, and I don't see a reason for using it on top of extraargs for additional or overriding kernel command-line arguments.
  • Since comments in boot.cmd and boot.scr are the same, in the letter the "mkimage" related instruction was misleading when one sees it in boot.scr. So I made now clear that one must edit boot.cmd and then generate/update boot.scr from it with the given command.

@manilx
Copy link

manilx commented Feb 13, 2022

Replaced my boot.cmd with the new version.

thx!

@MichaIng
Copy link
Owner Author

For it to become effective, as stated at the top of the file, run:

mkimage -C none -A arm64 -T script -d /boot/boot.cmd /boot/boot.scr

But the change really has no practical effect, being cosmetic.

@Kreeblah
Copy link

Kreeblah commented Feb 13, 2022

Please use the hardcoded OdroidN2_3.5mm option in dietpi-config sound card selection. The association between the internal I2S device and the ALSA output device needs to be setup from ground before it works, and the hardcoded onboard 3.5mm and HDMI options will do that. Basically it is explained here: https://forum.armbian.com/topic/19579-some-experiences-with-odroid-n2-on-debian-bullseye/?do=findComment&comment=135005

I tried the hardcoded OdroidN2_3.5mm option first, and I just tried again with the new stable image you created today, but I don't seem to be able to get anything out of the Roon Bridge app with it.

Using that hardcoded option on the stable image, I tried the following in alsamixer:

I unmuted FRDDR_A SRC 2 EN, FRDDR_B SRC 2 EN, FRDDR_C SRC 3 EN, and TOACODEC OUT EN with no result. After that, I tried also turning the sliders up a bit for all four TDMOUT_B lanes and all four TDMOUT_C lanes, with no effect. Unmuting TDMOUT_B Gain Enable and TDMOUT_C Gain Enable didn't seem to help, either.

No matter what I seem to try, I get nothing out of the Roon Bridge app, and if I try speaker-test, I get this:

speaker-test 1.2.4

Playback device is default
Stream parameters are 48000Hz, S16_LE, 1 channels
Using 16 octaves of pink noise
Channels count (1) not available for playbacks: Invalid argument
Setting of hwparams failed: Invalid argument

Am I missing an option somewhere?

@MichaIng
Copy link
Owner Author

Hmm, let me test.

@MichaIng
Copy link
Owner Author

Channels count (1) not available for playbacks

Ah, can you try to enable the auto-conversion plugin in dietpi-config ALSA settings? I really need to verify that it is in fact a noop when the stream is already supported by the output device and only does anything when not. In that case we could remove that option and have it enabled OOTB.

@Kreeblah
Copy link

After changing that setting, speaker-test doesn't give me an error any more, which is good.

Unfortunately, I'm still not hearing anything, so there seems to be something else going on as well.

@MichaIng
Copy link
Owner Author

Found it, please do:

sed -i -e 's/OdroidN2_HDMI/odroidn2_hdmi/' -e 's/OdroidN2_3\.5mm/odroidn2_3.5mm/' /boot/dietpi/func/dietpi-set_hardware

Then re-select the OdroidN2_3.5mm option in dietpi-config. I missed that all inputs are made lower-case in the backend script 😅. For speaker-test or other single channel input streams, the auto-conversion plugin is still required, but speaker-test -c 2 and common dual channel music and up to 8 channel inputs work OOTB (given sample format and rate are supported).

MichaIng added a commit that referenced this issue Feb 13, 2022
- DietPi-Config | Resolved an issue where the onboard audio selection for our new Odroid N2 image did not work. Many thanks to @Kreeblah for reporting this issue: #5039 (comment)
@MichaIng
Copy link
Owner Author

Fixed with: 372ca17

I'll probably send a live patch, since the image just went live it will be applied for most users on first boot automatically.

@Kreeblah
Copy link

That did it, mostly. I'm getting sound now, but I'm also getting a very loud pop whenever a PCM stream starts, and a slightly quieter (though still quite loud) one whenever a PCM stream ends. Just from searching around, it seems this can happen on x86/x64-based systems with power management settings turning the audio hardware off, thought I don't know whether that applies to an ARM device.

For anybody else who comes across this, it seems that the minimum things that need to be unmuted to get audio out of the 3.5mm jack are FRDDR_A SRC 2 EN and TOACODEC OUT EN.

@Kreeblah
Copy link

https://forum.odroid.com/viewtopic.php?f=177&t=34451&p=259180#p259451 seems to imply that power management settings can affect it on the N2 as well, though I haven't been able to figure out yet what to change on the mainline kernel that would be equivalent to what's in that post.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants