Commit Graph

13322 Commits

Author SHA1 Message Date
David Henningsson
c10514394e ALSA: usb - disable broken hw volume for Tenx TP6911
While going through Ubuntu bugs, I discovered this patch being
posted and a confirmation that the patch works as expected.

Finding out how the hw volume really works would be preferrable
to just disabling the broken one, but this would be better than
nothing.

Credit: sndfnsdfin (qawsnews)
BugLink: https://bugs.launchpad.net/bugs/559939
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-20 10:48:47 +02:00
David Henningsson
c40bd914a8 ALSA: hda - avoid non-standard "Docking" name in mixers
The standard name (and what PulseAudio picks up) is "Dock Mic",
not "Docking Mic" or "Docking-Station".

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-19 12:26:10 +02:00
Takashi Iwai
384dc085c3 ALSA: usb-audio: Avoid unnecessary EP setups in prepare
The recent fix for USB suspend breakage moved the code to set up EP
from hw_params to prepare, but it means also the EP setup might be
called multiple times unnecessarily because the prepare callback can
be called multiple times without starting the stream (e.g. OSS
emulation).

This patch adds a new flag to struct snd_usb_substream indicating
whether the setup of EP is required, and do it only when necessary,
i.e. right after hw_params or suspend.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-19 08:08:16 +02:00
Dylan Reid
61a709504b ALSA: usb-audio: Move configuration to prepare.
Move interface and endpoint configuration from hw_params to prepare
callback.  During system suspend/resume when the USB device power isn't
cycled the interface and endpoint configuration need to be set before
audio playback can continue.  Resume involves another call to prepare
but not to hw_params, moving it here allows a playing stream to continue
after resume.

Signed-off-by: Dylan Reid <dgreid@chromium.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-19 08:08:11 +02:00
Dylan Reid
35ec7aa298 ALSA: usb-audio: Don't require hw_params in endpoint.
Change the interface to configure an endpoint so that it doesn't require
a hw_params struct.  This will allow it to be called from prepare
instead of hw_params, configuring it after system resume.

Signed-off-by: Dylan Reid <dgreid@chromium.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-19 08:07:52 +02:00
Dylan Reid
715a170563 ALSA: usb-audio: set period_bytes in substream.
Set the peiod_bytes member of snd_usb_substream.  It was no longer being
set, but will be needed to resume properly in a future commit.

Signed-off-by: Dylan Reid <dgreid@chromium.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-19 08:07:34 +02:00
David Henningsson
4b527b6516 ALSA: hda - limit internal mic boost for Asus X202E
When the input gain for the internal mic is set to its maximum level,
the background noise becomes so high - and any relevant signal clipped -
that the setting becomes unusable. It is better to limit the amplification.

BugLink: https://bugs.launchpad.net/bugs/1052460
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Cc: <stable@vger.kernel.org> [v3.5+]
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-18 14:32:42 +02:00
Wang Xingchao
d279fae8a4 ALSA: hda - Add another pci id for Haswell board
A new PCI id 0x0d0c for Haswell HDA Controller.

[root@SKBM04SDP ~]# lspci |grep Audio
00:03.0 Audio device: Intel Corporation Device 0d0c (rev 02)
00:1b.0 Audio device: Intel Corporation Lynx Point HD Audio Controller

Signed-off-by: Wang Xingchao <xingchao.wang@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-17 10:35:07 +02:00
Vinod Koul
fb4a9779f1 ALSA: Compress - add codec parameter checks
Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-17 09:54:50 +02:00
Vinod Koul
4dc040a0b3 ALSA: compress - move the buffer check
Commit ALSA: compress_core: integer overflow in snd_compr_allocate_buffer()
added a new error check for input params.
this add new routine for input checks and moves buffer overflow check to this
new routine. This allows the error value to be propogated to user space

Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-17 09:54:41 +02:00
Takashi Iwai
e5d6db8e60 Merge branch 'topic/tlv-chmap' into for-next
This is a merge of a topic branch containing the support for the new
channel map API using control elements.
2012-09-15 16:32:31 +02:00
Takashi Iwai
62cbde1868 ALSA: hda - Add mic-mute LED control for HP laptop
Some of new HP laptops have a LED for microphone (or recording) mute,
and it's controlled by GPIO pin 3.

Bind this with the capture switch to turn it on/off properly by the
mixer change.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-14 12:23:50 +02:00
Dan Carpenter
b35cc82258 ALSA: compress_core: integer overflow in snd_compr_allocate_buffer()
These are 32 bit values that come from the user, we need to check for
integer overflows or we could end up allocating a smaller buffer than
expected.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-14 11:04:37 +02:00
Takashi Iwai
1dac6695c6 ALSA: hda - Allow to pass position_fix=0 explicitly
Set the default value of position_fix -1, and allow user passing
position_fix=0 explicitly to set the "auto" position-fix mode.
Otherwise the auto mode may be switched to others like COMBO of
VIACOMBO when the controller prefers it, thus user can't set the auto
mode any longer.

Also updated the documentation appropriately, too.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-13 15:03:10 +02:00
Takashi Iwai
5efbc2610a ALSA: Fix leftover chmap UNKNOWN -> MONO conversions
A few files have been slipped from the previous commit to add MONO
channel type.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-13 14:48:46 +02:00
Takashi Iwai
03efce755c ALSA: hda - Fix disordered enum definitions in patch_cirrus.c
Due to the definitions of CS420X_IMAC27_122 and CS420X_APPLE as
aliases, the rest enums are set to duplicated values unexpectedly.
Move the alias definitions at the end so that the enum values are
defined in the proper order.

Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-13 09:59:44 +02:00
Takashi Iwai
7b31d0095e ALSA: Define more channel map positions
For following the standard, define more channel map positions and
shuffle the items a bit:

- As both PulseAudio and gstreamer define MONO channel position
  explicitly, we should follow that, too.  The mono streams point to
  this channel position unless they are explicitly assigned to certain
  channel positions.

- Top-front-* and Top-rear-* positions are added, carried from
  PulseAudio's definitions.

- Move NA and MONO definitions at the top of table right after
  UNKNOWN, since these are more abstract in comparison with other
  practical positions.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-12 18:13:03 +02:00
Takashi Iwai
0afdb8f286 ALSA: ymfpci: Define channel maps
Provide channel maps for individual stereo streams of YMFPCI.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-12 16:14:37 +02:00
Takashi Iwai
7fb6861d62 ALSA: ens1370: Define channel maps
Provide channel maps for individual stereo streams of ENS1370 and
ENS1371.  Note that the configuration of ENS1370 uses the secondary
PCM as the front unlike ENS1371.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-12 15:53:26 +02:00
Takashi Iwai
3adc497f98 ALSA: emu10k1x: Define channel maps
Provide channel maps for individual stereo streams of emu10k1x.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-12 15:52:47 +02:00
Takashi Iwai
21147f91f1 ALSA: ca0106: Define channel maps
Provide channel maps for individual stereo streams of CA0106.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-12 15:52:09 +02:00
Takashi Iwai
1fe4d42e0e ALSA: ens1370: Reduce ifdefs
... just by defining CHIP_NAME and string concats.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-12 15:46:20 +02:00
Takashi Iwai
7e8d613b53 ALSA: ctxfi: Fix mono channel map to UNKNOWN
To follow the previous commit.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-12 15:19:23 +02:00
Takashi Iwai
ef596a57b4 ALSA: hda - Add support for MacBook Pro 10,1
MacBook Pro 10,1 needs a few adjustments to make it working:
- more COEF verbs
- some pin config overrides to disable the unused pin (0x0d, 0x12),
  and fix the internal mic (0x0e)

In addition, it uses GPIO 1 and 3 like other MacBooks.

The internal digital mic on the machine is still problematic: it seems
that only the right channel is used and the left is always static.
This looks like a hardware design, so we need to cope in the software
side somehow...

The primary information and test were brought from Daniel J Blueman.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-11 17:00:14 +02:00
Takashi Iwai
0528842690 Merge branch 'for-linus' into for-next
To merge HD-audio fixes back to 3.7 development line
2012-09-11 16:46:36 +02:00
Takashi Iwai
b35aabd78d ALSA: hda - Replace with the generic fixup codes in patch_cirrus.c
... to make easier to integrate into the common generic parser in near
future.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-11 16:45:09 +02:00
Takashi Iwai
a33b7b0a89 ALSA: hda - Check bit mask for codec SSID in snd_hda_pick_fixup()
snd_hda_pick_fixup() didn't check the case where the device mask bits
are set, typically used for SND_PCI_QUIRK_VENDOR() entries.  Fix this.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-11 16:42:18 +02:00
Takashi Iwai
915bf29eb9 ALSA: hda - Avoid BDL position workaround when no_period_wakeup is set
Originally the bogus period at BDL head was introduced as a workaround
for the mismatching position update at the period boundary, typically
seen on dmix.  However, for applications like PulseAudio that don't
require period wake ups, this workaround is just superfluous.  Thus
better to disable it when no_period_wakeup is given in hw_params.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-11 15:19:10 +02:00
Catalin Iacob
c302d6133c ALSA: hda_intel: add position_fix quirk for Asus K53E
Commit c20c5a841c changed some chipsets to
default to POS_FIX_COMBO so they now use POS_FIX_LPIB instead of
POS_FIX_POSBUF. Since then I've been getting artifacts on playback, including
repeated sounds on my Asus laptop.

My hardware is Cougar Point which the commit log of
c20c5a841c mentions as tested so POS_FIX_COMBO
probably works in general but apparently it doesn't on Asus K53E therefore the
need for the quirk.

Signed-off-by: Catalin Iacob <iacobcatalin@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-11 14:28:45 +02:00
Dan Carpenter
81cb324675 ALSA: compress_core: fix open flags test in snd_compr_open()
O_RDONLY is zero so the original test (f->f_flags & O_RDONLY) is always
false and it will never do compress capture.  The test for O_WRONLY is
also slightly off.  The original test would consider "->flags =
(O_WRONLY | O_RDWR)" as write only instead of rejecting it as invalid.

I've also removed the pr_err() because that could flood dmesg.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-11 14:27:40 +02:00
Takashi Iwai
2dc6fbf007 ALSA: pcm - Use UNKNOWN chmap for mono streams
In general, mono streams have no dedicated speaker assignment, thus
they should be rather marked as UNKNOWN position.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-11 14:24:43 +02:00
Takashi Iwai
498dab3aa7 ALSA: hda - Allow 3/5/7 channel map for HDMI/DP
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-10 16:08:40 +02:00
Takashi Iwai
07dc59f098 ALSA: hda - Fix Oops at codec reset/reconfig
snd_hda_codec_reset() calls restore_pincfgs() where the codec is
powered up again, which eventually tries to resume and initialize via
the callbacks of the codec.  However, it's the place just after codec
free callback, thus no codec callbacks should be called after that.
On a codec like CS4206, it results in Oops due to the access in init
callback.

This patch fixes the issue by clearing the codec callbacks properly
after freeing codec.

Reported-by: Daniel J Blueman <daniel@quora.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-10 10:26:23 +02:00
David Henningsson
5fe8e1e671 ALSA: hda - Remove ignore_misc_bit
The purpose of this flag is unclear. If the problem is that some machines
have broken misc/NO_PRESENCE bits, they should be fixed by pin fixups.

In addition, this causes jack detection functionality to be flawed on
the M31EI, where there are two jacks without jack detection (which is
properly marked as NO_PRESENCE), but due to ignore_misc_bit, these
jacks are instead being reported as being present but always unplugged.

BugLink: https://bugs.launchpad.net/bugs/939161
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-07 12:41:38 +02:00
Takashi Iwai
6e67683d71 ALSA: Remove VOLATILE flag from chmap ctls
The VOLATILE flag was added to control elements by
snd_pcm_add_chmap_ctls() just because I didn't want to have a
side-effect of "alsactl restore".  But now the set operation doesn't
allow to change the value unless the PCM stream is in PREAPRED state,
there is no reason to keep this flag.  Let's rip it off.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-06 18:08:33 +02:00
Takashi Iwai
8d50cdc1f5 ALSA: ctxfi: Implement channel maps
Assign the multi-channel map to front PCM, and other channel map to
each other channel PCM.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-06 18:08:33 +02:00
Takashi Iwai
f49921b894 ALSA: cmipci: Implement channel mapping
Simply enable the channel map according to the h/w capability.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-06 18:08:32 +02:00
Takashi Iwai
e36e3b86c7 ALSA: Implement channel maps for standard onboard AC97 drivers
Just set the channel maps depending on the hardware availability.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-06 18:08:31 +02:00
Takashi Iwai
833a493b7e ALSA: ac97: Implement channel map workaround for ALC650
ALC650 has a channel swap option between surround and CLFE channels,
so we need to tweak the channel maps dynamically depending on the
register bit.

Now struct snd_ac97 can contain chmap pointers for playback and
capture.  The driver may store these and let ac97 driver changing the
channel mapping dynamically.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-06 18:08:30 +02:00
Takashi Iwai
53775b0d0c ALSA: hda - Fix channel maps for Nvidia 7x 8ch HDMI codecs
Some old Nvidia HDMI codecs with 8ch support only 2/8 or
2/6/8 channels and with the fixed CLFE-first map.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-06 18:08:30 +02:00
Takashi Iwai
d45e6889ee ALSA: hda - Provide the proper channel mapping for generic HDMI driver
... instead of the standard fixed channel maps.
The generic HDMI is based on the audio infoframe, and its configuration
can be selected via CA bits.  Thus we need a translation between the
CA index and the verbose channel map list.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-06 18:08:26 +02:00
Takashi Iwai
9c9a5175e6 ALSA: hda - Add standard channel maps
Although HD-audio allows pair-wise channel configurations, only the
fixed channel positions are used in this version.  In future, this can
be changed and allow user to modify the channel positions.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-06 18:01:18 +02:00
Takashi Iwai
a8d372f171 ALSA: control: Fix missing VOLATILE flag at creating controls
The SNDRV_CTL_ELEM_ACCESS_VOLATILE bit flag wasn't properly inherited
at creating control elements via snd_ctl_new1().

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-06 18:01:16 +02:00
Takashi Iwai
2d3391ec0e ALSA: PCM: channel mapping API implementation
This patch implements the basic data types for the standard channel
mapping API handling.

- The definitions of the channel positions and the new TLV types are
  added in sound/asound.h and sound/tlv.h, so that they can be
  referred from user-space.

- Introduced a new helper function snd_pcm_add_chmap_ctls() to create
  control elements representing the channel maps for each PCM
  (sub)stream.

- Some standard pre-defined channel maps are provided for
  convenience.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-06 18:01:16 +02:00
Takashi Iwai
1a6003b525 ALSA: hda - Move non-PCM check to per_pin in patch_hdmi.c
Recently the check for non-PCM stream state was added to the generic
HDMI driver code.  But this check should be done rather to each pin
instead of each converter.  Otherwise when a different converter is
assigned at the next open, the audio infoframe can be inconsistent
with the setup using the previous converter.

For fixing this issue, this patch moves the state of the current
non-PCM status from per_cvt to per_pin.  (In addition an unused
argument cvt_nid is stripped from hdmi_setup_channel_mapping())

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-06 17:59:19 +02:00
Takashi Iwai
1213a205f9 ALSA: usb-audio: Fix bogus error messages for delay accounting
The recent fix for the missing fine delayed time adjustment gives
strange error messages at each start of the playback stream, such as
  delay: estimated 0, actual 352
  delay: estimated 353, actual 705

These come from the sanity check in retire_playback_urb().  Before the
stream is activated via start_endpoints(), a few silent packets have
been already sent.  And at this point the delay account is still in
the state as if the new packets are just queued, so the driver gets
confused and spews the bogus error messages.

For fixing the issue, we just need to check whether the received
packet is valid, whether it's zero sized or not.

Reported-by: Markus Trippelsdorf <markus@trippelsdorf.de>
Cc: <stable@vger.kernel.org> [v3.5+]
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-06 15:00:15 +02:00
David Henningsson
298efee7f5 ALSA: hda - fix control names for multiple speaker out on IDT/STAC
For multiple speaker outs, the names were previously
"Speaker,0", "Speaker,1", "Center"/"LFE", "Speaker,3". This is
inconsistent, confusing, and is not picked up correctly by PulseAudio.
Instead use "Front", "Surround", "Center"/"LFE", "Side" which
is more standard.

BugLink: https://bugs.launchpad.net/ubuntu/+source/linux/+bug/1046734
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-06 12:01:55 +02:00
Takashi Iwai
ab548d2dba ALSA: hda - Fix missing Master volume for STAC9200/925x
With the commit [2faa3bf: ALSA: hda - Rewrite the mute-LED hook with
vmaster hook in patch_sigmatel.c], the former Master volume control
was converted to PCM.  This was supposed to be covered by the vmaster
control.  But due to the lack of "PCM" slave definition, this didn't
happen properly.  The patch fixes the missing entry.

Reported-by: Andrew Shadura <bugzilla@tut.by>
Cc: <stable@vger.kernel.org> [v3.4+]
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-06 10:10:11 +02:00
Wang Xingchao
2d7e887cbb ALSA: HDMI - Setup channel mapping for non_pcm audio
For HBR stream test, use straight channel mapping way.
when switched back to "speaker-test -c8", even the audio
infoframe is up-to-date, there should be correct channel mapping setup.

Signed-off-by: Wang Xingchao <xingchao.wang@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-06 08:50:35 +02:00
Wang Xingchao
433968da4d ALSA: HDMI - Enable HBR feature on Intel chips
HDMI channel remapping apparently effects HBR packets on Intel's chips.
For compressed non-PCM audio, use "straight-through" channel mapping.
For uncompressed multi-channel pcm audio, use normal channel mapping.

Signed-off-by: Wang Xingchao <xingchao.wang@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-06 08:50:33 +02:00