Instead of relying of some control panel application to configure some
fixed sample rate, allow applications to set it automatically.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
In preparation for sample rate selection support, read the stream
parameters that might change when running at different sample rates.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
In preparation for sample rate selection support, ensure that the driver
knows about the device's clock capabilities.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Avoid a lock inversion between dice->mutex and pcm->open_mutex.
Signed-off-by: Stefan Richter <stefanr@s5r6.in-berlin.de>
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Since commit f2b3614cef (Don't check DMA time-out too shortly), we
need no longer to restrict the period length to less than 10 s.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
When a bus reset happens, the enable register is automatically cleared,
so we do not need to clear it manually when stopping the stream.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Add a flag to snd_fw_transaction() to allow it to abort when a bus reset
happens. This removes most of the duplicated error handling loops that
were required around calls to the low-level fw_run_transaction().
Also add a flag to suppress error messages; errors are expected when we
attempt to clean up after the device was unplugged.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Change the AMDTP streaming code to handle the non-standard stream format
that DICE devices use at sample rates greater than 96 kHz.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
DICE devices do not have a unique specifier ID in their unit directory
(it's always the same as the device vendor's ID), so rely on just the
version ID for driver loading, and use a heuristic in the probe callback
to detect actual DICE devices.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Introduce the helper function amdtp_out_stream_running(). This makes
many checks in amdtp.c clearer and frees the device drivers from having
to track this with a separate variable.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
When aborting a PCM stream, the xrun is signaled only if the stream is
running. When disconnecting a PCM stream, calling snd_card_disconnect()
too early would change the stream into a non-running state and thus
prevent the xrun from being noticed by user space.
To prevent this, move the snd_card_disconnect() call after the xrun.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Allow AMDTP output streams to use blocking mode.
Use it for DICE devices, because the old DICE-II chip will in some cases
not be able to lock to non-blocking streams (erratum E7).
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Instead of forcing a constant 44.1 kHz, read the current sample rate
from the device when opening the PCM device.
Actually changing the sample rate requires some separate controller
application.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
After a bus reset, do not stop the stream completely to avoid having to
reconfigure the device when restarting the stream.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
As a start point for further development, this is an incomplete driver
for DICE devices:
- only playback (so no clock source except the bus clock)
- only 44.1 kHz
- no MIDI
- recovery after bus reset is slow
- hwdep device is created, but not actually implemented
Contains compilation fixes by Stefan Richter.
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
The recent commit to delay the release of kobject triggered NULL
dereferences of opti9xx drivers. The cause is that all
snd-opti92x-ad1848, snd-opti92x-cs4231 and snd-opti93x drivers
register the PnP card driver with the very same name, and also
snd-opti92x-ad1848 and -cs4231 drivers register the ISA driver with
the same name, too. When these drivers are built in, quick
"register-release-and-re-register" actions occur, and this results in
Oops because of the same name is assigned to the kobject.
The fix is simply to assign individual names. As a bonus, by using
KBUILD_MODNAME, the patch reduces more lines than it adds.
The fix is based on the suggestion by Russell King.
Reported-and-tested-by: Fengguang Wu <fengguang.wu@intel.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Without the dynamic minor assignment, HDMI codec may have less PCM
instances than the number of pins, which eventually leads to Oops.
Reported-by: Stratos Karafotis <stratosk@semaphore.gr>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Yet another entry, just use the existing fixup for this machine, too.
Reported-by: "Nathanael D. Noblet" <nathanael@gnat.ca>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Gateway LT27 needs a fixup for the inverted digital mic.
Reported-by: "Nathanael D. Noblet" <nathanael@gnat.ca>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
A few driver specific fixes here plus one core fix for a memory
corruption issue in DAPM initialisation which could lead to crashes.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.14 (GNU/Linux)
iQIcBAABAgAGBQJSDLDiAAoJELSic+t+oim9K0UP/3JXJsprPlUQ7r4OxoX/eYcq
AMH3n84uTY1JqP2crTc8FwVtHyqxyj3nnhyPDZYtk9bfuAVpVohdSTuD8Ai+Cv8g
R46cGqvYXnURl0K8lKlq9zaDXNca0ijbmj0ljQg+gON/Cl8HLDPZ94GgwbzyrBU4
boGgam7WRJVhAl4Mt6S5wq6HoG6G+StJtjL7/P9LkQGx8USl8/TUZwJw43NnEmNP
qJRwjY5Zk0jJHRzKFzqTtEmNcy6/zugjK5K6sFLqEwUxmoW4CeSD6eQ21GduQ2Gt
w1dImWgBO3h0+BLGxy2ukTuTppyfUscliM6ohnZNdWoK5dlt55FXraS9ljQSgsEZ
xQoXe3yMx1oq/kJriuKmDLD5LtLnidsuhsSEeSjNoq4c6Jt9hEkncYWMEIm2LTpT
t+UxwqDtw4ZCVAHSX18hPsGq+QG2skxEca/JZ6T31CpmAf1lNA2ddH82XkQB9atK
REz8+Nt+agBDEuitSmdz5mRuoDmngUm8SSrv5HImtvdVWMr52BKUtzUkjPvoHy/4
1geIRond5ZLmOxZeo4LTEKC1FIQ9LVKmAoOyJehSAHWno8nQ6jG0gxX73eWCaAg1
ImxyM2NB4hEm/nQ6r9rddhsrU8YTOrXRcQDw0YhwWMRlIu4KBPSaDgTOZCavPkHO
iI+8rNQrgOQj/hwcW8IV
=WWSS
-----END PGP SIGNATURE-----
Merge tag 'asoc-v3.11-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
ASoC: Fixes for v3.11
A few driver specific fixes here plus one core fix for a memory
corruption issue in DAPM initialisation which could lead to crashes.
The Tegra30 I2S driver was writing the AHUB interface parameters to the
playback path register rather than the capture path register. This
caused the capture parameters not to be configured at all, so if
capturing using non-HW-default parameters (e.g. 16-bit stereo rather
than 8-bit mono) the audio would be corrupted.
With this fixed, audio capture from an analog microphone works correctly
on the Cardhu board.
Cc: stable@vger.kernel.org
Signed-off-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Add the volume control quirk for avoiding the kernel warning
for the Logitech HD Webcam C525
as in the similar commit 36691e1be6
for the Logitech HD Webcam C310.
Reported-by: Maksim Boyko <maksim.a.boyko@gmail.com>
Tested-by: Maksim Boyko <maksim.a.boyko@gmail.com>
Cc: <stable@vger.kernel.org> # 3.10.5+
Signed-off-by: Maksim Boyko <maksim.a.boyko@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
We've added a fake mute control (setting the amp volume to zero) for
CX5051 at commit [3868137e: ALSA: hda - Add a fake mute feature], but
this feature was overlooked in the generic parser implementation. Now
the driver lacks of mute controls on these codecs.
The fix is just to check both AC_AMPCAP_MUTE and AC_AMPCAP_MIN_MUTE
bits in each place checking the amp capabilities.
Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=59001
Cc: <stable@vger.kernel.org> [v3.9+]
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Commit aafe77cc45 (ALSA: usb-audio: add support for many Roland/Yamaha
devices) had several logic errors that prevented create_auto_midi_quirk
from enumerating any MIDI ports.
Reported-by: Keith A. Milner <maillist@superlative.org>
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Patch makes pcm buffers DMA-able by allocating each one separately.
Signed-off-by: Torsten Schenk <torsten.schenk@zoho.com>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Correct the pins for a line-in and a headphone on LG LW25 laptop with
ALC880 codec. Other pins seem fine.
Reported-and-tested-by: Joonas Saarinen <jonskunator@gmail.com>
Cc: <stable@vger.kernel.org> [v3.9+]
Signed-off-by: Takashi Iwai <tiwai@suse.de>
The driver used to assume that the streaming endpoint's wMaxPacketSize
value would be an indication of how much data the endpoint expects or
sends, and compute the number of packets per URB using this value.
However, the Focusrite Scarlett 2i4 declares a value of 1024 bytes,
while only about 88 or 44 bytes are be actually used. This discrepancy
would result in URBs with far too few packets, which would not work
correctly on the EHCI driver.
To get correct URBs, use wMaxPacketSize only as an upper limit on the
packet size.
Reported-by: James Stone <jamesmstone@gmail.com>
Tested-by: James Stone <jamesmstone@gmail.com>
Cc: <stable@vger.kernel.org> # 2.6.35+
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Patch fixes 6fire not to use stack as URB transfer_buffer. URB buffers need to
be DMA-able, which stack is not. Furthermore, transfer_buffer should not be
allocated as part of larger device structure because DMA coherency issues and
patch fixes this issue too.
Cc: stable@vger.kernel.org
Signed-off-by: Jussi Kivilinna <jussi.kivilinna@iki.fi>
Tested-by: Torsten Schenk <torsten.schenk@zoho.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
Beep Volume Min/Max was backwards.
Change to SOC_SONGLE_SX_TLV for correct volume representation
Signed-off-by: Brian Austin <brian.austin@cirrus.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Cc: stable@kernel.org
A fixup for Apple Mac Mini was lost during the adaption to the generic
parser because the fallback for the generic ID 8384:7680 was dropped,
and it resulted in the silence output (and maybe other problems).
Unfortunately, just adding the missing subsystem ID wasn't enough, in
this case. The subsystem ID of this machine is 0000:0100 (what Apple
thought...?), and since snd_hda_pick_fixup() doesn't take the vendor
id zero into account, the driver ignored this entry. Now it's fixed
to regard the vendor id zero as a valid value.
Reported-and-tested-by: Linus Torvalds <torvalds@linux-foundation.org>
Cc: <stable@vger.kernel.org> [v3.9+]
Signed-off-by: Takashi Iwai <tiwai@suse.de>
list_first_entry() will always return a valid pointer, even if the list is
empty. So the check whether path is NULL will always be false. So we end up
calling dapm_create_or_share_mixmux_kcontrol() with a path struct that points
right in the middle of the widget struct and by trying to modify the path the
widgets memory will become corrupted. Fix this by using list_emtpy() to check if
the widget doesn't have any paths.
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Tested-by: Stephen Warren <swarren@nvidia.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
Cc: stable@vger.kernel.org
The SGTL5000 Capture Attenuate Switch (or "ADC Volume Range Reduction"
as it is called in the manual) is single bit only.
Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de>
Reviewed-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
When a sound capture/playback is terminated while a playback/capture
is running, power_vag_event() will clear SGTL5000_CHIP_ANA_POWER in
the SND_SOC_DAPM_PRE_PMD event, thus muting the respective other
channel.
Don't clear SGTL5000_CHIP_ANA_POWER when both DAC and ADC are active
to prevent this.
Signed-off-by: Lothar Waßmann <LW@KARO-electronics.de>
Reviewed-by: Fabio Estevam <fabio.estevam@freescale.com>
Signed-off-by: Mark Brown <broonie@linaro.org>
A fix to make sure userspace knows when control writes have caused a
change in value, fixing some UIs, plus a few few driver fixes mainly
cleaning up issues from recent refactorings on less mainstream platforms.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.12 (GNU/Linux)
iQIcBAABAgAGBQJR+iU1AAoJELSic+t+oim9vJcP/Ro/AhPccuGwTa7tyMFSGAYO
3xQh4REis7TGgCWu018G+zA4bS5Inrqo7B0M61PFxCJoZ3R4QvIgKXHasQ9SNXmW
+nUYqs05rgzl4U2uyEUNLoVelFa1ZbQLKQxuOUQt0+u9rvtBZczNd85KeNtn3IVp
38LTc2scrxo2HmU7UE418euPuFYiz7PMWKSMGd/r5Ht2h6Tij8eQ/Vkm8IgKJ7n6
kfMZCdMgTx0k/JC3Akz2colIIc0I8ioV2FWkZ1XAMaktFR0u585EbqBC2QJhiXRF
RJREXCxp8SGI4H961m53GICk39xfWLC7d1/sprzWDWZ6XTM5T9rp8x3iJNw74AcG
2ERMrDjlJKNVpedhnY7KgtegC+qT/9XcLa1qKpAR9Ym61HUvRvUVD9OsEJ4l5ISn
m+EZFt1Z9BhXU/HlhLN9Nr6mw0A6OnpvyUwR8cR83gz9OHFCmg8MOxVP26sNQSuX
1Ll7XRikSxC5n4AxG3APE8MLB7bcvUoL7benD4zekXG+pJhoefg5hmL7qvMCv+fy
bkeFafc3QUSsaiuf2tQjfHF99wvJC/BWt4cx1hdRjLNMxqoJre5hpJE9/l4JLs7X
Z6j6RTOD7/cXPZNMh67zK2w/V2NzcvK9I4U20HA9+IjfiYYugCc2XzCLaYrp1bwo
6P8Y8EXhUC3thSti/WUZ
=WtLE
-----END PGP SIGNATURE-----
Merge tag 'asoc-v3.11-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/broonie/sound into for-linus
ASoC: Fixes for v3.11
A fix to make sure userspace knows when control writes have caused a
change in value, fixing some UIs, plus a few few driver fixes mainly
cleaning up issues from recent refactorings on less mainstream platforms.