NetBSD Problem Report #55017

From www@netbsd.org  Tue Feb 25 23:38:57 2020
Return-Path: <www@netbsd.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id B0B611A9213
	for <gnats-bugs@gnats.NetBSD.org>; Tue, 25 Feb 2020 23:38:57 +0000 (UTC)
Message-Id: <20200225233856.AC2C61A9217@mollari.NetBSD.org>
Date: Tue, 25 Feb 2020 23:38:56 +0000 (UTC)
From: vezhlys@gmail.com
Reply-To: vezhlys@gmail.com
To: gnats-bugs@NetBSD.org
Subject: audio0 autoconfiguration error on auvia
X-Send-Pr-Version: www-1.0

>Number:         55017
>Category:       kern
>Synopsis:       audio0 autoconfiguration error on auvia
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    isaki
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Tue Feb 25 23:40:00 +0000 2020
>Closed-Date:    Sun Mar 22 03:57:31 +0000 2020
>Last-Modified:  Sun Mar 22 03:57:31 +0000 2020
>Originator:     Andrius V
>Release:        NetBSD 9.0
>Organization:
>Environment:
NetBSD  9.0 NetBSD 9.0 (GENERIC) #0: Fri Feb 14 00:06:28 UTC 2020  mkrepro@mkrepro.NetBSD.org:/usr/src/sys/arch/i386/compile/GENERIC i386
>Description:
Audio fails to configure properly on VIA VT-310DP motherboard in NetBSD 9.0 release and current branch. It starts "blksize not configured 23040 -> 512" error followed by few autoconfiguration errors after (please look at dmesg messages below). Since, I am not using system frequently anymore, I am not sure when did it start, however I have dmesg file from Jan 15 of 2019 (NetBSD 8.99.30 (GENERIC) #0: Tue Jan 15 14:23:56 UTC 2019), those errors were still missing. They were not present in previous releases as well.

dmesg part from NetBSD 9.0:

auvia0 at pci0 dev 17 function 5: VIA Technologies VT8237 AC'97 Audio (rev 0x60)
auvia0: interrupting at ioapic0 pin 22
auvia0: ac97: VIA Technologies VT1616i codec; headphone, 18 bit DAC, 18 bit ADC, KS Waves 3D
auvia0: ac97: ext id 0x1c1<LDAC,SDAC,CDAC,VRA>
audio0 at auvia0: playback, capture, full duplex, independent
audio0: blksize not configured 23040 -> 512
audio0: autoconfiguration error: configuring playback mode failed
audio0: autoconfiguration error: audio_mixers_init failed, error = 22
audio0: autoconfiguration error: disabled

8.99.30 dmesg part:
auvia0 at pci0 dev 17 function 5: VIA Technologies VT8237 AC'97 Audio (rev 0x60)
auvia0: interrupting at ioapic0 pin 22
auvia0: ac97: VIA Technologies VT1616i codec; headphone, 18 bit DAC, 18 bit ADC, KS Waves 3D
auvia0: ac97: ext id 0x1c1<LDAC,SDAC,CDAC,VRA>
audio0 at auvia0: full duplex, playback, capture, mmap, independent
auvia0: Virtual format configured - Format SLINEAR, precision 16, channels 2, frequency 48000
auvia0: Latency: 8 milliseconds
>How-To-Repeat:
Boot into NetBSD 9.0, check dmesg messages.
>Fix:

>Release-Note:

>Audit-Trail:
From: Tetsuya Isaki <isaki@pastel-flower.jp>
To: gnats-bugs@netbsd.org
Cc: kern-bug-people@netbsd.org,
	gnats-admin@netbsd.org,
	netbsd-bugs@netbsd.org
Subject: Re: kern/55017: audio0 autoconfiguration error on auvia
Date: Wed, 26 Feb 2020 23:25:28 +0900

 At Tue, 25 Feb 2020 23:40:00 +0000 (UTC),
 vezhlys@gmail.com wrote:
 > auvia0 at pci0 dev 17 function 5: VIA Technologies VT8237 AC'97 Audio (rev 0x60)
 > auvia0: interrupting at ioapic0 pin 22
 > auvia0: ac97: VIA Technologies VT1616i codec; headphone, 18 bit DAC, 18 bit ADC, KS Waves 3D
 > auvia0: ac97: ext id 0x1c1<LDAC,SDAC,CDAC,VRA>
 > audio0 at auvia0: playback, capture, full duplex, independent
 > audio0: blksize not configured 23040 -> 512
 > audio0: autoconfiguration error: configuring playback mode failed

 Would you try this patch?

 diff --git a/sys/dev/pci/auvia.c b/sys/dev/pci/auvia.c
 index a80314177..954c4c8fa 100644
 --- a/sys/dev/pci/auvia.c
 +++ b/sys/dev/pci/auvia.c
 @@ -749,8 +749,7 @@ auvia_round_blocksize(void *addr, int blk,
  	if (sc->sc_flags & AUVIA_FLAGS_VT8233 && blk < 288)
  		blk = 288;

 -	/* Avoid too many dma_ops. */
 -	return uimin((blk & -32), AUVIA_MINBLKSZ);
 +	return (blk & -32);
  }

  static int

 ---
 Tetsuya Isaki <isaki@pastel-flower.jp / isaki@NetBSD.org>

From: Andrius V <vezhlys@gmail.com>
To: Tetsuya Isaki <isaki@pastel-flower.jp>
Cc: gnats-bugs@netbsd.org, kern-bug-people@netbsd.org, gnats-admin@netbsd.org, 
	netbsd-bugs@netbsd.org
Subject: Re: kern/55017: audio0 autoconfiguration error on auvia
Date: Wed, 26 Feb 2020 20:29:18 +0200

 Hi,

 Patch works:

 auvia0 at pci0 dev 17 function 5: VIA Technologies VT8237 AC'97 Audio (rev 0x60)
 allocated pic ioapic0 type level pin 22 level 7 to cpu0 slot 6 idt entry 112
 auvia0: interrupting at ioapic0 pin 22
 auvia0: ac97: VIA Technologies VT1616i codec; headphone, 18 bit DAC,
 18 bit ADC, KS Waves 3D
 auvia0: ac97: ext id 0x1c1<LDAC,SDAC,CDAC,VRA>
 audio0 at auvia0: playback, capture, full duplex, independent
 audio0: slinear_le:16 6ch 48000Hz, blk 40ms for playback
 audio0: slinear_le:16 2ch 48000Hz, blk 40ms for recording

 Regards,
 Andrius V

 On Wed, Feb 26, 2020 at 4:25 PM Tetsuya Isaki <isaki@pastel-flower.jp> wrote:
 >
 > At Tue, 25 Feb 2020 23:40:00 +0000 (UTC),
 > vezhlys@gmail.com wrote:
 > > auvia0 at pci0 dev 17 function 5: VIA Technologies VT8237 AC'97 Audio (rev 0x60)
 > > auvia0: interrupting at ioapic0 pin 22
 > > auvia0: ac97: VIA Technologies VT1616i codec; headphone, 18 bit DAC, 18 bit ADC, KS Waves 3D
 > > auvia0: ac97: ext id 0x1c1<LDAC,SDAC,CDAC,VRA>
 > > audio0 at auvia0: playback, capture, full duplex, independent
 > > audio0: blksize not configured 23040 -> 512
 > > audio0: autoconfiguration error: configuring playback mode failed
 >
 > Would you try this patch?
 >
 > diff --git a/sys/dev/pci/auvia.c b/sys/dev/pci/auvia.c
 > index a80314177..954c4c8fa 100644
 > --- a/sys/dev/pci/auvia.c
 > +++ b/sys/dev/pci/auvia.c
 > @@ -749,8 +749,7 @@ auvia_round_blocksize(void *addr, int blk,
 >         if (sc->sc_flags & AUVIA_FLAGS_VT8233 && blk < 288)
 >                 blk = 288;
 >
 > -       /* Avoid too many dma_ops. */
 > -       return uimin((blk & -32), AUVIA_MINBLKSZ);
 > +       return (blk & -32);
 >  }
 >
 >  static int
 >
 > ---
 > Tetsuya Isaki <isaki@pastel-flower.jp / isaki@NetBSD.org>

From: "Tetsuya Isaki" <isaki@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/55017 CVS commit: src/sys/dev/pci
Date: Fri, 28 Feb 2020 13:31:03 +0000

 Module Name:	src
 Committed By:	isaki
 Date:		Fri Feb 28 13:31:03 UTC 2020

 Modified Files:
 	src/sys/dev/pci: auvia.c

 Log Message:
 Drop 512 bytes limit on auvia_round_blocksize().
 This fixes attach on 6 channels device.
 PR kern/55017.


 To generate a diff of this commit:
 cvs rdiff -u -r1.84 -r1.85 src/sys/dev/pci/auvia.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: Tetsuya Isaki <isaki@pastel-flower.jp>
To: Andrius V <vezhlys@gmail.com>
Cc: gnats-bugs@netbsd.org,
	kern-bug-people@netbsd.org,
	gnats-admin@netbsd.org,
	netbsd-bugs@netbsd.org
Subject: Re: kern/55017: audio0 autoconfiguration error on auvia
Date: Fri, 28 Feb 2020 22:39:07 +0900

 Hello,

 At Wed, 26 Feb 2020 20:29:18 +0200,
 Andrius V wrote:
 > Patch works:
 > 
 > auvia0 at pci0 dev 17 function 5: VIA Technologies VT8237 AC'97 Audio (rev 0x60)
 > allocated pic ioapic0 type level pin 22 level 7 to cpu0 slot 6 idt entry 112
 > auvia0: interrupting at ioapic0 pin 22
 > auvia0: ac97: VIA Technologies VT1616i codec; headphone, 18 bit DAC,
 > 18 bit ADC, KS Waves 3D
 > auvia0: ac97: ext id 0x1c1<LDAC,SDAC,CDAC,VRA>
 > audio0 at auvia0: playback, capture, full duplex, independent
 > audio0: slinear_le:16 6ch 48000Hz, blk 40ms for playback
 > audio0: slinear_le:16 2ch 48000Hz, blk 40ms for recording

 I've commited it (and will pullup -9 later).

 In 8.99.39 audio(4) has been changed to attach with the number of maximum
 channels that hardware supports.  But auvia(4) had following mismatch:
 - auvia_round_blocksize returns 512 bytes (in most case).
 - audio(4) layer requires that round_blocksize returns a multiple of
   framesize, (precision/8 * channels).
 This is not a problem for 2ch/4ch, but is a problem for 6ch.

 Thank you for reporting.
 ---
 Tetsuya Isaki <isaki@pastel-flower.jp / isaki@NetBSD.org>

From: Andrius V <vezhlys@gmail.com>
To: Tetsuya Isaki <isaki@pastel-flower.jp>
Cc: gnats-bugs@netbsd.org, kern-bug-people@netbsd.org, gnats-admin@netbsd.org, 
	netbsd-bugs@netbsd.org
Subject: Re: kern/55017: audio0 autoconfiguration error on auvia
Date: Sat, 29 Feb 2020 14:41:11 +0200

 --00000000000058341e059fb64561
 Content-Type: text/plain; charset="UTF-8"

 Thank you for the quick fix and detailed explanation.

 Regards,
 Andrius V

 On Fri, Feb 28, 2020, 15:39 Tetsuya Isaki <isaki@pastel-flower.jp> wrote:

 > Hello,
 >
 > At Wed, 26 Feb 2020 20:29:18 +0200,
 > Andrius V wrote:
 > > Patch works:
 > >
 > > auvia0 at pci0 dev 17 function 5: VIA Technologies VT8237 AC'97 Audio
 > (rev 0x60)
 > > allocated pic ioapic0 type level pin 22 level 7 to cpu0 slot 6 idt entry
 > 112
 > > auvia0: interrupting at ioapic0 pin 22
 > > auvia0: ac97: VIA Technologies VT1616i codec; headphone, 18 bit DAC,
 > > 18 bit ADC, KS Waves 3D
 > > auvia0: ac97: ext id 0x1c1<LDAC,SDAC,CDAC,VRA>
 > > audio0 at auvia0: playback, capture, full duplex, independent
 > > audio0: slinear_le:16 6ch 48000Hz, blk 40ms for playback
 > > audio0: slinear_le:16 2ch 48000Hz, blk 40ms for recording
 >
 > I've commited it (and will pullup -9 later).
 >
 > In 8.99.39 audio(4) has been changed to attach with the number of maximum
 > channels that hardware supports.  But auvia(4) had following mismatch:
 > - auvia_round_blocksize returns 512 bytes (in most case).
 > - audio(4) layer requires that round_blocksize returns a multiple of
 >   framesize, (precision/8 * channels).
 > This is not a problem for 2ch/4ch, but is a problem for 6ch.
 >
 > Thank you for reporting.
 > ---
 > Tetsuya Isaki <isaki@pastel-flower.jp / isaki@NetBSD.org>
 >

 --00000000000058341e059fb64561
 Content-Type: text/html; charset="UTF-8"
 Content-Transfer-Encoding: quoted-printable

 <div dir=3D"auto"><div>Thank you for the quick fix and detailed explanation=
 .</div><div dir=3D"auto"><br></div><div dir=3D"auto">Regards,</div><div dir=
 =3D"auto">Andrius V<br><br><div class=3D"gmail_quote" dir=3D"auto"><div dir=
 =3D"ltr" class=3D"gmail_attr">On Fri, Feb 28, 2020, 15:39 Tetsuya Isaki &lt=
 ;<a href=3D"mailto:isaki@pastel-flower.jp">isaki@pastel-flower.jp</a>&gt; w=
 rote:<br></div><blockquote class=3D"gmail_quote" style=3D"margin:0 0 0 .8ex=
 ;border-left:1px #ccc solid;padding-left:1ex">Hello,<br>
 <br>
 At Wed, 26 Feb 2020 20:29:18 +0200,<br>
 Andrius V wrote:<br>
 &gt; Patch works:<br>
 &gt; <br>
 &gt; auvia0 at pci0 dev 17 function 5: VIA Technologies VT8237 AC&#39;97 Au=
 dio (rev 0x60)<br>
 &gt; allocated pic ioapic0 type level pin 22 level 7 to cpu0 slot 6 idt ent=
 ry 112<br>
 &gt; auvia0: interrupting at ioapic0 pin 22<br>
 &gt; auvia0: ac97: VIA Technologies VT1616i codec; headphone, 18 bit DAC,<b=
 r>
 &gt; 18 bit ADC, KS Waves 3D<br>
 &gt; auvia0: ac97: ext id 0x1c1&lt;LDAC,SDAC,CDAC,VRA&gt;<br>
 &gt; audio0 at auvia0: playback, capture, full duplex, independent<br>
 &gt; audio0: slinear_le:16 6ch 48000Hz, blk 40ms for playback<br>
 &gt; audio0: slinear_le:16 2ch 48000Hz, blk 40ms for recording<br>
 <br>
 I&#39;ve commited it (and will pullup -9 later).<br>
 <br>
 In 8.99.39 audio(4) has been changed to attach with the number of maximum<b=
 r>
 channels that hardware supports.=C2=A0 But auvia(4) had following mismatch:=
 <br>
 - auvia_round_blocksize returns 512 bytes (in most case).<br>
 - audio(4) layer requires that round_blocksize returns a multiple of<br>
 =C2=A0 framesize, (precision/8 * channels).<br>
 This is not a problem for 2ch/4ch, but is a problem for 6ch.<br>
 <br>
 Thank you for reporting.<br>
 ---<br>
 Tetsuya Isaki &lt;<a href=3D"mailto:isaki@pastel-flower.jp" target=3D"_blan=
 k" rel=3D"noreferrer">isaki@pastel-flower.jp</a> / isaki@NetBSD.org&gt;<br>
 </blockquote></div></div></div>

 --00000000000058341e059fb64561--

Responsible-Changed-From-To: kern-bug-people->isaki
Responsible-Changed-By: isaki@NetBSD.org
Responsible-Changed-When: Thu, 19 Mar 2020 09:31:45 +0000
Responsible-Changed-Why:


State-Changed-From-To: open->pending-pullups
State-Changed-By: isaki@NetBSD.org
State-Changed-When: Thu, 19 Mar 2020 09:31:45 +0000
State-Changed-Why:
fixed in HEAD and filed netbsd-9 #792.


From: "Martin Husemann" <martin@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/55017 CVS commit: [netbsd-9] src/sys
Date: Sat, 21 Mar 2020 15:31:51 +0000

 Module Name:	src
 Committed By:	martin
 Date:		Sat Mar 21 15:31:51 UTC 2020

 Modified Files:
 	src/sys/arch/amiga/dev [netbsd-9]: aucc.c
 	src/sys/dev/pci [netbsd-9]: auacer.c auich.c auixp.c auvia.c
 	    gcscaudio.c
 	src/sys/dev/sbus [netbsd-9]: dbri.c

 Log Message:
 Pull up following revision(s) (requested by isaki in ticket #792):

 	sys/arch/amiga/dev/aucc.c: revision 1.48
 	sys/dev/pci/auixp.c: revision 1.49
 	sys/dev/pci/gcscaudio.c: revision 1.19
 	sys/dev/pci/auich.c: revision 1.159
 	sys/dev/sbus/dbri.c: revision 1.42
 	sys/dev/pci/auvia.c: revision 1.85
 	sys/dev/pci/auacer.c: revision 1.39

 Drop 512 bytes limit on auvia_round_blocksize().

 This fixes attach on 6 channels device.
 PR kern/55017.

 round_blocksize must return a multiple of the framesize.
 aucc(4) supports 3 channels mode.

 round_blocksize must return a multiple of the framesize
 even if passed blocksize is greater than the upper limit.

 round_blocksize must return a multiple of the framesize.

 It's not divisible when blk=GCSCAUDI_PRD_SIZE_MAX and channels=4.
 round_blocksize must return a multiple of the framesize
 even if 6 channels mode.

 I believe that keeping "good alignment" is just a wish, not constraint.


 To generate a diff of this commit:
 cvs rdiff -u -r1.46.2.1 -r1.46.2.2 src/sys/arch/amiga/dev/aucc.c
 cvs rdiff -u -r1.38 -r1.38.2.1 src/sys/dev/pci/auacer.c
 cvs rdiff -u -r1.157 -r1.157.2.1 src/sys/dev/pci/auich.c
 cvs rdiff -u -r1.47 -r1.47.2.1 src/sys/dev/pci/auixp.c
 cvs rdiff -u -r1.84 -r1.84.2.1 src/sys/dev/pci/auvia.c
 cvs rdiff -u -r1.18 -r1.18.2.1 src/sys/dev/pci/gcscaudio.c
 cvs rdiff -u -r1.41 -r1.41.2.1 src/sys/dev/sbus/dbri.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: pending-pullups->closed
State-Changed-By: isaki@NetBSD.org
State-Changed-When: Sun, 22 Mar 2020 03:57:31 +0000
State-Changed-Why:
pullup is done.
Thank you for reporting.


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.46 2020/01/03 16:35:01 leot Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2020 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.