yashsingh1/xdaforums huggingface dataset:
[Fire TV Original Android Development] Pro-me3us:
I'll be amazed if you can push that higher, 445Mbps is already above what a lot of people get on WiFi6E on the 3rd gen.

That's the impression I've gotten too from the Kodi threads, HTTP/HTTPS is the best and SMB the worst option. SMB might still be fine for streams up to 100Mbps, covering most regular content? The Kodi Jellyfin plugin (HTTP/HTTPS) has also worked well for me.

I remember the 400Mbps Jellyfish sample playing but locking in parts under FireOS (MPV app, didn't try Kodi). CE is outperforming FireOS there.

I'm testing adding another boot option to allow booting a second USB stick. The thought was to leave two bootable USB drives plugged in (eg CoreELEC & EmuELEC), and choose which to reboot to (FireOS/CE/EE). It seems to work fine, it should also work with two CE USB sticks (primary and test sticks).

By the way, is your IR remote responsive? My experience with CEC control was that it was usable, but the slight lag made the UI feel sluggish. I prefer BT remote control over CEC. IR control is very popular under CE, since BT remotes can't be paired under both CE & Android. I assume IR is very reponsive, but never tested it. Try comparing yours to a USB keyboard (maximum responsivity).
[Fire TV Original Android Development] signde:
I was curious so I ran iperf3 from my Cube 3 using PingTools app. Fastest I saw was 498Mbps. I don't have a WiFi6e network but from my main router RT-AX88u which is WiFi6 AX6000 I can pull 700Mb on my iPhone 14 pro so my network definitely supports more than where the 3 is topping out.

Cool!

I don't know how much swapping back and forth I will do so I don't know how much I would use that but I continue to appreciate how much effort you put into this platform.

The remote I am using has its own USB dongle for the IR portion which I have plugged into my hub. It's something I have had laying around from back in the OpenElec days using little mini PCs. It works well and no difference in lag vs the USB keyboard I am also using.

I am wondering however you are asking about using IR directly against CE which I didn't even think about trying. Is the IR hardware in place in the Cube 2 for me to try something like this? My google searches around the Cube 2 IR are all a bunch of results with people trying to use the Cube's extender.
[Fire TV Original Android Development] ddogishere:
Hi @Pro-me3us , is the emmc flash removable, if so how. And secondly how do you update nightly with emmc flash. TIA.
[Fire TV Original Android Development] Pro-me3us:
It's soldered to the main board, so not easily.

As far as I know, the update process isn't any different. The config.ini setting directs CE to look for /Storage on the eMMC (/data/coreelec_storage/) rather than the USB stick.

When you follow the USB/eMMC setup instructions, it copies USB storage to /data/coreelec_storage on the Cube. You can remove the config.ini setting at anytime and CE will go back using Storage partition on the USB stick.

You might even get a little more if you run iperf3 directly from the command line. The attached version runs under FireOS. Copy it to:

gazelle:/ $ /data/local/tmp/iperf3

gazelle:/ $ chmod +x /data/local/tmp/iperf3

gazelle:/ $ /data/local/tmp/iperf3 -c <iperf3_server_ip>

The iperf3 binary may run on raven too.

The extender is an IR blaster (transmitter), there's 6 more blasters in the Cube's shell. There's also a separate IR receiver, but I couldn't get IR event dection working in CE. I couldn't even detect events in FireOS until editing the FireOS dtb.

FireOS is using the standard Amlogic IR driver, but it looks modified, and probably needs to be modified for CE.

Raven's remote has limited IR functionality (power + volume buttons), gazelle's remote is fully IR + BT. Gazelle's remote could be paired to raven to use BT in FireOS and IR in CE if IR was working. This is the only easy way to use one remote for both Android and CoreELEC on any Amlogic box. IR not working is probably a bigger problem than BLE.

At some point while debugging other problems with the CE dtb, I removed the IR receiver node altogther. I could put it back in, but I don't think it will matter without modifying the IR driver.

You might be able to detect IR events from gazelle's remote on your USB IR dongle, if you want one remote to control CE and FireOS.
[Fire TV Original Android Development] ddogishere:
Hi thanks @Pro-me3us , sorry I meant once you flash CE to the emmc, how then to remove CE from emmc again like it was before the flash.

Also what do I need hardware and software to get IR to work, to be able to turn on/off the Cube in CE & FireOS. Cheers.
[Fire TV Original Android Development] Pro-me3us:
Oh ok, I thought asking about removing the eMMC was odd :D

I've only tested getting the USB/hybrid mode setup. I haven't tried to move a working Kodi instance back to the USB drive. I'm assuming you can use CE's backup option.

Settings > CoreELEC Settings > System > Create System and Kodi Backup

Once you have your backup, edit /flash/config.ini and remove 'toram disk=FOLDER=/dev/data' from the line below

coreelec='quiet toram disk=FOLDER=/dev/data'

That stops CE from looking for storage on the data partition. You can then delete the /data/coreelec_storage/ folder if you want through ADB or filemanager in FireOS.

After this, CE will go back to using the USB Storage partition, and you can use the 'Restore Backup' option in CE. Whatever was on the USB storage partition before migrating to USB/eMMC mode will still be there even before you do a restore backup. The initial instructions only copy the USB's storage to the eMMC, it doesn't delete that data from the USB.

This is all based on Peter's guide, and a copy was added to the FAQ that can be expanded on for clarification. If you want confirmation on any of this, post to the FireTV Cube thread, and reference the guide from the Homatic's thread. Peter or someone in the know will probably respond.

The Cube's build-in IR receiver isn't currently functional under CE. So you'd need a USB IR dongle. FLIRC is the most popular one, but it's overpriced.

You'd also need a remote with IR capability. Only the volume and power buttons are IR capable on the 2nd gen Cube remote. If you had a 3rd gen Cube, you could swap with raven, because the 3rd gen Cube remote is fully IR capable (there are a lot of AndroidTV remotes that would work too). Then you could use that same remote for FireOS and CE. CEC lets you use the same remote for both OS's now.

IR wouldn't let you power on the Cube. That feature only works from suspend and mostly just Amlogic boxes without encrypted bootloaders.

I'll take another look at getting the Cube's IR receiver to work in CE, but driver problems are mostly beyond my understanding.
[Fire TV Original Android Development] ddogishere:
@signde did you solve constant spinning bootup 50% of the time? Have to unplug and plug it in again, really annoying.
[Fire TV Original Android Development] signde:
You were right, a little higher. Fastest I saw on the Cube 3 with the binary directly was 525Mbps.

I have yet to track this down.

I have BT disabled which seems to cut down the frequency but Pro-me3us seems to think it might be the WiFi driver as they are shared, see comments here.

My observations thus far are that before you disable the BT driver, a lockup can be observed with the splash screen animation stopping then nothing happening after that.

Once the BT driver is disabled, that behavior goes away but then you can sporadically see the animation spin indefinitely with CE never loading.

He has suggested disabling Wi-Fi but I have yet to do this. See his comments here.
[Fire TV Original Android Development] Pro-me3us:
Looking at IR on the Cube again, the receiver is working in CE, but the events aren't being decoded. I can manually decode the detected IR signal, and to figure out what button was pressed. Still trying to figure out if this is a software or hardware problem.

If anyone has another Amlogic box with IR working, can you run:

CoreELEC:~ # mode2 > /storage/downloads/fire_voldown.bin

Then tap the Volume Down button once on the 2nd gen Cube FireTV remote. And type Ctrl+C to stop. Then send me that fire_voldown.bin file in the downloads folder. I see the problem, IR can be fixed but need to figure out the best way to handle it.

I've been doing a lot of CE reboots the last few days, probably over 50, without any lockups during bootup. Blacklisting the MT7668 BT driver does seem to fix any bootup lockups in my case. I also ran a fresh install. The first boot after the partition resizing did take ~5min to complete, it can take some time.
[Fire TV Original Android Development] ddogishere:
Hi @Pro-me3us , great work as always. Thank you.

Encountering couple of issues:

1. Mkbootimg doesn't work on some tar like thisCE-21 or 19.4 - says kernel not found.

2.RebootToFireOS just hangs now, maybe we need to give permission to where quiescent.img is installed dev/misc- but can't find it.

Thanks.
[Fire TV Original Android Development] Pro-me3us:
That problem is fixed in the newer version of the script.

Don't mess with quiescent.img or /dev/misc, it could brick the Cube.

Maybe scripts do need execution permission under certain circumstances after all. SSH into the directory where you put bootfireos when you edited your Kodi skin and give it execution permissions (chmod +x bootfireos).

If that doesn't work, try the reboot to fireos command from SSH to make sure it's not hanging there (reboot quiescent). And if that works try running the script from SSH (./bootfireos).
[Fire TV Original Android Development] signde:
I wonder what is different about our setups vs. yours. I have yet to disable WiFi however like ddogishere I still get into scenarios where CE doesn't load. I wouldn't say it is 1/2 of the time, more like 1/3. I've resorted to putting the Cube 2 on a smart plug rather than wearing out the power port connector.

It seems like the nightly from 0619 has audio rework in it with a new MAT packer. I reported this in the CE forum thread but up to this point I am having some files stuttering during playback and the logs looks like audio sync issues for me. So far in my testing this new version has been solid.
[Fire TV Original Android Development] ddogishere:
Stupid me, my DialogButtonMenu was not configured properly-/storage/.kodi/addons/skin.confluence/720p.. miss the 720p.

Thanks and mkbootimg is now good 👍.
[Fire TV Original Android Development] Pro-me3us:
That's still very frequent, can you share the dmesg log from a successful boot.

CoreELEC:~ # dmesg | paste

@ddogishere did you blacklist the MT7668 BT driver? And after that you are still getting bootup freezes ⅓ - ½ the time?

Happy to see some different audio setups being tested with raven. Audio equipment can be hard to predict. Since audio is a SOC feature, I'd expect any issues to be common among any AML g12 boxes. That's a good thing, those types of problems are more likely to get fixed.

Your raven got banished to a 720P display :eek:

I'm going to enable the physical buttons on the Cube in CE while I fix the IR. Is there anything anyone would want them mapped to? For example, reboot or power off. Otherwise I will just make them available as gpio buttons that can be used as triggers in scripts.
[Fire TV Original Android Development] ddogishere:
Yes thanks @Pro-me3us the boot issue is almost gone with blacklist BT only.

Can you map separately to power to fireos & CE separately? That will be cool , thanks.

Btw will it be ever doable to turn on the Cube from cold with remote IR? That for me will be the ultimate sweetener.
[Fire TV Original Android Development] Pro-me3us:
Almost? How often do you still get boot lockups 1 in 5, 1 in 10 reboots?

The buttons can trigger a reboot to CE or FireOS from CE. How the Cube boots up from a power off state can't be controlled by CE. CE can only control what the Cube does while CE is running.

It would be possible to control how the Cube boots from the bootloader. Currently there's already three options implemented.

Volume Up - Fastboot

Volume Down - TWRP / Recovery

Action - Update / U-Boot

I could add a button combination like Volup+Voldown that bypasses USB to boot, to FireOS. But you'd still have to hold those buttons for 5-7sec after power-on, because the button check doesn't happen until 5-7secs into the boot process. I don't know if that adds much convenience over pulling the USB stick out?

That's not possible on any Amlogic box is it? I know it's possible to power on the box from a suspend state, because CE is still active. Powering the Cube on by IR from a suspend state might be possible, but all the problems that occur by pressing the action button to wake from suspend would still be there.
[Fire TV Original Android Development] signde:
https://paste.coreelec.org/SpellEntice

It took 7 reboots to get one that would not start. It's so random. I've had them happen back to back, sometimes even 3 times in a row, then I've had times like this where it doesn't do it for quite a few reboots.

Hopefully it doesn't matter when I captured that output, I did that after the first reboot.

I double checked and confirmed the blacklist entry in /storage/.config/modprobe.d/blacklist.conf is present.
[Fire TV Original Android Development] Pro-me3us:
Just wanted to double check that the blacklist was working and that the BT driver wasn't loading, it's not.

I am seeing lockups on my new USB test stick, always caused by WiFi at the same step of the driver loading process. No lockups on my daily use USB stick in the last month. It's on Ethernet, and WiFi is disabled in CE Settings. Don't know if that is the reason.

I need to test CE20.2 to see if the problem existed back then. I don't remember boot lockups, and CE has made changes to the MT7668 drivers since then. Plus EmuELEC doesn't have any problems with WiFi and BT enabled.

Will have to keep investigating. You can bring it up on the CE forum, that will at least let them know there is interest in these drivers.
[Fire TV Original Android Development] signde:
I'm happy to bring that up over there. A couple questions -

1. What is the difference between your new USB stick vs. your daily use USB stick? I assume CE version? I started seeing this issue from the beginning on my v21 stable stick and continuing still on my v21 nightly stick.

2. Do you know of any other CE supported devices that use the MT7668 chip?

3. How are you confirming it is the WiFi driver? is it via this method you described previously?
[Fire TV Original Android Development] Pro-me3us:
@signde @ddogishere I think this may work to do away with the bootup lockups. Attached are two scripts, move them both to /storage/.config (same as Samaba ConfigFiles folder). The shutdown script disables WiFi during shutdown/reboot, the autostart script enables WiFi on boot. You won't notice any difference in CE, this just deals with a WiFi timing related issue that seems to be causing the lockups.

If this gets you past 10 or more reboots without any lockups, then maybe we can try re-enabling the MT7668 BT driver.

I have uart hooked up so that I can see the boot log even when the output stops getting printed to the screen. Boot lockups always stop at the same step in the WiFi driver loading.

I just use multiple USB drives when I'm testing things out because I don't want to screw up my main device that I have for regular use. Try these scripts before reporting on the CE forum.
[Fire TV Original Android Development] ddogishere:
Muchos gracias @Pro-me3us will test & report back.

Btw, ive installed CoreELEC to cube emmc but i still need usb/ sdcard attached to boot to coreelec. Have had several corrupt sdcard due to constant spin so unplugged cube & needed to start from scratch so many times so I tried it. But why we still need usb attached, doesn't that defeat the purpose of install / boot from emmc?
[Fire TV Original Android Development] Pro-me3us:
Yes, it's a USB/eMMC hybrid mode. Only the Storage partition is run from the eMMC. Part of the system.img is run in RAM, and the entire kernel.img was already run in RAM previously. Booting entirely from the eMMC would require resizing and creating new eMMC partitions, without much extra improvement in performance.

Maybe the system.img could also be copied to the eMMC data partition and mounted from there rather than the USB. You'd have to ask Peter about that, I think it would require some CE changes. The USB/eMMC hybrid mode is already only possible because the reconfiguration was baked in to CE.

I've had the lockups many times during testing, but I don't remember ever corrupting a USB stick pulling the power. In what way were the USB sticks corrupted? What was the observed behavior that indicated corruption?
[Fire TV Original Android Development] ddogishere:
The never ending spin , pull plug, lead to system corrupt & give you 120 secs for it to repair/ rebuild the usb or take outl. My usb is split into 2, 1. Nfs & coreelec as the card is 100gb+. But have return to all sdcard for coreelec and autostart.sh/ shutdown helps lot, so far 1 in 6 lockups compared to 4 in 6 before.
[Fire TV Original Android Development] Pro-me3us:
If it happens again and rebuilds and proceeds to CE, save the dmesg (dmesg | paste). I've not experienced that yet. You lose all your settings and CE acts like it was freshly setup? @signde Has this happen to you too?

The scripts depend on a graceful reboot/shutdown. Shutdown.sh won't be executed if the Cube loses power in CE, or when CE is forcefully exited (reboot now/shutdown now). When using SSH, issue reboot/shutdown without the 'now' parameter.

I'm trying out disabling/enabling BT with WiFi, and that seems to be working too, I've done at least 5-10 reboots without a lockup. The scripts aren't needed when using Ethernet, because WiFi can stay off. That's why I hadn't had any lockups in a number of weeks.
[Fire TV Original Android Development] ddogishere:
Thanks what hub you use? I'm thinking of buying one.
[Fire TV Original Android Development] signde:
No I have never seen this. I bet I have pulled power to reboot the device at least 20 times for various reasons as I was tinkering a lot early on.

In their shoes I’d try a different USB stick or hub. I’m using a cheap $8 PNY 32GB “Elite” stick and Cable Matters hub with ethernet both of which I’ve linked previously in this thread.
[Fire TV Original Android Development] Pro-me3us:
I updated the raven DTB to enable the keypad buttons and IR receiver. The Cube buttons are working but I need to decide what to use them for. Right now VolUp/VolDown are mapped to the TV volume and Mute is mapped to unknown (key code 240).

The Action button is mapped to Shutdown. This is an aggressive shutdown, that will exit Kodi without closing properly. This is useful if CE locks up and you have to resort to pulling the power code. It works on bootup lockups, but it gives the WiFi driver 100sec to respond before forcing forward. So the shutdown takes ~110 seconds, but you don't have to pull the power cord. Hopefully the autostart/shutdown scripts are working well enough that this isn't needed.

IR is working but I'm not happy with the performance, maybe I've gotten too use to BT. Performance is remote dependent. Very clicky remotes seem to work worse that soft button remotes. Maybe this can be optimized further. I got the impression that IR remote responsiveness is not uncommon with CE.

Guide to creating a amremote.conf file for your remote.

Remote repository with amremote and meson-ir remote profiles.

I've added another script to the mkbootimp.zip, so that you can pack the raven DTB directly into CE's kernel.img. I also replaced the update.sh script with a python version. The updated raven DTB with keypad and IR functions is in the mkbootimg.zip under /mkbootimg/out/raven_dtb.img.

To update CE's DTB, run the following command from SSH

python kernelpack.py <raven-dtb-name>

reboot

To pack a kernel.img you provided

python kernelpack.py <raven-dtb-name> <kernel.img>

Newly packed kernel.img will be in out/kernel.img

To pack the raven DTB into a update .tar file

python update.py <name-of-ce-update-file>

Packed tar is moved to Update folder, and will install on next reboot.

Attached are newer versions of the autostart.sh and shutdown.sh scripts. Enabling/disabling Bluetooth was added, but if you don't use Bluetooth, leave it on the blacklisted. There's also an extra command in autostart.sh to make IR work.
[Fire TV Original Android Development] Pro-me3us:
I don't use anything special, I have a couple of these laying around, that are 10-15years old. If you want one that includes Gigabit Ethernet and optional power supply, this one is popular.
[Fire TV Original Android Development] Pro-me3us:
Did you replace kernel.img on your flashdrive with the kernel.img from the OP? It has the needed raven DTB packed into it.
[Fire TV Original Android Development] Wagmans:
I did.

What I've noticed is that the Cube is very selective as to what USB Hub/Flash drive/devices it will boot from. I'm slowly narrowing down which devices work and which don't. Oddly enough some non-powered hubs will boot, while some powered hubs won't.
[Fire TV Original Android Development] Pro-me3us:
I did have a USB stick that U-boot wouldn't detect. When you find a USB stick that will boot, try different ports on the USB hub that's not working. The U-Boot USB drivers aren't as flexible as Android/FireOS/CE.
[Fire TV Original Android Development] Wagmans:
I'm seeing some odd behavior- I was able to get it to boot into CoreElec with a powered hub from a flashcard reader, but when I plugged a USB keyboard in some of the keys didn't work.

Without a working hub this is useless to me- I assume someone has figured out a working combination. I need to at least be able to get a keyboard/ethernet and remote receiver (or BT dongle) working simultaneously.

I have one hub it won't boot from at all- another two where it will boot and lock (but sometimes works).
[Fire TV Original Android Development] Pro-me3us:
It's locking on the CoreELEC bootup screen? If so that's probably due to the MT7688 WiFi/BT drivers. They are frequently locking the bootup. The current work around is to copy the autostart.sh & shutdown.sh scripts to /storage/.config/ (Samba ConfigFiles). That's been working well for me. I'm waiting to see how it works for others. I'm still trying to figure out the heart of the driver problem.

I haven't had any problems with keys not working on my one USB keyboard. Do you have a USB mouse that you could use with the on-screen keyboard? If you can get your WiFi password in, then you can use SSH and Samba to do the rest.
[Fire TV Original Android Development] ddogishere:
Thank you for your effort on the IR front, much appreciated. I just have several q's & feedbacks.

1. Will it be possible to turn on cube with remote?

2. I have the USB C one but it doesn't work with micro usb to usb c adapter, any ideas why?

3. Regarding boot lookups, the autostart.sh/ shutdown scripts, it works 60% of time but I find I get no WiFi after login & my Mount.services (to Mount on bootup) doesn't Mount due to no WiFi (I only use wifi as my usb c hub doesn't work as mention earlier.

4. What's working for me is the blacklist.confi, I get 80/90% boot ups with my mounts working.

TIA.