====== Mini PC AMD Ryzen 7 5825U Acemagician AM06PRO ====== I purchased this Mini PC to do video editing using the **Olive Video Editor** program. My previous Mini PC based on the Intel N95 **was not able to playback 2.7K/60 fps videos**, it only does 1080/30 fps. The **AMD Ryzen 7 5825U** CPU is instead capable of previewing the clips applying cropping on the fly on Olive, which is what I actually need. {{.:mini_pc_ryzen7:acemagician-ryzen-7-5825u.jpg?nolink&360|Mini PC Acemagician AM06Pro}} ===== Linux kernel support of WiFi adapter ===== GNU/Linux **kernel 6.1.0** shipped with **Debian 12 Bookworm** does not support the **RTL8852BE** WiFi adapter. You can download kernel 6.12.22 from bookworm backports and install it manually using **%%dpkg -i%%**. Download also the backported firmwares: * **[[https://packages.debian.org/bookworm-backports/linux-image-6.12.22+bpo-amd64|linux-image-6.12.22+bpo-amd64_6.12.22-1~bpo12+1_amd64.deb]]** * **[[https://packages.debian.org/bookworm-backports/firmware-amd-graphics|firmware-amd-graphics_20241210-1~bpo12+1_all.deb]]** * **[[https://packages.debian.org/bookworm-backports/firmware-realtek|firmware-realtek_20241210-1~bpo12+1_all.deb]]** ===== Problem with audio over HDMI using Pulseaudio and ALSA ===== I had a problem getting audio to work on the **HDMI port**: at bootstrap the PC was totally mute; **no audio** was routed to the HDMI display. First of all I manually checked all the following to ensure that audio can work: * From **alsamixer**: unmute the **S/PDIF output** of the first **HD-Audio Generic** sound card. * From the **PulseAdio Plugin** on the XFCE panel: check that the master volume control si associated to the **Renoir Radeon High Definition Audio Controller HDMI / DisplayPort 1 Output**, enable the output and set a sensible volume level. * Open the XFCE mixer app **pavucontrol**: * Into the **Output Devices** tab: check that the **HDMI / DisplayPort 1 Output** is marked as //plugged in//, verify it is //unmuted// and click the //Set as fallback// button. * Start an audio player (e.g. the **audacious** program to play some mp3 files); into the **Playback** tab of **pavucontrol** check that the app is using the **Renoir Radeon High Definition Audio Controller HDMI / DisplayPort 1 Output** port to route the sound. ==== The problem of mute HDMI audio ==== There are actually two problems with this PC and the HDMI audio: - On each reboot the order of the sound cards may vary. The mini PC has two sound cards that can play audio: a **C-Media Electronics Inc. USB Audio Device** is connected to the 3.5 mm jack, and an **HDA-Intel** is responsible to send audio to the HDMI port. On each boot the kernel may discover the hardware with different timing, so the **card #0** is not guaranteed to be always the same. - A **pulseaudio.service** is started in user-space. If you run a graphical environment, you will find the process running e.g. under the ''lightdm'' user name, otherwise the process will run under the logged in user name (the user must be in the //audio// group to have this). It seems that this service resets the HDMI audio port to the muted state on each start. There is the system-wide service named **alsa-restore.service**, this service is intended to save the current ALSA mixer settings on shutdown and restore them on bootstrap. The service actually works and you can find the saved state in the **/var/lib/alsa/asound.state** file. So the ALSA mixer is correctly set during bootstrap, but as soon as the pulseaudio.service starts, the HDMI audio port is muted again. To solve the first problem, set - as the intended user - **the default PulseAudio sink** (where audio goes): pactl set-default-sink 'alsa_output.pci-0000_04_00.1.HiFi__hw_Generic_1_3__sink' You can discover the available audio sink using the command (search for the lines starting with ''name:''): pacmd list-sinks You can confirm that the default sink is correctly set with: pactl get-default-sink The settings are saved into the user directory **$HOME/.config/pulse/**. If you want to give this same default for all the new users, create a file **/etc/pulse/client.conf.d/99-local.conf** with: # Renoir Radeon High Definition Audio Controller HDMI / DisplayPort 1 Output default-sink = alsa_output.pci-0000_04_00.1.HiFi__hw_Generic_1_3__sink Solving the second problem (pulseaudio.service which sets the mute state to the HDMI port) is a bit more complicated. I resorted on creating **an user systemd service** to be run just after the pulseaudio.service. First of all unmute the HDMI S/PDIF port using **alsamixer**; then save the ALSA mixer settings in an user file using **alsactl**: mkdir -p ~/.config/alsa/ /usr/sbin/alsactl --file ~/.config/alsa/asound.state store Create a systemd service named **alsa-restore.service** (the name is the same as the system-wide service, but this is executed on user logon): mkdir -p ~/.config/systemd/user/ vi ~/.config/systemd/user/alsa-restore.service The file is like this: [Unit] Description=Restore ALSA mixer levels After=pulseaudio.service [Service] Type=oneshot RemainAfterExit=true ExecStart=/usr/sbin/alsactl --file %h/.config/alsa/asound.state restore Generic_1 [Install] WantedBy=default.target Finally enable this user's systemd service: systemctl --user enable alsa-restore.service **NOTICE**: The ''alsactl restore'' command is executed passing the ID of the sound card //Generic_1// (passing the card number is not feasible because that number can vary across reboots). Passing the card ID is required because restoring the ALSA mixer status for all the available cards leads to this error message: /usr/sbin/alsactl --file ~/.config/alsa/asound.state restore alsa-lib parser.c:2080:(parse_verb_file) error: no use case device defined alsa-lib main.c:1541:(snd_use_case_mgr_open) error: failed to import hw:1 use case configuration -22 To view the **card ID** associated to the **card number**, inspect the ''/proc/asound/cards'' pseudo file: cat /proc/asound/cards 0 [Generic_1 ]: HDA-Intel - HD-Audio Generic HD-Audio Generic at 0xfc9c8000 irq 69 1 [Generic ]: HDA-Intel - HD-Audio Generic HD-Audio Generic at 0xfc9c0000 irq 70 2 [Device ]: USB-Audio - USB Audio Device C-Media Electronics Inc. USB Audio Device at usb-0000:04:00.4-3, full speed 3 [acp ]: acp - acp HCTechnology.Ltd.-HCAR5000_MI-Defaultstring