From: Takashi Iwai Subject: Re: ALSA patch Nvidia 8 channel hdmi audio Date: Thu, 04 Jun 2009 08:33:56 +0200 Message-ID: References: <410e92830906021458x3d47a1d6jebba8bbe1150e76d@mail.gmail.com> <410e92830906021530l767478c4tae72c4b161583b6@mail.gmail.com> <200906030200.54455.marek.vasut@gmail.com> <15F501D1A78BD343BE8F4D8DB854566B058A63F1@hkemmail01.nvidia.com> <410e92830906030100m5a3d045dsa856382fa2396e60@mail.gmail.com> <410e92830906030234u49a1e618kdf2d1e0550f00cdc@mail.gmail.com> <410e92830906031628t64c4cbf3y104062f2147ea44d@mail.gmail.com> <410e92830906032318v4ed6987cr41c8f73a8a54a9e6@mail.gmail.com> Mime-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Return-path: Received: from mx1.suse.de (cantor.suse.de [195.135.220.2]) by alsa0.perex.cz (Postfix) with ESMTP id ADF5D243B6 for ; Thu, 4 Jun 2009 08:33:59 +0200 (CEST) In-Reply-To: <410e92830906032318v4ed6987cr41c8f73a8a54a9e6@mail.gmail.com> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: alsa-devel-bounces@alsa-project.org Errors-To: alsa-devel-bounces@alsa-project.org To: Alan Alan Cc: Peer Chen , Marek Vasut , Wei Ni , alsa-devel@alsa-project.org List-Id: alsa-devel@alsa-project.org At Thu, 4 Jun 2009 08:18:23 +0200, Alan Alan wrote: > = > 2009/6/4 Takashi Iwai > = > At Thu, 4 Jun 2009 01:28:24 +0200, > Alan Alan wrote: > > > > Hello Takashi ! > > > > I tried to apply the patch that removes restrictions to 16bits 48khz > format. > > Well now we have the following: > > 16bit 48khz=A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 = =A0 =A0 =A0 =A0=A0 works > > 32bit 48khz =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0= =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 works > > 32bit 44khz, 96khz, 192khz =A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 don= 't work > > 24bit 44khz, 48khz, 96khz, 192khz=A0=A0 don't work > > 16bit 44khz, 96khz, 192khz=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0=A0 d= on't work > > > > I only get > > Sample format not available for playback: > > Setting of hwparams failed: > = > As you can find in alsa-info output, it seems that the codec supports > only 48kHz and 88.2kHz, strangely. =A0I don't know whether it's a > (hardware) bug or not. > = > The codec surely supports up to 192khz as it works on Windows. > = > I think this line is completely wrong as here it says: It is not "wrong". These are values that the codec reports, so it's more or less correct as the h/w information. > =A0 rates [0xc0]: 48000 88200 Wei, is it right? Or is anything missing here? > =A0=A0=A0 bits [0xf]: 8 16 20 24 > = > 8, 20, 24bits are supported, but they all give an error message. 24bit here means 24bit in 4 bytes, thus it's essentially 32bit format. 24bit in 3 bytes format isn't supported on HD-audio. > 32 bits are not supposed to be supported but it works with 48 and 88.2khz. > = > How can we change the software side to accept 96 or 192khz spample format= s and > 24 bits ? As long as the codec reports so, it's no "software" problem. > I think it is not hardware limited and we just need to change the allowed > formats to be played. If it's just a hardware problem that reports wrong values, you can override the information, simply replacing the bits my patch disabled to the right values. Takashi > = > > > > I enclosed to pastebin my alsainfo script output. > > > > http://pastebin.com/m77dcfb3f > > > > Thanks for the help ! > > > > 2009/6/3 Takashi Iwai > > > > =A0 =A0 At Wed, 3 Jun 2009 11:34:00 +0200, > > =A0 =A0 Alan Alan wrote: > > =A0 =A0 > > > =A0 =A0 > Hello Takashi ! > > =A0 =A0 > > > =A0 =A0 > What should this patch do ? > > > > =A0 =A0 The patch removes the restriction patch_nvhdmi.c sets. =A0I= nstead, > > =A0 =A0 the driver tries to detect the supported format, rate, etc = from the > > =A0 =A0 codec widget information. > > > > =A0 =A0 > Is it a cure for the 96, 192khz or 24bit sample playback = problem ? > > > > =A0 =A0 Possibly. > > > > =A0 =A0 > If so, will it resample or natievly pass the stream to the > amplifier ? > > > > =A0 =A0 It just enables the native support, possibly. > > > > =A0 =A0 And, don't forget to give back the alsa-info.sh output (run= with > > =A0 =A0 --no-upload option). > > > > =A0 =A0 Takashi > > > > =A0 =A0 > > > =A0 =A0 > Thank you > > =A0 =A0 > > > =A0 =A0 > Alan > > =A0 =A0 > > > =A0 =A0 > 2009/6/3 Takashi Iwai > > =A0 =A0 > > > =A0 =A0 > =A0 =A0 At Wed, 3 Jun 2009 10:00:24 +0200, > > =A0 =A0 > =A0 =A0 Alan Alan wrote: > > =A0 =A0 > =A0 =A0 > > > =A0 =A0 > =A0 =A0 > Hello Wei ! > > =A0 =A0 > =A0 =A0 > > > =A0 =A0 > =A0 =A0 > Thanks for replying. > > =A0 =A0 > =A0 =A0 > I tested it with speaker-test and xbmc babylon.= Both had > problems > > =A0 =A0 with > > =A0 =A0 > =A0 =A0 > channel mapping. > > =A0 =A0 > =A0 =A0 > I used this command: > > =A0 =A0 > =A0 =A0 > > > =A0 =A0 > =A0 =A0 > speaker-test -Dhdmi -c6 > > =A0 =A0 > =A0 =A0 > or > > =A0 =A0 > =A0 =A0 > speaker-test -Dhdmi -c8 > > =A0 =A0 > =A0 =A0 > > > =A0 =A0 > =A0 =A0 > alternatively you could try > > =A0 =A0 > =A0 =A0 > > > =A0 =A0 > =A0 =A0 > speaker-test -Dhw:0,3 -c6 > > =A0 =A0 > =A0 =A0 > > > =A0 =A0 > =A0 =A0 > > > =A0 =A0 > =A0 =A0 > I had to rund Xorg first and have the command f= rom an xterm, > > =A0 =A0 becasue > > =A0 =A0 > =A0 =A0 from a > > =A0 =A0 > =A0 =A0 > normal terminal it would not work. > > =A0 =A0 > =A0 =A0 > I think that is normal as a limitation of hdmi. > > =A0 =A0 > =A0 =A0 > > > =A0 =A0 > =A0 =A0 > What about the support for 24bits 192khz sound ? > > =A0 =A0 > =A0 =A0 > > > =A0 =A0 > =A0 =A0 > speaker-test -Dhdmi -c6 =A0-r192000 does not wo= rk. > > =A0 =A0 > > > =A0 =A0 > =A0 =A0 How about the patch below? > > =A0 =A0 > > > =A0 =A0 > =A0 =A0 Also, could you give alsa-info.sh output? > > =A0 =A0 > > > =A0 =A0 > =A0 =A0 Takashi > > =A0 =A0 > > > =A0 =A0 > =A0 =A0 --- > > =A0 =A0 > =A0 =A0 diff --git a/sound/pci/hda/patch_nvhdmi.c b/sound= /pci/hda/ > > =A0 =A0 patch_nvhdmi.c > > =A0 =A0 > =A0 =A0 index f5792e2..48443de 100644 > > =A0 =A0 > =A0 =A0 --- a/sound/pci/hda/patch_nvhdmi.c > > =A0 =A0 > =A0 =A0 +++ b/sound/pci/hda/patch_nvhdmi.c > > =A0 =A0 > =A0 =A0 @@ -258,9 +258,11 @@ static struct hda_pcm_stream > > =A0 =A0 > =A0 =A0 nvhdmi_pcm_digital_playback_8ch =3D { > > =A0 =A0 > =A0 =A0 =A0 =A0 =A0 =A0.channels_min =3D 2, > > =A0 =A0 > =A0 =A0 =A0 =A0 =A0 =A0.channels_max =3D 8, > > =A0 =A0 > =A0 =A0 =A0 =A0 =A0 =A0.nid =3D Nv_Master_Convert_nid, > > =A0 =A0 > =A0 =A0 +#if 0 > > =A0 =A0 > =A0 =A0 =A0 =A0 =A0 =A0.rates =3D SNDRV_PCM_RATE_48000, > > =A0 =A0 > =A0 =A0 =A0 =A0 =A0 =A0.maxbps =3D 16, > > =A0 =A0 > =A0 =A0 =A0 =A0 =A0 =A0.formats =3D SNDRV_PCM_FMTBIT_S16_= LE, > > =A0 =A0 > =A0 =A0 +#endif > > =A0 =A0 > =A0 =A0 =A0 =A0 =A0 =A0.ops =3D { > > =A0 =A0 > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0.open =3D nvhdmi_d= ig_playback_pcm_open, > > =A0 =A0 > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0.close =3D nvhdmi_= dig_playback_pcm_close_8ch, > > =A0 =A0 > =A0 =A0 @@ -273,9 +275,11 @@ static struct hda_pcm_stream > > =A0 =A0 > =A0 =A0 nvhdmi_pcm_digital_playback_2ch =3D { > > =A0 =A0 > =A0 =A0 =A0 =A0 =A0 =A0.channels_min =3D 2, > > =A0 =A0 > =A0 =A0 =A0 =A0 =A0 =A0.channels_max =3D 2, > > =A0 =A0 > =A0 =A0 =A0 =A0 =A0 =A0.nid =3D Nv_Master_Convert_nid, > > =A0 =A0 > =A0 =A0 +#if 0 > > =A0 =A0 > =A0 =A0 =A0 =A0 =A0 =A0.rates =3D SNDRV_PCM_RATE_48000, > > =A0 =A0 > =A0 =A0 =A0 =A0 =A0 =A0.maxbps =3D 16, > > =A0 =A0 > =A0 =A0 =A0 =A0 =A0 =A0.formats =3D SNDRV_PCM_FMTBIT_S16_= LE, > > =A0 =A0 > =A0 =A0 +#endif > > =A0 =A0 > =A0 =A0 =A0 =A0 =A0 =A0.ops =3D { > > =A0 =A0 > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0.open =3D nvhdmi_d= ig_playback_pcm_open, > > =A0 =A0 > =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0 =A0.close =3D nvhdmi_= dig_playback_pcm_close_2ch, > > =A0 =A0 > > > =A0 =A0 > > > > > > = > =