From patchwork Fri Aug 1 11:40:31 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: thomas schorpp X-Patchwork-Id: 4668781 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 806B59F373 for ; Mon, 4 Aug 2014 09:10:16 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C5EF120222 for ; Mon, 4 Aug 2014 09:10:12 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.kernel.org (Postfix) with ESMTP id A10FD20218 for ; Mon, 4 Aug 2014 09:10:08 +0000 (UTC) Received: by alsa0.perex.cz (Postfix, from userid 1000) id 38AEF2607C8; Mon, 4 Aug 2014 11:10:06 +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.8 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, NO_DNS_FOR_FROM, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=no version=3.3.1 Received: from alsa0.perex.cz (localhost [IPv6:::1]) by alsa0.perex.cz (Postfix) with ESMTP id 83ADC2608CF; Mon, 4 Aug 2014 11:09:58 +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 604BA265056; Fri, 1 Aug 2014 13:40:43 +0200 (CEST) Received: from mail-vc0-f178.google.com (mail-vc0-f178.google.com [209.85.220.178]) by alsa0.perex.cz (Postfix) with ESMTP id 13A89265054 for ; Fri, 1 Aug 2014 13:40:35 +0200 (CEST) Received: by mail-vc0-f178.google.com with SMTP id la4so6344234vcb.23 for ; Fri, 01 Aug 2014 04:40:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=message-id:date:from:reply-to:user-agent:mime-version:to:cc:subject :content-type:content-transfer-encoding; bh=idCtne3Ax9QRnZSQRuqyoRr/Q+lrdjfQNtjIcgo45zY=; b=h/6yo7RaEBgToX5S1RcQ0GasWFpgGw0bp8tZLL8gaYaF4E4ZBKa/SAYzLua1N8KCQt HBJOKsXC/FMYX77lQMzSZ1ayznjyPcUA5voFKxAZq+ACtvbYnaU68PuJ0iRwHtWYM6Ht zVH8rN92tXWHx+7SjS9D32JAM6GGgsFu2e+ogJ7DlMxNmizllZAER9lV4efH/TgbrsvK FHpnPSqOY0avi6+4ijbhxH921s9hf0F9qbx4sMtA4mGZPAx8CiWr9McS2dhgmYn/QKY+ fvRk8P2ubKe9O8zg/IBqYsk5ZUFZkui67TwbxH1jD9HjZMeqxz0eYvoH1fAFiypm3hLJ lheg== X-Received: by 10.220.167.2 with SMTP id o2mr5236103vcy.8.1406893234856; Fri, 01 Aug 2014 04:40:34 -0700 (PDT) Received: from [192.168.0.105] (HSI-KBW-109-192-117-071.hsi6.kabel-badenwuerttemberg.de. [109.192.117.71]) by mx.google.com with ESMTPSA id db3sm6033244veb.4.2014.08.01.04.40.33 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 01 Aug 2014 04:40:34 -0700 (PDT) Message-ID: <53DB7CAF.4020402@gmail.com> Date: Fri, 01 Aug 2014 13:40:31 +0200 From: thomas schorpp User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.0 MIME-Version: 1.0 To: linux-sunxi@googlegroups.com X-Mailman-Approved-At: Mon, 04 Aug 2014 11:09:55 +0200 Cc: alsa-devel@alsa-project.org Subject: [alsa-devel] [PATCH] ARM: sun7i: Fix HDMI Audio driver's Alsa interface and do 8CH IEC60958 output X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list Reply-To: thomas.schorpp@gmail.com List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" 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 X-Virus-Scanned: ClamAV using ClamSMTP First shot. HDMI backend seems to work with speaker-test but stream samples wrong order /mapping issues and the Alsa frontend is a stub, Pulseaudio needs more, still defaults to 2CH and "Analog". Please test if it switches Your receivers correctly into multichannel pcm mode, strange people with those overexpensed high end 7.1 receivers ;-) Signed-off-by: Not Yet ----------- https://github.com/linux-sunxi/linux-sunxi * stage/sunxi-3.4 diff --git a/drivers/video/sunxi/hdmi/drv_hdmi.c b/drivers/video/sunxi/hdmi/drv_hdmi.c index 283d2ae..9cf2cc2 100644 --- a/drivers/video/sunxi/hdmi/drv_hdmi.c +++ b/drivers/video/sunxi/hdmi/drv_hdmi.c @@ -314,7 +314,7 @@ __s32 Hdmi_init(struct platform_device *dev) if (err) return err; - audio_info.channel_num = 2; + audio_info.channel_num = 8; #if 0 { /* for audio test */ hdmi_audio_t audio_para; diff --git a/sound/soc/sunxi/hdmiaudio/sndhdmi.c b/sound/soc/sunxi/hdmiaudio/sndhdmi.c index 1c306d2..4563010 100644 --- a/sound/soc/sunxi/hdmiaudio/sndhdmi.c +++ b/sound/soc/sunxi/hdmiaudio/sndhdmi.c @@ -85,7 +85,9 @@ static int sndhdmi_hw_params(struct snd_pcm_substream *substream, return -EINVAL; } - if (4 == hdmi_para.channel_num) + if (2 < hdmi_para.channel_num) + hdmi_para.channel_num = 8; + if (2 > hdmi_para.channel_num) hdmi_para.channel_num = 2; g_hdmi_func.hdmi_set_audio_para(&hdmi_para); @@ -129,11 +131,11 @@ struct snd_soc_dai_ops sndhdmi_dai_ops = { /* codec dai */ struct snd_soc_dai_driver sndhdmi_dai = { .name = "sndhdmi", - /* playback capabilities */ + /* playback capabilities, hdmi_core::audio_config() claims 8ch cap */ .playback = { .stream_name = "Playback", - .channels_min = 1, - .channels_max = 2, + .channels_min = 2, + .channels_max = 8, .rates = SNDHDMI_RATES, .formats = SNDHDMI_FORMATS, }, diff --git a/sound/soc/sunxi/hdmiaudio/sunxi-hdmiaudio.c b/sound/soc/sunxi/hdmiaudio/sunxi-hdmiaudio.c index 12da1a6..80dd3b9 100644 --- a/sound/soc/sunxi/hdmiaudio/sunxi-hdmiaudio.c +++ b/sound/soc/sunxi/hdmiaudio/sunxi-hdmiaudio.c @@ -34,8 +34,8 @@ #include #include -static struct sunxi_dma_params sunxi_hdmiaudio_pcm_stereo_out = { - .client.name = "HDMIAUDIO PCM Stereo out", +static struct sunxi_dma_params sunxi_hdmiaudio_pcm_iec60958_out = { + .client.name = "HDMIAUDIO PCM IEC60958 out", #if defined CONFIG_ARCH_SUN4I || defined CONFIG_ARCH_SUN5I .channel = DMACH_HDMIAUDIO, #endif @@ -67,7 +67,7 @@ static int sunxi_hdmiaudio_hw_params(struct snd_pcm_substream *substream, rtd = substream->private_data; if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK) - dma_data = &sunxi_hdmiaudio_pcm_stereo_out; + dma_data = &sunxi_hdmiaudio_pcm_iec60958_out; else printk("error:hdmiaudio can't support capture:%s,line:%d\n", __func__, __LINE__); @@ -182,8 +182,8 @@ static struct snd_soc_dai_driver sunxi_hdmiaudio_dai = { .resume = sunxi_hdmiaudio_resume, .remove = sunxi_hdmiaudio_dai_remove, .playback = { - .channels_min = 1, - .channels_max = 2, + .channels_min = 2, + .channels_max = 8, .rates = SUNXI_HDMI_RATES, .formats = SNDRV_PCM_FMTBIT_S16_LE | SNDRV_PCM_FMTBIT_S32_LE, }, diff --git a/sound/soc/sunxi/hdmiaudio/sunxi-hdmipcm.c b/sound/soc/sunxi/hdmiaudio/sunxi-hdmipcm.c index 4916b51..9ab01ee 100644 --- a/sound/soc/sunxi/hdmiaudio/sunxi-hdmipcm.c +++ b/sound/soc/sunxi/hdmiaudio/sunxi-hdmipcm.c @@ -45,8 +45,8 @@ static const struct snd_pcm_hardware sunxi_pcm_hardware = { SNDRV_PCM_RATE_KNOT, .rate_min = 8000, .rate_max = 192000, - .channels_min = 1, - .channels_max = 2, + .channels_min = 2, + .channels_max = 8, .buffer_bytes_max = 128*1024, /* value must be (2^n)Kbyte size */ .period_bytes_min = 1024*4, .period_bytes_max = 1024*32,