perex a7e045
From a13707da6bb0161db855a146c3e4d1d849e4108b Mon Sep 17 00:00:00 2001
perex a7e045
From: Jaroslav Kysela <perex@perex.cz>
perex a7e045
Date: Tue, 9 Sep 2008 13:07:39 +0200
perex a7e045
Subject: [PATCH] pcm_softvol plugin: remove access type change for refine
perex a7e045
perex a7e045
The softvol plugin does in-place sample recalculation. The access type
perex a7e045
cannot be changed like in linear plugins. Remove access type change
perex a7e045
in refine functions.
perex a7e045
perex a7e045
This bug was detected with PulseAudio on Sony PS3 platform.
perex a7e045
perex a7e045
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
perex a7e045
---
perex a7e045
 src/pcm/pcm_softvol.c |   14 ++++----------
perex a7e045
 1 files changed, 4 insertions(+), 10 deletions(-)
perex a7e045
perex a7e045
diff --git a/src/pcm/pcm_softvol.c b/src/pcm/pcm_softvol.c
perex a7e045
index eee6424..8268f1d 100644
perex a7e045
--- a/src/pcm/pcm_softvol.c
perex a7e045
+++ b/src/pcm/pcm_softvol.c
perex a7e045
@@ -399,7 +399,6 @@ static int snd_pcm_softvol_hw_refine_cprepare(snd_pcm_t *pcm,
perex a7e045
 {
perex a7e045
 	int err;
perex a7e045
 	snd_pcm_softvol_t *svol = pcm->private_data;
perex a7e045
-	snd_pcm_access_mask_t access_mask = { SND_PCM_ACCBIT_SHM };
perex a7e045
 	snd_pcm_format_mask_t format_mask = {
perex a7e045
 		{
perex a7e045
 			(1ULL << SND_PCM_FORMAT_S16_LE) |
perex a7e045
@@ -413,10 +412,6 @@ static int snd_pcm_softvol_hw_refine_cprepare(snd_pcm_t *pcm,
perex a7e045
 		snd_pcm_format_mask_none(&format_mask);
perex a7e045
 		snd_pcm_format_mask_set(&format_mask, svol->sformat);
perex a7e045
 	}
perex a7e045
-	err = _snd_pcm_hw_param_set_mask(params, SND_PCM_HW_PARAM_ACCESS,
perex a7e045
-					 &access_mask);
perex a7e045
-	if (err < 0)
perex a7e045
-		return err;
perex a7e045
 	err = _snd_pcm_hw_param_set_mask(params, SND_PCM_HW_PARAM_FORMAT,
perex a7e045
 					 &format_mask);
perex a7e045
 	if (err < 0)
perex a7e045
@@ -434,10 +429,7 @@ static int snd_pcm_softvol_hw_refine_cprepare(snd_pcm_t *pcm,
perex a7e045
 static int snd_pcm_softvol_hw_refine_sprepare(snd_pcm_t *pcm, snd_pcm_hw_params_t *sparams)
perex a7e045
 {
perex a7e045
 	snd_pcm_softvol_t *svol = pcm->private_data;
perex a7e045
-	snd_pcm_access_mask_t saccess_mask = { SND_PCM_ACCBIT_MMAP };
perex a7e045
 	_snd_pcm_hw_params_any(sparams);
perex a7e045
-	_snd_pcm_hw_param_set_mask(sparams, SND_PCM_HW_PARAM_ACCESS,
perex a7e045
-				   &saccess_mask);
perex a7e045
 	if (svol->sformat != SND_PCM_FORMAT_UNKNOWN) {
perex a7e045
 		_snd_pcm_hw_params_set_format(sparams, svol->sformat);
perex a7e045
 		_snd_pcm_hw_params_set_subformat(sparams, SND_PCM_SUBFORMAT_STD);
perex a7e045
@@ -451,7 +443,8 @@ static int snd_pcm_softvol_hw_refine_schange(snd_pcm_t *pcm,
perex a7e045
 {
perex a7e045
 	snd_pcm_softvol_t *svol = pcm->private_data;
perex a7e045
 	int err;
perex a7e045
-	unsigned int links = (SND_PCM_HW_PARBIT_CHANNELS |
perex a7e045
+	unsigned int links = (SND_PCM_HW_PARBIT_ACCESS |
perex a7e045
+			      SND_PCM_HW_PARBIT_CHANNELS |
perex a7e045
 			      SND_PCM_HW_PARBIT_RATE |
perex a7e045
 			      SND_PCM_HW_PARBIT_PERIODS |
perex a7e045
 			      SND_PCM_HW_PARBIT_PERIOD_SIZE |
perex a7e045
@@ -475,7 +468,8 @@ static int snd_pcm_softvol_hw_refine_cchange(snd_pcm_t *pcm,
perex a7e045
 {
perex a7e045
 	snd_pcm_softvol_t *svol = pcm->private_data;
perex a7e045
 	int err;
perex a7e045
-	unsigned int links = (SND_PCM_HW_PARBIT_CHANNELS |
perex a7e045
+	unsigned int links = (SND_PCM_HW_PARBIT_ACCESS |
perex a7e045
+			      SND_PCM_HW_PARBIT_CHANNELS |
perex a7e045
 			      SND_PCM_HW_PARBIT_RATE |
perex a7e045
 			      SND_PCM_HW_PARBIT_PERIODS |
perex a7e045
 			      SND_PCM_HW_PARBIT_PERIOD_SIZE |
perex a7e045
-- 
perex a7e045
1.5.5.1
perex a7e045