Nicolin Chen [Thu, 7 Nov 2013 06:45:16 +0000 (14:45 +0800)]
ASoC: generic-dmaengine-pcm: Use SNDRV_DMA_TYPE_DEV_IRAM as default
When allocating memory space for DMA buffer, use on-chip internal SRAM
as default choice to save power. Since the core would allocate memory
from traditional external memory if iram allocation failed, we don't
need to worry about any side effect.
Signed-off-by: Nicolin Chen <b42378@freescale.com> Acked-by: Lars-Peter Clausen <lars@metafoo.de> Acked-by: Mark Brown <broonie@linaro.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Takashi Iwai [Thu, 7 Nov 2013 12:38:23 +0000 (13:38 +0100)]
ALSA: hda - Delay HDMI presence reports while waiting for ELD information
There is a small gap between the jack detection unsolicited event and
the time the ELD is updated. When user-space queries the HDMI ELD
immediately after receiving the notification, it might fail because of
this gap.
For avoiding such a problem, this patch tries to delay the HDMI jack
detect notification until ELD information is fully updated. The
workaround is imperfect, but good enough as a starting point.
Chen Gang [Thu, 7 Nov 2013 03:14:29 +0000 (11:14 +0800)]
ALSA: include/uapi/sound/firewire.h: use "_UAPI" instead of "UAPI"
When installing, "scripts/headers_install.sh" will strip guard macro'
"_UAPI" to prevent from appearing it to users. And also, all another
files which need uapi prefix always use "_UAPI", not "UAPI".
So use "_UAPI" instead of "UAPI" on the guard macro, and also give a
comment for "#endif".
Signed-off-by: Chen Gang <gang.chen@asianux.com> Acked-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Vinod Koul [Thu, 7 Nov 2013 09:08:22 +0000 (10:08 +0100)]
ALSA: compress: fix drain calls blocking other compress functions (v6)
The drain and drain_notify callback were blocked by low level driver
until the draining was complete. Due to this being invoked with big
fat mutex held, others ops like reading timestamp, calling pause, drop
were blocked.
So to fix this we add a new snd_compr_drain_notify() API. This would
be required to be invoked by low level driver when drain or partial
drain has been completed by the DSP. Thus we make the drain and
partial_drain callback as non blocking and driver returns immediately
after notifying DSP. The waiting is done while releasing the lock so
that other ops can go ahead.
[ The commit 917f4b5cba78 was wrongly applied from the preliminary
patch. This commit corrects to the final version.
Sorry for inconvenience! -- tiwai ]
Takashi Iwai [Wed, 6 Nov 2013 16:54:55 +0000 (17:54 +0100)]
ALSA: lx6464es: Fix pointer cast compile warnings
The warnings are really harmless but annoying. Since they are only
about debug prints, and it's at most 32bit DMA, let's just cast to
unsigned long.
sound/pci/lx6464es/lx6464es.c:457:22: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
sound/pci/lx6464es/lx_core.c:1195:21: warning: cast to pointer from integer of different size [-Wint-to-pointer-cast]
Takashi Iwai [Wed, 6 Nov 2013 16:54:02 +0000 (17:54 +0100)]
ALSA: cmi8328: Fix compile warnings without CONFIG_PM
Just add an ifdef CONFIG_PM to shut up the warnings:
sound/isa/cmi8328.c:129:13: warning: ‘snd_cmi8328_cfg_save’ defined but not used [-Wunused-function]
sound/isa/cmi8328.c:136:13: warning: ‘snd_cmi8328_cfg_restore’ defined but not used [-Wunused-function]
ALSA: hda - Make sure mute LEDs stay on during runtime suspend (Realtek)
Some HP machines with Realtek codecs have mute LEDs connected to VREF pins.
However when these go into runtime suspend, the pin powers down and its
pin control is disabled, thus disabling the LED too.
This patch fixes that issue by making sure that the pin stays in D0 with
correct pin control.
Cc: stable@kernel.org BugLink: https://bugs.launchpad.net/bugs/1248465 Tested-by: Franz Hsieh <franz.hsieh@canonical.com> Signed-off-by: David Henningsson <david.henningsson@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Takashi Iwai [Tue, 5 Nov 2013 14:33:40 +0000 (15:33 +0100)]
ALSA: pxa2xx: Replace BUG() with snd_BUG()
BUG() used in the driver is just to spit the stack trace on buggy
points, not really needed to stop the whole operation. For that
purpose, it'd be more convenient to use snd_BUG() instead.
Takashi Iwai [Tue, 5 Nov 2013 16:34:46 +0000 (17:34 +0100)]
ALSA: hda - Force buffer alignment for Haswell HDMI controllers
Haswell HDMI audio controllers seem to get stuck when unaligned buffer
size is used. Let's enable the buffer alignment for the corresponding
entries.
Since AZX_DCAPS_INTEL_PCH contains AZX_DCAPS_BUFSIZE that disables the
buffer alignment forcibly, define AZX_DCAPS_INTEL_HASWELL and put the
necessary AZX_DCAPS bits there.
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=60769 Reported-by: Alexander E. Patrakov <patrakov@gmail.com> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Clemens Ladisch [Tue, 5 Nov 2013 08:27:10 +0000 (09:27 +0100)]
ALSA: hda: add device IDs for AMD Evergreen/Northern Islands HDMI
The device IDs of the AMD Cypress/Juniper/Redwood/Cedar/Cayman/Antilles/
Barts/Turks/Caicos HDMI HDA controllers weren't added explicitly
because the generic entry works, but it made the device appearing as
"Generic", and people are confused as if it's no proper HDMI
controller. Add them so that the name shows up properly as "ATI HDMI"
instead of "Generic".
According to Takashi's tests and the lack of complaints, these devices
work fine without disabling snooping.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Takashi Iwai [Mon, 4 Nov 2013 15:32:01 +0000 (16:32 +0100)]
ALSA: hda - Introduce the bitmask for excluding output volume
Add a bitmask to hda_gen_spec indicating NIDs to exclude from the
possible volume controls. That is, when the bit is set, the NID
corresponding to the bit won't be picked as an output volume control
any longer.
Basically this is just a band-aid for working around the issue found
with CS4208 codec, where only the headphone pin has a volume AMP with
different dB steps.
Takashi Iwai [Mon, 4 Nov 2013 14:44:09 +0000 (15:44 +0100)]
ALSA: hda - Fix possible zero-division
Check the TLV db scale result before actually dividing in vmaster
slave init code. Also mask TLV_DB_SCALE_MUTE bit so that the right
value is obtained even if this bit is set by the codec driver.
ALSA: usb - Don't trust the channel config if the channel count changed
In case the channel count of the input terminal is not the same as
the channel count of the streaming descriptor, the channel config of
the input terminal can not be trusted. Instead fall back to a default
(guessed) channel map.
This was found on a Logitech USB Headset.
Signed-off-by: David Henningsson <david.henningsson@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
ALSA: usb - For class 2 devices, use channel map from altsettings
The channel config from the streaming descriptor is probably a
better indicator of the channel map than the input terminal.
Use the input terminal's channel map as fallback only.
Signed-off-by: David Henningsson <david.henningsson@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
ALSA: usb: supply channel maps even when wChannelConfig is unspecified
If wChannelconfig is given for some formats but not others, userspace
might not be able to set the channel map.
This is RFC because I'm not sure what the best behaviour is - to guess
the channel map from the given number of channels (it's quite likely
that one channel is MONO and two channels is FL FR), or just to supply
UNKNOWN for all channels.
But the complete lack of channel map for a format leads userspace to
believe that the format is not available at all. Or am I
misunderstanding how this should be used?
Signed-off-by: David Henningsson <david.henningsson@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Mengdong Lin [Mon, 4 Nov 2013 06:13:13 +0000 (01:13 -0500)]
ALSA: hda - rename function not_share_unassigned_cvt()
The function name not_share_unassigned_cvt() is opposite to what it does.
This patch renames it to intel_not_share_assigned_cvt(), and addes comments
to explain why some Intel display codecs need this workaround.
Signed-off-by: Mengdong Lin <mengdong.lin@intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
NVIDIA HDMI codecs do not seem to follow the Audio Sample Packet (ASP)
channel mapping (as set by verb F32h per HDA specification 7.3.3.41)
when playing back 2-channel audio (CEA CA 0x00).
Basically this means that specifying swapped channels for stereo audio
(FR,FL) does not take effect, and e.g. this command plays back on the
wrong channel:
speaker-test -c2 -Dhdmi:CARD=NVidia,DEV=0 -m FR,FL -s1
Multichannel audio is not affected.
This issue has been confirmed to exist on codec 0x10de0015 by me and on
0x10de0040 by Juho Teperi.
Disable 2ch FL/FR channel swapping on all NVIDIA HDMI codecs that use
the standard HDA channel mapping system. Since this is a very minor
functionality loss, we err on the side of disabling it for newer codecs
as well until any future testing confirms that this issue has been
fixed.
Mengdong Lin [Thu, 31 Oct 2013 22:31:51 +0000 (18:31 -0400)]
ALSA: hda - not choose assigned converters for unused pins of Valleyview
For Valleyview display codec, if an unused pin chooses an assgined converter
selected by a used pin, playback on the unused pin can also give sound to the
output device of the used pin. It's because data flows from the same convertor
to the display port of the used pin. This issue is same as Haswell.
So this patch avoids using assinged convertors for unused pins.
The related function haswell_config_cvts() is renamed for code reuse.
Signed-off-by: Mengdong Lin <mengdong.lin@intel.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Phil Edworthy [Fri, 1 Nov 2013 06:06:17 +0000 (23:06 -0700)]
ASoC: ak4642: prevent un-necessary changes to SG_SL1
If you record the sound during playback,
the playback sound becomes silent.
Modify so that the codec driver does not clear
SG_SL1::DACL bit which is controlled under widget
Signed-off-by: Phil Edworthy <phil.edworthy@renesas.com> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com> Signed-off-by: Mark Brown <broonie@linaro.org> Cc: stable@vger.kernel.org
This is provoked when the ASoC front end is open along with its backend,
(which causes the backend to have a runtime assigned to it) and then the
SNDRV_CTL_IOCTL_PCM_INFO is requested for the (visible) backend device.
Resolve this by ensuring that ASoC internal backend devices are not
visible to userspace, just as the commentry for snd_pcm_new_internal()
says it should be.
Signed-off-by: Russell King <rmk+kernel@arm.linux.org.uk> Acked-by: Mark Brown <broonie@linaro.org> Cc: <stable@vger.kernel.org> [v3.4+] Signed-off-by: Takashi Iwai <tiwai@suse.de>
Takashi Iwai [Wed, 30 Oct 2013 16:41:12 +0000 (17:41 +0100)]
ALSA: hda - Add extra chmap for 2.1 outputs on ASUS laptops
ASUS N56VZ and N76VZ laptops have a bass speaker but its output comes
only from the right channel. This patch adds the extra chmap specific
to these models.
Takashi Iwai [Wed, 30 Oct 2013 06:50:53 +0000 (07:50 +0100)]
ALSA: hda - Disable AA-loopback on ALC283 Chromebook
ALC283-based Chromebook suffers from occasional white noise, and it
turned out that this comes from AA-loopback. Disable this output path
by just clearing mixer_nid, then the generic parser will skip the
creation of AA-loopback path.
Reported-and-tested-by: Kailang Yang <kailang@realtek.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Takashi Iwai [Tue, 29 Oct 2013 15:37:11 +0000 (16:37 +0100)]
ALSA: ak4114: Fix wrong register array size
The size of the register cache array is actually 6 instead of 7,
as it caches up to AK4114_REG_INT1_MASK. This resulted in unexpected
access out of array range, although most of them aren't so serious
(just reading one more byte on the stack at snd_ak4114_create()).
Also, the check of cache size was wrongly done by checking with
sizeof() instead of ARRAY_SIZE(). Fixed this together.
(And yes, hardcoded numbers are bad, but I keep the coding style as is
for making it clear what this patch actually does.)
Spotted by coverity among several CIDs, e.g. 711621.
Takashi Iwai [Tue, 29 Oct 2013 14:20:06 +0000 (15:20 +0100)]
ALSA: Limit the fallback card id string size
When no proper id string is given, the driver tries to fall back to
copy the proc_root name string via strcpy(), but this might overflow
the fixed string size. Let's use strlcpy().
Takashi Iwai [Tue, 29 Oct 2013 14:15:20 +0000 (15:15 +0100)]
ALSA: pcsp: Fix initialization with nopcm=1
When nopcm=1 is set, some initializations based on hrtimer resolution
might be bogus because the driver checks the resolution only when
nopcm=0. Simply get the resolution always at first for fixing the
bug.
Takashi Iwai [Tue, 29 Oct 2013 10:59:31 +0000 (11:59 +0100)]
ALSA: memalloc: NULL-initialize in snd_malloc_dev_iram()
dmab->area and addr fields should be cleared at the head of
snd_malloc_dev_iram() as especially dmab->area is used to indicate the
allocation failure / fallback.