New notebook – The last bits

Sorted out the last bits that didn’t work smoothly yet.

WiFi

WiFi connection was intermittent and slow. lspci had this to say about it:

01:00.0 Network controller: MEDIATEK Corp. MT7922 802.11ax PCI Express Wireless Network Adapter

There are numerous reports about this controller not working, almost all firmware related. The Liquorix kernel I’m running has the latest firmware so that was not the issue. Then I stumbled on a report related to power saving. Disabled that through NetworkManager by adding an extra configuration file in /etc/NetworkManager/conf.d with the following lines in it:

[connection]
wifi.powersave = 2

WiFi is now stable and fast.

Keyboard

Backlight

This can be controlled through sysfs or D-Bus but the system thinks there are only three settings: off (0), dimmed (1) or bright (2). But my keyboard thinks there are four settings, the fourth being what I would call “responsive bright”. This setting disables the backlight after a minute of inactivity and responds to key strokes by enabling backlight again to the bright setting. You can toggle this setting on the keyboard itself with Fn+Space but unfortunately the system does not know about this. I’ve worked around this by using a tiny daemon that listens for key strokes and enables the backlight and disabling it again when there’s no activity for a minute. There are several solutions for this, I settled for kbd_backlight_ctrl because it works and it’s just a few lines of C. Can’t set the brightness though but since it’s just a few lines of code I see this as an opportunity to improve my non-existent C skills.

Media keys

The keyboard has four dedicated media keys, play/pause, stop, previous and next. These work perfectly with a media player like VLC but Ardour does not recognize them. By creating supplementary udev hardware database entries I remapped the media keys so they’re now also functioning in Ardour which is quite neat. Only the stop key has no purpose yet as Ardour has no shortcut for what I want to map it to, stopping and going back to the start marker. Maybe I could create something myself through Ardour’s Lua scripting engine.

The hardware database entries look like this:

evdev:input:b0011v0001p0001*
 KEYBOARD_KEY_a2=space
 KEYBOARD_KEY_90=left
 KEYBOARD_KEY_99=right

These went into /etc/udev/hwdb.d/99-media-keys.hwdb. After running systemd-hwdb update && udevadm trigger as root Ardour now sees the play/pause button as space, previous as left and next as right. I used Remapping Keyboard Keys in Ubuntu with udev / evdev as a reference.

Audio devices

There are three audio devices on this machine:

$ lspci | grep -i audio
64:00.1 Audio device: Advanced Micro Devices, Inc. [AMD/ATI] Rembrandt Radeon High Definition Audio Controller
64:00.5 Multimedia controller: Advanced Micro Devices, Inc. [AMD] ACP/ACP3X/ACP6x Audio Coprocessor (rev 63)
64:00.6 Audio device: Advanced Micro Devices, Inc. [AMD] Family 17h/19h HD Audio Controller
$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: Babyface2359686 [Babyface (23596862)], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 10: Generic [HD-Audio Generic], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 10: Generic [HD-Audio Generic], device 7: HDMI 1 [HDMI 1]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 10: Generic [HD-Audio Generic], device 8: HDMI 2 [HDMI 2]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 11: Generic_1 [HD-Audio Generic], device 0: ALC257 Analog [ALC257 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
$ arecord -l
**** List of CAPTURE Hardware Devices ****
card 0: Babyface2359686 [Babyface (23596862)], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: acp63 [acp63], device 0: DMIC capture dmic-hifi-0 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 11: Generic_1 [HD-Audio Generic], device 0: ALC257 Analog [ALC257 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

So onboard audio, HDMI and a capture device acp63. As you can see I’ve managed to get onboard and HDMI out of the way by indexing them but unfortunately the kernel module for the capture device, snd-soc-ps-mach, does not seem to support indexing. I’d like to index it as card 12 because now that acp63 device claims 0 when my Babyface is not attached. Something for later investigation.

I’ll dedicate a separate post to doing real-time audio on this machine. I need to do some more stress testing but Ardour runs without complaining at 48kHz, 64 frames/period and 3 periods/buffer, so 4ms system latency. No weird things there.

New notebook – The last bits

Leave a Reply

Your email address will not be published. Required fields are marked *