Revision tags: v3.12-rc3 |
|
#
976b6c06 |
| 24-Sep-2013 |
Alan Stern <stern@rowland.harvard.edu> |
ALSA: improve buffer size computations for USB PCM audio
This patch changes the way URBs are allocated and their sizes are determined for PCM playback in the snd-usb-audio driver. Currently the dri
ALSA: improve buffer size computations for USB PCM audio
This patch changes the way URBs are allocated and their sizes are determined for PCM playback in the snd-usb-audio driver. Currently the driver allocates too few URBs for endpoints that don't use implicit sync, making underruns more likely to occur. This may be a holdover from before I/O delays could be measured accurately; in any case, it is no longer necessary.
The patch allocates as many URBs as possible, subject to four limitations:
The total number of URBs for the endpoint is not allowed to exceed MAX_URBS (which the patch increases from 8 to 12).
The total number of packets per URB is not allowed to exceed MAX_PACKS (or MAX_PACKS_HS for high-speed devices), which is decreased from 20 to 6.
The total duration of queued data is not allowed to exceed MAX_QUEUE, which is decreased from 24 ms to 18 ms.
The total number of ALSA frames in the output queue is not allowed to exceed the ALSA buffer size.
The last requirement is the hardest to implement. Currently the number of URBs needed to fill a buffer cannot be determined in advance, because a buffer contains a fixed number of frames whereas the number of frames in an URB varies to match shifts in the device's clock rate. To solve this problem, the patch changes the logic for deciding how many packets an URB should contain. Rather than using as many as possible without exceeding an ALSA period boundary, now the driver uses only as many packets as needed to transfer a predetermined number of frames. As a result, unless the device's clock has an exceedingly variable rate, the number of URBs making up each period (and hence each buffer) will remain constant.
The overall effect of the patch is that playback works better in low-latency settings. The user can still specify values for frames/period and periods/buffer that exceed the capabilities of the hardware, of course. But for values that are within those capabilities, the performance will be improved. For example, testing shows that a high-speed device can handle 32 frames/period and 3 periods/buffer at 48 KHz, whereas the current driver starts to get glitchy at 64 frames/period and 2 periods/buffer.
A side effect of these changes is that the "nrpacks" module parameter is no longer used. The patch removes it.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu> CC: Clemens Ladisch <clemens@ladisch.de> Tested-by: Daniel Mack <zonque@gmail.com> Tested-by: Eldad Zack <eldad@fogrefinery.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
show more ...
|
Revision tags: v3.12-rc2, v3.12-rc1, v3.11, v3.11-rc7, v3.11-rc6, v3.11-rc5, v3.11-rc4, v3.11-rc3, v3.11-rc2, v3.11-rc1, v3.10, v3.10-rc7, v3.10-rc6 |
|
#
342cda29 |
| 15-Jun-2013 |
Clemens Ladisch <clemens@ladisch.de> |
ALSA: usb-audio: work around Android accessory firmware bug
When the Android firmware enables the audio interfaces in accessory mode, it always declares in the control interface's baInterfaceNr arra
ALSA: usb-audio: work around Android accessory firmware bug
When the Android firmware enables the audio interfaces in accessory mode, it always declares in the control interface's baInterfaceNr array that interfaces 0 and 1 belong to the audio function. However, the accessory interface itself, if also enabled, already is at index 0 and shifts the actual audio interface numbers to 1 and 2, which prevents the PCM streaming interface from being seen by the host driver.
To get the PCM interface interface to work, detect when the descriptors point to the (for this driver useless) accessory interface, and redirect to the correct one.
Reported-by: Jeremy Rosen <jeremy.rosen@openwide.fr> Tested-by: Jeremy Rosen <jeremy.rosen@openwide.fr> Cc: <stable@vger.kernel.org> Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
show more ...
|
Revision tags: v3.10-rc5, v3.10-rc4, v3.10-rc3, v3.10-rc2, v3.10-rc1, v3.9 |
|
#
60af3d03 |
| 25-Apr-2013 |
Takashi Iwai <tiwai@suse.de> |
ALSA: usb-audio: Fix autopm error during probing
We've got strange errors in get_ctl_value() in mixer.c during probing, e.g. on Hercules RMX2 DJ Controller:
ALSA mixer.c:352 cannot get ctl value:
ALSA: usb-audio: Fix autopm error during probing
We've got strange errors in get_ctl_value() in mixer.c during probing, e.g. on Hercules RMX2 DJ Controller:
ALSA mixer.c:352 cannot get ctl value: req = 0x83, wValue = 0x201, wIndex = 0xa00, type = 4 ALSA mixer.c:352 cannot get ctl value: req = 0x83, wValue = 0x200, wIndex = 0xa00, type = 4 ....
It turned out that the culprit is autopm: snd_usb_autoresume() returns -ENODEV when called during card->probing = 1.
Since the call itself during card->probing = 1 is valid, let's fix the return value of snd_usb_autoresume() as success.
Reported-and-tested-by: Daniel Schürmann <daschuer@mixxx.org> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
show more ...
|
Revision tags: v3.9-rc8, v3.9-rc7, v3.9-rc6 |
|
#
ef02e29b |
| 03-Apr-2013 |
Eldad Zack <eldad@fogrefinery.com> |
ALSA: usb-audio: UAC2: auto clock selection module param
Add a module param to disable auto clock selection. This is provided for users that expect the audio stream to fail when the clock source is
ALSA: usb-audio: UAC2: auto clock selection module param
Add a module param to disable auto clock selection. This is provided for users that expect the audio stream to fail when the clock source is invalid (e.g., the word clock was unintentionally disconnected).
Signed-off-by: Eldad Zack <eldad@fogrefinery.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
show more ...
|
#
f9d35435 |
| 03-Apr-2013 |
Eldad Zack <eldad@fogrefinery.com> |
ALSA: usb-audio: neaten MODULE_DEVICE_TABLE placement
Minor style fix, following a general code style in the kernel.
Signed-off-by: Eldad Zack <eldad@fogrefinery.com> Signed-off-by: Takashi Iwai <t
ALSA: usb-audio: neaten MODULE_DEVICE_TABLE placement
Minor style fix, following a general code style in the kernel.
Signed-off-by: Eldad Zack <eldad@fogrefinery.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
show more ...
|
#
88766f04 |
| 03-Apr-2013 |
Eldad Zack <eldad@fogrefinery.com> |
ALSA: usb-audio: convert list_for_each to entry variant
Change occurances of list_for_each into list_for_each_entry where applicable.
Signed-off-by: Eldad Zack <eldad@fogrefinery.com> Signed-off-by
ALSA: usb-audio: convert list_for_each to entry variant
Change occurances of list_for_each into list_for_each_entry where applicable.
Signed-off-by: Eldad Zack <eldad@fogrefinery.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
show more ...
|
Revision tags: v3.9-rc5, v3.9-rc4, v3.9-rc3 |
|
#
281a6ac0 |
| 11-Mar-2013 |
Clemens Ladisch <clemens@ladisch.de> |
ALSA: usb-audio: add a workaround for the NuForce UDH-100
The NuForce UDH-100 numbers its interfaces incorrectly, which makes the interface associations come out wrong, which results in the driver e
ALSA: usb-audio: add a workaround for the NuForce UDH-100
The NuForce UDH-100 numbers its interfaces incorrectly, which makes the interface associations come out wrong, which results in the driver erroring out with the message "Audio class v2 interfaces need an interface association".
Work around this by searching for the interface association descriptor also in some other place where it might have ended up.
Reported-and-tested-by: Dave Helstroom <helstroom@google.com> Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
show more ...
|
Revision tags: v3.9-rc2, v3.9-rc1, v3.8, v3.8-rc7, v3.8-rc6 |
|
#
aa53f986 |
| 29-Jan-2013 |
Antonio Ospite <ao2@amarulasolutions.com> |
ALSA: usb: cosmetics, remove a leading space
Signed-off-by: Antonio Ospite <ao2@amarulasolutions.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
|
Revision tags: v3.8-rc5, v3.8-rc4, v3.8-rc3, v3.8-rc2, v3.8-rc1, v3.7, v3.7-rc8, v3.7-rc7 |
|
#
20d32022 |
| 20-Nov-2012 |
Takashi Iwai <tiwai@suse.de> |
ALSA: usb-audio: Deprecate async_unlink option
The async unlink behavior has been working over years. The option was provided only as a workaround for 2.4.x kernel. Let's get rid of it.
Signed-of
ALSA: usb-audio: Deprecate async_unlink option
The async unlink behavior has been working over years. The option was provided only as a workaround for 2.4.x kernel. Let's get rid of it.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
show more ...
|
Revision tags: v3.7-rc6 |
|
#
10e44239 |
| 13-Nov-2012 |
Takashi Iwai <tiwai@suse.de> |
ALSA: usb-audio: Fix mutex deadlock at disconnection
The recent change for USB-audio disconnection race fixes introduced a mutex deadlock again. There is a circular dependency between chip->shutdow
ALSA: usb-audio: Fix mutex deadlock at disconnection
The recent change for USB-audio disconnection race fixes introduced a mutex deadlock again. There is a circular dependency between chip->shutdown_rwsem and pcm->open_mutex, depicted like below, when a device is opened during the disconnection operation:
A. snd_usb_audio_disconnect() -> card.c::register_mutex -> chip->shutdown_rwsem (write) -> snd_card_disconnect() -> pcm.c::register_mutex -> pcm->open_mutex
B. snd_pcm_open() -> pcm->open_mutex -> snd_usb_pcm_open() -> chip->shutdown_rwsem (read)
Since the chip->shutdown_rwsem protection in the case A is required only for turning on the chip->shutdown flag and it doesn't have to be taken for the whole operation, we can reduce its window in snd_usb_audio_disconnect().
Reported-by: Jiri Slaby <jslaby@suse.cz> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
show more ...
|
Revision tags: v3.7-rc5, v3.7-rc4, v3.7-rc3, v3.7-rc2 |
|
#
34f3c89f |
| 15-Oct-2012 |
Takashi Iwai <tiwai@suse.de> |
ALSA: usb-audio: Use rwsem for disconnect protection
Replace mutex with rwsem for codec->shutdown protection so that concurrent accesses are allowed.
Also add the protection to snd_usb_autosuspend(
ALSA: usb-audio: Use rwsem for disconnect protection
Replace mutex with rwsem for codec->shutdown protection so that concurrent accesses are allowed.
Also add the protection to snd_usb_autosuspend() and snd_usb_autoresume(), too.
Reported-by: Matthieu CASTET <matthieu.castet@parrot.com> Cc: <stable@vger.kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
show more ...
|
Revision tags: v3.7-rc1, v3.6, v3.6-rc7 |
|
#
384dc085 |
| 18-Sep-2012 |
Takashi Iwai <tiwai@suse.de> |
ALSA: usb-audio: Avoid unnecessary EP setups in prepare
The recent fix for USB suspend breakage moved the code to set up EP from hw_params to prepare, but it means also the EP setup might be called
ALSA: usb-audio: Avoid unnecessary EP setups in prepare
The recent fix for USB suspend breakage moved the code to set up EP from hw_params to prepare, but it means also the EP setup might be called multiple times unnecessarily because the prepare callback can be called multiple times without starting the stream (e.g. OSS emulation).
This patch adds a new flag to struct snd_usb_substream indicating whether the setup of EP is required, and do it only when necessary, i.e. right after hw_params or suspend.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
show more ...
|
Revision tags: v3.6-rc6, v3.6-rc5, v3.6-rc4 |
|
#
03d2f44e |
| 30-Aug-2012 |
Pavel Roskin <proski@gnu.org> |
ALSA: snd-usb: use list_for_each_safe for endpoint resources
snd_usb_endpoint_free() frees the structure that contains its argument.
Signed-off-by: Pavel Roskin <proski@gnu.org> Cc: stable@vger.ker
ALSA: snd-usb: use list_for_each_safe for endpoint resources
snd_usb_endpoint_free() frees the structure that contains its argument.
Signed-off-by: Pavel Roskin <proski@gnu.org> Cc: stable@vger.kernel.org Signed-off-by: Takashi Iwai <tiwai@suse.de>
show more ...
|
Revision tags: v3.6-rc3, v3.6-rc2, v3.6-rc1, v3.5, v3.5-rc7, v3.5-rc6, v3.5-rc5, v3.5-rc4, v3.5-rc3, v3.5-rc2, v3.5-rc1, v3.4, v3.4-rc7, v3.4-rc6, v3.4-rc5, v3.4-rc4, v3.4-rc3 |
|
#
edcd3633 |
| 12-Apr-2012 |
Daniel Mack <zonque@gmail.com> |
ALSA: snd-usb: switch over to new endpoint streaming logic
With the previous commit that added the new streaming model, all endpoint and streaming related code is now in endpoint.c, and pcm.c only a
ALSA: snd-usb: switch over to new endpoint streaming logic
With the previous commit that added the new streaming model, all endpoint and streaming related code is now in endpoint.c, and pcm.c only acts as a wrapper for handling the packet's payload.
Signed-off-by: Daniel Mack <zonque@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
show more ...
|
#
596580d0 |
| 12-Apr-2012 |
Daniel Mack <zonque@gmail.com> |
ALSA: snd-usb: add snd_usb_audio-wide mutex
This is needed for new card-wide list operations.
Signed-off-by: Daniel Mack <zonque@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
|
Revision tags: v3.4-rc2, v3.4-rc1, v3.3, v3.3-rc7, v3.3-rc6, v3.3-rc5, v3.3-rc4, v3.3-rc3, v3.3-rc2, v3.3-rc1, v3.2, v3.2-rc7, v3.2-rc6 |
|
#
a67ff6a5 |
| 14-Dec-2011 |
Rusty Russell <rusty@rustcorp.com.au> |
ALSA: module_param: make bool parameters really bool
module_param(bool) used to counter-intuitively take an int. In fddd5201 (mid-2009) we allowed bool or int/unsigned int using a messy trick.
It'
ALSA: module_param: make bool parameters really bool
module_param(bool) used to counter-intuitively take an int. In fddd5201 (mid-2009) we allowed bool or int/unsigned int using a messy trick.
It's time to remove the int/unsigned int option. For this version it'll simply give a warning, but it'll break next kernel version.
Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Takashi Iwai <tiwai@suse.de>
show more ...
|
Revision tags: v3.2-rc5, v3.2-rc4, v3.2-rc3, v3.2-rc2, v3.2-rc1, v3.1, v3.1-rc10, v3.1-rc9, v3.1-rc8, v3.1-rc7, v3.1-rc6, v3.1-rc5, v3.1-rc4, v3.1-rc3, v3.1-rc2, v3.1-rc1, v3.0 |
|
#
da155d5b |
| 15-Jul-2011 |
Paul Gortmaker <paul.gortmaker@windriver.com> |
sound: Add module.h to the previously silent sound users
Lots of sound drivers were getting module.h via the implicit presence of it in <linux/device.h> but we are going to clean that up. So fix up
sound: Add module.h to the previously silent sound users
Lots of sound drivers were getting module.h via the implicit presence of it in <linux/device.h> but we are going to clean that up. So fix up those users now.
Signed-off-by: Paul Gortmaker <paul.gortmaker@windriver.com>
show more ...
|
#
61a6a108 |
| 26-Sep-2011 |
Thomas Pfaff <tpfaff@gmx.net> |
ALSA: usb-audio: Check for possible chip NULL pointer before clearing probing flag
Before clearing the probing flag in the error exit path, check that the chip pointer is not NULL.
Signed-off-by: T
ALSA: usb-audio: Check for possible chip NULL pointer before clearing probing flag
Before clearing the probing flag in the error exit path, check that the chip pointer is not NULL.
Signed-off-by: Thomas Pfaff <tpfaff@gmx.net> Cc: <stable@kernel.org> [2.6.39+] Signed-off-by: Takashi Iwai <tiwai@suse.de>
show more ...
|
#
362e4e49 |
| 22-Sep-2011 |
Thomas Pfaff <tpfaff@gmx.net> |
ALSA: usb-audio - clear chip->probing on error exit
The Terratec Aureon 5.1 USB sound card support is broken since kernel 2.6.39. 2.6.39 introduced power management support for USB sound cards that
ALSA: usb-audio - clear chip->probing on error exit
The Terratec Aureon 5.1 USB sound card support is broken since kernel 2.6.39. 2.6.39 introduced power management support for USB sound cards that added a probing flag in struct snd_usb_audio.
During the probe of the card it gives following error message :
usb 7-2: new full speed USB device number 2 using uhci_hcd cannot find UAC_HEADER snd-usb-audio: probe of 7-2:1.3 failed with error -5 input: USB Audio as /devices/pci0000:00/0000:00:1d.1/usb7/7-2/7-2:1.3/input/input6 generic-usb 0003:0CCD:0028.0001: input: USB HID v1.00 Device [USB Audio] on usb-0000:00:1d.1-2/input3
I can not comment about that "cannot find UAC_HEADER" error, but until 2.6.38 the card worked anyway. With 2.6.39 chip->probing remains 1 on error exit, and any later ioctl stops in snd_usb_autoresume with -ENODEV.
Signed-off-by: Thomas Pfaff <tpfaff@gmx.net> Cc: <stable@kernel.org> [2.6.39+] Signed-off-by: Takashi Iwai <tiwai@suse.de>
show more ...
|
#
c731bc96 |
| 14-Sep-2011 |
Daniel Mack <zonque@gmail.com> |
ALSA: snd-usb: move code from urb.c to endpoint.c
No code altered at this point, simply preparing for upcoming refactorizations.
Signed-off-by: Daniel Mack <zonque@gmail.com> Acked-by: Clemens Ladi
ALSA: snd-usb: move code from urb.c to endpoint.c
No code altered at this point, simply preparing for upcoming refactorizations.
Signed-off-by: Daniel Mack <zonque@gmail.com> Acked-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
show more ...
|
#
e8e8babf |
| 12-Sep-2011 |
Daniel Mack <zonque@gmail.com> |
ALSA: snd-usb: re-order code
Move code from endpoint.c into a new file called stream.c and rename functions so that their names actually reflect what they're doing.
This way, endpoint.c will be ava
ALSA: snd-usb: re-order code
Move code from endpoint.c into a new file called stream.c and rename functions so that their names actually reflect what they're doing.
This way, endpoint.c will be available to functions that hold all the endpoint logic.
Signed-off-by: Daniel Mack <zonque@gmail.com> Acked-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
show more ...
|
#
5b1b0b81 |
| 19-Aug-2011 |
Alan Stern <stern@rowland.harvard.edu> |
PM / Runtime: Add macro to test for runtime PM events
This patch (as1482) adds a macro for testing whether or not a pm_message value represents an autosuspend or autoresume (i.e., a runtime PM) even
PM / Runtime: Add macro to test for runtime PM events
This patch (as1482) adds a macro for testing whether or not a pm_message value represents an autosuspend or autoresume (i.e., a runtime PM) event. Encapsulating this notion seems preferable to open-coding the test all over the place.
Signed-off-by: Alan Stern <stern@rowland.harvard.edu> Acked-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Rafael J. Wysocki <rjw@sisk.pl>
show more ...
|
Revision tags: v3.0-rc7 |
|
#
81b85b6b |
| 06-Jul-2011 |
Pavel Roskin <proski@gnu.org> |
ALSA: usb-audio: replace "void *" with more specific pointers
Signed-off-by: Pavel Roskin <proski@gnu.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
|
Revision tags: v3.0-rc6, v3.0-rc5, v3.0-rc4, v3.0-rc3, v3.0-rc2, v3.0-rc1 |
|
#
9e38658f |
| 25-May-2011 |
Daniel Mack <zonque@gmail.com> |
ALSA: usb-audio: export snd_usb_feature_unit_ctl
In order to allow quirks functions to hook up to the standard feature unit op tables, this patch exports a pointer to the struct that is used interna
ALSA: usb-audio: export snd_usb_feature_unit_ctl
In order to allow quirks functions to hook up to the standard feature unit op tables, this patch exports a pointer to the struct that is used internally.
That way, all the code handling the control can be kept private, and external code can reference the symbol to re-use it.
Signed-off-by: Daniel Mack <zonque@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
show more ...
|
#
5875c2cb |
| 25-May-2011 |
Daniel Mack <zonque@gmail.com> |
ALSA: usb-audio: move assignment of chip->ctrl_intf
This is needed for upcoming changes to the quirks mechanism.
Signed-off-by: Daniel Mack <zonque@gmail.com> Signed-off-by: Takashi Iwai <tiwai@sus
ALSA: usb-audio: move assignment of chip->ctrl_intf
This is needed for upcoming changes to the quirks mechanism.
Signed-off-by: Daniel Mack <zonque@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
show more ...
|