summaryrefslogtreecommitdiffstats
path: root/sound/usb/usbaudio.c
Commit message (Collapse)AuthorAgeFilesLines
* Merge branch 'topic/misc' of ↵Jaroslav Kysela2010-02-161-135/+121Star
|\ | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6 into devel
| * ALSA: pcm - Call pgprot_noncached() for vmalloc'ed buffersTakashi Iwai2010-01-181-0/+2
| | | | | | | | | | | | | | | | | | | | | | pgprot_noncached() can be set for vmalloc'ed buffers safely, and we'd need non-cached behavior more or less, even for the intermediate ring- buffers. Now snd_pcm_lib_mmap_vmalloc() is added as the common PCM mmap callback that is coupled with snd_pcm_lib_alloc_vmalloc_buffer() & co. Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * ALSA: usb-audio: use usbquirk.h for detection of HVR-950Q/850John S. Gruber2009-12-281-15/+15
| | | | | | | | | | | | | | | | Detect the HVR-950Q HVR-850 urb data alignment quirk using usbquirk.h rather than using a case statement in snd_usb_audio_probe. Signed-off-by: John S. Gruber <JohnSGruber@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * ALSA: usb-audio: relax urb data align. restriction HVR-950Q and HVR-850 onlyJohn S. Gruber2009-12-281-2/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Addressing audio quality problem. In sound/usb/usbaudio.c, for the Hauppage HVR-950Q and HVR-850 only, change retire_capture_urb to allow transfers on audio sub-slot boundaries rather than audio slots boundaries. With these devices the left and right channel samples can be split between two different urbs. Throwing away extra channel samples causes a sound quality problem for stereo streams as the left and right channels are swapped repeatedly, perhaps many times per second. Urbs unaligned on sub-slot boundaries are still truncated to the next lowest stride (audio slot) to retain synchronization on samples even though left/right channel synchronization may be lost in this case. Detect the quirk using a case statement in snd_usb_audio_probe. BugLink: https://bugs.launchpad.net/ubuntu/+bug/495745 Signed-off-by: John S. Gruber <JohnSGruber@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * ALSA: usb-audio: make buffer pointer based on bytes instead on framesClemens Ladisch2009-12-281-39/+37Star
| | | | | | | | | | | | | | | | | | | | Since there are devices that do not align the size of their data packets to frame boundaries, the driver needs to be able to keep track of partial frames. This patch prepares for support for such devices by changing the hwptr_done variable from a frame counter to a byte counter. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * ALSA: usb-audio - Added functionality for E-mu 0404USB/0202USB/TrackerPreSergiy Kovalchuk2009-12-281-0/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Added functionality: 1) Extension Units support (all XU settings now available at alsamixer, kmix, etc): - "AnalogueIn soft limiter" switch; - "Sample rate" selector (values 0,1,2,3,4,5 corresponds to 44.1 48 ... 192 kHz); - "DigitalIn CLK source" selector (internal/external) (**); - "DigitalOut format SPDIF/AC3" switch (**); (**)E-mu-0404usb only. 2) Automatic device sample rate adjustment depending on substream samplerate for both capture and playback substream. [minor coding-style fixes by tiwai] Signed-off-by: Sergiy Kovalchuk <cnb_zerg@yahoo.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * sound: usb-audio: use vmalloc buffer helper functionsClemens Ladisch2009-12-181-41/+5Star
| | | | | | | | | | | | | | | | Remove this duplicate of snd_pcm_alloc_vmalloc_buffer and use the equivalent core functions instead. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * Merge branch 'fix/misc' into topic/miscTakashi Iwai2009-12-181-1/+1
| |\
| * | sound: add Edirol UA-101 supportClemens Ladisch2009-12-141-54/+0Star
| | | | | | | | | | | | | | | | | | | | | Add experimental support for the Edirol UA-101 audio/MIDI interface. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | | ALSA: USB MIDI support for Access Music VirusTISebastien Alaiwan2010-02-161-0/+32
| |/ |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Here's a patch that adds MIDI support through USB for one of the Access Music synths, the VirusTI. The synth uses standard USBMIDI protocol on its USB interface 3, although it does signal "vendor specific" class. A magic string has to be sent on interface 3 to enable the sending of MIDI from the synth (this string was found by sniffing usb communication of the Windows driver). This is all my patch does, and it works on my computer. Please note that the synth can also do standard usb audio I/O on its interfaces 2&3, which already works with the current snd-usb-audio driver, except for the audio input from the synth. I'm going to work on it when I have some time. Signed-off-by: Sebastien Alaiwan <sebastien.alaiwan@gmail.com> Signed-off-by: Clemens Ladisch <clemens@ladisch.de> (cosmetics, list terminator) Signed-off-by: Jaroslav Kysela <perex@perex.cz>
* | sound: sgio2audio/pdaudiocf/usb-audio: initialize PCM bufferClemens Ladisch2009-12-181-1/+1
|/ | | | | | | | | | | | When allocating the PCM buffer, use vmalloc_user() instead of vmalloc(). Otherwise, it would be possible for applications to play the previous contents of the kernel memory to the speakers, or to read it directly if the buffer is exported to userspace. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Cc: <stable@kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* sound: usb: make the USB MIDI module more independentClemens Ladisch2009-11-241-15/+23
| | | | | | | | | Remove the dependecy from the USB MIDI code on the snd_usb_audio structure. This allows using the USB MIDI module from another driver without having to pretend to be the generic USB audio driver. 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-09-101-0/+2
|\ | | | | | | | | | | | | | | | | | | * topic/usb-audio: ALSA: usb-audio - Fix types taken in min() sound: usb-audio: do not make URBs longer than sync packet interval sound: usb-audio: add MIDI drain callback sound: usb-audio: use multiple output URBs sound: usb-audio: use multiple input URBs sound: usb-audio: Xonar U1 digital output support
| * ALSA: usb-audio - Fix types taken in min()Takashi Iwai2009-08-111-1/+1
| | | | | | | | | | | | | | | | Fix the compile warning due to different integer types used in min(): sound/usb/usbaudio.c: In function 'init_substream_urbs': sound/usb/usbaudio.c:1087: warning: comparison of distinct pointer types lacks a cast Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * sound: usb-audio: do not make URBs longer than sync packet intervalClemens Ladisch2009-08-101-0/+2
| | | | | | | | | | | | | | | | | | Using more packets in one URB do avoid interrupts does not make sense when we have a sync pipe whose packets generate interrupts more often. Therefore, limit the URB size to the synchronization packet interval. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | ALSA: Re-export snd_pcm_format_name() functionTakashi Iwai2009-09-081-2/+2
|/ | | | | | | Re-export snd_pcm_format_name() function to be used outside the PCM core. As a first example, usbaudio is changed to use it now again. Signed-off-by: Takashi Iwai <tiwai@suse.de>
* sound: usb-audio: add workaround for Blue Microphones devicesClemens Ladisch2009-07-151-1/+13
| | | | | | | | | | | | | | | Blue Microphones USB devices have an alternate setting that sends two channels of data to the computer. Unfortunately, the descriptors of that altsetting have a wrong channel setting, which means that any recorded data from such a device has twice the sample rate from what would be expected. This patch adds a workaround to ignore that altsetting. Since these devices have only one actual channel, no data is lost. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Cc: <stable@kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* Merge branch 'topic/usb-audio' into for-linusTakashi Iwai2009-06-101-0/+25
|\ | | | | | | | | | | | | | | * 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-081-0/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-101-1/+13
|\ \ | |/ |/| | | | | | | * topic/pcm-delay: ALSA: usbaudio - Add delay account ALSA: Add extra delay count in PCM
| * ALSA: usbaudio - Add delay accountTakashi Iwai2009-05-051-1/+13
| | | | | | | | | | | | 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-271-1/+1
|/ | | | | | | | | | | | | 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-071-20/+86
| | | | | | | | | | 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-071-6/+21
| | | | | | | | | 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-071-116/+19Star
| | | | | | | | | | | | | 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-071-1/+2
| | | | | | | | | 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-241-46/+33Star
|\
| * sound: usb-audio: fix queue length check for high speed devicesClemens Ladisch2009-03-021-3/+2Star
| | | | | | | | | | | | | | | | | | | | 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-021-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | 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-201-8/+6Star
| | | | | | | | | | | | | | | | | | 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-051-2/+4
| | | | | | | | Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * ALSA: usbaudio - use printf format instead of hardcoding itAndreas Bergmeier2009-01-271-7/+7
| | | | | | | | | | | | | | | | 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-261-24/+5Star
| | | | | | | | | | | | | | | | | | | | 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-261-1/+8
| | | | | | | | | | | | | | | | | | | | 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-261-3/+3
| | | | | | | | | | | | | | | | | | | | 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-241-3/+3
|\ \
| * | ALSA: Convert to snd_card_create() in other sound/*Takashi Iwai2009-01-121-3/+3
| |/ | | | | | | | | | | | | 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-161-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | 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-161-8/+9
| | | | | | | | | | | | | | | | | | | | | | 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-061-0/+1
|/ | | | | | | | | | | | 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-021-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-101-0/+25
| | | | | | | | | | 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-101-33/+8Star
| | | | | | | | | | 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-101-1/+2
| | | | | | | | | | | | 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-151-2/+5
| | | | | | | | | 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-131-4/+8
| | | | | | | | 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-061-4/+0Star
| | | | | | | | | 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-241-1/+1
| | | | | | | | 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-241-31/+32
| | | | | | | | 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-241-5/+6
| | | | | | | | | | | | | 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>