From mboxrd@z Thu Jan 1 00:00:00 1970 From: Takashi Iwai Subject: Re: [RESEND PATCH] conf/cards: add VC4-HDMI card Date: Mon, 10 Apr 2017 14:19:18 +0200 Message-ID: References: <1488451773-22010-1-git-send-email-boris.brezillon@free-electrons.com> <87lgrd48ve.fsf@eliezer.anholt.net> <87r314qgmj.fsf@eliezer.anholt.net> <20170410140911.2fb09a20@bbrezillon> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mx2.suse.de (mx2.suse.de [195.135.220.15]) by alsa0.perex.cz (Postfix) with ESMTP id 662A226686A for ; Mon, 10 Apr 2017 14:19:19 +0200 (CEST) In-Reply-To: <20170410140911.2fb09a20@bbrezillon> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org To: Boris Brezillon Cc: Eric Anholt , alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org On Mon, 10 Apr 2017 14:09:11 +0200, Boris Brezillon wrote: > > Eric, Takashi, > > On Fri, 07 Apr 2017 10:20:20 -0700 > Eric Anholt wrote: > > > Takashi Iwai writes: > > > > > On Thu, 06 Apr 2017 21:46:29 +0200, > > > Eric Anholt wrote: > > >> > > >> Takashi Iwai writes: > > >> > > >> > On Thu, 02 Mar 2017 11:49:33 +0100, > > >> > Boris Brezillon wrote: > > >> >> > > >> >> Add a conf file for the VC4-HDMI sound card. > > >> >> > > >> >> Signed-off-by: Boris Brezillon > > >> >> --- > > >> >> Hi, > > >> >> > > >> >> Sorry for the noise, but I didn't send this patch to the alsa-lib > > >> >> maintainer on my first attempt. > > >> >> > > >> >> This patch is adding a card config file for the audio sound card whose > > >> >> driver has been submitted here [1] (not accepted yet). > > >> >> > > >> >> Since I am a total newbie to the alsa world, I'd like to get some > > >> >> feedback on this patch. > > >> >> > > >> >> Also, the card only supports 2 to 8 channels, and I wonder if we should > > >> >> add a plug element to support mono streams, and where this element > > >> >> should be added (after or before the iec958 element). > > >> > > > >> > Applied, thanks. > > >> > > >> Thanks! > > >> > > >> Any recommendations on how to restructure this so that things like > > >> 'aplay' from the console also work by default? > > > > > > Well, once after you have your card config in > > > /usr/share/alsa/cards/vc4-hdmi.conf, aplay should work as is. > > > > > > If not, check /proc/asounds output. The entry looks like > > > 0 [ID ]: DRIVER - SHORTNAME > > > LONGNAME > > > > > > and in your case, "DRIVER" must be "vc4-hdmi", as same as the config > > > file name. > > > > It doesn't work as is -- the default ends up not having iec958 > > conversion, so nothing will play. You can do aplay -D iec958, which > > works but only as long as you've got stereo input (it seems plug can't > > do mono-to-stereo on iec958 data) > > Sorry for being so silent during the past weeks, but I've been busy > with other things and was on vacation last week. Thanks for joining. I was also slow just because I've been sick and off in the last week :-< Now getting recovered, and resuming the task... > As Eric explained, we're looking for advices on how to best expose > the sound card so that it can be easily used by end-users without > requiring advanced options (like -D iec958) or conf tweaking (like > declaring an extra plug element before the iec958 one to convert from > mono to stereo and then using -D iec958-mono). > > Takashi, what do you suggest? Is it possible/acceptable to make iec958 > the default for this card? What about implicit/automatic mono-to-stereo > conversion, is it achievable? Now I looked at your config again, and one likely problem is that you wrap plug *before* iec958 plugin. vc4-hdmi.pcm.iec958.0 { ..... type iec958 slave { format IEC958_SUBFRAME_LE pcm { type plug slave.pcm { type hw card $CARD } } } status [ $AES0 $AES1 $AES2 $AES3 ] } Why do you need to wrap with plug there? Instead, it should be accessing directly to hw, i.e. vc4-hdmi.pcm.iec958.0 { @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 } type iec958 slave { format IEC958_SUBFRAME_LE pcm { type hw card $CARD } } status [ $AES0 $AES1 $AES2 $AES3 ] } Then the plug above this plugin should work. % aplay -D plug:hdmi foo.wav (Note that plug over plug doesn't work -- that's the likely reason it failed before.) Then, about the default PCM: I wonder whether the dmix is feasible at all with this kind of setup. What format does work with this device? Takashi