Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 14 Aug 2008 12:08:04 -0500
From:      eculp <eculp@encontacto.net>
To:        freebsd-multimedia@freebsd.org
Subject:   Re: RFC: massive snd_hda driver update to better conform UAA specification
Message-ID:  <20080814120804.58926z73nlr9d9oo@econet.encontacto.net>
In-Reply-To: <1218665493.1899.4.camel@wombat.2hip.net>
References:  <48A20E02.6070609@FreeBSD.org> <1218665493.1899.4.camel@wombat.2hip.net>

next in thread | previous in thread | raw e-mail | index | archive | help
Quoting Robert Noland <rnoland@FreeBSD.org>:

> On Wed, 2008-08-13 at 01:26 +0300, Alexander Motin wrote:
>> Hi.
>>
>> I have made major snd_hda driver rewrite. I will be grateful for reviews
>> and any positive or negative feedbacks.
>>
>> Here is my patches: http://people.freebsd.org/~mav/
>>
>> For 8-CURRENT use:
>> http://people.freebsd.org/~mav/hda.20080812.patch

Yesterday I found time to test the patch and I am blown away.  =20
Everything sound related COMPLETELY works for the first time since I =20
bought this Acer Aspire 5520-5679.  Connecting my headset EVEN blocks =20
the speakers.  That has never worked.  FANTASTIC.  THANKS for your =20
work.  I have even added the patch to my script for building and =20
installing world and kernel in FreeBSD current 8 automatically until =20
it is commited.  I would appreciate someone posting on the list when =20
that happens.

The following is general info on my sound card with the patch applied.

hdac0: <NVidia MCP67 High Definition Audio Controller> mem =20
0xd0880000-0xd0883fff irq 21 at device 7.0 on pci0
hdac0: DMA Coherency: Uncacheable / vendor=3D0x10de
hdac0: Reserved 0x4000 bytes for rid 0x10 type 3 at 0xd0880000
hdac0: [MPSAFE]
hdac0: [ITHREAD]
hdac0: hdac_dma_alloc: size=3D1024 -> roundsz=3D1024
hdac0: hdac_dma_alloc: size=3D2048 -> roundsz=3D2048

hdac0@pci0:0:7:0:       class=3D0x040300 card=3D0x01261025 chip=3D0x055c10de=
 =20
rev=3D0xa1 hdr=3D0x00
     vendor     =3D 'Nvidia Corp'
     class      =3D multimedia

# cat /dev/sndstat
FreeBSD Audio Driver (newpcm: 32bit 2007061600/i386)
Installed devices:
pcm0: <HDA codec Realtek ALC268 PCM #0> at hdac0 cad 0 kld snd_hda =20
[20080812_0000] [GIANT] (1p:1v/1r:1v channels duplex default)
pcm1: <HDA codec Realtek ALC268 PCM #1> at hdac0 cad 0 kld snd_hda =20
[20080812_0000] [MPSAFE] (1p:1v/1r:1v channels duplex)

Mixer vol      is currently set to 100:100
Mixer pcm      is currently set to 100:100
Mixer speaker  is currently set to 100:100
Mixer line     is currently set to 100:100
Mixer mic      is currently set to  50:50
Mixer rec      is currently set to 100:100
Mixer ogain    is currently set to  80:80
Mixer monitor  is currently set to 100:100

Thanks again.

ed

>
> Nice work, applied to -CURRENT on my Dell D630 with no apparent
> regressions.  I'll attach the verbose dmesg.  It seems that I now have a
> monitor device which looks like it is the built in mic.
>
> wombat% mixer
> Mixer vol      is currently set to  75:75
> Mixer pcm      is currently set to  75:75
> Mixer speaker  is currently set to  75:75
> Mixer rec      is currently set to   0:0
> Mixer monitor  is currently set to  75:75
>
> robert.
>
>> For 7-STABLE try (I have no place to test it, but it builds):
>> http://people.freebsd.org/~mav/hda.7.20080812.patch
>>
>> The main point of this change was to make driver conforming Universal
>> Audio Architecture (UAA) specification. UAA gives ability to avoid most
>> of device-dependent quirks (I have removed most of) and make driver more
>> friendly to a new hardware, more friendly to average user by using
>> information written by system integrators and much more configurable for
>> experienced users. UAA allows driver to get all configuration
>> information directly from HDA codec and configure system audio devices
>> according to it. Same time new driver allows easily override default
>> configuration using device.hints mechanism.
>>
>> Second point of this change was to make driver multichannel. Now driver
>> supports multiple HDA codecs per controller, multiple function groups
>> per codec, multiple PCM devices per audio function group and multiple
>> channels per PCM device (last will be useful if FreeBSD OSS sometimes
>> will have multichannel support).
>>
>> To demonstrate features I can show some operation examples from my
>> notebook. This is Acer TM6292 with very simple simple Realtek ALC268 HDA
>> codec.
>>
>> 1. Previous driver gave me:
>>   - stereo playback (pcm0) via built in speakers and headphones without
>> jack sensing;
>>   - recording device (pcm0) from external mic. Built in mic, CD and line
>> in was dead.
>>
>> 2. New driver by default without any quirks gives me:
>>   - stereo playback (pcm0) via built in speakers and headphones with
>> jack sensing;
>>   - recording device (pcm0) for built in mic (it does working!), line in
>> and mic in;
>>   - recording device (pcm1) for CD. CD does not working for some unknown
>> reason, I think it may be just not implemented in hardware.
>>
>> 3. By adding to the loader.conf string
>> hint.hdac.0.cad0.nid20.config=3D"seq=3D1"
>> it will be possible (when OSS will have multichannel support) to get
>> quadro playback via built in speakers and HP out connector. cad0 here
>> means codec with ID 0. nid20 means pin with ID 20 - HP out, seq=3D1
>> changes pin sequence inside association from 15 to 1 effectively
>> disabling redirection making HP out independent.
>>
>> 4. By adding
>> hint.hdac.0.cad0.nid20.config=3D"seq=3D1"
>> hint.hdac.0.cad0.nid21.config=3D"as=3D3 seq=3D1"
>> it is possible to get two independent playback devices. One (pcm0) for
>> HP connector and second (pcm1) for built in speakers. Record will stay
>> as before. Here as=3D3 changes built in speakers pin association number
>> from 1 to 3 separating it completely from HP output.
>>
>> 5. By adding
>> hint.hdac.0.cad0.nid26.config=3D"as=3D1 seq=3D0 device=3D0"
>>
>> hint.hdac.0.cad0.nid20.config=3D"as=3D1 seq=3D15"
>>
>> hint.hdac.0.cad0.nid21.config=3D"as=3D3"
>>
>> it is possible to get two independent playback devices. First (pcm0) for
>> playback via line in and HP out connectors with jack sensing in HP
>> connector and line in connector auto mute. And second (pcm1) for
>> playback via built in speakers. In this codec line in connector is
>> reversible. String device=3D0 changes it's description from Line in to
>> Line out forcing actual direction change.
>>
>> Driver allows to build many others usage scenarios. The main limitation
>> factor is codec functionality. Presented ALC268 is very simple and
>> restricted one. But I have also successfully tested it on more powerful
>> AD1988 and there range of possible scenarios is wider while even default
>> configuration covers all present codec functionality.
>>
>> More information about UAA you can find at:
>> http://www.microsoft.com/whdc/device/audio/default.mspx
>>
>> If you will have any questions/problems boot your system with verbose
>> logging. Driver prints a lot of usable information there. If you will
>> send me problem reports add please attach that verbose boot output and
>> `cat /dev/sndstat` output to your message.
>>
>> Thanks.
>>
>> --
>> Alexander Motin
>> _______________________________________________
>> freebsd-multimedia@freebsd.org mailing list
>> http://lists.freebsd.org/mailman/listinfo/freebsd-multimedia
>> To unsubscribe, send any mail to =20
>> "freebsd-multimedia-unsubscribe@freebsd.org"
>




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