Le Potato Segmentation Fault on Large File Transfer


#41

Hi all,

here are a few observations from my side: I’ve not only the large-file-make-Le-Potato-crash-Problem, which is totally annoying, but I also observe imperfections in USB transfers. Namely, I’ve attached a DVB-T2 dual tuner receiver, which is well supported by the CrazyCat-drivers. When I use it to watch TV, I’ve every few seconds short breakdowns in the stream, which tvheadend reports as continuity errors. However, it is nearly impossible that this comes from bad signal/reception/SNR: I am living in about 2 km distance to the sending antenna, and using the same receiver with the same antenna in the same place with a Windows PC, picture is perfect! Things get even worse: As soon as I try to use tuner #2, the image from it is nearly unusable - it stutters and breaks down every two or three seconds. Again, on a Windows PC no problem at all.

Long story short: I suspect that both, the crash and the stuttering, are not a fundamental code problems, but some timing problems. I’ve tried to understand how I can influence the hardware timings, but I cannot find much about it.

Can anyone give me a pointer in the right direction? I’d then play around with the timings and see where I get.

Btw.: All currently available mainline versions (Armbian, the Ubuntu image and the Raspbian image) work flawlessly with regard to the large file topic - I have no problems whatsoever with network and writing files. I cannot say anything to USB, since I’ve a hard time to install anything on these unfinished mainline versions.

If the loverpi-guys are unwilling to help - perhaps the Armbian team is more helpful? I found TonyMac32 very approachable when I tried to solve the problem by backporting the fixes in Armbian to Libre/Coreelec (which by the way did not solve the issue as it did in Armbian).

Cheers, Hauke


#42

@Hauke,
Just a thought …
Have you tried reducing the antenna to a minimum to make sure the tuners are not being overloaded being so close to the transmitter?
Probably not a problem, but it might be worth the time to be sure :wink:


#43

@JohnBoyz: Thanks for the idea! I just removed the antenna completely - SNR goes from 33 dB down to 18 dB, and effects are the same (but /me receiving a good picture even without antenna shows how close I am to the transmitter :slight_smile:). I’m rather confident that it’s nothing about signal quality. And i did not want to move the topic to DVB-T2… So my question remains: Where would I configure timings? Is it possible at all? I remember some post quite a while ago that mentioned something about RAM timings and a config file for that, but for all I search, I can’t find it…

[EDIT]Did find it: RAM timing post - however: This seems to be more complicated than I thought…


#44

Ive been doing more digging on my issue. I am not confident but we may be looking at bit rate issue for me. I took the same file 4K H265 Main 10 90mbps I believe and am running it through default setting on handbrake for 4K H265 MKV and it played considerably longer then the non converted file. The conversion will be another hours or so. In the mean time I am going to try some stupid high bitrate H265 clips and see what happens.


#45

I have been testing LePotato+mainline+Kodi and the issues we have with the 3.14 kernel are definitely non existent, unfortunately the mainline work is very much in it’s infancy though.

Only the following works, MPEG 1/2/4, H.264, MJPEG, (partial) HEVC 8-bit.

There is no HDMI 2.0 driver or any of the other good stuff yet.


#46

Good news. I have resolved my issue it deffinately has to do with a patch as last night I pulled the latest development branch and made the following changes

Changed the following files
/packages/sysutils/busybox/config/busybox-init.conf
-# CONFIG_FSTRIM is not set
+CONFIG_FSTRIM=y

/packages/sysutils/busybox/config/busybox-target.conf
CONFIG_FSTRIM is not set
+CONFIG_FSTRIM=y

/packages/sysutils/util-linux/package.mk
@@ -53,7 +53,6 @@ PKG_CONFIGURE_OPTS_TARGET="$UTILLINUX_CONFIG_DEFAULT \
                            --enable-libsmartcols \
                            --enable-losetup \
                            --enable-fsck \
-                           --enable-fstrim \
                            --enable-blkid"
 
/projects/Amlogic/devices/LePotato/bootloader/boot.ini
-setenv libretech "no_console_suspend logo=osd1,loaded,0x3f800000,${hdmimode} vout=${hdmimode},enable hdmimode=${hdmimode} cvbsmode=nocvbs consoleblank=0"
+setenv libretech "no_console_suspend logo=${logoopt} vout=${outputmode},enable hdmimode=${hdmimode} cvbsmode=nocvbs consoleblank=0"
+#setenv libretech "no_console_suspend logo=osd1,loaded,0x3f800000,${hdmimode} vout=${hdmimode},enable hdmimode=${hdmimode} cvbsmode=nocvbs consoleblank=0"
 if test "${hdmi_cec}" = "1"; then setenv cec "hdmitx=cec17"; fi
 setenv bootargs "console=${condev} ${bootrootfs} ${libretech} ${cec} ${libreelec}"
 
/projects/Amlogic/filesystem/usr/lib/systemd/system/fstrim.service
 [Service]
 Type=simple
-ExecStart=-/usr/sbin/fstrim -a -v
+#ExecStart=-/usr/sbin/fstrim -a -v
+ExecStart=-/usr/sbin/fstrim /storage
 
Remove this patch
/projects/Amlogic/packages/u-boot/patches/a43076c/u-boot-0004-faster-boot.patch

i could make my build available if someone is having similar issues to me.


#47

I’ll certainly assist with testing your build if you’d like to upload it somewhere


#48

Ill put it up on my google drive or somewhere tonight when I get home from work.

I want to try reverting a few of the changes I made to identify a specific cause to my issue. Ill share what I have so far.


#49

C00l! Would love to test it and see if it fixes my file write problem also!
Thanks!


#50

Here you guys go. I doubt it will fix the file copy issues but it is worth a shot.

Image removed as instructions are below and how to fix current release.


#51

My test is not scientific, it’s more “chaos monkey” based on actions known to cause problems, but it has been consistently repeatable within a short period of time on all previous builds. Using your dev build I have not yet gotten my box to lockup. Will keep monkeying around.


#52

That’s good news. I had a video file I could consistently crash my lepotato 40 seconds in. My build is playing it perfectly fine. I’m in the process of building a new version with a few of my changes rolled back in hopes of fixing the video overlay issue I noticed and speeding up the boot process.


#53

I tried copying a 1.6GB file over NFS tonight and it worked just fine. I didn’t want to deal with getting rsync installed so I just used cp. Hopefully @oz-ra will be able to try his test as well. So far so good for me.


#54

I am able to confirm that @ih8lag has found the root cause of the long standing segfault bug on LePotato.

It was related to a patch in u-boot added by kszaq designed to speed up the boot process, I would never have thought to look in u-boot myself.

bootloader.img (656.5 KB)

Download the above file to /storage and execute the following commands to replace your bootloader.

dd if=/storage/bootloader.img of=/dev/mmcblk0 conv=fsync bs=1 count=112
dd if=/storage/bootloader.img of=/dev/mmcblk0 conv=fsync bs=512 skip=1 seek=1

There is no need to download and reflash the whole OS if you don’t want to.


#55

Hi adamg,
thanks for providing this! But no luck with me: First tried to patch my existing CoreElec 8.95.0, device failed to boot after the two commands and reboot. Did a clean install from the downloaded image, same result. Tried twice, just to be sure, second time with poweroff, disconnect from power, start cold. No success. Followed the instructions to the letter, cut’n’paste-ing the commands in the end.
Anyone with more success?
Cheers, Hauke


#56

@Hauke

I have not tried @adamg commands. After your report I tried the following:

Checked that I had a /dev/mmcblk0

Then:

dd if=/storage/bootloader.img of=/dev/mmcblk0 conv=fsync bs=1 count=112
dd if=/storage/bootloader.img of=/dev/mmcblk0 conv=fsync bs=512 skip=1 seek=1

that I found at: https://github.com/CoreELEC/CoreELEC/blob/master/projects/Amlogic/bootloader/update.sh

it Showed:

dd if=$SYSTEM_ROOT/usr/share/bootloader/u-boot of=$BOOT_DISK conv=fsync bs=1 count=112 status=none
dd if=$SYSTEM_ROOT/usr/share/bootloader/u-boot of=$BOOT_DISK conv=fsync bs=512 skip=1 seek=1 status=none

My System rebooted fine and I am now testing Network Transfers but it already looks fantastic, doing a 2.7GB restore successfully that would have failed in the past about 600MB in.

TL;DR I have not tried @adamg’s commands. The above worked for me. I will try his next.

Cheers


#57

@Hauke make sure you download the file to the location I specified, if you reinstall or update then you will have to do the commands again until we make a new release.


#58

Ok I have retested.

Using Etcher and a fresh image every-time:

This hangs after I apply patch when I reboot:

Re-writing SD card with Etcher:

This reboots successfully after I apply @adamg file

Thanks for everybody’s help. It is looking very good so far but will stress-test network transfers.


#59

Hi oz-ra,
thanks for sharing this - indeed, adding “seek=1” to admag’s second command did the trick.
And I can also confirm that my large file copy problem is gone! Really happy! Thanks to ih8alg for finding this out!!!
My DVB-T2 problem is still there, so I was wrong that these problems were connected - however, this is a different topic, and I am still on rather old crazycat-drivers - will update next days, perhaps that’s it already.
Thanks again to everyone, will now reenable the recordings and see if the Potato survives!
Hauke


#60

Apologies for forgetting the seek=1 at the end, updated the post.