HDMI Audio on A311D (RCM4-BPi)

I was experimenting with HDMI audio on my A311D Pocket Reform today for movie watching purposes, and this works to output audio over HDMI as well:

amixer -c 0 sset 'FRDDR_A SINK 1 SEL' 'OUT 0'
amixer -c 0 sset 'FRDDR_A SRC 2 EN' on
amixer -c 0 sset 'TDMOUT_A SRC SEL' 'IN 0'
amixer -c 0 sset 'TOHDMITX I2S SRC' 'I2S A'
amixer -c 0 sset 'TOHDMITX' on

We really need some UCM profiles! To switch between speaker, headphones, HDMI.

Also, EDID currently doesn’t work for me so I have this line in my sway config for a 1080p mode:

output HDMI-A-1 modeline 148.50 1920 2448 2492 2640 1080 1084 1089 1125 +hsync +vsync

A311D can only handle a single display at a time because of driver limitations so I use wdisplays to turn off DSI, turn on HDMI, select the 1080p mode and then press Apply.

All of this could be wrapped up in a nice little tool.

1 Like

reform-display-config?

/me runs :wink:

I just swapped my pocket reform to the A311D processor and now have glorious 4K60Hz output from HDMI! Also the system as a whole is much snappier.

I am also using wdisplays to turn off DSI, manually enter resolution and refresh rate, and this gets the external monitor working reliably.

But I can’t seem to get back to the “only DSI is on” state using widsplays. The HDMI output turns off, but the built-in display stays off, and I can’t even get to a tty by issuing ALT+F1. I’ve also tried the following “switch monitor” bindings:

# Switch monitors
bindsym $mod+m output eDP-1 disable ; output HDMI-A-1 enable
bindsym $mod+Shift+m output HDMI-A-1 disable ; output eDP-1 enable

The same problem happens when I turn off the HDMI and try to get eDP-1 re-enabled. I have to reboot to get the internal display to come back on, can’t find a tty.

I would be happy to test scripts to try and get display switching working reliably, or take any suggestions for troubleshooting.

1 Like

I’ve not tried using wdisplays yet. What I have in my $PATH since May this year are the following two scripts:

#!/bin/sh
# ~/.local/bin/enable-hdmi
swaymsg output eDP-1 disable; swaymsg output HDMI-A-1 enable
swaymsg output HDMI-A-1 modeline 148.50 1920 2448 2492 2640 1080 1084 1089 1125 +hsync +vsync
#!/bin/sh
# ~/.local/bin/disable-hdmi
swaymsg output eDP-1 enable
swaymsg output HDMI-A-1 disable
swaymsg output eDP-1 enable
swaymsg output HDMI-A-1 disable

Notably, to switch back from HDMI to eDP output, I need to do the enable/disable procedure twice.

There’s no eDP-1 on Pocket, so this should be replaced with DSI-1.

Aha, of course! Substituting DSI-1 really helps! Thank you :slight_smile:

I can’t fully test because I am temporarily booting Debian Bookworm with the backported kernel by @josch while I wait for linux image packages to become available again.

But at least on Bookworm-backport, when an external monitor is not plugged in, the internal display turns off and on reliably. When an external monitor is plugged in, sway attempts output to HDMI and then crashes, but I can recover a tty on the internal display. This is substantial progress!

But for display switching, the Bookworm-backport image works great on pocket with A311D, so far as I can tell. Wifi, sound, and pure-gtk emacs seem to run fine. Unfortunately getting smooth transitions between “my desk with a big monitor and speakers” and “the couch” is core to my pocket reform use case so I can’t just switch to bookworm.

So, I am very interested in helping to get a nice “display and audio switching script” put together and will help however I can.

I think the next step for me is to generate modelines correctly, given that EDID doesn’t work for me either; I tried:

cvt 3840 2160 60

to print a 4K 60Hz modeline. Am I missing any arguments or should the output of that command be a good? I have a dell monitor that does 3840 x 2160 at 60 Hz.

Is there a way to log whatever wdisplays sends to sway?