Re: [PATCH 3.2 042/221] ALSA: hdspm - Constrain periods to 2 on older cards

Ben Hutchings
2015-05-05T12:57:43Z

[-- Attachment #1: Type: text/plain, Size: 1936 bytes --]

On Tue, 2015-05-05 at 14:46 +0200, Adrian Knoth wrote:
> On 05/05/15 03:16, Ben Hutchings wrote:
>
> > 3.2.69-rc1 review patch. If anyone has any objections, please let me know.
>
> I do! :)
>
> >
> > From: Adrian Knoth <adi@drcomp.erfurt.thur.de>
> >
> > commit f0153c3d948c1764f6c920a0675d86fc1d75813e upstream.
> >
> > RME RayDAT and AIO use a fixed buffer size of 16384 samples. With period
> > sizes of 32-4096, this translates to 4-512 periods.
> >
> > The older RME cards have a variable buffer size but require exactly two
> > periods.
> >
> > This patch enforces nperiods=2 on those cards.
> >
> > Signed-off-by: Adrian Knoth <adi@drcomp.erfurt.thur.de>
> > Signed-off-by: Takashi Iwai <tiwai@suse.de>
> > Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
> > ---
> > sound/pci/rme9652/hdspm.c | 6 ++++++
> > 1 file changed, 6 insertions(+)
> >
> > --- a/sound/pci/rme9652/hdspm.c
> > +++ b/sound/pci/rme9652/hdspm.c
> > @@ -6040,6 +6040,12 @@ static int snd_hdspm_capture_open(struct
> > snd_pcm_hw_constraint_minmax(runtime,
> > SNDRV_PCM_HW_PARAM_PERIOD_SIZE,
> > 64, 8192);
> > + snd_pcm_hw_constraint_minmax(runtime,
> > + SNDRV_PCM_HW_PARAM_PERIODS,
> > + 2, 2);
> > + snd_pcm_hw_constraint_minmax(runtime,
> > + SNDRV_PCM_HW_PARAM_PERIODS,
> > + 2, 2);
> > break;
> > }
>
> This is not correct, those lines need to go to two different functions
> (snd_hdspm_playback_open and snd_hdspm_capture_open)
>
> Here is how the patch should look like:

Thanks, I've now fixed it.

[...]
> PS: This exact same problem happened to GregKH for one of his stable
> branches. Not sure what's the root cause and if it's worth
> investigating.

It's a bug in patch: https://bugs.debian.org/717782

Ben.

--
Ben Hutchings
Once a job is fouled up, anything done to improve it makes it worse.

[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 811 bytes --]