Adding boot parameters to the rpi (and any arm build probably)

  • Hello everyone :)

    Now that kodi 20a1 is released and libreelec's nightlies use it, I decided to try it on my rpi3b+. It was on le 9.2.8, but since its update to le 10 was delayed until 10.0.2, it was left unused for months now.

    So, instead of setting le 10 from scratch, I decided to flash the latest nightly (20220522-ffda0f7 as of today). Everything went fine on first boot, I connected it to my wireless network and shut it down to continue the next day.

    And this morning, for the first time ever, I was greeted with a corrupted filesystem notification!

    I let it idle for 120seconds, the fixing procedure started and when it reached kodi again, it was not connected to the network. I reconnected it, installed confluence and the greek language pack and shut it down again, because it makes me mad to control it with the tv's remote and I prefer ssh for stuff that can be done that way.

    On the next boot, the same message showed up, I let it do the same, it reached kodi again (kodi was in greek and with confluence), but the network had to be set up again. I thought unplugging its power supply might cause the corruption issue, so I left it connected.

    Long story short, I shut down or rebooted almost 10 times and half of them showed this recovery message. And once, le started in safe mode, but it booted normally after that. I want to troubleshoot it further, so I want the boot output to be shown.

    On the 2 x64 installations of le (9.2.6 and 10.0.2) that I have, I have set a couple of boot parameters in /flash/syslinux.cfg and from this

    Code
     quiet

    I now have this

    Code
    quiet nosplash progress nofsck

    and I have a beautiful boot log showing instead of the splash screen.

    On arm architectures though, there is no /flash/syslinux.cfg but a /flash/config.txt which has a lot more text inside it. So, assuming that the forementioned parameters work regardless of the architecture, how can I add them to my rpi too?

    I read about the file that has the parameters and how to edit it here

    https://wiki.libreelec.tv/configuration/config_txt

    and about the boot parameters themselves here (lines 971 to 1069).

    LibreELEC.tv/init at 36dcdfdc8b9b1de48fa794edf1289248a875abfc · LibreELEC/LibreELEC.tv
    Just enough OS for KODI. Contribute to LibreELEC/LibreELEC.tv development by creating an account on GitHub.
    github.com
  • On RPi kernel command line parameters are set in /flash/cmdline.txt - note that everything has to be in a single line

    I'm not aware of any general filesystem corruption issues on reboot, so I'd recommend testing with a different SD card. Also keep an eye on undervoltage messages in dmesg (and/or check throttled state with vcgencmd get_throttled).

    so long,

    Hias

  • Thank you for your support. There is indeed a /flash/cmdline.txt in there that looks like the arm version of /flash/syslinux.cfg. I will edit it and report back, although it seems to be what I want.

    I will also try a different card if the problem persists. The card was bought with the 3b+ ~3 years ago and it has been used for very little time, i.e. 1-1.5 months of total usage. When I decided to install lakka on the 3b+, I got a new card and installed it there, but it also has less than 1 month of total usage.

    As for the command, it returns

    Code
    # vcgencmd get_throttled
    throttled=0x0

    Can I assume there is no issue there?

  • And it just booted with issues again. There was no notification at the boot log that anything is corrupt, just a small one at the very end that the network is starting.

    After that, it booted to a stock kodi with estuary in english, but with everything else installed (I installed yputube, twitch and the 2 inputstream addons earlier). It also had no network connection and I had to reconnect it to my wifi.

    In dmesg there are 7 lines that say

    Code
    EXT4-fs error (device mmcblk0p2): __ext4_find_entry:1623: inode #294924: comm kodi.bin: checksumming directory block 0

    so yea, something is happening on the filesystem. I will reflash it when I have time. Are there any checksums to validate the img files of the test builds?

  • The update tar file includes md5 checksum files for SYSTEM and KERNEL (located in the target folder).

    But the error you mentioned seems to happen on the storage partition so these checksum files won't help much.

    Post the output URL of "pastekodi", ideally after you got such an error in dmesg, maybe we can sport something in the logs.

    so long,

    Hias

  • So, I reflashed the img last night and rebooted twice with no issues. I then installed greek and confluence and called it a day.

    First boot of the day today and although kodi was using confluence and greek, it was not connected to the wireless network. In fact, it re-asked me to add the wifi key when I clicked connect, as if it did not save it in the first place. There are no messages similar to the above so far, but here is the pastebin output you requested. I will look for them and post again if needed.

    http://ix.io/3Yxx

    Minor issues that I have since the previous installation

    - once kodi starts, a small notification pops up at the bottom right corner saying about it not being able to connect to a remote server

    - wifi reception at my tv is bad in general, but with le 11 is at ~30 % while on le 9 it was at ~45%

    - I use putty 0.76 (under linux) to ssh to it and with le 11 the terminal flickers badly when I write many or long lines of text, which was also not an issue on le 9

    p.s. Other that confluence and greek, I may have configured some aspects of kodi and I may have added my dlna server to check something for a future issue report on kodi's github. It is way to early to remember them now, but if you see anything like that in the log, please do not mention them.

    ---edit

    As for the checksum of the files, the releases.json file contains the sha256sums for all the files that are hosted under test.libreelec.tv. I verified mine before reflashing it on the sd and it was correct.

    ---re-edit

    Same thing happened on the 2nd (fresh) boot of the day that I did just now. Wireless did not connect automatically and I had to reenter the key. So far, there has been no notification about filesystem corryption and here is a new pastebin output that looks almost the same as the one earlier.

    http://ix.io/3Yy3

    ---re-re-edit

    And it just gave me the corrupted filesystem notification just now. I wanted to check if a subtitle ussue was fixed, so I disconnected it from the tv, moved it close to my router, ssh'ed to it and downloaded a video (sintel) and its subtitles on it with wget. I then shut it down and moved it back to the tv.

    Oddly enough, it booted just fine, there were no fixing messages in dmesg and it connected to the wifi network with no issues. Here is a new paste if anyone wants to check.

    http://ix.io/3Yyl

    Edited 3 times, last by jim_p (May 25, 2022 at 10:21 AM).

  • First boot of the day and also the first one on 20220526-5d4fb9b that gets the corrupted filesystem notification. It booted with no issues last night after the upgrade to the new nightly.

    Leaving the above aside and the fact that if "forgets" the wifi key everytime, is there any chance that the wifi does not connect automatically due to poor signal?

  • Certainly. If the signal is poor chances are high you don't get a connection - actually that's the number one cause for "no connection" issue (and the RPi's built-in wifi is known for struggling with poor signal conditions as it has only a tiny antenna).

    so long,

    Hias

  • What if I told you that wifi reception on the rpi3b (as shown under libreelec settings > connections) is equally bad with an external usb wireless card too?

    I have a tplink wn722n v1 (the one with the atheros chipset, with antenna) and a wn821n (atheros chipset too, no antenna) and both of them barely get over 30-32% of signal strength.

    If there is any connman command I can run from a terminal in order to show you that, please tell me. If not, I will resort to iwlist and do some grepping.

  • What if I told you that wifi reception on the rpi3b (as shown under libreelec settings > connections) is equally bad with an external usb wireless card too?

    It's just a number. Unfortunately in current included connman 1.41 signal strength from iwd is computed different to formerly used wpa_supplicant.

    In the meantime there is a fix. Expect higher numbers after next connman update.

  • Yea, but I rely on that number! For instance, right now a 10MB download via wget is stalled because of the bad wifi connection and I am swearing :P

    The corruption notification came up again earlier, along with some lines like the one above in dmesg, so I do not know how much longer I will keep that installation. And if this is not enough, I downloaded today's 20220526-3de1e3b, saw it fail to upgrade once, re-downloaded it, checked its sha256sum to be sure, rebooted and when the procedure started it said that the md5sum for the system file was wrong!

  • This can all be related to the memory, I/O or disk errors you see. Without any RPI experience I'm unfortunately unable to give any help.

  • Number one cause are broken SD cards, as I mentioned in post 2. They can go bad and there are lots of fakes around.

    Powersupply issues can also cause all sorts of problems. A very short voltage dip is enough to make the CPU perform wrong calculations, affect memory content etc - if it happens at the "right" time it can also corrupt filesystems, of course.

    Those things are quite easy to check, use another SD card and another (official) RPi power supply.

    Actual DRAM memory issues are extremely rare - most of the time power supply and/or excessive overclocking were the cause of memory corruption. LE ships with "memtester", you can use it if you suspect RAM issues.

    EDIT: and of course incorrect shutdown (i.e. just pulling the plug) is also well known to trash filesystems - but I hope the OP isn't doing that :)

    so long,

    Hias

  • I already have the official rpi power supply (5v/2.5a) and the sd card is a 32gb, u1 class kingston.

    In fact, I got all of them (rpi 3b+ + official case + official power supply + sd card) as a bundle back then and I occasionally use the power supply on my zero too (I have a samsung 5v/2a charger for that, which I think is enough even for the 3b+). And I do not remember pulling the plug before the device has shut down, ever.

    As for the memory itself, since there is no way to run memtest on the rpi, what can I do? I am also looking for another way to stress the sd card, but excluding my rpis and a tvbox, all I have is the phone where I can use it as storage only, so it is pointless to have it there.

    I thought of installing raspbian on it, although I hate its dependance on dhcpcd for networking. After that, osmc is the next option. Any way I chose though, I will lose the chance to test kodi 20. I also thought of installing lakka or retroarch or something similar, plus a handful of games and send it to a friend to test it.

    On the other hand, I have a 16gb class 10 kingston card that has lakka 4 (aarch64) on it, plus ONE snes game in it that I play when I am very bored. If it is a memory issue, wouldn't it corrupt that card too?

  • Quote

    LE ships with "memtester", you can use it if you suspect RAM issues.

    Stop kodi ("systemctl stop kodi") and all other programs you don't need to make as much free RAM available as possible, then check with "free" how much free memory you got and run memtester, specifying a bit less memory. eg if you want to check 600MB run

    Code
    memtester 600M

    so long,

    Hias

  • Concerning SD cards: I've got rather mixed results with Kingston and rather poor results with Transcend in the past (also on portable audio recorders, cameras and phones) so I tend to avoid them.

    One of those cards even bricked my parents' Marantz audio recorder, it's update process didn't verify firmware checksums and missed that a few blocks of the firmware file were corrupt (all 0xff). Card went to the bin but it took me a long time to unbrick the audio recorder.

    I'm almost exclusively using Sandisk Extreme 32GB cards on RPis since a few years and didn't have any issues with those yet.

    so long,

    Hias

  • I use sandisk ones on my phone and on the zero and although I had no issues so far, I have a friend whose card simply died on the phone one day, losing all his stuff and some apps.

    Ontopic, memtest just completed 2 passes and gave no errors. I gave it 700mb to check, because htop reported that only ~55 out of 900+ were free after I stopped kodi.

    And that makes me ask a question similar to the one I had when I opened this thread. Is there a command line parameter I can add so as to make le start without kodi?