New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ucm2: Add initial support for AMD Vangogh (acp5x) on Steam Deck #233
Conversation
ucm2/AMD/acp5x/HiFi.conf
Outdated
} | ||
} | ||
|
||
SectionDevice."Internal Mic".0 { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Follow https://github.com/alsa-project/alsa-lib/blob/master/include/use-case.h#L132 . Use "Mic" or "Mic1" here. Remove .0
suffix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
ucm2/AMD/acp5x/HiFi.conf
Outdated
|
||
Value { | ||
PlaybackPriority 100 | ||
PlaybackPCM "hw:acp5x,1" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Use "hw:${CardId},1" here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
ucm2/AMD/acp5x/HiFi.conf
Outdated
] | ||
|
||
DisableSequence [ | ||
cset "name='Left AMP Enable Switch' off" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This setup is not in sync with the EnableSequence.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
ucm2/AMD/acp5x/HiFi.conf
Outdated
EnableSequence [ | ||
cset "name='Int Mic Switch' on" | ||
cset "name='DMIC Enable Switch' on" | ||
cset "name='Mic Volume' 252" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed volume control. The application cannot use hw volume control (CaptureMixerElem).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
User configurable settings moved to BootSequence.
ucm2/AMD/acp5x/HiFi.conf
Outdated
@@ -0,0 +1,122 @@ | |||
SectionVerb { | |||
EnableSequence [ | |||
cset "name='Left DSP1 Preload Switch' 0" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest to study https://www.alsa-project.org/alsa-doc/alsa-lib/group__ucm__conf.html . The values which may be configurable by users should be put to the BootSequence.
Also the hw volume control is completely missing in this definition. The problem may be the Left/Right mono controls (apps expect the stereo controls for the stereo stream). This can be remaped using the alsa-lib's remap control plugin. We need to build probably a macro - see ucm2/common/ctl/remap.conf, https://www.alsa-project.org/alsa-doc/alsa-lib/control_plugins.html .
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Many thanks for the detailed review and the hints to further improve this! Hopefully I got it in a better shape this time..
Works perfectly here. What are we still waiting for?... |
The "off" Profile does not work as expected for me. The output devices are still available if I try to disable the port. Steps to reproduce: Connect steam deck to TV. Play audio to builtin (acp5x) speaker by pulseaudio / pipewire. expected behaviour is the both acp5x output devices are not available and audio switch to HDMI output. Currently I use the |
This has been tested on a Valve Steam Deck EV2 unit, using kernel v6.1-rc1. Signed-off-by: Cristian Ciocaltea <cristian.ciocaltea@collabora.com>
Thank you! Does perfectly work for me now |
I tried copying the files in this pull request to my Steam Deck (which is currently running Debian bookworm/testing), and it did not show the HiFi option in pavucontrol. I additionally tried running
I have rebooted it multiple times, but it still doesn't show the HiFi option and only shows the HDMI options. What configuration step am I missing? |
@hexaheximal Although I haven't encountered that kind of issues so far, I would suggest to follow the installation procedure documented in README.md, just to exclude a possible configuration problem. Make sure to do a backup first, since this might break your setup if the installed ALSA binaries are too old and cannot properly handle the configuration update. |
I'm using the version of alsa-ucm-conf (and the kernel) included in debian bookworm. Also, backups are not a problem for me since I'm using a custom script that I wrote (https://github.com/deckian/deckian) to install debian on my Steam Deck which handles rootfs backups automatically so I can just reinstall it from a backup when I need to. |
I only tested on an Arch Linux based distro after updating alsa-ucm-conf as indicated above.
That's because not all the changes are on the driver itself, e.g. you need at least the following patch from 6.1 to get proper sound support:
|
I am using this on a Steam Deck with Fedora 37 on the latest 6.1.2 kernel from koji. While the patchset works generally and makes the speakers work they are very, very hushed and in any slightly louder environment almost completely inaudible at max volume (125% boost, gnome+pipewire). Booting back to SteamOS they're at the expected max loudness again. Is this expected for now? |
@waffshappen It is expected to get a slightly lower loudness, but not quite to the levels you describe. Probably some of the mixer controls are not properly adjusted. Also note SteamOS achieves max loudness by using a modified/tuned firmware for the cs35l41 audio codec. You may try to locate WARNING: Before doing any audio test with the replaced firmware, make sure to lower the volume first, otherwise you may risk damaging the speakers! On the SteamOS side, this is mitigated via the UCM configuration by restricting user access to some mixer controls. |
I tested this with both the original steam deck and fedora firmware - both were initially equally silent until i found (alsamixer, disabled pw alsa redirection) the "Left Analog PCM" (and right variant) and set both to dB gain: 0,20 This made loudness equal to the original steam deck loudness on both firmware versions. Maybe something to adjust in the ucm config, if possible? |
The adjustment is already handled in acp5x.conf:
Both controls should have been automatically set to 0.17dB if the sound card state was not previously saved, i.e. file After rebooting the system, what does alsamixer show? I would expect either 0.20 (what you manually set) or 0.17 (what UCM provides as defaults). |
It is still on 0.20 as was set via alsamixer. Could this be a sideeffect of having to install the distro first and then adding the configs and kernel 6.1 after first boot? |
On Arch Linux (and most likely on Fedora as well), the alsa-utils package provides the
The most plausible scenario is that the sound card state had been already persisted when you updated the UCM configuration, hence the |
You may remove the old state using:
And yes, |
@perexg Is there anything else you'd like me to address/improve in order to get this merged? |
This has been tested on a Valve Steam Deck EV2 unit, using kernel v6.1-rc1.