[alsa-devel] channel map for intel8x0

Takashi Iwai tiwai at suse.de
Wed Nov 6 08:16:44 CET 2013


At Wed, 06 Nov 2013 08:01:16 +0100,
Takashi Iwai wrote:
> 
> At Wed, 6 Nov 2013 10:45:32 +0800,
> Raymond Yau wrote:
> > 
> > \
> > 
> > > > > >
> > > > > > > Refer to patch ALSA: Implement channel maps for standard onboard
> > > AC97
> > > > > > > drivers
> > > > > > >
> > > > > > > e36e3b86c78cee9c7435eb33e0ef8a788193e812<
> > > > > >
> > > https://git.kernel.org/cgit/linux/kernel/git/tiwai/sound.git/commit/sound/pci/intel8x0.c?id=e36e3b86c78cee9c7435eb33e0ef8a788193e812
> > > > > > >
> > > > > > >
> > > > > > > It seem that channal map is not working when testing with
> > > > > > > alsa-lib/test/chmap.c with the emulated intel8x0 inside virtualbox
> > > > > >
> > > > > > What doesn't work actually?  The lack of chmap for the capture?
> > > > > > Please give a bit more explanations about your problem.
> > > > > >
> > > > > >
> > > > >  /alsa-lib/test$ ./chmap -Dhw:0,0 query
> > > > > Cannot query maps
> > > >
> > > > OK.  An untested fix patch is below.
> > >
> > > Let me know if the patch worked.  Then I'll apply it with Cc to
> > > stable.
> > >
> > >
> > > thanks,
> > >
> > > Takashi
> > >
> > >
> > > > Meanwhile, most of drivers don't provide the chmap for the capture
> > > > direction just because they are up to two channels, and obviously it's
> > > > only FL/FR.  The chmap support has been added for drivers of consumer
> > > > cards that are capable of multi channels.
> > > >
> > >
> > 
> > only playback channel map is added in the emulated ICH controller , no
> > channel map for capture
> 
> As I already mentioned, the chmaps have been added only for multi
> channel playback.  Others are only two channels, so no chmap is
> added.
> 
> > Does it mean that no playback channel map for the other controller ali5455
> > SIS7012  ?
> 
> It is supported.

... with the revised patch below :)


Takashi

---
From: Takashi Iwai <tiwai at suse.de>
Subject: [PATCH] ALSA: intel8x0: Fix chmap application

The playback chmap for multi-channel stream hasn't been properly added
to intel8x0 devices due to the wrong condition.

Reported-by: Raymond Yau <superquad.vortex2 at gmail.com>
Signed-off-by: Takashi Iwai <tiwai at suse.de>
---
 sound/pci/intel8x0.c | 17 ++++++++---------
 1 file changed, 8 insertions(+), 9 deletions(-)

diff --git a/sound/pci/intel8x0.c b/sound/pci/intel8x0.c
index 59c8aaebb91e..08d8733604a2 100644
--- a/sound/pci/intel8x0.c
+++ b/sound/pci/intel8x0.c
@@ -1541,17 +1541,16 @@ static int snd_intel8x0_pcm1(struct intel8x0 *chip, int device,
 					      snd_dma_pci_data(chip->pci),
 					      rec->prealloc_size, rec->prealloc_max_size);
 
-	if (rec->ac97_idx == ICHD_PCMOUT && rec->playback_ops) {
+	if (rec->playback_ops &&
+	    rec->playback_ops->open == snd_intel8x0_playback_open) {
 		struct snd_pcm_chmap *chmap;
 		int chs = 2;
-		if (rec->ac97_idx == ICHD_PCMOUT) {
-			if (chip->multi8)
-				chs = 8;
-			else if (chip->multi6)
-				chs = 6;
-			else if (chip->multi4)
-				chs = 4;
-		}
+		if (chip->multi8)
+			chs = 8;
+		else if (chip->multi6)
+			chs = 6;
+		else if (chip->multi4)
+			chs = 4;
 		err = snd_pcm_add_chmap_ctls(pcm, SNDRV_PCM_STREAM_PLAYBACK,
 					     snd_pcm_alt_chmaps, chs, 0,
 					     &chmap);
-- 
1.8.4.2



More information about the Alsa-devel mailing list