All of lore.kernel.org
 help / color / mirror / Atom feed
From: Takashi Iwai <tiwai@suse.de>
To: Anssi Hannula <anssi.hannula@iki.fi>
Cc: alsa-devel@alsa-project.org, Nitin Daga <ndaga@nvidia.com>
Subject: Re: [PATCH] ALSA: hda: Disable 4/6 channels on some NVIDIA	GPUs.
Date: Tue, 11 Jan 2011 20:06:10 +0100	[thread overview]
Message-ID: <s5hsjwzi7kt.wl%tiwai@suse.de> (raw)
In-Reply-To: <4D2C8F59.4040507@iki.fi>

At Tue, 11 Jan 2011 19:11:53 +0200,
Anssi Hannula wrote:
> 
> On 10.01.2011 18:19, Nitin Daga wrote:
> > Added hardware constraint in patch_hdmi.c to disable
> > channels 4/6 which are not supported by some older
> > NVIDIA GPUs.
> 
> And 3/5/7, which do not seem to work either with my 0x0007.
> 
> However, 3/5/7 do not work with my 0x000b system either, is this a hw
> limitation as well (that should be added to the driver) or is there a
> bug in the HDA driver for uneven channel counts?

In theory yes, but I don't know any really working codecs.  It seems
that codecs (or controllers?) are designed to take always
stereo-pairs.

Maybe we can put a hw_constraint in hda_intel.c.


thanks,

Takashi

> (I looked at the HDA specification and it does seem to allow
> odd-numbered channel counts)
> 
> Strangely, on both of my systems speaker-test -c5 fails with an error:
> 
> $ speaker-test -Dhdmi -c5
> 
> speaker-test 1.0.23
> 
> Playback device is hdmi
> Stream parameters are 48000Hz, S16_LE, 5 channels
> Using 16 octaves of pink noise
> Rate set to 48000Hz (requested 48000Hz)
> Buffer size range from 128 to 419392
> Period size range from 64 to 209664
> Using max buffer size 419392
> Periods = 4
> Unable to set nperiods 4 for playback: No such file or directory
> Setting of hwparams failed: No such file or directory
> 
> While -c3 and -c7 run fine but no sound is received.
> 
> 
> > Signed-off-by: Nitin Daga <ndaga@nvidia.com>
> > Acked-By: Stephen Warren <swarren@nvidia.com>
> > ---
> >  pci/hda/patch_hdmi.c |   42 ++++++++++++++++++++++++++++++++++++++++++
> >  1 files changed, 42 insertions(+), 0 deletions(-)
> > 
> > diff --git a/pci/hda/patch_hdmi.c b/pci/hda/patch_hdmi.c
> > index d3e49aa..ddde59b 100644
> > --- a/pci/hda/patch_hdmi.c
> > +++ b/pci/hda/patch_hdmi.c
> > @@ -1166,11 +1166,53 @@ static int nvhdmi_7x_init(struct hda_codec *codec)
> >  	return 0;
> >  }
> >  
> > +static unsigned int channels_2_6_8[] = {
> > +	2, 6, 8
> > +};
> > +
> > +static unsigned int channels_2_8[] = {
> > +	2, 8
> > +};
> > +
> > +static struct snd_pcm_hw_constraint_list hw_constraints_2_6_8_channels = {
> > +	.count = ARRAY_SIZE(channels_2_6_8),
> > +	.list = channels_2_6_8,
> > +	.mask = 0,
> > +};
> > +
> > +static struct snd_pcm_hw_constraint_list hw_constraints_2_8_channels = {
> > +	.count = ARRAY_SIZE(channels_2_8),
> > +	.list = channels_2_8,
> > +	.mask = 0,
> > +};
> > +
> >  static int simple_playback_pcm_open(struct hda_pcm_stream *hinfo,
> >  				    struct hda_codec *codec,
> >  				    struct snd_pcm_substream *substream)
> >  {
> >  	struct hdmi_spec *spec = codec->spec;
> > +	struct snd_pcm_hw_constraint_list *hw_constraints_channels = NULL;
> > +
> > +	switch (codec->preset->id) {
> > +	case 0x10de0002:
> > +	case 0x10de0003:
> > +	case 0x10de0005:
> > +	case 0x10de0006:
> > +		hw_constraints_channels = &hw_constraints_2_8_channels;
> > +		break;
> > +	case 0x10de0007:
> > +		hw_constraints_channels = &hw_constraints_2_6_8_channels;
> > +		break;
> > +	default:
> > +		break;
> > +	}
> > +
> > +	if (hw_constraints_channels != NULL) {
> > +		snd_pcm_hw_constraint_list(substream->runtime, 0,
> > +				SNDRV_PCM_HW_PARAM_CHANNELS,
> > +				hw_constraints_channels);
> > +	}
> > +
> >  	return snd_hda_multi_out_dig_open(codec, &spec->multiout);
> >  }
> >  
> 
> 
> -- 
> Anssi Hannula
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
> 

  parent reply	other threads:[~2011-01-11 19:06 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-10 16:19 [PATCH] ALSA: hda: Disable 4/6 channels on some NVIDIA GPUs Nitin Daga
2011-01-11 17:11 ` Anssi Hannula
2011-01-11 17:41   ` Stephen Warren
2011-01-12  4:11     ` Anssi Hannula
2011-01-12 16:42       ` Stephen Warren
2011-01-12 17:11         ` Anssi Hannula
2011-01-11 19:06   ` Takashi Iwai [this message]
2011-01-11 19:01 ` Takashi Iwai

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=s5hsjwzi7kt.wl%tiwai@suse.de \
    --to=tiwai@suse.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=anssi.hannula@iki.fi \
    --cc=ndaga@nvidia.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.