Multiple simultaneous sound channels (sources) with and Envy24 (M-Audio Audiophile 2496)

Stefan Ehmann shoesoft at
Fri Dec 19 00:29:06 PST 2008

On Thursday 18 December 2008 21:58:18 Scott Spare wrote:
> Stefan,
> Thank you for your detailed message. I am more than willing to test any new
> driver code for Envy24 that supports multiplexing if anyone creates it.  I
> looked at the code for the driver yesterday, but realized after about half
> an hour of reading code that driver debugging is way beyond my C ability.
> I was unable to figure out what that high-quality hardware mixing is called
> in the driver, or whether it's just automatically enabled, and so would be
> something that would have to be disabled explicitly by sending a signal to
> the chip to tell it not to use it.  I would be very glad to use the
> hardware mixer if it was working.  Also I'm not really clear on what
> portion of all this is handled by the driver itself, and what's handled by
> the kernel modules.
> I looked around for datasheets for the VIA Envy24 chip itself, and couldn't
> find those.  I personally thank Konstantin and whoever else authored these
> drivers in the first place. How they did so without datasheets, I will
> never know.
> FWIW, there's a web page on the chip itself at
> The digital mixer is shown on that page in a block diagram, but the quality
> of the diagram is not so good.  There's a zip file for an "image kit" on
> that page, but that's just logos.
Some datasheets are available here:
This should be the relevant one:

> Next steps: I think I'm going to try OSS again and see if I can get that
> virtual channel mixing thing working.  I might also look at the source of
> their envy24 support to see if that answers anything.  I kind of doubt it,
> but it's worth a shot.  I'd really prefer to use some kind of low-level
> solution like the hardware mixing or FreeBSDs vchans.  I think the driver
> may be disabling the vchans, but not sure.
AFAIK the original driver was written before there was even vchans support in 
FreeBSD :)

I came up with a quick&dirty patch to disable hardware mixing. With the patch 
applied vchans should be working.

Fixing hardware mixing would be nice but that's beyond my scope right now.

--- envy24.c.bak	2008-12-19 09:04:56.000000000 +0100
+++ envy24.c	2008-12-19 09:17:41.000000000 +0100
@@ -2535,14 +2535,12 @@
 	mixer_init(dev, &envy24mixer_class, sc);
 	/* set channel information */
-	err = pcm_register(dev, sc, 5, 2 + sc->adcn);
+	err = pcm_register(dev, sc, 1, 2 + sc->adcn);
 	if (err)
 		goto bad;
 	sc->chnum = 0;
-	for (i = 0; i < 5; i++) {
-		pcm_addchan(dev, PCMDIR_PLAY, &envy24chan_class, sc);
-		sc->chnum++;
-	}
+	pcm_addchan(dev, PCMDIR_PLAY, &envy24chan_class, sc);
+	sc->chnum = 5;
 	for (i = 0; i < 2 + sc->adcn; i++) {
 		pcm_addchan(dev, PCMDIR_REC, &envy24chan_class, sc);

More information about the freebsd-multimedia mailing list