All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ALSA : au88x0 - fix playback/capture channels of au8830
@ 2011-01-16  3:14 Raymond Yau
  2011-01-17 10:39 ` Takashi Iwai
  0 siblings, 1 reply; 2+ messages in thread
From: Raymond Yau @ 2011-01-16  3:14 UTC (permalink / raw)
  To: ALSA Development Mailing List, Takashi Iwai

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

patch to change supported playback channels of au8830 to 1,2,4 and capture
channels to 1,2
This prevent oops when oss emulation use SNDCTL_DSP_CHANNELS to set 3
channels

[-- Attachment #2: 0001-ALSA-au88x0.patch --]
[-- Type: application/octet-stream, Size: 2029 bytes --]

From 067a7f2cbaac6c5fd0106b0944873cc8e085a229 Mon Sep 17 00:00:00 2001
From: Raymond Yau <superquad.vortex2@gmail.com>
Date: Sun, 16 Jan 2011 10:55:54 +0800
Subject: [PATCH] ALSA : au88x0 - fix playback/capture channels
 patch to change supported playback channels of au8830 to 1,2,4
 and capture channels to 1,2
 This prevent oops when oss emulation use SNDCTL_DSP_CHANNELS
 to set 3 Channels


Signed-off-by: Raymond Yau <superquad.vortex2@gmail.com>

diff --git a/sound/pci/au88x0/au88x0_pcm.c b/sound/pci/au88x0/au88x0_pcm.c
index b9d2f20..5439d66 100644
--- a/sound/pci/au88x0/au88x0_pcm.c
+++ b/sound/pci/au88x0/au88x0_pcm.c
@@ -42,11 +42,7 @@ static struct snd_pcm_hardware snd_vortex_playback_hw_adb = {
 	.rate_min = 5000,
 	.rate_max = 48000,
 	.channels_min = 1,
-#ifdef CHIP_AU8830
-	.channels_max = 4,
-#else
 	.channels_max = 2,
-#endif
 	.buffer_bytes_max = 0x10000,
 	.period_bytes_min = 0x1,
 	.period_bytes_max = 0x1000,
@@ -115,6 +111,17 @@ static struct snd_pcm_hardware snd_vortex_playback_hw_wt = {
 	.periods_max = 64,
 };
 #endif
+#ifdef CHIP_AU8830
+static unsigned int au8830_channels[3] = {
+	1, 2, 4,
+};
+
+static struct snd_pcm_hw_constraint_list hw_constraints_au8830_channels = {
+	.count = ARRAY_SIZE(au8830_channels),
+	.list = au8830_channels,
+	.mask = 0,
+};
+#endif
 /* open callback */
 static int snd_vortex_pcm_open(struct snd_pcm_substream *substream)
 {
@@ -156,6 +163,15 @@ static int snd_vortex_pcm_open(struct snd_pcm_substream *substream)
 		if (VORTEX_PCM_TYPE(substream->pcm) == VORTEX_PCM_ADB
 		    || VORTEX_PCM_TYPE(substream->pcm) == VORTEX_PCM_I2S)
 			runtime->hw = snd_vortex_playback_hw_adb;
+#ifdef CHIP_AU8830
+		if (substream->stream == SNDRV_PCM_STREAM_PLAYBACK &&
+			VORTEX_PCM_TYPE(substream->pcm) == VORTEX_PCM_ADB) {
+			runtime->hw.channels_max = 4;
+			snd_pcm_hw_constraint_list(runtime, 0,
+				SNDRV_PCM_HW_PARAM_CHANNELS,
+				&hw_constraints_au8830_channels);
+		}
+#endif
 		substream->runtime->private_data = NULL;
 	}
 #ifndef CHIP_AU8810
-- 
1.6.0.6


[-- Attachment #3: Type: text/plain, Size: 160 bytes --]

_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

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

* Re: [PATCH] ALSA : au88x0 - fix playback/capture channels of au8830
  2011-01-16  3:14 [PATCH] ALSA : au88x0 - fix playback/capture channels of au8830 Raymond Yau
@ 2011-01-17 10:39 ` Takashi Iwai
  0 siblings, 0 replies; 2+ messages in thread
From: Takashi Iwai @ 2011-01-17 10:39 UTC (permalink / raw)
  To: Raymond Yau; +Cc: ALSA Development Mailing List

At Sun, 16 Jan 2011 11:14:09 +0800,
Raymond Yau wrote:
> 
> patch to change supported playback channels of au8830 to 1,2,4 and capture
> channels to 1,2
> This prevent oops when oss emulation use SNDCTL_DSP_CHANNELS to set 3
> channels

Thanks, applied now with Cc to stable kernel.


Takashi

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

end of thread, other threads:[~2011-01-17 10:39 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-16  3:14 [PATCH] ALSA : au88x0 - fix playback/capture channels of au8830 Raymond Yau
2011-01-17 10: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.