ALSA: oxfw: add Mackie Onyx Satellite quirk to inform wrong value in 'dbs' field in tx CIP header
Mackie Onyx Satellite has two usage; standalone and with base station.
These two modes has different stream formats. In standalone mode, rx data
block includes 2 Multi Bit Linear Audio (MBLA) data channels and tx data
block includes 2. With base station, they're 6 and 2.
Although, with base station, the actual tx packet include wrong value in
'dbs' field in its CIP header. This quirk causes packet streaming layer to
detect packet discontinuity and to stop PCM substream.
This is a response of 'single' subfunction 'extended stream format
information' command in AV/C Stream Format Information Specification 1.1.
It means that a data block in tx packets includes 2 MBLA data channels.
On the other hand, in actual tx CIP, the 'dbs' field has 6. But the number
of quadlets in CIP payload is not multiple of 6. Seeing the subtraction of
two successive payload quadlets, it should be multiple of 2.
This commit adds support for this quirk to OXFW driver, by using
CIP_WRONG_DBS flag. When this flag is set, packet streaming layer uses
the value of its 'data_block_quadlets' member instead of the value in CIP
header. This value is already set by OXFW driver and no discontinuity is
detected.
ALSA: pcm: remove structure member of 'struct snd_pcm_hwptr_log *' type because this structure had been removed
This structure was added by 4d96eb255c53 ('ALSA: pcm_lib - add possibility
to log last 10 DMA ring buffer positions') to store PCM pointers
information of latest 10 pointer movements (=XRUN_LOG_CNT). When
CONFIG_SND_PCM_XRUN_DEBUG is configured, 'struct snd_pcm_runtime' has
'hwptr_log' member with a pointer to the structure. When calling
xrun_log() in pcm_lib.c, the structure was allocated to the pointer.
When calling snd_pcm_detach_substream() in pcm.c, the allocated pointer
is released.
In f5914908a5b7 ('ALSA: pcm: Replace PCM hwptr tracking with tracepoints'),
the pointer logging is replaced with using Linux Kernel Tracepoints. The
structure was also removed, while it's just declared. The member and kfree
still remains.
This commit removes the member and related codes. I think this was
overlooked because it brings no errors/warnings to C compilers.
Johan Rastén [Sun, 6 Sep 2015 16:16:13 +0000 (18:16 +0200)]
ALSA: usb-audio: Change internal PCM order
New PCMs will now be added to the end of the chip's PCM list instead of to the
front. This changes the way streams are combined so that the first capture
stream will now be merged with the first playback stream instead of the last.
This fixes a problem with ASUS U7. Cards with one playback stream and cards
without capture streams should be unaffected by this change.
Exception added for M-Audio Audiophile USB (tm) since it seems to have a fix to
swap capture stream numbering in alsa-lib conf/cards/USB-audio.conf
Signed-off-by: Johan Rastén <johan@oljud.se> Signed-off-by: Takashi Iwai <tiwai@suse.de>
The M3800 is very minor workstation variant of the XPS 15 which has
already been patched for this issue. I figured it's probably more
important for this version of the laptop to be patched than the
regular XPS as Dell sells is pre-configured with Ubuntu to be used as
a Linux workstation. I have tested the patch on my the hardware on
Linux 4.2.0.
Takashi Iwai [Thu, 13 Aug 2015 16:02:39 +0000 (18:02 +0200)]
ALSA: hda - Enable headphone jack detect on old Fujitsu laptops
According to the bug report, FSC Amilo laptops with ALC880 can detect
the headphone jack but currently the driver disables it. It's partly
intentionally, as non-working jack detect was reported in the past.
Let's enable now.
ALSA: hda - Add some FIXUP quirks for white noise on Dell laptop.
Dell laptop has a series model to use the same codec but different subsystem ID.
At the same time they happens the white noise by login screen and headphone;
for fixing them together, I only can add these IDs to FIXUP function ALC292_FIXUP_DISABLE_AAMIX,
then try to solve such the similar issues.
drm/i915: Add locks around audio component bind/unbind
This will make sure that audio callbacks do not race with
component bind/unbind.
[Note: this is an update patch to commit [51e1d83cab99: drm/i915: Call
audio pin/ELD notify function] where I mistakenly applied the older
version. Jani and Daniel's review tags were to the latest version,
so I add them below, too -- tiwai]
Signed-off-by: David Henningsson <david.henningsson@canonical.com> Reviewed-by: Jani Nikula <jani.nikula@intel.com> Acked-by: Daniel Vetter <daniel@ffwll.ch> Signed-off-by: Takashi Iwai <tiwai@suse.de>
drm/i915: Drop port_mst_index parameter from pin/eld callback
The port_mst_index parameter was reserved for future use, but
maintainers prefer to add it later when it is actually used.
[Note: this is an update patch to commit [51e1d83cab99: drm/i915: Call
audio pin/ELD notify function] where I mistakenly applied the older
version. Jani and Daniel's review tags were to the latest version,
so I add them below, too -- tiwai]
Signed-off-by: David Henningsson <david.henningsson@canonical.com> Reviewed-by: Jani Nikula <jani.nikula@intel.com> Acked-by: Daniel Vetter <daniel@ffwll.ch> Signed-off-by: Takashi Iwai <tiwai@suse.de>
ALSA: hda - Wake the codec up on pin/ELD notify events
Whenever there is an event from the i915 driver, wake the codec
and recheck plug/unplug + ELD status.
This fixes the issue with lost unsol events in power save mode,
the codec and controller can now sleep in D3 and still know when
the HDMI monitor has been connected.
Signed-off-by: David Henningsson <david.henningsson@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
When the audio codec is enabled or disabled, notify the audio driver.
This will enable the audio driver to get the notification at all times
(even when audio is in different powersave states).
Signed-off-by: David Henningsson <david.henningsson@canonical.com> Reviewed-by: Jani Nikula <jani.nikula@intel.com> Acked-by: Daniel Vetter <daniel@ffwll.ch> Signed-off-by: Takashi Iwai <tiwai@suse.de>
This callback will be called by the i915 driver to notify the hda
driver that its HDMI information needs to be refreshed, i e,
that audio output is now available (or unavailable) - usually as a
result of a monitor being plugged in (or unplugged).
Signed-off-by: David Henningsson <david.henningsson@canonical.com> Reviewed-by: Jani Nikula <jani.nikula@intel.com> Acked-by: Daniel Vetter <daniel@ffwll.ch> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Takashi Iwai [Mon, 31 Aug 2015 14:25:22 +0000 (16:25 +0200)]
Merge tag 'asoc-v4.2-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
ASoC: Updates for v4.3
Not many updates to the core here, but an awful lot of driver updates
this time round:
- Factoring out of AC'97 reset code into the core
- New drivers for Cirrus CS4349, GTM601, InvenSense ICS43432, Realtek
RT298 and ST STI controllers.
- Machine drivers for Rockchip systems with MAX98090 and RT5645 and
RT5650.
- Initial driver support for Intel Skylake devices.
- A large number of cleanups for Lars-Peter Clausen and Axel Lin.
Axel Lin [Sat, 29 Aug 2015 15:09:30 +0000 (23:09 +0800)]
ASoC: zx296702-i2s: Fix resource leak when unload module
Use devm_* API to fix leaks in current code.
1. Use devm_kzalloc to fix memory leak for zx_i2s when unload the module.
2. Use devm_snd_soc_register_component to ensure component is unregistered
when unload the module.
Signed-off-by: Axel Lin <axel.lin@ingics.com> Reviewed-by: Jun Nie <jun.nie@linaro.org> Signed-off-by: Mark Brown <broonie@kernel.org>
Axel Lin [Sun, 30 Aug 2015 00:08:15 +0000 (08:08 +0800)]
ASoC: spear_pcm: Use devm_snd_dmaengine_pcm_register to fix resource leak
All the callers assume devm_spear_pcm_platform_register is a devm_ API, so
use devm_snd_dmaengine_pcm_register in devm_spear_pcm_platform_register.
Fixes: e1771bcf99b0 ("ASoC: SPEAr: remove custom DMA alloc compat function") Signed-off-by: Axel Lin <axel.lin@ingics.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Takashi Sakamoto [Sat, 29 Aug 2015 01:38:46 +0000 (10:38 +0900)]
ALSA: fireworks/bebob/dice/oxfw: fix substreams counting at vmalloc failure
In PCM core, when hw_params() in each driver returns error, the state of
PCM substream is kept as 'open'. In this case, current drivers for sound
units on IEEE 1394 bus doesn't decrement substream counter in hw_free()
correctly. This causes these drivers to keep streams even if not
required.
This commit fixes this bug. When snd_pcm_lib_alloc_vmalloc_buffer()
fails, hw_params function in each driver returns without incrementing the
counter.
Jonathan Corbet [Tue, 25 Aug 2015 07:14:48 +0000 (01:14 -0600)]
ASoC: Clean up docbook warnings
A number of functions and structures in the sound subsystem had incomplete
and/or obsolete DocBook comments, leading to warnings when the docs were
built. Correct those comments so that we can enjoy our audio in the
absence of warning noise.
Signed-off-by: Jonathan Corbet <corbet@lwn.net> Signed-off-by: Mark Brown <broonie@kernel.org>
Oder Chiou [Thu, 27 Aug 2015 07:14:51 +0000 (15:14 +0800)]
ASoC: rt5645: Prevent the pop sound of the headphone while rebooting or shutdowning
Add i2c shutdown function to prevent the pop sound of the headphone while
the system is rebooting or shutdowning. It de-initials the jack detection
function, and it cannot be turned off in _BIAS_OFF. If we don't de-initial
it, the pop sound will be heard in the situation of powering off. And
replace the related register settings from magic number to meaningful
defined name.
Signed-off-by: Oder Chiou <oder_chiou@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Ricard Wanderlof [Thu, 27 Aug 2015 09:35:20 +0000 (11:35 +0200)]
ASoC: ics43432: Add codec driver for InvenSense ICS-43432
Add support for the InvenSense ICS-43432 I2S MEMS microphone.
This is a non-software-configurable MEMS microphone with I2S output.
Tested on a setup with a single ICS-43432 (the device itself supports
stereo operation using a hardware pin controlling left vs. right channel
output).
Signed-off-by: Ricard Wanderlof <ricardw@axis.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Jyri Sarha [Wed, 26 Aug 2015 13:11:40 +0000 (16:11 +0300)]
ASoC: omap-hdmi-audio: Set buffer bytes step constraint to 128
Set buffer bytes step constraint to 128. A matching constraint has
already been set to period size. This helps PCM setup to tolerate ALSA
clients that set the PCM hw params in unusual order.
Signed-off-by: Jyri Sarha <jsarha@ti.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Takashi Iwai [Wed, 26 Aug 2015 08:23:26 +0000 (10:23 +0200)]
ALSA: usb-audio: Handle normal and auto-suspend equally
In theory, the device may get suspended even at runtime PM suspend.
Currently we don't save the mixer state for autopm, and it may bring
inconsistency.
This patch removes the special handling for autosuspend.
Takashi Iwai [Tue, 25 Aug 2015 14:09:00 +0000 (16:09 +0200)]
ALSA: usb-audio: Avoid nested autoresume calls
After the recent fix of runtime PM for USB-audio driver, we got a
lockdep warning like:
=============================================
[ INFO: possible recursive locking detected ]
4.2.0-rc8+ #61 Not tainted
---------------------------------------------
pulseaudio/980 is trying to acquire lock:
(&chip->shutdown_rwsem){.+.+.+}, at: [<ffffffffa0355dac>] snd_usb_autoresume+0x1d/0x52 [snd_usb_audio]
but task is already holding lock:
(&chip->shutdown_rwsem){.+.+.+}, at: [<ffffffffa0355dac>] snd_usb_autoresume+0x1d/0x52 [snd_usb_audio]
This comes from snd_usb_autoresume() invoking down_read() and it's
used in a nested way. Although it's basically safe, per se (as these
are read locks), it's better to reduce such spurious warnings.
The read lock is needed to guarantee the execution of "shutdown"
(cleanup at disconnection) task after all concurrent tasks are
finished. This can be implemented in another better way.
Also, the current check of chip->in_pm isn't good enough for
protecting the racy execution of multiple auto-resumes.
This patch rewrites the logic of snd_usb_autoresume() & co; namely,
- The recursive call of autopm is avoided by the new refcount,
chip->active. The chip->in_pm flag is removed accordingly.
- Instead of rwsem, another refcount, chip->usage_count, is introduced
for tracking the period to delay the shutdown procedure. At
the last clear of this refcount, wake_up() to the shutdown waiter is
called.
- The shutdown flag is replaced with shutdown atomic count; this is
for reducing the lock.
- Two new helpers are introduced to simplify the management of these
refcounts; snd_usb_lock_shutdown() increases the usage_count, checks
the shutdown state, and does autoresume. snd_usb_unlock_shutdown()
does the opposite. Most of mixer and other codes just need this,
and simply returns an error if it receives an error from lock.
Takashi Iwai [Wed, 26 Aug 2015 05:22:49 +0000 (07:22 +0200)]
ALSA: hda - Fix widget sysfs tree corruption after refresh
When snd_hdac_refresh_widget_sysfs() is called before the first
hda_widget_sysfs_init(), the next call overrides and eventually
fails. This results in unexpected Oops, something like:
BUG: unable to handle kernel NULL pointer dereference at 00000000000000c8
IP: [<ffffffff8180e2a3>] hdmi_chmap_ctl_info+0x23/0x40
The fix is to add a check of the existing sysfs tree. Also, for more
safety, this patch adds the checks of device_is_registered() in
snd-hdac_refresh_wdiget_sysfs(), too.
Fixes: fa4f18b4f402 ('ALSA: hda - Refresh widgets sysfs at probing Haswell+ HDMI codecs')
Bugizlla: https://bugzilla.kernel.org/show_bug.cgi?id=103431 Reported-by: Andreas Reis <andreas.reis@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Charles Keepax [Tue, 25 Aug 2015 11:43:48 +0000 (12:43 +0100)]
ASoC: arizona: Poll for FLL clock OK rather than use interrupts
The extcon driver takes the DAPM mutex from within the interrupt thread
in several places, which makes it possible to get into a situation where
the interrupt thread is blocked waiting on the DAPM mutex whilst a DAPM
sequence is running which is attempting to configure the FLL. In this
case the FLL completion can't be completed as as the IRQ handler is
ONE_SHOT, which cause the FLL lock to use the full time out (250mS) and
report that the process timed out.
It is not really practical to make the extcon driver not take the DAPM
mutex from within the interrupt thread, at least not without extensive
modification. So this patch fixes the issue by switching the wait for
the FLL lock to polling. A few fast polls are done first as the FLL
should lock quickly for a good quality reference clock, (indeed it hits
on the first poll on my system) and it will poll every 20mS after that
until it times out.
Signed-off-by: Charles Keepax <ckeepax@opensource.wolfsonmicro.com> Signed-off-by: Mark Brown <broonie@kernel.org> Cc: stable@vger.kernel.org
Ben Zhang [Sat, 22 Aug 2015 04:17:00 +0000 (21:17 -0700)]
ASoC: rt5677: Allow arbitrary block read/write via SPI
Added rt5677_spi_read() and refactored rt5677_spi_write() so that
an arbitrary block in the DSP address space can be read/written
via SPI. For example, this allows us to load an ELF DSP firmware
with sparse sections, and stream audio samples from DSP ring buffer.
Signed-off-by: Ben Zhang <benzh@chromium.org> Acked-by: Oder Chiou <oder_chiou@realtek.com> Signed-off-by: Mark Brown <broonie@kernel.org>
Takashi Iwai [Tue, 25 Aug 2015 12:04:44 +0000 (14:04 +0200)]
ALSA: ppc: Add missing inclusion of linux/module.h
Otherwise it triggers a compile warning like:
sound/ppc/keywest.c:104:1: warning: data definition has no type or storage class
sound/ppc/keywest.c:104:1: error: type defaults to 'int' in declaration of 'MODULE_DEVICE_TABLE' [-Werror=implicit-int]
Fixes: a2bc2af66a5b ('ALSA: ppc: keywest: Export I2C module alias information') Reported-by: kbuild test robot <fengguang.wu@intel.com> Reviewed-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
ALSA: ppc: keywest: Export I2C module alias information
The I2C core always reports the MODALIAS uevent as "i2c:<client name"
regardless if the driver was matched using the I2C id_table or the
of_match_table. So the driver needs to export the I2C table and this
be built into the module or udev won't have the necessary information
to auto load the correct module when the device is added.
Signed-off-by: Javier Martinez Canillas <javier@osg.samsung.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
Takashi Iwai [Tue, 25 Aug 2015 06:52:55 +0000 (08:52 +0200)]
ALSA: hda - Refresh sysfs at snd_hda_codec_update_widgets()
In the commit [fa4f18b4f402: ALSA: hda - Refresh widgets sysfs at
probing Haswell+ HDMI codecs], snd_hdac_refresh_widget_sysfs() is
explicitly called in the codec driver. But this results in refreshing
twice, as snd_hdac_refresh_widget_sysfs() itself calls
snd_hdac_refresh_widgets() function.
Instead, we can replace the call in snd_hda_codec_update_widgets()
with snd_hdac_refresh_widget_sysfs(). This also fixes the missing
sysfs update for ca0132, too.
Takashi Iwai [Mon, 24 Aug 2015 08:52:06 +0000 (10:52 +0200)]
ALSA: hda - Fix path power activation
The widget power-saving code tries to turn up/down the power of each
widget in the I/O paths that are modified at each jack plug/unplug.
The recent report revealed that the power activation leaves some
widgets unpowered after plugging. This is because
snd_hda_activate_path() turns on path->active flag at the end of the
function while the path power management is done before that. Then
it's regarded as if nothing is active, and the driver turns off the
power.
The fix is simply to set the flag at the beginning of the function,
before trying to power up.
Takashi Iwai [Mon, 24 Aug 2015 08:45:27 +0000 (10:45 +0200)]
ALSA: hda - Check all inputs for is_active_nid_for_any()
The is_active_nid_for_any() function in the generic parser is supposed
to check all connections from/to the given widget, but the current
code checks only the first input connection (index = 0).
This patch corrects the code to check all inputs by passing -1 to
index argument.
Markus Osterhoff [Mon, 24 Aug 2015 12:11:39 +0000 (14:11 +0200)]
ALSA: hda: fix possible NULL dereference
After a for-loop was replaced by list_for_each_entry, see
Commit bbbc7e8502c9 ("ALSA: hda - Allocate hda_pcm objects dynamically"),
Commit 751e2216899c ("ALSA: hda: fix possible null dereference"),
a possible NULL pointer dereference has been introduced; this patch adds
the NULL check on pcm->pcm, while leaving a potentially superfluous
check on pcm itself untouched.