Skip to contentSkip to conversation

sound updates #2 for 2.6.40

GIT PULL Takashi Iwai 2 participants 7 messages May 27, 2011 – May 28, 2011

Subsystems (6)
lore
Share & tools
lore
#0 lore raw

Linus,

please pull sound updates (part 2) for v2.6.40-rc1 from:

git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6.git for-linus

As usual, the episode 2 is mostly boring. It contains some pending updates that missed in the previous pull request, and last-minute fixes after it. Large portion of changes are for USB M-Audio FastTrack device support, and a few ASoC and HD-audio updates.

Thanks!

Takashi

===

Axel Lin (1):

      ASoC: wm1250-ev1: Define "WM1250 Output" with SND_SOC_DAPM_OUTPUT

Clemens Ladisch (1):
MAINTAINERS: add FireWire audio maintainer

Daniel Mack (6):
ASoC: fix raumfeld platform
ALSA: usb-audio: move assignment of chip->ctrl_intf
ALSA: usb-audio: rework add_control_to_empty()
ALSA: usb-audio: export snd_usb_feature_unit_ctl
ALSA: usb-audio: add new quirk type QUIRK_AUDIO_STANDARD_MIXER
ALSA: usb-audio: more control quirks for M-Audio FastTrack devices

David Henningsson (1):
ALSA: HDA: Add quirk for Lenovo U350

Jarkko Nikula (1):
ASoC: Fix power down for widgetless per-card DAPM context case

Jesper Juhl (1):
ASoC: Remove duplicate linux/delay.h inclusion.

Liam Girdwood (2):
ASoC: core - fix module reference counting for CPU DAIs
ASoC: core - remove superfluous new line.

Luca Tettamanti (1):
ALSA: core: remove unused variables.

Nicolas Ferre (2):
ASoC: wm8731: fix wm8731_check_osc() connected condition
ASoC: sam9g20_wm8731: use the proper SYSCKL value

Stephen Warren (2):
ALSA: HDA: Unify HDMI hotplug handling.
ALSA: HDA: Increase MAX_HDMI_PINS

Takashi Iwai (7):
ALSA: hda - Fix auto-mic detection in Conexant codec-parser
ALSA: hda - Fix initial capture-source with auto-mic for Cxt auto-parser
ALSA: hda - Fix speaker auto-mute in Cxt auto-parser
ALSA: hda - Use model=auto for Lenovo G555
ALSA: PCM - Don't check DMA time-out too shortly
ALSA: hda - Use snd_printd() in snd_hda_parse_pin_def_config()
ALSA: hda - Reorganize controller quriks with bit flags

Tony Vroon (1):
ALSA: hda - Force AD1988_6STACK_DIG for Asus M3N-HT Deluxe

---
 MAINTAINERS                      |    7 ++
 sound/core/control.c             |    3 +-
 sound/core/init.c                |    3 -
 sound/core/oss/linear.c          |    3 -
 sound/core/pcm_lib.c             |   17 +++-
 sound/core/pcm_native.c          |   21 ++--
 sound/core/seq/seq_queue.c       |    2 -
 sound/pci/hda/hda_codec.c        |    2 +-
 sound/pci/hda/hda_eld.c          |   21 +----
 sound/pci/hda/hda_intel.c        |  206 +++++++++++++++++++++++---------------
 sound/pci/hda/patch_analog.c     |    1 +
 sound/pci/hda/patch_conexant.c   |   42 +++++---
 sound/pci/hda/patch_hdmi.c       |  123 ++++++++++-------------
 sound/soc/atmel/sam9g20_wm8731.c |    2 +-
 sound/soc/codecs/wm1250-ev1.c    |    2 +-
 sound/soc/codecs/wm8731.c        |    2 +-
 sound/soc/codecs/wm8915.c        |    1 -
 sound/soc/pxa/raumfeld.c         |   92 +++++++++++------
 sound/soc/soc-core.c             |    8 +-
 sound/soc/soc-dapm.c             |    2 +-
 sound/usb/card.c                 |   17 ++--
 sound/usb/mixer.c                |   32 +++----
 sound/usb/mixer.h                |   14 +++-
 sound/usb/mixer_quirks.c         |   70 +++++++++++++
 sound/usb/quirks-table.h         |    4 +-
 sound/usb/quirks.c               |   18 +++-
 sound/usb/usbaudio.h             |    1 +
 27 files changed, 432 insertions(+), 284 deletions(-)
MAINTAINERS +7 -0
index c4fc1da..572b5b2 100644
@@ -2584,6 +2584,13 @@ S:	Maintained
 F:	drivers/hwmon/f75375s.c
 F:	include/linux/f75375s.h
 
+FIREWIRE AUDIO DRIVERS
+M:	Clemens Ladisch <[email protected]>
+L:	[email protected] (moderated for non-subscribers)
+T:	git git://git.alsa-project.org/alsa-kernel.git
+S:	Maintained
+F:	sound/firewire/
+
 FIREWIRE SUBSYSTEM
 M:	Stefan Richter <[email protected]>
 L:	[email protected]
sound/core/control.c +1 -2
index 5d98194..f8c5be4 100644
@@ -704,13 +704,12 @@ static int snd_ctl_elem_list(struct snd_card *card,
 	struct snd_ctl_elem_list list;
 	struct snd_kcontrol *kctl;
 	struct snd_ctl_elem_id *dst, *id;
-	unsigned int offset, space, first, jidx;
+	unsigned int offset, space, jidx;
 	
 	if (copy_from_user(&list, _list, sizeof(list)))
 		return -EFAULT;
 	offset = list.offset;
 	space = list.space;
-	first = 0;
 	/* try limit maximum space */
 	if (space > 16384)
 		return -ENOMEM;
sound/core/init.c +0 -3
index 30ecad4..2c041bb 100644
@@ -342,7 +342,6 @@ static const struct file_operations snd_shutdown_f_ops =
 int snd_card_disconnect(struct snd_card *card)
 {
 	struct snd_monitor_file *mfile;
-	struct file *file;
 	int err;
 
 	if (!card)
@@ -366,8 +365,6 @@ int snd_card_disconnect(struct snd_card *card)
 	
 	spin_lock(&card->files_lock);
 	list_for_each_entry(mfile, &card->files_list, list) {
-		file = mfile->file;
-
 		/* it's critical part, use endless loop */
 		/* we have no room to fail */
 		mfile->disconnected_f_op = mfile->file->f_op;
sound/core/oss/linear.c +0 -3
index 13b3f6f..2045697 100644
@@ -90,11 +90,8 @@ static snd_pcm_sframes_t linear_transfer(struct snd_pcm_plugin *plugin,
 			       struct snd_pcm_plugin_channel *dst_channels,
 			       snd_pcm_uframes_t frames)
 {
-	struct linear_priv *data;
-
 	if (snd_BUG_ON(!plugin || !src_channels || !dst_channels))
 		return -ENXIO;
-	data = (struct linear_priv *)plugin->extra_data;
 	if (frames == 0)
 		return 0;
 #ifdef CONFIG_SND_DEBUG
sound/core/pcm_lib.c +13 -4
index abfeff16..f134130 100644
@@ -1756,8 +1756,18 @@ static int wait_for_avail(struct snd_pcm_substream *substream,
 	wait_queue_t wait;
 	int err = 0;
 	snd_pcm_uframes_t avail = 0;
-	long tout;
-
+	long wait_time, tout;
+
+	if (runtime->no_period_wakeup)
+		wait_time = MAX_SCHEDULE_TIMEOUT;
+	else {
+		wait_time = 10;
+		if (runtime->rate) {
+			long t = runtime->period_size * 2 / runtime->rate;
+			wait_time = max(t, wait_time);
+		}
+		wait_time = msecs_to_jiffies(wait_time * 1000);
+	}
 	init_waitqueue_entry(&wait, current);
 	add_wait_queue(&runtime->tsleep, &wait);
 	for (;;) {
@@ -1765,9 +1775,8 @@ static int wait_for_avail(struct snd_pcm_substream *substream,
 			err = -ERESTARTSYS;
 			break;
 		}
-		set_current_state(TASK_INTERRUPTIBLE);
 		snd_pcm_stream_unlock_irq(substream);
-		tout = schedule_timeout(msecs_to_jiffies(10000));
+		tout = schedule_timeout_interruptible(wait_time);
 		snd_pcm_stream_lock_irq(substream);
 		switch (runtime->status->state) {
 		case SNDRV_PCM_STATE_SUSPENDED:
sound/core/pcm_native.c +11 -10
index 1a07750..1c6be91 100644
@@ -1481,11 +1481,20 @@ static int snd_pcm_drain(struct snd_pcm_substream *substream,
 			break; /* all drained */
 		init_waitqueue_entry(&wait, current);
 		add_wait_queue(&to_check->sleep, &wait);
-		set_current_state(TASK_INTERRUPTIBLE);
 		snd_pcm_stream_unlock_irq(substream);
 		up_read(&snd_pcm_link_rwsem);
 		snd_power_unlock(card);
-		tout = schedule_timeout(10 * HZ);
+		if (runtime->no_period_wakeup)
+			tout = MAX_SCHEDULE_TIMEOUT;
+		else {
+			tout = 10;
+			if (runtime->rate) {
+				long t = runtime->period_size * 2 / runtime->rate;
+				tout = max(t, tout);
+			}
+			tout = msecs_to_jiffies(tout * 1000);
+		}
+		tout = schedule_timeout_interruptible(tout);
 		snd_power_lock(card);
 		down_read(&snd_pcm_link_rwsem);
 		snd_pcm_stream_lock_irq(substream);
@@ -1518,13 +1527,11 @@ static int snd_pcm_drain(struct snd_pcm_substream *substream,
 static int snd_pcm_drop(struct snd_pcm_substream *substream)
 {
 	struct snd_pcm_runtime *runtime;
-	struct snd_card *card;
 	int result = 0;
 	
 	if (PCM_RUNTIME_CHECK(substream))
 		return -ENXIO;
 	runtime = substream->runtime;
-	card = substream->pcm->card;
 
 	if (runtime->status->state == SNDRV_PCM_STATE_OPEN ||
 	    runtime->status->state == SNDRV_PCM_STATE_DISCONNECTED ||
@@ -2056,7 +2063,6 @@ static int snd_pcm_open_file(struct file *file,
 {
 	struct snd_pcm_file *pcm_file;
 	struct snd_pcm_substream *substream;
-	struct snd_pcm_str *str;
 	int err;
 
 	if (rpcm_file)
@@ -2073,7 +2079,6 @@ static int snd_pcm_open_file(struct file *file,
 	}
 	pcm_file->substream = substream;
 	if (substream->ref_count == 1) {
-		str = substream->pstr;
 		substream->file = pcm_file;
 		substream->pcm_release = pcm_release_private;
 	}
@@ -3015,11 +3020,9 @@ static const struct vm_operations_struct snd_pcm_vm_ops_status =
 static int snd_pcm_mmap_status(struct snd_pcm_substream *substream, struct file *file,
 			       struct vm_area_struct *area)
 {
-	struct snd_pcm_runtime *runtime;
 	long size;
 	if (!(area->vm_flags & VM_READ))
 		return -EINVAL;
-	runtime = substream->runtime;
 	size = area->vm_end - area->vm_start;
 	if (size != PAGE_ALIGN(sizeof(struct snd_pcm_mmap_status)))
 		return -EINVAL;
@@ -3054,11 +3057,9 @@ static const struct vm_operations_struct snd_pcm_vm_ops_control =
 static int snd_pcm_mmap_control(struct snd_pcm_substream *substream, struct file *file,
 				struct vm_area_struct *area)
 {
-	struct snd_pcm_runtime *runtime;
 	long size;
 	if (!(area->vm_flags & VM_READ))
 		return -EINVAL;
-	runtime = substream->runtime;
 	size = area->vm_end - area->vm_start;
 	if (size != PAGE_ALIGN(sizeof(struct snd_pcm_mmap_control)))
 		return -EINVAL;
sound/core/seq/seq_queue.c +0 -2
index e7a8e9e..f907736 100644
@@ -467,13 +467,11 @@ int snd_seq_queue_timer_open(int queueid)
 int snd_seq_queue_timer_close(int queueid)
 {
 	struct snd_seq_queue *queue;
-	struct snd_seq_timer *tmr;
 	int result = 0;
 
 	queue = queueptr(queueid);
 	if (queue == NULL)
 		return -EINVAL;
-	tmr = queue->timer;
 	snd_seq_timer_close(queue);
 	queuefree(queue);
 	return result;
sound/pci/hda/hda_codec.c +1 -1
index 8edd998..45b4a8d 100644
@@ -4719,7 +4719,7 @@ int snd_hda_parse_pin_def_config(struct hda_codec *codec,
 			   cfg->dig_out_pins[0], cfg->dig_out_pins[1]);
 	snd_printd("   inputs:");
 	for (i = 0; i < cfg->num_inputs; i++) {
-		snd_printdd(" %s=0x%x",
+		snd_printd(" %s=0x%x",
 			    hda_get_autocfg_input_label(codec, cfg, i),
 			    cfg->inputs[i].pin);
 	}
sound/pci/hda/hda_eld.c +3 -18
index 74b0560..b05f7be 100644
@@ -312,23 +312,6 @@ out_fail:
 	return -EINVAL;
 }
 
-static int hdmi_eld_valid(struct hda_codec *codec, hda_nid_t nid)
-{
-	int eldv;
-	int present;
-
-	present = snd_hda_pin_sense(codec, nid);
-	eldv    = (present & AC_PINSENSE_ELDV);
-	present = (present & AC_PINSENSE_PRESENCE);
-
-#ifdef CONFIG_SND_DEBUG_VERBOSE
-	printk(KERN_INFO "HDMI: sink_present = %d, eld_valid = %d\n",
-			!!present, !!eldv);
-#endif
-
-	return eldv && present;
-}
-
 int snd_hdmi_get_eld_size(struct hda_codec *codec, hda_nid_t nid)
 {
 	return snd_hda_codec_read(codec, nid, 0, AC_VERB_GET_HDMI_DIP_SIZE,
@@ -343,7 +326,7 @@ int snd_hdmi_get_eld(struct hdmi_eld *eld,
 	int size;
 	unsigned char *buf;
 
-	if (!hdmi_eld_valid(codec, nid))
+	if (!eld->eld_valid)
 		return -ENOENT;
 
 	size = snd_hdmi_get_eld_size(codec, nid);
@@ -477,6 +460,8 @@ static void hdmi_print_eld_info(struct snd_info_entry *entry,
 
 	snd_iprintf(buffer, "monitor_present\t\t%d\n", e->monitor_present);
 	snd_iprintf(buffer, "eld_valid\t\t%d\n", e->eld_valid);
+	if (!e->eld_valid)
+		return;
 	snd_iprintf(buffer, "monitor_name\t\t%s\n", e->monitor_name);
 	snd_iprintf(buffer, "connection_type\t\t%s\n",
 				eld_connection_type_names[e->conn_type]);
sound/pci/hda/hda_intel.c +125 -81

354 lines not on this page · raw message

sound/pci/hda/patch_analog.c +1 -0
index f1b3875..696ac25 100644
@@ -3159,6 +3159,7 @@ static const struct snd_pci_quirk ad1988_cfg_tbl[] = {
 	SND_PCI_QUIRK(0x1043, 0x81ec, "Asus P5B-DLX", AD1988_6STACK_DIG),
 	SND_PCI_QUIRK(0x1043, 0x81f6, "Asus M2N-SLI", AD1988_6STACK_DIG),
 	SND_PCI_QUIRK(0x1043, 0x8277, "Asus P5K-E/WIFI-AP", AD1988_6STACK_DIG),
+	SND_PCI_QUIRK(0x1043, 0x82c0, "Asus M3N-HT Deluxe", AD1988_6STACK_DIG),
 	SND_PCI_QUIRK(0x1043, 0x8311, "Asus P5Q-Premium/Pro", AD1988_6STACK_DIG),
 	{}
 };
sound/pci/hda/patch_conexant.c +27 -15

93 lines not on this page · raw message

sound/pci/hda/patch_hdmi.c +52 -71

197 lines not on this page · raw message

sound/soc/atmel/sam9g20_wm8731.c +1 -1
index 28afbbf..95572d2 100644
@@ -146,7 +146,7 @@ static int at91sam9g20ek_wm8731_init(struct snd_soc_pcm_runtime *rtd)
 			"at91sam9g20ek_wm8731 "
 			": at91sam9g20ek_wm8731_init() called\n");
 
-	ret = snd_soc_dai_set_sysclk(codec_dai, WM8731_SYSCLK_XTAL,
+	ret = snd_soc_dai_set_sysclk(codec_dai, WM8731_SYSCLK_MCLK,
 		MCLK_RATE, SND_SOC_CLOCK_IN);
 	if (ret < 0) {
 		printk(KERN_ERR "Failed to set WM8731 SYSCLK: %d\n", ret);
sound/soc/codecs/wm1250-ev1.c +1 -1
index 14d0716..bcc2089 100644
@@ -22,7 +22,7 @@ SND_SOC_DAPM_ADC("ADC", "wm1250-ev1 Capture", SND_SOC_NOPM, 0, 0),
 SND_SOC_DAPM_DAC("DAC", "wm1250-ev1 Playback", SND_SOC_NOPM, 0, 0),
 
 SND_SOC_DAPM_INPUT("WM1250 Input"),
-SND_SOC_DAPM_INPUT("WM1250 Output"),
+SND_SOC_DAPM_OUTPUT("WM1250 Output"),
 };
 
 static const struct snd_soc_dapm_route wm1250_ev1_dapm_routes[] = {
sound/soc/codecs/wm8731.c +1 -1
index 6dec7ce..2dc964b 100644
@@ -198,7 +198,7 @@ static int wm8731_check_osc(struct snd_soc_dapm_widget *source,
 {
 	struct wm8731_priv *wm8731 = snd_soc_codec_get_drvdata(source->codec);
 
-	return wm8731->sysclk_type == WM8731_SYSCLK_MCLK;
+	return wm8731->sysclk_type == WM8731_SYSCLK_XTAL;
 }
 
 static const struct snd_soc_dapm_route wm8731_intercon[] = {
sound/soc/codecs/wm8915.c +0 -1
index ccc9bd8..a0b1a72 100644
@@ -19,7 +19,6 @@
 #include <linux/gcd.h>
 #include <linux/gpio.h>
 #include <linux/i2c.h>
-#include <linux/delay.h>
 #include <linux/regulator/consumer.h>
 #include <linux/slab.h>
 #include <linux/workqueue.h>
sound/soc/pxa/raumfeld.c +58 -34

125 lines not on this page · raw message

sound/soc/soc-core.c +4 -4
index bb7cd58..d75043e 100644
@@ -1306,10 +1306,6 @@ static int soc_bind_dai_link(struct snd_soc_card *card, int num)
 	/* no, then find CPU DAI from registered DAIs*/
 	list_for_each_entry(cpu_dai, &dai_list, list) {
 		if (!strcmp(cpu_dai->name, dai_link->cpu_dai_name)) {
-
-			if (!try_module_get(cpu_dai->dev->driver->owner))
-				return -ENODEV;
-
 			rtd->cpu_dai = cpu_dai;
 			goto find_codec;
 		}
@@ -1622,11 +1618,15 @@ static int soc_probe_dai_link(struct snd_soc_card *card, int num)
 
 	/* probe the cpu_dai */
 	if (!cpu_dai->probed) {
+		if (!try_module_get(cpu_dai->dev->driver->owner))
+			return -ENODEV;
+
 		if (cpu_dai->driver->probe) {
 			ret = cpu_dai->driver->probe(cpu_dai);
 			if (ret < 0) {
 				printk(KERN_ERR "asoc: failed to probe CPU DAI %s\n",
 						cpu_dai->name);
+				module_put(cpu_dai->dev->driver->owner);
 				return ret;
 			}
 		}
sound/soc/soc-dapm.c +1 -1
index 456617e..999bb08 100644
@@ -1110,7 +1110,7 @@ static int dapm_power_widgets(struct snd_soc_dapm_context *dapm, int event)
 	trace_snd_soc_dapm_start(card);
 
 	list_for_each_entry(d, &card->dapm_list, list)
-		if (d->n_widgets)
+		if (d->n_widgets || d->codec == NULL)
 			d->dev_power = 0;
 
 	/* Check which widgets we need to power and store them in
sound/usb/card.c +9 -8
index a90662a..220c616 100644
@@ -48,6 +48,7 @@
 #include <linux/usb/audio.h>
 #include <linux/usb/audio-v2.h>
 
+#include <sound/control.h>
 #include <sound/core.h>
 #include <sound/info.h>
 #include <sound/pcm.h>
@@ -492,14 +493,6 @@ static void *snd_usb_audio_probe(struct usb_device *dev,
 		}
 	}
 
-	chip->txfr_quirk = 0;
-	err = 1; /* continue */
-	if (quirk && quirk->ifnum != QUIRK_NO_INTERFACE) {
-		/* need some special handlings */
-		if ((err = snd_usb_create_quirk(chip, intf, &usb_audio_driver, quirk)) < 0)
-			goto __error;
-	}
-
 	/*
 	 * For devices with more than one control interface, we assume the
 	 * first contains the audio controls. We might need a more specific
@@ -508,6 +501,14 @@ static void *snd_usb_audio_probe(struct usb_device *dev,
 	if (!chip->ctrl_intf)
 		chip->ctrl_intf = alts;
 
+	chip->txfr_quirk = 0;
+	err = 1; /* continue */
+	if (quirk && quirk->ifnum != QUIRK_NO_INTERFACE) {
+		/* need some special handlings */
+		if ((err = snd_usb_create_quirk(chip, intf, &usb_audio_driver, quirk)) < 0)
+			goto __error;
+	}
+
 	if (err > 0) {
 		/* create normal USB audio interfaces */
 		if (snd_usb_create_streams(chip, ifnum) < 0 ||
sound/usb/mixer.c +13 -19
index eab06ed..c22fa76 100644
@@ -86,16 +86,6 @@ struct mixer_build {
 	const struct usbmix_selector_map *selector_map;
 };
 
-enum {
-	USB_MIXER_BOOLEAN,
-	USB_MIXER_INV_BOOLEAN,
-	USB_MIXER_S8,
-	USB_MIXER_U8,
-	USB_MIXER_S16,
-	USB_MIXER_U16,
-};
-
-
 /*E-mu 0202/0404/0204 eXtension Unit(XU) control*/
 enum {
 	USB_XU_CLOCK_RATE 		= 0xe301,
@@ -535,20 +525,21 @@ static int check_matrix_bitmap(unsigned char *bmap, int ich, int och, int num_ou
  * if failed, give up and free the control instance.
  */
 
-static int add_control_to_empty(struct mixer_build *state, struct snd_kcontrol *kctl)
+int snd_usb_mixer_add_control(struct usb_mixer_interface *mixer,
+			      struct snd_kcontrol *kctl)
 {
 	struct usb_mixer_elem_info *cval = kctl->private_data;
 	int err;
 
-	while (snd_ctl_find_id(state->chip->card, &kctl->id))
+	while (snd_ctl_find_id(mixer->chip->card, &kctl->id))
 		kctl->id.index++;
-	if ((err = snd_ctl_add(state->chip->card, kctl)) < 0) {
+	if ((err = snd_ctl_add(mixer->chip->card, kctl)) < 0) {
 		snd_printd(KERN_ERR "cannot add control (err = %d)\n", err);
 		return err;
 	}
 	cval->elem_id = &kctl->id;
-	cval->next_id_elem = state->mixer->id_elems[cval->id];
-	state->mixer->id_elems[cval->id] = cval;
+	cval->next_id_elem = mixer->id_elems[cval->id];
+	mixer->id_elems[cval->id] = cval;
 	return 0;
 }
 
@@ -984,6 +975,9 @@ static struct snd_kcontrol_new usb_feature_unit_ctl_ro = {
 	.put = NULL,
 };
 
+/* This symbol is exported in order to allow the mixer quirks to
+ * hook up to the standard feature unit control mechanism */
+struct snd_kcontrol_new *snd_usb_feature_unit_ctl = &usb_feature_unit_ctl;
 
 /*
  * build a feature control
@@ -1176,7 +1170,7 @@ static void build_feature_ctl(struct mixer_build *state, void *raw_desc,
 
 	snd_printdd(KERN_INFO "[%d] FU [%s] ch = %d, val = %d/%d/%d\n",
 		    cval->id, kctl->id.name, cval->channels, cval->min, cval->max, cval->res);
-	add_control_to_empty(state, kctl);
+	snd_usb_mixer_add_control(state->mixer, kctl);
 }
 
 
@@ -1340,7 +1334,7 @@ static void build_mixer_unit_ctl(struct mixer_build *state,
 
 	snd_printdd(KERN_INFO "[%d] MU [%s] ch = %d, val = %d/%d\n",
 		    cval->id, kctl->id.name, cval->channels, cval->min, cval->max);
-	add_control_to_empty(state, kctl);
+	snd_usb_mixer_add_control(state->mixer, kctl);
 }
 
 
@@ -1641,7 +1635,7 @@ static int build_audio_procunit(struct mixer_build *state, int unitid, void *raw
 
 		snd_printdd(KERN_INFO "[%d] PU [%s] ch = %d, val = %d/%d\n",
 			    cval->id, kctl->id.name, cval->channels, cval->min, cval->max);
-		if ((err = add_control_to_empty(state, kctl)) < 0)
+		if ((err = snd_usb_mixer_add_control(state->mixer, kctl)) < 0)
 			return err;
 	}
 	return 0;
@@ -1858,7 +1852,7 @@ static int parse_audio_selector_unit(struct mixer_build *state, int unitid, void
 
 	snd_printdd(KERN_INFO "[%d] SU [%s] items = %d\n",
 		    cval->id, kctl->id.name, desc->bNrInPins);
-	if ((err = add_control_to_empty(state, kctl)) < 0)
+	if ((err = snd_usb_mixer_add_control(state->mixer, kctl)) < 0)
 		return err;
 
 	return 0;
sound/usb/mixer.h +13 -1
index b4a2c81..ae1a14d 100644
@@ -24,7 +24,16 @@ struct usb_mixer_interface {
 	u8 xonar_u1_status;
 };
 
-#define MAX_CHANNELS	10	/* max logical channels */
+#define MAX_CHANNELS	16	/* max logical channels */
+
+enum {
+	USB_MIXER_BOOLEAN,
+	USB_MIXER_INV_BOOLEAN,
+	USB_MIXER_S8,
+	USB_MIXER_U8,
+	USB_MIXER_S16,
+	USB_MIXER_U16,
+};
 
 struct usb_mixer_elem_info {
 	struct usb_mixer_interface *mixer;
@@ -55,4 +64,7 @@ int snd_usb_mixer_set_ctl_value(struct usb_mixer_elem_info *cval,
 void snd_usb_mixer_inactivate(struct usb_mixer_interface *mixer);
 int snd_usb_mixer_activate(struct usb_mixer_interface *mixer);
 
+int snd_usb_mixer_add_control(struct usb_mixer_interface *mixer,
+			      struct snd_kcontrol *kctl);
+
 #endif /* __USBMIXER_H */
sound/usb/mixer_quirks.c +70 -0

88 lines not on this page · raw message

sound/usb/quirks-table.h +2 -2
index 78792a8..0b2ae8e 100644
@@ -1988,7 +1988,7 @@ YAMAHA_DEVICE(0x7010, "UB99"),
 		.data = & (const struct snd_usb_audio_quirk[]) {
 			{
 				.ifnum = 0,
-				.type = QUIRK_IGNORE_INTERFACE
+				.type = QUIRK_AUDIO_STANDARD_MIXER,
 			},
 			{
 				.ifnum = 1,
@@ -2055,7 +2055,7 @@ YAMAHA_DEVICE(0x7010, "UB99"),
 		.data = & (const struct snd_usb_audio_quirk[]) {
 			{
 				.ifnum = 0,
-				.type = QUIRK_IGNORE_INTERFACE
+				.type = QUIRK_AUDIO_STANDARD_MIXER,
 			},
 			{
 				.ifnum = 1,
sound/usb/quirks.c +17 -1
index bd13d72..2e969cb 100644
@@ -19,6 +19,7 @@
 #include <linux/usb.h>
 #include <linux/usb/audio.h>
 
+#include <sound/control.h>
 #include <sound/core.h>
 #include <sound/info.h>
 #include <sound/pcm.h>
@@ -263,6 +264,20 @@ static int create_uaxx_quirk(struct snd_usb_audio *chip,
 }
 
 /*
+ * Create a standard mixer for the specified interface.
+ */
+static int create_standard_mixer_quirk(struct snd_usb_audio *chip,
+				       struct usb_interface *iface,
+				       struct usb_driver *driver,
+				       const struct snd_usb_audio_quirk *quirk)
+{
+	if (quirk->ifnum < 0)
+		return 0;
+
+	return snd_usb_create_mixer(chip, quirk->ifnum, 0);
+}
+
+/*
  * audio-interface quirks
  *
  * returns zero if no standard audio/MIDI parsing is needed.
@@ -294,7 +309,8 @@ int snd_usb_create_quirk(struct snd_usb_audio *chip,
 		[QUIRK_AUDIO_STANDARD_INTERFACE] = create_standard_audio_quirk,
 		[QUIRK_AUDIO_FIXED_ENDPOINT] = create_fixed_stream_quirk,
 		[QUIRK_AUDIO_EDIROL_UAXX] = create_uaxx_quirk,
-		[QUIRK_AUDIO_ALIGN_TRANSFER] = create_align_transfer_quirk
+		[QUIRK_AUDIO_ALIGN_TRANSFER] = create_align_transfer_quirk,
+		[QUIRK_AUDIO_STANDARD_MIXER] = create_standard_mixer_quirk,
 	};
 
 	if (quirk->type < QUIRK_TYPE_COUNT) {
sound/usb/usbaudio.h +1 -0
index 32f2a97..1e79986 100644
@@ -84,6 +84,7 @@ enum quirk_type {
 	QUIRK_AUDIO_FIXED_ENDPOINT,
 	QUIRK_AUDIO_EDIROL_UAXX,
 	QUIRK_AUDIO_ALIGN_TRANSFER,
+	QUIRK_AUDIO_STANDARD_MIXER,
 
 	QUIRK_TYPE_COUNT
 };
#1 lore raw
Quoted 4 lines · Takashi Iwai

please pull sound updates (part 2) for v2.6.40-rc1 from:

 git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6.git for-linus

Ok, I've bisected the sound problems on my machine to one of three. It's somewhere in this range:

af4ccf4f86c0..9477c58e3308

probably it's that last one ("ALSA: hda - Reorganize controller quriks with bit flags").

I'll have it fully bisected soon enough.

Linus

#2 lore raw
Quoted 8 lines · Linus Torvalds

Ok, I've bisected the sound problems on my machine to one of three. It's somewhere in this range:

 af4ccf4f86c0..9477c58e3308

probably it's that last one ("ALSA: hda - Reorganize controller quriks with bit flags").

Confirmed. Also confirmed that reverting that from current tip of git fixes the issue.

Takashi, do you see anything obviously wrong in there, or should I just go ahead and revert?

Linus

#3 lore raw
Quoted 8 lines · Linus Torvalds
Quoted 5 lines

 af4ccf4f86c0..9477c58e3308

probably it's that last one ("ALSA: hda - Reorganize controller quriks with bit flags").

Confirmed. Also confirmed that reverting that from current tip of git fixes the issue.

Just to clarify: it's commit 9477c58e3308f54a108a5d1eb9621830b329b0ca that is bad.

It causes odd stuttering/echoing effects on my bog-standard Westmere setup:

00:00.0 Host bridge: Intel Corporation Core Processor DRAM Controller (rev 12) 00:02.0 VGA compatible controller: Intel Corporation Core Processor
Integrated Graphics Controller (rev 12)
00:16.0 Communication controller: Intel Corporation 5 Series/3400
Series Chipset HECI Controller (rev 06)
00:1a.0 USB Controller: Intel Corporation 5 Series/3400 Series
Chipset USB2 Enhanced Host Controller (rev 06)
00:1b.0 Audio device: Intel Corporation 5 Series/3400 Series Chipset
High Definition Audio (rev 06)
...

with dmesg saying:

HDA Intel 0000:00:1b.0: PCI INT A -> GSI 22 (level, low) -> IRQ 22 HDA Intel 0000:00:1b.0: irq 52 for MSI/MSI-X
HDA Intel 0000:00:1b.0: setting latency timer to 64
hda_codec: ALC889: BIOS auto-probing.
HDMI status: Pin=6 Presence_Detect=0 ELD_Valid=0
input: HDA Intel HDMI/DP as
/devices/pci0000:00/0000:00:1b.0/sound/card0/input2
input: HDA Intel Headphone as
/devices/pci0000:00/0000:00:1b.0/sound/card0/input3
ALSA device list:

    #0: HDA Intel at 0xfb9f4000 irq 52

and I'm not seeing anything odd with the bad kernel, but the long-on "boing" sound repeats about once a second as an echo and some corruption for a few seconds, and trying to listen to music or anything else is just psychedelic (more echo/stutter effects).

Linus

#4 lore raw
Quoted 3 lines · Linus Torvalds

Just to clarify: it's commit 9477c58e3308f54a108a5d1eb9621830b329b0ca that is bad.

Looking at that diff, I found at least one bug:

- if (chip->driver_type != AZX_DRIVER_ATI &&
- chip->driver_type != AZX_DRIVER_ATIHDMI)
+ if (chip->driver_caps & AZX_DCAPS_NO_TCSEL) {

That's wrong. It should be

        if (!(chip->driver_caps & AZX_DCAPS_NO_TCSEL)) {

but I haven't checked if that fixes it for me yet.

Linus

#5 lore raw
Quoted 7 lines · Linus Torvalds

Looking at that diff, I found at least one bug:

-       if (chip->driver_type != AZX_DRIVER_ATI &&
-           chip->driver_type != AZX_DRIVER_ATIHDMI)
+       if (chip->driver_caps & AZX_DCAPS_NO_TCSEL) {

Quoted 5 lines

That's wrong. It should be

       if (!(chip->driver_caps & AZX_DCAPS_NO_TCSEL)) {

but I haven't checked if that fixes it for me yet.

Yup, that's it. Apparently if you don't clear the TCSEL bit, you get random static and repeated stuff.

And the reason the conversion was wrong is that the bit is not a "feature" bit, it's a "lack of feature" bit, but the conversion missed the negation.

Linus

#6 lore raw

At Fri, 27 May 2011 19:44:54 -0700,

Quoted 14 lines · Linus Torvalds
Quoted 11 lines · Linus Torvalds

Looking at that diff, I found at least one bug:

-       if (chip->driver_type != AZX_DRIVER_ATI &&
-           chip->driver_type != AZX_DRIVER_ATIHDMI)
+       if (chip->driver_caps & AZX_DCAPS_NO_TCSEL) {

That's wrong. It should be

       if (!(chip->driver_caps & AZX_DCAPS_NO_TCSEL)) {

Quoted 8 lines
Quoted 1 line

but I haven't checked if that fixes it for me yet.

Yup, that's it. Apparently if you don't clear the TCSEL bit, you get random static and repeated stuff.

And the reason the conversion was wrong is that the bit is not a "feature" bit, it's a "lack of feature" bit, but the conversion missed the negation.

My bad. I concentrated on fixing AMD issues, and this was a part of it. Obviously I didn't test Intel boxes carefully enough.

Sorry for taking your time!

Takashi