aboutsummaryrefslogtreecommitdiff
path: root/sound/usb/usbaudio.c
AgeCommit message (Collapse)Author
2007-10-16[ALSA] missing error check in usb sound driverOliver Neukum
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>
2007-10-16[ALSA] usb-audio: allow low speed MIDI devicesClemens Ladisch
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>
2007-10-16[ALSA] pcm: add snd_pcm_rate_to_rate_bit() helperClemens Ladisch
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>
2007-10-14more trivial signedness fixes in driversAl Viro
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-07-20[ALSA] usb-audio - Fix AC3 with M-Audio Audiophile USBThibault Le Meur
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>
2007-07-20[ALSA] usb-audio - Fix audiophile-USB quirk for little-endianThibault Le Meur
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>
2007-05-11[ALSA] usbaudio - Revert the minimal period size fix patchTakashi Iwai
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>
2007-05-11[ALSA] usb-audio - Fix the minimum period size per transfer modeTakashi Iwai
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>
2007-02-14[ALSA] usbaudio - remove urb->bandwidth referenceJiri Kosina
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>
2007-02-09[ALSA] usbaudio - Add support for Edirol UA-101Bjoern Fay
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>
2007-02-09[ALSA] usbaudio - Fix Oops with unconventional sample ratesTakashi Iwai
The patch fixes the memory corruption by the support of unconventional sample rates. Also, it avoids the too restrictive constraints if any of usb descriptions contain continuous rates. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
2007-02-09[ALSA] usbaudio - Fix Oops with broken usb descriptorsGregor Jasny
This is a patch for ALSA Bug #2724. Some webcams provide bogus settings with no valid rates. With this patch those are skipped. Signed-off-by: Gregor Jasny <gjasny@web.de> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
2007-02-09[ALSA] usbaudio.c: remove unneeded castsJohn Daiker
Went rummaging through usbaudio.c and found some castings that aren't needed as far as I can see. Part of the KernelJanitors TODO list. Signed-off-by: John Daiker <daikerjohn@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
2007-02-09[ALSA] usb-audio: allow pausingClemens Ladisch
Add pause capabilities for both USB playback and capture streams. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
2007-02-09[ALSA] usb-audio: merge playback/capture hardware information structsClemens Ladisch
The hardware information structures for playback and capture streams, respectively, are the same, so we can use just one structure for both streams. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
2007-01-09[ALSA] usbaudio - Fix kobject_add() error at reconnectionTakashi Iwai
Fixed the error from kobject_add() at reconnection the usb audio device. This happens when an app keeps opening a device while the device is replugged, due to the confliction of the internal bookkept index and the really empty slot. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
2007-01-09[ALSA] usb-audio: work around wrong frequency in CM6501 descriptorsClemens Ladisch
The C-Media CM6501 chip's descriptors say that altsetting 5 supports 48 kHz, but it actually plays at 96 kHz. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
2006-12-20[ALSA] sound/usb/usbaudio: Handle return value of usb_register()Tobias Klauser
Handle the return value of usb_register() in the module_init function. Signed-off-by: Tobias Klauser <tklauser@distanz.ch> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
2006-11-28[ALSA] Fix hang-up at disconnection of usb-audioTakashi Iwai
Fix hang-up at disconnection of usb-audio devices while accessing PCM. Don't handle PCM operations any more after shutdown flag is set. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
2006-10-05IRQ: Maintain regs pointer globally rather than passing to IRQ handlersDavid Howells
Maintain a per-CPU global "struct pt_regs *" variable which can be used instead of passing regs around manually through all ~1800 interrupt handlers in the Linux kernel. The regs pointer is used in few places, but it potentially costs both stack space and code to pass it around. On the FRV arch, removing the regs parameter from all the genirq function results in a 20% speed up of the IRQ exit path (ie: from leaving timer_interrupt() to leaving do_IRQ()). Where appropriate, an arch may override the generic storage facility and do something different with the variable. On FRV, for instance, the address is maintained in GR28 at all times inside the kernel as part of general exception handling. Having looked over the code, it appears that the parameter may be handed down through up to twenty or so layers of functions. Consider a USB character device attached to a USB hub, attached to a USB controller that posts its interrupts through a cascaded auxiliary interrupt controller. A character device driver may want to pass regs to the sysrq handler through the input layer which adds another few layers of parameter passing. I've build this code with allyesconfig for x86_64 and i386. I've runtested the main part of the code on FRV and i386, though I can't test most of the drivers. I've also done partial conversion for powerpc and MIPS - these at least compile with minimal configurations. This will affect all archs. Mostly the changes should be relatively easy. Take do_IRQ(), store the regs pointer at the beginning, saving the old one: struct pt_regs *old_regs = set_irq_regs(regs); And put the old one back at the end: set_irq_regs(old_regs); Don't pass regs through to generic_handle_irq() or __do_IRQ(). In timer_interrupt(), this sort of change will be necessary: - update_process_times(user_mode(regs)); - profile_tick(CPU_PROFILING, regs); + update_process_times(user_mode(get_irq_regs())); + profile_tick(CPU_PROFILING); I'd like to move update_process_times()'s use of get_irq_regs() into itself, except that i386, alone of the archs, uses something other than user_mode(). Some notes on the interrupt handling in the drivers: (*) input_dev() is now gone entirely. The regs pointer is no longer stored in the input_dev struct. (*) finish_unlinks() in drivers/usb/host/ohci-q.c needs checking. It does something different depending on whether it's been supplied with a regs pointer or not. (*) Various IRQ handler function pointers have been moved to type irq_handler_t. Signed-Off-By: David Howells <dhowells@redhat.com> (cherry picked from 1b16e7ac850969f38b375e511e3fa2f474a33867 commit)
2006-10-01[PATCH] kmemdup: some usersAlexey Dobriyan
Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2006-09-23[ALSA] usb-audio: increase number of packets per URBClemens Ladisch
To decrease the USB interrupts rate, increase both the default and the maximum number of packets per URB. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
2006-09-23[ALSA] Support for non-standard rates in USB audio driverLuke Ross
There's at least one USB audio chipset out there which supports only one non-standard rate (ID 0e6a:0310 supports 46875Hz). There's a few other patches for this card which are unsatisfactory because they attempt to map this rate to 44.1k leading to sound distortion. The patch below uses SNDRV_PCM_RATE_KNOT to properly support the non-standard rates where they are available. Signed-off-by: Luke Ross <luke@lukeross.name> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
2006-09-23[ALSA] usb-audio - Fix a typo of CONFIG_PROC_FSTakashi Iwai
Fixed a typo of CONFIG_PROC_FS in usbaudio.c. The stream proc file appears again. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
2006-09-23[ALSA] Unregister device files at disconnectionTakashi Iwai
Orignally proposed by Sam Revitch <sam.revitch@gmail.com>. Unregister device files at disconnection to avoid the futher accesses. Also, the dev_unregister callback is removed and replaced with the combination of disconnect + free. A new function snd_card_free_when_closed() is introduced, which is used in USB disconnect callback. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
2006-08-03[ALSA] Conversions from kmalloc+memset to k(z|c)allocPanagiotis Issaris
sound: Conversions from kmalloc+memset to k(c|z)alloc. Signed-off-by: Panagiotis Issaris <takis@issaris.org> Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
2006-06-28[ALSA] usb-audio support for Turtle Beach RoadieSam Revitch
From: Sam Revitch <sam.revitch@gmail.com>Recently a Turtle Beach Audio Advantage Roadie device ended up in my possession. It seems to work with the snd-usb-audio driver, but only using the headphone jack in 2-channel mode. The device has a DIN connector carrying six more channels that are otherwise silent. C-Media has freely available documentation for the CM106 chip around which this device is based, and enabling 8-channel output, or 6-channel output with the headphone jack following the front pair is a matter of setting one of its registers. Attached is a patch to try to enable 5.1 output mode at probe time. It seems to work correctly with my device. There is quite list of other configurables for this device that might deserve controls. Signed-off-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Jaroslav Kysela <perex@suse.cz>
2006-06-22[ALSA] USB midi: Remove duplicate CS_AUDIO_* #definesBen Williamson
Removed the CS_AUDIO_* #defines, which were duplicates of the class-specific USB_DT_CS_* #defines in <linux/usb_ch9.h>. Signed-off-by: Ben Williamson <ben.williamson@greyinnovation.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2006-06-22[ALSA] usbaudio - Fix a typoTakashi Iwai
Fix a typo introduced by the last fix. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2006-06-22[ALSA] usb-audio: add workaround for CSR Bluetooth Headphones (Saitek A-250)Clemens Ladisch
Some devices don't have the required class-specific endpoint descriptors. Instead of making this case an error, this patch makes the driver guess the endpoint attributes. Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
2006-06-22[ALSA] Remove unneeded read/write_size fields in proc text opsTakashi Iwai
Remove unneeded read/write_size fields in proc text ops. snd_info_set_text_ops() is fixed, too. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2006-03-22[ALSA] Fixes audiophile usb analog capture with the new device_setup parameterThibault LE MEUR
Modules: Documentation,USB generic driver The patch adds the 'device_setup' module parameter and a specific quirk to correctly initialize the audiophile usb device: this fixes the distorted sound bug on the Analog capture port. Backward compatibility is achieved by simply omitting the new parameter. Signed-off-by: Thibault LE MEUR <Thibault.LeMeur@supelec.fr> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2006-03-22[ALSA] usb-audio: add error message about missing split iso supportClemens Ladisch
Modules: USB generic driver Add an error message for -ENOSYS for situations when split iso support is needed but not enabled. Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
2006-03-22[ALSA] usb-audio: show USB error descriptionsClemens Ladisch
Modules: USB generic driver When usb_submit_urb() fails, show an error description instead of just the error code. Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
2006-03-22[ALSA] no need to check pointers passed to vfree() for NULLJesper Juhl
Modules: Digigram VX core,USB generic driver There's no need to check pointers passed to vfree() for NULL. Signed-off-by: Jesper Juhl <jesper.juhl@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2006-03-22[ALSA] usb-audio: rename QUIRK_MIDI_MIDITECH to QUIRK_MIDI_CMEClemens Ladisch
Modules: USB generic driver Rename QUIRK_MIDI_MIDITECH to QUIRK_MIDI_CME because Miditech keyboards are built by CME and use the same protocol, and don't force a Miditech product name for the USB ID used by both Miditech and CME UF-x keyboards. Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
2006-03-22[ALSA] snd_pcm_format_name() is no longer exportedJaroslav Kysela
Modules: PCM Midlevel,USB generic driver Because snd_pcm_format_name() function is used only for informational purposes, it is no longer exported from the PCM midlevel to reduce space and dependency. usbaudio module shows only numeric value for format. Signed-off-by: Jaroslav Kysela <perex@suse.cz>
2006-03-22[ALSA] semaphore -> mutex (Archs, misc buses)Ingo Molnar
Semaphore to mutex conversion. The conversion was generated via scripts, and the result was validated automatically via a script as well. Signed-off-by: Ingo Molnar <mingo@elte.hu> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2006-03-22[ALSA] PCM midlevel & PCM OSS - make procfs & OSS plugin code optionalJaroslav Kysela
Modules: ALSA Core,PCM Midlevel,ALSA<-OSS emulation,USB generic driver 1) The verbose procfs code for the PCM midlevel and usb audio can be removed now (more patches will follow). CONFIG_SND_VERBOSE_PROCFS 2) The PCM OSS plugin system can be also compiled optionaly. CONFIG_SND_PCM_OSS_PLUGINS Signed-off-by: Jaroslav Kysela <perex@suse.cz>
2006-03-22[ALSA] usb-audio: factor out packet size calculation codeClemens Ladisch
Modules: USB generic driver Move the common packet size calculation code from prepare_startup_playback_urb() and prepare_playback_urb() to a new function. Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
2006-01-22[ALSA] usb-audio: fix non-48k sample rates with SB Audigy 2 ZSClemens Ladisch
Modules: USB generic driver On the Audigy 2 ZS, disable all sample rate that are not a multiple of 48 kHz because the others work only with the digital output which is not yet supported. Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
2006-01-22[ALSA] usb-audio: don't use empty packets at start of playbackClemens Ladisch
Modules: USB generic driver Some widespread USB interface chips with adaptive iso endpoints hang after receiving a series of empty packets when they expect data (ALSA bug#1585). To avoid this, we have to send packets containing silence (zero samples) instead. Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
2006-01-04Merge git://git.kernel.org/pub/scm/linux/kernel/git/perex/alsaLinus Torvalds
2006-01-04[PATCH] USB: remove .owner field from struct usb_driverGreg Kroah-Hartman
It is no longer needed, so let's remove it, saving a bit of memory. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2006-01-03[ALSA] Remove xxx_t typedefs: USB-AudioTakashi Iwai
Modules: USB generic driver Remove xxx_t typedefs from the USB-Audio driver. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2005-11-04[ALSA] usb-audio: start submitting URBs in the prepared stateClemens Ladisch
Modules: USB generic driver If we submit all our URBs when a playback stream is started, the first hwptr_done update for each URB happens at the same time. This results in an underrun when there isn't enough PCM data available at this point for all URBs. To avoid this, we begin submitting our URBs earlier (when the stream is prepared), with empy packets. When the stream is started, the prepare_playback_urb() call for each URB will be run only when the respective URB has completed previously, so the first hwptr_done updates will be done nicely staggered. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2005-11-04[ALSA] Fix schedule_timeout usageNishanth Aravamudan
Use schedule_timeout_{,un}interruptible() instead of set_current_state()/schedule_timeout() to reduce kernel size. Also use human-time conversion functions instead of hard-coded division to avoid rounding issues. Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2005-11-04[ALSA] usb-audio: don't call usb_reset_configuration() when probingClemens Ladisch
Modules: USB generic driver Remove the usb_reset_configuration() call from the probe callback because it isn't needed and it may interfere with other drivers already loaded for the device. Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
2005-11-04[ALSA] Remove vmalloc wrapper, kfree_nocheck()Takashi Iwai
- Remove vmalloc wrapper - Add release_and_free_resource() to remove kfree_nocheck() from each driver and simplify the code Signed-off-by: Takashi Iwai <tiwai@suse.de>
2005-11-04[ALSA] usb-audio: remove old compatibility wrappers (2/2)Clemens Ladisch
Modules: USB generic driver Move the usb_complete_callback() compatibility wrapper out of the kernel tree. Signed-off-by: Clemens Ladisch <clemens@ladisch.de>