Which USB-Soundcards work?

Barry Bouwsma freebsd-misuser at remove-NOSPAM-to-reply.NOSPAM.dyndns.dk
Thu Feb 3 18:27:57 PST 2005


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: <USB Audio> 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: <USB Audio> at addr ? (1p/1r/0v channels duplex)
pcm1: <USB Audio> 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



More information about the freebsd-multimedia mailing list