Commit Graph

399978 Commits

Author SHA1 Message Date
Takashi Iwai
861e66d341 Merge branch 'dice-driver-playback-only' of git://git.alsa-project.org/alsa-kprivate into for-next 2013-10-22 10:02:57 +02:00
Takashi Iwai
b55447a730 ALSA: hda - Fix typos in patch_hdmi.c
... which was introduced by the previous commit a4e9a38b, causing
build errors without CONFIG_PROC_FS.

Reported-by: Fengguang Wu <fengguang.wu@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-10-21 16:31:45 +02:00
Mengdong Lin
cc1a95d9f6 ALSA: hda - add codec ID for Valleyview2 display codec
This patch adds codec ID (0x80862882) and module alias for
Valleyview2 display codec.

Signed-off-by: Mengdong Lin <mengdong.lin@intel.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-10-21 12:30:38 +02:00
Clemens Ladisch
b20be8de1b ALSA: dice: restrict the driver to playback-only devices
At the moment, this driver supports only playback, while FFADO supports
(only) full-duplex devices.  So, prevent conflicts by not claiming
devices that would be better handled by FFADO.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
2013-10-20 22:07:57 +02:00
Clemens Ladisch
a471fcde8c ALSA: dice: fix detection of Weiss devices
While most DICE devices keep TCAT's default category ID of 0x04, Weiss
devices identify themselves with 0x00.

Reported-by: Rolf Anderegg <rolf.anderegg@weiss.ch>
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
2013-10-20 22:07:57 +02:00
Clemens Ladisch
ed7e48264c ALSA: dice: dice_proc_read: remove wrong typecast
Remove a wrong typecast that resulted from a copy-and-paste error.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
2013-10-20 22:07:57 +02:00
Clemens Ladisch
61b8cf0222 ALSA: dice: document quadlet alignment
Doing accesses without quadlet alignment is a bad idea because the
firmware's byte-swapping would garble the data; clarify this in the
documentation.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
2013-10-20 22:07:57 +02:00
Clemens Ladisch
c614475b0e ALSA: dice: add a proc file to show device information
For easier debugging, add a proc file to show the device's capabilities
and current status.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
2013-10-20 22:07:57 +02:00
Clemens Ladisch
640d9b421d ALSA: dice: check clock change timeout
Output a warning if the wait for the clock change notification times
out.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
2013-10-20 22:07:57 +02:00
Clemens Ladisch
4edeb831f3 ALSA: dice: dynamic sample rate selection
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>
2013-10-20 22:07:57 +02:00
Clemens Ladisch
15a75c8bed ALSA: dice: get rate-dependent parameters
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>
2013-10-20 22:07:57 +02:00
Clemens Ladisch
5ea4018e43 ALSA: dice: allow notifications during initialization
Reorganize the initialization order so that the driver can receive
notifications earlier.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
2013-10-20 22:07:57 +02:00
Clemens Ladisch
a0301998ae ALSA: dice: get clock capabilities
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>
2013-10-20 22:07:57 +02:00
Clemens Ladisch
c5280e996f ALSA: dice: make amdtp_rates[] const
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
2013-10-20 22:07:57 +02:00
Stefan Richter
a8c558f6a3 ALSA: dice: fix locking
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>
2013-10-20 22:07:57 +02:00
Clemens Ladisch
8709f1e4d6 ALSA: dice: remove superfluous field
The pcm field was not actually used.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
2013-10-20 22:07:57 +02:00
Clemens Ladisch
435a9be8bd ALSA: dice: remove 10s period length limit
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>
2013-10-20 22:07:57 +02:00
Clemens Ladisch
eadce07faa ALSA: dice: avoid superflous write at bus reset
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>
2013-10-20 22:07:57 +02:00
Clemens Ladisch
1b70485f13 ALSA: firewire: extend snd_fw_transaction()
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>
2013-10-20 22:07:57 +02:00
Clemens Ladisch
a644a9473f ALSA: dice: optimize reading of consecutive registers
Instead of reading two consecutive register with two quadlet requests,
use one block read request.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
2013-10-20 22:07:57 +02:00
Clemens Ladisch
a7304e3bf0 ALSA: dice: support dual-wire stream format at 192 kHz
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>
2013-10-20 22:07:57 +02:00
Clemens Ladisch
cbab328ddc ALSA: dice: fix device detection for other vendors
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>
2013-10-20 22:07:57 +02:00
Clemens Ladisch
54e72f0ba3 ALSA: dice: reorganize interface definitions
Move the DICE interface symbols into a separate header file, and add
more documentation.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
2013-10-20 22:07:57 +02:00
Clemens Ladisch
20b65dd040 ALSA: firewire: introduce amdtp_out_stream_running()
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>
2013-10-20 22:07:57 +02:00
Clemens Ladisch
9dd81e3143 ALSA: dice: clear device lock when closing hwdep device
Ensure that misbehaving or aborted userspace programs do not
accidentally keep the lock.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
2013-10-20 22:07:57 +02:00
Clemens Ladisch
0c29c9180f ALSA: dice: implement hwdep device
Implement the hwdep locking and notification mechanisms.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
2013-10-20 22:07:57 +02:00
Clemens Ladisch
4ed31f20bb ALSA: dice: fix hang when unplugging a running device
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>
2013-10-20 22:07:57 +02:00
Clemens Ladisch
e84d15f619 ALSA: dice, firewire-lib: add blocking mode
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>
2013-10-20 22:07:57 +02:00
Clemens Ladisch
d13109673a ALSA: dice: reduce noisy logging
The notification bits are not of general interest; log them only when
debugging.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
2013-10-20 22:07:57 +02:00
Clemens Ladisch
341682cd4f ALSA: dice: allow all sample rates
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>
2013-10-20 22:07:57 +02:00
Clemens Ladisch
6abce9e63d ALSA: dice: optimize bus reset handling
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>
2013-10-20 22:07:57 +02:00
Geyslan G. Bem
f1b4863a87 ALSA: emu10k1: code refactoring
Partially restructures _snd_emu10k1_audigy_init_efx() and
_snd_emu10k1_init_efx() functions.

Be noted that the cast is demanded to use '__user'. So, in these cases,
avoid patches based on the coccinelle 'drop_kmalloc_cast' semantic patch.

Signed-off-by: Geyslan G. Bem <geyslan@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-10-18 08:58:24 +02:00
Clemens Ladisch
82fbb4f7b4 ALSA: add DICE driver
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>
2013-10-17 21:18:32 +02:00
Takashi Iwai
a4e9a38b40 ALSA: hda - Move mutex from hda_eld to per_pin in HDMI codec driver
Since the lock is used primarily in patch_hdmi.c, it's better to move
it in the local struct instead of exporting in hda_eld.  The only
functions requiring the lock in hda_eld.c are proc accessors.  So in
this patch, the proc entry and its creation/deletion/accessors are
moved into patch_hdmi.c, together with the mutex lock to pin_spec
struct.

The former proc info functions are exported so that they can be called
from patch_hdmi.c.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-10-17 19:23:45 +02:00
Takashi Iwai
cbbaa603a0 ALSA: hda - Fix possible races in HDMI driver
Some per_pin fields and ELD contents might be changed dynamically in
multiple ways where the concurrent accesses are still opened in the
current code.  This patch fixes such possible races by using eld->lock
in appropriate places.

Reported-by: Anssi Hannula <anssi.hannula@iki.fi>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-10-17 19:23:40 +02:00
Takashi Iwai
4758fed912 ALSA: hda - Treat zero connection as non-error
The zero-length connection list happens so often on Haswell HDMI, and
it results in warning messages like
    ALSA: hda_codec: invalid CONNECT_LIST verb 5[1]:0
at each time the codec resumes from the power-save, which is fairly
annoying.

Since this is no real error, make it shown only in the verbose debug
mode.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-10-17 19:21:52 +02:00
David Henningsson
08cf680cca ALSA: hda - add connection to thinkpad_acpi to control mute/micmute LEDs
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-10-17 14:39:03 +02:00
David Henningsson
360fec281e ALSA: hda - add HDA_FIXUP_ACT_FREE action
A fixup which should be called before codec being freed will come
to use in the next patch.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-10-17 14:38:54 +02:00
David Henningsson
420f9739a6 thinkpad-acpi: Add mute and mic-mute LED functionality
The LEDs are currently not visible to userspace, for security
reasons. They are exported through thinkpad_acpi.h for use by the
snd-hda-intel driver.

Thanks to Alex Hung <alex.hung@canonical.com> and Takashi Iwai
<tiwai@suse.de> for writing parts of this patch.

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Acked-by: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-10-17 14:38:44 +02:00
Joe Perches
1d198f26c9 sound: Remove unnecessary semicolons
These aren't necessary after switch and if blocks.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-10-14 11:00:05 +02:00
David Henningsson
cd4035e814 ALSA: hda - Enable surround speakers (when line out is also present)
In the case where we have both line out and more than stereo speakers,
the speaker DACs will end up in extra_out_nid.
In fact, AFAIU, speakers are the only ones that can end up in extra_out_nid,
and if we have several of those, they should be surround outputs
rather than copy front.

BugLink: https://bugs.launchpad.net/bugs/1236965
Signed-off-by: David Henningsson <david.henningsson@canonical.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-10-10 09:47:58 +02:00
Sachin Kamat
6b5a7c66ce ALSA: usb-audio: Use module_usb_driver
module_usb_driver makes code simpler by removing the boilerplate.

Signed-off-by: Sachin Kamat <sachin.kamat@linaro.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-10-09 14:00:34 +02:00
Takashi Iwai
d820306cbe Merge branch 'for-linus' into for-next
For updating the HDMI chmap fix.

Conflicts:
	sound/pci/hda/patch_hdmi.c
2013-10-08 09:30:04 +02:00
Anssi Hannula
39edac70e9 ALSA: hda - hdmi: Fix channel map switch not taking effect
Currently hdmi_setup_audio_infoframe() reprograms the HDA channel
mapping only when the infoframe is not up-to-date or the non-PCM flag
has changed.

However, when just the channel map has been changed, the infoframe may
still be up-to-date and non-PCM flag may not have changed, so the new
channel map is not actually programmed into the HDA codec.

Notably, this failing case is also always triggered when the device is
already in a prepared state and a new channel map is configured while
changing only the channel positions (for example, plain
"speaker-test -c2 -m FR,FL").

Fix that by always programming the channel map in
hdmi_setup_audio_infoframe(). Tested on Intel HDMI.

Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi>
Cc: <stable@vger.kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-10-08 09:27:26 +02:00
Thomas Pugliese
6d5eba5aac ALSA: usb-audio: support wireless devices in snd_usb_parse_datainterval
This patch adds support for dev speed USB_SPEED_WIRELESS in
snd_usb_parse_datainterval which allows the usb sound core to create
ISO urbs with the correct number and size of buffers.

Signed-off-by: Thomas Pugliese <thomas.pugliese@gmail.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-10-07 12:52:21 +02:00
Thomas Pugliese
df3774c5c5 ALSA: usb-audio: add support for wireless USB devices
This patch updates snd_usb_audio_create also support devices whose
speed == USB_SPEED_WIRELESS.

Signed-off-by: Thomas Pugliese <thomas.pugliese@gmail.com>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-10-07 12:51:54 +02:00
Anssi Hannula
980b24958f ALSA: hda - hdmi: Tweak debug messages to be more useful
Allow channel map debugging for both automatic and manual channel maps,
and print CA always when updating infoframe.

Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-10-07 12:49:25 +02:00
Anssi Hannula
bb731f2100 ALSA: hda - hdmi: Fix available channel maps missing from TLV
Currently the available channel maps TLV only contains channel maps that
are limited to the traditional 7.1 speakers.

Since the other HDMI channel mapping functions have been fixed to
properly handle all CEA-861-E specified speakers, allow them to be
listed.

Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-10-07 12:49:13 +02:00
Anssi Hannula
a5b7d510b2 ALSA: hda - hdmi: Fix channel maps with less common speakers
For some speakers and slots the CEA slot <-> speaker assignment depends
on the used CEA Channel Allocation value.

Therefore the from_cea_slot() and to_cea_slot() helpers currently only
work correctly for the regular 7.1 speakers.

Fix them to work with all speakers, taking the re-ordered CA index as
input and adapting use sites accordingly.

This change allows manual channel mapping to actually work for all CEA
allocated speakers. Additionally, this fixes incorrect channel map
reporting in automatic channel mapping mode when an affected speaker
position is used (e.g. 6.1 map which contains an RC speaker).

Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-10-07 12:48:15 +02:00
Anssi Hannula
11f7c52d90 ALSA: hda - hdmi: Fix unused slots being enabled in manual and non-PCM mappings
hdmi_manual_setup_channel_mapping() and hdmi_std_setup_channel_mapping
try to assign ALSA channels to HDMI channel slots and disable (i.e.
silence) other slots.

However, they try to disable a slot by using AC_VERB_SET_CHAN_SLOT with
parameter ((alsa_ch << 8) | 0xf), while the correct parameter is
((0xf << 8) | hdmi_slot), i.e. the slot should be unassigned, not the
ALSA channel.

Fix that by actually disabling the unused slots.

Note that this bug did not cause any (reported) issues because slots
incorrectly having audio are normally ignored by a receiver if the CEA
channel allocation used does not map that slot to any speaker.
Additionally, the converter channel count configuration limits the
number of actually active channels in any case.

Signed-off-by: Anssi Hannula <anssi.hannula@iki.fi>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2013-10-07 12:47:30 +02:00