aboutsummaryrefslogtreecommitdiffstats
path: root/sound/usb/usbaudio.c
Commit message (Collapse)AuthorAge
* Merge branch 'topic/usb-audio' into for-linusTakashi Iwai2009-06-10
|\ | | | | | | | | | | | | | | * topic/usb-audio: ALSA: usb - Add boot quirk for C-Media 6206 USB Audio ALSA: usb-audio - errata corrige for quirk ALSA: usb-audio - Add quirk for Roland/Edirol M-16DX ALSA: usb-audio - quirk for USB Aureon cards
| * ALSA: usb - Add boot quirk for C-Media 6206 USB AudioDan Allongo2009-06-08
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Added boot quirk for C-Media CM6206 device in snd_usb_audio_probe. The function snd_usb_cm6206_boot_quirk sets up six internal 16-bit registers in order to initialize the device. Values for the registers came from sniffing USB traffic under Windows since only four of the six are documented in the datasheet for CM106 and some reserved bits were also being set. [Minor coding-style fixes by tiwai] Signed-off-by: Dan Allongo <gongo2k1@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | Merge branch 'topic/pcm-delay' into for-linusTakashi Iwai2009-06-10
|\ \ | |/ |/| | | | | | | * topic/pcm-delay: ALSA: usbaudio - Add delay account ALSA: Add extra delay count in PCM
| * ALSA: usbaudio - Add delay accountTakashi Iwai2009-05-05
| | | | | | | | | | | | Manage the PCM delay account based on the queued URBs. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | sound: usb-audio: make the MotU Fastlane work againClemens Ladisch2009-05-27
|/ | | | | | | | | | | | | Kernel 2.6.18 broke the MotU Fastlane, which uses duplicate endpoint numbers in a manner that is not only illegal but also confuses the kernel's endpoint descriptor caching mechanism. To work around this, we have to add a separate usb_set_interface() call to guide the USB core to the correct descriptors. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Reported-and-tested-by: David Fries <david@fries.net> Cc: <stable@kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* sound: usb-audio: allow period sizes less than 1 msClemens Ladisch2009-04-06
| | | | | | | | | | To enable periods shorter than 1 ms, we have to make sure that short periods are only available for alternate settings that have a small enough data packet interval. Furthermore, the code that aligns URBs to USB frames is now superfluous. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* sound: usb-audio: save data packet interval in audioformat structureClemens Ladisch2009-04-06
| | | | | | | | | The data packet interval needs to be available in the audioformat structure, together with the other audio format parameters, so that it can be used to influence ALSA hardware parameters. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* sound: usb-audio: remove check_hw_params_convention()Clemens Ladisch2009-04-06
| | | | | | | | | | | | | This removes the check_hw_params_convention() function because 1) it is not necessary, as the hw_rule_* functions also work correctly (i.e., as no-ops) when the device supports all combinations of the audio format parameters; and 2) it would become too complex when adding a fourth altsetting-dependent hardware parameter, as this would require another three loops to check dependecies with rate/channels/format. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* sound: usb-audio: show sample format width in proc fileClemens Ladisch2009-04-06
| | | | | | | | | When listing the device's sample formats in the stream? proc file, the sample format number itself is rather obscure, so we better show the format width, too. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* Merge branch 'topic/usb-audio' into for-linusTakashi Iwai2009-03-23
|\
| * sound: usb-audio: fix queue length check for high speed devicesClemens Ladisch2009-03-02
| | | | | | | | | | | | | | | | | | | | When checking for the maximum queue length, we have to take into account that MAX_QUEUE is measured in milliseconds (i.e., frames) while the unit of urb_packs is whatever data packet interval the device uses (possibly less than one frame when using high speed devices). Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * sound: usb-audio: fix rules check for 32-channel devicesClemens Ladisch2009-03-02
| | | | | | | | | | | | | | | | | | | | | | | | | | When storing the channel numbers used by a format, and if the device happens to support 32 channels, the code would try to store 1<<32 in a 32-bit value. Since no valid format can have zero channels, we can use 1<<(channels-1) instead of 1<<channels so that all the channel numbers that we test for fit into 32 bits. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * sound: usb-audio: remove MIN_PACKS_URBClemens Ladisch2009-02-20
| | | | | | | | | | | | | | | | | | Remove the MIN_PACKS_URB symbol because other limits can force the number of packets down to one, regardless of the value of this symbol, and nobody has ever changed it anyway. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * ALSA: usb - Add missing KERN_* prefix to printkTakashi Iwai2009-02-05
| | | | | | | | Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * ALSA: usbaudio - use printf format instead of hardcoding itAndreas Bergmeier2009-01-27
| | | | | | | | | | | | | | | | Rather use printf format instead of hardcoding prefix like 0x. A next step would be to predefine certain formats. Signed-off-by: Andreas Bergmeier <lcid-fire@gmx.net> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * sound: usb-audio: make URB sizes more equalClemens Ladisch2009-01-26
| | | | | | | | | | | | | | | | | | | | Distribute the packets evenly among the URBs, instead of making all URBs except the last one to have the maximum size. This makes the timing of pointer updates more regular and removes some special cases from the code. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * sound: usb-audio: limit playback queue lengthClemens Ladisch2009-01-26
| | | | | | | | | | | | | | | | | | | | Once our URBs contain enough packets, queueing more URBs does not give us any additional underrun protection (as we use double-buffering) but just increases latency unnecessarily. Therefore, we try to limit the queue length to some reasonable value. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * sound: usb-audio: use normal number of frames for no-data URBsClemens Ladisch2009-01-26
| | | | | | | | | | | | | | | | | | | | When sending a silence URB (before playback has started, or when it is paused), use the number of frames that would be normally sent instead of a single frame so that the rate at which completion interrupts arrive is consistent. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | Merge branch 'topic/snd_card_new-err' into for-linusTakashi Iwai2009-03-23
|\ \
| * | ALSA: Convert to snd_card_create() in other sound/*Takashi Iwai2009-01-12
| |/ | | | | | | | | | | | | Convert from snd_card_new() to the new snd_card_create() function in other sound subdirectories. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | ALSA: usb-audio - Workaround for misdetected sample rate with CM6207Joris van Rantwijk2009-02-16
| | | | | | | | | | | | | | | | | | | | | | | | The CM6207 incorrectly advertises its 96 kHz playback setting as 48 kHz in its USB device descriptor. This patch extends an existing workaround in usbaudio.c to also cover the CM6207. This resolves issue 0004249 in the ALSA bug tracker. Signed-off-by: Joris van Rantwijk <jorispubl@xs4all.nl> Cc: <stable@kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | ALSA: usb-audio - Fix non-continuous rate detectionTakashi Iwai2009-02-16
| | | | | | | | | | | | | | | | | | | | | | The detection of non-continuous rates (given via rate tables) isn't processed properly (e.g. for type II). This patch fixes and simplifies the detection code. Tested-by: Joris van Rantwijk <jorispubl@xs4all.nl> Cc: <stable@kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | sound: usb-audio: handle wMaxPacketSize for FIXED_ENDPOINT devicesClemens Ladisch2009-02-06
|/ | | | | | | | | | | | For audio devices that do not have proper audio descriptors (e.g., Edirol UA-20), we use hardcoded parameters from our quirks list. However, we must still read the maximum packet size from the standard endpoint descriptor; otherwise, we might use packets that are too big and therefore rejected by the USB core. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Cc: <stable@kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: Use usb_set/get_intfdataJulia Lawall2009-01-02
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use the USB functions usb_get_intfdata and usb_set_intfdata instead of dev_get_drvdata and dev_set_drvdata, respectively. The semantic patch that makes this change for the usb_get_intfdata case is as follows: (http://www.emn.fr/x-info/coccinelle/) // <smpl> @header@ @@ #include <linux/usb.h> @same depends on header@ position p; @@ usb_get_intfdata@p(...) { ... } @depends on header@ position _p!=same.p; identifier _f; struct usb_interface*intf; @@ _f@_p(...) { <+... - dev_get_drvdata(&intf->dev) + usb_get_intfdata(intf) ...+> } // </smpl> Signed-off-by: Julia Lawall <julia@diku.dk> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: usb-audio: dynamic detection of MIDI interfaces in uaxx-quirkPedro Lopez-Cabanillas2008-10-10
| | | | | | | | | | The MIDI interfaces have to be detected dynamically for Edirol devices ua-700, ua-25 and ua4-fx. This patch reverses the wrong changes made by my other patch in uaxx-quirk. Signed-off-by: Pedro Lopez-Cabanillas <pedro.lopez.cabanillas@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* ALSA: snd-usb-audio: support for Edirol UA-4FX devicePedro Lopez-Cabanillas2008-10-10
| | | | | | | | | | Renamed the old quirk function for ua-700/ua-25 to become more generic, moving the MIDI interfaces to the quirk data header. Added a new quirk for the Edirol UA-4FX. Signed-off-by: Pedro Lopez-Cabanillas <pedro.lopez.cabanillas@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* ALSA: usb-audio: add support for E-Mu Tracker PreEran Tromer2008-10-10
| | | | | | | | | | | | Add support for the E-Mu "Tracker Pre" USB sound card, following the example of the (very similar) E-Mu 0202 and E-Mu 0404 USB. As with the 0202 and 0404 USB, functionality is very limited: just a couple of sample rates, no volume/mute control, etc. Signed-off-by: Eran Tromer <eran@tromer.org> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* ALSA: usb-audio - Add ignore_ctl_error parameterTakashi Iwai2008-08-15
| | | | | | | | | Added the ignore_ctl_error parameter to enable/disable the control-error handling for mixer interfaces. It was a hard-coded ifdef, and now you can change it more easily. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* ALSA: Kill snd_assert() in other placesTakashi Iwai2008-08-13
| | | | | | | | Kill snd_assert() in other places, either removed or replaced with if () with snd_BUG_ON(). Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* [ALSA] usbaudio.c: remove #ifndef CONFIG_USB_EHCI_SPLIT_ISO codeAdrian Bunk2008-06-06
| | | | | | | | | Since USB_EHCI_SPLIT_ISO is now unconditionally enabled the #ifndef CONFIG_USB_EHCI_SPLIT_ISO became wrong. Reported-by: Robert P. J. Day <rpjday@crashcourse.ca> Signed-off-by: Adrian Bunk <bunk@kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* [ALSA] usb-audio - Fix race in reconnectionTakashi Iwai2008-04-24
| | | | | | | | Fix the race at reconnection of the device. The disconnected usb_chip[] must be cleared before the next probe call properly. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* [ALSA] sound/usb/usbaudio.c: coding stylePavel Machek2008-04-24
| | | | | | | | Putting space between ! and variable is a strange coding style, fix that, also make it fit into 80 columns where that is easy. Signed-off-by: Pavel Machek <pavel@suse.cz> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* [ALSA] usb audio: make quirk handling more readable, and fix commented-out codePavel Machek2008-04-24
| | | | | | | | | | | | | usb audio contains useful debugging code, protected by #if 0. Unfortunately, it will not compile because variable names changed; fix it. Dallas workaround is formatted in a way where it is not quite obvious what is normal code and what is quirk. Reformat it to make it obvious. Signed-off-by: Pavel Machek <pavel@suse.cz> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* [ALSA] usb audio: Fix another Dallas quirkPavel Machek2008-04-24
| | | | | | | | | Dallas USB speakers are buggy in more than one way. One of configs they offer does not work at all. Signed-off-by: Pavel Machek <pavel@suse.cz> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* [ALSA] usb-audio - Add a proper error checkTakashi Iwai2008-04-24
| | | | | | | The error in check_hw_params_convention() has to be checked and handled properly. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* USB: usbaudio: handle kcalloc failureJim Meyering2008-03-10
| | | | | | | | | sound/usb/usbaudio.c (check_hw_params_convention): Handle kcalloc failure. Signed-off-by: Jim Meyering <meyering@redhat.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
* [ALSA] usb-audio: add workaround for broken E-Mu frequency feedbackClemens Ladisch2008-02-29
| | | | | | | | | Add a workaround for the feedback pipe of E-Mu 0202/0404 USB devices that reports the number of samples per packet instead of the number of samples per microframe. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* [ALSA] Remove sound/driver.hTakashi Iwai2008-01-31
| | | | | | | | | | | | This header file exists only for some hacks to adapt alsa-driver tree. It's useless for building in the kernel. Let's move a few lines in it to sound/core.h and remove it. With this patch, sound/driver.h isn't removed but has just a single compile warning to include it. This should be really killed in future. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* [ALSA] sound/usb/usbaudio.c: fix build with CONFIG_PM=nAndrew Morton2008-01-31
| | | | | | | | | sound/usb/usbaudio.c: In function 'usb_audio_suspend': sound/usb/usbaudio.c:3674: error: implicit declaration of function 'snd_pcm_sus\pend_all' Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* [ALSA] usb audio suspend supportOliver Neukum2008-01-31
| | | | | | | | | This patch implements suspend/resume support for USB audio devices. It works with the microphone in my camera. Signed-off-by: Oliver Neukum <oneukum@suse.de> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* [ALSA] missing error check in usb sound driverOliver Neukum2007-10-16
| | | | | | | | usb_set_interface() can fail, even for altsetting 0 Signed-off-by: Oliver Neukum <oneukum@suse.de> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
* [ALSA] usb-audio: allow low speed MIDI devicesClemens Ladisch2007-10-16
| | | | | | | | Allow low speed MIDI devices because newer devices from ESI do not support full speed. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
* [ALSA] pcm: add snd_pcm_rate_to_rate_bit() helperClemens Ladisch2007-10-16
| | | | | | | | Add a snd_pcm_rate_to_rate_bit() function to factor out common code used by several drivers. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
* more trivial signedness fixes in driversAl Viro2007-10-14
| | | | | Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
* [ALSA] usb-audio - Fix AC3 with M-Audio Audiophile USBThibault Le Meur2007-07-20
| | | | | | | | | Fixed AC3 interface in device_setup=0x00 mode thanks to Hakan Lennestal and updated documentation Signed-off-by: Thibault Le Meur <Thibault.LeMeur@supelec.fr> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
* [ALSA] usb-audio - Fix audiophile-USB quirk for little-endianThibault Le Meur2007-07-20
| | | | | | | | | | Audiophile-usb fix (corrects little-endianness in 16bit modes, resets interfaces at device initialization, and updates the documentation). Signed-off-by: Thibault Le Meur <Thibault.LeMeur@supelec.fr> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
* [ALSA] usbaudio - Revert the minimal period size fix patchTakashi Iwai2007-05-11
| | | | | | | | | | The last patch didn't really work (false report). Although the hardware supports 125us minimum period, the current usb-audio driver code assumes the 1ms period in many places. Rollback the change. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
* [ALSA] usb-audio - Fix the minimum period size per transfer modeTakashi Iwai2007-05-11
| | | | | | | | The minimal period size is 125us for high-speed mode while 1ms for full-speed mode. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
* [ALSA] usbaudio - remove urb->bandwidth referenceJiri Kosina2007-02-14
| | | | | | | | | Recent changes in usbcore removed the bandwidth field from struct urb. Remove the occurence in usbaudio.c Signed-off-by: Jiri Kosina <jkosina@suse.cz> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
* [ALSA] usbaudio - Add support for Edirol UA-101Bjoern Fay2007-02-09
| | | | | | | | | | | | | | | | Added support for the Edirol UA-101 (only in high-speed mode) by taking the quirks for the UA-1000 and change them accordingly. Changes were made in 'usbaudio.c', 'usbaudio.h', and 'usbquirks.h' MIDI and recording seem to work perfectly (with JACK), but playback gives some few glitches. I think that's the mentioned synchronizing-problem in the UA-1000 quirk ('FIXME: playback must be synchronized to capture'), so I didn't change that. ToDo: Adding Mixer-Support for the built-in control-panel/patch-bay/router. Signed-off-by: Bjoern Fay <mail@bfay.de> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>