Commit Graph

58 Commits

Author SHA1 Message Date
Thibault LE MEUR e311334ee6 [ALSA] Fixes audiophile usb analog capture with the new device_setup parameter
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 10:38:38 +01:00
Clemens Ladisch 3e964432f5 [ALSA] usb-audio: add error message about missing split iso support
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 10:38:20 +01:00
Clemens Ladisch 32e19e882c [ALSA] usb-audio: show USB error descriptions
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 10:36:37 +01:00
Jesper Juhl 9c4be3d334 [ALSA] no need to check pointers passed to vfree() for NULL
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 10:29:21 +01:00
Clemens Ladisch cc7a59bd8d [ALSA] usb-audio: rename QUIRK_MIDI_MIDITECH to QUIRK_MIDI_CME
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 10:28:22 +01:00
Jaroslav Kysela 3f72a30ccf [ALSA] snd_pcm_format_name() is no longer exported
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 10:27:05 +01:00
Ingo Molnar 12aa757905 [ALSA] semaphore -> mutex (Archs, misc buses)
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 10:25:43 +01:00
Jaroslav Kysela 21a3479a0b [ALSA] PCM midlevel & PCM OSS - make procfs & OSS plugin code optional
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 10:23:12 +01:00
Clemens Ladisch 9568f461e5 [ALSA] usb-audio: factor out packet size calculation code
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-03-22 10:22:27 +01:00
Clemens Ladisch 3315937825 [ALSA] usb-audio: fix non-48k sample rates with SB Audigy 2 ZS
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 16:24:16 +01:00
Clemens Ladisch 4b28492834 [ALSA] usb-audio: don't use empty packets at start of playback
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-22 16:24:09 +01:00
Linus Torvalds 4da5cc2cec Merge git://git.kernel.org/pub/scm/linux/kernel/git/perex/alsa 2006-01-04 16:38:36 -08:00
Greg Kroah-Hartman 75318d2d7c [PATCH] USB: remove .owner field from struct usb_driver
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-04 13:48:34 -08:00
Takashi Iwai 86e07d3465 [ALSA] Remove xxx_t typedefs: USB-Audio
Modules: USB generic driver

Remove xxx_t typedefs from the USB-Audio driver.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2006-01-03 12:19:55 +01:00
Clemens Ladisch b55bbf06e8 [ALSA] usb-audio: start submitting URBs in the prepared state
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 13:25:06 +01:00
Nishanth Aravamudan 8433a509c0 [ALSA] Fix schedule_timeout usage
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 13:19:49 +01:00
Clemens Ladisch f0597a416d [ALSA] usb-audio: don't call usb_reset_configuration() when probing
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 13:18:58 +01:00
Takashi Iwai b1d5776d86 [ALSA] Remove vmalloc wrapper, kfree_nocheck()
- 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 13:18:00 +01:00
Clemens Ladisch 3527a008cb [ALSA] usb-audio: remove old compatibility wrappers (2/2)
Modules: USB generic driver

Move the usb_complete_callback() compatibility wrapper out of the
kernel tree.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
2005-11-04 13:16:39 +01:00
Clemens Ladisch d1bda04554 [ALSA] usb-audio: simplify MIDI quirk handling
Modules: USB generic driver

Simplify the handling of MIDI quirks by treating an interface without
quirks as a QUIRK_MIDI_STANDARD_INTERFACE.

This also fixes the bug where a MIDI_STANDARD quirk would not be
recognized.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
2005-11-04 13:15:49 +01:00
Clemens Ladisch d31cbbfd80 [ALSA] usb-audio: increase max buffer size
USB generic driver
Increase the maximum PCM buffer size to 1 MB.  The USB driver doesn't
have any inherent buffer size limit, and big multichannel interfaces
may benefit from this.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
2005-10-07 14:46:11 +02:00
Takashi Iwai 561b220a4d [ALSA] Replace with kzalloc() - others
Documentation,SA11xx UDA1341 driver,Generic drivers,MPU401 UART,OPL3
OPL4,Digigram VX core,I2C cs8427,I2C lib core,I2C tea6330t,L3 drivers
AK4114 receiver,AK4117 receiver,PDAudioCF driver,PPC PMAC driver
SPARC AMD7930 driver,SPARC cs4231 driver,Synth,Common EMU synth
USB generic driver,USB USX2Y
Replace kcalloc(1,..) with kzalloc().

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2005-09-12 10:48:22 +02:00
Clemens Ladisch 49045d3d4d [ALSA] usb-audio: add SNDRV_PCM_INFO_BATCH flag
USB generic driver
Add the SNDRV_PCM_INFO_BATCH flag to the PCM hardware information to
indicate that the driver uses double buffering.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
2005-09-12 10:41:10 +02:00
Alan Stern b375a0495f [PATCH] USB: URB_ASYNC_UNLINK flag removed from the kernel
29 July 2005, Cambridge, MA:

This afternoon Alan Stern submitted a patch to remove the URB_ASYNC_UNLINK
flag from the Linux kernel.  Mr. Stern explained, "This flag is a relic
from an earlier, less-well-designed system.  For over a year it hasn't
been used for anything other than printing warning messages."

An anonymous spokesman for the Linux kernel development community
commented, "This is exactly the sort of thing we see happening all the
time.  As the kernel evolves, support for old techniques and old code can
be jettisoned and replaced by newer, better approaches.  Proprietary
operating systems do not have the freedom or flexibility to change so
quickly."

Mr. Stern, a staff member at Harvard University's Rowland Institute who
works on Linux only as a hobby, noted that the patch (labelled as548) did
not update two files, keyspan.c and option.c, in the USB drivers' "serial"
subdirectory.  "Those files need more extensive changes," he remarked.
"They examine the status field of several URBs at times when they're not
supposed to.  That will need to be fixed before the URB_ASYNC_UNLINK flag
is removed."

Greg Kroah-Hartman, the kernel maintainer responsible for overseeing all
of Linux's USB drivers, did not respond to our inquiries or return our
calls.  His only comment was "Applied, thanks."

Signed-off-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2005-09-08 16:23:04 -07:00
Clemens Ladisch 6207e51b79 [ALSA] usb-audio: use vmalloc for the PCM buffer
USB generic driver
With the double buffering, we no longer need contiguous memory for the
PCM buffer, so we can use vmalloc() instead of the preallocation
functions, and increase the maximum size to 256 KB.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
2005-08-30 08:45:57 +02:00
Clemens Ladisch 55851f734d [ALSA] usb-audio: use usb_buffer_alloc/free
USB generic driver
Use the USB buffer allocation functions to avoid repeated DMA mappings
of our buffers, which are re-used quite a lot.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
2005-08-30 08:45:53 +02:00
Clemens Ladisch daa150ef7d [ALSA] usb-audio: properly lock hwptr_done accesses
USB generic driver
Take the substream lock when reading hwptr_done to avoid a race
condition with the updates in the URB callbacks.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
2005-08-30 08:45:50 +02:00
Clemens Ladisch 9624ea812c [ALSA] usb-audio: actually schedule playback URBs at frame boundaries
USB generic driver
Change prepare_playback_urb() not to stop preparing packets before a
frame boundary has been reached.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
2005-08-30 08:45:47 +02:00
Clemens Ladisch 7efd8bc800 [ALSA] usb-audio: double-buffer all playback data
USB generic driver
We always had to use double buffering when capturing, and when playback
data for one URB crosses a buffer boundary.  The latter would make hwptr
updates less precise because the double-buffered data is read from the
buffer much earlier than the other data is read by the host controller.

Double-buffering all data allows to update hwptr immediately after the
data was copied to the USB buffer(s), which has the additional benefit
of avoiding the latency imposed by the host controller's delay of up to
one frame when interrupting.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
2005-08-30 08:45:43 +02:00
Clemens Ladisch b263a9bdf9 [ALSA] usb-audio: optimize handling of capture URBs
USB generic driver
When preparing capture URBs, we don't need to stop when we cross a
period boundary because we now never handle more than one millisecond of
data per URB anyway.

When handling captured data, use an extra flag to call
snd_pcm_period_elapsed() no more than once.  This allows us to move the
period boundary checking code before the copying of the data which
avoids a second locking of the substream's lock.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
2005-08-30 08:45:41 +02:00
Clemens Ladisch a93bf99077 [ALSA] usb-audio: schedule high speed URBs with 1 ms alignment
USB generic driver
The EHCI driver doesn't interrupt more than once per millisecond, and
organizes all iso transfers with frame-sized ITDs, so we can (try to)
be more efficient by aligning all URBs on frame boundaries.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
2005-08-30 08:45:16 +02:00
Clemens Ladisch 71d848ca00 [ALSA] usb-audio: make nrpacks parameter writeable
USB generic driver
The nrpacks module parameter is used only when initializing a playback
stream, so it doesn't hurt to make it writeable.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
2005-08-30 08:45:14 +02:00
Clemens Ladisch d6db392e92 [ALSA] usb-audio: fix packets per URB calculation for playback
USB generic driver
When determining how many packets are needed for one period, we cannot
assume that all packets have their maximum size -- we always use the
nominal sample rate when sending data, and could use an even lower rate
when the endpoint uses frequency feedback.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
2005-08-30 08:45:08 +02:00
Clemens Ladisch 15a24c0778 [ALSA] usb-audio: use 1 ms URBs when capturing
USB generic driver
When capturing audio data, we do not know beforehand how many samples
the device sends per frame, so we have to use URBs that are as short as
possible to make sure that we can handle period boundaries without any
additional latencies.

Furthermore, the total count of URBs submitted doesn't matter when
capturing, so we can just use the maximum number.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
2005-08-30 08:45:04 +02:00
Clemens Ladisch 854af9578c [ALSA] usb-audio - change quirk type handling
USB generic driver
Make the quirk type an enum instead of a #defined integer, and use a
table for the quirk constructor functions instead of a big switch
statement.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
2005-07-28 12:22:41 +02:00
Clemens Ladisch f38275fe99 [ALSA] usb-audio - add support for Miditech USB MIDI keyboards
USB generic driver
Add support for Miditech Midistart and MidiStudio keyboards (another
case of devices using the standard protocol but having no descriptors).

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
2005-07-28 12:22:37 +02:00
Nishanth Aravamudan b27c187f95 [ALSA] Fix-up sleeping in sound/usb
USB generic driver,USB USX2Y
Description: Fix-up sleeping in sound/usb. Replace big_mdelay() with
msleep() to guarantee the task delays as expected. This also involved
replacing/removing custom sleep functions.

Patch is compile-tested.

Signed-off-by: Nishanth Aravamudan <nacc@us.ibm.com>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
2005-07-28 12:22:22 +02:00
Clemens Ladisch 6155aff84b [ALSA] usb-audio - rename QUIRK_MIDI_MOTU to QUIRK_MIDI_RAW
USB generic driver
Rename the protocol used by the MOTU FastLane to 'raw' because it might
be useful with other devices, and there are other MOTU interfaces that
do not use this protocol.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
2005-07-28 12:21:41 +02:00
Clemens Ladisch b1c6ef52e2 [ALSA] usb-audio - enable high speed transfers with Audiy 2 NX
USB generic driver
This patch enables the boot commands to activate high speed mode (and
associated sample formats like 8 channels with 24 bits at 96 kHz) on the
SB Audigy 2 NX.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
2005-07-28 12:21:34 +02:00
Clemens Ladisch b4d3f9d452 [ALSA] usb-audio - fix capture of non-48k sample rates on Audigy 2 NX
USB generic driver
On the SB Audigy 2 NX, capturing with sample rates that are not a
multiple of 48 kHz does not seem to work, so disable it.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
2005-07-28 12:09:26 +02:00
Clemens Ladisch 573567e07b [ALSA] usb-audio - high speed audio support
USB generic driver
Add support for endpoints with bInterval > 1, and decoding of the
wMaxPacketSize field of high-speed endpoints.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
2005-07-28 12:09:25 +02:00
Jesper Juhl 77933d7276 [PATCH] clean up inline static vs static inline
`gcc -W' likes to complain if the static keyword is not at the beginning of
the declaration.  This patch fixes all remaining occurrences of "inline
static" up with "static inline" in the entire kernel tree (140 occurrences in
47 files).

While making this change I came across a few lines with trailing whitespace
that I also fixed up, I have also added or removed a blank line or two here
and there, but there are no functional changes in the patch.

Signed-off-by: Jesper Juhl <juhl-lkml@dif.dk>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
2005-07-27 16:26:20 -07:00
Jesper Juhl 4d572776d4 [ALSA] Remove redundant NULL checks before kfree
Timer Midlevel,ALSA sequencer,ALSA<-OSS sequencer,Digigram VX core
I2C tea6330t,GUS Library,VIA82xx driver,VIA82xx-modem driver
CA0106 driver,CS46xx driver,EMU10K1/EMU10K2 driver,YMFPCI driver
Digigram VX Pocket driver,Common EMU synth,USB generic driver,USB USX2Y
Checking a pointer for NULL before calling kfree() on it is redundant,
kfree() deals with NULL pointers just fine.
This patch removes such checks from sound/

This patch also makes another, but closely related, change.
It avoids casting pointers about to be kfree()'ed.

Signed-off-by: Jesper Juhl <juhl-lkml@dif.dk>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2005-06-22 12:27:43 +02:00
Clemens Ladisch 604cf49925 [ALSA] usb-audio - fix synchronization packet interval with Audigy 2 NX
USB generic driver
When a device does not provide the bRefresh field in its audio endpoint
descriptors, use the bInterval field instead.

Furthermore, increase the number of sync URBs for better queueing.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
2005-05-29 10:11:03 +02:00
Clemens Ladisch 29b16931f9 [ALSA] usb-audio - avoid unnecessary double buffering
USB generic driver
When a USB packet boundary falls exactly on a buffer boundary, hwptr
remains at the end of the buffer which causes an overflow in the next
iteration and triggers double buffering although the next packet would
actually be contiguous.

This patch ensures that hwptr is always smaller than buffer_size.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
2005-05-29 10:08:53 +02:00
Clemens Ladisch 50cdbf1519 [ALSA] usb-audio - sanity-check sync feedback frequency values
USB generic driver
Check that the synchronization feedback frequency values returned by the
device are more or less near the nominal frequency.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
2005-05-29 10:08:50 +02:00
Clemens Ladisch 1dcd3ec472 [ALSA] usb-audio - bind to control interface instead of usb_device
USB generic driver
Bind the device files to the (first) audio control interface instead of
the entire USB device.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
2005-05-29 10:06:43 +02:00
Clemens Ladisch 3a2f08560d [ALSA] usb-audio - enable high speed (not) on Audigy 2 NX
USB generic driver
The SB Audigy 2 NX needs a special boot-up command before it works in
high speed mode.

However, we don't actually enable it yet because high speed
synchronization doesn't seem to work with this device.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
2005-05-29 10:06:28 +02:00
Clemens Ladisch c3f9329716 [ALSA] usb-audio - set sample rate attribute on Audigy 2 NX endpoints
USB generic driver
The SB Audigy 2 NX does not advertise the sample rate attribute in its
endpoint descriptors although it supports it.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
2005-05-29 10:06:07 +02:00
Clemens Ladisch ca81090a00 [ALSA] usb-audio - use only one packet in synchronization feedback URBs
USB generic driver
Do not use more than one packet in synchronization feedback URBs because
it would be pointless to send or receive more than one value at the same
time.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
2005-05-29 10:05:57 +02:00