All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH - asihpi 2/2] Disable S24_3LE incompatible with 2^N buffer size.
@ 2008-06-19  2:15 linux
  2008-06-19  8:30 ` Jaroslav Kysela
  2008-06-19  9:39 ` Takashi Iwai
  0 siblings, 2 replies; 3+ messages in thread
From: linux @ 2008-06-19  2:15 UTC (permalink / raw)
  To: tiwai; +Cc: Eliot Blennerhassett, alsa-devel

From: Eliot Blennerhassett <eblennerhassett@audioscience.com>


Signed-off-by: Eliot Blennerhassett <eblennerhassett@audioscience.com>

diff --git a/pci/asihpi/asihpi.c b/pci/asihpi/asihpi.c
index ab90b08..c715ad2 100644
--- a/pci/asihpi/asihpi.c
+++ b/pci/asihpi/asihpi.c
@@ -328,21 +328,28 @@ static void print_hwparams(struct snd_pcm_hw_params *p)
 
 static snd_pcm_format_t hpi_to_alsa_formats[] = {
 	-1,			/* INVALID */
-	SNDRV_PCM_FORMAT_U8,	/* { HPI_FORMAT_PCM8_UNSIGNED        1 */
-	SNDRV_PCM_FORMAT_S16,	/* { HPI_FORMAT_PCM16_SIGNED         2 */
-	-1,			/* { HPI_FORMAT_MPEG_L1              3 */
-	SNDRV_PCM_FORMAT_MPEG,	/* { HPI_FORMAT_MPEG_L2              4 */
-	SNDRV_PCM_FORMAT_MPEG,	/* { HPI_FORMAT_MPEG_L3              5 */
-	-1,			/* { HPI_FORMAT_DOLBY_AC2            6 */
-	-1,			/* { HPI_FORMAT_DOLBY_AC3            7 */
-	SNDRV_PCM_FORMAT_S16_BE,/* { HPI_FORMAT_PCM16_BIGENDIAN      8 */
-	-1,			/* { HPI_FORMAT_AA_TAGIT1_HITS       9 */
-	-1,			/* { HPI_FORMAT_AA_TAGIT1_INSERTS   10 */
-	SNDRV_PCM_FORMAT_S32,	/* { HPI_FORMAT_PCM32_SIGNED        11 */
-	-1,			/* { HPI_FORMAT_RAW_BITSTREAM       12 */
-	-1,			/* { HPI_FORMAT_AA_TAGIT1_HITS_EX1  13 */
-	SNDRV_PCM_FORMAT_FLOAT,	/* { HPI_FORMAT_PCM32_FLOAT         14 */
-	SNDRV_PCM_FORMAT_S24	/* { HPI_FORMAT_PCM24_SIGNED        15 */
+	SNDRV_PCM_FORMAT_U8,	/* HPI_FORMAT_PCM8_UNSIGNED        1 */
+	SNDRV_PCM_FORMAT_S16,	/* HPI_FORMAT_PCM16_SIGNED         2 */
+	-1,			/* HPI_FORMAT_MPEG_L1              3 */
+	SNDRV_PCM_FORMAT_MPEG,	/* HPI_FORMAT_MPEG_L2              4 */
+	SNDRV_PCM_FORMAT_MPEG,	/* HPI_FORMAT_MPEG_L3              5 */
+	-1,			/* HPI_FORMAT_DOLBY_AC2            6 */
+	-1,			/* HPI_FORMAT_DOLBY_AC3            7 */
+	SNDRV_PCM_FORMAT_S16_BE,/* HPI_FORMAT_PCM16_BIGENDIAN      8 */
+	-1,			/* HPI_FORMAT_AA_TAGIT1_HITS       9 */
+	-1,			/* HPI_FORMAT_AA_TAGIT1_INSERTS   10 */
+	SNDRV_PCM_FORMAT_S32,	/* HPI_FORMAT_PCM32_SIGNED        11 */
+	-1,			/* HPI_FORMAT_RAW_BITSTREAM       12 */
+	-1,			/* HPI_FORMAT_AA_TAGIT1_HITS_EX1  13 */
+	SNDRV_PCM_FORMAT_FLOAT,	/* HPI_FORMAT_PCM32_FLOAT         14 */
+#if 1
+	/* ALSA can't handle 3 byte sample size together with power-of-2
+	 *  constraint on buffer_bytes, so disable this format
+	 */
+	-1
+#else
+	/* SNDRV_PCM_FORMAT_S24_3LE */	/* { HPI_FORMAT_PCM24_SIGNED        15 */
+#endif
 };
 
 
@@ -978,7 +985,7 @@ static int snd_card_asihpi_playback_open(struct snd_pcm_substream *substream)
 	runtime->hw = snd_card_asihpi_playback;
 	/* Strictly only necessary for HPI6205 adapters */
 	err = snd_pcm_hw_constraint_pow2(runtime, 0,
-					SNDRV_PCM_HW_PARAM_BUFFER_SIZE);
+					SNDRV_PCM_HW_PARAM_BUFFER_BYTES);
 	if (err < 0)
 		return err;
 
@@ -1195,7 +1202,7 @@ static int snd_card_asihpi_capture_open(struct snd_pcm_substream *substream)
 
 	/* Strictly only necessary for HPI6205 adapters */
 	err = snd_pcm_hw_constraint_pow2(runtime, 0,
-					SNDRV_PCM_HW_PARAM_BUFFER_SIZE);
+					SNDRV_PCM_HW_PARAM_BUFFER_BYTES);
 	if (err < 0)
 		return err;
 
@@ -2025,6 +2032,7 @@ static int snd_asihpi_meter_get(struct snd_kcontrol *kcontrol,
 	short anGain0_01dB[HPI_MAX_CHANNELS], i;
 	u16 err;
 
+	//err = HPI_MeterGetRms(phSubSys, hControl, anGain0_01dB);
 	err = HPI_MeterGetPeak(phSubSys, hControl, anGain0_01dB);
 
 	for (i = 0; i < HPI_MAX_CHANNELS; i++) {
-- 
1.5.4.3

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH - asihpi 2/2] Disable S24_3LE incompatible with 2^N buffer size.
  2008-06-19  2:15 [PATCH - asihpi 2/2] Disable S24_3LE incompatible with 2^N buffer size linux
@ 2008-06-19  8:30 ` Jaroslav Kysela
  2008-06-19  9:39 ` Takashi Iwai
  1 sibling, 0 replies; 3+ messages in thread
From: Jaroslav Kysela @ 2008-06-19  8:30 UTC (permalink / raw)
  To: linux; +Cc: Eliot Blennerhassett, ALSA development

On Thu, 19 Jun 2008 linux@audioscience.com wrote:

> From: Eliot Blennerhassett <eblennerhassett@audioscience.com>
> 
> 
> Signed-off-by: Eliot Blennerhassett <eblennerhassett@audioscience.com>

Applied.

					Jaroslav

-----
Jaroslav Kysela <perex@perex.cz>
Linux Kernel Sound Maintainer
ALSA Project, Red Hat, Inc.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH - asihpi 2/2] Disable S24_3LE incompatible with 2^N buffer size.
  2008-06-19  2:15 [PATCH - asihpi 2/2] Disable S24_3LE incompatible with 2^N buffer size linux
  2008-06-19  8:30 ` Jaroslav Kysela
@ 2008-06-19  9:39 ` Takashi Iwai
  1 sibling, 0 replies; 3+ messages in thread
From: Takashi Iwai @ 2008-06-19  9:39 UTC (permalink / raw)
  To: linux; +Cc: Eliot Blennerhassett, alsa-devel

At Thu, 19 Jun 2008 14:15:13 +1200,
linux@audioscience.com wrote:
> 
> From: Eliot Blennerhassett <eblennerhassett@audioscience.com>
> 
> 
> Signed-off-by: Eliot Blennerhassett <eblennerhassett@audioscience.com>
> 
> diff --git a/pci/asihpi/asihpi.c b/pci/asihpi/asihpi.c
> index ab90b08..c715ad2 100644
> --- a/pci/asihpi/asihpi.c
> +++ b/pci/asihpi/asihpi.c
> @@ -328,21 +328,28 @@ static void print_hwparams(struct snd_pcm_hw_params *p)
>  
>  static snd_pcm_format_t hpi_to_alsa_formats[] = {
>  	-1,			/* INVALID */
> -	SNDRV_PCM_FORMAT_U8,	/* { HPI_FORMAT_PCM8_UNSIGNED        1 */
> -	SNDRV_PCM_FORMAT_S16,	/* { HPI_FORMAT_PCM16_SIGNED         2 */
> -	-1,			/* { HPI_FORMAT_MPEG_L1              3 */
> -	SNDRV_PCM_FORMAT_MPEG,	/* { HPI_FORMAT_MPEG_L2              4 */
> -	SNDRV_PCM_FORMAT_MPEG,	/* { HPI_FORMAT_MPEG_L3              5 */
> -	-1,			/* { HPI_FORMAT_DOLBY_AC2            6 */
> -	-1,			/* { HPI_FORMAT_DOLBY_AC3            7 */
> -	SNDRV_PCM_FORMAT_S16_BE,/* { HPI_FORMAT_PCM16_BIGENDIAN      8 */
> -	-1,			/* { HPI_FORMAT_AA_TAGIT1_HITS       9 */
> -	-1,			/* { HPI_FORMAT_AA_TAGIT1_INSERTS   10 */
> -	SNDRV_PCM_FORMAT_S32,	/* { HPI_FORMAT_PCM32_SIGNED        11 */
> -	-1,			/* { HPI_FORMAT_RAW_BITSTREAM       12 */
> -	-1,			/* { HPI_FORMAT_AA_TAGIT1_HITS_EX1  13 */
> -	SNDRV_PCM_FORMAT_FLOAT,	/* { HPI_FORMAT_PCM32_FLOAT         14 */
> -	SNDRV_PCM_FORMAT_S24	/* { HPI_FORMAT_PCM24_SIGNED        15 */
> +	SNDRV_PCM_FORMAT_U8,	/* HPI_FORMAT_PCM8_UNSIGNED        1 */
> +	SNDRV_PCM_FORMAT_S16,	/* HPI_FORMAT_PCM16_SIGNED         2 */
> +	-1,			/* HPI_FORMAT_MPEG_L1              3 */
> +	SNDRV_PCM_FORMAT_MPEG,	/* HPI_FORMAT_MPEG_L2              4 */
> +	SNDRV_PCM_FORMAT_MPEG,	/* HPI_FORMAT_MPEG_L3              5 */
> +	-1,			/* HPI_FORMAT_DOLBY_AC2            6 */
> +	-1,			/* HPI_FORMAT_DOLBY_AC3            7 */
> +	SNDRV_PCM_FORMAT_S16_BE,/* HPI_FORMAT_PCM16_BIGENDIAN      8 */
> +	-1,			/* HPI_FORMAT_AA_TAGIT1_HITS       9 */
> +	-1,			/* HPI_FORMAT_AA_TAGIT1_INSERTS   10 */
> +	SNDRV_PCM_FORMAT_S32,	/* HPI_FORMAT_PCM32_SIGNED        11 */
> +	-1,			/* HPI_FORMAT_RAW_BITSTREAM       12 */
> +	-1,			/* HPI_FORMAT_AA_TAGIT1_HITS_EX1  13 */
> +	SNDRV_PCM_FORMAT_FLOAT,	/* HPI_FORMAT_PCM32_FLOAT         14 */
> +#if 1
> +	/* ALSA can't handle 3 byte sample size together with power-of-2
> +	 *  constraint on buffer_bytes, so disable this format
> +	 */
> +	-1
> +#else
> +	/* SNDRV_PCM_FORMAT_S24_3LE */	/* { HPI_FORMAT_PCM24_SIGNED        15 */
> +#endif

Just out of curiosity: how handle 3 bytes format and the power-of-two
buffer bytes in other OS?  Adding pads?


Takashi

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2008-06-19  9:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-06-19  2:15 [PATCH - asihpi 2/2] Disable S24_3LE incompatible with 2^N buffer size linux
2008-06-19  8:30 ` Jaroslav Kysela
2008-06-19  9:39 ` Takashi Iwai

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.