Commit Graph

538 Commits

Author SHA1 Message Date
Mark Hills bd4cbf6c76 ALSA: snd-usb-caiaq: Restore 'Control vinyl' input mode on A4DJ
This feature was undocumented on early A4DJ units. It is indicated
by lighting both the 'line' and 'phono' lamps at the same time.
Newer units document this and the newer Windows drivers enable this
for all units, so restore the functionality.

This patch simplifies the code and changes the mode mapping to match
the A8DJ, favouring simpler code and consistency over keeping the
existing mapping.

Both 'Control vinyl' and 'Phono' input modes enable the hardware
preamp. The difference is the input impedance.

This reverts commit 9a9527e.

Acked-by: Daniel Mack <daniel@caiaq.de>
Signed-off-by: Mark Hills <mark@pogo.org.uk>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-05-29 21:48:24 +02:00
Daniel Mack e8d0fee70b ALSA: usb-audio: fix feature unit parser for UAC2
Fix a small off-by-one bug which causes the feature unit to announce a
wrong number of channels. This leads to illegal requests sent to the
firmware eventually.

Signed-off-by: Daniel Mack <daniel@caiaq.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-05-28 07:48:17 +02:00
Daniel Mack 92c256110f ALSA: usb-audio: add support for UAC2 pitch control
This request is again handled differently in comparison to UAC1.

Signed-off-by: Daniel Mack <daniel@caiaq.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-05-27 09:49:37 +02:00
Daniel Mack 43b8e3bc4a ALSA: usb-audio: parse UAC2 endpoint descriptors correctly
UAC2 devices have their information about pitch control stored in a
different field. Parse it, and emulate the bits for a v1 device.

A new struct uac2_iso_endpoint_descriptor is added.

Signed-off-by: Daniel Mack <daniel@caiaq.de>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-05-27 09:49:22 +02:00
Daniel Mack 8d09124271 ALSA: usb-audio: fix return values
-1 is not a good return value as it means -EPERM, "not permitted".
Choose -ENOTSUPP instead, which is what the code really wants to tell
its callers.

Signed-off-by: Daniel Mack <daniel@caiaq.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-05-27 09:48:47 +02:00
Daniel Mack 74754f974b ALSA: usb-audio: parse more format descriptors with structs
Signed-off-by: Daniel Mack <daniel@caiaq.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-05-27 09:48:31 +02:00
Linus Torvalds 2214482cb0 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6:
  ALSA: emu10k1: allow high-resolution mixer controls
  ALSA: pcm: fix delta calculation at boundary wraparound
  ALSA: hda_intel: fix handling of non-completion stream interrupts
  ALSA: usb/caiaq: fix Traktor Kontrol X1 ABS_HAT2X axis
  ALSA: hda: Fix model quirk for Dell M1730
  ALSA: hda - iMac9,1 sound fixes
  ALSA: hda: Use LPIB for Toshiba A100-259
  ALSA: hda: Use LPIB for Acer Aspire 5110
  ALSA: aw2-alsa.c: use pci_ids.h defines and fix checkpatch.pl noise
  ALSA: usb-audio: add support for Akai MPD16
  ALSA: pcm: fix the fix of the runtime->boundary calculation
2010-05-26 08:41:25 -07:00
Daniel Mack 57c7ffc941 ALSA: usb/caiaq: fix Traktor Kontrol X1 ABS_HAT2X axis
Signed-off-by: Daniel Mack <daniel@caiaq.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-05-25 20:21:53 +02:00
Krzysztof Foltman 4434ade8c9 ALSA: usb-audio: add support for Akai MPD16
The decoding/encoding is based on own reverse-engineering. Both control and
data ports are handled. Writing to control port supports SysEx events only,
as this is the only type of messages that MPD16 recognizes.

Signed-off-by: Krzysztof Foltman <wdev@foltman.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-05-21 17:12:30 +02:00
Linus Torvalds 7a9b149212 Merge git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6
* git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb-2.6: (229 commits)
  USB: remove unused usb_buffer_alloc and usb_buffer_free macros
  usb: musb: update gfp/slab.h includes
  USB: ftdi_sio: fix legacy SIO-device header
  USB: kl5usb105: reimplement using generic framework
  USB: kl5usb105: minor clean ups
  USB: kl5usb105: fix memory leak
  USB: io_ti: use kfifo to implement write buffering
  USB: io_ti: remove unsused private counter
  USB: ti_usb: use kfifo to implement write buffering
  USB: ir-usb: fix incorrect write-buffer length
  USB: aircable: fix incorrect write-buffer length
  USB: safe_serial: straighten out read processing
  USB: safe_serial: reimplement read using generic framework
  USB: safe_serial: reimplement write using generic framework
  usb-storage: always print quirks
  USB: usb-storage: trivial debug improvements
  USB: oti6858: use port write fifo
  USB: oti6858: use kfifo to implement write buffering
  USB: cypress_m8: use kfifo to implement write buffering
  USB: cypress_m8: remove unused drain define
  ...

Fix up conflicts (due to usb_buffer_alloc/free renaming) in
	drivers/input/tablet/acecad.c
	drivers/input/tablet/kbtab.c
	drivers/input/tablet/wacom_sys.c
	drivers/media/video/gspca/gspca.c
	sound/usb/usbaudio.c
2010-05-20 21:26:12 -07:00
Stephen Rothwell 3d62e3fdce sound: fixup for usb_buffer_alloc/free rename
This is needed before the USB merge.

Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-05-20 21:15:18 -07:00
Daniel Mack 997ea58eb9 USB: rename usb_buffer_alloc() and usb_buffer_free() users
For more clearance what the functions actually do,

  usb_buffer_alloc() is renamed to usb_alloc_coherent()
  usb_buffer_free()  is renamed to usb_free_coherent()

They should only be used in code which really needs DMA coherency.

All call sites have been changed accordingly, except for staging
drivers.

Signed-off-by: Daniel Mack <daniel@caiaq.de>
Cc: Alan Stern <stern@rowland.harvard.edu>
Cc: Pedro Ribeiro <pedrib@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
2010-05-20 13:21:38 -07:00
Takashi Iwai 9ce3db4e79 Merge branch 'topic/usb' into for-linus 2010-05-20 11:59:43 +02:00
Daniel Mack e213e9cf70 ALSA: sound/usb: add preliminary support for UAC2 interrupts
For both UAC1 and UAC2, interrupt endpoint messages are now parsed with
structs rather that with anonymous buffer array accesses.

For UAC2, only CUR interrupt notifications are supported for now.

snd_usb_mixer_status_complete() was renamed to
snd_usb_mixer_interrupt().

Fixed one indentation flaw on the way.

Signed-off-by: Daniel Mack <daniel@caiaq.de>
Cc: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-05-11 22:44:07 +02:00
Daniel Mack 5e68888356 ALSA: sound/usb: fix UAC1 regression
Commit 23caaf19b ("ALSA: usb-mixer: Add support for Audio Class v2.0")
broke support for Class1 devices due to two faulty changes. This patch
fixes it.

Signed-off-by: Daniel Mack <daniel@caiaq.de>
Reported-and-Tested-by: The Source <thesourcehim@gmail.com>
Cc: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-05-08 11:39:44 +02:00
Jaroslav Kysela ca4c2adaf2 ALSA: usb/mixer - use get_iface_desc() rather than direct structure
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2010-04-16 10:37:50 +02:00
Jaroslav Kysela f09d045e2a Merge branch 'topic/usb' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6 into devel 2010-04-16 10:37:41 +02:00
Takashi Iwai 872d65f674 Merge branch 'fix/misc' into for-linus 2010-04-16 10:03:42 +02:00
Takashi Iwai 27762b2ce1 Merge branch 'fix/misc' into topic/usb 2010-04-10 21:34:56 +02:00
Takashi Iwai 29aac005ff ALSA: usb - Fix Oops after usb-midi disconnection
usb-midi causes sometimes Oops at snd_usbmidi_output_drain() after
disconnection.  This is due to the access to the endpoints which have
been already released at disconnection while the files are still alive.

This patch fixes the problem by checking disconnection state at
snd_usbmidi_output_drain() and by releasing urbs but keeping the
endpoint instances until really all freed.

Tested-by: Tvrtko Ursulin <tvrtko@ursulin.net>
Cc: <stable@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-04-10 21:34:24 +02:00
Tejun Heo 5a0e3ad6af include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit slab.h inclusion from percpu.h
percpu.h is included by sched.h and module.h and thus ends up being
included when building most .c files.  percpu.h includes slab.h which
in turn includes gfp.h making everything defined by the two files
universally available and complicating inclusion dependencies.

percpu.h -> slab.h dependency is about to be removed.  Prepare for
this change by updating users of gfp and slab facilities include those
headers directly instead of assuming availability.  As this conversion
needs to touch large number of source files, the following script is
used as the basis of conversion.

  http://userweb.kernel.org/~tj/misc/slabh-sweep.py

The script does the followings.

* Scan files for gfp and slab usages and update includes such that
  only the necessary includes are there.  ie. if only gfp is used,
  gfp.h, if slab is used, slab.h.

* When the script inserts a new include, it looks at the include
  blocks and try to put the new include such that its order conforms
  to its surrounding.  It's put in the include block which contains
  core kernel includes, in the same order that the rest are ordered -
  alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
  doesn't seem to be any matching order.

* If the script can't find a place to put a new include (mostly
  because the file doesn't have fitting include block), it prints out
  an error message indicating which .h file needs to be added to the
  file.

The conversion was done in the following steps.

1. The initial automatic conversion of all .c files updated slightly
   over 4000 files, deleting around 700 includes and adding ~480 gfp.h
   and ~3000 slab.h inclusions.  The script emitted errors for ~400
   files.

2. Each error was manually checked.  Some didn't need the inclusion,
   some needed manual addition while adding it to implementation .h or
   embedding .c file was more appropriate for others.  This step added
   inclusions to around 150 files.

3. The script was run again and the output was compared to the edits
   from #2 to make sure no file was left behind.

4. Several build tests were done and a couple of problems were fixed.
   e.g. lib/decompress_*.c used malloc/free() wrappers around slab
   APIs requiring slab.h to be added manually.

5. The script was run on all .h files but without automatically
   editing them as sprinkling gfp.h and slab.h inclusions around .h
   files could easily lead to inclusion dependency hell.  Most gfp.h
   inclusion directives were ignored as stuff from gfp.h was usually
   wildly available and often used in preprocessor macros.  Each
   slab.h inclusion directive was examined and added manually as
   necessary.

6. percpu.h was updated not to include slab.h.

7. Build test were done on the following configurations and failures
   were fixed.  CONFIG_GCOV_KERNEL was turned off for all tests (as my
   distributed build env didn't work with gcov compiles) and a few
   more options had to be turned off depending on archs to make things
   build (like ipr on powerpc/64 which failed due to missing writeq).

   * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
   * powerpc and powerpc64 SMP allmodconfig
   * sparc and sparc64 SMP allmodconfig
   * ia64 SMP allmodconfig
   * s390 SMP allmodconfig
   * alpha SMP allmodconfig
   * um on x86_64 SMP allmodconfig

8. percpu.h modifications were reverted so that it could be applied as
   a separate patch and serve as bisection point.

Given the fact that I had only a couple of failures from tests on step
6, I'm fairly confident about the coverage of this conversion patch.
If there is a breakage, it's likely to be something in one of the arch
headers which should be easily discoverable easily on most builds of
the specific arch.

Signed-off-by: Tejun Heo <tj@kernel.org>
Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>
2010-03-30 22:02:32 +09:00
Tejun Heo 7b7b904226 ALSA: usb - update gfp/slab.h includes
Implicit slab.h inclusion via percpu.h is about to go away.  Make sure
gfp.h or slab.h is included as necessary.

Signed-off-by: Tejun Heo <tj@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-03-29 21:29:03 +02:00
Stephen Rothwell 9966ddafe1 ALSA: usb pcm: use of kmalloc requires the include of slab.h
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-03-29 10:04:07 +02:00
Stephen Rothwell 36db045658 ALSA: usb - use of kmalloc/kfree requires the include of slab.h
Signed-off-by: Stephen Rothwell <sfr@canb.auug.org.au>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-03-29 08:23:27 +02:00
Felix Homann fca5bca487 ALSA: usbaudio: Add basic support for M-Audio Fast Track Ultra series
This adds basic support for M-Audio's Fast Track Ultra series of USB
audio interfaces. It is a refactored version of the patch Clemens
Ladisch posted some time ago. Neither playback nor capturing work
properly at 44100 Hz (don't know why).
The other sampling rates work properly. There's no support for the DSP
mixer, yet.

Signed-off-by: Felix Homann <fexpop@web.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-03-25 12:26:44 +01:00
Takashi Iwai 85ae01b2da Merge remote branch 'alsa/devel' into topic/usb 2010-03-23 14:56:33 +01:00
Clemens Ladisch 306ff3e473 ALSA: ua101: remove experimental status
Now that the EHCI driver copes with small iso packets without blowing
up, take the snd-ua101 driver out of the alpha-test stage.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2010-03-23 11:21:53 +01:00
Randy Dunlap 6407d474e6 ALSA: usb: fix usb build error when PM is not enabled
Fix build errors when CONFIG_PM is not enabled:

sound/usb/card.c:629: error: 'usb_audio_suspend' undeclared here (not in a function)
sound/usb/card.c:630: error: 'usb_audio_resume' undeclared here (not in a function)

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-03-22 17:07:36 +01:00
Takashi Iwai 2fb20b6155 Merge branch 'topic/misc' into topic/usb 2010-03-22 17:05:48 +01:00
Daniel Mack 6da7a2aa89 ALSA: usb/caiaq: Add support for Traktor Kontrol X1
This device does not have audio controllers and backlit buttons only.
Input data is handled over a dedicated USB endpoint.

All functions are supported by the driver now.

Signed-off-by: Daniel Mack <daniel@caiaq.de>
Cc: Dmitry Torokhov <dtor@mail.ru>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-03-22 16:10:41 +01:00
Daniel Mack 23caaf19b1 ALSA: usb-mixer: Add support for Audio Class v2.0
USB Audio Class v2.0 compliant devices have different descriptors and a
different way of setting/getting min/max/res/cur properties. This patch
adds support for them.

Signed-off-by: Daniel Mack <daniel@caiaq.de>
Cc: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-03-12 12:21:26 +01:00
Daniel Mack 99fc86450c ALSA: usb-mixer: parse descriptors with structs
Introduce a number of new structs for mixer, selector, feature and
processing units and some static inline helpers to access fields which
have dynamic offsets. Use them in mixer.c to parse the descriptors. This
is necessary for the upcoming audio v2 parsers.

Signed-off-by: Daniel Mack <daniel@caiaq.de>
Cc: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-03-12 12:21:12 +01:00
Daniel Mack f0b5e634ff ALSA: usbmixer: rename usbmixer.[ch] -> mixer.[ch]
For clearer namespace, also rename usbmixer_maps.c -> mixer_maps.c

Signed-off-by: Daniel Mack <daniel@caiaq.de>
Cc: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-03-12 12:20:49 +01:00
Daniel Mack 7b1eda223d ALSA: usb-mixer: factor out quirks
Move all non-standard mixer controls and vendor-specific extensions to a
separate file. Some structs need to be exported now.

Signed-off-by: Daniel Mack <daniel@caiaq.de>
Cc: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-03-12 12:20:26 +01:00
Daniel Mack 45d760567a ALSA: usb-mixer: use defines from audio.h
No need for the private enum.

Signed-off-by: Daniel Mack <daniel@caiaq.de>
Cc: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-03-12 12:20:07 +01:00
Daniel Mack 7e84789403 linux/usb/audio.h: split header
- Split the audio.h file in two to clearly denote the differences
  between the standards.
- Add many more defines to audio-v2.h. Most of them are not currently
  used.
- Replaced a magic value with a proper define

Signed-off-by: Daniel Mack <daniel@caiaq.de>
Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
Cc: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-03-12 12:19:49 +01:00
Daniel Mack 767d75ad1c ALSA: usb-audio: add support for samplerate setting on v2 devices
Sample rate setting is done with a 4-byte long class request that
addresses the interface.

Signed-off-by: Daniel Mack <daniel@caiaq.de>
Cc: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-03-05 08:19:17 +01:00
Clemens Ladisch 29088fef3e ALSA: usb-audio: support multiple formats with audio class v2 devices
Change the parser to correctly handle v2 descriptors with multiple
format bits set.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-03-05 08:18:54 +01:00
Clemens Ladisch 015eb0b081 ALSA: usb-audio: use a format bitmask per alternate setting
In preparation for USB audio 2.0 support, change the audioformat
structure so that it uses a bitmask to specify possible formats.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-03-05 08:18:32 +01:00
Clemens Ladisch e11b4e0e4f ALSA: usb-audio: rename substream format field to altset_idx
The snd_usb_substream::format field actually contains the index of the
current alternate setting, so rename it to altset_idx to avoid
confusion.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-03-05 08:18:07 +01:00
Daniel Mack e5779998bf ALSA: usb-audio: refactor code
Clean up the usb audio driver by factoring out a lot of functions to
separate files. Code for procfs, quirks, urbs, format parsers etc all
got a new home now.

Moved almost all special quirk handling to quirks.c and introduced new
generic functions to handle them, so the exceptions do not pollute the
whole driver.

Renamed usbaudio.c to card.c because this is what it actually does now.
Renamed usbmidi.c to midi.c for namespace clarity.
Removed more things from usbaudio.h.

The non-standard drivers were adopted accordingly.

Signed-off-by: Daniel Mack <daniel@caiaq.de>
Cc: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-03-05 08:17:14 +01:00
Daniel Mack 3e1aebef6f ALSA: usb-audio: header file cleanups
Rename snd-usb-lib to snd-usbmidi-lib as MIDI functions are the only
thing it actually contains. Introduce a new header file to only declare
these functions.

Introduced usbmixer.h for all functions exported by usbmixer.c.

Signed-off-by: Daniel Mack <daniel@caiaq.de>
Cc: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-03-05 08:16:47 +01:00
Daniel Mack bc700ab140 ALSA: usb-audio: move ua101 driver
As part of the USB audio code cleanup, move the non-standard ua101
driver out of the way.

Signed-off-by: Daniel Mack <daniel@caiaq.de>
Cc: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-03-05 08:15:36 +01:00
Jaroslav Kysela e61e642c2a ALSA: usbaudio - remove debug "SAMPLE BYTES" printk line
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-03-03 22:40:04 +01:00
Arseniy Lartsev 864c11080c ALSA: usbaudio: Fix wrong bitrate for Creative Creative VF0470 Live Cam
This patch works around misbehaviour of Creative Creative VF0470 Live Cam
which reports 16 kHz sample rate for audio capture while actually producing
8 kHz stream.

Signed-off-by: Arseniy Lartsev <arseniy@fizlesh.ru>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-03-02 12:59:26 +01:00
Takashi Iwai 156366d315 Merge remote branch 'alsa/devel' into topic/misc
Conflicts:
	sound/usb/usbaudio.c
2010-03-02 11:27:46 +01:00
Clemens Ladisch 0a566ec256 ALSA: ua101: removing debugging code
Remove some code that is no longer needed now that the relevant parts of
the driver have been tested.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2010-03-02 11:25:43 +01:00
Andrea Gelmini 7f9320d415 ALSA: sound/usb/caiaq/midi.h: Checkpatch cleanup
sound/usb/caiaq/midi.h:6: ERROR: "foo* bar" should be "foo *bar"

Signed-off-by: Andrea Gelmini <andrea.gelmini@gelma.net>
Acked-by: Daniel Mack <daniel@caiaq.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-03-02 11:22:49 +01:00
Clemens Ladisch e584bc3cf6 ALSA: ua101: add Edirol UA-1000 support
Add support for the Edirol UA-1000 to the UA-101 driver.

Both devices behave the same, so we just have to shuffle around some
interface numbers and name strings.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2010-03-01 17:02:38 +01:00
Daniel Mack de48c7bc6f ALSA: usbaudio: consolidate header files
Use the definitions from linux/usb/audio.h all over the ALSA USB audio
driver and add some missing definitions there as well.

Use the endpoint attribute macros from linux/usb/ch9 and remove the own
things from sound/usb/usbaudio.h.

Now things are also nicely prefixed which makes understanding the code
easier.

Signed-off-by: Daniel Mack <daniel@caiaq.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-02-23 08:51:56 +01:00
Daniel Mack 7b8a043f26 ALSA: usbmixer: bail out early when parsing audio class v2 descriptors
This is just a quick hack that needs to be removed once the new units
defined by the audio class v2.0 standard are supported.

However, it allows using these devices for now, without mixer support.

Signed-off-by: Daniel Mack <daniel@caiaq.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-02-23 08:40:26 +01:00
Daniel Mack 53ee98fe8a ALSA: usbaudio: implement basic set of class v2.0 parser
This adds a number of parsers for audio class v2.0. In particular, the
following internals are different and now handled by the code:

* the number of streaming interfaces is now reported by an interface
  association descriptor. The old approach using a proprietary
  descriptor is deprecated.

* The number of channels per interface is now stored in the AS_GENERAL
  descriptor (used to be part of the FORMAT_TYPE descriptor).

* The list of supported sample rates is no longer stored in a variable
  length appendix of the format_type descriptor but is retrieved from
  the device using a class specific GET_RANGE command.

* Supported sample formats are now reported as 32bit bitmap rather than
  a fixed value. For now, this is worked around by choosing just one of
  them.

* A devices needs to have at least one CLOCK_SOURCE descriptor which
  denotes a clockID that is needed im the class request command.

* Many descriptors (format_type, ...) have changed their layout. Handle
  this by casting the descriptors to the appropriate structs.

Signed-off-by: Daniel Mack <daniel@caiaq.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-02-23 08:40:24 +01:00
Daniel Mack 8fee4aff8c ALSA: usbaudio: introduce new types for audio class v2
This patch adds some definitions for audio class v2.

Unfortunately, the UNIT types PROCESSING_UNIT and EXTENSION_UNIT have
different numerical representations in both standards, so there is need
for a _V1 add-on now. usbmixer.c is changed accordingly.

Signed-off-by: Daniel Mack <daniel@caiaq.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-02-23 08:40:20 +01:00
Daniel Mack 28e1b77308 ALSA: usbaudio: parse USB descriptors with structs
In preparation of support for v2.0 audio class, use the structs from
linux/usb/audio.h and add some new ones to describe the fields that are
actually parsed by the descriptor decoders.

Also, factor out code from usb_create_streams(). This makes it easier to
adopt the new iteration logic needed for v2.0.

Signed-off-by: Daniel Mack <daniel@caiaq.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-02-23 08:40:12 +01:00
Chris J Arges 40717382e0 ALSA: usbaudio Mbox support, output only
Signed-off-by: Chris J Arges <christopherarges@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-02-22 09:56:26 +01:00
Takashi Iwai 7fb3a069bc Merge branch 'fix/misc' into topic/misc
Conflicts:
	sound/pci/hda/patch_realtek.c
2010-02-17 14:24:46 +01:00
Takashi Iwai 9d3415a8cc Merge remote branch 'alsa/fixes' into fix/misc 2010-02-17 14:22:21 +01:00
Jaroslav Kysela 291186e049 ALSA: usbmixer - use MAX_ID_ELEMS where possible
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2010-02-16 12:00:45 +01:00
Jaroslav Kysela 7affdc17d4 ALSA: usbmixer - add usb_id value to usbmixer proc file
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2010-02-16 12:00:42 +01:00
Jaroslav Kysela ebfdeea3df ALSA: usbmixer - introduce /proc/asound/card#/usbmixer file
The usbmixer proc file contains mapping between ALSA control API and
USB mixer control units. The purpose of this file is for debugging
and a problem diagnostics.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2010-02-16 11:25:55 +01:00
Jaroslav Kysela b8f1f5983f Merge branch 'topic/misc' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6 into devel 2010-02-16 11:25:03 +01:00
Jaroslav Kysela ba9341dfef Merge branch 'fixes' into devel 2010-02-16 11:19:18 +01:00
Sebastien Alaiwan d39e82db73 ALSA: USB MIDI support for Access Music VirusTI
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>
2010-02-16 09:34:56 +01:00
Clemens Ladisch f167e1d073 ALSA: usb-audio: reduce MIDI packet size to work around broken firmware
Extend the list of devices whose firmware does not expect more than one
USB MIDI packet in one USB packet.

bug report: https://bugtrack.alsa-project.org/alsa-bug/view.php?id=3752

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Cc: <stable@kernel.org>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2010-02-16 08:08:01 +01:00
Takashi Iwai a540e13386 Merge remote branch 'alsa/devel' into topic/misc 2010-02-12 10:42:38 +01:00
Jaroslav Kysela c3a3e040f0 ALSA: usbmixer - add possibility to remap dB values
USB devices tends to represent dB ranges in different way than ALSA expects.
Add possibility to override these values and add guessed values for
SoundBlaster MP3+.

Also rename 'Capture Input Source' control to 'Capture Source' for
SoundBlaster MP3+ and Extigy.

Signed-off-by: Jaroslav Kysela <perex@perex.cz>
2010-02-11 18:00:16 +01:00
Takashi Iwai c32d977b81 ALSA: pcm - Call pgprot_noncached() for vmalloc'ed buffers
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>
2010-01-18 15:00:34 +01:00
John S. Gruber 52a7a58351 ALSA: usb-audio: use usbquirk.h for detection of HVR-950Q/850
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>
2009-12-28 12:30:57 +01:00
John S. Gruber 98e89f606c ALSA: usb-audio: relax urb data align. restriction HVR-950Q and HVR-850 only
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>
2009-12-28 12:30:41 +01:00
Clemens Ladisch adc8d31326 ALSA: usb-audio: make buffer pointer based on bytes instead on frames
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>
2009-12-28 12:29:46 +01:00
Sergiy Kovalchuk 7d2b451e65 ALSA: usb-audio - Added functionality for E-mu 0404USB/0202USB/TrackerPre
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>
2009-12-28 12:29:39 +01:00
Takashi Iwai 78b8d5d2ee ALSA: usb-audio - Avoid Oops after disconnect
As the release of substreams may be done asynchronously from the
disconnection, close callback needs to check the shutdown flag before
actually accessing the usb interface.

Reference: Novell bnc#505027
	http://bugzilla.novell.com/show_bug.cgi?id=565027

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-12-28 12:24:22 +01:00
Clemens Ladisch 5b4b2a41a1 sound: ua101: use vmalloc buffer helper functions
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>
2009-12-18 12:58:25 +01:00
Clemens Ladisch c55675e348 sound: usb-audio: use vmalloc buffer helper functions
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>
2009-12-18 12:58:14 +01:00
Takashi Iwai 14d44e2c2c Merge branch 'fix/misc' into topic/misc 2009-12-18 12:53:45 +01:00
Clemens Ladisch 3e85fd614c sound: sgio2audio/pdaudiocf/usb-audio: initialize PCM buffer
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>
2009-12-18 12:53:17 +01:00
Clemens Ladisch 63978ab3e3 sound: add Edirol UA-101 support
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>
2009-12-14 17:58:13 +01:00
Tobias Hansen 2b6f6c0d11 ALSA: snd-usb-us122l: add product IDs of US-122MKII and US-144MKII
I added the product IDs of the new revisions of the devices, so owners
can test whether this suffices to make them work. Patched against ALSA
snapshot 20091207.

Signed-off-by: Tobias Hansen <Tobias.Hansen at physik.uni-hamburg.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-12-08 12:56:50 +01:00
Alexey Fisher e0feefc70c ALSA: usb - Fix mixer map for Hercules Gamesurround Muse Pocket LT
Muse Pocket use brocken mixer names, so alsamixer and PA can't use it correctly
This patch add quirk to overwirte default mixers.

Signed-off-by: Alexey Fisher <bug-track@fisher-privat.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-12-01 16:00:08 +01:00
Takashi Iwai ef47bf386e Merge branch 'fix/misc' into topic/misc 2009-12-01 08:36:05 +01:00
Clemens Ladisch a014bbadb5 sound: usxxx: cleanup chip field
The chip field is no longer needed.  Move those of its fields that are
actually used to the device structure itself.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-11-24 10:20:09 +01:00
Clemens Ladisch d82af9f9aa sound: usb: make the USB MIDI module more independent
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>
2009-11-24 10:19:59 +01:00
Clemens Ladisch 96f61d9ade sound: usb-audio: allow switching altsetting on Roland USB MIDI devices
Add a mixer control to select between the two altsettings on Roland USB
MIDI devices where the input endpoint is either bulk or interrupt.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-11-24 10:19:49 +01:00
Akinobu Mita fbc543915f ALSA: sound: usbmidi: Use hweight16
Use hweight16 instead of Brian Kernighan's/Peter Wegner's method

Signed-off-by: Akinobu Mita <akinobu.mita@gmail.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-11-20 08:46:26 +01:00
Clemens Ladisch d867bba945 sound: usb-audio: add Roland UA-1G support
Add support for the Roland UA-1G audio interface.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-11-20 08:45:55 +01:00
Javier Kohen 0c3cee57ef ALSA: usb - Quirk to disable master volume control in PCM2702
Disable the master volume control in the PCM2702 chipset.

The datasheet documents two independent channel volume controls, one
master mute control and one master volume control. All controls are
fully functional except for the master volume control, which returns
USB stalls on all GET requests.

Signed-off-by: Javier Kohen <jkohen@users.sourceforge.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-11-17 15:49:26 +01:00
Takashi Iwai 0c3c35e148 Merge branch 'fix/misc' into topic/misc 2009-11-14 14:38:28 +01:00
Julian Anastasov f495088210 ALSA: usb-audio: fix combine_word problem
Fix combine_word problem where first octet is not
read properly. The only affected place seems to be the
INPUT_TERMINAL type. Before now, sound controls can be created
with the output terminal's name which is a fallback mechanism
used only for unknown input terminal types. For example,
Line can wrongly appear as Speaker. After the change it
should appear as Line.

	The side effect of this change can be that users
can expect the wrong control name in their scripts or
programs while now we return the correct one.

	Probably, these defines should use get_unaligned_le16 and
friends.

Signed-off-by: Julian Anastasov <ja@ssi.bg>
Cc: <stable@kernel.org>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-11-07 09:46:06 +01:00
Takashi Iwai e87a3dd33e Merge branch 'fix/misc' into topic/misc 2009-11-01 11:11:07 +01:00
Mark Hills 467cc16920 ALSA: snd-usb-caiaq: Bump version number to 1.3.20
Signed-off-by: Mark Hills <mark@pogo.org.uk>
Acked-by: Daniel Mack <daniel@caiaq.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-10-30 12:29:56 +01:00
Mark Hills ac9dd9d384 ALSA: snd-usb-caiaq: Lock on stream start/unpause
Fix a bug which can result in white noise from the driver after stream
start or unpause.

Signed-off-by: Mark Hills <mark@pogo.org.uk>
Acked-by: Daniel Mack <daniel@caiaq.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-10-30 12:29:42 +01:00
Mark Hills 3702b08228 ALSA: snd-usb-caiaq: Missing lock around use of buffer positions
Fix a race which causes snd_pcm_update_hw_ptr_pos() to report a bug.

Signed-off-by: Mark Hills <mark@pogo.org.uk>
Acked-by: Daniel Mack <daniel@caiaq.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-10-30 12:29:16 +01:00
Tobias Hansen a688e4885c ALSA: snd-usb-us122l: corrent error number for not probing US-144 on ehci-hcd
snd-usb-us122l: corrent error number for not probing US-144 on ehci-hcd
This is the correct error number for telling the USB system that this
driver is not for the device.

Signed-off-by: Tobias Hansen <Tobias.Hansen@physik.uni-hamburg.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-10-13 08:20:20 +02:00
Linus Torvalds f0a221ef47 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6
* 'for-linus' of ssh://master.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6: (21 commits)
  ALSA: usb - Use strlcat() correctly
  ALSA: Fix invalid __exit in sound/mips/*.c
  ALSA: hda - Fix / improve ALC66x parser
  ALSA: ctxfi: Swapped SURROUND-SIDE mute
  sound: Make keywest_driver static
  ALSA: intel8x0 - Mute External Amplifier by default for Sony VAIO VGN-B1VP
  ALSA: hda - Fix digita/analog mic auto-switching with IDT codecs
  ASoC: fix kconfig order of Blackfin drivers
  ALSA: hda - Added quirk to enable sound on Toshiba NB200
  ASoC: Fix dependency of CONFIG_SND_PXA2XX_SOC_IMOTE2
  ALSA: Don't assume i2c device probing always succeeds
  ALSA: intel8x0 - Mute External Amplifier by default for Sony VAIO VGN-T350P
  ALSA: echoaudio - Re-enable the line-out control for the Mia card
  ALSA: hda - Resurrect input-source mixer of ALC268 model=acer
  ALSA: hda - Analog Devices AD1984A add HP Touchsmart model
  ALSA: hda - Add HP Pavilion dv4t-1300 to MSI whitelist
  ALSA: hda - CD-audio sound for hda-intel conexant benq laptop
  ASoC: DaVinci: Correct McASP FIFO initialization
  ASoC: Davinci: Fix race with cpu_dai->dma_data
  ASoC: DaVinci: Fix divide by zero error during 1st execution
  ...
2009-10-03 11:25:30 -07:00
Takashi Iwai 08d1e63508 ALSA: usb - Use strlcat() correctly
Don't pass the advanced position to strlcat() but just gives the buffer
head position so that the max size limit can be checked correctly.
Introduced a new helper function to standaralize strlcat() calls.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-10-02 14:06:08 +02:00
Alexey Dobriyan f0f37e2f77 const: mark struct vm_struct_operations
* mark struct vm_area_struct::vm_ops as const
* mark vm_ops in AGP code

But leave TTM code alone, something is fishy there with global vm_ops
being used.

Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-09-27 11:39:25 -07:00
Tobias Hansen 4f272341c7 ALSA: snd-usb-us122l: add support for US-144
Adds support for US-144 when attached on USB1.1.
Unlike the US-122L it uses both USB interfaces 0 and 1.

Signed-off-by: Tobias Hansen <Tobias.Hansen@physik.uni-hamburg.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-09-22 17:47:47 +02:00
Takashi Iwai fd30afa454 Merge branch 'topic/usb-audio' into for-linus
* 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
2009-09-10 15:33:07 +02:00
Takashi Iwai b34c866394 Merge branch 'topic/tlv-minmax' into for-linus
* topic/tlv-minmax:
  ALSA: usb-audio - Correct bogus volume dB information
  ALSA: usb-audio - Use the new TLV_DB_MINMAX type
  ALSA: Add new TLV types for dBwith min/max
2009-09-10 15:33:06 +02:00
Takashi Iwai 6e5265ec34 ALSA: Re-export snd_pcm_format_name() function
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>
2009-09-08 14:26:51 +02:00
Takashi Iwai f1e6d3c5cf ALSA: usb-audio - Fix types taken in min()
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>
2009-08-11 08:16:15 +02:00
Clemens Ladisch 765e8db078 sound: usb-audio: do not make URBs longer than sync packet interval
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>
2009-08-10 13:13:56 +02:00
Takashi Iwai 57e4a5c4f8 Merge branch 'fix/usb-audio' into for-linus
* fix/usb-audio:
  ALSA: usb-audio - Volume control quirk for QuickCam E 3500
2009-07-26 11:07:08 +02:00
Daniel Mack b30c494773 ALSA: snd_usb_caiaq: add support for Audio2DJ
This adds support for Native Instrument's freshly announced Audio2DJ
sound device hardware. Version number bumped to 1.3.19.

Signed-off-by: Daniel Mack <daniel@caiaq.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-07-23 16:31:58 +02:00
Alexey Fisher 2cf313ee75 ALSA: usb-audio - Volume control quirk for QuickCam E 3500
- E3500 report cval->max more than it actually can handel, so if you
set 95% capture level it will be silently muted.
- Betwen cval->min and cval-max(real) is 2940 control units,
but real are only 7 with cval->res = 384.
- Alsa can't handel less than 10 controls, so make it more
and set cval->res = 192.

Signed-off-by: Alexey Fisher <bug-track@fisher-privat.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-07-22 15:52:15 +02:00
Clemens Ladisch a65dd997b3 sound: usb-audio: add MIDI drain callback
When draining, instead of waiting for fifty milliseconds, just wait for
the currently active URBs to complete.  This cuts the usual waiting time
down to one USB frame, or zero in the common case when there is no URB.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-07-15 11:56:41 +02:00
Clemens Ladisch ed4affa532 sound: usb-audio: use multiple output URBs
Some newer USB MIDI interfaces use rather small packet sizes, so to get
enough bandwidth, we have to be able to send multiple packets in one USB
frame, so we have to use multiple URBs.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-07-15 11:56:30 +02:00
Clemens Ladisch 4773d1fb8f sound: usb-audio: use multiple input URBs
Some newer USB MIDI interfaces use rather small packet sizes, so to get
enough bandwidth, we have to be able to receive multiple packets in one
USB frame, so we have to use multiple URBs.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-07-15 11:56:19 +02:00
Clemens Ladisch 468b8fde24 sound: usb-audio: Xonar U1 digital output support
Add support for the Asus Xonar U1.  This device is mostly class compliant, but
the digital output requires a vendor-specific request.

Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-07-15 11:55:25 +02:00
Clemens Ladisch 8886f33f25 sound: usb-audio: add workaround for Blue Microphones devices
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>
2009-07-15 11:55:00 +02:00
Joe Perches ad361c9884 Remove multiple KERN_ prefixes from printk formats
Commit 5fd29d6ccb ("printk: clean up
handling of log-levels and newlines") changed printk semantics.  printk
lines with multiple KERN_<level> prefixes are no longer emitted as
before the patch.

<level> is now included in the output on each additional use.

Remove all uses of multiple KERN_<level>s in formats.

Signed-off-by: Joe Perches <joe@perches.com>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-07-08 10:30:03 -07:00
Takashi Iwai 3f5d3465be ALSA: usx2y - reparent sound device
Fix the parent device to be the USB interface, not the USB device.
A similiar commit like 563c2bf59d.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-07-02 11:53:12 +02:00
Daniel Mack 563c2bf59d ALSA: snd_usb_caiaq: reparent sound device
The sound device instance needs to be a child of the USB interface, not
the USB device. Newer udev versions pay attention to that.

Signed-off-by: Daniel Mack <daniel@caiaq.de>
Reported-by: Lennart Poettering <lennart@poettering.net>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-07-02 10:58:33 +02:00
Linus Torvalds 413318444f Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6:
  ALSA: hda - Add model=6530g option
  ALSA: hda - Acer Inspire 6530G model for Realtek ALC888
  ALSA: snd_usb_caiaq: fix legacy input streaming
  ASoC: Kill BUS_ID_SIZE
  ALSA: HDA - Correct trivial typos in comments.
  ALSA: HDA - Name-fixes in code (tagra/targa)
  ALSA: HDA - Add pci-quirk for MSI MS-7350 motherboard.
  ALSA: hda - Fix memory leak at codec creation
2009-06-21 13:13:08 -07:00
Takashi Iwai 0b6306f69f Merge branch 'topic/caiaq' into for-linus
* topic/caiaq:
  ALSA: snd_usb_caiaq: fix legacy input streaming
2009-06-21 10:59:10 +02:00
Daniel Mack 0a842c8b60 ALSA: snd_usb_caiaq: fix legacy input streaming
Seems that nobody recently tried the input on the very first supported
sound card model, RK2. This patch fixes the byte offset to make it
running again.

Signed-off-by: Daniel Mack <daniel@caiaq.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-06-17 17:50:27 +02:00
Takashi Iwai eedbdf03a2 ALSA: usb-audio - Correct bogus volume dB information
Some USB devices give bogus dB information and it screws up PA.
It's better to detect a broken value and correct it in the driver
before exposing the value to the outside.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-06-17 10:57:02 +02:00
Takashi Iwai b8e1c73f46 ALSA: usb-audio - Use the new TLV_DB_MINMAX type
Use the new TLV_DB_MINMAX type instead of TLV_DB_SCALE.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-06-17 10:57:01 +02:00
Linus Torvalds 661adc423d Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6:
  ALSA: ctxfi - Fix deadlock with xfi-timer
  ALSA: intel8x0 - Fix PCM position craziness
  ALSA: usb-audio - rework quirk for TerraTec Aureon USB 5.1 MkII
  ASoC: magician: fix PXA SSP clock polarity
  ASoC: Instantiate any forgotten DAPM widgets
  ASoC: Revert duplicated code in SSM2602 driver
  ALSA: hda - Add quirk for Acer Aspire 6935G
  ALSA: ctxfi - Replace atc lock to mutex
  ASoC: Remove odd bit clock ratios for WM8903
2009-06-16 12:10:31 -07:00
Takashi Iwai 3b13b5ce8c Merge branch 'topic/usb-audio' into for-linus
* topic/usb-audio:
  ALSA: usb-audio - rework quirk for TerraTec Aureon USB 5.1 MkII
2009-06-16 17:38:50 +02:00
Andrea Borgia d9e89bf0c0 ALSA: usb-audio - rework quirk for TerraTec Aureon USB 5.1 MkII
This patch changes yet again the ID for the TTA cards, resulting in a
more reasonable name:
 1 [Aureon51MkII   ]: USB-Audio - Aureon5.1MkII
    TerraTec Aureon5.1MkII at usb-0000:00:03.0-2, full speed

Signed-off-by: Andrea Borgia <andrea@borgia.bo.it>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-06-15 08:09:57 +02:00
Linus Torvalds 489f7ab6c1 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/jikos/trivial: (31 commits)
  trivial: remove the trivial patch monkey's name from SubmittingPatches
  trivial: Fix a typo in comment of addrconf_dad_start()
  trivial: usb: fix missing space typo in doc
  trivial: pci hotplug: adding __init/__exit macros to sgi_hotplug
  trivial: Remove the hyphen from git commands
  trivial: fix ETIMEOUT -> ETIMEDOUT typos
  trivial: Kconfig: .ko is normally not included in module names
  trivial: SubmittingPatches: fix typo
  trivial: Documentation/dell_rbu.txt: fix typos
  trivial: Fix Pavel's address in MAINTAINERS
  trivial: ftrace:fix description of trace directory
  trivial: unnecessary (void*) cast removal in sound/oss/msnd.c
  trivial: input/misc: Fix typo in Kconfig
  trivial: fix grammo in bus_for_each_dev() kerneldoc
  trivial: rbtree.txt: fix rb_entry() parameters in sample code
  trivial: spelling fix in ppc code comments
  trivial: fix typo in bio_alloc kernel doc
  trivial: Documentation/rbtree.txt: cleanup kerneldoc of rbtree.txt
  trivial: Miscellaneous documentation typo fixes
  trivial: fix typo milisecond/millisecond for documentation and source comments.
  ...
2009-06-14 13:46:25 -07:00
Takashi Iwai 80986be486 Merge branch 'topic/caiaq' into for-linus
* topic/caiaq:
  ALSA: snd_usb_caiaq: set mixername
2009-06-12 20:03:06 +02:00
Viral Mehta cf3f9130f4 trivial: remove extra space
Just for the sake of readability, removing extra space

Signed-off-by: Viral Mehta <viral.mehta@einfochips.com>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2009-06-12 18:01:45 +02:00
Daniel Mack 955f2d9665 ALSA: snd_usb_caiaq: set mixername
alsamixer and friends want the mixername to be set. Even though the
driver does not exports a real mixer device, export the name doesn't
harm.

Signed-off-by: Daniel Mack <daniel@caiaq.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-06-11 03:02:31 +02:00
Takashi Iwai 85e013a18a Merge branch 'topic/usb-audio' into for-linus
* 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
2009-06-10 07:26:49 +02:00
Takashi Iwai eabaf0634a Merge branch 'topic/pcm-delay' into for-linus
* topic/pcm-delay:
  ALSA: usbaudio - Add delay account
  ALSA: Add extra delay count in PCM
2009-06-10 07:26:40 +02:00
Dan Allongo 92a43793a9 ALSA: usb - Add boot quirk for C-Media 6206 USB Audio
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>
2009-06-08 19:08:42 +02:00
Andrea Borgia ca85b6ba59 ALSA: usb-audio - errata corrige for quirk
Cut'n'paste mistake, whose likely result was nothing at all.
Correct version is "USB_DEVICE", not "USB_DEVICE_VENDOR_SPEC".

Signed-off-by: Andrea Borgia <andrea@borgia.bo.it>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-06-03 08:05:32 +02:00
Daniel Mack c6e24d4db8 ALSA: snd_usb_caiaq: bump version number
Signed-off-by: Daniel Mack <daniel@caiaq.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-06-02 14:03:58 +02:00
Daniel Mack bafeee5b1f ALSA: snd_usb_caiaq: give better shortname
If not passed as module option, provide an own card ID with the newly
introduced snd_set_card_id() call.

This will prevent ALSA from calling choose_default_name() which only
takes the last part of a name containing whitespaces. This for example
caused 'Audio 4 DJ' to be shortened to 'DJ', which was not very
descriptive.

The implementation now takes the short name and removes all whitespaces
from it which is much nicer.

Signed-off-by: Daniel Mack <daniel@caiaq.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-06-02 12:55:59 +02:00
Daniel Mack 1a1df6f043 ALSA: snd_usb_caiaq: give better longname
The serial number is of no interest in the longname, remove it. This
gives space for the usb path information which is more informative.

Signed-off-by: Daniel Mack <daniel@caiaq.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-06-02 09:47:33 +02:00
Daniel Mack d3873a1be9 ALSA: snd_usb_caiaq: use strlcpy
Signed-off-by: Daniel Mack <daniel@caiaq.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-06-02 09:41:16 +02:00
Daniel Mack 9318dce503 ALSA: snd_usb_caiaq: clean whitespaces
Cosmetic changes only, no code change.

Signed-off-by: Daniel Mack <daniel@caiaq.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-06-02 09:39:29 +02:00
Takashi Iwai 6efd2cd5e8 ALSA: usb-audio - Add quirk for Roland/Edirol M-16DX
Added a half-working quirk for Roland/Edirol M-16DX.
This enables the capture on the device but the playback on it seems still
problematic becuase of lack of sync with the capture clock.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-06-01 10:59:51 +02:00
Andrea Borgia 93bfd01227 ALSA: usb-audio - quirk for USB Aureon cards
Add quirk to provide proper naming of the Terratec Aureon 5.1 MkII
USB card.

Signed-off-by: Andrea Borgia <andrea@borgia.bo.it>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-06-01 10:48:54 +02:00
Clemens Ladisch 55de5ef970 sound: usb-audio: make the MotU Fastlane work again
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>
2009-05-27 11:25:33 +02:00
Takashi Iwai ae1ec5e1e9 ALSA: usbaudio - Add delay account
Manage the PCM delay account based on the queued URBs.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-05-05 14:47:21 +02:00
Takashi Iwai 2008f137e9 ALSA: Add missing SNDRV_PCM_INFO_BATCH flag to some drivers
Added SNDRV_PCM_INFO_BATCH flag to PCM info field of some drivers that
really don't give the precise pointer value.

Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-04-28 15:06:44 +02:00
Takashi Iwai 5530f41bd2 Merge branch 'fix/caiaq' into for-linus
* fix/caiaq:
  ALSA: snd-usb-caiaq: fix reported elapsed periods
2009-04-27 17:15:41 +02:00
Daniel Mack a9b487fa1e ALSA: snd-usb-caiaq: fix reported elapsed periods
Reset the internal period position counter upon stream startup. This
fixes initial aplay underruns and problems related to latency picky
applications such as pulseaudio.

Bumped the version number to 1.3.14.

Signed-off-by: Daniel Mack <daniel@caiaq.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-04-27 12:32:52 +02:00
Takashi Iwai a7b554ad7e Merge branch 'fix/usx2y' into for-linus
* fix/usx2y:
  ALSA: us122l: add snd_us122l_free()
  ALSA: us122l: Fix signedness in comparisions
2009-04-21 07:43:10 +02:00
Karsten Wiese 5d4af1be06 ALSA: us122l: add snd_us122l_free()
Use it to clean up snd_us122l_card_used[].

Without patch unplugging of an US122L soundcard didn't reset the
corresponding element of snd_us122l_card_used[] to 0.
The (SNDRV_CARDS + 1)th plugging in did not result in creating the soundcard
device anymore.
Index values supplied with the modprobe command line were not used correctly
anymore after the first unplugging of an US122L.

Signed-off-by: Karsten Wiese <fzu@wemgehoertderstaat.de>
Cc: stable@kernel.org
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-04-20 13:39:38 +02:00
Karsten Wiese f600f6c482 ALSA: us122l: Fix signedness in comparisions
Within 2.6.30's mergewindow, struct urb's transfer_buffer_length has become
unsigned. This changed an "int > int" comparision to an "unsigned > int" one
in snd_usb_122l.
Fix this by using a local int variable instead of urb->transfer_buffer_length
in comparisions.

Shorten playback_prep_freqn() a bit and tweak error-paths in
usb_stream_prepare_playback().

Signed-off-by: Karsten Wiese <fzu@wemgehoertderstaat.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-04-17 15:24:07 +02:00
Takashi Iwai f4723b224d Merge branch 'topic/memdup_user' into for-linus
* topic/memdup_user:
  ALSA: sound/pci: use memdup_user()
  ALSA: sound/usb: use memdup_user()
  ALSA: sound/isa: use memdup_user()
  ALSA: sound/core: use memdup_user()
2009-04-15 11:24:27 +02:00
Daniel Mack 936e7d0339 ALSA: snd-usb-caiaq: rename files to remove redundant information in file pathes
Cleanup only, no functional change.

Signed-off-by: Daniel Mack <daniel@caiaq.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-04-14 13:31:17 +02:00
Daniel Mack e431cf4568 ALSA: snd-usb-caiaq: clean up header includes
Signed-off-by: Daniel Mack <daniel@caiaq.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-04-14 13:29:57 +02:00
Li Zefan 85385c1551 ALSA: sound/usb: use memdup_user()
Remove open-coded memdup_user().

Signed-off-by: Li Zefan <lizf@cn.fujitsu.com>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2009-04-14 12:39:39 +02:00
Clemens Ladisch a7d9c0990d sound: usb-audio: allow period sizes less than 1 ms
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>
2009-04-07 04:11:28 +02:00
Clemens Ladisch 744b89e542 sound: usb-audio: save data packet interval in audioformat structure
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>
2009-04-07 04:11:24 +02:00