From nobody@FreeBSD.org  Fri Oct 21 12:55:40 2005
Return-Path: <nobody@FreeBSD.org>
Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125])
	by hub.freebsd.org (Postfix) with ESMTP id 8493216A41F
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 21 Oct 2005 12:55:40 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (www.freebsd.org [216.136.204.117])
	by mx1.FreeBSD.org (Postfix) with ESMTP id 2921543DA1
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 21 Oct 2005 12:55:40 +0000 (GMT)
	(envelope-from nobody@FreeBSD.org)
Received: from www.freebsd.org (localhost [127.0.0.1])
	by www.freebsd.org (8.13.1/8.13.1) with ESMTP id j9LCtdvS058769
	for <freebsd-gnats-submit@FreeBSD.org>; Fri, 21 Oct 2005 12:55:39 GMT
	(envelope-from nobody@www.freebsd.org)
Received: (from nobody@localhost)
	by www.freebsd.org (8.13.1/8.13.1/Submit) id j9LCtde2058768;
	Fri, 21 Oct 2005 12:55:39 GMT
	(envelope-from nobody)
Message-Id: <200510211255.j9LCtde2058768@www.freebsd.org>
Date: Fri, 21 Oct 2005 12:55:39 GMT
From: "Jos M. Fandio" <freebsd@fadesa.es>
To: freebsd-gnats-submit@FreeBSD.org
Subject: snd_t4dwave and pcm0:record:0: record interrupt timeout, channel dead 
X-Send-Pr-Version: www-2.3

>Number:         87782
>Category:       kern
>Synopsis:       [sound] snd_t4dwave and pcm0:record:0: record interrupt timeout, channel dead
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-multimedia
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Fri Oct 21 13:00:23 GMT 2005
>Closed-Date:    
>Last-Modified:  Sat Apr 14 09:10:12 UTC 2012
>Originator:     Jos M. Fandio
>Release:        FreeBSD 5-stable
>Organization:
particular
>Environment:
FreeBSD 5.4-STABLE #0: Mon Oct 10 14:37:58 CEST 2005 with GENERIC kernel
>Description:
Each time I use the snd_t4dwave for recording I get the following error:
pcm0:record:0: record interrupt timeout, channel dead

pcm0: <Acer Labs M5451> port 0x1800-0x18ff mem 0xe0000000-0xe0000fff irq 11 at device 6.0 on pci0
pcm0: <Cirrus Logic CS4299 AC97 Codec>
>How-To-Repeat:
dd if=/dev/audio of=foo
pcm0:record:0: record interrupt timeout, channel dead
0+0 records in
0+0 records out
0 bytes transferred in 0.999230 secs (0 bytes/sec)
>Fix:
              
>Release-Note:
>Audit-Trail:
Responsible-Changed-From-To: freebsd-bugs->freebsd-multimedia 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Fri Oct 21 16:35:38 GMT 2005 
Responsible-Changed-Why:  
Over to maintainer(s). 

http://www.freebsd.org/cgi/query-pr.cgi?pr=87782 

From: Marian Cerny <jojo@matfyz.cz>
To: bug-followup@FreeBSD.org, freebsd@fadesa.es
Cc:  
Subject: Re: kern/87782: [sound] snd_t4dwave and pcm0:record:0: record interrupt timeout, channel dead
Date: Mon, 21 Nov 2005 16:29:00 +0100

 I have the same problem on FreeBSD 5.4-RELEASE-p1.
 
 # dmesg | grep pcm
 pcm0: <Acer Labs M5451> port 0x8400-0x84ff mem 0xf0011000-0xf0011fff irq 5 at device 8.0 on pci0
 pcm0: <Analog Devices AD1886A AC97 Codec>
 pcm0:record:0: record interrupt timeout, channel dead
 
 -- 
 Marian Cerny <jojo@matfyz.cz>

From: Marian Cerny <jojo@matfyz.cz>
To: bug-followup@FreeBSD.org
Cc:  
Subject: Re: kern/87782: [sound] snd_t4dwave and pcm0:record:0: record interrupt
 timeout, channel dead
Date: Sun, 08 Nov 2009 01:56:32 +0100

 This is a multi-part message in MIME format.
 --------------090104070104060404070603
 Content-Type: text/plain; charset=ISO-8859-1; format=flowed
 Content-Transfer-Encoding: 7bit
 
 I don't have the hardware available, so I can't reproduce this problem 
 any more. I am forwarding some old follow-ups on freebsd-multimedia, so 
 that they are noted in GNATS.
 
 Regards,
 
 Marian
 
 
 -------- Original Message --------
 Date: 	Wed, 11 Oct 2006 10:18:18 +0900
 From: 	Pyun YongHyeon
 To: 	Anish Mistry
 CC: 	freebsd-multimedia@freebsd.org, Marian Cerny
 
 
 On Tue, Oct 10, 2006 at 03:59:20PM -0400, Anish Mistry wrote:
   >  On Tuesday 10 October 2006 03:16, Pyun YongHyeon wrote:
   >  >  On Sat, Oct 07, 2006 at 04:52:02PM -0400, Anish Mistry wrote:
   >  >   >  On Monday 21 November 2005 10:30, Marian Cerny wrote:
   >  >   >  >  The following reply was made to PR kern/87782; it has been
   >  >   >  >  noted by GNATS.
   >  >   >  >
   >  >   >  >  From: Marian Cerny<jojo@matfyz.cz>
   >  >   >  >  To: bug-followup@FreeBSD.org, freebsd@fadesa.es
   >  >   >  >  Cc:
   >  >   >  >  Subject: Re: kern/87782: [sound] snd_t4dwave and
   >  >   >  >  pcm0:record:0: record interrupt timeout, channel dead Date:
   >  >   >  >  Mon, 21 Nov 2005 16:29:00 +0100
   >  >   >  >
   >  >   >  >   I have the same problem on FreeBSD 5.4-RELEASE-p1.
   >  >   >  >
   >  >   >  >   # dmesg | grep pcm
   >  >   >  >   pcm0:<Acer Labs M5451>  port 0x8400-0x84ff mem
   >  >   >  >  0xf0011000-0xf0011fff irq 5 at device 8.0 on pci0 pcm0:
   >  >   >  >  <Analog Devices AD1886A AC97 Codec>
   >  >   >  >   pcm0:record:0: record interrupt timeout, channel dead
   >  >   >
   >  >   >  pcm0:<Acer Labs M5451>  port 0x1000-0x10ff mem
   >  >   >  0xfc101000-0xfc101fff irq 9 at device 4.0 on pci0
   >  >   >  pcm0:<SigmaTel STAC9756/57 AC97 Codec>
   >  >   >  pcm0:<Acer Labs M5451>  at io 0x1000 irq 9 kld snd_t4dwave
   >  >   >  (4p/1r/1v channels duplex default)
   >  >   >
   >  >   >  I'm still seeing this with -CURRENT.  I can give access to
   >  >   >  someone if they need access.
   >  >
   >  >  Hmm... I think I've posted a possible fix log time ago but got no
   >  >  reply. Would you please try attached patch?
   >  >  If it work for you I'll make complete patch.
   >  The patch does not work.  I don't see the channel dead message when
   >  using wmrecord, but the app sort of hangs (I can stop the recording,
   >  but the timer doesn't advance) and doesn't record anything.  There
   >  seems to be data in the wav file but it isn't playable.  Attached.
   >
 
 Did recording ever work on your M5451?
 I have no idea why t4dwave(4) still uses legacy capturing mode(Sound
 Blaster compatible mode). It seems that M5451 support code lacks codec
 initialization. So I guess its ADC part was not activated.
 Try attached patch and let me know the result.
 
 -- 
 Regards,
 Pyun YongHyeon
 
 
 --------------090104070104060404070603
 Content-Type: text/plain;
  name="t4dwave.diff2"
 Content-Transfer-Encoding: 7bit
 Content-Disposition: attachment;
  filename="t4dwave.diff2"
 
 --- t4dwave.c.orig	Tue Mar  1 17:58:05 2005
 +++ t4dwave.c	Wed Oct 11 09:57:42 2006
 @@ -93,6 +93,7 @@
  
  	struct mtx *lock;
  
 +	u_int32_t numchans;
  	u_int32_t playchns;
  	unsigned int bufsz;
  
 @@ -725,7 +726,7 @@
  	intsrc = tr_rd(tr, TR_REG_MISCINT, 4);
  	if (intsrc & TR_INT_ADDR) {
  		chnum = 0;
 -		while (chnum < 64) {
 +		while (chnum < tr->numchans) {
  			mask = 0x00000001;
  			active = tr_rd(tr, (chnum < 32)? TR_REG_ADDRINTA : TR_REG_ADDRINTB, 4);
  			bufhalf = tr_rd(tr, (chnum < 32)? TR_REG_CSPF_A : TR_REG_CSPF_B, 4);
 @@ -773,6 +774,7 @@
  		tr_wr(tr, SPA_REG_CODECST, SPA_RST_OFF, 4);
  		break;
  	case TDX_PCI_ID:
 +	case ALI_PCI_ID:
  		tr_wr(tr, TDX_REG_CODECST, TDX_CDC_ON, 4);
  		break;
  	case TNX_PCI_ID:
 @@ -846,6 +848,10 @@
  		device_printf(dev, "unable to initialize the card\n");
  		goto bad;
  	}
 +	if (tr->type == ALI_PCI_ID)
 +		tr->numchans = 32;
 +	else
 +		tr->numchans = 64;
  	tr->playchns = 0;
  
  	codec = AC97_CREATE(dev, tr, tr_ac97);
 
 
 --------------090104070104060404070603--

From: Gildor Oronar <gildororonar@mail-on.us>
To: bug-followup@FreeBSD.org, freebsd@fadesa.es
Cc:  
Subject: Re: kern/87782: [sound] snd_t4dwave and pcm0:record:0: record interrupt
 timeout, channel dead
Date: Sat, 14 Apr 2012 16:42:32 +0800

 I have the same error message but on playback. Device is SiS 7018.
 
 [zhangweiwu@lugdunnum ~]$ dmesg | tail
 ath0: <Atheros 5212> irq 11 at device 0.0 on cardbus0
 ath0: AR5212 mac 5.9 RF5112 phy 4.3
 uhub0: 3 ports with 3 removable, self powered
 uhub1: 3 ports with 3 removable, self powered
 Trying to mount root from ufs:/dev/ada0s2a [rw]...
 wlan0: Ethernet address: 00:40:96:ae:79:d3
 drm0: <SiS 630> on vgapci0
 info: [drm] AGP at 0xe0000000 64MB
 info: [drm] Initialized sis 1.3.0 20070626
 pcm0: chn_write(): pcm0:play:dsp0.p1: play interrupt timeout, channel dead
 
 
 Note the last line of error message is only after playback for about 3
 seconds. The first 3 seconds playback fine though, with any software
 (tried mpg321 and xine -A oss).
 
 Since the patch you offered no longer can apply, I did the minimum
 change on t4dwave.c and compiled a new kernel, tried, without luck (same
 error mssage). What I did is:
 
 @@ -725,7 +726,7 @@
  	intsrc = tr_rd(tr, TR_REG_MISCINT, 4);
  	if (intsrc & TR_INT_ADDR) {
  		chnum = 0;
 -		while (chnum < 64) {
 +		while (chnum < 32) {
  			mask = 0x00000001;
  			active = tr_rd(tr, (chnum < 32)? TR_REG_ADDRINTA : TR_REG_ADDRINTB, 4);
  			bufhalf = tr_rd(tr, (chnum < 32)? TR
 
 
 Looking at the source code the problem triggered by "while (chnum < 64)"
 should have been fixed already, thus this bug should be closed, mine is
 probably a different one.
 
 Anything to try for me?
 
>Unformatted:
