summaryrefslogtreecommitdiff
path: root/sound
AgeCommit message (Collapse)Author
2012-09-06ALSA: PCM: channel mapping API implementationTakashi Iwai
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-06ALSA: control: Fix missing VOLATILE flag at creating controlsTakashi Iwai
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-06ALSA: hda - Move non-PCM check to per_pin in patch_hdmi.cTakashi Iwai
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-06ALSA: hda - fix control names for multiple speaker out on IDT/STACDavid Henningsson
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-06ALSA: HDMI - Setup channel mapping for non_pcm audioWang Xingchao
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-06ALSA: HDMI - Enable HBR feature on Intel chipsWang Xingchao
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-06ALSA: HDMI - Fix channel_allocation array wrong orderWang Xingchao
The array channel_allocations[] is an ordered list, add function to get correct order by ca_index. Signed-off-by: Wang Xingchao <xingchao.wang@intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-05Merge branch 'fixes' of git://git.alsa-project.org/alsa-kernel into for-nextTakashi Iwai
2012-09-05ALSA: emu10k1: use list_move_tail instead of list_del/list_add_tailWei Yongjun
Using list_move_tail() instead of list_del() + list_add_tail(). Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-05ALSA: opl4: use list_move_tail instead of list_del/list_add_tailWei Yongjun
Using list_move_tail() instead of list_del() + list_add_tail(). Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Acked-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-04ALSA: remove the main version informationJaroslav Kysela
Remove the main ALSA version number from the kernel ALSA driver. The ALSA driver package release diverges from the upstream. This may confuse users to see the same ALSA version for many kernel releases and this version lost it's original purpose and connection. The "ioctl" APIs have own version numbers, so the user space may check for specific API changes only. Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2012-09-04ALSA: snd-usb: Add quirks for Playback Designs devicesDaniel Mack
Playback Designs' USB devices have some hardware limitations on their USB interface. In particular: - They need a 20ms delay after each class compliant request as the hardware ACKs the USB packets before the device is actually ready for the next command. Sending data immediately will result in buffer overflows in the hardware. - The devices send bogus feedback data at the start of each stream which confuse the feedback format auto-detection. This patch introduces a new quirks hook that is called after each control packet and which adds a delay for all devices that match Playback Designs' USB VID for now. In addition, it adds a counter to snd_usb_endpoint to drop received packets on the floor. Another new quirks function that is called once an endpoint is started initializes that counter for these devices on their sync endpoint. Signed-off-by: Daniel Mack <zonque@gmail.com> Reported-and-tested-by: Andreas Koch <andreas@akdesigninc.com> Supported-by: Demian Martin <demianm_1@yahoo.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-03ALSA: USB: Support for (original) Xbox CommunicatorMarko Friedemann
Added support for Xbox Communicator to USB quirks. Signed-off-by: Marko Friedemann <mfr@bmx-chemnitz.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-03ALSA: fix possible memory leak in snd_mixer_oss_build_input()Wei Yongjun
uinfo has been allocated in this function and should be freed before leaving from the error handling cases. spatch with a semantic match is used to found this problem. (http://coccinelle.lip6.fr/) Signed-off-by: Wei Yongjun <yongjun_wei@trendmicro.com.cn> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-09-03ALSA: Remove the last mention of SNDRV_MAIN_OBJECT_FILEJosh Triplett
SNDRV_MAIN_OBJECT_FILE hasn't done anything since the pre-git days, and the only remaining reference occurs as a #define in sound/last.c. Drop that last mention of it. Signed-off-by: Josh Triplett <josh@joshtriplett.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-31ALSA: hda - Clean up redundant FG checksTakashi Iwai
Just refactoring, no functional changes. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-31ALSA: hda - Yet another fix for D3 stop-clock refcountingTakashi Iwai
The call of pm_notify callback in snd_hda_codec_free() should be with the check of the current state whether pm_notify(false) is called or not, instead of codec->power_on check. For improving the code readability and fixing this inconsistency, codec->d3_stop_clk_ok is renamed to codec->pm_down_notified, and this flag is set only when runtime PM down is called. The new name reflects to a more direct purpose of the flag. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-30ALSA: cs5530: Fix resource leak in error pathTakashi Iwai
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=44741 Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-30ALSA: korg1212: Fix reverted min/max ADC sense rangeTakashi Iwai
k1212MinADCSens and k1212MaxADCSens are defined wrongly. The max must be greater than the min by obvious reason. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=46561 Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-30ALSA: hda - Optimize bitfield usage in struct hda_codecTakashi Iwai
Move up a few bitfields to be packed into a single int. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-30ALSA: hda - Clean up CONFIG_SND_HDA_POWER_SAVETakashi Iwai
CONFIG_SND_HDA_POWER_SAVE is no longer an experimental feature and its behavior can be well controlled via the default value and module parameter. Let's just replace it with the standard CONFIG_PM. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-30ALSA: hda - Fix D3 clock stop check for codecs with own set_power_state opTakashi Iwai
When a codec provides its own set_power_state op, the D3-clock-stop isn't checked correctly. And the recent changes for repeating the state-setting operation isn't applied to such a codec, too. This patch fixes these issues by moving the call of codec's own op to the place where the generic power-set operation is done, and move the power-state synchronization code out of snd_hda_set_power_state_to_all() so that it can be called always at the end of power-up/down sequence, and updates the D3 clock-stop flag properly. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-30ALSA: hda - Fix runtime PM leftover refcountsTakashi Iwai
When the HD-audio is removed, it leaves the refcounts when codecs are powered up (usually yes) in the destructor. For fixing the unbalance, and cleaning up the code mess, this patch changes the following: - change pm_notify callback to take the explicit power on/off state, - check of D3 stop-clock and keep_link_on flags is moved to the caller side, - call pm_notify callback in snd_hda_codec_new() and snd_hda_codec_free() so that the refcounts are proprely updated. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-28ALSA: usb-audio: Remove obsoleted fields in struct snd_usb_substreamTakashi Iwai
The two entries are duplicated in struct snd_usb_endpoint. Seems forgotten in the last clean-up. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-28ALSA: emu8000: fix emu8000 DRAM sized 512 KiB too smallDavid Flater
v2: Fixed result still wrong in the case of 512 KiB DRAM. Oops. Applicable to 3.5.3 mainline. In emu8000.c, size_dram determines the amount of memory on the sound card by doing write/readback tests starting at 512 KiB and incrementing by 512 KiB. On success, detected_size is updated to the successful address and testing continues. On failure, the loop is immediately exited. The resulting detected_size is 512 KiB too small except in two special cases: 1. If there is no memory, the initial 0 value of detected_size is used, which is correct. 2. If the address space wraps around, detected_size is updated before the bailout, so the result is correct. The patch corrects all cases and was tested with an AWE64 Gold. Before: EMU8000 [0x620]: 3584 Kb on-board memory detected asfxload 4GMGSMT.SF2 (4174814 B) fails. After: EMU8000 [0x620]: 4096 Kb on-board memory detected asfxload 4GMGSMT.SF2 succeeds. I do not have a card with 512 KiB to test with, but by forcibly enabling the added conditional I verified on the AWE64 Gold that it detects 512 KiB (successfully reading from the first memory location) and does not hang the card. C.f. Bug 46451 https://bugzilla.kernel.org/show_bug.cgi?id=46451 Signed-off-by: David Flater <dave@flaterco.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-28Merge branch 'for-linus' into for-nextTakashi Iwai
Need to merge the fixes regarding EPSS. Conflicts: sound/pci/hda/hda_codec.c
2012-08-28ALSA: hda - Don't trust codec EPSS bit for IDT 92HD83xx & coTakashi Iwai
These codecs seem reporting EPSS but require longer delay for the proper D3 transition. For example, D3_STOP_CLOCK_OK bit won't be set correctly even after D3. In this patch, codec->epss flag is overridden for avoid the misbehavior. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-28ALSA: hda - Avoid unnecessary parameter read for EPSSTakashi Iwai
EPSS parameter should be static, so we can read it once and remember. This also allows more easily to override the wrong EPSS capability reported from a codec by changing the flag in the codec initialization step. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-28ALSA: hda - Make clear built-in driver optimizationTakashi Iwai
Use unsigned int to make clear that the codes required only for modules will be reduced by the compiler optimization. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-27ALSA: pcxhr: Add 8 new sound cardsMarkus Bollinger
add new sound cards VX442HR VX442e PCX442HR PCX442e VX822HR VX822e PCX822HR and PCX822e Signed-off-by: Markus Bollinger <bollinger@digigram.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-24ALSA: cmi8328: Fix build error with CONFIG_GAMEPORT=nTakashi Iwai
sound/isa/cmi8328.c: In function 'snd_cmi8328_remove': sound/isa/cmi8328.c:416:24: error: 'cmi' undeclared (first use in this function) sound/isa/cmi8328.c:416:24: note: each undeclared identifier is reported only once for each function it appears in make[3]: *** [sound/isa/cmi8328.o] Error 1 Reported-by: Randy Dunlap <rdunlap@xenotime.net> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-24ALSA: hda - bug fix on references without checking CONFIG_SND_HDA_POWER_SAVEMengdong Lin
The patch to support runtime PM introduced a bug: Module parameter 'power_save_controller', and the codec flag 'd3_stop_clk' 'd3_stop_clk_ok' are defined only when HDA power save is enabled in config. But there are references to them without checking macro CONFIG_SND_HDA_POWER_SAVE. This patch is to fix the bug. Signed-off-by: Mengdong Lin <mengdong.lin@intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-23ALSA: hda - add runtime PM supportMengdong Lin
Runtime PM can bring more power saving: - When the controller is suspended, its parent device will also have a chance to suspend. - PCI subsystem can choose the lowest power state the controller can signal wake up from. This state can be D3cold on platforms with ACPI PM support. And runtime PM can provide a gerneral sysfs interface for a system policy manager. Runtime PM support is based on current HDA power saving implementation. The user can enable runtime PM on platfroms that provide acceptable latency on transition from D3 to D0. Details: - When both power saving and runtime PM are enabled: -- If a codec supports 'stop-clock' in D3, it will request suspending the controller after it enters D3 and request resuming the controller before back to D0. Thus the controller will be suspended only when all codecs are suspended and support stop-clock in D3. -- User IO operations and HW wakeup signal can resume the controller back to D0. - If runtime PM is disabled, power saving just works as before. - If power saving is disabled, the controller won't be suspended because the power usage counter can never be 0. More about 'stop-clock' feature: If a codec can support targeted pass-through operations in D3 state when there is no BCLK present on the link, it will set CLKSTOP flag in the supported power states and report PS-ClkStopOk when entering D3 state. Please refer to HDA spec section 7.3.3.10 Power state and 7.3.4.12 Supported Power State. [Fixed CONFIG_PM_RUNTIME dependency in hda_intel.c by tiwai] Signed-off-by: Mengdong Lin <mengdong.lin@intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-22ALSA: hda - Call snd_hda_jack_report_sync() generically in hda_codec.cTakashi Iwai
Instead of calling the jack sync in the init callback of each codec, call it generically at initialization and resume. By calling it at the last of resume sequence, a possible race between the jack sync and the unsol event enablement in the current code will be closed, too. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-22ALSA: hda - Do not set GPIOs for speakers on IDT if there are no speakersDavid Henningsson
This fixes an issue with a machine where there were no speakers, but GPIO0 had to be data=1 for the headphone to be functioning. I'm not sure if we need a more advanced patch to solve all possible cases, but if so, this patch would still provide a minor optimisation. BugLink: https://bugs.launchpad.net/bugs/1040077 Signed-off-by: David Henningsson <david.henningsson@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-21ALSA: introduce snd-cmi8328: C-Media CMI8328 driverOndrej Zary
Introduce snd-cmi8328 driver for C-Media CMI8328-based sound cards, such as AudioExcel AV500. It supports PCM playback and capture (full-duplex) through wss_lib, gameport, OPL3 and MPU401. The AV500 card has onboard Dream wavetable synth connected to the MPU401 port and Aux 1 input internally which works too. The CDROM interface is not supported (as the drivers for these CDROMs were removed from the kernel some time ago). A separate driver is needed because CMI8328 is completely different chip to CMI8329/CMI8330. It's configured by magic registers (there's no PnP). Sound is provided by a real WSS codec (CS4231A) and the SB part is just a SB Pro emulation (for DOS games, useless for Linux). When SB is enabled, the CMI8328 chip disables access to the WSS codec, emulates SoundBlaster on one side and outputs sound data to the codec - so SB and WSS can't work together with this card. The WSS codec can do full duplex by itself so there's no need for crazy things like snd-cmi8330 does (combining SB and WSS parts into one driver). Signed-off-by: Ondrej Zary <linux@rainbow-software.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-21ALSA: snd-als100: fix suspend/resumeOndrej Zary
snd_card_als100_probe() does not set pcm field in struct snd_sb. As a result, PCM is not suspended and applications don't know that they need to resume the playback. Tested with Labway A381-F20 card (ALS120). Signed-off-by: Ondrej Zary <linux@rainbow-software.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-20Merge branch 'for-linus' into for-nextTakashi Iwai
Conflicts: sound/pci/hda/hda_codec.c Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-20ALSA: hda - Fix leftover codec->power_transitionTakashi Iwai
When the codec turn-on operation is canceled by the immediate power-on, the driver left the power_transition flag as is. This caused the persistent avoidance of power-save behavior. Cc: <stable@vger.kernel.org> [v3.5+] Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-20Merge tag 'asoc-3.6' of ↵Takashi Iwai
git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus ASoC: Additional updates for 3.6 A batch more bugfixes, all driver-specific and fairly small and unremarkable in a global context. The biggest batch are for the newly added Arizona drivers.
2012-08-20ALSA: hda - Add missing ifdef CONFIG_SND_HDA_POWER_SAVE to tracepointsTakashi Iwai
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-20ALSA: lto, sound: Fix export symbols for !CONFIG_MODULESAndi Kleen
The new LTO EXPORT_SYMBOL references symbols even without CONFIG_MODULES. Since these functions are macros in this case this doesn't work. Add a ifdef to fix the build. Signed-off-by: Andi Kleen <ak@linux.intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-20ALSA: hda - Check the power state when power_save option is changedTakashi Iwai
... by calling the newly introduced snd_hda_power_sync(). I had to reimplement a wheel for adding the trigger at changing the parameter -- the parameter set ops is overwritten to pass the integer parameter, then trigger the power-state sync. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-20ALSA: hda - Implement snd_hda_power_sync() helper functionTakashi Iwai
Added a new helper function snd_hda_power_sync() to trigger the power-saving manually. It's an inline function call to snd_hda_power_save() helper function. Together with this addition, snd_hda_power_up*() and snd_hda_power_down() functions are inlined to a call of the same snd_hda_power_save() helper function. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-20Merge branch 'topic/ca0132-fix' into for-linusTakashi Iwai
This is a series of fixes for CA0132, especially the missing SPDIF I/O and the mixer build errors.
2012-08-20ALSA: hda - don't create dysfunctional mixer controls for ca0132David Henningsson
It's possible that these amps are settable somehow, e g through secret codec verbs, but for now, don't create the controls (as they won't be working anyway, and cause errors in amixer). Cc: stable@kernel.org BugLink: https://bugs.launchpad.net/bugs/1038651 Signed-off-by: David Henningsson <david.henningsson@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-20ALSA: hda - Add tracepoints at snd_hda_power_up/down entrances.Takashi Iwai
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-20ALSA: snd-ad1816a: Implement suspend/resumeOndrej Zary
Implement suspend/resume support for AD1816 chips. Tested with Terratec SoundSystem Base-1. Signed-off-by: Ondrej Zary <linux@rainbow-software.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-20ALSA: snd-ad1816a: remove useless struct snd_card_ad1816aOndrej Zary
struct snd_card_ad1816a is only set but the values are never used then. Removing it allows struct snd_card's private_data to be used for struct snd_ad1816a, simplifying the code. Signed-off-by: Ondrej Zary <linux@rainbow-software.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-20ALSA: sound/ppc/snd_ps3.c: fix error return codeJulia Lawall
Initialize ret before returning on failure, as done elsewhere in the function. A simplified version of the semantic match that finds this problem is as follows: (http://coccinelle.lip6.fr/) // <smpl> ( if@p1 (\(ret < 0\|ret != 0\)) { ... return ret; } | ret@p1 = 0 ) ... when != ret = e1 when != &ret *if(...) { ... when != ret = e2 when forall return ret; } // </smpl> Signed-off-by: Julia Lawall <Julia.Lawall@lip6.fr> Signed-off-by: Takashi Iwai <tiwai@suse.de>