Re: [PATCH] Fix Windows 2000 and XP HDAudio Support

2023-11-12 Thread Volker Rümelin
Am 12.11.23 um 01:37 schrieb Christopher Lentocha:
> So wait, you want me to add it as another device name? Because 
> it is going to be the same exact way as the 1af4 device
> just with a number change. Ok, work it is then ...
> (Sorry about not getting back sooner also)
>
> Christopher

Hi Christopher,

why do you want the device to be exactly the same as the generic hda
codec? A new device gives you the opportunity to model it closer to the
specs in the ALC885 datasheet. This could improve compatibility with the
old guest drivers.

With best regards,
Volker

> On 11/8/23 6:12 AM, Gerd Hoffmann wrote:
>> On Wed, Nov 08, 2023 at 11:02:06AM +0100, Philippe Mathieu-Daudé wrote:
>>> Thanks Christopher for your patch,
>>>
>>> I'm Cc'ing Volker and Gerd who know better this hardware model.
>>>
>>> On 7/11/23 20:27, Christopher Lentocha wrote:
 Change the ID to be a Realtek ALC885 so that both
>> No.  Rewriting the existing codecs is clearly a non-starter.
>>
>> You can add a 'hda-realtek-alc885' variant which tries to
>> mimic the realtek coded close enough to make old guests
>> without generic hda driver happy.
>>
 +#define QEMU_HDA_ID 0x10EC0885
>> Nope.  Somemething like 'REALTEK_ALC885_ID' please.
>>
>> [ remaining bits of the patch snipped, needs major rework ]
>>
>> take care,
>>   Gerd
>>




Re: [PATCH] Fix Windows 2000 and XP HDAudio Support

2023-11-11 Thread Christopher Lentocha
So wait, you want me to add it as another device name? Because 
it is going to be the same exact way as the 1af4 device
just with a number change. Ok, work it is then ...
(Sorry about not getting back sooner also)

Christopher

On 11/8/23 6:12 AM, Gerd Hoffmann wrote:
> On Wed, Nov 08, 2023 at 11:02:06AM +0100, Philippe Mathieu-Daudé wrote:
>> Thanks Christopher for your patch,
>>
>> I'm Cc'ing Volker and Gerd who know better this hardware model.
>>
>> On 7/11/23 20:27, Christopher Lentocha wrote:
>>>
>>> Change the ID to be a Realtek ALC885 so that both
> 
> No.  Rewriting the existing codecs is clearly a non-starter.
> 
> You can add a 'hda-realtek-alc885' variant which tries to
> mimic the realtek coded close enough to make old guests
> without generic hda driver happy.
> 
>>> +#define QEMU_HDA_ID 0x10EC0885
> 
> Nope.  Somemething like 'REALTEK_ALC885_ID' please.
> 
> [ remaining bits of the patch snipped, needs major rework ]
> 
> take care,
>   Gerd
> 



Re: [PATCH] Fix Windows 2000 and XP HDAudio Support

2023-11-08 Thread Gerd Hoffmann
On Wed, Nov 08, 2023 at 11:02:06AM +0100, Philippe Mathieu-Daudé wrote:
> Thanks Christopher for your patch,
> 
> I'm Cc'ing Volker and Gerd who know better this hardware model.
> 
> On 7/11/23 20:27, Christopher Lentocha wrote:
> > 
> > Change the ID to be a Realtek ALC885 so that both

No.  Rewriting the existing codecs is clearly a non-starter.

You can add a 'hda-realtek-alc885' variant which tries to
mimic the realtek coded close enough to make old guests
without generic hda driver happy.

> > +#define QEMU_HDA_ID 0x10EC0885

Nope.  Somemething like 'REALTEK_ALC885_ID' please.

[ remaining bits of the patch snipped, needs major rework ]

take care,
  Gerd




Re: [PATCH] Fix Windows 2000 and XP HDAudio Support

2023-11-08 Thread Philippe Mathieu-Daudé

Thanks Christopher for your patch,

I'm Cc'ing Volker and Gerd who know better this hardware model.

On 7/11/23 20:27, Christopher Lentocha wrote:


Change the ID to be a Realtek ALC885 so that both
Windows 2000 and up (including XP) and macOS
(on a later patch for HDEF ACPI Fixes) support HDA
HDA is supported for ALC885 on macOS AppleHDA.kext
and 2K people can use the following file to get
sound working (MD5sum):

959c6ad895ee22d0003fe24b6ce1b150

WDM_R269.exe

for Vista+, the following can be used for EQ or if
the native one doesn't work OOTB (MD5sum):

fb0aaffcfc620b70b7f3c3b1381d08e5

Vista_Win7_Win8_R270.exe

A Note for the Vista+ Driver: You need to go to
playback settings, under the Speaker, Advanced,
change the Hz to one that is valid, so sound
actually plays, though you may need to enable
under the Enhancements tab, check Disable All
then change the Hz, and uncheck Disable All
Under Enhancements, applying after each of
the tasks, due to a bug in the stock Realtek
Driver, also note, newer drivers don't work at
all, even on real machines, this is the latest
confirmed to work at the moment!

Signed-off-by: Christopher Lentocha 
---
  hw/audio/hda-codec-common.h | 66 +
  hw/audio/hda-codec.c|  8 +++--
  2 files changed, 36 insertions(+), 38 deletions(-)

diff --git a/hw/audio/hda-codec-common.h b/hw/audio/hda-codec-common.h
index b4fdb51e8b..ef57a1b98d 100644
--- a/hw/audio/hda-codec-common.h
+++ b/hw/audio/hda-codec-common.h
@@ -24,19 +24,15 @@
   * HDA codec descriptions
   */
  
+#define QEMU_HDA_ID 0x10EC0885

+
  #ifdef HDA_MIXER
-#define QEMU_HDA_ID_OUTPUT  ((QEMU_HDA_ID_VENDOR << 16) | 0x12)
-#define QEMU_HDA_ID_DUPLEX  ((QEMU_HDA_ID_VENDOR << 16) | 0x22)
-#define QEMU_HDA_ID_MICRO   ((QEMU_HDA_ID_VENDOR << 16) | 0x32)
  #define QEMU_HDA_AMP_CAPS   \
  (AC_AMPCAP_MUTE |   \
   (QEMU_HDA_AMP_STEPS << AC_AMPCAP_OFFSET_SHIFT)|\
   (QEMU_HDA_AMP_STEPS << AC_AMPCAP_NUM_STEPS_SHIFT) |\
   (3  << AC_AMPCAP_STEP_SIZE_SHIFT))
  #else
-#define QEMU_HDA_ID_OUTPUT  ((QEMU_HDA_ID_VENDOR << 16) | 0x11)
-#define QEMU_HDA_ID_DUPLEX  ((QEMU_HDA_ID_VENDOR << 16) | 0x21)
-#define QEMU_HDA_ID_MICRO   ((QEMU_HDA_ID_VENDOR << 16) | 0x31)
  #define QEMU_HDA_AMP_CAPS   QEMU_HDA_AMP_NONE
  #endif
  
@@ -137,10 +133,10 @@ static const desc_param glue(common_params_audio_linein_, PARAM)[] = {

  static const desc_param glue(output_params_root_, PARAM)[] = {
  {
  .id  = AC_PAR_VENDOR_ID,
-.val = QEMU_HDA_ID_OUTPUT,
+.val = QEMU_HDA_ID,
  },{
  .id  = AC_PAR_SUBSYSTEM_ID,
-.val = QEMU_HDA_ID_OUTPUT,
+.val = QEMU_HDA_ID,
  },{
  .id  = AC_PAR_REV_ID,
  .val = 0x00100101,
@@ -157,7 +153,7 @@ static const desc_param glue(output_params_audio_func_, 
PARAM)[] = {
  .val = AC_GRP_AUDIO_FUNCTION,
  },{
  .id  = AC_PAR_SUBSYSTEM_ID,
-.val = QEMU_HDA_ID_OUTPUT,
+.val = QEMU_HDA_ID,
  },{
  .id  = AC_PAR_NODE_COUNT,
  .val = 0x00020002,
@@ -208,9 +204,9 @@ static const desc_node glue(output_nodes_, PARAM)[] = {
  .name= "out",
  .params  = glue(common_params_audio_lineout_, PARAM),
  .nparams = ARRAY_SIZE(glue(common_params_audio_lineout_, PARAM)),
-.config  = ((AC_JACK_PORT_COMPLEX << AC_DEFCFG_PORT_CONN_SHIFT) |
-(AC_JACK_LINE_OUT << AC_DEFCFG_DEVICE_SHIFT)|
-(AC_JACK_CONN_UNKNOWN << AC_DEFCFG_CONN_TYPE_SHIFT) |
+.config  = ((AC_JACK_PORT_FIXED << AC_DEFCFG_PORT_CONN_SHIFT) |
+(AC_JACK_SPEAKER << AC_DEFCFG_DEVICE_SHIFT)|
+(AC_JACK_CONN_1_8 << AC_DEFCFG_CONN_TYPE_SHIFT) |
  (AC_JACK_COLOR_GREEN  << AC_DEFCFG_COLOR_SHIFT) |
  0x10),
  .pinctl  = AC_PINCTL_OUT_EN,
@@ -221,7 +217,7 @@ static const desc_node glue(output_nodes_, PARAM)[] = {
  /* output: codec */
  static const desc_codec glue(output_, PARAM) = {
  .name   = "output",
-.iid= QEMU_HDA_ID_OUTPUT,
+.iid= QEMU_HDA_ID,
  .nodes  = glue(output_nodes_, PARAM),
  .nnodes = ARRAY_SIZE(glue(output_nodes_, PARAM)),
  };
@@ -230,10 +226,10 @@ static const desc_codec glue(output_, PARAM) = {
  static const desc_param glue(duplex_params_root_, PARAM)[] = {
  {
  .id  = AC_PAR_VENDOR_ID,
-.val = QEMU_HDA_ID_DUPLEX,
+.val = QEMU_HDA_ID,
  },{
  .id  = AC_PAR_SUBSYSTEM_ID,
-.val = QEMU_HDA_ID_DUPLEX,
+.val = QEMU_HDA_ID,
  },{
  .id  = AC_PAR_REV_ID,
  .val = 0x00100101,
@@ -250,7 +246,7 @@ static const desc_param glue(duplex_params_audio_func_, 
PARAM)[] = {
  .val = AC_GRP_AUDIO_FUNCTION,
  },{
  .id  = AC_PAR_SUBSYSTEM_ID,
-.val = 

Re: [PATCH] Fix Windows 2000 and XP HDAudio Support

2023-11-07 Thread Christopher Lentocha
I forgot to turn off HTML formatting on my mail, 
thats why, sorry.
I also changed the liaf to alcnode if its valid?
Please check your next email from me for the 
hopefully fixed patch!
Thanks,

Christopher Lentocha

On 11/7/23 5:19 AM, Philippe Mathieu-Daudé wrote:
> Hi Christopher,
> 
> On 6/11/23 18:38, Christopher Lentocha wrote:
>>
>> Change the ID to be a Realtek ALC885 so that both
>> Windows 2000 and up (including XP) and macOS
>> (on a later patch for HDEF ACPI Fixes) support HDA
>> HDA is supported for ALC885 on macOS AppleHDA.kext
>> and 2K people can use the following file to get
>> sound working (MD5sum):
>>
>> 959c6ad895ee22d0003fe24b6ce1b150
>>
>> WDM_R269.exe
>>
>> for Vista+, the following can be used for EQ or if
>> the native one doesn't work OOTB (MD5sum):
>>
>> fb0aaffcfc620b70b7f3c3b1381d08e5
>>
>> Vista_Win7_Win8_R270.exe
>>
>> A Note for the Vista+ Driver: You need to go to
>> playback settings, under the Speaker, Advanced,
>> change the Hz to one that is valid, so sound
>> actually plays, though you may need to enable
>> under the Enhancements tab, check Disable All
>> then change the Hz, and uncheck Disable All
>> Under Enhancements, applying after each of
>> the tasks, due to a bug in the stock Realtek
>> Driver, also note, newer drivers don't work at
>> all, even on real machines, this is the latest
>> confirmed to work at the moment!
>>
>> Signed-off-by: Christopher Lentocha 
>> ---
>> hw/audio/hda-codec-common.h | 66 +
>> hw/audio/hda-codec.c | 8 +++--
>> 2 files changed, 36 insertions(+), 38 deletions(-)
>>
>> diff --git a/hw/audio/hda-codec-common.h b/hw/audio/hda-codec-common.h
>> index b4fdb51e8b..ef57a1b98d 100644
>> --- a/hw/audio/hda-codec-common.h
>> +++ b/hw/audio/hda-codec-common.h
>> @@ -24,19 +24,15 @@
>> * HDA codec descriptions
>> */
>>
>> +#define QEMU_HDA_ID 0x10EC0885
>> +
>> #ifdef HDA_MIXER
>> -#define QEMU_HDA_ID_OUTPUT ((QEMU_HDA_ID_VENDOR << 16) | 0x12)
>> -#define QEMU_HDA_ID_DUPLEX ((QEMU_HDA_ID_VENDOR << 16) | 0x22)
>> -#define QEMU_HDA_ID_MICRO ((QEMU_HDA_ID_VENDOR << 16) | 0x32)
>> #define QEMU_HDA_AMP_CAPS \
>> (AC_AMPCAP_MUTE | \
>> (QEMU_HDA_AMP_STEPS << AC_AMPCAP_OFFSET_SHIFT) | \
>> (QEMU_HDA_AMP_STEPS << AC_AMPCAP_NUM_STEPS_SHIFT) | \
>> (3 << AC_AMPCAP_STEP_SIZE_SHIFT))
>> #else
>> -#define QEMU_HDA_ID_OUTPUT ((QEMU_HDA_ID_VENDOR << 16) | 0x11)
>> -#define QEMU_HDA_ID_DUPLEX ((QEMU_HDA_ID_VENDOR << 16) | 0x21)
>> -#define QEMU_HDA_ID_MICRO ((QEMU_HDA_ID_VENDOR << 16) | 0x31)
>> #define QEMU_HDA_AMP_CAPS QEMU_HDA_AMP_NONE
>> #endif
>>
>> @@ -137,10 +133,10 @@ static const desc_param 
>> glue(common_params_audio_linein_, PARAM)[] = {
>> static const desc_param glue(output_params_root_, PARAM)[] = {
>> {
>> .id = AC_PAR_VENDOR_ID,
>> - .val = QEMU_HDA_ID_OUTPUT,
>> + .val = QEMU_HDA_ID,
> 
> Thanks for your patch, but it seems ill-formatted and can't be
> applied :/
> 
> See for help:
> https://www.qemu.org/docs/master/devel/submitting-a-patch.html#submitting-your-patches
> 
>> },{
>> .id = AC_PAR_SUBSYSTEM_ID,
>> - .val = QEMU_HDA_ID_OUTPUT,
>> + .val = QEMU_HDA_ID,
>> },{
>> .id = AC_PAR_REV_ID,
>> .val = 0x00100101,
>> @@ -157,7 +153,7 @@ static const desc_param glue(output_params_audio_func_, 
>> PARAM)[] = {
>> .val = AC_GRP_AUDIO_FUNCTION,
>> },{
>> .id = AC_PAR_SUBSYSTEM_ID,
>> - .val = QEMU_HDA_ID_OUTPUT,
>> + .val = QEMU_HDA_ID,
>> },{
>> .id = AC_PAR_NODE_COUNT,
>> .val = 0x00020002,
>> @@ -208,9 +204,9 @@ static const desc_node glue(output_nodes_, PARAM)[] = {
>> .name = "out",
>> .params = glue(common_params_audio_lineout_, PARAM),
>> .nparams = ARRAY_SIZE(glue(common_params_audio_lineout_, PARAM)),
>> - .config = ((AC_JACK_PORT_COMPLEX << AC_DEFCFG_PORT_CONN_SHIFT) |
>> - (AC_JACK_LINE_OUT << AC_DEFCFG_DEVICE_SHIFT) |
>> - (AC_JACK_CONN_UNKNOWN << AC_DEFCFG_CONN_TYPE_SHIFT) |
>> + .config = ((AC_JACK_PORT_FIXED << AC_DEFCFG_PORT_CONN_SHIFT) |
>> + (AC_JACK_SPEAKER << AC_DEFCFG_DEVICE_SHIFT) |
>> + (AC_JACK_CONN_1_8 << AC_DEFCFG_CONN_TYPE_SHIFT) |
>> (AC_JACK_COLOR_GREEN << AC_DEFCFG_COLOR_SHIFT) |
>> 0x10),
>> .pinctl = AC_PINCTL_OUT_EN,
>> @@ -221,7 +217,7 @@ static const desc_node glue(output_nodes_, PARAM)[] = {
>> /* output: codec */
>> static const desc_codec glue(output_, PARAM) = {
>> .name = "output",
>> - .iid = QEMU_HDA_ID_OUTPUT,
>> + .iid = QEMU_HDA_ID,
>> .nodes = glue(output_nodes_, PARAM),
>> .nnodes = ARRAY_SIZE(glue(output_nodes_, PARAM)),
>> };
>> @@ -230,10 +226,10 @@ static const desc_codec glue(output_, PARAM) = {
>> static const desc_param glue(duplex_params_root_, PARAM)[] = {
>> {
>> .id = AC_PAR_VENDOR_ID,
>> - .val = QEMU_HDA_ID_DUPLEX,
>> + .val = QEMU_HDA_ID,
>> },{
>> .id = AC_PAR_SUBSYSTEM_ID,
>> - .val = QEMU_HDA_ID_DUPLEX,
>> + .val = QEMU_HDA_ID,
>> },{
>> .id = AC_PAR_REV_ID,
>> .val = 0x00100101,
>> @@ -250,7 +246,7 @@ static const desc_param glue(duplex_params_audio_func_, 
>> PARAM)[] = {
>> .val = AC_GRP_AUDIO_FUNCTION,
>> },{
>> .id = AC_PAR_SUBSYSTEM_ID,
>> 

[PATCH] Fix Windows 2000 and XP HDAudio Support

2023-11-07 Thread Christopher Lentocha


Change the ID to be a Realtek ALC885 so that both
Windows 2000 and up (including XP) and macOS
(on a later patch for HDEF ACPI Fixes) support HDA
HDA is supported for ALC885 on macOS AppleHDA.kext
and 2K people can use the following file to get
sound working (MD5sum):

959c6ad895ee22d0003fe24b6ce1b150

WDM_R269.exe

for Vista+, the following can be used for EQ or if
the native one doesn't work OOTB (MD5sum):

fb0aaffcfc620b70b7f3c3b1381d08e5

Vista_Win7_Win8_R270.exe

A Note for the Vista+ Driver: You need to go to
playback settings, under the Speaker, Advanced,
change the Hz to one that is valid, so sound
actually plays, though you may need to enable
under the Enhancements tab, check Disable All
then change the Hz, and uncheck Disable All
Under Enhancements, applying after each of
the tasks, due to a bug in the stock Realtek
Driver, also note, newer drivers don't work at
all, even on real machines, this is the latest
confirmed to work at the moment!

Signed-off-by: Christopher Lentocha 
---
 hw/audio/hda-codec-common.h | 66 +
 hw/audio/hda-codec.c|  8 +++--
 2 files changed, 36 insertions(+), 38 deletions(-)

diff --git a/hw/audio/hda-codec-common.h b/hw/audio/hda-codec-common.h
index b4fdb51e8b..ef57a1b98d 100644
--- a/hw/audio/hda-codec-common.h
+++ b/hw/audio/hda-codec-common.h
@@ -24,19 +24,15 @@
  * HDA codec descriptions
  */
 
+#define QEMU_HDA_ID 0x10EC0885
+
 #ifdef HDA_MIXER
-#define QEMU_HDA_ID_OUTPUT  ((QEMU_HDA_ID_VENDOR << 16) | 0x12)
-#define QEMU_HDA_ID_DUPLEX  ((QEMU_HDA_ID_VENDOR << 16) | 0x22)
-#define QEMU_HDA_ID_MICRO   ((QEMU_HDA_ID_VENDOR << 16) | 0x32)
 #define QEMU_HDA_AMP_CAPS   \
 (AC_AMPCAP_MUTE |   \
  (QEMU_HDA_AMP_STEPS << AC_AMPCAP_OFFSET_SHIFT)|\
  (QEMU_HDA_AMP_STEPS << AC_AMPCAP_NUM_STEPS_SHIFT) |\
  (3  << AC_AMPCAP_STEP_SIZE_SHIFT))
 #else
-#define QEMU_HDA_ID_OUTPUT  ((QEMU_HDA_ID_VENDOR << 16) | 0x11)
-#define QEMU_HDA_ID_DUPLEX  ((QEMU_HDA_ID_VENDOR << 16) | 0x21)
-#define QEMU_HDA_ID_MICRO   ((QEMU_HDA_ID_VENDOR << 16) | 0x31)
 #define QEMU_HDA_AMP_CAPS   QEMU_HDA_AMP_NONE
 #endif
 
@@ -137,10 +133,10 @@ static const desc_param glue(common_params_audio_linein_, 
PARAM)[] = {
 static const desc_param glue(output_params_root_, PARAM)[] = {
 {
 .id  = AC_PAR_VENDOR_ID,
-.val = QEMU_HDA_ID_OUTPUT,
+.val = QEMU_HDA_ID,
 },{
 .id  = AC_PAR_SUBSYSTEM_ID,
-.val = QEMU_HDA_ID_OUTPUT,
+.val = QEMU_HDA_ID,
 },{
 .id  = AC_PAR_REV_ID,
 .val = 0x00100101,
@@ -157,7 +153,7 @@ static const desc_param glue(output_params_audio_func_, 
PARAM)[] = {
 .val = AC_GRP_AUDIO_FUNCTION,
 },{
 .id  = AC_PAR_SUBSYSTEM_ID,
-.val = QEMU_HDA_ID_OUTPUT,
+.val = QEMU_HDA_ID,
 },{
 .id  = AC_PAR_NODE_COUNT,
 .val = 0x00020002,
@@ -208,9 +204,9 @@ static const desc_node glue(output_nodes_, PARAM)[] = {
 .name= "out",
 .params  = glue(common_params_audio_lineout_, PARAM),
 .nparams = ARRAY_SIZE(glue(common_params_audio_lineout_, PARAM)),
-.config  = ((AC_JACK_PORT_COMPLEX << AC_DEFCFG_PORT_CONN_SHIFT) |
-(AC_JACK_LINE_OUT << AC_DEFCFG_DEVICE_SHIFT)|
-(AC_JACK_CONN_UNKNOWN << AC_DEFCFG_CONN_TYPE_SHIFT) |
+.config  = ((AC_JACK_PORT_FIXED << AC_DEFCFG_PORT_CONN_SHIFT) |
+(AC_JACK_SPEAKER << AC_DEFCFG_DEVICE_SHIFT)|
+(AC_JACK_CONN_1_8 << AC_DEFCFG_CONN_TYPE_SHIFT) |
 (AC_JACK_COLOR_GREEN  << AC_DEFCFG_COLOR_SHIFT) |
 0x10),
 .pinctl  = AC_PINCTL_OUT_EN,
@@ -221,7 +217,7 @@ static const desc_node glue(output_nodes_, PARAM)[] = {
 /* output: codec */
 static const desc_codec glue(output_, PARAM) = {
 .name   = "output",
-.iid= QEMU_HDA_ID_OUTPUT,
+.iid= QEMU_HDA_ID,
 .nodes  = glue(output_nodes_, PARAM),
 .nnodes = ARRAY_SIZE(glue(output_nodes_, PARAM)),
 };
@@ -230,10 +226,10 @@ static const desc_codec glue(output_, PARAM) = {
 static const desc_param glue(duplex_params_root_, PARAM)[] = {
 {
 .id  = AC_PAR_VENDOR_ID,
-.val = QEMU_HDA_ID_DUPLEX,
+.val = QEMU_HDA_ID,
 },{
 .id  = AC_PAR_SUBSYSTEM_ID,
-.val = QEMU_HDA_ID_DUPLEX,
+.val = QEMU_HDA_ID,
 },{
 .id  = AC_PAR_REV_ID,
 .val = 0x00100101,
@@ -250,7 +246,7 @@ static const desc_param glue(duplex_params_audio_func_, 
PARAM)[] = {
 .val = AC_GRP_AUDIO_FUNCTION,
 },{
 .id  = AC_PAR_SUBSYSTEM_ID,
-.val = QEMU_HDA_ID_DUPLEX,
+.val = QEMU_HDA_ID,
 },{
 .id  = AC_PAR_NODE_COUNT,
 .val = 0x00020004,
@@ -301,9 +297,9 @@ static const desc_node glue(duplex_nodes_, PARAM)[] = {

Re: [PATCH] Fix Windows 2000 and XP HDAudio Support

2023-11-07 Thread Philippe Mathieu-Daudé

Hi Christopher,

On 6/11/23 18:38, Christopher Lentocha wrote:


Change the ID to be a Realtek ALC885 so that both
Windows 2000 and up (including XP) and macOS
(on a later patch for HDEF ACPI Fixes) support HDA
HDA is supported for ALC885 on macOS AppleHDA.kext
and 2K people can use the following file to get
sound working (MD5sum):

959c6ad895ee22d0003fe24b6ce1b150

WDM_R269.exe

for Vista+, the following can be used for EQ or if
the native one doesn't work OOTB (MD5sum):

fb0aaffcfc620b70b7f3c3b1381d08e5

Vista_Win7_Win8_R270.exe

A Note for the Vista+ Driver: You need to go to
playback settings, under the Speaker, Advanced,
change the Hz to one that is valid, so sound
actually plays, though you may need to enable
under the Enhancements tab, check Disable All
then change the Hz, and uncheck Disable All
Under Enhancements, applying after each of
the tasks, due to a bug in the stock Realtek
Driver, also note, newer drivers don't work at
all, even on real machines, this is the latest
confirmed to work at the moment!

Signed-off-by: Christopher Lentocha 
---
hw/audio/hda-codec-common.h | 66 +
hw/audio/hda-codec.c | 8 +++--
2 files changed, 36 insertions(+), 38 deletions(-)

diff --git a/hw/audio/hda-codec-common.h b/hw/audio/hda-codec-common.h
index b4fdb51e8b..ef57a1b98d 100644
--- a/hw/audio/hda-codec-common.h
+++ b/hw/audio/hda-codec-common.h
@@ -24,19 +24,15 @@
* HDA codec descriptions
*/

+#define QEMU_HDA_ID 0x10EC0885
+
#ifdef HDA_MIXER
-#define QEMU_HDA_ID_OUTPUT ((QEMU_HDA_ID_VENDOR << 16) | 0x12)
-#define QEMU_HDA_ID_DUPLEX ((QEMU_HDA_ID_VENDOR << 16) | 0x22)
-#define QEMU_HDA_ID_MICRO ((QEMU_HDA_ID_VENDOR << 16) | 0x32)
#define QEMU_HDA_AMP_CAPS \
(AC_AMPCAP_MUTE | \
(QEMU_HDA_AMP_STEPS << AC_AMPCAP_OFFSET_SHIFT) | \
(QEMU_HDA_AMP_STEPS << AC_AMPCAP_NUM_STEPS_SHIFT) | \
(3 << AC_AMPCAP_STEP_SIZE_SHIFT))
#else
-#define QEMU_HDA_ID_OUTPUT ((QEMU_HDA_ID_VENDOR << 16) | 0x11)
-#define QEMU_HDA_ID_DUPLEX ((QEMU_HDA_ID_VENDOR << 16) | 0x21)
-#define QEMU_HDA_ID_MICRO ((QEMU_HDA_ID_VENDOR << 16) | 0x31)
#define QEMU_HDA_AMP_CAPS QEMU_HDA_AMP_NONE
#endif

@@ -137,10 +133,10 @@ static const desc_param 
glue(common_params_audio_linein_, PARAM)[] = {

static const desc_param glue(output_params_root_, PARAM)[] = {
{
.id = AC_PAR_VENDOR_ID,
- .val = QEMU_HDA_ID_OUTPUT,
+ .val = QEMU_HDA_ID,


Thanks for your patch, but it seems ill-formatted and can't be
applied :/

See for help:
https://www.qemu.org/docs/master/devel/submitting-a-patch.html#submitting-your-patches


},{
.id = AC_PAR_SUBSYSTEM_ID,
- .val = QEMU_HDA_ID_OUTPUT,
+ .val = QEMU_HDA_ID,
},{
.id = AC_PAR_REV_ID,
.val = 0x00100101,
@@ -157,7 +153,7 @@ static const desc_param 
glue(output_params_audio_func_, PARAM)[] = {

.val = AC_GRP_AUDIO_FUNCTION,
},{
.id = AC_PAR_SUBSYSTEM_ID,
- .val = QEMU_HDA_ID_OUTPUT,
+ .val = QEMU_HDA_ID,
},{
.id = AC_PAR_NODE_COUNT,
.val = 0x00020002,
@@ -208,9 +204,9 @@ static const desc_node glue(output_nodes_, PARAM)[] = {
.name = "out",
.params = glue(common_params_audio_lineout_, PARAM),
.nparams = ARRAY_SIZE(glue(common_params_audio_lineout_, PARAM)),
- .config = ((AC_JACK_PORT_COMPLEX << AC_DEFCFG_PORT_CONN_SHIFT) |
- (AC_JACK_LINE_OUT << AC_DEFCFG_DEVICE_SHIFT) |
- (AC_JACK_CONN_UNKNOWN << AC_DEFCFG_CONN_TYPE_SHIFT) |
+ .config = ((AC_JACK_PORT_FIXED << AC_DEFCFG_PORT_CONN_SHIFT) |
+ (AC_JACK_SPEAKER << AC_DEFCFG_DEVICE_SHIFT) |
+ (AC_JACK_CONN_1_8 << AC_DEFCFG_CONN_TYPE_SHIFT) |
(AC_JACK_COLOR_GREEN << AC_DEFCFG_COLOR_SHIFT) |
0x10),
.pinctl = AC_PINCTL_OUT_EN,
@@ -221,7 +217,7 @@ static const desc_node glue(output_nodes_, PARAM)[] = {
/* output: codec */
static const desc_codec glue(output_, PARAM) = {
.name = "output",
- .iid = QEMU_HDA_ID_OUTPUT,
+ .iid = QEMU_HDA_ID,
.nodes = glue(output_nodes_, PARAM),
.nnodes = ARRAY_SIZE(glue(output_nodes_, PARAM)),
};
@@ -230,10 +226,10 @@ static const desc_codec glue(output_, PARAM) = {
static const desc_param glue(duplex_params_root_, PARAM)[] = {
{
.id = AC_PAR_VENDOR_ID,
- .val = QEMU_HDA_ID_DUPLEX,
+ .val = QEMU_HDA_ID,
},{
.id = AC_PAR_SUBSYSTEM_ID,
- .val = QEMU_HDA_ID_DUPLEX,
+ .val = QEMU_HDA_ID,
},{
.id = AC_PAR_REV_ID,
.val = 0x00100101,
@@ -250,7 +246,7 @@ static const desc_param 
glue(duplex_params_audio_func_, PARAM)[] = {

.val = AC_GRP_AUDIO_FUNCTION,
},{
.id = AC_PAR_SUBSYSTEM_ID,
- .val = QEMU_HDA_ID_DUPLEX,
+ .val = QEMU_HDA_ID,
},{
.id = AC_PAR_NODE_COUNT,
.val = 0x00020004,
@@ -301,9 +297,9 @@ static const desc_node glue(duplex_nodes_, PARAM)[] = {
.name = "out",
.params = glue(common_params_audio_lineout_, PARAM),
.nparams = ARRAY_SIZE(glue(common_params_audio_lineout_, PARAM)),
- .config = ((AC_JACK_PORT_COMPLEX << AC_DEFCFG_PORT_CONN_SHIFT) |
- (AC_JACK_LINE_OUT << AC_DEFCFG_DEVICE_SHIFT) |
- (AC_JACK_CONN_UNKNOWN << AC_DEFCFG_CONN_TYPE_SHIFT) |
+ .config = ((AC_JACK_PORT_FIXED << AC_DEFCFG_PORT_CONN_SHIFT) |
+ (AC_JACK_SPEAKER << AC_DEFCFG_DEVICE_SHIFT) |
+ (AC_JACK_CONN_1_8 << AC_DEFCFG_CONN_TYPE_SHIFT) |

[PATCH] Fix Windows 2000 and XP HDAudio Support

2023-11-06 Thread Christopher Lentocha



Change the ID to be a Realtek ALC885 so that both
Windows 2000 and up (including XP) and macOS
(on a later patch for HDEF ACPI Fixes) support HDA
HDA is supported for ALC885 on macOS AppleHDA.kext
and 2K people can use the following file to get
sound working (MD5sum):

959c6ad895ee22d0003fe24b6ce1b150

WDM_R269.exe

for Vista+, the following can be used for EQ or if
the native one doesn't work OOTB (MD5sum):

fb0aaffcfc620b70b7f3c3b1381d08e5

Vista_Win7_Win8_R270.exe

A Note for the Vista+ Driver: You need to go to
playback settings, under the Speaker, Advanced,
change the Hz to one that is valid, so sound
actually plays, though you may need to enable
under the Enhancements tab, check Disable All
then change the Hz, and uncheck Disable All
Under Enhancements, applying after each of
the tasks, due to a bug in the stock Realtek
Driver, also note, newer drivers don't work at
all, even on real machines, this is the latest
confirmed to work at the moment!

Signed-off-by: Christopher Lentocha 
---
hw/audio/hda-codec-common.h | 66 +
hw/audio/hda-codec.c | 8 +++--
2 files changed, 36 insertions(+), 38 deletions(-)

diff --git a/hw/audio/hda-codec-common.h b/hw/audio/hda-codec-common.h
index b4fdb51e8b..ef57a1b98d 100644
--- a/hw/audio/hda-codec-common.h
+++ b/hw/audio/hda-codec-common.h
@@ -24,19 +24,15 @@
* HDA codec descriptions
*/

+#define QEMU_HDA_ID 0x10EC0885
+
#ifdef HDA_MIXER
-#define QEMU_HDA_ID_OUTPUT ((QEMU_HDA_ID_VENDOR << 16) | 0x12)
-#define QEMU_HDA_ID_DUPLEX ((QEMU_HDA_ID_VENDOR << 16) | 0x22)
-#define QEMU_HDA_ID_MICRO ((QEMU_HDA_ID_VENDOR << 16) | 0x32)
#define QEMU_HDA_AMP_CAPS \
(AC_AMPCAP_MUTE | \
(QEMU_HDA_AMP_STEPS << AC_AMPCAP_OFFSET_SHIFT) | \
(QEMU_HDA_AMP_STEPS << AC_AMPCAP_NUM_STEPS_SHIFT) | \
(3 << AC_AMPCAP_STEP_SIZE_SHIFT))
#else
-#define QEMU_HDA_ID_OUTPUT ((QEMU_HDA_ID_VENDOR << 16) | 0x11)
-#define QEMU_HDA_ID_DUPLEX ((QEMU_HDA_ID_VENDOR << 16) | 0x21)
-#define QEMU_HDA_ID_MICRO ((QEMU_HDA_ID_VENDOR << 16) | 0x31)
#define QEMU_HDA_AMP_CAPS QEMU_HDA_AMP_NONE
#endif

@@ -137,10 +133,10 @@ static const desc_param 
glue(common_params_audio_linein_, PARAM)[] = {

static const desc_param glue(output_params_root_, PARAM)[] = {
{
.id = AC_PAR_VENDOR_ID,
- .val = QEMU_HDA_ID_OUTPUT,
+ .val = QEMU_HDA_ID,
},{
.id = AC_PAR_SUBSYSTEM_ID,
- .val = QEMU_HDA_ID_OUTPUT,
+ .val = QEMU_HDA_ID,
},{
.id = AC_PAR_REV_ID,
.val = 0x00100101,
@@ -157,7 +153,7 @@ static const desc_param 
glue(output_params_audio_func_, PARAM)[] = {

.val = AC_GRP_AUDIO_FUNCTION,
},{
.id = AC_PAR_SUBSYSTEM_ID,
- .val = QEMU_HDA_ID_OUTPUT,
+ .val = QEMU_HDA_ID,
},{
.id = AC_PAR_NODE_COUNT,
.val = 0x00020002,
@@ -208,9 +204,9 @@ static const desc_node glue(output_nodes_, PARAM)[] = {
.name = "out",
.params = glue(common_params_audio_lineout_, PARAM),
.nparams = ARRAY_SIZE(glue(common_params_audio_lineout_, PARAM)),
- .config = ((AC_JACK_PORT_COMPLEX << AC_DEFCFG_PORT_CONN_SHIFT) |
- (AC_JACK_LINE_OUT << AC_DEFCFG_DEVICE_SHIFT) |
- (AC_JACK_CONN_UNKNOWN << AC_DEFCFG_CONN_TYPE_SHIFT) |
+ .config = ((AC_JACK_PORT_FIXED << AC_DEFCFG_PORT_CONN_SHIFT) |
+ (AC_JACK_SPEAKER << AC_DEFCFG_DEVICE_SHIFT) |
+ (AC_JACK_CONN_1_8 << AC_DEFCFG_CONN_TYPE_SHIFT) |
(AC_JACK_COLOR_GREEN << AC_DEFCFG_COLOR_SHIFT) |
0x10),
.pinctl = AC_PINCTL_OUT_EN,
@@ -221,7 +217,7 @@ static const desc_node glue(output_nodes_, PARAM)[] = {
/* output: codec */
static const desc_codec glue(output_, PARAM) = {
.name = "output",
- .iid = QEMU_HDA_ID_OUTPUT,
+ .iid = QEMU_HDA_ID,
.nodes = glue(output_nodes_, PARAM),
.nnodes = ARRAY_SIZE(glue(output_nodes_, PARAM)),
};
@@ -230,10 +226,10 @@ static const desc_codec glue(output_, PARAM) = {
static const desc_param glue(duplex_params_root_, PARAM)[] = {
{
.id = AC_PAR_VENDOR_ID,
- .val = QEMU_HDA_ID_DUPLEX,
+ .val = QEMU_HDA_ID,
},{
.id = AC_PAR_SUBSYSTEM_ID,
- .val = QEMU_HDA_ID_DUPLEX,
+ .val = QEMU_HDA_ID,
},{
.id = AC_PAR_REV_ID,
.val = 0x00100101,
@@ -250,7 +246,7 @@ static const desc_param 
glue(duplex_params_audio_func_, PARAM)[] = {

.val = AC_GRP_AUDIO_FUNCTION,
},{
.id = AC_PAR_SUBSYSTEM_ID,
- .val = QEMU_HDA_ID_DUPLEX,
+ .val = QEMU_HDA_ID,
},{
.id = AC_PAR_NODE_COUNT,
.val = 0x00020004,
@@ -301,9 +297,9 @@ static const desc_node glue(duplex_nodes_, PARAM)[] = {
.name = "out",
.params = glue(common_params_audio_lineout_, PARAM),
.nparams = ARRAY_SIZE(glue(common_params_audio_lineout_, PARAM)),
- .config = ((AC_JACK_PORT_COMPLEX << AC_DEFCFG_PORT_CONN_SHIFT) |
- (AC_JACK_LINE_OUT << AC_DEFCFG_DEVICE_SHIFT) |
- (AC_JACK_CONN_UNKNOWN << AC_DEFCFG_CONN_TYPE_SHIFT) |
+ .config = ((AC_JACK_PORT_FIXED << AC_DEFCFG_PORT_CONN_SHIFT) |
+ (AC_JACK_SPEAKER << AC_DEFCFG_DEVICE_SHIFT) |
+ (AC_JACK_CONN_1_8 << AC_DEFCFG_CONN_TYPE_SHIFT) |
(AC_JACK_COLOR_GREEN << AC_DEFCFG_COLOR_SHIFT) |
0x10),
.pinctl = AC_PINCTL_OUT_EN,
@@ -320,10 +316,10 @@ static const desc_node glue(duplex_nodes_, 
PARAM)[] = {

.name = "in",
.params = glue(common_params_audio_linein_, PARAM),
.nparams =