|
@@ -69,16 +69,19 @@ the real MPD on `radio.lo`, with on-screen buttons and keyboard shortcuts. Every
|
|
|
frame takes the real path down to individual TCA9539 bytes, and a simulator of
|
|
frame takes the real path down to individual TCA9539 bytes, and a simulator of
|
|
|
the expander and LCD controller decodes those bytes to produce the picture.
|
|
the expander and LCD controller decodes those bytes to produce the picture.
|
|
|
|
|
|
|
|
-**Written and compiled, but never run:** the DRM kernel driver, the DRM frontend,
|
|
|
|
|
-the i2c-dev frontend against a real bus, and the device tree overlay. No part of
|
|
|
|
|
-this has touched real hardware, so everything about the hardware itself is still
|
|
|
|
|
-unconfirmed (section 7).
|
|
|
|
|
|
|
+**Runs on the USB test rig:** the panel through i2c-dev and through the DRM
|
|
|
|
|
+driver, the full UI on both, and the key expander U2: all 13 keys read
|
|
|
|
|
+correctly on the key screen.
|
|
|
|
|
+
|
|
|
|
|
+**Not yet run:** the device tree overlay, the application on the target board
|
|
|
|
|
+and its Python 3.7.3, and key autorepeat on real presses. What is still unconfirmed about
|
|
|
|
|
+the hardware is in section 7.
|
|
|
|
|
|
|
|
## 2. Decisions and how they changed
|
|
## 2. Decisions and how they changed
|
|
|
|
|
|
|
|
| Topic | Original plan | Now | Reason |
|
|
| Topic | Original plan | Now | Reason |
|
|
|
|---|---|---|---|
|
|
|---|---|---|---|
|
|
|
-| Keys | 4×4 matrix, `gpio-matrix-keypad` | 13 keys sensed directly, `gpio-keys` | 13 keys + backlight = 14 of U2's 16 pins; no scanning |
|
|
|
|
|
|
|
+| Keys | 4×4 matrix, `gpio-matrix-keypad` | 13 keys sensed directly: `gpio-keys` with the overlay, polled over i2c-dev until `INT` is wired | 13 of U2's 16 pins, no scanning; the backlight is on U1 P1.0 |
|
|
|
| UI toolkit | LVGL | Cairo + Pango on GLib | LVGL was not installed; Pango handles Polish text directly |
|
|
| UI toolkit | LVGL | Cairo + Pango on GLib | LVGL was not installed; Pango handles Polish text directly |
|
|
|
| Development | USB adapter first | Window + simulator first | Most of the logic needs no hardware |
|
|
| Development | USB adapter first | Window + simulator first | Most of the logic needs no hardware |
|
|
|
| MPD | Local | Host is an option; default `radio.lo` in the window, `localhost` on the panel frontends | Remote development |
|
|
| MPD | Local | Host is an option; default `radio.lo` in the window, `localhost` on the panel frontends | Remote development |
|
|
@@ -93,7 +96,7 @@ address binds to one driver, which is another reason for a separate expander.
|
|
|
|
|
|
|
|
MPD (mpd.py, idle events) ───────┐
|
|
MPD (mpd.py, idle events) ───────┐
|
|
|
/dev/kmsg (optional) ────────────┤
|
|
/dev/kmsg (optional) ────────────┤
|
|
|
- keys (evdev, or a window) ───────┤
|
|
|
|
|
|
|
+ keys (evdev, U2 polled, window) ─┤
|
|
|
▼
|
|
▼
|
|
|
app.py + render.py (Cairo/Pango) Python
|
|
app.py + render.py (Cairo/Pango) Python
|
|
|
│ XRGB8888 frame + changed rows
|
|
│ XRGB8888 frame + changed rows
|
|
@@ -160,7 +163,9 @@ python3-gi-cairo; GTK 3 only for the window and the test mode, libdrm only for
|
|
|
| `gtkkeys.py` | Key table and buttons, and the test mode's key window |
|
|
| `gtkkeys.py` | Key table and buttons, and the test mode's key window |
|
|
|
| `drm.py` | `drm`: the panel through the DRM driver (libdrm 2.4.97 calls, dumb buffer by ioctl) |
|
|
| `drm.py` | `drm`: the panel through the DRM driver (libdrm 2.4.97 calls, dumb buffer by ioctl) |
|
|
|
| `platform.py` | evdev keys, sysfs backlight, i2c bus check, signal handling |
|
|
| `platform.py` | evdev keys, sysfs backlight, i2c bus check, signal handling |
|
|
|
-| `__main__.py` | Command line, `i2c` frontend and its `--pattern geometry` / `gray` |
|
|
|
|
|
|
|
+| `keypad.py` | U2 over i2c-dev: setup, 20 ms polling, debounce, autorepeat, stuck-key and bus-fault guards |
|
|
|
|
|
+| `keytest.py` | `keytest`: the key screen for hardware tests |
|
|
|
|
|
+| `__main__.py` | Command line, `i2c` and `keytest` frontends, `--pattern geometry` / `gray` |
|
|
|
|
|
|
|
|
Behaviour kept from the firmware: 300 ms key lockout, 30 s backlight, the same
|
|
Behaviour kept from the firmware: 300 ms key lockout, 30 s backlight, the same
|
|
|
command for each key, no title while stopped. New: event-driven updates instead
|
|
command for each key, no title while stopped. New: event-driven updates instead
|
|
@@ -208,12 +213,13 @@ re-sending DISP ON (the cursor fix); the last two rows predate it.
|
|
|
| Panel tests: init values, invalid configs, no-change = no traffic, direction choice, gap merging, 2000 random update rounds at 1/2/4 bpp and message sizes 7/61/1025, error recovery, pixel conversion | Pass, also under ASan and UBSan |
|
|
| Panel tests: init values, invalid configs, no-change = no traffic, direction choice, gap merging, 2000 random update rounds at 1/2/4 bpp and message sizes 7/61/1025, error recovery, pixel conversion | Pass, also under ASan and UBSan |
|
|
|
| The simulator's fault detector fires on bad streams | Pass |
|
|
| The simulator's fault detector fires on bad streams | Pass |
|
|
|
| All frontends, the overlay and the module compile; module with `W=1` | No warnings shown |
|
|
| All frontends, the overlay and the module compile; module with `W=1` | No warnings shown |
|
|
|
-| Python UI tests (`make pytest`, 17 tests): MPD parsing, commands, push and reconnect against the fake server; rendering through the simulator with no faults; key lockout; patterns; bus refusal; evdev codes against the overlay | Pass on 3.14.7 |
|
|
|
|
|
|
|
+| Python UI tests (`make pytest`, 26 tests): MPD parsing, commands, push and reconnect against the fake server; rendering through the simulator with no faults; key lockout; patterns; bus refusal; evdev codes and U2 pins against the overlay; U2 setup, debounce, autorepeat, keys held at start, bus faults, poller error recovery; key screen | Pass on 3.14.7 |
|
|
|
| `radio-ui sim` against the C window, same fake server | LCD area identical except one progress bar pixel (timing) |
|
|
| `radio-ui sim` against the C window, same fake server | LCD area identical except one progress bar pixel (timing) |
|
|
|
| `radio-ui drm` on the real panel (driver loaded), fake MPD | Runs, no errors from the frontend or the kernel |
|
|
| `radio-ui drm` on the real panel (driver loaded), fake MPD | Runs, no errors from the frontend or the kernel |
|
|
|
| Test mode key window: every shortcut, media key and window close, injected as GDK events | All 13 keys mapped; closing the window quits |
|
|
| Test mode key window: every shortcut, media key and window close, injected as GDK events | All 13 keys mapped; closing the window quits |
|
|
|
| DRM ctypes structures and ioctl numbers against the C headers | Identical |
|
|
| DRM ctypes structures and ioctl numbers against the C headers | Identical |
|
|
|
| Window buttons against a fake MPD: Next, Up, Down, Pause, Prev, Stop, Play, Esc, Menu | The seven MPD commands sent correctly; Menu sends none |
|
|
| Window buttons against a fake MPD: Next, Up, Down, Pause, Prev, Stop, Play, Esc, Menu | The seven MPD commands sent correctly; Menu sends none |
|
|
|
|
|
+| Every key on the key screen (`tests/hw_test.sh`), USB rig | All 13 read correctly after swapping Play (P1.6) and Stop (P1.4) |
|
|
|
| Real MPD on `radio.lo` (0.21.4), read-only | Connects and displays correctly; player state not changed |
|
|
| Real MPD on `radio.lo` (0.21.4), read-only | Connects and displays correctly; player state not changed |
|
|
|
| MPD pushing a change | Triggers a refresh (fake server) |
|
|
| MPD pushing a change | Triggers a refresh (fake server) |
|
|
|
| Server lost, then back | Warning shown, reconnects automatically (fake server) |
|
|
| Server lost, then back | Warning shown, reconnects automatically (fake server) |
|
|
@@ -223,8 +229,9 @@ Python 3.7.3 was not run here (no interpreter or container available): the code
|
|
|
was parsed with `ast.parse(feature_version=(3, 7))` and avoids newer library
|
|
was parsed with `ast.parse(feature_version=(3, 7))` and avoids newer library
|
|
|
calls, but needs a run on the target. Real X keyboard delivery to the key window
|
|
calls, but needs a run on the target. Real X keyboard delivery to the key window
|
|
|
was not exercised (no input injection tool), nor real MPD with key presses, to
|
|
was not exercised (no input injection tool), nor real MPD with key presses, to
|
|
|
-avoid changing playback. `radio-ui i2c` was not run on hardware after the port:
|
|
|
|
|
-the DRM driver held the panel's address at the time.
|
|
|
|
|
|
|
+avoid changing playback. The Python i2c-dev path drove the panel on the rig
|
|
|
|
|
+(`tests/hw_test.sh init`); the full `radio-ui i2c` UI has not run there since
|
|
|
|
|
+the port.
|
|
|
|
|
|
|
|
## 7. Not verified
|
|
## 7. Not verified
|
|
|
|
|
|
|
@@ -240,6 +247,9 @@ These can only be settled with hardware.
|
|
|
which can't be synchronised over I²C. The existing firmware doesn't either.
|
|
which can't be synchronised over I²C. The existing firmware doesn't either.
|
|
|
- **A0 timing margin.** The conservative extra cycle may be removable, saving
|
|
- **A0 timing margin.** The conservative extra cycle may be removable, saving
|
|
|
about a third of the seek cost.
|
|
about a third of the seek cost.
|
|
|
|
|
+- **Key autorepeat.** All 13 keys read correctly on the key screen (Play and
|
|
|
|
|
+ Stop were swapped and are fixed), but the repeat timing on held keys is
|
|
|
|
|
+ unconfirmed.
|
|
|
- **`radio-keys` device name.** Assumed from the node name; `--input` overrides it.
|
|
- **`radio-keys` device name.** Assumed from the node name; `--input` overrides it.
|
|
|
- **DRM driver and frontend behaviour at runtime.** Also `/dev/kmsg` on the target.
|
|
- **DRM driver and frontend behaviour at runtime.** Also `/dev/kmsg` on the target.
|
|
|
|
|
|
|
@@ -276,7 +286,8 @@ cost on the board.
|
|
|
**Phase 1: keys and backlight**
|
|
**Phase 1: keys and backlight**
|
|
|
- [x] Rewire the keypad for direct sensing: active high, pull-downs, U2 at 0x76
|
|
- [x] Rewire the keypad for direct sensing: active high, pull-downs, U2 at 0x76
|
|
|
- [x] Key expander answers on the rig, idle reading clean
|
|
- [x] Key expander answers on the rig, idle reading clean
|
|
|
-- [ ] Press every key on `tests/hw_test.sh` (key screen), check repeat on Up/Down
|
|
|
|
|
|
|
+- [x] Press every key on `tests/hw_test.sh` (key screen): Play/Stop were swapped
|
|
|
|
|
+- [ ] Check repeat on Up/Down
|
|
|
- [ ] Full UI with I²C keys against the fake MPD (`tests/hw_test.sh ui`)
|
|
- [ ] Full UI with I²C keys against the fake MPD (`tests/hw_test.sh ui`)
|
|
|
- [ ] Set the real root `compatible`, I²C bus and INT pin in the overlay
|
|
- [ ] Set the real root `compatible`, I²C bus and INT pin in the overlay
|
|
|
- [ ] Check with `evtest`: all 13 keys, no bus traffic while idle
|
|
- [ ] Check with `evtest`: all 13 keys, no bus traffic while idle
|
|
@@ -319,8 +330,8 @@ cost on the board.
|
|
|
|
|
|
|
|
## 11. Open questions
|
|
## 11. Open questions
|
|
|
|
|
|
|
|
-1. **Is the keypad a physical matrix?** The firmware scans it as one. If the traces are wired that way, direct sensing needs rework; otherwise `gpio-matrix-keypad` remains an option with no code changes to the app.
|
|
|
|
|
-2. **Volume.** `radio.lo` reports `volume: n/a`, and the old scripts used `amixer set DAC` directly. If MPD has no working mixer, the Up/Down keys will only log an error. The fix is either an MPD mixer configuration or an ALSA path on the board.
|
|
|
|
|
|
|
+1. ~~**Is the keypad a physical matrix?**~~ Settled: rewired for direct sensing, active high with pull-downs, U2 at 0x76.
|
|
|
|
|
+2. **Volume.** `radio.lo` reports `volume: n/a`, and the old scripts used `amixer set DAC` directly. Without a working MPD mixer the Up/Down keys do nothing. The default hardware mixer looks for `PCM`, which the H3 codec lacks; `linux/README.md` gives the `mixer_control "DAC"` setting for `/etc/mpd.conf`; not yet confirmed on the board.
|
|
|
3. **Which SoC exactly?** The overlay's `compatible`, bus and INT pin are placeholders.
|
|
3. **Which SoC exactly?** The overlay's `compatible`, bus and INT pin are placeholders.
|
|
|
4. **Are other devices on the chosen I²C bus?** A dedicated bus is preferable.
|
|
4. **Are other devices on the chosen I²C bus?** A dedicated bus is preferable.
|
|
|
|
|
|
|
@@ -329,8 +340,8 @@ cost on the board.
|
|
|
The development PC is an AMD BC-250. Its `I2C_HEADER1` and possibly its PIIX4
|
|
The development PC is an AMD BC-250. Its `I2C_HEADER1` and possibly its PIIX4
|
|
|
SMBus ports reach the voltage regulators (ISL69247, ISL95712). Do not attach the
|
|
SMBus ports reach the voltage regulators (ISL69247, ISL95712). Do not attach the
|
|
|
expanders there, and do not run `i2cdetect` scans on buses 6-10.
|
|
expanders there, and do not run `i2cdetect` scans on buses 6-10.
|
|
|
-`radio-ui i2c` refuses those buses by name. Use a dedicated USB adapter such as an
|
|
|
|
|
-MCP2221A; this needs `CONFIG_HID_MCP2221` and `CONFIG_GPIOLIB` enabled.
|
|
|
|
|
|
|
+`radio-ui i2c` refuses those buses by name. Use a dedicated USB adapter: the rig
|
|
|
|
|
+uses an ATmega8U2 running i2c-tiny-usb (load it with `delay=1` for 400 kHz).
|
|
|
|
|
|
|
|
## 13. References
|
|
## 13. References
|
|
|
|
|
|