Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751931AbdHAPv7 (ORCPT ); Tue, 1 Aug 2017 11:51:59 -0400 Received: from mx08-00178001.pphosted.com ([91.207.212.93]:36535 "EHLO mx07-00178001.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751701AbdHAPvD (ORCPT ); Tue, 1 Aug 2017 11:51:03 -0400 Subject: Re: [alsa-devel] [PATCH v2 2/2] drm/bridge: adv7511: restrict audio sample sizes To: Srinivas Kandagatla , Mark Brown CC: Jyri Sarha , "alsa-devel@alsa-project.org" , Archit Taneja , David Airlie , "linux-kernel@vger.kernel.org" , Liam Girdwood , "dri-devel@lists.freedesktop.org" , Takashi Iwai , Andrzej Hajda References: <20170731224944.9986-1-srinivas.kandagatla@linaro.org> <20170731224944.9986-3-srinivas.kandagatla@linaro.org> <7d700845-da72-5c40-31f9-c3faa7ca93a2@st.com> <20170801122840.6demhukafhtpeaby@sirena.org.uk> From: Arnaud Pouliquen Message-ID: <3bf60afb-d260-badd-7340-6d54a4decd62@st.com> Date: Tue, 1 Aug 2017 17:50:03 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.2.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="windows-1252" Content-Language: en-US Content-Transfer-Encoding: 8bit X-Originating-IP: [10.75.127.46] X-ClientProxiedBy: SFHDAG4NODE2.st.com (10.75.127.11) To SFHDAG3NODE1.st.com (10.75.127.7) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-08-01_08:,, signatures=0 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1408 Lines: 34 Hello Srinivas, On 08/01/2017 02:52 PM, Srinivas Kandagatla wrote: >>>> As example, if you configure bus in Left justified format with 24 bits >>>> sample length, 32 bits application samples should be truncated to 24 >>>> bits samples at ADV7533 I2S interface level (LSB dropped). >> >>> May be we can do that to make the user happy but isn't this just truncate >>> the resolution to 24Bit then? >> >>> And it's a false indication that we are supporting 32bit samples. >>> Which am not very happy with. >> >> This is what the sample_bits field in the DAI structure is for.ya. > But still reporting that driver supports 32 bit samples when it does not > really support all 32 bits, is kinda misleading to user. > Isn't it? > > And the driver would be end up with hacked up code for each case. By experience, this is usual. As example, if you have a look to codec ad193x (i take one randomly) it support 16, 20, 24 and 32 bits frames. But if you have a look to AD1939 data-sheet it supports 24-bits conversion. Some other examples could be 13-bits DAC/ADC with 16 bits samples. In term of audio quality, truncation to a 24 bits sample should generate an negligible additional error equal to the LSB bit: -20log(2^24)= -144dB. It is just a personal opinion, but if have the choice between do truncation in software (application or alsa-lib) and in hardware, i would prefer the second one. Regards arnaud