Переглянути джерело

Swap Play and Stop on U2, record the key test

Pressing every key on the rig's key screen showed Play on P1.6 and Stop
on P1.4, the reverse of the map. Fix it in keypad.py, the overlay and
the README pin table. All 13 keys now read correctly; autorepeat timing
is still unconfirmed.

Document the MPD mixer setting the volume keys need: the H3 codec has
no PCM control, so the ALSA output has to use DAC.
k4be 2 тижнів тому
батько
коміт
ea149de8ba
2 змінених файлів з 19 додано та 8 видалено
  1. 17 6
      README.md
  2. 2 2
      dts/radio-panel.dts

+ 17 - 6
README.md

@@ -2,15 +2,15 @@
 
 Replaces the LPC1114 firmware: the panel and keys hang off I²C expanders on the
 Linux board. The panel runs on real hardware through `radio-ui i2c` and
-`radio-ui drm`. The key expander answers on the test rig and reads idle; no
-key has been pressed yet. The overlay has not run.
+`radio-ui drm`. All 13 keys read correctly through the key expander on the test
+rig. The overlay has not run.
 
 | Path | What |
 |---|---|
 | `driver/s1d13700_core.*` | Panel core, used by everything: init, 2 bpp conversion, write planner, TCA9539 stream |
 | `driver/s1d13700_drm.c` | DRM driver (6.x kernels) |
 | `sim/` | Model of the TCA9539 and S1D13700: decodes the I²C bytes and flags bus faults |
-| `radio/` | The application, in Python: UI, MPD client and the `sim`, `i2c` and `drm` frontends |
+| `radio/` | The application, in Python: UI, MPD client, I²C key polling and the `sim`, `i2c`, `drm` and `keytest` frontends |
 | `radio/libpanel.c` | The panel core and simulator as a library for the application |
 | `radio-ui` | Starts the application |
 | `dts/radio-panel.dts` | Overlay for the keys, backlight and panel |
@@ -32,6 +32,17 @@ GTK 3 for `sim` and `--window-keys`; libdrm for `drm`. On Debian:
 
 `RADIO_PANEL_LIB` points it at the library if it is not in `build/`.
 
+Volume is set through MPD (`volume ±1`), so MPD needs a working mixer. The
+default hardware mixer looks for a `PCM` control, which the H3 codec does not
+have; the firmware's old `volup`/`voldown` scripts used `DAC`, so the ALSA
+output in `/etc/mpd.conf` needs:
+
+    mixer_type      "hardware"
+    mixer_device    "default"
+    mixer_control   "DAC"
+
+Without it MPD's status has no `volume:` line and the volume keys do nothing.
+
 ## Running
 
 Window with the simulated panel, using a real MPD:
@@ -164,13 +175,13 @@ test board, so the keys are polled; the final board wires it to a host GPIO.
 | P0.3 | Next | P1.1 | OK |
 | P0.4 | Left | P1.2 | Menu |
 | P0.5 | Down | P1.3 | List |
-| P0.6 | Up | P1.4 | Play |
+| P0.6 | Up | P1.4 | Stop |
 | P0.7 | Right | P1.5 | Pause |
-| | | P1.6 | Stop |
+| | | P1.6 | Play |
 | | | P1.7 | Prev |
 
 ## To confirm on hardware
 
 - TC/R (`--tcr`) for frame rate; 162 comes from the AVR project's 2 bpp setup
-- Every key on the key screen (`tests/hw_test.sh`); then the overlay (`evtest`)
+- Key autorepeat on Up/Down; then the overlay (`evtest`)
 - The application on the target's Python 3.7.3

+ 2 - 2
dts/radio-panel.dts

@@ -71,9 +71,9 @@
 				ok	{ label = "ok";    gpios = <&radio_u2 9 0>;  linux,code = <352>; debounce-interval = <20>; };
 				menu	{ label = "menu";  gpios = <&radio_u2 10 0>; linux,code = <139>; debounce-interval = <20>; };
 				list	{ label = "list";  gpios = <&radio_u2 11 0>; linux,code = <395>; debounce-interval = <20>; };
-				play	{ label = "play";  gpios = <&radio_u2 12 0>; linux,code = <200>; debounce-interval = <20>; };
+				stop	{ label = "stop";  gpios = <&radio_u2 12 0>; linux,code = <166>; debounce-interval = <20>; };
 				pause	{ label = "pause"; gpios = <&radio_u2 13 0>; linux,code = <201>; debounce-interval = <20>; };
-				stop	{ label = "stop";  gpios = <&radio_u2 14 0>; linux,code = <166>; debounce-interval = <20>; };
+				play	{ label = "play";  gpios = <&radio_u2 14 0>; linux,code = <200>; debounce-interval = <20>; };
 				prev	{ label = "prev";  gpios = <&radio_u2 15 0>; linux,code = <165>; debounce-interval = <20>; };
 			};
 		};