* ALSA: oxygen: set fifo_size
@ 2014-09-21 20:52 Clemens Ladisch
2014-09-22 7:02 ` Takashi Iwai
0 siblings, 1 reply; 2+ messages in thread
From: Clemens Ladisch @ 2014-09-21 20:52 UTC (permalink / raw)
To: Takashi Iwai; +Cc: alsa-devel
Allow the driver to report the hardware FIFO size.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
---
sound/pci/oxygen/oxygen_pcm.c | 10 ++++++++++
1 file changed, 10 insertions(+)
diff --git a/sound/pci/oxygen/oxygen_pcm.c b/sound/pci/oxygen/oxygen_pcm.c
index cc0bcd9..0282824 100644
--- a/sound/pci/oxygen/oxygen_pcm.c
+++ b/sound/pci/oxygen/oxygen_pcm.c
@@ -29,6 +29,9 @@
/* the multichannel DMA channel has a 24-bit counter */
#define BUFFER_BYTES_MAX_MULTICH ((1 << 24) * 4)
+#define FIFO_BYTES 256
+#define FIFO_BYTES_MULTICH 1024
+
#define PERIOD_BYTES_MIN 64
#define DEFAULT_BUFFER_BYTES (BUFFER_BYTES_MAX / 2)
@@ -60,6 +63,7 @@ static const struct snd_pcm_hardware oxygen_stereo_hardware = {
.period_bytes_max = BUFFER_BYTES_MAX,
.periods_min = 1,
.periods_max = BUFFER_BYTES_MAX / PERIOD_BYTES_MIN,
+ .fifo_size = FIFO_BYTES,
};
static const struct snd_pcm_hardware oxygen_multichannel_hardware = {
.info = SNDRV_PCM_INFO_MMAP |
@@ -87,6 +91,7 @@ static const struct snd_pcm_hardware oxygen_multichannel_hardware = {
.period_bytes_max = BUFFER_BYTES_MAX_MULTICH,
.periods_min = 1,
.periods_max = BUFFER_BYTES_MAX_MULTICH / PERIOD_BYTES_MIN,
+ .fifo_size = FIFO_BYTES_MULTICH,
};
static const struct snd_pcm_hardware oxygen_ac97_hardware = {
.info = SNDRV_PCM_INFO_MMAP |
@@ -106,6 +111,7 @@ static const struct snd_pcm_hardware oxygen_ac97_hardware = {
.period_bytes_max = BUFFER_BYTES_MAX,
.periods_min = 1,
.periods_max = BUFFER_BYTES_MAX / PERIOD_BYTES_MIN,
+ .fifo_size = FIFO_BYTES,
};
static const struct snd_pcm_hardware *const oxygen_hardware[PCM_COUNT] = {
@@ -141,6 +147,10 @@ static int oxygen_open(struct snd_pcm_substream *substream,
runtime->hw.rates &= ~(SNDRV_PCM_RATE_32000 |
SNDRV_PCM_RATE_64000);
runtime->hw.rate_min = 44100;
+ /* fall through */
+ case PCM_A:
+ case PCM_B:
+ runtime->hw.fifo_size = 0;
break;
case PCM_MULTICH:
runtime->hw.channels_max = chip->model.dac_channels_pcm;
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: ALSA: oxygen: set fifo_size
2014-09-21 20:52 ALSA: oxygen: set fifo_size Clemens Ladisch
@ 2014-09-22 7:02 ` Takashi Iwai
0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2014-09-22 7:02 UTC (permalink / raw)
To: Clemens Ladisch; +Cc: alsa-devel
At Sun, 21 Sep 2014 22:52:46 +0200,
Clemens Ladisch wrote:
>
> Allow the driver to report the hardware FIFO size.
>
> Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Applied, thanks.
Takashi
> ---
> sound/pci/oxygen/oxygen_pcm.c | 10 ++++++++++
> 1 file changed, 10 insertions(+)
>
> diff --git a/sound/pci/oxygen/oxygen_pcm.c b/sound/pci/oxygen/oxygen_pcm.c
> index cc0bcd9..0282824 100644
> --- a/sound/pci/oxygen/oxygen_pcm.c
> +++ b/sound/pci/oxygen/oxygen_pcm.c
> @@ -29,6 +29,9 @@
> /* the multichannel DMA channel has a 24-bit counter */
> #define BUFFER_BYTES_MAX_MULTICH ((1 << 24) * 4)
>
> +#define FIFO_BYTES 256
> +#define FIFO_BYTES_MULTICH 1024
> +
> #define PERIOD_BYTES_MIN 64
>
> #define DEFAULT_BUFFER_BYTES (BUFFER_BYTES_MAX / 2)
> @@ -60,6 +63,7 @@ static const struct snd_pcm_hardware oxygen_stereo_hardware = {
> .period_bytes_max = BUFFER_BYTES_MAX,
> .periods_min = 1,
> .periods_max = BUFFER_BYTES_MAX / PERIOD_BYTES_MIN,
> + .fifo_size = FIFO_BYTES,
> };
> static const struct snd_pcm_hardware oxygen_multichannel_hardware = {
> .info = SNDRV_PCM_INFO_MMAP |
> @@ -87,6 +91,7 @@ static const struct snd_pcm_hardware oxygen_multichannel_hardware = {
> .period_bytes_max = BUFFER_BYTES_MAX_MULTICH,
> .periods_min = 1,
> .periods_max = BUFFER_BYTES_MAX_MULTICH / PERIOD_BYTES_MIN,
> + .fifo_size = FIFO_BYTES_MULTICH,
> };
> static const struct snd_pcm_hardware oxygen_ac97_hardware = {
> .info = SNDRV_PCM_INFO_MMAP |
> @@ -106,6 +111,7 @@ static const struct snd_pcm_hardware oxygen_ac97_hardware = {
> .period_bytes_max = BUFFER_BYTES_MAX,
> .periods_min = 1,
> .periods_max = BUFFER_BYTES_MAX / PERIOD_BYTES_MIN,
> + .fifo_size = FIFO_BYTES,
> };
>
> static const struct snd_pcm_hardware *const oxygen_hardware[PCM_COUNT] = {
> @@ -141,6 +147,10 @@ static int oxygen_open(struct snd_pcm_substream *substream,
> runtime->hw.rates &= ~(SNDRV_PCM_RATE_32000 |
> SNDRV_PCM_RATE_64000);
> runtime->hw.rate_min = 44100;
> + /* fall through */
> + case PCM_A:
> + case PCM_B:
> + runtime->hw.fifo_size = 0;
> break;
> case PCM_MULTICH:
> runtime->hw.channels_max = chip->model.dac_channels_pcm;
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-09-22 7:02 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-21 20:52 ALSA: oxygen: set fifo_size Clemens Ladisch
2014-09-22 7:02 ` 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.