[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: threads and audio read



On Sat, Nov 15, 2003 at 12:30:00PM -0800, Marco S Hyman wrote:
>  > 	I'm trying to port to openbsd a threaded application that reads 
>  > from audio device (ices2). Whenever application tries to read(2)
>  > sth from audio -pthread library changes read function to poll 
>  > ( it is what ktrace says ). But poll always fails ( data
>  > will be grabbed from a sound card when a real read is issued, 

I think I'm having a similar issue.  The program at
http://www.jakemsr.com/audio_grab.c works OK on it's own,
but when it's plugin for a threaded app, it blocks with
EINTR.

> The real problem is that poll always fails.   What type of sound card?
> dmesg please.

OpenBSD 3.6-current (GENERIC) #0: Wed Sep 22 20:10:14 PDT 2004
    jakemsr_(_at_)_puff_(_dot_)_jakemsr_(_dot_)_dom:/usr/src/sys/arch/i386/compile/GENERIC
cpu0: AMD Athlon(tm) XP 2500+ ("AuthenticAMD" 686-class) 1.84 GHz
cpu0: FPU,V86,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,MMX,FXSR,SSE
real mem  = 536387584 (523816K)
avail mem = 482398208 (471092K)
using 4278 buffers containing 26923008 bytes (26292K) of memory
mainbus0 (root)
bios0 at mainbus0: AT/286+(82) BIOS, date 09/24/03, BIOS32 rev. 0 @ 0xfa0e0
apm0 at bios0: Power Management spec V1.2
apm0: AC on, battery charge unknown
pcibios0 at bios0: rev 2.1 @ 0xf0000/0xc474
pcibios0: PCI IRQ Routing Table rev 1.0 @ 0xfc3c0/176 (9 entries)
pcibios0: PCI Exclusive IRQs: 5 10 11
pcibios0: PCI Interrupt Router at 000:17:0 ("VIA VT82C596A ISA" rev 0x00)
pcibios0: PCI bus #1 is the last bus
bios0: ROM list: 0xc0000/0x9400
cpu0 at mainbus0
pci0 at mainbus0 bus 0: configuration mode 1 (no bios)
pchb0 at pci0 dev 0 function 0 "VIA VT8377 PCI" rev 0x80
ppb0 at pci0 dev 1 function 0 "VIA VT8377 AGP" rev 0x00
pci1 at ppb0 bus 1
vga1 at pci1 dev 0 function 0 "Nvidia Vanta" rev 0x15
wsdisplay0 at vga1: console (80x25, vt100 emulation)
wsdisplay0: screen 1-5 added (80x25, vt100 emulation)
"AT&T/Lucent FW322 1394" rev 0x61 at pci0 dev 10 function 0 not configured
bktr0 at pci0 dev 11 function 0 "Brooktree BT878" rev 0x11: irq 11
bktr0: ATI TV-Wonder/VE, Philips NTSC tuner.
"Brooktree BT878 Audio" rev 0x11 at pci0 dev 11 function 1 not configured
emu0 at pci0 dev 13 function 0 "Creative Labs SoundBlaster Audigy" rev 0x03: irq 10
ac97: codec id 0x83847609 (SigmaTel STAC9721/23)
ac97: codec features 18 bit DAC, 18 bit ADC, SigmaTel 3D
audio0 at emu0
"Creative Labs SoundBlaster Audigy Digital Input" rev 0x03 at pci0 dev 13 function 1 not configured
uhci0 at pci0 dev 16 function 0 "VIA VT83C572 USB" rev 0x80: irq 5
usb0 at uhci0: USB revision 1.0
uhub0 at usb0
uhub0: VIA UHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub0: 2 ports with 2 removable, self powered
uhci1 at pci0 dev 16 function 1 "VIA VT83C572 USB" rev 0x80: irq 10
usb1 at uhci1: USB revision 1.0
uhub1 at usb1
uhub1: VIA UHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub1: 2 ports with 2 removable, self powered
uhci2 at pci0 dev 16 function 2 "VIA VT83C572 USB" rev 0x80: irq 11
usb2 at uhci2: USB revision 1.0
uhub2 at usb2
uhub2: VIA UHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub2: 2 ports with 2 removable, self powered
ehci0 at pci0 dev 16 function 3 "VIA VT6202 USB 2.0" rev 0x82: irq 11
ehci0: EHCI version 1.0
ehci0: companion controllers, 2 ports each: uhci0 uhci1 uhci2
usb3 at ehci0: USB revision 2.0
uhub3 at usb3
uhub3: VIA EHCI root hub, class 9/0, rev 2.00/1.00, addr 1
uhub3: 6 ports with 6 removable, self powered
pcib0 at pci0 dev 17 function 0 "VIA VT8235 ISA" rev 0x00
pciide0 at pci0 dev 17 function 1 "VIA VT82C571 IDE" rev 0x06: ATA133, channel 0 configured to compatibility, channel 1 configured to compatibility
wd0 at pciide0 channel 0 drive 1: <Maxtor 6Y080P0>
wd0: 16-sector PIO, LBA, 78166MB, 160084415 sectors
wd0(pciide0:0:1): using PIO mode 4, Ultra-DMA mode 6
atapiscsi0 at pciide0 channel 1 drive 0
scsibus0 at atapiscsi0: 2 targets
cd0 at scsibus0 targ 0 lun 0: <SONY, DVD RW DRU-510A, 1.0c> SCSI0 5/cdrom removable
cd0(pciide0:1:0): using PIO mode 4, Ultra-DMA mode 2
rl0 at pci0 dev 19 function 0 "Realtek 8139" rev 0x10: irq 11 address 00:0d:61:c1:58:0d
rlphy0 at rl0 phy 0: RTL internal phy
isa0 at pcib0
isadma0 at isa0
pckbc0 at isa0 port 0x60/5
pckbd0 at pckbc0 (kbd slot)
pckbc0: using irq 1 for kbd slot
wskbd0 at pckbd0: console keyboard, using wsdisplay0
pms0 at pckbc0 (aux slot)
pckbc0: using irq 12 for aux slot
wsmouse0 at pms0 mux 0
pcppi0 at isa0 port 0x61
midi0 at pcppi0: <PC speaker>
sysbeep0 at pcppi0
lpt0 at isa0 port 0x378/4 irq 7
it0 at isa0 port 0x290/8: IT87
npx0 at isa0 port 0xf0/16: using exception 16
pccom0 at isa0 port 0x3f8/8 irq 4: ns16550a, 16 byte fifo
pccom1 at isa0 port 0x2f8/8 irq 3: ns16550a, 16 byte fifo
fdc0 at isa0 port 0x3f0/6 irq 6 drq 2
fd0 at fdc0 drive 0: 1.44MB 80 cyl, 2 head, 18 sec
biomask ef65 netmask ef65 ttymask ffe7
pctr: user-level cycle counter enabled
mtrr: Pentium Pro MTRR support
dkcsum: wd0 matched BIOS disk 80
root on wd0a
rootdev=0x0 rrootdev=0x300 rawdev=0x302


yes, it's an unsupported card, but it shouldn't be that much
different than any other emu(4).  I will try an SBLive! later
as well.  I have no other supported PCI cards, and no ISA
ports.

Is it possible that the poll(2) call just times out too fast?
Would manually adding the poll(2) be a possible workaround?

Also, if I open /dev/audio with O_NONBLOCK in the threaded
app, open fails?

-- 
<jakemsr_(_at_)_jakemsr_(_dot_)_com>



Visit your host, monkey.org