0.93.0 - Full screen when the phone turns, and a USB tab in Settings

On a phone the console now behaves like a video player. Turn the phone on its side and the picture takes the whole screen. Turn it back and full screen goes away too, but only if the turn is what started it. If you pressed the full-screen button yourself, it stays.
Chrome on Android reacts to the turn itself. Other browsers insist on a tap first, so there the first tap after the turn does it. iPhone Safari won't give a web page full screen at all, so on an iPhone nothing changes. It's on by default. To turn it off: Settings > UI > Full screen.
The gamepad and the serial port together
Until now it was the gamepad or the serial port over USB, never both. They had the same endpoint number, so the USB description had room for only one of them.
Now the device hands out endpoint numbers while it builds that description, and checks the whole set against the P4's port. The port has 7 endpoints for data going to the target and 4 KB of buffer for all of them together. Not much. Keyboard, mouse, gamepad, virtual media and the serial port fit, just. Ask for more and Settings refuses and tells you what to turn off. With all five on, USB screen sharing gets nothing, and Settings > Video says so.
One catch: with a gamepad on, the whole device shows up under the gamepad's USB IDs, because only then do Windows and Linux drive the pad. ESP-KVM Tools looks for its port under those IDs too.
To see where the endpoints went, Settings now has a USB tab. Each function is a row with its endpoints and whether it is on right now. Two bars on top show how full the port is, and the switches sit together instead of across four tabs. Whatever would not fit is greyed out. The USB names moved here from System as well.
Screenshots during USB screen sharing
Ruben Jongejan's second pull request (console#5). When the picture comes over USB from OS Services, the Screenshot button becomes "Download screenshot" and the browser saves the frame. Screenshots to the card still need HDMI.
Fixes
- HDMI sound on a busy board. A Function EV with Tailscale, Wi-Fi and Ethernet all running would not start the sound, and the log said "allocate DMA buffer failed" every 2 seconds. The receiver wants 10 KB of fast internal memory in one piece. By the time anyone listened, the network had chopped it up. So it takes the memory at boot now and holds on to it.
- Restart loop under a flood of connections. A client that opened new HTTPS connections in a loop, with video running, restarted the device over and over, until it gave up on the firmware and booted the other copy on the flash. On this chip a full TLS handshake takes about a third of a second. Back to back they kept one core busy until the watchdog fired. Handshakes now get a limited share of the time, and above it new connections are turned away for a moment. Open ones keep going. A browser that comes back resumes its session in a few milliseconds.
- "I2C transfer failed ... bus wedged?" On TC358743 boards this came dozens of times a minute under 1080p H.264, and now and then with two viewers. Nothing was wrong with the bus. The task that checks the HDMI input waited for it while a lower-priority task held it and could not get CPU time, and each time one HDMI check was lost. Now the waiting task lifts the priority of whoever holds the bus.
- Rare restart on an HDMI mode change. ESP-IDF 6.1 frees a DMA channel's controller state before it removes the interrupt handler, and an interrupt in that gap crashed the device. Capture keeps the controller in use now, so it is never freed.
Release: v.0.93.0.
Comments