On Sun, Mar 05, 2023 at 08:53:00AM +0100, Alexandre Ratchov wrote:
> If you've an azalia(4) attaching as "AMD 17h/1xh HD Audio", please
> test this diff and report regressions. Especially audio lock ups that
> require reboot.
> 
> IIRC, MSI was disabled few years ago to "fix" such lockups, and now
> this diff suggests we need MSI on certain boards.
> 
> Context and diff below:
> 
> ----- Forwarded message from Andreas Bartelt <o...@bartula.de> -----
> 
> Date: Sat, 4 Mar 2023 16:12:22 +0100
> From: Andreas Bartelt <o...@bartula.de>
> To: Alexandre Ratchov <a...@caoua.org>, b...@openbsd.org
> Subject: Re: audio(4) output doesn't work yet on ASUS ProArt X670E-CREATOR 
> WIFI mainboard (ALC1220
>       CODEC)
> User-Agent: Mozilla/5.0 (X11; OpenBSD amd64; rv:102.0) Gecko/20100101 
> Thunderbird/102.8.0
> 
> On 2/27/23 6:41 PM, Andreas Bartelt wrote:
> > On 2/27/23 2:40 PM, Alexandre Ratchov wrote:
> > > On Sat, Feb 25, 2023 at 05:20:53PM +0100, Andreas Bartelt wrote:
> > > > Hi,
> > > > 
> > > > I've tested a recent OpenBSD snapshot of CURRENT on an ASUS ProArt
> > > > X670E-CREATOR WIFI mainboard. According to the information
> > > > provided by ASUS,
> > > > this mainboard features a "Realtek S1220A CODEC" which attaches as
> > > > Realtek
> > > > ALC1220 on OpenBSD -- however, audio output (tested with
> > > > headphones on the
> > > > line out connector) doesn't work there yet. Applications (e.g., mplayer,
> > > > mpg123) hang and I can hear no sound.
> > > > 
> > > > [I don't know if this helps but I previously also had access to an
> > > > ASUS ROG
> > > > STRIX B550-E GAMING mainboard which, according to ASUS, also features an
> > > > S1220A CODEC which also attaches as Realtek ALC1220 on OpenBSD -- audio
> > > > output (tested on the line out connector) works there without problems.]
> > > > 
> > > > In order to verify that the new mainboard doesn't have a physical defect
> > > > with regard to the line out audio connector, I've also tested a
> > > > FreeBSD 13.2
> > > > BETA3 snapshot on the ASUS ProArt X670E-CREATOR WIFI mainboard.
> > > > Audio output
> > > > worked there out-of-the-box, so this might be a fixable problem on
> > > > OpenBSD.
> > > > 
> > > > I've found some info with regard to audio debugging at
> > > > https://www.openbsd.org/faq/faq13.html#audioprob . While running
> > > > # cat > /dev/audio0 < /dev/zero
> > > > play.bytes doesn't increase at all:
> > > > # audioctl play.{bytes,errors}
> > > > play.bytes=0
> > > > play.errors=0
> > > > 
> > > 
> > > mixerctl shows that the host manages communicate with the codec, but
> > > above lines suggest that DMA doesn't start. Could you check if there
> > > are any audio-related options in the BIOS? Especially, if there's an
> > > option to disable the microphone (or "recording" or alike), please
> > > enable it.
> > 
> > There's no microphone or recording specific options available. I could
> > only identify a single audio related configuration option. Under
> > Advanced\Onboard Devices Configuration: enable/disable "HD Audio
> > Controller" (description says Enable/Disable Azalia HD Audio). It does
> > exactly that, i.e., disabling this option removes the azalia1 device from
> > OpenBSD's dmesg.
> > 
> > With this option enabled again, mp3 playback works with FreeBSD but hangs
> > with OpenBSD -- same BIOS config.
> > 
> 
> I've made audio work on the ASUS ProArt X670E-CREATOR WIFI mainboard, simply
> by enabling msi.
> 
> azalia1 at pci21 dev 0 function 6 "AMD 17h/1xh HD Audio" rev 0x00: msi
> azalia1: codecs: Realtek ALC1220
> audio0 at azalia1
> 
> The following diff fixes the problem:
> Index: src/sys/dev/pci/azalia.c
> ===================================================================
> RCS file: /cvs/src/sys/dev/pci/azalia.c,v
> retrieving revision 1.283
> diff -u -p -r1.283 azalia.c
> --- src/sys/dev/pci/azalia.c  21 Feb 2023 13:42:59 -0000      1.283
> +++ src/sys/dev/pci/azalia.c  4 Mar 2023 15:02:31 -0000
> @@ -554,7 +554,6 @@ azalia_pci_attach(struct device *parent,
>       if (PCI_VENDOR(sc->pciid) == PCI_VENDOR_AMD) {
>               switch (PCI_PRODUCT(sc->pciid)) {
>               case PCI_PRODUCT_AMD_17_HDA:
> -             case PCI_PRODUCT_AMD_17_1X_HDA:
>               case PCI_PRODUCT_AMD_HUDSON2_HDA:
>                       pa->pa_flags &= ~PCI_FLAGS_MSI_ENABLED;
>               }
> 
> OK?
> 
> 
> ----- End forwarded message -----

No, this workaround is still needed. thfr@ and I tried to debug this years
ago but could not determine the cause at the time.

This audio hang is still there on many systems, e.g: playback works for a
breif time until the it hangs, and only a reboot will fix it. But we could
never reproduce it with MSI disabled, so that was the best option we had.

-Bryan.

Reply via email to