From owner-freebsd-multimedia@FreeBSD.ORG Fri Feb 4 02:27:56 2005 Return-Path: Delivered-To: freebsd-multimedia@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id C49BD16A4CE for ; Fri, 4 Feb 2005 02:27:56 +0000 (GMT) Received: from dastardly.newsbastards.org.72.27.172.IN-addr.ARPA.NOSPAM.dyndns.dk (84-72-30-141.dclient.hispeed.ch [84.72.30.141]) by mx1.FreeBSD.org (Postfix) with ESMTP id C8A8843D1D for ; Fri, 4 Feb 2005 02:27:54 +0000 (GMT) (envelope-from bounce@NOSPAM.dyndns.dk) Received: from Mail.NOSPAM.DynDNS.dK (ipv6.NOSPAM.dyndns.dk [IPv6:2002:5448:1e8d:0:206:28ff:fed8:8dcf]) (8.13.2/8.11.6-SPAMMERS-DeLiGHt) with ESMTP id j142RoMf000785NO) for ; Fri, 4 Feb 2005 03:27:52 +0100 (CET) (envelope-from bounce@NOSPAM.dyndns.dk) Received: (from beer@localhost) by Mail.NOSPAM.DynDNS.dK (8.13.2/FNORD) id j142Rnw4000784; Fri, 4 Feb 2005 03:27:49 +0100 (CET) (envelope-from bounce@NOSPAM.dyndns.dk) Date: Fri, 4 Feb 2005 03:27:49 +0100 (CET) Message-Id: <200502040227.j142Rnw4000784@Mail.NOSPAM.DynDNS.dK> X-Authentication-Warning: localhost.newsbastards.org.72.27.172.IN-addr.A: beer set sender to bounce@NOSPAM.dyndns.dk using -f X-Authentication-Warning: localhost.newsbastards.org.72.27.172.IN-addr.A: Processed from queue /tmp X-Authentication-Warning: localhost.newsbastards.org.72.27.172.IN-addr.A: Processed by beer with -C /etc/mail/sendmail.cf-LOCAL From: Barry Bouwsma To: freebsd-multimedia@freebsd.org Mail-Followups-To: freebsd-multimedia@freebsd.org References: <20050201.025634.343191193.kazuhito@ph.noda.tus.ac.jp> <20050202.002449.343190992.kazuhito@ph.noda.tus.ac.jp> <200502011815.j11IFWkB004113@Mail.NOSPAM.DynDNS.dK> <20050202.125013.343181897.kazuhito@ph.noda.tus.ac.jp> Subject: Re: Which USB-Soundcards work? X-BeenThere: freebsd-multimedia@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list Reply-To: Barry Bouwsma List-Id: Multimedia discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 Feb 2005 02:27:57 -0000 On Wed, 02 Feb 2005 12:50:13 +0900 (JST), Kazuhito HONDA wrote: > > I just obtained the Creative Audigy 2 NX USB today, and while it > > looks promising when I connected it (uaudio finds it, and recognizes > > what it can do), it doesn't quite seem to be able to play back yet. > > I haven't tried -- I just saw the errors below, and `mixer' reports > > it's only mixer-aware. > > play channel supported format list invalid > > pcm1: chn_init(pcm1:play:0) failed: err = 19 > > pcm1: pcm_chn_create(ua_chan, 1, 0xc19f4a80) failed > > record channel supported format list invalid > > pcm1: chn_init(pcm1:record:0) failed: err = 19 > > pcm1: pcm_chn_create(ua_chan, -1, 0xc19f4a80) failed > These look like the same problem as below: > http://docs.freebsd.org/cgi/getmsg.cgi?fetch=246398+0+archive/2004/freebsd-usb/20041231.freebsd-usb Sorry that I sent out my last message so quickly, without the chance to sit and study my `dmesg' output and report on other possibilities I had tried. Now, some days later, I can say more. I did not mention that in my boot messages, I also saw quite a few lines like this: ``uaudio0: ignored audio interface with 2 endpoints'' I also saw that later when booting into NetBSD. Both NetBSD and (my hacked or -current) FreeBSD have a commented /* #define UAUDIO_MULTIPLE_ENDPOINTS */ in uaudio.c . I uncommented that in FreeBSD and now at boot time, with no other changes, I see uaudio0: playback: 2ch, 16/16bit, pcm, 22050Hz uaudio0: ignored setting with format 0 uaudio0: ignored setting with format 0 uaudio0: playback: 2ch, 16/16bit, pcm, 48000Hz uaudio0: playback: 2ch, 24/24bit, pcm, 48000Hz uaudio0: playback: 2ch, 16/16bit, pcm, 96000Hz uaudio0: playback: 2ch, 24/24bit, pcm, 96000Hz uaudio0: playback: 4ch, 16/16bit, pcm, 22050Hz uaudio0: playback: 4ch, 16/16bit, pcm, 48000Hz uaudio0: playback: 4ch, 24/24bit, pcm, 48000Hz uaudio0: playback: 6ch, 16/16bit, pcm, 22050Hz uaudio0: playback: 6ch, 16/16bit, pcm, 48000Hz uaudio0: playback: 6ch, 24/24bit, pcm, 48000Hz uaudio0: playback: 8ch, 16/16bit, pcm, 22050Hz uaudio0: playback: 8ch, 16/16bit, pcm, 48000Hz uaudio0: recording: 2ch, 16/16bit, pcm, 32000Hz uaudio0: recording: 2ch, 24/24bit, pcm, 32000Hz uaudio0: recording: 2ch, 16/16bit, pcm, 44100Hz uaudio0: recording: 2ch, 24/24bit, pcm, 44100Hz uaudio0: recording: 2ch, 16/16bit, pcm, 48000Hz uaudio0: recording: 2ch, 24/24bit, pcm, 48000Hz uaudio0: recording: 2ch, 16/16bit, pcm, 96000Hz uaudio0: recording: 2ch, 24/24bit, pcm, 96000Hz uaudio0: audio rev 1.00 uaudio0: 19 mixer controls pcm0: on uaudio0 pcm0: sndbuf_setmap 3000, 4000; 0xc4c33000 -> 3000 pcm0: sndbuf_setmap 7000, 4000; 0xc4c37000 -> 7000 This also makes the device show up as more than just a mixer: pcm0: at addr ? (1p/1r/0v channels duplex) pcm1: at addr ? (1p/1r/0v channels duplex) (pcm1 is the other USB card that works for me) But, when I play audio, so far I hear nothing with FreeBSD yet. I've added this change to my NetBSD, and after adjusting `mixerctl' there appropriately, I am able to hear something. As it turns out, by default, when this Audigy device resets, it automatically mutes the master output (there's a LED by a button which does the same -- unfortunately, I haven't seen that the button, or anything else on the box or the remote, unmutes the playback). So, the reason which you gave was not the real reason why it did not work -- it seems to just need the multiple-endpoints enabled, which appears to work for playback, and does not seem to affect my other uaudio device negatively, though I have not played too much with that. It could also be that I need to apply that patch for other reasons, but playback works without it, as opposed to not working at all. In addition, when I try to record anything, my program writes the file header, and then nothing. It's not timing out waiting for data as would be the case when I try to record from s/pdif input but no source. I also couldn't get NetBSD to write anything more than the header when trying to record, so this is something else. My NetBSD source is over a month out-of-date, so I'm about to update that in case there are changes I've missed. In order to unmute the audio, I tried and failed to tie that mixerctl to a FreeBSD sysctl knob, the way I adapted the CMI8738 s/pdif options that are available to NetBSD's `mixerctl' in order to have interactive control over that input with FreeBSD. When that failed, I added a line to uaudio_set() the values for the Audigy NX to unmute the audio at attach time. That isn't a very nice solution -- since there are a lot of knobs available to NetBSD from this card, as well as other cards like the CMI8738-based card I have, that don't seem to fit well with the FreeBSD mixer/sysctl control. I did some more hacking on uaudio.c to add to FreeBSD the ctlname and ctlunit, as well as NetBSD's audioio.h for the labels, which helped greatly to clarify what FreeBSD is trying to do at higher debug levels. Unfortunately there's some interaction that seems to make this enable a phantom FreeBSD mixer bass control, as well as to try to set a few extensions -- these could be related, but things still appear to work in spite of that. Unfortunately, I don't have a working `mixerctl' program able to retrieve and tweak these values yet. I probably need to dig more deeply in the source to make that happen, if it's possible. Here's what NetBSD's `mixerctl' has to say about this card, and this matches the values which FreeBSD is getting but not able to make use of: inputs.aux.mute=off [ off on ] inputs.aux=128,128 volume delta=1 inputs.line.mute=off [ off on ] inputs.line=192,192 volume delta=1 record.mixerout=133 volume delta=6 record.line=200 volume delta=6 record.aux=133 volume delta=6 record.sel14-i12i13i11=2 [ 1 2 3 ] outputs.ext17-enable=off [ off on ] outputs.master.mute=off [ off on ] outputs.master=217 volume delta=1 outputs.ext21-enable=off [ off on ] outputs.aux.mute=off [ off on ] outputs.ext23-enable=off [ off on ] inputs.ext27-enable=off [ off on ] outputs.speaker.mute=off [ off on ] outputs.sel29-i17i27i4=1 [ 1 2 3 ] outputs.headphones.mute=off [ off on ] outputs.sel31-i17i21=1 [ 1 2 ] The failure of this card to actually record is annoying, but other than that, it has the potential to work with FreeBSD, other than that the above knobs are not available by default at present. For those who want to record at 32 or 44,1kHz samplerates, this card offers that, even though it apparently doesn't support those for playback natively, hmmm. There are a few dials and buttons on this Audigy 2 NX as well, but unlike my other Big Knob soundcard, nothing appears as a uhid device. The cursed mute button seems to do that much, with no need for a uhid interface, while none of the other controls have any obvious effect. thanks barry bouwsma