summaryrefslogtreecommitdiff
path: root/sound
AgeCommit message (Collapse)Author
2013-04-05ALSA: hda/ca0132 - Update latency based on DSP state.Dylan Reid
The DSP in the CA0132 codec adds a variable latency to audio depending on what processing is being done. Add a new patch op to return that latency for capture and playback streams. The latency is determined by which blocks are enabled and knowing how much latency is added by each block. Signed-off-by: Dylan Reid <dgreid@chromium.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-04-05ALSA: hda - Introduce get_delay codec PCM opsTakashi Iwai
Add a new codec PCM ops, get_delay(), to obtain the codec/stream- specific PCM delay count. When it's NULL, nothing changes. This new feature was requested for CA0132, which has significant delays in the path depending on the running DSP code. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-04-04ALSA: usb-audio: UAC2: support read-only freq controlEldad Zack
Some clocks might be read-only, e.g., external clocks (see also UAC2 4.7.2.1). In this case, setting the sample frequency will always fail (even if the rate is equal to the current clock rate), therefore do not write, but read the value and compare to the requested rate. If the clock is read only, avoid reading it twice. If it doesn't match, return -ENXIO since the clock is invalid for this configuration. Signed-off-by: Eldad Zack <eldad@fogrefinery.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-04-04ALSA: usb-audio: show err in set_sample_rate_v2 debugEldad Zack
Show the error code returned from the USB subsystem in the debug messages. Signed-off-by: Eldad Zack <eldad@fogrefinery.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-04-04ALSA: usb-audio: UAC2: auto clock selection module paramEldad Zack
Add a module param to disable auto clock selection. This is provided for users that expect the audio stream to fail when the clock source is invalid (e.g., the word clock was unintentionally disconnected). Signed-off-by: Eldad Zack <eldad@fogrefinery.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-04-04ALSA: usb-audio: UAC2: try to find and switch to valid clockEldad Zack
If a selector is available on a device, it may be pointing to a clock source which is currently invalid. If there is a valid clock source which can be selected, switch to it. Signed-off-by: Eldad Zack <eldad@fogrefinery.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-04-04ALSA: usb-audio: UAC2: do clock validity check earlierEldad Zack
Move the check that parse_audio_format_rates_v2() do after receiving the clock source entity ID directly into the find function and add a validation flag to the function. This patch does not introduce any logic flow change. It is provided to allow introducing automatic clock switching easier later. By moving this uac_clock_source_is_valid callsite, 2 additional callsites can be avoided. Signed-off-by: Eldad Zack <eldad@fogrefinery.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-04-04ALSA: usb-audio: use endianness macrosEldad Zack
Replace the endianness conversions with the kernel-wide swabbing macros in get/set_sample_rate_v2. Signed-off-by: Eldad Zack <eldad@fogrefinery.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-04-04ALSA: usb-audio: spelling correctionEldad Zack
Correct spelling of snd_usb_endpoint_implict_feedback_sink in all occurances. Signed-off-by: Eldad Zack <eldad@fogrefinery.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-04-04ALSA: usb-audio: neaten EXPORT_SYMBOLS placementEldad Zack
Put EXPORT_SYMBOLS directly under the exported function. Signed-off-by: Eldad Zack <eldad@fogrefinery.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-04-04ALSA: usb-audio: neaten MODULE_DEVICE_TABLE placementEldad Zack
Minor style fix, following a general code style in the kernel. Signed-off-by: Eldad Zack <eldad@fogrefinery.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-04-04ALSA: usb-audio: convert list_for_each to entry variantEldad Zack
Change occurances of list_for_each into list_for_each_entry where applicable. Signed-off-by: Eldad Zack <eldad@fogrefinery.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-04-03ALSA: usb-audio: Clean up the code in set_sample_rate_v2()Takashi Iwai
Just for cleaning up, introduce a new function get_sample_rate_v2() for replacing two identical calls in set_sample_rate_v2(). No functional change. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-04-03Merge branch 'for-linus' into for-nextTakashi Iwai
Back-merge for cleaning up usb-audio code the recent commit modified, and further UAC2 autoclock patches.
2013-04-03ALSA: usb: Work around CM6631 sample rate change bugTorstein Hegge
The C-Media CM6631 USB receiver doesn't respond to changes in sample rate while the interface is active. The same behavior is observed in other UAC2 hardware like the VIA VT1731. Reset the interface after setting the sampling frequency on sample rate changes, to ensure that the sample rate set by snd_usb_init_sample_rate() is used. Otherwise, the device will try to use the sample rate of the previous stream, causing distorted sound on sample rate changes. The reset is performed for all UAC2 devices, as it should not affect a standards compliant device, but it is only necessary for C-Media CM6631, VIA VT1731 and possibly others. Failure to read sample rate from the device is not handled as an error in set_sample_rate_v2(), as (permanent or intermittent) failure to read sample rate isn't essential for a successful sample rate set. Signed-off-by: Torstein Hegge <hegge@resisty.net> Acked-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-04-02ALSA: hda - bug fix on HDMI ELD debug messageMengdong Lin
This patch let ELD debug message show 'pin_eld->monitor_present' which reflects the real pin response to verb GET_PIN_SENSE. 'eld->monitor_present' should not be used here because 'eld' is a temp structure now and so its "monitor_present" is not set. Signed-off-by: Mengdong Lin <mengdong.lin@intel.com> Acked-by: David Henningsson <david.henningsson@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-04-02ALSA: hda - bug fix on return value when getting HDMI ELD infoMengdong Lin
In function snd_hdmi_get_eld(), the variable 'ret' should be initialized to 0. Otherwise it will be returned uninitialized as non-zero after ELD info is got successfully. Thus hdmi_present_sense() will always assume ELD info is invalid by mistake, and /proc file system cannot show the proper ELD info. Signed-off-by: Mengdong Lin <mengdong.lin@intel.com> Cc: stable@vger.kernel.org Acked-by: David Henningsson <david.henningsson@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-04-02ALSA: hda/ca0132 - Delay HP amp turnon.Chih-Chung Chang
Turing on the headphone amp interferes with the impedance measurement used to detect a TRRS style headset microphone. Delay the HP turn on until 500ms after the jack is detected, allowing the mic detection state machine to run to completion. Signed-off-by: Chih-Chung Chang <chihchung@chromium.org> Signed-off-by: Dylan Reid <dgreid@chromium.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-04-02sound: oss: sb_common: Used kmemdup instead of kmalloc and memcpyAlexandru Gheorghiu
Used kmemdup instead of replicating it's behaviour with kmalloc followed by memcpy. Patch found using coccinelle. Signed-off-by: Alexandru Gheorghiu <gheorghiuandru@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-04-02sound: oss: uart401: Used kmemdup instead of kmalloc and memcpyAlexandru Gheorghiu
Used kmemdup instead of replicating it's behaviour with kmalloc followed by memcpy. Patch found using coccinelle. Signed-off-by: Alexandru Gheorghiu <gheorghiuandru@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-03-26Merge remote-tracking branch 'asoc/fix/spear' into asoc-nextMark Brown
2013-03-26Merge remote-tracking branch 'asoc/fix/si476x' into asoc-nextMark Brown
2013-03-26Merge remote-tracking branch 'asoc/fix/sh' into asoc-nextMark Brown
2013-03-26Merge remote-tracking branch 'asoc/fix/max98090' into asoc-nextMark Brown
2013-03-26Merge remote-tracking branch 'asoc/fix/fsl' into asoc-nextMark Brown
2013-03-26Merge remote-tracking branch 'asoc/fix/dapm' into asoc-nextMark Brown
2013-03-26Merge remote-tracking branch 'asoc/fix/core' into asoc-nextMark Brown
2013-03-26Merge remote-tracking branch 'asoc/fix/adsp' into asoc-nextMark Brown
2013-03-22ALSA: hda - VIA prefers side surrounds over HPTakashi Iwai
The recent fix for the independent HP reduced the availability of the side surround output, because there are only 4 DACs for 7.1 and a HP outputs. Adjust the badness tables for VIA so that 7.1 outputs are activated for the cost of missing independent HP. Once when we implement the dynamic DAC switching to multiple outputs, this conflicts will be eased in future... Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-03-22ALSA: hda - Lower the badness for independent HP penaltyTakashi Iwai
The lack of independent HP mode shouldn't be too bad, but currently its badness is set a bit too high. Let's lower it. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-03-22ALSA: hda - Allow codec drivers to give own badness tablesTakashi Iwai
The standard badness values don't seem to fit to all preferences. Some configuration prefer the side output over the headphone, some want the speaker over the surround, etc. This patch moves the badness table pointers into hda_gen_spec, so that the codec driver can override them. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-03-22Merge branch 'for-linus' into for-nextTakashi Iwai
Merge back for-linus branch for the badness table adjustment for VIA codecs * for-linus: ALSA: hda - Fix DAC assignment for independent HP ALSA: hda - Fix abuse of snd_hda_lock_devices() for DSP loader ALSA: hda - Fix typo in checking IEC958 emphasis bit ALSA: snd-usb: mixer: ignore -EINVAL in snd_usb_mixer_controls() ALSA: snd-usb: mixer: propagate errors up the call chain ALSA: usb: Parse UAC2 extension unit like for UAC1 ALSA: hda - Fix yet missing GPIO/EAPD setup in cirrus driver
2013-03-22ASoC: dma-sh7760: Fix compile errorLars-Peter Clausen
The dma-sh7760 currently fails with the following compile error: sound/soc/sh/dma-sh7760.c:346:2: error: unknown field 'pcm_ops' specified in initializer sound/soc/sh/dma-sh7760.c:346:2: warning: initialization from incompatible pointer type sound/soc/sh/dma-sh7760.c:347:2: error: unknown field 'pcm_new' specified in initializer sound/soc/sh/dma-sh7760.c:347:2: warning: initialization makes integer from pointer without a cast sound/soc/sh/dma-sh7760.c:348:2: error: unknown field 'pcm_free' specified in initializer sound/soc/sh/dma-sh7760.c:348:2: warning: initialization from incompatible pointer type sound/soc/sh/dma-sh7760.c: In function 'sh7760_soc_platform_probe': sound/soc/sh/dma-sh7760.c:353:2: warning: passing argument 2 of 'snd_soc_register_platform' from incompatible pointer type include/sound/soc.h:368:5: note: expected 'struct snd_soc_platform_driver *' but argument is of type 'struct snd_soc_platform *' This is due the misnaming of the snd_soc_platform_driver type name and 'ops' field. The issue was introduced in commit f0fba2a("ASoC: multi-component - ASoC Multi-Component Support"). Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Cc: stable@vger.kernel.org
2013-03-21ALSA: hda - Fix DAC assignment for independent HPTakashi Iwai
The generic parser should evaluate the availability of the independent HP when specified. Otherwise a DAC without the direct connection to the corresponding pin may be assigned for the HP, but the driver doesn't check it at all. The problem was actually seen on some machines with VT1708s or equivalent codec, where DAC0 is assigned to HP although it can be connected only via aamix. This patch adds the badness evaluation for the independent HP to make it working properly. Reported-by: Lydia Wang <LydiaWang@viatech.com.cn> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-03-21ALSA: hda - Enable "Headset Mic" name for some Dell Latitude devicesDavid Henningsson
Now that we have a "Headset Mic" name, let's use it for some devices we know for sure has a headset mic jack. Signed-off-by: David Henningsson <david.henningsson@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-03-21ALSA: hda - Introduce "Headset Mic" nameDavid Henningsson
Headset mic jacks, i e TRRS style jacks with Headphone Left, Headphone Right, Mic and GND signals, are becoming increasingly common and are now being shipped by several manufacturers. Unfortunately, the HDA specification does not give us any hint of whether a Mic pin belongs to such a jack or not, but it would still be helpful for the user to know (especially if there is one TRS Mic jack and one TRRS headset jack). This new fixup causes the first (non-dock, non-internal) mic to be a headset mic jack. The algorithm can be later refined if needed. Signed-off-by: David Henningsson <david.henningsson@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-03-20ALSA: hda - Fix abuse of snd_hda_lock_devices() for DSP loaderTakashi Iwai
The current DSP loader code abuses snd_hda_lock_devices() for ensuring the DSP loader not conflicting with the other normal operations. But this trick obviously doesn't work for the PM resume since the streams are kept opened there where snd_hda_lock_devices() returns -EBUSY. That means we need another lock mechanism instead of abuse. This patch provides the new lock state to azx_dev. Theoretically it's possible that the DSP loader conflicts with the stream that has been already assigned for another PCM. If it's running, the DSP loader should simply fail. If not -- it's the case for PM resume --, we should assign this stream temporarily to the DSP loader, and take it back to the PCM after finishing DSP loading. If the PCM is operated during the DSP loading, it should get an error, too. Reported-and-tested-by: Dylan Reid <dgreid@chromium.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-03-20ALSA: hda - Fix typo in checking IEC958 emphasis bitTakashi Iwai
There is a typo in convert_to_spdif_status() about checking the emphasis IEC958 status bit. It should check the given value instead of the resultant value. Reported-by: Martin Weishart <martin.weishart@telosalliance.com> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-03-20ASoC: core: fix invalid free of devm_ allocated dataSilviu-Mihai Popescu
The objects allocated by devm_* APIs are managed by devres and are freed when the device is detached. Hence there is no need to use kfree() explicitly. Signed-off-by: Silviu-Mihai Popescu <silviupopescu1990@gmail.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-03-20ASoC: spear_pcm: Update to new pcm_new() APILars-Peter Clausen
Commit 552d1ef6 ("ASoC: core - Optimise and refactor pcm_new() to pass only rtd") updated the pcm_new() callback to take the rtd as the only parameter. The spear PCM driver (which was merged much later) still uses the old API. This patch updates the driver to the new API. Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Acked-by: Rajeev Kumar <rajeev-dlh.kumar@st.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com> Cc: stable@vger.kernel.org
2013-03-20ASoC:: max98090: Remove executable bitJoe Perches
Source files shouldn't have the executable bit set. Signed-off-by: Joe Perches <joe@perches.com> Signed-off-by: Mark Brown <broonie@opensource.wolfsonmicro.com>
2013-03-20ALSA: snd-usb: mixer: ignore -EINVAL in snd_usb_mixer_controls()Daniel Mack
Creation of individual mixer controls may fail, but that shouldn't cause the entire mixer creation to fail. Even worse, if the mixer creation fails, that will error out the entire device probing. All the functions called by parse_audio_unit() should return -EINVAL if they find descriptors that are unsupported or believed to be malformed, so we can safely handle this error code as a non-fatal condition in snd_usb_mixer_controls(). That fixes a long standing bug which is commonly worked around by adding quirks which make the driver ignore entire interfaces. Some of them might now be unnecessary. Signed-off-by: Daniel Mack <zonque@gmail.com> Reported-and-tested-by: Rodolfo Thomazelli <pe.soberbo@gmail.com> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-03-20ALSA: snd-usb: mixer: propagate errors up the call chainDaniel Mack
In check_input_term() and parse_audio_feature_unit(), propagate the error value that has been returned by a failing function instead of -EINVAL. That helps cleaning up the error pathes in the mixer. Signed-off-by: Daniel Mack <zonque@gmail.com> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-03-20ALSA: usb: Parse UAC2 extension unit like for UAC1Torstein Hegge
UAC2_EXTENSION_UNIT_V2 differs from UAC1_EXTENSION_UNIT, but can be handled in the same way when parsing the unit. Otherwise parse_audio_unit() fails when it sees an extension unit on a UAC2 device. UAC2_EXTENSION_UNIT_V2 is outside the range allocated by UAC1. Signed-off-by: Torstein Hegge <hegge@resisty.net> Acked-by: Daniel Mack <zonque@gmail.com> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-03-18ALSA: hda - Fix yet missing GPIO/EAPD setup in cirrus driverTakashi Iwai
I forgot to update spec->gpio_data in the automute hook, so it will be overridden at the init sequence, thus the machine is still silent when no headphone jack is plugged at boot time. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-03-18ALSA: hda - Add GPIO-based LED support on HP desktop machinesTakashi Iwai
The new HP desktop machines have Realtek codecs and their LEDs are controlled via GPIO as for many laptop models. Add similar hooks as well as in patch_sigmatel.c for controlling LEDs. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-03-18ALSA: hda - Make the resume of digital beep setup properTakashi Iwai
The verb to set up the digital beep via AC_VERB_SET_DIGI_CONVERT_2 should be executed at resume as well. Use the cached write for it being performed automatically at resume. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-03-18ALSA: hda - Fix power-saving during playing beep soundTakashi Iwai
While playing the digital beep tone, the codec shouldn't be turned off. This patch adds proper snd_hda_power_up()/down() calls at each time when the beep is played or off. Also, this fixes automatically an unnecessary codec power-up at detaching the beep device when the beep isn't being played. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-03-18ALSA: hda - Move beep attach/detach calls in hda_generic.cTakashi Iwai
Instead of calling snd_hda_attach_beep_device() and snd_hda_detach_beep_device() in each codec driver, move them to the generic parser. The codec driver just needs to set spec->beep_nid for activating the digital beep. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-03-18Merge branch 'for-linus' into for-nextTakashi Iwai
Back-merged for refactoring beep stuff.