I posted about the crash I was getting on my Shield TV, but I did a lot more digging and found that it seems to be related to running Channels under either Docker specifically or Docker under Unraid. It might also just affect the Linux binary itself. These issues don't manifest when using Apple TV, they seem to only manifest with Android TV devices, specifically the Shield TV. For example, my Shield that's on Wi-Fi will randomly get connection reset errors and the stream will just drop.
My Shield that's on Ethernet is much more forgiving. It'll randomly freeze the app until I restart the Docker container or decides to randomly come back after five minutes. Since I have the beta sideloaded and the Channels buttons enabled in the accessibility settings, when the Shield that's on Ethernet freezes, it creates multiple button presses in one button press, which is really weird.
I have tried all sorts of things, pretty much every single possible variable of TCP tuning one can do on a Linux device with sysctl. I mean, you name it, I tried it. I also tried every possible Docker networking mode available on Unraid. I even went so far as to build my own Debian-based Docker container for Channels DVR, which actually worked really well. I probably should rebuild it and put it out there because I think it actually solved the permissions issues on Unraid.
Regardless, that didn't even fix it, so it wasn't the Docker container specifically, or even, in my opinion, Unraid. I even went and installed a third-party kernel for Unraid that's on a much more recent kernel release than what's currently available. And that still didn't solve it.
What did resolve all of my issues is a Windows Virtual Machine running the Windows version of Channels DVR under Unraid. I am now at a complete loss. I'm happily running Channels DVR on Windows with no stream drops, no freezes or anything like that. The server's just running on a Windows virtual machine.
I'm posting here just to see if anyone who knows anything about Linux internals or has any idea of what could be going on could give me some advice. I prefer a containerized approach, but if I have to go with virtualization completely, I will.
It's just super weird and the fact that it works on Windows kind of confirms that it's not my network specifically. It also rules out a bug with the Android client.
What I would observe essentially is the app would either freeze on the Ethernet Shield and restarting the Docker would unfreeze it and I saw there were some stale connections piling up in the conntrack table. That I knew for sure. The shield in my bedroom that's stuck on Wi-Fi would just drop it's stream and send RST packets observed with tcpdump. I also caught some weird epoll errors with strace.
I just think something weird is going on with the current Linux binary. That's the only explanation because Windows works just fine. The primary variable is either the Windows TCP stack doing something different even though it's still going through virtio or the Linux binary. But regardless, if anyone's getting black screens with their Shield, try moving your server over to a Windows box or a VM. If no one has any ideas, at least that works very well actually. It's super stable.
Original post:
