hw/audio: Fix logic error in hda audio
PATCH 1/1 hw/audio: Fix logic error in hda audio
Commit b7639b7dd0 introduced a logic error about mixer and nomixer. Cause use micro_mixemu when there is no mixer in HDAAudioState, but use micro_nomixemu wehen there has a mixer in HDAAuditState.
Signed-off-by zhouyang23 <[email protected]>
--- hw/audio/hda-codec.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
hw/audio/hda-codec.c +3 -3
@@ -857,7 +857,7 @@ static void hda_audio_init_output(HDACodecDevice *hda, Error **errp)HDAAudioState *a =HDA_AUDIO (hda);const struct desc_codec *desc = &output_nomixemu; -if (!a->mixer) { +if (a->mixer) { desc = &output_mixemu; }
@@ -869,7 +869,7 @@ static void hda_audio_init_duplex(HDACodecDevice *hda, Error **errp)HDAAudioState *a =HDA_AUDIO (hda);const struct desc_codec *desc = &duplex_nomixemu; -if (!a->mixer) { +if (a->mixer) { desc = &duplex_mixemu; }
@@ -881,7 +881,7 @@ static void hda_audio_init_micro(HDACodecDevice *hda, Error **errp)HDAAudioState *a =HDA_AUDIO (hda);const struct desc_codec *desc = µ_nomixemu; -if (!a->mixer) { +if (a->mixer) { desc = µ_mixemu; }
Signature · 1 line
2.34.1
Quoted 3 lines · On 16/11/23 08:50, zhouyang23 via wrote:
Commit
b7639b7dd0introduced a logic error about mixer and nomixer. Cause usemicro_mixemuwhen there is no mixer in HDAAudioState, but usemicro_nomixemuwehen there has a mixer in HDAAuditState.
Cc'ing Marc-André and Volker for
https://lore.kernel.org/qemu-devel/[email protected]/
Quoted 36 lines
Signed-off-by zhouyang23 <[email protected]>--- hw/audio/hda-codec.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)hw/audio/hda-codec.c +3
-3@@ -857,7 +857,7 @@ static void hda_audio_init_output(HDACodecDevice *hda, Error **errp)HDAAudioState *a =HDA_AUDIO (hda);const struct desc_codec *desc = &output_nomixemu; -if (!a->mixer) { +if (a->mixer) { desc = &output_mixemu; }@@ -869,7 +869,7 @@ static void hda_audio_init_duplex(HDACodecDevice *hda, Error **errp)HDAAudioState *a =HDA_AUDIO (hda);const struct desc_codec *desc = &duplex_nomixemu; -if (!a->mixer) { +if (a->mixer) { desc = &duplex_mixemu; }@@ -881,7 +881,7 @@ static void hda_audio_init_micro(HDACodecDevice *hda, Error **errp)HDAAudioState *a =HDA_AUDIO (hda);const struct desc_codec *desc = µ_nomixemu; -if (!a->mixer) { +if (a->mixer) { desc = µ_mixemu; }
Quoted 6 lines · On Thu, Nov 16, 2023 at 1:48 PM zhouyang23 via <[email protected]> wrote:
Commit
b7639b7dd0introduced a logic error about mixer and nomixer. Cause usemicro_mixemuwhen there is no mixer in HDAAudioState, but usemicro_nomixemuwehen there has a mixer in HDAAuditState.Signed-off-by zhouyang23 <[email protected]>
Reviewed-by Marc-André Lureau <[email protected]>
Quoted 39 lines
--- hw/audio/hda-codec.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)hw/audio/hda-codec.c +3
-4@@ -857,7 +857,7 @@ static void hda_audio_init_output(HDACodecDevice *hda, Error **errp)HDAAudioState *a =HDA_AUDIO (hda);const struct desc_codec *desc = &output_nomixemu; -if (!a->mixer) { +if (a->mixer) { desc = &output_mixemu; }@@ -869,7 +869,7 @@ static void hda_audio_init_duplex(HDACodecDevice *hda, Error **errp)HDAAudioState *a =HDA_AUDIO (hda);const struct desc_codec *desc = &duplex_nomixemu; -if (!a->mixer) { +if (a->mixer) { desc = &duplex_mixemu; }@@ -881,7 +881,7 @@ static void hda_audio_init_micro(HDACodecDevice *hda, Error **errp)HDAAudioState *a =HDA_AUDIO (hda);const struct desc_codec *desc = µ_nomixemu; -if (!a->mixer) { +if (a->mixer) { desc = µ_mixemu; } --2.34.1
Signature · 1 line
Marc-André Lureau