From owner-freebsd-hackers@FreeBSD.ORG Sat Jul 24 12:03:27 2010 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6A548106566C; Sat, 24 Jul 2010 12:03:27 +0000 (UTC) (envelope-from xorquewasp@googlemail.com) Received: from mail-ey0-f182.google.com (mail-ey0-f182.google.com [209.85.215.182]) by mx1.freebsd.org (Postfix) with ESMTP id BBDDB8FC13; Sat, 24 Jul 2010 12:03:26 +0000 (UTC) Received: by eyh6 with SMTP id 6so241352eyh.13 for ; Sat, 24 Jul 2010 05:03:25 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:received:received:received:date:from:to:cc :subject:message-id:references:mime-version:content-type :content-disposition:in-reply-to; bh=fSoiYUfy03PihWQVCaXpJNm09c+PgA/AmBfSlcVyAXQ=; b=qgg4hy4xGGdMrbBwEqW2x/X3xnqYSYf7sE5FtOuJdxDGUeyq384GY+Q/CYAPQaC18z HIWIo3nAl7mOkFNrBhErpWTpCoZSvzUrg/fWGwDIaEXfPXpxEGnLi3QSX9LC3DvL/y0E IeuxaYgbzX4DL/MJKu9B1FQ3nCtN7GeNFOL0o= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=date:from:to:cc:subject:message-id:references:mime-version :content-type:content-disposition:in-reply-to; b=BuGhOsd/j6JHiGXddfZWqJLUBDRl//G89oZ8DPQw5+NVHeO/1Slojy/WTJVz+N8cRu K3Tt15PtwujerHaLpDPkc5H0n42ZH4gF9odQ78IZRopbe3DMfMRbEqY5WERpOtaXwNEG 17O4fJWUehPFjf8kIsMpwm3j7p6ehRqEp8uZg= Received: by 10.213.4.81 with SMTP id 17mr451624ebq.97.1279973005448; Sat, 24 Jul 2010 05:03:25 -0700 (PDT) Received: from viper.internal.network (dsl78-143-208-62.in-addr.fast.co.uk [78.143.208.62]) by mx.google.com with ESMTPS id v59sm2045290eeh.4.2010.07.24.05.03.23 (version=TLSv1/SSLv3 cipher=OTHER); Sat, 24 Jul 2010 05:03:24 -0700 (PDT) Received: by viper.internal.network (Postfix, from userid 11001) id 544FA4AC08; Sat, 24 Jul 2010 12:03:22 +0000 (UTC) Date: Sat, 24 Jul 2010 12:03:22 +0000 From: xorquewasp@googlemail.com To: Stanislav Sedov Message-ID: <20100724120322.GA76854@logik.internal.network> References: <20100707183935.GA24697@logik.internal.network> <20100707185848.GA53688@logik.internal.network> <20100709151544.GA42131@logik.internal.network> <20100722163256.24953414.stas@FreeBSD.org> <20100723185110.GB37045@logik.internal.network> <20100723131846.e7116b60.stas@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20100723131846.e7116b60.stas@FreeBSD.org> Cc: freebsd-hackers@freebsd.org Subject: Re: envy24 driver broken X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 24 Jul 2010 12:03:27 -0000 Ok, here's where I am with this. I'm currently using the Audiophile for the sake of simplicity (I'm assuming that if the Audiophile works properly, the Delta 66 probably will too). /dev/sndstat, at maximum verbosity, looks like: FreeBSD Audio Driver (newpcm: 64bit 2009061500/amd64) Installed devices: pcm0: at io 0xac00:32,0xa880:16,0xa800:16,0xa480:64 irq 17 [MPSAFE] (5p:1v/3r:1v channels duplex default) snddev flags=0x2e2 [pcm0:play:dsp0.p0]: spd 48000, fmt 0x00200010, flags 0x00002100, 0x00000004 interrupts 0, underruns 0, feed 0, ready 0 [b:16384/2048/8|bs:16384/8192/2] channel flags=0x2100 {userland} -> feeder_mixer(0x00200010) -> {hardware} [pcm0:play:dsp0.p1]: spd 8000, fmt 0x00100008, flags 0x00000000, 0x00000000 interrupts 0, underruns 0, feed 0, ready 0 [b:32768/16384/2|bs:0/0/0] channel flags=0x0 {userland} -> feeder_root(0x00000000) -> {hardware} [pcm0:play:dsp0.p2]: spd 8000, fmt 0x00100008, flags 0x00000000, 0x00000000 interrupts 0, underruns 0, feed 0, ready 0 [b:32768/16384/2|bs:0/0/0] channel flags=0x0 {userland} -> feeder_root(0x00000000) -> {hardware} [pcm0:play:dsp0.p3]: spd 8000, fmt 0x00100008, flags 0x00000000, 0x00000000 interrupts 0, underruns 0, feed 0, ready 0 [b:32768/16384/2|bs:0/0/0] channel flags=0x0 {userland} -> feeder_root(0x00000000) -> {hardware} [pcm0:play:dsp0.p4]: spd 8000, fmt 0x00100008, flags 0x00000000, 0x00000000 interrupts 0, underruns 0, feed 0, ready 0 [b:32768/16384/2|bs:0/0/0] channel flags=0x0 {userland} -> feeder_root(0x00000000) -> {hardware} pcm0:play:dsp0.p0[pcm0:virtual:dsp0.vp0]: spd 8000, fmt 0x00100008, flags 0x10000000, 0x00000000 interrupts 0, underruns 0, feed 0, ready 0 [b:0/0/0|bs:0/0/0] channel flags=0x10000000 {userland} -> feeder_root(0x00000000) -> {hardware} [pcm0:record:dsp0.r0]: spd 48000, fmt 0x00200010, flags 0x00002100, 0x00000005 interrupts 0, overruns 0, feed 0, hfree 16384, sfree 16384 [b:16384/2048/8|bs:16384/8192/2] channel flags=0x2100 {hardware} -> feeder_root(0x00200010) -> feeder_mixer(0x00200010) -> {userland} [pcm0:record:dsp0.r1]: spd 8000, fmt 0x00100008, flags 0x00000000, 0x00000000 interrupts 0, overruns 0, feed 0, hfree 32768, sfree 0 [b:32768/16384/2|bs:0/0/0] channel flags=0x0 {hardware} -> feeder_root(0x00000000) -> {userland} [pcm0:record:dsp0.r2]: spd 8000, fmt 0x00100008, flags 0x00000000, 0x00000000 interrupts 0, overruns 0, feed 0, hfree 32768, sfree 0 [b:32768/16384/2|bs:0/0/0] channel flags=0x0 {hardware} -> feeder_root(0x00000000) -> {userland} pcm0:record:dsp0.r0[pcm0:virtual:dsp0.vr0]: spd 8000, fmt 0x00100008, flags 0x10000000, 0x00000000 interrupts 0, overruns 0, feed 0, hfree 0, sfree 0 [b:0/0/0|bs:0/0/0] channel flags=0x10000000 {hardware} -> feeder_root(0x00000000) -> {userland} File Versions: $FreeBSD: src/sys/dev/sound/pci/envy24.c,v 1.17.2.1.2.1 2009/10/25 01:10:29 kensmith Exp $ $FreeBSD: src/sys/dev/sound/isa/sndbuf_dma.c,v 1.4.2.1.2.1 2009/10/25 01:10:29 kensmith Exp $ $FreeBSD: src/sys/dev/sound/pcm/feeder_format.c,v 1.1.2.1.2.1 2009/10/25 01:10:29 kensmith Exp $ $FreeBSD: src/sys/dev/sound/pcm/vchan.c,v 1.37.2.1.2.1 2009/10/25 01:10:29 kensmith Exp $ $FreeBSD: src/sys/dev/sound/pcm/sound.c,v 1.123.2.1.2.1 2009/10/25 01:10:29 kensmith Exp $ $FreeBSD: src/sys/dev/sound/pcm/feeder_eq.c,v 1.1.2.1.2.1 2009/10/25 01:10:29 kensmith Exp $ $FreeBSD: src/sys/dev/sound/pcm/feeder.c,v 1.45.2.1.2.1 2009/10/25 01:10:29 kensmith Exp $ $FreeBSD: src/sys/dev/sound/pcm/feeder_chain.c,v 1.1.2.1.2.1 2009/10/25 01:10:29 kensmith Exp $ $FreeBSD: src/sys/dev/sound/pcm/sndstat.c,v 1.29.2.1.2.1 2009/10/25 01:10:29 kensmith Exp $ $FreeBSD: src/sys/dev/sound/pcm/feeder_volume.c,v 1.7.2.1.2.1 2009/10/25 01:10:29 kensmith Exp $ $FreeBSD: src/sys/dev/sound/pcm/buffer.c,v 1.38.2.1.2.1 2009/10/25 01:10:29 kensmith Exp $ $FreeBSD: src/sys/dev/sound/pcm/mixer.c,v 1.66.2.1.2.1 2009/10/25 01:10:29 kensmith Exp $ $FreeBSD: src/sys/dev/sound/pcm/ac97_patch.c,v 1.12.2.1.2.1 2009/10/25 01:10:29 kensmith Exp $ $FreeBSD: src/sys/dev/sound/pcm/ac97.c,v 1.75.2.1.2.1 2009/10/25 01:10:29 kensmith Exp $ $FreeBSD: src/sys/dev/sound/pcm/dsp.c,v 1.114.2.1.2.1 2009/10/25 01:10:29 kensmith Exp $ $FreeBSD: src/sys/dev/sound/pcm/feeder_rate.c,v 1.29.2.1.2.1 2009/10/25 01:10:29 kensmith Exp $ $FreeBSD: src/sys/dev/sound/pcm/channel.c,v 1.124.2.1.2.1 2009/10/25 01:10:29 kensmith Exp $ $FreeBSD: src/sys/dev/sound/pcm/feeder_mixer.c,v 1.1.2.1.2.1 2009/10/25 01:10:29 kensmith Exp $ $FreeBSD: src/sys/dev/sound/pcm/feeder_matrix.c,v 1.1.2.1.2.1 2009/10/25 01:10:29 kensmith Exp $ The relevant part of dmesg: pcm0: port 0xac00-0xac1f,0xa880-0xa88f,0xa800-0xa80f,0xa480-0xa4bf irq 17 at device 6.0 on pci1 pcm0: [ITHREAD] pcm0: system configuration SubVendorID: 0x1412, SubDeviceID: 0xd634 XIN2 Clock Source: 22.5792MHz(44.1kHz*512) MPU-401 UART(s) #: 1 AC'97 codec: not exist ADC #: 1 DAC #: 1 Multi-track converter type: I2S(96KHz support, 24bit resolution, ID#0x2) S/PDIF(IN/OUT): 1/1 ID# 0x00 GPIO(mask/dir/state): 0x04/0xfb/0xfe Trying to use the mixer on anything other than the vol, pcm or line channels results in: $ mixer mic 100 Setting the mixer mic from 0:0 to 100:100. mixer: WRITE_MIXER: Device not configured Which is fair enough - if it doesn't have them, it doesn't have them. The card, however, doesn't seem to work in full duplex mode (pretty essential for "pro" audio work). As a test of full duplex capability, I'm using jackd from ports: $ /usr/local/bin/jackd -d oss jackd 0.116.2 Copyright 2001-2005 Paul Davis and others. jackd comes with ABSOLUTELY NO WARRANTY This is free software, and you are welcome to redistribute it under certain conditions; see the file COPYING for details JACK compiled with System V SHM support. loading driver .. oss_driver: /dev/dsp : 0x10/2/48000 (4096) oss_driver: indevbuf 4096 B, outdevbuf 4096 B oss_driver: not using barrier mode, (single thread) OSS: write() failed: oss_driver.c@1054, count=-1/4096, errno=22 Having spoken to the jackd developers at length whilst picking through the OSS backend source code, we came to the conclusion that this error (EINVAL) occurs because the envy24 driver can't work in full duplex mode (essential for jackd without the workaround below). The same problem occurs with the Delta 66. The EINVAL error occurs as soon as a jack client connects. Starting jackd with some flags to tell it not to open any inputs allows it to work (for a given value of "work"): $ /usr/local/bin/jackd -d oss -i 0 jackd 0.116.2 Copyright 2001-2005 Paul Davis and others. jackd comes with ABSOLUTELY NO WARRANTY This is free software, and you are welcome to redistribute it under certain conditions; see the file COPYING for details JACK compiled with System V SHM support. loading driver .. oss_driver: /dev/dsp : 0x10/2/48000 (4096) oss_driver: indevbuf 0 B, outdevbuf 4096 B oss_driver: not using barrier mode, (single thread) Using the card as a plain recording device (ie, reading from /dev/dsp) fails too. I can get audio output to my speakers writing to /dev/dsp I can only get an endless stream of 0x80 from any audio input: $ cat /dev/dsp0.0 | hd -v 00000000 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 |................| 00000010 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 |................| 00000020 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 |................| 00000030 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 |................| 00000040 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 |................| 00000050 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 |................| 00000060 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 80 |................| If you need any more information, please let me know. Regards, xw