From mreimer@bilbo.vpop.net  Tue Feb  8 10:13:43 2000
Return-Path: <mreimer@bilbo.vpop.net>
Received: from bilbo.vpop.net (bilbo.vpop.net [216.160.82.65])
	by builder.freebsd.org (Postfix) with ESMTP id E2364403F
	for <FreeBSD-gnats-submit@freebsd.org>; Tue,  8 Feb 2000 10:13:28 -0800 (PST)
Received: (from mreimer@localhost)
	by bilbo.vpop.net (8.9.3/8.9.3) id KAA00903;
	Tue, 8 Feb 2000 10:14:20 -0800 (PST)
	(envelope-from mreimer)
Message-Id: <200002081814.KAA00903@bilbo.vpop.net>
Date: Tue, 8 Feb 2000 10:14:20 -0800 (PST)
From: mreimer@vpop.net
Sender: mreimer@bilbo.vpop.net
Reply-To: mreimer@vpop.net
To: FreeBSD-gnats-submit@freebsd.org
Subject: Can't record with newpcm & CS4236 (AW35/Pro)
X-Send-Pr-Version: 3.2

>Number:         16587
>Category:       kern
>Synopsis:       [sound] [patch] Can't record with newpcm & CS4236 (AW35/Pro)
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    sound
>State:          closed
>Quarter:        
>Keywords:       
>Date-Required:  
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Tue Feb  8 10:20:00 PST 2000
>Closed-Date:    Tue Jun 14 15:00:29 GMT 2005
>Last-Modified:  Tue Jun 14 15:00:29 GMT 2005
>Originator:     Matthew Reimer
>Release:        FreeBSD 4.0-CURRENT i386
>Organization:
VPOP Technologies, Inc.
>Environment:

---------------------

cat /dev/sndstat 
FreeBSD Audio Driver (newpcm) Feb  4 2000 14:51:04
Installed devices:
pcm0: <CS423x> at io 0x534 irq 5 drq 1:0 (1p/1r channels duplex)

---------------------

FreeBSD 4.0-CURRENT #0: Fri Feb  4 14:52:00 PST 2000
    mreimer@bilbo.vpop.net:/usr/src/sys/compile/BILBO
Timecounter "i8254"  frequency 1193182 Hz
CPU: Pentium III/Pentium III Xeon (451.02-MHz 686-class CPU)
  Origin = "GenuineIntel"  Id = 0x673  Stepping = 3
  Features=0x383f9ff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,SEP,MTRR,PGE,MCA,CMOV,PA
T,PSE36,MMX,FXSR,XMM>
real memory  = 134205440 (131060K bytes)
avail memory = 126857216 (123884K bytes)
Preloaded elf kernel "kernel" at 0xc0316000.
Pentium Pro MTRR support enabled
npx0: <math processor> on motherboard
npx0: INT 16 interface
apm0: <APM BIOS> on motherboard
apm: found APM BIOS v1.2, connected at v1.2
pcib0: <Intel 82443BX (440 BX) host to PCI bridge> on motherboard
pci0: <PCI bus> on pcib0
pcib1: <Intel 82443BX (440 BX) PCI-PCI (AGP) bridge> at device 1.0 on pci0
pci1: <PCI bus> on pcib1
vga-pci0: <NVidia Riva TNT2 graphics accelerator> mem 0xe2000000-0xe3ffffff,0xe0
000000-0xe0ffffff irq 11 at device 0.0 on pci1
isab0: <Intel 82371AB PCI to ISA bridge> at device 4.0 on pci0
isa0: <ISA bus> on isab0
ata-pci0: <Intel PIIX4 ATA-33 controller> port 0xd800-0xd80f at device 4.1 on pc
i0
ata0 at 0x01f0 irq 14 on ata-pci0
ata1 at 0x0170 irq 15 on ata-pci0
pci0: Intel 82371AB/EB (PIIX4) USB controller (vendor=0x8086, dev=0x7112) at 4.2
 irq 10
chip1: <Intel 82371AB Power management controller> port 0xe800-0xe80f at device 
4.3 on pci0
xl0: <3Com 3c905B-TX Fast Etherlink XL> port 0xd000-0xd07f mem 0xdf800000-0xdf80
007f irq 10 at device 9.0 on pci0
xl0: Ethernet address: 00:10:5a:ab:87:55
miibus0: <MII bus> on xl0
xlphy0: <3Com internal media interface> on miibus0
xlphy0:  10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
fdc0: <NEC 72065B or clone> at port 0x3f0-0x3f5,0x3f7 irq 6 drq 2 on isa0
fdc0: FIFO enabled, 8 bytes threshold
fd0: <1440-KB 3.5" drive> on fdc0 drive 0
atkbdc0: <keyboard controller (i8042)> at port 0x60-0x6f on isa0
atkbd0: <AT Keyboard> irq 1 on atkbdc0
psm0: <PS/2 Mouse> irq 12 on atkbdc0
psm0: model MouseMan+, device ID 0
vga0: <Generic ISA VGA> at port 0x3c0-0x3df iomem 0xa0000-0xbffff on isa0
sc0: <System console> on isa0
sc0: VGA <16 virtual consoles, flags=0x200>
sio0 at port 0x3f8-0x3ff irq 4 flags 0x10 on isa0
sio0: type 16550A
sio1 at port 0x2f8-0x2ff irq 3 on isa0
sio1: type 16550A
ppc0: <Parallel port> at port 0x378-0x37f irq 7 on isa0
ppc0: SMC-like chipset (ECP/EPP/PS2/NIBBLE) in COMPATIBLE mode
ppc0: FIFO with 16/16/9 bytes threshold
ppi0: <Parallel I/O> on ppbus0
lpt0: <Printer> on ppbus0
lpt0: Interrupt-driven port
pcm0: <CS423x> at port 0x534-0x537,0x388-0x38f,0x220-0x22f irq 5 drq 1,0 on isa0
joy0: <CSC0001 PnP Joystick> at port 0x200-0x207 on isa0
unknown0: <CTRL> at port 0x120-0x127 on isa0
unknown1: <MPU> at port 0x330-0x331 irq 9 on isa0
IPsec: Initialized Security Association Processing.
ad0: 8223MB <ST38422A> [16708/16/63] at ata0-master using UDMA33
acd0: CDROM <ATAPI 44X CDROM> at ata1-master using PIO4
Mounting root from ufs:/dev/ad0s1a

---------------------

pnpinfo:

Card assigned CSN #1
Vendor ID CSCd937 (0x37d9630e), Serial Number 0xffffffff
PnP Version 1.0, Vendor Version 1
Device Description: AW35/Pro (Resource R2.2-D7)

Logical Device ID: CSC0000 0x0000630e #0
Device Description: WSS/SB
TAG Start DF
Good Configuration
    DMA: channel(s) 1 
        8-bit, not a bus master, count by byte, , Type A
    DMA: channel(s) 0 3 
        8-bit, not a bus master, count by byte, , Type A
    IRQ: 5  - only one type (true/edge)
    I/O Range 0x534 .. 0x534, alignment 0x4, len 0x4
        [16-bit addr]
    I/O Range 0x388 .. 0x388, alignment 0x8, len 0x8
        [16-bit addr]
    I/O Range 0x220 .. 0x220, alignment 0x20, len 0x10
        [16-bit addr]
TAG Start DF
Acceptable Configuration
    DMA: channel(s) 1 3 
        8-bit, not a bus master, count by byte, , Type A
    DMA: channel(s) 0 1 3 
        8-bit, not a bus master, count by byte, , Type A
    IRQ: 5 7 9 11 12 15  - only one type (true/edge)
    I/O Range 0x534 .. 0xffc, alignment 0x4, len 0x4
        [16-bit addr]
    I/O Range 0x388 .. 0x388, alignment 0x8, len 0x8
        [16-bit addr]
    I/O Range 0x220 .. 0x260, alignment 0x20, len 0x10
        [16-bit addr]
TAG Start DF
Sub-optimal Configuration
    DMA: channel(s) 0 1 3 
        8-bit, not a bus master, count by byte, , Type A
    IRQ: 5 7 9 11 12 15  - only one type (true/edge)
    I/O Range 0x534 .. 0xffc, alignment 0x4, len 0x4
        [16-bit addr]
    I/O Range 0x388 .. 0x3f8, alignment 0x8, len 0x8
        [16-bit addr]
    I/O Range 0x220 .. 0x300, alignment 0x20, len 0x10
        [16-bit addr]
TAG End DF

Logical Device ID: CSC0001 0x0100630e #1
Device Description: GAME
TAG Start DF
Good Configuration
    I/O Range 0x200 .. 0x200, alignment 0x8, len 0x8
        [16-bit addr]
TAG Start DF
Acceptable Configuration
    I/O Range 0x208 .. 0x208, alignment 0x8, len 0x8
        [16-bit addr]
TAG End DF

Logical Device ID: CSC0010 0x1000630e #2
Device Description: CTRL
    I/O Range 0x120 .. 0xff8, alignment 0x8, len 0x8
        [16-bit addr]

Logical Device ID: CSC0003 0x0300630e #3
Device Description: MPU
TAG Start DF
Good Configuration
    IRQ: 9  - only one type (true/edge)
    I/O Range 0x330 .. 0x330, alignment 0x8, len 0x2
        [16-bit addr]
TAG Start DF
Acceptable Configuration
    IRQ: 9 11 12 15  - only one type (true/edge)
    I/O Range 0x330 .. 0x360, alignment 0x8, len 0x2
        [16-bit addr]
TAG Start DF
Sub-optimal Configuration
    I/O Range 0x330 .. 0x3e0, alignment 0x8, len 0x2
        [16-bit addr]
TAG End DF
End Tag

Successfully got 46 resources, 4 logical fdevs
-- card select # 0x0001

CSN CSCd937 (0x37d9630e), Serial Number 0xffffffff

Logical device #0
IO:  0x0534 0x0534 0x0534 0x0534 0x0534 0x0534 0x0534 0x0534
IRQ 5 0
DMA 1 0
IO range check 0x00 activate 0x01

Logical device #1
IO:  0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000
IRQ 0 0
DMA 4 4
IO range check 0x00 activate 0x01

Logical device #2
IO:  0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000
IRQ 0 0
DMA 4 4
IO range check 0x00 activate 0x01

Logical device #3
IO:  0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000 0x0000
IRQ 9 0
DMA 4 4
IO range check 0x00 activate 0x01

------------------

>Description:

	With my Acer AW35/Pro (CS4236) and -current I can play sound
just fine, but I can't record. (Recording and full duplex worked fine with
3.4-stable.)

When I run

	rec -c 1 -f s -r 44100 -s w test.wav

rec just sits, blocked in pcmrd, and rec can't be interrupted with ctl-c. The output file test.wav never increases in size, always remaining 0 bytes long.

My kernel config file has "device pcm".

Any ideas?

Matt


>How-To-Repeat:

	Try to record anything; e.g.

		rec -c 1 -f s -r 44100 -s w test.wav

>Fix:

	


>Release-Note:
>Audit-Trail:

From: Matthew Reimer <mreimer@vpop.net>
To: freebsd-gnats-submit@FreeBSD.org, mreimer@vpop.net
Cc:  
Subject: Re: kern/16587: Can't record with newpcm & CS4236 (AW35/Pro)
Date: Wed, 23 Feb 2000 11:13:22 -0800

 Partial fix: the following patch correctly configures the card for dual
 channel DMA. The problem was that the SDC bit (0x04) can only be set in
 the MCE state.
 
 So now recording doesn't hang, and data is returned, but the recorded
 sound doesn't sound right when played back. Anybody?
 
 --- mss.c.orig  Wed Feb 23 11:04:23 2000
 +++ mss.c       Fri Jan 28 16:18:28 2000
 @@ -92,8 +92,6 @@
  static int             ad_read(struct mss_info *mss, int reg);
  static void            ad_write(struct mss_info *mss, int reg, u_char
 data);
  static void            ad_write_cnt(struct mss_info *mss, int reg,
 u_short data
 -static void            ad_enter_MCE(struct mss_info *mss);
 -static void            ad_leave_MCE(struct mss_info *mss);
 
  /* io primitives */
  static void            conf_wr(struct mss_info *mss, u_char reg, u_char
 data); 
 @@ -467,9 +465,7 @@
         }
         if (FULL_DUPLEX(mss) && mss->bd_id != MD_OPTI931)
                 ad_write(mss, 12, ad_read(mss, 12) | 0x40); /* mode 2 */
 -       ad_enter_MCE(mss);
         ad_write(mss, 9, FULL_DUPLEX(mss)? 0 : 4);
 -       ad_leave_MCE(mss);
         ad_write(mss, 10, 2); /* int enable */
         io_wr(mss, MSS_STATUS, 0); /* Clear interrupt status */
         /* the following seem required on the CS4232 */
 

From: Matthew Reimer <mreimer@vpop.net>
To: freebsd-gnats-submit@FreeBSD.org, mreimer@vpop.net
Cc:  
Subject: Re: kern/16587: Can't record with newpcm & CS4236 (AW35/Pro)
Date: Mon, 20 Mar 2000 11:52:21 -0800

 Whoops, that patch was reversed.
 
 Elucidation on how recording doesn't work properly: when playing back
 the recorded sample, there is a short burst of what sounds like static
 and then silence.
 
Responsible-Changed-From-To: freebsd-bugs->cg 
Responsible-Changed-By: adrian 
Responsible-Changed-When: Tue Mar 28 07:59:55 PST 2000 
Responsible-Changed-Why:  
Over to the maintainer 
Responsible-Changed-From-To: cg->sound 
Responsible-Changed-By: linimon 
Responsible-Changed-When: Thu Sep 9 19:29:52 GMT 2004 
Responsible-Changed-Why:  
With permission, reassign to mailing list alias. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=16587 
State-Changed-From-To: open->closed 
State-Changed-By: arved 
State-Changed-When: Tue Jun 14 14:59:37 GMT 2005 
State-Changed-Why:  
Committed by cg 5 years ago. 

http://www.freebsd.org/cgi/query-pr.cgi?pr=16587 
>Unformatted:
