diff mbox

[1/1] ALSA: usb-audio: Change internal PCM order

Message ID 55ec6713.231d980a.60089.ffff8a20@mx.google.com (mailing list archive)
State New, archived
Headers show

Commit Message

Johan Rastén Sept. 6, 2015, 4:16 p.m. UTC
From: Johan Rastén <johan@oljud.se>

New PCMs will now be added to the end of the chip's PCM list instead of to the
front. This changes the way streams are combined so that the first capture
stream will now be merged with the first playback stream instead of the last.

This fixes a problem with ASUS U7. Cards with one playback stream and cards
without capture streams should be unaffected by this change.

Exception added for M-Audio Audiophile USB (tm) since it seems to have a fix to
swap capture stream numbering in alsa-lib conf/cards/USB-audio.conf

Signed-off-by: Johan Rastén <johan@oljud.se>

2.1.4

Comments

Takashi Iwai Sept. 7, 2015, 9:27 a.m. UTC | #1
On Sun, 06 Sep 2015 18:16:13 +0200,
johan@oljud.se wrote:
> 
> From: Johan Rastén <johan@oljud.se>
> 
> New PCMs will now be added to the end of the chip's PCM list instead of to the
> front. This changes the way streams are combined so that the first capture
> stream will now be merged with the first playback stream instead of the last.
> 
> This fixes a problem with ASUS U7. Cards with one playback stream and cards
> without capture streams should be unaffected by this change.
> 
> Exception added for M-Audio Audiophile USB (tm) since it seems to have a fix to
> swap capture stream numbering in alsa-lib conf/cards/USB-audio.conf
> 
> Signed-off-by: Johan Rastén <johan@oljud.se>

Thanks, applied now.


Takashi

> diff --git a/sound/usb/stream.c b/sound/usb/stream.c
> index 310a382..01f5a86 100644
> --- a/sound/usb/stream.c
> +++ b/sound/usb/stream.c
> @@ -377,8 +377,15 @@ int snd_usb_add_audio_stream(struct snd_usb_audio *chip,
> 
>  	snd_usb_init_substream(as, stream, fp);
> 
> -	list_add(&as->list, &chip->pcm_list);
> +	/*
> +	 * Keep using head insertion for M-Audio Audiophile USB (tm) which has a
> +	 * fix to swap capture stream order in conf/cards/USB-audio.conf
> +	 */
> +	if (chip->usb_id == USB_ID(0x0763, 0x2003))
> +		list_add(&as->list, &chip->pcm_list);
> +	else
> +		list_add_tail(&as->list, &chip->pcm_list);
> +
>  	chip->pcm_devs++;
> 
>  	snd_usb_proc_pcm_format_add(as);
> --
> 2.1.4
>
diff mbox

Patch

diff --git a/sound/usb/stream.c b/sound/usb/stream.c
index 310a382..01f5a86 100644
--- a/sound/usb/stream.c
+++ b/sound/usb/stream.c
@@ -377,8 +377,15 @@  int snd_usb_add_audio_stream(struct snd_usb_audio *chip,

 	snd_usb_init_substream(as, stream, fp);

-	list_add(&as->list, &chip->pcm_list);
+	/*
+	 * Keep using head insertion for M-Audio Audiophile USB (tm) which has a
+	 * fix to swap capture stream order in conf/cards/USB-audio.conf
+	 */
+	if (chip->usb_id == USB_ID(0x0763, 0x2003))
+		list_add(&as->list, &chip->pcm_list);
+	else
+		list_add_tail(&as->list, &chip->pcm_list);
+
 	chip->pcm_devs++;

 	snd_usb_proc_pcm_format_add(as);
--