Advice on Wetek Play 2 Replacement

  • The command output shows you not following instructions :)

    You've noticed the "u" option in emmctool, which writes u-boot to the 1st and 512th sectors on the emmc storage. If you stopped at this point it would have worked. Then you "w" the LE image to emmc which overwrites it with an image containing MBR structures in the 1st sector and u-boot in the 512th sector. This would work on GXL and newer devices which check the 512th sector on emmc, but not a GXBB device which only checks 1st sector. Then finally you dd u-boot directly to emmc again which puts it in the first sector again.

    The image has some audio issues. I'm unable to get 48KHz media to output unless I force Kodi to resample it to 44.1HKz. I don't see this on GXL/GXM devices using the same image. There is also a "machine gun noise" buffer underrun which occurs. You'll know it when it happens because your ears will bleed - You need to toggle the audio source in Kodi to fix it. In both cases I have no clue where the problem resides - and I'm not really a coding developer with the skills to investigate.

    I don't do the beers thing. The project accepts paypal and open-collective donations though.

  • I wonder if there isn't something else going.
    It booted from internal storage (SD card was out) and I checked the storage size in Kodi. All good.
    I started my configuration then I decided to stop and powered the wetek play 2 off.

    It never booted back from eMMC the next time I powered it on.

    Then I went through the procedure again, and the emmctool seems at times to modify incorrectly labels:

    - emmctool w img-file

    - emmctool u u-boot.bin-file

    Reboot, impossible to boot from internal, re-insert SD card then boot prompt with error about not finding the partition with the LABEL LIBREELEC.

    Re-flash the img onto the SD, boot again, SSH to the box, tried using DD for the u-boot, still nope.

    What I've noticed is that the sector are not modified between emmctool w and emmctool u:

    Zeroed: OK

    emmctool u

    emmctool w

    dd u-boot file

    None of the 3 scenarios allow me to boot from internal for now. Not sure which wizardry occurred when it booted for just one time

  • I have been trying a whole lot of different procedures, it will only boot when the SD in held in, and when it manages to boot there's no control over whether it starts from EMMC or SD.

    The instructions seem pretty straightforward and so far I don't see where I'm making a mistake:

    Code
    cd /storage
    wget https://chewitt.libreelec.tv/testing/LibreELEC-AMLGX.arm-10.0.0-wetek-play2.img.gz
    emmctool w LibreELEC-AMLGX.arm-10.0.0-wetek-play2.img.gz
    dd if=/storage/u-boot.bin.sd.bin-wetek-play2 of=/dev/mmcblk1

    Then reboot without SD should have Llibreelec start from internal EMMC. Or is there something else to do?

    FYI - I tried toggling boot loader with the remote's power button just in case as well

  • I am 100% confident you cannot put mainline u-boot on eMMC *and* boot into an OS that resides on eMMC at the same time. It would need the same kind of MBR coexistence fudge that Amlogic added to their own u-boot sources. This doesn't (and won't) exist in mainline u-boot so we cannot replicate the the vendor image experience. That said:

    Install the image to emmc (emmctool w ...). This gives you the normal two partitions and files in the right place. Now erase an SD card and put u-boot on it in the right place, see: LibreELEC.tv/mkimage at amlogic · chewitt/LibreELEC.tv · GitHub and u-boot.bin.sd.bin-wetek-play2 for the u-boot.bin.sd.bin file.

    I've never tested this, but it should boot (u-boot) from SD and then find the LE boot files (via disk LABEL) on the eMMC partition?


  • The dd command to another SD got the Wetek play 2 to boot from eMMC.

    Code
    sudo dd if=./u-boot.bin.sd.bin-wetek-play2 of=/dev/disk5  conv=sync,notrunc bs=512 skip=1 seek=1

    Is the part I am not understanding is that I will always need the SD inserted to trigger the boot via disk LABEL on eMMC?

  • Is the part I am not understanding is that I will always need the SD inserted to trigger the boot via disk LABEL on eMMC?

    Correct. The SoC (hardcoded silicon) only checks for signed boot firmware magic in the first sector of eMMC, which is where the MBR partition data also needs to reside, i.e. if you install u-boot there it overwrites/breaks partitioning (but the box will boot) and if you put MBR there your partitions are good but the box will not boot (no bootloader). The design mistake is corrected in the next hardware generation (GXL) and up, which also check the 512th sector (same as SD media) which allows MBR to reside in the expected location and boot firmware to be elsewhere. So the workaround is to boot (u-boot) from SD .. it then executes the Linux KERNEL file and userspace SYSTEM file from eMMC.

    The *only* way to boot *and* run from eMMC is to use Amlogic u-boot which implements a custom partition scheme that relocates the MBR data to a non-standard location. The code for this could in theory be ported to mainline u-boot, but the resulting changeset would never be accepted and would have to remain as an out-of-tree hack/patch, which effectively guarantees it will never happen.

  • Thanks for the explanation.

    Is this the non standard location?

    Code
    /dev/mmcblk1boot0
    /dev/mmcblk1boot1

    Since the Wetek Play 2 won't be able to play HDR or DV, I think I will keep it for its DVB-S tuner in a corner or my house as recommended at the beginning of this thread.

    And since the SD latch is now broken, booting from SD is only an option if I put a thick piece of tape or something to hold it in permanently.

    Any possibilities of using a USB stick? And shall I revert back to LE9 to have the tuner support?

  • The /dev/mmcblk1boot0 and boot1 devices are special locations where (if the hardware supports them) you can install u-boot separate from a normal MBR filesystem on the /dev/mmcblk1 device, but GXBB (and GXL/GXM) do not support this. The first Amlogic devices that do suppport it are G12A (S905X2/D2/Y2).

    The non-standard location is simply an offset (shifted X sectors). However this is only visible-to and understood by Amlogic u-boot which has the internal juju to understand the offset and it's own partition tools. All normal userspace apps like fdisk/parted cannot see the partitions that have been created. You can see this when booting the LE10 WP2 image on a factory state box and running "emmctool i" - it can see the emmc device but no filesystems are listed on it.

    If you want the DVB tuners to work you will need to restore to an LE9 or CE9 image as there is currently zero support for the DVB cards used in Amlogic boxes in the mainline kernel. This also solves the SD card issue as the device will boot from eMMC. This image will restore the box to WeTek/Android state Dropbox - backup-wp2.img.gz - Simplify your life .. then boot from SD card (the LE10 WP2 image) and use emmctool or dd to write the file to emmc. USB should also work as an alernative to SD .. I've done it numerous times with other boxes but can't say I've ever bothered with a WP2 as mine has a working SD slot. YMMV.