Skip to content
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

Tiny sound on ASUS Zenbook UM5606 out of the box #467

Open
IShashkin opened this issue Nov 20, 2024 · 26 comments
Open

Tiny sound on ASUS Zenbook UM5606 out of the box #467

IShashkin opened this issue Nov 20, 2024 · 26 comments

Comments

@IShashkin
Copy link

ASUS Zenbook UM5606 doesn't use subwoofers out of the box. So sound is tiny on the laptop. There is a workaround described here https://wiki.archlinux.org/title/ASUS_Zenbook_UM5606#Audio but it's broken in the last alsa release.

alsa-info.sh --no-upload
alsa-info.txt.zip

Let me know if you need more info.

@perexg
Copy link
Member

perexg commented Nov 20, 2024

While you play something (assuming working 4.0 config workaround), how the mixer controls Speaker and Headphone react (use alsamixer -c 1) ? Do they control normal/additional speakers separately ?

EDIT: Please, also grab and upload alsa-info output when the playback is active.

@IShashkin
Copy link
Author

While you play something (assuming working 4.0 config workaround), how the mixer controls Speaker and Headphone react (use alsamixer -c 1) ? Do they control normal/additional speakers separately ?

I'm not sure what I need to check. I started a youtube video and it's how alsamixer looks like
When using speakers
Screenshot From 2024-11-21 08-35-09
When using headphones
Screenshot From 2024-11-21 08-35-25

EDIT: Please, also grab and upload alsa-info output when the playback is active.

alsa-info-youtube.txt.zip

@simontrimmer
Copy link

Hi @IShashkin,
Can you upload your dmesg too please, I'd like to check that the kernel started the amplifiers properly
-Simon

@IShashkin
Copy link
Author

Hello @simontrimmer

journalctl --dmesg >> gmesg.txt

gmesg.txt

@simontrimmer
Copy link

Hi @IShashkin ,
Thanks that looks good - the amplifiers are fully configured with firmware, tuning and calibration
-Simon

@perexg
Copy link
Member

perexg commented Nov 21, 2024

@simontrimmer : Could you explain, how the volume should be controlled in this case for tweeters/bass speakers at the ALSA control API level?

The 4ch workaround seems really wrong. The multichannel setup uses HDA DAC node 0x03 (with volume control) and 0x06 (without volume control).

There are 4 mono AMP? Speaker controls for the digital amplifiers. We should probably use them , too. Also only one HDA DAC output for nodes 0x15 (woofer output) and 0x18 (tweeter output) should be used to route signal to both speakers simultaneously.

@IShashkin : Could you stop pipewire (systemctl --user stop wireplumber) and play a stereo file using aplay using aplay -D hw:1 <wav_file> command. Show alsa-info output and try to play with mixer settings (Bass Speaker, Speaker, AMP?) . Describe the behaviour.

@IShashkin
Copy link
Author

@perexg
Bass Speaker can't be changed. I wasn't able to activate the bass speakers.
AMP1 Speaker controls the right tweeter, AMP2 Speaker and AMP3 Speaker do nothing, AMP4 Speaker controls the left tweeter.
Speaker controls both tweeters.

alsa-info-wav.txt.zip

@perexg
Copy link
Member

perexg commented Nov 22, 2024

@IShashkin : Bass Speaker can be only muted/unmuted. Press m in alsamixer when this bar is selected.

@IShashkin
Copy link
Author

@perexg No luck. I don't hear the bass speakers
Screenshot From 2024-11-23 08-52-11

@Chevek
Copy link

Chevek commented Nov 23, 2024

I have the same issue here with Fedora 41.

@smithfred
Copy link

smithfred commented Nov 23, 2024

For reference, the latest version from the original comment is 1.2.13, and the previous version for which there is a functioning workaround is 1.2.12.

On 1.2.12, "AMP2 Speaker" adjusts the level of the right woofer, and "AMP3 speaker" controls the left woofer.

Edit: and muting "Bass Speaker" completely mutes audio.

@perexg
Copy link
Member

perexg commented Nov 23, 2024

Analysis from the alsa-info output:

  • Speaker NID 0x17 -> routed to DAC NID 0x03
  • Bass Speaker NID 0x15 -> routed to DAC NID 0x06 (without volume control - usually used for S/PDIF output)

So the driver does not do a right job.

@IShashkin: Could you run command sudo hda-verb /dev/snd/hwC1D0 0x15 SET_CONNECT_SEL 1 and retest aplay? The connection list in /proc/asound/card1/codec#0 file for Node 0x17 should be changed from 0x02 0x03 0x06* to 0x02 0x03* 0x06.

Referred info from procfs (part of alsa-info.sh output):

Node 0x03 [Audio Output] wcaps 0x41d: Stereo Amp-Out
  Control: name="Speaker Playback Volume", index=0, device=0
    ControlAmp: chs=3, dir=Out, idx=0, ofs=0
  Converter: stream=5, channel=0
Node 0x06 [Audio Output] wcaps 0x411: Stereo
  Converter: stream=0, channel=0
Node 0x15 [Pin Complex] wcaps 0x40058d: Stereo Amp-Out
  Control: name="Bass Speaker Playback Switch", index=0, device=0
    ControlAmp: chs=3, dir=Out, idx=0, ofs=0
  Connection: 3
     0x02 0x03 0x06*
Node 0x17 [Pin Complex] wcaps 0x40058d: Stereo Amp-Out
  Control: name="Speaker Playback Switch", index=0, device=0
    ControlAmp: chs=3, dir=Out, idx=0, ofs=0
 Connection: 3
     0x02 0x03* 0x06

@Chevek
Copy link

Chevek commented Nov 24, 2024

@IShashkin: Could you run command sudo hda-verb /dev/snd/hwC1D0 0x15 SET_CONNECT_SEL 1 and retest aplay? The connection list in /proc/asound/card1/codec#0 file for Node 0x17 should be changed from 0x02 0x03 0x06* to 0x02 0x03* 0x06.

I tested it, and the sound seems ok: the bass speakers are playing the music. Beside I could mute the bass speakers in alsamixer. Thank you! Is there a config file we could use to have this with pipewire?

@perexg
Copy link
Member

perexg commented Nov 24, 2024

The driver should set this by default. You may try kernel patch like
ALC294_FIXUP_BASS_SPEAKER_15.txt . If you confirm that it works, I'll send it to linux-sound kernel mailing list.

@Chevek
Copy link

Chevek commented Nov 26, 2024

The driver should set this by default. You may try kernel patch like ALC294_FIXUP_BASS_SPEAKER_15.txt . If you confirm that it works, I'll send it to linux-sound kernel mailing list.

Simple instructions to test this on almost any distributions (Debian/Ubuntu/Fedora...) using the TKG Kernel:

git clone https://github.com/Frogging-Family/linux-tkg.git
cd linux-tkg
mkdir linux612-tkg-userpatches
cd linux612-tkg-userpatches/
wget -O ALC294_FIXUP_BASS_SPEAKER_15.mypatch https://github.com/user-attachments/files/17894729/ALC294_FIXUP_BASS_SPEAKER_15.txt
cd ..
./install.sh install

Our CPU is architecture "zen5", choose kernel 6.12.
If you have secureboot enable, you should disable it with those simple instructions.

I tested just a few minutes on Fedora 41and it is definitely an improvement. I'll do further tests comparing with Windows. I also had to push everything to the max in alsamixer to get a better balance.

Thank you!!

@perexg
Copy link
Member

perexg commented Nov 26, 2024

@Chevek : Could you share output from alsa-info.sh --no-upload for the test kernel. I would like to check routes.

Also, the goal is that Speaker volume bar handles stereo volume for all speakers and balance may be altered using AMP? Speaker controls. The testing should be without any custom pipewire or other modifications.

@Chevek
Copy link

Chevek commented Nov 26, 2024

alsa-info2.txt
I do not have much time atm. There is the alsa-info file.

@perexg
Copy link
Member

perexg commented Nov 26, 2024

alsa-info2.txt I do not have much time atm. There is the alsa-info file.

Looks fine.

@simontrimmer
Copy link

Hiya @perexg,

@simontrimmer : Could you explain, how the volume should be controlled in this case for tweeters/bass speakers at the ALSA control API level?

The 4ch workaround seems really wrong. The multichannel setup uses HDA DAC node 0x03 (with volume control) and 0x06 (without volume control).

There are 4 mono AMP? Speaker controls for the digital amplifiers. We should probably use them , too. Also only one HDA DAC output for nodes 0x15 (woofer output) and 0x18 (tweeter output) should be used to route signal to both speakers simultaneously.

I agree with you though I'm not in a great position to comment on it as I've not experimented with a system that has the tweeters on the realtek codec and the woofers connected to cs35l56s.

The files being loaded into the amplifiers contain the tuning specific to that speaker location and that includes which channel they are picking out of a multichannel audio stream as well as the config of the algorithms on the amp's DSP and each amp exposes a volume control that you've found.

I have seen systems that have the cs35l56 amplifiers snuck behind a cs42l43 (ucm2/sof-soundwire/cs35l56-bridge.conf), in these cases the stereo audio is sent over soundwire to the codec to the amplifiers which then split out a stream for the tweeters and send that back to the codec to be outputted. So the relative volumes in this case are part of the sku specific amplifier tuning and the codec is set to a fixed volume and the overall volume is controlled by the renderer/APO (?)

I'm assuming that in this SKU the audio splitting is happening in the realtek part?

@Chevek
Copy link

Chevek commented Nov 26, 2024

Also, the goal is that Speaker volume bar handles stereo volume for all speakers and balance may be altered using AMP? Speaker controls. The testing should be without any custom pipewire or other modifications.

'Speaker' control the whole volume. for all speakers.
'AMP1 Speaker' controls the treble speaker on the right,
'AMP2 Speaker' controls the bass speaker on the right,
'AMP3 Speaker' controls the bass speaker on the left,
'AMP4 Speaker' controls the treble speaker on the left,
'Bass Speaker' can mute the 2 bass speakers,
I do not know what are the 4 'AMPx Posture Number' for. They seems to have no effect.

Comparing to windows, the sound is a bit louder on Linux, but it sound better on Windows because on linux some time the volume get higher during a song when medium/treble are in front given the impression the music is not regular.

Even at the max volume, either on windows or on Linux there is no saturation.

Thank you !!

@Chevek
Copy link

Chevek commented Nov 26, 2024

@perexg As far as I know, there is 6 speakers in total, is it possible to get control on each of them?

@Chevek
Copy link

Chevek commented Nov 28, 2024

The driver should set this by default. You may try kernel patch like ALC294_FIXUP_BASS_SPEAKER_15.txt . If you confirm that it works, I'll send it to linux-sound kernel mailing list.

I confirm, it works. Have you sent it to kml?

@perexg
Copy link
Member

perexg commented Nov 28, 2024

https://lore.kernel.org/linux-sound/[email protected]/

tiwai pushed a commit to tiwai/sound that referenced this issue Nov 28, 2024
This hardware has ALC294 codec with speaker NID 0x17 and bass speaker
NID 0x15.

This patch removes DAC NID 0x06 (without volume control) from
the connection list for bass speaker NID 0x15. Both speaker PINs
are routed to DAC NID 0x03 with this change.

Link: alsa-project/alsa-ucm-conf#467
Signed-off-by: Jaroslav Kysela <[email protected]>
Link: https://patch.msgid.link/[email protected]
Signed-off-by: Takashi Iwai <[email protected]>
@ThatOneCalculator
Copy link

ThatOneCalculator commented Nov 28, 2024

lore.kernel.org/linux-sound/[email protected]

Will be including this into my kernel patchset very soon!

Edit: Tested, works, and added!

@euplotes
Copy link

Another UM5606 user here - confirmed the patch works (Fedora 41). Thank you!

@simontrimmer
Copy link

I do not know what are the 4 'AMPx Posture Number' for. They seems to have no effect.

These activate different configurations with the tunings to be able to handle device rotation (so the speakers rotate around to match the orientation).

I can't say I've seen a production tuning that contains these yet and there would have to be some user-space component that would respond to the (accelerometer?) event and switch the screen and audio rotations. Not sure if the UCM does that yet?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants