summaryrefslogtreecommitdiff
path: root/sound/pci/hda
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-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-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-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-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-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.
2013-03-18ALSA: hda/cirrus - Fix the digital beep registrationTakashi Iwai
The argument passed to snd_hda_attach_beep_device() is a widget NID while spec->beep_amp holds the composed value for amp controls. Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-03-18ALSA: hda - Fix missing beep detach in patch_conexant.cTakashi Iwai
This leaks the beep input device after module unload, which leads to Oops. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=55321 Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-03-15ALSA: hda - Fix missing EAPD/GPIO setup for Cirrus codecsTakashi Iwai
During the transition to the generic parser, the hook to the codec specific automute function was forgotten. This resulted in the silent output on some MacBooks. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-03-15ALSA: hda/ca0132 - Remove extra setting of dsp_state.Dylan Reid
spec->dsp_state is initialized to DSP_DOWNLOAD_INIT, no need to reset and check it in ca0132_download_dsp(). Signed-off-by: Dylan Reid <dgreid@chromium.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-03-15ALSA: hda/ca0132 - Check download state of DSP.Dylan Reid
Instead of using the dspload_is_loaded() function, check the dsp_state that is kept in the spec. The dspload_is_loaded() function returns true if the DSP transfer was never started. This false-positive leads to multiple second delays when ca0132_setup_efaults() times out on each write. Signed-off-by: Dylan Reid <dgreid@chromium.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-03-15ALSA: hda/ca0132 - Check if dspload_image succeeded.Dylan Reid
If dspload_image() fails, it was ignored and dspload_wait_loaded() was still called. dsp_loaded should never be set to true in this case, skip it. The check in dspload_wait_loaded() return true if the DSP is loaded or if it never started. Signed-off-by: Dylan Reid <dgreid@chromium.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-03-14ALSA: hda - Disable IDT eapd_switch if there are no internal speakersDavid Henningsson
If there are no internal speakers, we should not turn the eapd switch off, because it might be necessary to keep high for Headphone. BugLink: https://bugs.launchpad.net/bugs/1155016 Signed-off-by: David Henningsson <david.henningsson@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-03-13ALSA: hda - Don't apply EAPD power filter as defaultTakashi Iwai
So far, the driver doesn't power down the widget at going down to D3 when the widget node has an EAPD capability and EAPD is actually set on all codecs unless codec->power_filter is set explicitly. This caused a problem on some Conexant codecs, leading to click noises, and we set it as NULL there. But it is very unlikely that the problem hits only these codecs. Looking back at the development history, this workaround for EAPD was introduced just for some laptops with STAC9200 codec, then we applied it blindly for all. Now, since it's revealed to have an ill effect, we should disable this workaround per default and apply only for the known requiring systems. The EAPD workaround is implemented now as snd_hda_codec_eapd_power_filter(), and this has to be set explicitly by the codec driver when needed. As of now, only patch_stac9200() sets this one. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-03-13ALSA: hda - Allow unlimited pins and converters in patch_hdmi.cTakashi Iwai
Use the dynamic array allocations for pins, converters and PCM arrays instead of the fixed size arrays. The modern HDMI codecs get more and more pins, and we don't know the sensitive limit. Most of the patch are spent for the straight conversions from the fixed array access to snd_array helpers. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-03-13ALSA: hda - Drop explicit memset() by reallocation with __GFP_ZEROTakashi Iwai
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-03-12ALSA: hda - Fix snd_hda_get_num_raw_conns() to return a correct valueTakashi Iwai
In the connection list expansion in hda_codec.c and hda_proc.c, the value returned from snd_hda_get_num_raw_conns() is used as the array size to store the connection list. However, the function returns simply a raw value of the AC_PAR_CONNLIST_LEN parameter, and the widget list with ranges isn't considered there. Thus it may return a smaller size than the actual list, which results in -ENOSPC in snd_hda_get_raw_conections(). This patch fixes the bug by parsing the connection list correctly also for snd_hda_get_num_raw_conns(). Reported-and-tested-by: David Henningsson <david.henningsson@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-03-11ALSA: hda - Don't re-initialize shared hp/mic pinctlTakashi Iwai
When a headphone pin is set up as a shared hp/mic pin, we rather want to keep it as a headphone primarily as default, but the driver overrides it always as a mic pin, just because the input controls are created after outputs. Add a check of pin NID and skip the re-initialization of pinctl for such a shared hp/mic pin. Reported-by: Jonathan Woithe <jwoithe@just42.net> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-03-07ALSA: hda - Avoid automatic pin-ctl update for hp/mic when jack ctl existsTakashi Iwai
When the headphone mic jack enum control is created (via explicitly specification by user), it doesn't make much sense to change the I/O direction dynamically per capture source change, since the I/O direction is rather controlled over the enum ctl. This also reduces the implicit dependency between the capture source and the hp mic jack enum ctls, which might confuse a program accessing the whole control elements at once like alsactl. In addition, this patch introduces update_hp_automute_hook() function to call the proper hook function. It's just to remove the open codes in multiple places in hda_generic.c. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-03-07ALSA: hda - Consolidate add_in_jack_modes and add_out_jack_modes hintsTakashi Iwai
There is no big merit to distinguish these two hints. Instead, just have a single flag, add_jack_modes, for creating the jack mode enum ctls for both I/O directions. The hint string parser code is left and translated as add_jack_modes just for keeping compatibility. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-03-07ALSA: hda - Allow to change I/O direction in hp/mic jack mode ctlTakashi Iwai
The previous commits added the capability to change the pin control of hp/mic shared jack, but it actually didn't work as expected when the value is changed from the output to the input, since I forgot to reset the pin I/O bit in that case. This patch fixes the problem. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-03-07ALSA: hda - Add some model name strings for ALC260Takashi Iwai
In order to let user test the known workaround more easily, give a few known fixups for ALC260 to the model strings so that it can be passed via the module option. Also, move the unusual setups found in FSC S7020 fixup into a special model, fujitsu-jwse, Jonathan Woithe Special Edition. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-03-07ALSA: hda - Handle shared hp/mic jack modeTakashi Iwai
When a headphone jack is configured as a shared hp/mic jack, the jack mode enum needs to handle both input and output directions. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-03-07ALSA: hda - Add the generic Headphone Mic featureTakashi Iwai
This patch improves the generic parser code to allow to set up the headphone jack as a mic input. User can enable this feature by giving hp_mic hint string. The former shared hp/mic feature for the single built-in mic is still retained. This detection can be disabled now via hp_mic_detect hint string, too. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-03-07ALSA: hda - Add support of new codec ALC233Kailang Yang
It's compatible with ALC282. Signed-off-by: Kailang Yang <kailang@realtek.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-03-07ALSA: hda/ca0132 - Avoid division by zero in dspxfr_one_seg()Xi Wang
Move the zero check `hda_frame_size_words == 0' before the modulus `buffer_size_words % hda_frame_size_words'. Also remove the redundant null check `buffer_addx == NULL'. Signed-off-by: Xi Wang <xi.wang@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-03-07ALSA: hda - check NULL pointer when creating SPDIF PCM switchMengdong Lin
If the new control cannot be created, this function will return to avoid snd_hda_ctl_add dereferencing a NULL control pointer. Signed-off-by: Mengdong Lin <mengdong.lin@intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-03-07ALSA: hda - check NULL pointer when creating SPDIF controlsMengdong Lin
If the SPDIF control array cannot be reallocated, the function will return to avoid dereferencing a NULL pointer. Signed-off-by: Mengdong Lin <mengdong.lin@intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-02-25ALSA: hda - Enable beep for ASUS EeeBox EBP1501PTakashi Iwai
Reported-by: Harald Becker <ralda@gmx.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-02-22ALSA: hda - hdmi: Make jacks phantom, if they're not detectableDavid Henningsson
Just as for analog codecs, a jack that isn't suitable for detection (in this case, NO_PRESENCE was set) should be a phantom Jack instead of a normal one. Thanks to Raymond Yau for spotting. Cc: stable@vger.kernel.org BugLink: https://bugs.launchpad.net/bugs/961286 BugLink: https://bugzilla.redhat.com/show_bug.cgi?id=903869 Signed-off-by: David Henningsson <david.henningsson@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-02-19ALSA: hda - hdmi: Notify userspace when ELD control changesDavid Henningsson
ELD validity can change during the lifetime of a presence detect, so we need to be able to listen for changes on the ELD control. Signed-off-by: David Henningsson <david.henningsson@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-02-19ALSA: hda - hdmi: Protect ELD bufferDavid Henningsson
Because the eld buffer can be simultaneously accessed from both workqueue context (updating) and process context (kcontrol read), we need to protect it with a mutex to guarantee consistency. To avoid holding the mutex while reading the ELD info from the codec, we introduce a temporary eld buffer. Signed-off-by: David Henningsson <david.henningsson@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-02-19ALSA: hda - hdmi: Refactor hdmi_eld into parsed_hdmi_eldDavid Henningsson
For better readability, the information that is parsed out of the ELD data is now put into a separate parsed_hdmi_eld struct. Signed-off-by: David Henningsson <david.henningsson@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-02-19ALSA: hda - hdmi: Do not expose eld data when eld is invalidDavid Henningsson
Previously, it was possible to read the eld data of the previous monitor connected. This should not be allowed. Also refactor the function slightly. Signed-off-by: David Henningsson <david.henningsson@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-02-19ALSA: hda - hdmi: ELD shouldn't be valid after unplugDavid Henningsson
Currently, eld_valid is never set to false, except at kernel module load time. This patch makes sure that eld is no longer valid when the cable is (hot-)unplugged. Cc: stable@kernel.org Signed-off-by: David Henningsson <david.henningsson@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>