User Tools

Site Tools


doc:appunti:hardware:mini_pc_ryzen_7_5825u

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
doc:appunti:hardware:mini_pc_ryzen_7_5825u [2025/10/17 15:59] – [Problem with audio over HDMI using Pulseaudio and ALSA] niccolodoc:appunti:hardware:mini_pc_ryzen_7_5825u [2025/10/17 16:36] (current) – [The problem of mute HDMI audio] niccolo
Line 59: Line 59:
 </file> </file>
  
 +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**:
 +
 +<code bash>
 +mkdir -p ~/.config/alsa/
 +/usr/sbin/alsactl --file ~/.config/alsa/asound.state store
 +</code>
 +
 +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):
 +
 +<code bash>
 +mkdir -p ~/.config/systemd/user/
 +vi ~/.config/systemd/user/alsa-restore.service
 +</code>
 +
 +The file is like this:
 +
 +<file>
 +[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
 +</file>
 +
 +Finally enable this user's systemd service:
 +
 +<code bash>
 +systemctl --user enable alsa-restore.service
 +</code>
 +
 +**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:
 +
 +<code>
 +/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
 +</code>
 +
 +To view the **card ID** associated to the **card number**, inspect the ''/proc/asound/cards'' pseudo file:
 +
 +<code>
 +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
 +</code>
  
doc/appunti/hardware/mini_pc_ryzen_7_5825u.1760709546.txt.gz · Last modified: by niccolo