From owner-freebsd-current@FreeBSD.ORG Wed Jan 11 19:33:22 2012 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 3EFDB1065675 for ; Wed, 11 Jan 2012 19:33:22 +0000 (UTC) (envelope-from mavbsd@gmail.com) Received: from mail-ee0-f54.google.com (mail-ee0-f54.google.com [74.125.83.54]) by mx1.freebsd.org (Postfix) with ESMTP id 9D0DC8FC24 for ; Wed, 11 Jan 2012 19:33:21 +0000 (UTC) Received: by eekd49 with SMTP id d49so549960eek.13 for ; Wed, 11 Jan 2012 11:33:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=sender:message-id:date:from:user-agent:mime-version:to:subject :content-type:content-transfer-encoding; bh=aY7qYXoEO+aEuO8NS6nzvltFyfhygOTqNijz5Rc5lDw=; b=giXKiWc+334DLyjS/XLqeHd2/OOtQHWtBwB9G7IFAkzh+V61ZI67MrFsysk/t6HA/t XjdqyF2uhhE+bywADssDs7ibPnd4uoXfsV01ORMRSIW8s0VaS/WEbz13VMog/Bq/XHkP MTnwDGr7wmqP+8rQssUJrlkChe3boQckNtm08= Received: by 10.14.39.196 with SMTP id d44mr164538eeb.108.1326310400481; Wed, 11 Jan 2012 11:33:20 -0800 (PST) Received: from mavbook2.mavhome.dp.ua (pc.mavhome.dp.ua. [212.86.226.226]) by mx.google.com with ESMTPS id t1sm9479942eeb.3.2012.01.11.11.33.18 (version=TLSv1/SSLv3 cipher=OTHER); Wed, 11 Jan 2012 11:33:19 -0800 (PST) Sender: Alexander Motin Message-ID: <4F0DE3FD.2020203@FreeBSD.org> Date: Wed, 11 Jan 2012 21:33:17 +0200 From: Alexander Motin User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:9.0) Gecko/20111227 Thunderbird/9.0 MIME-Version: 1.0 To: FreeBSD current , freebsd-multimedia@FreeBSD.org Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: Subject: [RFT] Major snd_hda rewrite X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 11 Jan 2012 19:33:22 -0000 Hi. I would like request for testing of my work on further HDA sound driver improvement. List of changes done this time: - Huge old hdac driver was split into three independent pieces: HDA controller driver (hdac), HDA CODEC driver (hdacc) and HDA sudio function driver (hdaa). All drivers are completely independent and talk to each other only via NewBus interfaces. Using more NewBus bells and whistles allows to properly see HDA structure with standard system instruments, such as `devinfo -v`. Biggest driver file size now is 150K, instead of 240K before, and the code is much more clean. - Support for multichannel recording was added. While I've never seen it configured by default, UAA specification tells that it is possible. Now, as specification defines, driver checks input associations for pins with sequence numbers 14 and 15, and if found (usually) -- works as before, mixing signals together. If it doesn't, it configures input association as multichannel. I've found some CODECs doing strange things when configured for multichannel recording, but I've also found successfully working examples. - Signal tracer was improved to look for cases where several DACs/ADCs in CODEC can work with the same audio signal. If such case found, driver registers additional playback/record stream (channel) for the pcm device. Having more then one stream allows to avoid vchans use and so avoid extra conversion to pre-configured vchan rate and sample format. Not many CODECs allow this, especially on playback, but some do. - New controller streams reservation mechanism was implemented. That allows to have more pcm devices then streams supported by the controller (usually 4 in each direction). Now it limits only number of _simultaneously_ transferred audio streams, that is rarely reachable and properly reported if happens. - Codec pins and GPIO signals configuration was exported via set of writable sysctls. Another sysctl dev.hdaa.X.reconfig allows to trigger driver reconfiguration in run-time. The only requirement is that all pcm devices should be closed at the moment, as they will be destroyed and recreated. This should significantly simplify process of fixing CODEC configuration. It should be possible now even to write GUI to do it with few mouse clicks. - Driver now decodes pins location and connector type names. In some cases it allows to hint user where on the system case connectors, related to the pcm device, are located. Number of channels supported by pcm device, reported now (if it is not 2), should also make search easier. - Added fix for digital mic recording on some Asus laptops/netbooks. That is how it may look now in dmesg: hdac0: mem 0xf7ef4000-0xf7ef7fff irq 22 at device 27.0 on pci0 hdacc0: at cad 0 on hdac0 hdaa0: at nid 1 on hdacc0 hdacc1: at cad 3 on hdac0 hdaa1: at nid 1 on hdacc1 pcm0: at nid 28,29 and 26,30,27 on hdaa0 pcm1: at nid 32 on hdaa0 pcm2: at nid 6 on hdaa1 Patch can be found here: http://people.freebsd.org/~mav/hda.rewrite.patch Patch was generated for 10-CURRENT, but should apply to fresh 9-STABLE and 8-STABLE branches also. Special thanks to iXsystems, Inc. for supporting this work. Comments and tests results are welcome! -- Alexander Motin