Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 18 Feb 2013 10:02:59 +0100
From:      Yamagi Burmeister <lists@yamagi.org>
To:        karl@denninger.net
Cc:        freebsd-stable@freebsd.org
Subject:   Re: And for our next trick (Audio problems, Envy24HT driver)
Message-ID:  <20130218100259.97fcc3e0fe3c2b3b98f55bca@yamagi.org>
In-Reply-To: <511EAF8D.8090703@denninger.net>
References:  <511EAF8D.8090703@denninger.net>

next in thread | previous in thread | raw e-mail | index | archive | help
On Fri, 15 Feb 2013 15:58:37 -0600
Karl Denninger <karl@denninger.net> wrote:

> FreeBSD 9.1-STABLE #2 r244942M: Tue Feb  5 21:54:29 CST 2013    
> karl@dbms.denninger.net:/usr/obj/usr/src/sys/KSD-SMP
> 
> (custom kernel is there to support PPS for my GPS clock)
> 
> Attempting to add a generic card that claims to have a Envy24DT chipset
> in it; it identifies and loads under the snd_envy24ht driver as:
> 
> pci6: <multimedia, audio> at device 0.0 (no driver attached)
> pcm0: <Envy24HT audio (Generic)> port 0xcc00-0xcc1f,0xc880-0xc8ff irq 16
> at device 0.0 on pci6
> pcm0: [GIANT-LOCKED]
> pcm0: system configuration
>   SubVendorID: 0x1412, SubDeviceID: 0x2403
>   XIN2 Clock Source: 24.576MHz(96kHz*256)
>   MPU-401 UART(s) #: not implemented
>   ADC #: 1 and SPDIF receiver connected
>   DAC #: 4
>   Multi-track converter type: AC'97(SDATA_OUT:packed)
>   S/PDIF(IN/OUT): 1/1 ID# 0x00
>   GPIO(mask/dir/state): 0xff/0xff/0xff
> 
> cat /dev/sndstat returns:
> 
> [root@NewFS /boot/kernel]# cat /dev/sndstat
> FreeBSD Audio Driver (newpcm: 64bit 2009061500/amd64)
> Installed devices:
> pcm0: <Envy24HT audio (Generic)> at io 0xcc00:32,0xc880:128 irq 16
> (1p:1v/5r:1v) default
> 
> So it appears it did attach properly.

No it did not. :) It's a longer story. While the Envy family had of
course a generic chip design, there wasn't a generic card design. So
every Envy card is different and needs a different driver. The
snd_envy24ht driver solves this problem with distinct device sections
for each supported devices. See envy24ht.c line 279. If no device
section could be found the card is detected as "generic" and a default
device section is used. That may or may not work... So the solution
would be to add a device section for your card but that's everything
but easy. In an ideal world there would be a datasheet for that card, 
in reality it may be necessary to reverse engineer it. And there are
other problems with the driver:
- It's not MPSAFE (at least it's not marked MPSAFE)
- Recording doesn't work
- The debug mode is prone to panics
- All channels supported by the Envy chip are exposed to the mixer
  regardless if they're connect in hardware or not. This leads to
  invalid channels.
I've once had the idea to clean it up but never found the time.
Nevertheless it still would be really nice if someone could give
this driver some love. :)

Ciao,
Yamagi

-- 
Homepage:  www.yamagi.org
XMPP:      yamagi@yamagi.org
GnuPG/GPG: 0xEFBCCBCB



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