On vacation I connected my 13" Framework Laptop (2025 AMD Ryzen AI 300 Series) to the Panasonic TV (TX-40CSW523S) in our holiday flat. When playing a movie, I thought it'd be cool if I could pause the film and skip advertisements with the TV's remote control.
The framework's HDMI adapter is CEC capable, and thus my laptop should be able to receive the remote control button presses.
The Arch Linux HDMI-CEC wiki documentation page had much information about the Linux side: The Linux kernel has CEC support and even emulates multimedia key presses when remote control button events are received via CEC.
But nothing happened, and I used cec-ctl -d0 --monitor-all to log CEC data seen by the laptop:
Initial Event: State Change: PA: 1.0.0.0, LA mask: 0x0000 Received from TV to all (0 to 15): ACTIVE_SOURCE (0x82): phys-addr: 0.0.0.0
Apart from the "source change" events, no key presses were received. While scanning cec-ctl --help I had seen that I can set my laptop to be one of the CEC device classes: TV, recording+playback, tuner, playback device, audio system, processor and unregistered.
DVD + Bluray players can be controlled with the TV remote, so I configured the laptop to identify itself as a playback device:
$ cec-ctl --playback Driver Info: Driver Name : amdgpu Adapter Name : DP-4 Capabilities : 0x0000037e Logical Addresses Transmit Passthrough Remote Control Support Monitor All Needs HPD Connector Info Reply Vendor ID Driver version : 6.16.0 Available Logical Addresses: 4 DRM Connector Info : card 0, connector 127 Physical Address : 1.0.0.0 Logical Address Mask : 0x0010 CEC Version : 2.0 Vendor ID : 0x000c03 (HDMI) OSD Name : 'Playback' Logical Addresses : 1 (Allow RC Passthrough) Logical Address : 4 (Playback Device 1) Primary Device Type : Playback Logical Address Type : Playback All Device Types : Playback RC TV Profile : None Device Features : None
After switching the TV's source to TV and then back to HDMI 1, I started seeing CEC remote button events:
Initial Event: State Change: PA: 1.0.0.0, LA mask: 0x0010 Received from TV to all (0 to 15): ROUTING_CHANGE (0x80): orig-phys-addr: 0.0.0.0 new-phys-addr: 1.0.0.0 Received from TV to all (0 to 15): SET_STREAM_PATH (0x86): phys-addr: 1.0.0.0 Received from TV to Playback Device 1 (0 to 4): USER_CONTROL_PRESSED (0x44): ui-cmd: pause (0x46) Received from TV to Playback Device 1 (0 to 4): USER_CONTROL_RELEASED (0x45) Received from TV to Playback Device 1 (0 to 4): USER_CONTROL_PRESSED (0x44): ui-cmd: pause (0x46) Received from TV to Playback Device 1 (0 to 4): USER_CONTROL_RELEASED (0x45) Received from TV to Playback Device 1 (0 to 4): USER_CONTROL_PRESSED (0x44): ui-cmd: pause (0x46) Received from TV to Playback Device 1 (0 to 4): USER_CONTROL_RELEASED (0x45)
mpv-mpris
mpv itself does not react to global multimedia keys - for this I had to install the mpv-mpris Debian package. After doing that, mpv reacted on play, pause, seek forward and backward buttons on the TV remote.
Mission accomplished.