Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 19 Dec 2008 09:29:01 +0100
From:      Stefan Ehmann <shoesoft@gmx.net>
To:        "Scott Spare" <scuppers@gmail.com>
Cc:        freebsd-multimedia@freebsd.org
Subject:   Re: Multiple simultaneous sound channels (sources) with X.org and Envy24 (M-Audio Audiophile 2496)
Message-ID:  <200812190929.02650.shoesoft@gmx.net>
In-Reply-To: <daaab7120812181258n3a267c31td2047794fd71adec@mail.gmail.com>
References:  <daaab7120812161343v124d7513s40bb0d26f9d91c23@mail.gmail.com> <200812170046.32702.shoesoft@gmx.net> <daaab7120812181258n3a267c31td2047794fd71adec@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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
> http://www.via.com.tw/en/products/audio/controllers/envy24/.
> 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:
http://envy24.svobodno.com/
This should be the relevant one:
http://envy24.svobodno.com/datasheets/via/vt1712.pdf

> 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);
 		sc->chnum++;




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