Status of VIA Envy24 audio controller support in FreeBSD

Konstantin Dimitrov kosio.dimitrov at gmail.com
Thu May 25 08:45:16 PDT 2006


ok, so here is the patches to make Katsurajima Naoto's driver for "M-Audio
Delta Dio 2496" to compile under newer versions of FreeBSD:

http://xkodi.svobodno.com/envy24/envy24.c.diff
http://xkodi.svobodno.com/envy24/ak452x.c.diff

so with these patches we immediately have support for "M-Audio Delta Dio
2496" under FreeBSD as Katsurajima Naoto implemented it 5 years ago, i don't
have "M-Audio Delta Dio 2496", but the driver compiles fine on FreeBSD
5.4and FreeBSD
6.1-RC2, to compile under FreeBSD 6.1-RC2 you should add "WERROR=" to the
Makefile for snd_envy24.ko:

# $FreeBSD$

.PATH:        ${.CURDIR}/../../../../dev/sound/pci
KMOD        = snd_envy24
SRCS        = device_if.h bus_if.h isa_if.h pci_if.h
SRCS        += envy24.c
WERROR=

.include <bsd.kmod.mk>

to prove myself that the above driver is actually working i made small
hardware specific patches and after that it is able to operate with my
"Terratec DMX 6fire" card, i have loud and clear sound under FreeBSD 5.4 and
FreeBSD 6.1-RC2, so the driver is really working. it is very easy to add
support for another Envy24-based (ICE1712) sound card, which uses AK4524
audio codec, here is the heart of the patch (notice that this patch brokes
the "M-Audio Delta Dio 2496" support and enables "Terratec DMX 6fire"
support, anyway it is easy to make support for more than one card at the
same time):

http://xkodi.svobodno.com/envy24/envy24.h.diff :

-#define ENVY24_GPIO_AK4524_CS0    0x40
-#define ENVY24_GPIO_AK4524_CS1    0x80
+#define ENVY24_GPIO_AK4524_CS0    0x01
+#define ENVY24_GPIO_AK4524_CS1    0x02

-#define ENVY24_DELTA_AK4524_CIF 0
+#define ENVY24_DELTA_AK4524_CIF 1

"M-Audio Delta Dio 2496" has 2xAK4524 audio codecs and their chip select
(CS) pins are wired to GPIO6 and GPIO7 of the Envy24 audio controller chip,
"Terratec DMX 6fire" has 3xAK4524 audio codecs wired to GPIO0, GPIO1 and
GPIO2, so i change the CS definitions to their correct values for "Terratec
DMX 6fire" and doesn't add the third codec (ENVY24_GPIO_AK4524_CS2), because
the driver is able to initialize only two audio codecs.
ENVY24_DELTA_AK4524_CIF defines the input to AK4524 Control Interface pin
and determines how the control data send to the audio codec are sampled - on
the rissing or on the falling edge of chip select (CS) and it must be "1"
for "Terratec DMX 6fire".

because sometimes with my "Terratec DMX 6fire" i have noise entering
hardware mixer of the Envy24 from one the inputs i muted it, using this
patch (it is ugly, maybe not on the right place and the cause of the noise
is unknown, so maybe it will not be needed for the future):

http://xkodi.svobodno.com/envy24/envy24_6fire.c.diff :

+        envy24_wrmt(sc, ENVY24_MT_VOLIDX, 16, 1);
+        envy24_wrmt(sc, ENVY24_MT_VOLUME, 0x7f7f, 2);
+        envy24_wrmt(sc, ENVY24_MT_VOLIDX, 17, 1);
+        envy24_wrmt(sc, ENVY24_MT_VOLUME, 0x7f7f, 2);

here is the last, really not needed and pure "cosmetic" patch, which changes
the name of the card:

http://xkodi.svobodno.com/envy24/envy24_6fire2.c.diff :

 static struct cfg_info cfg_table[] = {
     {
-        "Envy24 audio(M Audio Delta Dio 2496)",
-        0x1412, 0xd631,
-        0x10, 0x80, 0xf0, 0x03,
-        0xff, 0x00, 0x00,
+        "Envy24 audio(Terratec DMX 6fire)",
+        0x153b, 0x1138,
+        0x2f, 0x80, 0xf0, 0x03,
+        0xc0, 0x7f, 0xff,
         0,
         &delta_codec,
     },

all magic numbers above are taken from "Terratec DMX 6fire" EEPROM, dump is
available here:

http://xkodi.svobodno.com/envy24/6fire.dump

to summarize at least two Envy24-based (ICE1712) cards work, and have basic
open source support under FreeBSD, using the Katsurajima Naoto's driver and
appropriate patches:

1) "M-Audio Delta Dio 2496"
2) "Terratec DMX 6fire"

if you have questions you can contact me, but for the next several week i
will be very busy, so don't expect very fast answers.

On 5/25/06, Alexander Leidinger <Alexander at leidinger.net> wrote:
>
> Quoting "Konstantin Dimitrov" <kosio.dimitrov at gmail.com> (Thu, 25 May 2006
> 10:18:17 +0300):
>
> > 1.2) most important than documentation is that there is open source
> driver
> > for FreeBSD, written by Katsurajima Naoto for "M-Audio Delta Dio 2496",
>
> I CCed him.
>
> > which is Envy24-based (ICE1712) card:
> >
> > http://people.freebsd.org/~lofi/envy24.tar.gz
> >
> > the driver is 5 years old, from 2001 and doesn't compile on newer
> versions
> > of FreeBSD, but it is very easy to make it compile with patching only
> > several lines of code
>
> > 2) we can use Katsurajima Naoto's driver as a base, at least i can
> provide
> > patches to that driver for "Terratec DMX 6fire" to start working under
> > FreeBSD (tested on 5.4 and 6.1-RC2) and it is very easy to be added
> support
>
> That would be great. Since the driver source contains a BSD license, I
> don't think there will be any objections, but I want some kind of
> formal OK (with a timeout of ... let's say two weeks).
>
> Katsurajima-san (I hope I got the right part of your name, my apologies
> if I didn't), is it ok for you when I commit your driver to FreeBSD? Do
> you have a newer version, or are you still working on it? If not, are
> you willing to work on it (maybe together with Konstantin)?
>
> > for every Envy24-based (ICE1712), which uses AKM4524 audio codec like
> the
> > one Nikolas Britton planning to buy:
> > http://www.newegg.com/Product/Product.asp?Item=N82E16829121120
> >
> > i am willing to work on the driver, but there is a lot of work to be
> done to
> > the Katsurajima Naoto's driver to have full support at least for several
> > most-wide-spreaded Envy24-based cards and i am not sure i can do it
> alone,
>
> You don't have to. Just do what you are willing to do. Support for even
> only one card is more than support for no card at all.
>
> > because my experience with audio drivers under FreeBSD is limited to the
> > time i spend making the patch for "Terratec DMX 6fire", though working
> on it
> > is great opportunity to gain experience, but my time is very limited, so
> i
> > can't guarantee any results
>
> I'm sure Ariff will answer questions as time permits when you (or
> someone else) asks questions.
>
> You can have a look at http://www.leidinger.net/FreeBSD/src_docs/, and
> in case you take notes we would be happy if you could add some
> doxygen lines (www.doxygen.org) to the source and send them in.
>
> The stuff to generate those docs you see above will enter CVS "soon".
>
> I think this summer will be an interesting sound-stuff summer...
>
> Bye,
> Alexander.
>
> --
> Selling GoodYear Eagle F1 235/40ZR18, 2x 4mm + 2x 5mm, ~150 EUR
> you have to pick it up between Germany/Saarland and Luxembourg/Capellen
> http://www.Leidinger.net    Alexander @ Leidinger.net: PGP ID = B0063FE7
> http://www.FreeBSD.org       netchild @ FreeBSD.org  : PGP ID = 72077137
>


More information about the freebsd-multimedia mailing list