Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 12 Jul 2008 15:57:18 GMT
From:      Martin Laabs <martin.laabs@mailbox.tu-dresden.de>
To:        freebsd-gnats-submit@FreeBSD.org
Subject:   ports/125542: audio/oss does not return propper SNDCTL_DSP_GETBLKSIZE size
Message-ID:  <200807121557.m6CFvIA3075503@www.freebsd.org>
Resent-Message-ID: <200807121600.m6CG04QW017804@freefall.freebsd.org>

next in thread | raw e-mail | index | archive | help

>Number:         125542
>Category:       ports
>Synopsis:       audio/oss does not return propper SNDCTL_DSP_GETBLKSIZE size
>Confidential:   no
>Severity:       non-critical
>Priority:       low
>Responsible:    freebsd-ports-bugs
>State:          open
>Quarter:        
>Keywords:       
>Date-Required:
>Class:          sw-bug
>Submitter-Id:   current-users
>Arrival-Date:   Sat Jul 12 16:00:03 UTC 2008
>Closed-Date:
>Last-Modified:
>Originator:     Martin Laabs
>Release:        7.0-RELEASE
>Organization:
>Environment:
FreeBSD martin.laabs 7.0-RELEASE FreeBSD 7.0-RELEASE #0: Sun Feb 24 19:59:52 UTC 2008     root@logan.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC  i386

>Description:
I'm using the "ich" OSS driver for my soundcard because the freebsd driver does not support changing the mic input to the auxiliary channel.
Now - many programs (i.e. xwave, teamspeak, skype) rely on the SNDCTL_DSP_GETBLKSIZE ioctl that is handled incorrect by the OSS-driver which returns an "Invalid argument" error. (At least the ich driver)

I attached my dmesg output and a little test program.

Thank you,
 Martin L.
>How-To-Repeat:
Install OSS and try the following test-program: (or try to use xwave for playback or recording)

#include <sys/ioctl.h>
#include <fcntl.h>
#include <sys/soundcard.h>
#include <stdio.h>
#include <errno.h>

main()
{
        int             audio;
        int             size = 0;
        int             ioctl_retval;

        audio = open("/dev/dsp", O_RDONLY);
        if (audio == -1)
                printf("open(\"/dev/dsp\",O_RDONLY): %s\n", strerror(errno));
        printf("audio: %d\n", audio);

        ioctl_retval = ioctl(audio, SNDCTL_DSP_GETBLKSIZE, &size);

        printf("SNDCTL_DSP_GETBLKSIZE: %i\n", size);
        if (ioctl_retval == -1)
                printf("ioctl(audio, SNDCTL_DSP_GETBLKSIZE, &size): %s\n", strer

        close(audio);
        return 0;
}

>Fix:
use the original sound_ich driver and forgo the features of the oss driver

Patch attached with submission follows:

Copyright (c) 1992-2008 The FreeBSD Project.
Copyright (c) 1979, 1980, 1983, 1986, 1988, 1989, 1991, 1992, 1993, 1994
	The Regents of the University of California. All rights reserved.
FreeBSD is a registered trademark of The FreeBSD Foundation.
FreeBSD 7.0-RELEASE #0: Sun Feb 24 19:59:52 UTC 2008
    root@logan.cse.buffalo.edu:/usr/obj/usr/src/sys/GENERIC
Timecounter "i8254" frequency 1193182 Hz quality 0
CPU: AMD Athlon(tm) XP 2400+ (1996.99-MHz 686-class CPU)
  Origin = "AuthenticAMD"  Id = 0x681  Stepping = 1
  Features=0x383fbff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,APIC,SEP,MTRR,PGE,MCA,CMOV,PAT,PSE36,MMX,FXSR,SSE>
  AMD Features=0xc0400800<SYSCALL,MMX+,3DNow!+,3DNow!>
real memory  = 805240832 (767 MB)
avail memory = 774074368 (738 MB)
mptable_probe: MP Config Table has bad signature: \^\
ACPI APIC Table: <Nvidia AWRDACPI>
ioapic0 <Version 1.1> irqs 0-23 on motherboard
kbd1 at kbdmux0
ath_hal: 0.9.20.3 (AR5210, AR5211, AR5212, RF5111, RF5112, RF2413, RF5413)
hptrr: HPT RocketRAID controller driver v1.1 (Feb 24 2008 19:59:27)
acpi0: <Nvidia AWRDACPI> on motherboard
acpi0: [ITHREAD]
acpi0: Power Button (fixed)
Timecounter "ACPI-fast" frequency 3579545 Hz quality 1000
acpi_timer0: <24-bit timer at 3.579545MHz> port 0x4008-0x400b on acpi0
cpu0: <ACPI CPU> on acpi0
acpi_button0: <Power Button> on acpi0
pcib0: <ACPI Host-PCI bridge> port 0xcf8-0xcff on acpi0
pci0: <ACPI PCI bus> on pcib0
Correcting nForce2 C1 CPU disconnect hangs
agp0: <NVIDIA nForce2 AGP Controller> on hostb0
pci0: <memory, RAM> at device 0.1 (no driver attached)
pci0: <memory, RAM> at device 0.2 (no driver attached)
pci0: <memory, RAM> at device 0.3 (no driver attached)
pci0: <memory, RAM> at device 0.4 (no driver attached)
pci0: <memory, RAM> at device 0.5 (no driver attached)
isab0: <PCI-ISA bridge> at device 1.0 on pci0
isa0: <ISA bus> on isab0
pci0: <serial bus, SMBus> at device 1.1 (no driver attached)
ohci0: <OHCI (generic) USB controller> mem 0xed080000-0xed080fff irq 20 at device 2.0 on pci0
ohci0: [GIANT-LOCKED]
ohci0: [ITHREAD]
usb0: OHCI version 1.0, legacy support
usb0: <OHCI (generic) USB controller> on ohci0
usb0: USB revision 1.0
uhub0: <nVidia OHCI root hub, class 9/0, rev 1.00/1.00, addr 1> on usb0
uhub0: 3 ports with 3 removable, self powered
ohci1: <OHCI (generic) USB controller> mem 0xed082000-0xed082fff irq 21 at device 2.1 on pci0
ohci1: [GIANT-LOCKED]
ohci1: [ITHREAD]
usb1: OHCI version 1.0, legacy support
usb1: <OHCI (generic) USB controller> on ohci1
usb1: USB revision 1.0
uhub1: <nVidia OHCI root hub, class 9/0, rev 1.00/1.00, addr 1> on usb1
uhub1: 3 ports with 3 removable, self powered
ehci0: <NVIDIA nForce2 USB 2.0 controller> mem 0xed083000-0xed0830ff irq 22 at device 2.2 on pci0
ehci0: [GIANT-LOCKED]
ehci0: [ITHREAD]
usb2: EHCI version 1.0
usb2: companion controllers, 4 ports each: usb0 usb1
usb2: <NVIDIA nForce2 USB 2.0 controller> on ehci0
usb2: USB revision 2.0
uhub2: <nVidia EHCI root hub, class 9/0, rev 2.00/1.00, addr 1> on usb2
uhub2: 6 ports with 6 removable, self powered
nfe0: <NVIDIA nForce2 MCP2 Networking Adapter> port 0xe000-0xe007 mem 0xed084000-0xed084fff irq 20 at device 4.0 on pci0
miibus0: <MII bus> on nfe0
rlphy0: <RTL8201L 10/100 media interface> PHY 1 on miibus0
rlphy0:  10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
nfe0: Ethernet address: 00:e0:18:d5:26:29
nfe0: [FILTER]
pci0: <multimedia, audio> at device 5.0 (no driver attached)
pci0: <multimedia, audio> at device 6.0 (no driver attached)
pcib1: <ACPI PCI-PCI bridge> at device 8.0 on pci0
pci1: <ACPI PCI bus> on pcib1
pci1: <network> at device 8.0 (no driver attached)
pci1: <simple comms, generic modem> at device 9.0 (no driver attached)
atapci0: <nVidia nForce2 UDMA133 controller> port 0x1f0-0x1f7,0x3f6,0x170-0x177,0x376,0xf000-0xf00f at device 9.0 on pci0
ata0: <ATA channel 0> on atapci0
ata0: [ITHREAD]
ata1: <ATA channel 1> on atapci0
ata1: [ITHREAD]
pcib2: <ACPI PCI-PCI bridge> at device 30.0 on pci0
pci2: <ACPI PCI bus> on pcib2
vgapci0: <VGA-compatible display> mem 0xea000000-0xeaffffff,0xe0000000-0xe7ffffff irq 19 at device 0.0 on pci2
fdc0: <floppy drive controller> port 0x3f0-0x3f5,0x3f7 irq 6 drq 2 on acpi0
fdc0: [FILTER]
fd0: <1440-KB 3.5" drive> on fdc0 drive 0
sio0: <16550A-compatible COM port> port 0x3f8-0x3ff irq 4 flags 0x10 on acpi0
sio0: type 16550A
sio0: [FILTER]
atkbdc0: <Keyboard controller (i8042)> port 0x60,0x64 irq 1 on acpi0
atkbd0: <AT Keyboard> irq 1 on atkbdc0
kbd0 at atkbd0
atkbd0: [GIANT-LOCKED]
atkbd0: [ITHREAD]
psm0: <PS/2 Mouse> irq 12 on atkbdc0
psm0: [GIANT-LOCKED]
psm0: [ITHREAD]
psm0: model IntelliMouse, device ID 3
pmtimer0 on isa0
orm0: <ISA Option ROM> at iomem 0xd0000-0xd17ff pnpid ORM0000 on isa0
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/16 bytes threshold
ppbus0: <Parallel port bus> on ppc0
ppbus0: [ITHREAD]
plip0: <PLIP network interface> on ppbus0
lpt0: <Printer> on ppbus0
lpt0: Interrupt-driven port
ppi0: <Parallel I/O> on ppbus0
ppc0: [GIANT-LOCKED]
ppc0: [ITHREAD]
sc0: <System console> at flags 0x100 on isa0
sc0: VGA <16 virtual consoles, flags=0x300>
sio1: configured irq 3 not in bitmap of probed irqs 0
sio1: port may not be enabled
vga0: <Generic ISA VGA> at port 0x3c0-0x3df iomem 0xa0000-0xbffff on isa0
umass0: <ICneric USB Storage Device, class 0/0, rev 1.10/1.00, addr 2> on uhub0
umass1: <WEM USB 1.1 5 in 1 Card Reader/Writer Multi Panel 5.25", class 0/0, rev 1.10/0.12, addr 2> on uhub1
Timecounter "TSC" frequency 1996991677 Hz quality 800
Timecounters tick every 1.000 msec
hptrr: no controller detected.
ad0: 76319MB <Seagate ST380021A 3.19> at ata0-master UDMA100
ad1: 76319MB <SAMSUNG SP0842N BH900-41> at ata0-slave UDMA133
acd0: DVDR <Optiarc DVD RW AD-7170A/1.04> at ata1-master UDMA66
GEOM_LABEL: Label for provider ad0s2a is label/Home.
GEOM_LABEL: Label for provider ad1s2a is label/Media.
da0 at umass-sim0 bus 0 target 0 lun 0
da0: <IC USB Storage-CFC 322E> Removable Direct Access SCSI-0 device 
da0: 1.000MB/s transfers
da0: Attempt to query device size failed: NOT READY, Medium not present
da4 at umass-sim1 bus 1 target 0 lun 0
da4: <WEM 5 in 1 Card ReCF 1.00> Removable Direct Access SCSI-0 device 
da4: 1.000MB/s transfers
da4: Attempt to query device size failed: NOT READY, Medium not present
da1 at umass-sim0 bus 0 target 0 lun 1
da1: <IC USB Storage-SMC 322E> Removable Direct Access SCSI-0 device 
da1: 1.000MB/s transfers
da1: Attempt to query device size failed: NOT READY, Medium not present
da5 at umass-sim1 bus 1 target 0 lun 1
da5: <WEM 5 in 1 Card ReMS 1.00> Removable Direct Access SCSI-0 device 
da5: 1.000MB/s transfers
da5: Attempt to query device size failed: NOT READY, Medium not present
da2 at umass-sim0 bus 0 target 0 lun 2
da2: <IC USB Storage-MMC 322E> Removable Direct Access SCSI-0 device 
da2: 1.000MB/s transfers
da2: Attempt to query device size failed: NOT READY, Medium not present
da6 at umass-sim1 bus 1 target 0 lun 2
da6: <WEM 5 in 1 CarMMC/SD 1.00> Removable Direct Access SCSI-0 device 
da6: 1.000MB/s transfers
da6: Attempt to query device size failed: NOT READY, Medium not present
da3 at umass-sim0 bus 0 target 0 lun 3
da3: <IC USB Storage-MSC 322E> Removable Direct Access SCSI-0 device 
da3: 1.000MB/s transfers
da3: Attempt to query device size failed: NOT READY, Medium not present
Trying to mount root from ufs:/dev/ad1s1a
fuse4bsd: version 0.3.9-pre1, FUSE ABI 7.8
pcm0: <nVidia nForce2> port 0xe400-0xe4ff,0xe800-0xe87f mem 0xed081000-0xed081fff irq 22 at device 6.0 on pci0
pcm0: [ITHREAD]
pcm0: <Avance Logic ALC650 AC97 Codec>
pcm0: detached
ich0: [ITHREAD]
ich0: <Nvidia nForce2> port 0xe400-0xe4ff,0xe800-0xe87f mem 0xed081000-0xed081fff irq 22 at device 6.0 on pci0
ich0: detached
pcm0: <nVidia nForce2> port 0xe400-0xe4ff,0xe800-0xe87f mem 0xed081000-0xed081fff irq 22 at device 6.0 on pci0
pcm0: [ITHREAD]
pcm0: <Avance Logic ALC650 AC97 Codec>
pcm0: detached
pcm0: <nVidia nForce2> port 0xe400-0xe4ff,0xe800-0xe87f mem 0xed081000-0xed081fff irq 22 at device 6.0 on pci0
pcm0: [ITHREAD]
pcm0: <Avance Logic ALC650 AC97 Codec>
kldunload: attempt to unload file that was loaded by the kernel
pcm0: detached
ich0: [ITHREAD]
ich0: <Nvidia nForce2> port 0xe400-0xe4ff,0xe800-0xe87f mem 0xed081000-0xed081fff irq 22 at device 6.0 on pci0
ich0: detached
pcm0: <nVidia nForce2> port 0xe400-0xe4ff,0xe800-0xe87f mem 0xed081000-0xed081fff irq 22 at device 6.0 on pci0
pcm0: [ITHREAD]
pcm0: <Avance Logic ALC650 AC97 Codec>
pcm0: detached
ich0: [ITHREAD]
ich0: <Nvidia nForce2> port 0xe400-0xe4ff,0xe800-0xe87f mem 0xed081000-0xed081fff irq 22 at device 6.0 on pci0
ich0: detached
ich0: [ITHREAD]
ich0: <Nvidia nForce2> port 0xe400-0xe4ff,0xe800-0xe87f mem 0xed081000-0xed081fff irq 22 at device 6.0 on pci0
ich0: detached
ich0: [ITHREAD]
ich0: <Nvidia nForce2> port 0xe400-0xe4ff,0xe800-0xe87f mem 0xed081000-0xed081fff irq 22 at device 6.0 on pci0
ich0: detached
ich0: [ITHREAD]
ich0: <Nvidia nForce2> port 0xe400-0xe4ff,0xe800-0xe87f mem 0xed081000-0xed081fff irq 22 at device 6.0 on pci0



>Release-Note:
>Audit-Trail:
>Unformatted:



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200807121557.m6CFvIA3075503>