From patchwork Tue Jul 8 08:19:20 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anssi Hannula X-Patchwork-Id: 4502971 X-Patchwork-Delegate: tiwai@suse.de Return-Path: X-Original-To: patchwork-alsa-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 06F469F39B for ; Tue, 8 Jul 2014 08:19:47 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 366E32034F for ; Tue, 8 Jul 2014 08:19:46 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id E7F9120218 for ; Tue, 8 Jul 2014 08:19:43 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id E17142608ED; Tue, 8 Jul 2014 10:19:42 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 01191260309; Tue, 8 Jul 2014 10:19:33 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id D049526072A; Tue, 8 Jul 2014 10:19:31 +0200 (CEST) Received: from webmail.tpnet.fi (webmail.tpnet.fi [62.106.63.33]) by alsa0.perex.cz (Postfix) with ESMTP id CAA4E2602AD for ; Tue, 8 Jul 2014 10:19:23 +0200 (CEST) Received: from mail.onse.fi (host-109-204-178-176.tp-fne.tampereenpuhelin.net [109.204.178.176]) by webmail.tpnet.fi (Postfix) with ESMTP id D2E722078A; Tue, 8 Jul 2014 11:19:22 +0300 (EEST) Received: by mail.onse.fi (Postfix, from userid 501) id B3D3540522; Tue, 8 Jul 2014 11:19:22 +0300 (EEST) From: Anssi Hannula To: Takashi Iwai Date: Tue, 8 Jul 2014 11:19:20 +0300 Message-Id: <1404807560-17139-1-git-send-email-anssi.hannula@iki.fi> X-Mailer: git-send-email 1.8.4.5 Cc: alsa-devel@alsa-project.org Subject: [alsa-devel] [PATCH] USB-Audio: Add second S/PDIF device on Phiree U2 X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP Phiree U2 has an unusual configuration. It only has S/PDIF output, but there are still two devices presented: - device 0: PCM audio, subject to volume control - device 1: non-PCM data (passthrough), not subject to volume control It looks like the AES bits are set according to the selected device, since outputting PCM data via device 1 will not work (silence). Currently only the device 0 is shown via the "iec958" alias, and the second device is not accessible via hinted aliases. Simply provide access to both of these devices via the "iec958" alias. Reported-by: touc @ XBMC forum Signed-off-by: Anssi Hannula --- This isn't really the optimal solution, but is probably one of the simplest (except maybe just using device 1 as the only iec958 device). I guess the kernel driver (or even config rules with sufficient @func support) could select the appropriate device according to AES0, but not sure if that is worth the effort? Also, I'm not 100% sure if this is actually uncommon or if we just hide it in on other such devices. src/conf/cards/USB-Audio.conf | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/src/conf/cards/USB-Audio.conf b/src/conf/cards/USB-Audio.conf index ce3ae01..77a48b9 100644 --- a/src/conf/cards/USB-Audio.conf +++ b/src/conf/cards/USB-Audio.conf @@ -52,6 +52,11 @@ USB-Audio.pcm.iec958_device { "USB Device 0x46d:0x992" 999 } +# Second iec958 device number, if any. +USB-Audio.pcm.iec958_2_device { + "PHIREE U2" 1 # 0 = PCM S/PDIF, 1 = non-PCM S/PDIF +} + # If a device requires non-standard definitions for front, surround40, # surround51, surround71 or iec958, they can be defined here. @@ -422,4 +427,39 @@ USB-Audio.pcm.iec958.0 { } } +USB-Audio.pcm.iec958.1 { + @args [ CARD AES0 AES1 AES2 AES3 ] + @args.CARD { type string } + @args.AES0 { type integer } + @args.AES1 { type integer } + @args.AES2 { type integer } + @args.AES3 { type integer } + @func refer + name { + @func concat + strings [ + "cards.USB-Audio." + { @func card_name card $CARD } + ".pcm.iec958_2:CARD=" $CARD + ",AES0=" $AES0 ",AES1=" $AES1 ",AES2=" $AES2 ",AES3=" $AES3 + ] + } + default { + # FIXME: we cannot set the AES parameters + type hw + card $CARD + device { + @func refer + name { + @func concat + strings [ + "cards.USB-Audio.pcm.iec958_2_device." + { @func card_name card $CARD } + ] + } + default 999 + } + } +} + # vim: ft=alsaconf