Skip to content

rt722: change output volume of speaker to 0dB#506

Closed
shumingfan wants to merge 1 commit intoalsa-project:masterfrom
shumingfan:rt722-spk-vol-0db
Closed

rt722: change output volume of speaker to 0dB#506
shumingfan wants to merge 1 commit intoalsa-project:masterfrom
shumingfan:rt722-spk-vol-0db

Conversation

@shumingfan
Copy link
Copy Markdown
Contributor

This patch also changes hardware gain to software gain when using volume bar.

@perexg
Copy link
Copy Markdown
Member

perexg commented Mar 11, 2025

This patch also changes hardware gain to software gain when using volume bar.

Why this change is required ? Hardware volume is always preferred.

@shumingfan
Copy link
Copy Markdown
Contributor Author

Why this change is required ? Hardware volume is always preferred.

@perexg The "rt722 FU06 playback volume" control does not correspond to the 100% scale level.
To avoid problems in customer testing, it is recommended to use SW gain to control volume, and the hardware supports 0dB level.

@perexg
Copy link
Copy Markdown
Member

perexg commented Mar 11, 2025

Thanks for explanation. Could you add this information to the comment in commit ?

@perexg
Copy link
Copy Markdown
Member

perexg commented Mar 11, 2025

Also, do you report correct dB range through TLV for this control? I think that the audio server may apply the software volume change on demand only.

From sources:

static const DECLARE_TLV_DB_SCALE(out_vol_tlv, -6525, 75, 0);

The range seems enough.

@shumingfan
Copy link
Copy Markdown
Contributor Author

Also, do you report correct dB range through TLV for this control? I think that the audio server may apply the software volume change on demand only.

Yes, the value of that control is from 0 to 87 only.

@perexg
Copy link
Copy Markdown
Member

perexg commented Mar 11, 2025

The mentioned range is from -65.25dB to 0dB as defined in TLV. It should be enough to have decent volume range, so I wonder what you mean with 100% scale. The lowest value (0) is not so quiet? Then does -65.25dB match the codec output level? If not, the driver should be corrected at first.

@shumingfan
Copy link
Copy Markdown
Contributor Author

The mentioned range is from -65.25dB to 0dB as defined in TLV. It should be enough to have decent volume range, so I wonder what you mean with 100% scale. The lowest value (0) is not so quiet? Then does -65.25dB match the codec output level? If not, the driver should be corrected at first.

There is no problem with the codec output level.
The customer might make a question about some volume percentage getting the same value of "rt722 FU06 playback volume" control.

This patch also changes hardware gain to software gain when using volume bar.
The "rt722 FU06 playback volume" control does not correspond to the 100% scale level.
To avoid problems in customer testing, it is recommended to use SW gain to control volume,
and the hardware supports 0dB level.

Signed-off-by: Shuming Fan <shumingf@realtek.com>
@perexg
Copy link
Copy Markdown
Member

perexg commented Mar 12, 2025

The customer might make a question about some volume percentage getting the same value of "rt722 FU06 playback volume" control.

I'm afraid, it seems that you like to resolve issue which is in another component. I suggest to check volume bars in alsamixer. If they are correct, because they are computed by the TLV dB range not using a linear scale, then the problem exists in the mixer frontend which is used to handle the volume settings, not at the "bottom" control elements. The mentioned dB range -65.25dB to 0dB is common to HDA codecs and we don't do such workarounds there.

Note that sound server should apply soft volume automatically (see pipewire logs):

# no softvol

spa.alsa ../spa/plugins/alsa/acp/acp.c:1235:set_volume: Requested volume: 51101
spa.alsa ../spa/plugins/alsa/acp/acp.c:1236:set_volume: Got hardware volume: 51303
spa.alsa ../spa/plugins/alsa/acp/acp.c:1237:set_volume: Calculated software volume: 65278 (accurate-enough=yes)

# hw volume + softvol used together

spa.alsa ../spa/plugins/alsa/acp/acp.c:1235:set_volume: Requested volume: 27654
spa.alsa ../spa/plugins/alsa/acp/acp.c:1236:set_volume: Got hardware volume: 28032
spa.alsa ../spa/plugins/alsa/acp/acp.c:1237:set_volume: Calculated software volume: 64652 (accurate-enough=no)

So I think that the problem is really somewhere else.

Pipewire debug:

systemctl --user stop wireplumber
WIREPLUMBER_DEBUG="spa.*:5" wireplumber 2>&1 | grep set_volume

@shumingfan
Copy link
Copy Markdown
Contributor Author

Pipewire debug:

systemctl --user stop wireplumber
WIREPLUMBER_DEBUG="spa.*:5" wireplumber 2>&1 | grep set_volume

@perexg Thanks for explanation. I understood.
Will share this information with the customer.
Therefore, I would like to close the PR. If needed, I will re-open the PR.

@shumingfan shumingfan closed this Mar 13, 2025
@shumingfan shumingfan deleted the rt722-spk-vol-0db branch March 17, 2025 01:55
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

Successfully merging this pull request may close these issues.

2 participants