On Aug 18 07:59:17, a...@caoua.org wrote:
> On Tue, Aug 17, 2021 at 03:31:55PM +0200, Jan Stary wrote:
> > This is current/amd64 on an older PC (full dmesg below)
> > using an ESI Wave Terminal 192M attaching as
> > 
> > envy0 at pci4 dev 4 function 0 "IC Ensemble Envy24PT/HT Audio" rev 0x01: 
> > apic 2 int 20
> > envy0: unknown 1724-based card, 2 inputs, 8 outputs
> > audio0 at envy0
> > midi0 at envy0: <Envy24 MIDI UART>
> > 
> > This is what audioctl and mixerctl show
> > as the exposed controls:
> > 
> > # audioctl
> > name=envy0
> > mode=
> > pause=1
> > active=0
> > nblks=4
> > blksz=480
> > rate=48000
> > encoding=s24le4msb
> > play.channels=8
> > play.bytes=0
> > play.errors=0
> > record.channels=2
> > record.bytes=0
> > record.errors=0
> > 
> > # mixerctl -av
> > outputs.line-0_source=play-0  [ line-0 line-1 play-0 ]
> > outputs.line-1_source=play-1  [ line-0 line-1 play-1 ]
> > outputs.line-2_source=play-2  [ line-0 line-1 play-2 ]
> > outputs.line-3_source=play-3  [ line-0 line-1 play-3 ]
> > outputs.line-4_source=play-4  [ line-0 line-1 play-4 ]
> > outputs.line-5_source=play-5  [ line-0 line-1 play-5 ]
> > outputs.line-6_source=play-6  [ line-0 line-1 play-6 ]
> > outputs.line-7_source=play-7  [ line-0 line-1 play-7 ]
> > record.enable=sysctl  [ off on sysctl ]
> > 
> > Is this expected? With other audio devices
> > I usualy also see some mixer and volume controls.
> > 
> > 
> > I am seeing timeouts with both recording and playback:
> > 
> >     $ aucat -o file.wav
> >     $ default: audio device gone, stopping
> > 
> >     $ aucat -i file.wav
> >     $ default: audio device gone, stopping
> > 
> > While this happens, dmesg says:
> > 
> >     envy0: output DMA halt timeout
> >     envy0: input DMA halt timeout
> >     envy0: output DMA halt timeout
> >     envy0: input DMA halt timeout
> > 
> > How can I help debug this?
> > 
> 
> Hi,
> 
> You could start by enabling ENVY_DEBUG option rebuild kernel and see
> if you get additional information.

Thanks for the hint - full dmesg of current cvs GENERIC.MP
with option ENVY_DEBUG below (plus a pcidump of the device).
This is the dmesg diff w.r.t. envy:

 envy0 at pci4 dev 4 function 0 "IC Ensemble Envy24PT/HT Audio" rev 0x01: apic 
2 int 20
 envy0: unknown 1724-based card, 2 inputs, 8 outputs
+envy0: eeprom:  36 53 49 36 78 78 78 78 45 47 4f 53 59 53 ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff
+envy0: gpio_mask = ffff53
+envy0: gpio_dir = 59534f
+envy0: gpio_state = 600bc
 audio0 at envy0
+envy0: allocated 65536 bytes dir=1, ka=0xffff8000224da000, da=a0a3000
+envy0: allocated 65536 bytes dir=2, ka=0xffff8000224ea000, da=a0b3000
 midi0 at envy0: <Envy24 MIDI UART>


When playing a trivial file (created with sox -n file.wav synth 1),
via aucat -i file.wav, there don't seem to be any extra messages
besides the

        $ aucat -i file.wav  
        default: audio device gone, stopping

at the command line (as previously) and

        envy0: output DMA halt timeout
        envy0: input DMA halt timeout
        envy0: output DMA halt timeout
        envy0: input DMA halt timeout

in the device messages (as previously).

FWIW, this is a script of sndiod -ddd during the aucat play:

snd0 pst=cfg.default: rec=0:1 play=0:1 vol=32768 dup
snd1 pst=cfg.default: rec=0:1 play=0:1 vol=32768 dup
snd2 pst=cfg.default: rec=0:1 play=0:1 vol=32768 dup
snd3 pst=cfg.default: rec=0:1 play=0:1 vol=32768 dup
helper(helper|ini): created
worker(worker|ini): created
listen(/tmp/sndio/sock0|ini): created
sock(sock|ini): created
helper: recv: cmd = 0, num = 0, idx = 0, mode = 3, fd = -1
helper: send: cmd = 3, num = 0, idx = 0, mode = 0, fd = 3
helper: recv: cmd = 2, num = 0, idx = 0, mode = 768, fd = -1
helper: send: cmd = 3, num = 0, idx = 0, mode = 0, fd = 3
sock,rmsg,widl: AUTH message
sock,rmsg,widl: HELLO message
sock,rmsg,widl: hello from <aucat>, mode = 1, ver 7
app/aucat0.level=127 at 1 -> slot_level:aucat0: added
snd0 pst=cfg: device requested
snd0 pst=cfg: trying rsnd/0
worker: send: cmd = 0, num = 0, idx = 0, mode = 3, fd = -1
worker: recv: cmd = 3, num = 0, idx = 0, mode = 0, fd = 6
worker: send: cmd = 2, num = 0, idx = 0, mode = 768, fd = -1
worker: recv: cmd = 3, num = 0, idx = 0, mode = 0, fd = 7
snd0 pst=cfg: using rsnd/0
sio(dev|ini): created
sioctl(mix|ini): created
snd0 pst=cfg: software master level control enabled
0/output.level=127 at 2 -> dev_master:0: added
dec: s24le4msb, 2 channels
enc: s24le4msb, 8 channels
snd0 pst=cfg: 48000Hz, s24le4msb, play 0:7, rec 0:1, 4 blocks of 480 frames
aucat0 vol=127,pst=ini: using snd0 pst=ini.default, mode = 1
aucat0 vol=127,pst=ini,rmsg,widl: SETPAR message
aucat0 vol=127,pst=ini,rmsg,widl: playback channels 0:0 -> 0:1
aucat0 vol=127,pst=ini,rmsg,widl: 48000Hz sample rate, 480 frame blocks
aucat0 vol=127,pst=ini,rmsg,widl: 9600 frame buffer
aucat0 vol=127,pst=ini,rmsg,widl: GETPAR message
aucat0 vol=127,pst=ini,rmsg,widl: GETPAR message
aucat0 vol=127,pst=ini,rmsg,widl: START message
aucat0 vol=127,pst=ini: playing s16le -> s24le4msb
aucat0 vol=127,pst=ini: allocated 9600/11520 fr buffers
aucat0 vol=127,pst=sta: 48000Hz, s16le, play 0:0, 20 blocks of 480 frames
aucat0 vol=127,pst=sta,rmsg,widl: building SETVOL message, vol = 127
cmap: nch = 1, ostart = 0, onext = 7, istart = 0, inext = 0
snd0 pst=ini: device started
snd0 pst=run: started
aucat0 vol=127,pst=rdy: attached at -1920 + 0/480
aucat0 vol=127,pst=rdy: set weight: 32768/32768
snd0 pst=run: watchdog timeout
aucat0 vol=127,pst=run,rmsg,widl: exit
aucat0 vol=127,pst=run,rmsg,widl: closing
aucat0 vol=127,pst=run: stopping
aucat0 vol=127,pst=run: detached at -1920 + 0/480
aucat0 vol=127,pst=ini: zomb_eof
deleting non-empty buffer, used = 19200
snd0 pst=run: device released
sock(sock|zom): destroyed
snd0 pst=cfg: closed
sio(dev|zom): destroyed
sioctl(mix|zom): destroyed
snd0 pst=cfg: closing
0/output.level=127 at 2 -> dev_master:0: removed
^Cworker(worker|zom): destroyed
listen(/tmp/sndio/sock0|zom): destroyed
snd0 pst=cfg: draining
snd1 pst=cfg: draining
snd2 pst=cfg: draining
snd3 pst=cfg: draining
nothing to do...
snd0 pst=cfg: deleting
snd1 pst=cfg: deleting
snd2 pst=cfg: deleting
snd3 pst=cfg: deleting

> The "DMA halt timeout" errors probably indicate that DMA never
> started, which is very strange. You can check this by writing zeros to
> /dev/audio1 and see if there are interrupts (ex. with "systat
> vmstat").  No interrupts indicates DMA didn't start.

I have audio0, not audio1; is that a typo?

Anyway, in systat vmstat, I don't even see envy0 (or audio0)
among the Interrupts that break down the total. According to the manpage,
this means there were no interrupts on the device:

         Only devices that have interrupted at least once
         since boot time are shown.

(On other machines where I have working audio,
I see e.g. azalia0 with interrupts there.)

> Basically, these cards have an Envy chip which is the interface to the
> PCI bus and handles DMA and interrupts. The Envy chip is connected to
> one or more DACs and/or ADCs (or to a complete AC97-style codec). The
> Envy chip simply reads data from hosts memory and sends it to the DAC.
> 
> For sound to work ADC/DACs may need to be configured; this is done
> either by setting GPIO pins or sending few bytes through a I2C link.

Are the "envy0: gpio" lines in the dmesg any help in that?

> As your card is not known by OpenBSD driver, the code for ADC/DAC
> initialization is missing. You can figure-out what ADC/DAC your card
> is using by looking at the ICs on the board (the big one is the Envy
> chip, aka ICExxxx, the other big one(s) are the ADC/DAC), then google
> for the corresponding datasheets

This is the board itself:
http://stare.cz/.tmp/esi-waveterminal-192M.jpg                           
I am sorry, the actual circuits are a bit
above my nearly nonexistent EE skills.

If anyone is interested, I can donate the device
- please let me know.

        Jan

> The interesting part in your dmesg is that DMA doesn't seem to start,
> I thought DMA would start even if the ADC/DAC is not initialized, but
> I may be wrong.



OpenBSD 7.0-beta (GENERIC.MP) #0: Wed Aug 18 16:20:19 CEST 2021
    h...@usb.stare.cz:/usr/src/sys/arch/amd64/compile/GENERIC.MP
real mem = 4242145280 (4045MB)
avail mem = 4097634304 (3907MB)
random: good seed from bootblocks
mpath0 at root
scsibus0 at mpath0: 256 targets
mainbus0 at root
bios0 at mainbus0: SMBIOS rev. 2.6 @ 0xfccb0 (23 entries)
bios0: vendor American Megatrends Inc. version "5.13" date 03/03/2010
bios0: Hewlett-Packard Compaq 500B Microtower
acpi0 at bios0: ACPI 3.0
acpi0: sleep states S0 S1 S3 S4 S5
acpi0: tables DSDT FACP APIC MCFG OEMB HPET GSCI SSDT
acpi0: wakeup devices P0P2(S4) P0P3(S4) P0P1(S4) MC97(S4) P0P4(S4) P0P5(S4) 
P0P6(S4) P0P7(S4) LAN1(S1) P0P8(S4) P0P9(S4) USB0(S3) USB1(S3) USB2(S3) 
USB3(S3) EUSB(S3)
acpitimer0 at acpi0: 3579545 Hz, 24 bits
acpimadt0 at acpi0 addr 0xfee00000: PC-AT compat
cpu0 at mainbus0: apid 0 (boot processor)
cpu0: Intel(R) Core(TM)2 Duo CPU E7500 @ 2.93GHz, 4107.04 MHz, 06-17-0a
cpu0: 
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,DTES64,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,SSE4.1,XSAVE,NXE,LONG,LAHF,PERF,SENSOR,MELTDOWN
cpu0: 3MB 64b/line 8-way L2 cache
cpu0: smt 0, core 0, package 0
mtrr: Pentium Pro MTRR support, 8 var ranges, 88 fixed ranges
cpu0: apic clock running at 266MHz
cpu0: mwait min=64, max=64, C-substates=0.2.2.2.2, IBE
cpu1 at mainbus0: apid 1 (application processor)
cpu1: Intel(R) Core(TM)2 Duo CPU E7500 @ 2.93GHz, 2933.34 MHz, 06-17-0a
cpu1: 
FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,CFLUSH,DS,ACPI,MMX,FXSR,SSE,SSE2,SS,HTT,TM,PBE,SSE3,DTES64,MWAIT,DS-CPL,VMX,EST,TM2,SSSE3,CX16,xTPR,PDCM,SSE4.1,XSAVE,NXE,LONG,LAHF,PERF,SENSOR,MELTDOWN
cpu1: 3MB 64b/line 8-way L2 cache
cpu1: smt 0, core 1, package 0
ioapic0 at mainbus0: apid 2 pa 0xfec00000, version 20, 24 pins, remapped
acpimcfg0 at acpi0
acpimcfg0: addr 0xe0000000, bus 0-255
acpihpet0 at acpi0: 14318179 Hz
acpiprt0 at acpi0: bus 0 (PCI0)
acpiprt1 at acpi0: bus 4 (P0P1)
acpiprt2 at acpi0: bus 2 (P0P4)
acpiprt3 at acpi0: bus 3 (P0P5)
acpiprt4 at acpi0: bus -1 (P0P6)
acpiprt5 at acpi0: bus -1 (P0P7)
acpiprt6 at acpi0: bus -1 (P0P8)
acpiprt7 at acpi0: bus -1 (P0P9)
acpipci0 at acpi0 PCI0: 0x00000010 0x00000011 0x00000000
acpicmos0 at acpi0
acpibtn0 at acpi0: PWRB
acpicpu0 at acpi0
acpi0: SSDT checksum error: C1(@1 halt!), PSS
acpicpu1 at acpi0: C1(@1 halt!), PSS
cpu0: Enhanced SpeedStep 4107 MHz: speeds: 2936, 2670, 2403, 2136, 1870, 1603 
MHz
pci0 at mainbus0 bus 0
pchb0 at pci0 dev 0 function 0 "Intel G41 Host" rev 0x03
ppb0 at pci0 dev 1 function 0 "Intel G45 PCIE" rev 0x03: msi
pci1 at ppb0 bus 1
nvme0 at pci1 dev 0 function 0 "Toshiba NVMe" rev 0x01: msix, NVMe 1.2
nvme0: KBG30ZMV128G TOSHIBA, firmware ADHA0102, serial 29OPC7NPPZWP
scsibus1 at nvme0: 2 targets, initiator 0
sd0 at scsibus1 targ 1 lun 0: <NVMe, KBG30ZMV128G TOS, ADHA>
sd0: 122104MB, 512 bytes/sector, 250069680 sectors
inteldrm0 at pci0 dev 2 function 0 "Intel G41 Video" rev 0x03
drm0 at inteldrm0
intagp0 at inteldrm0
agp0 at intagp0: aperture at 0xd0000000, size 0x10000000
inteldrm0: apic 2 int 16, G45, gen 4
ppb1 at pci0 dev 28 function 0 "Intel 82801GB PCIE" rev 0x01: msi
pci2 at ppb1 bus 2
ppb2 at pci0 dev 28 function 1 "Intel 82801GB PCIE" rev 0x01: msi
pci3 at ppb2 bus 3
re0 at pci3 dev 0 function 0 "Realtek 8101E" rev 0x02: RTL8102EL (0x2480), msi, 
address d8:d3:85:7f:58:94
rlphy0 at re0 phy 7: RTL8201L 10/100 PHY, rev. 1
uhci0 at pci0 dev 29 function 0 "Intel 82801GB USB" rev 0x01: apic 2 int 23
uhci1 at pci0 dev 29 function 1 "Intel 82801GB USB" rev 0x01: apic 2 int 19
uhci2 at pci0 dev 29 function 2 "Intel 82801GB USB" rev 0x01: apic 2 int 18
uhci3 at pci0 dev 29 function 3 "Intel 82801GB USB" rev 0x01: apic 2 int 16
ehci0 at pci0 dev 29 function 7 "Intel 82801GB USB" rev 0x01: apic 2 int 23
usb0 at ehci0: USB revision 2.0
uhub0 at usb0 configuration 1 interface 0 "Intel EHCI root hub" rev 2.00/1.00 
addr 1
ppb3 at pci0 dev 30 function 0 "Intel 82801BA Hub-to-PCI" rev 0xe1
pci4 at ppb3 bus 4
envy0 at pci4 dev 4 function 0 "IC Ensemble Envy24PT/HT Audio" rev 0x01: apic 2 
int 20
envy0: unknown 1724-based card, 2 inputs, 8 outputs
envy0: eeprom:  36 53 49 36 78 78 78 78 45 47 4f 53 59 53 ff ff ff ff ff ff ff 
ff ff ff ff ff ff ff ff ff ff ff
envy0: gpio_mask = ffff53
envy0: gpio_dir = 59534f
envy0: gpio_state = 600bc
audio0 at envy0
envy0: allocated 65536 bytes dir=1, ka=0xffff8000224da000, da=a0a3000
envy0: allocated 65536 bytes dir=2, ka=0xffff8000224ea000, da=a0b3000
midi0 at envy0: <Envy24 MIDI UART>
pcib0 at pci0 dev 31 function 0 "Intel 82801GB LPC" rev 0x01
pciide0 at pci0 dev 31 function 1 "Intel 82801GB IDE" rev 0x01: DMA, channel 0 
configured to compatibility, channel 1 configured to compatibility
pciide0: channel 0 disabled (no drives)
pciide0: channel 1 disabled (no drives)
pciide1 at pci0 dev 31 function 2 "Intel 82801GB SATA" rev 0x01: DMA, channel 0 
configured to native-PCI, channel 1 configured to native-PCI
pciide1: using apic 2 int 19 for native-PCI interrupt
wd0 at pciide1 channel 0 drive 0: <WDC WD5000AAKX-001CA0>
wd0: 16-sector PIO, LBA48, 476940MB, 976773168 sectors
atapiscsi0 at pciide1 channel 0 drive 1
scsibus2 at atapiscsi0: 2 targets
cd0 at scsibus2 targ 0 lun 0: <hp, DVD-RAM GH40L, RB12> removable
wd0(pciide1:0:0): using PIO mode 4, Ultra-DMA mode 6
cd0(pciide1:0:1): using PIO mode 4, Ultra-DMA mode 5
ichiic0 at pci0 dev 31 function 3 "Intel 82801GB SMBus" rev 0x01: apic 2 int 19
iic0 at ichiic0
spdmem0 at iic0 addr 0x50: 2GB DDR3 SDRAM PC3-10600
spdmem1 at iic0 addr 0x52: 2GB DDR3 SDRAM PC3-10600
usb1 at uhci0: USB revision 1.0
uhub1 at usb1 configuration 1 interface 0 "Intel UHCI root hub" rev 1.00/1.00 
addr 1
usb2 at uhci1: USB revision 1.0
uhub2 at usb2 configuration 1 interface 0 "Intel UHCI root hub" rev 1.00/1.00 
addr 1
usb3 at uhci2: USB revision 1.0
uhub3 at usb3 configuration 1 interface 0 "Intel UHCI root hub" rev 1.00/1.00 
addr 1
usb4 at uhci3: USB revision 1.0
uhub4 at usb4 configuration 1 interface 0 "Intel UHCI root hub" rev 1.00/1.00 
addr 1
isa0 at pcib0
isadma0 at isa0
pckbc0 at isa0 port 0x60/5 irq 1 irq 12
pckbd0 at pckbc0 (kbd slot)
wskbd0 at pckbd0: console keyboard
pcppi0 at isa0 port 0x61
spkr0 at pcppi0
it0 at isa0 port 0x2e/2: IT8720F rev 5, EC port 0xa10
dt: 445 probes
umass0 at uhub0 port 6 configuration 1 interface 0 "Generic Mass Storage" rev 
2.00/1.00 addr 2
umass0: using SCSI over Bulk-Only
scsibus3 at umass0: 2 targets, initiator 0
sd1 at scsibus3 targ 1 lun 0: <Generic, Flash Disk, 8.07> removable
sd1: 7680MB, 512 bytes/sector, 15728640 sectors
umass1 at uhub0 port 7 configuration 1 interface 0 "Generic USB 2.0 Reader" rev 
2.00/58.88 addr 3
umass1: using SCSI over Bulk-Only
scsibus4 at umass1: 2 targets, initiator 0
sd2 at scsibus4 targ 1 lun 0: <Generic-, Multi-Card, 1.00> removable
uhidev0 at uhub2 port 1 configuration 1 interface 0 "Logitech USB-PS/2 Optical 
Mouse" rev 2.00/11.10 addr 2
uhidev0: iclass 3/1
ums0 at uhidev0: 3 buttons, Z dir
wsmouse0 at ums0 mux 0
uhidev1 at uhub2 port 2 configuration 1 interface 0 "vendor 0x173d product 
0x0004" rev 1.10/1.50 addr 3
uhidev1: iclass 3/1
ukbd0 at uhidev1: 8 variable keys, 6 key codes
wskbd1 at ukbd0 mux 1
uhidev2 at uhub2 port 2 configuration 1 interface 1 "vendor 0x173d product 
0x0004" rev 1.10/1.50 addr 3
uhidev2: iclass 3/0, 3 report ids
uhid0 at uhidev2 reportid 1: input=3, output=0, feature=0
uhid1 at uhidev2 reportid 2: input=1, output=0, feature=0
uhid2 at uhidev2 reportid 3: input=2, output=0, feature=0
vscsi0 at root
scsibus5 at vscsi0: 256 targets
softraid0 at root
scsibus6 at softraid0: 256 targets
root on sd1a (bef4f0e18a4b8ac8.a) swap on sd1b dump on sd1b
inteldrm0: 1680x1050, 32bpp
wsdisplay0 at inteldrm0 mux 1: console (std, vt100 emulation), using wskbd0
wskbd1: connecting to wsdisplay0
wsdisplay0: screen 1-5 added (std, vt100 emulation)



 4:4:0: IC Ensemble Envy24PT/HT Audio
        0x0000: Vendor ID: 1412, Product ID: 1724
        0x0004: Command: 0005, Status: 0210
        0x0008: Class: 04 Multimedia, Subclass: 01 Audio,
                Interface: 00, Revision: 01
        0x000c: BIST: 00, Header Type: 00, Latency Timer: 40,
                Cache Line Size: 00
        0x0010: BAR io addr: 0x0000ec00/0x0020
        0x0014: BAR io addr: 0x0000e880/0x0080
        0x0018: BAR empty (00000000)
        0x001c: BAR empty (00000000)
        0x0020: BAR empty (00000000)
        0x0024: BAR empty (00000000)
        0x0028: Cardbus CIS: 00000000
        0x002c: Subsystem Vendor ID: 4936 Product ID: 4553
        0x0030: Expansion ROM Base Address: 00000000
        0x0038: 00000000
        0x003c: Interrupt Pin: 01 Line: 0a Min Gnt: 00 Max Lat: 00
        0x0080: Capability 0x01: Power Management
                State: D0
        0x0000: 17241412 02100005 04010001 00004000
        0x0010: 0000ec01 0000e881 00000000 00000000
        0x0020: 00000000 00000000 00000000 45534936
        0x0030: 00000000 00000080 00000000 0000010a
        0x0040: 00000000 00000000 00000000 00000000
        0x0050: 00000000 00000000 00000000 00000000
        0x0060: 00000000 00000000 00000000 00000000
        0x0070: 00000000 00000000 00000000 00000000
        0x0080: 04010001 00000000 00000000 00000000
        0x0090: 00000000 00000000 00000000 00000000
        0x00a0: 00000000 00000000 00000000 00000000
        0x00b0: 00000000 00000000 00000000 00000000
        0x00c0: 00000000 00000000 00000000 00000000
        0x00d0: 00000000 00000000 00000000 00000000
        0x00e0: 00000000 00000000 00000000 00000000
        0x00f0: 00000000 00000000 00000000 00000000
        0x0100: ffffffff ffffffff ffffffff ffffffff
        0x0110: ffffffff ffffffff ffffffff ffffffff
        [...]

Reply via email to