aboutsummaryrefslogtreecommitdiffstats
path: root/sound/usb (follow)
AgeCommit message (Collapse)AuthorFilesLines
2011-02-23ALSA: usb-audio: fix oops due to cleanup race when disconnectingTakashi Iwai3-2/+10
When a USB audio device is disconnected, snd_usb_audio_disconnect() kills all audio URBs. At the same time, the application, after being notified of the disconnection, might close the device, in which case ALSA calls the .hw_free callback, which should free the URBs too. Commit de1b8b93a0ba "[ALSA] Fix hang-up at disconnection of usb-audio" prevented snd_usb_hw_free() from freeing the URBs to avoid a hang that resulted from this race, but this introduced another race because the URB callbacks could now be executed after snd_usb_hw_free() has returned, and try to access already freed data. Fix the first race by introducing a mutex to serialize the disconnect callback and all PCM callbacks that manage URBs (hw_free and hw_params). Reported-and-tested-by: Pierre-Louis Bossart <pierre-louis.bossart@intel.com> Cc: <stable@kernel.org> [CL: also serialize hw_params callback] Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-02-14ALSA: caiaq - Fix possible string-buffer overflowTakashi Iwai2-2/+2
Use strlcpy() to assure not to overflow the string array sizes by too long USB device name string. Reported-by: Rafa <rafa@mwrinfosecurity.com> Cc: stable <stable@kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-02-08ALSA: usbaudio - Enable the E-MU 0204 USBJoseph Teichman3-3/+11
Signed-off-by: Joseph Teichman <josteich@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-01-11ALSA: snd-usb-us122l: Fix missing NULL checksKarsten Wiese1-21/+20
Fix missing NULL checks in usb_stream_hwdep_poll() and usb_stream_hwdep_ioctl(). Wake up poll waiters before returning from usb_stream_hwdep_ioctl(). Signed-off-by: Karsten Wiese <fzu@wemgehoertderstaat.de> Cc: stable@kernel.org Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-01-11ALSA: snd-usb-us122l: Fix MIDI outputKarsten Wiese1-2/+9
The US-122L always reads 9 bytes per urb unless they are set to 0xFD. Signed-off-by: Karsten Wiese <fzu@wemgehoertderstaat.de> Cc: stable@kernel.org Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-01-10ALSA: usb-audio: add Edirol SD-90 PCM supportClemens Ladisch2-3/+6
Add support for the 24-bit audio I/Os of the Edirol SD-90 interface. Reported-any-tested-by: Jim Grusendorf <alsa-user@grusendorf.ca> Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2011-01-10ALSA: usb-audio: use enum control info helperClemens Ladisch2-16/+3
Simplify info callbacks by using the snd_ctl_enum_info() helper function. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-11-02ALSA: usb-audio - Support for Power/Status LED on Creative USB X-Fi S51Mandar Joshi1-2/+13
This patch adds support for Power/Status LED on Creative USB X-Fi S51. There is just one LED on the device. The LED can either be On or it can be set to Blink. There doesn't seem to be a way to switch it off. The control message to change LED status is similar to that of audigy2nx except that the index is to be set to 0 and value is 1 for Blink and 0 for On. The 'Power LED' control in alsamixer when muted will cause the LED to Blink continuously. When unmuted the LED will stay On. The Creative driver under Windows sets the LED to blink whenever audio is muted. This LED can be treated as the CMSS LED but I figured since there is just one LED, it should be treated as the Power LED. Is that alright? I've also changed the comment "Usb X-Fi" to "Usb X-Fi S51" as there are other external X-Fi devices from Creative like Usb X-Fi Go and Xmod. The volume knob and LED support patch doesn't apply to them. Signed-off-by: Mandar Joshi <emailmandar@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-11-01ALSA: usb - driver neglects kmalloc return value check and may deref NULLJesper Juhl1-1/+3
sound/usb/pcm.c::snd_usb_pcm_check_knot() fails to check the return value from kmalloc() and may end up dereferencing a null pointer. The patch below (compile tested only) should take care of that little problem. Signed-off-by: Jesper Juhl <jj@chaosbits.net> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-10-27ALSA: usb-audio: automatically detect feedback formatClemens Ladisch4-112/+67
There are two USB Audio Class specifications (v1 and v2), but neither of them clearly defines the feedback format for high-speed UAC v1 devices. Add to this whatever the Creative and M-Audio firmware writers have been smoking, and it becomes impossible to predict the exact feedback format used by a particular device. Therefore, automatically detect the feedback format by looking at the magnitude of the first received feedback value. Also, this allows us to get rid of some special cases for E-Mu devices. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-10-24ALSA: usb - Creative USB X-Fi volume knob supportMandar Joshi1-0/+1
Adds an entry for Creative USB X-Fi to the rc_config array in mixer_quirks.c to allow use of volume knob on the device. The action of the volume knob is received by lirc when its using the alsa_usb driver. Signed-off-by: Mandar Joshi <emailmandar@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-10-22ALSA: usb-audio: add Novation Launchpad supportClemens Ladisch4-6/+16
Add a quirk entry for the Novation Launchpad USB MIDI controller. QUIRK_MIDI_FASTLANE gets renamed to *_RAW_BYTES because this quirk type is now shared by different devices. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Tested-by: Jakob Flierl <jakob.flierl@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-10-17sound: fixed typosAndrea Gelmini1-2/+2
Signed-off-by: Andrea Gelmini <andrea.gelmini@gelma.net> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-10-11ALSA: sound/usb/usx2y: simplify conditionalNicolas Kaiser1-1/+1
Simplify conditional: (a || (!a && b)) => (a || b) Signed-off-by: Nicolas Kaiser <nikai@nikai.net> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-10-05ALSA: usb-audio: add more Yamaha USB MIDI devicesClemens Ladisch1-0/+12
Add quirks for more devices (according to driver V.3.0.4-2). Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-09-16ALSA: usb/mixer: remove bogus castDan Carpenter1-2/+3
"uinfo->value.enumerated.item" is an unsigned int. If it's negative when we do the comparison: if ((int)uinfo->value.enumerated.item >= cval->max) then we would read past the end of the array on the next line. I also changed the strcpy() to strlcpy() out of paranoia. Signed-off-by: Dan Carpenter <error27@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-09-16ALSA: usb-audio - Fix an unused-variable compile warningTakashi Iwai1-3/+1
Used only when CONFIG_SND_DEBUG=y sound/usb/mixer.c: In function 'get_min_max': sound/usb/mixer.c:762: warning: unused variable 'chip' Reported-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-09-10ALSA: snd-usb-caiaq: Add support for Traktor Kontrol S4Daniel Mack6-49/+598
This patch adds support for the new Traktor Kontrol S4 by Native Instruments. It features a new audio data streaming model, MIDI in and out ports, a huge number of 174 dimmable LEDs, 96 buttons and 46 absolute encoder axis, including some rotary encoders. All features are supported by the driver now. Did some code refactoring along the way. Signed-off-by: Daniel Mack <daniel@caiaq.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-09-10ALSA: snd-usb-caiaq: drop version numberDaniel Mack1-1/+1
Let git do the job. Signed-off-by: Daniel Mack <daniel@caiaq.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-09-09Merge branch 'fix/misc' into topic/miscTakashi Iwai1-1/+1
2010-09-08ALSA: usb - Release capture substream URBs properlyTakashi Iwai1-1/+1
Due to the wrong "return" in the loop, a capture substream won't be released at disconnection properly if the device is capture only and has no playback substream. This caused Oops occasionally at the device reconnection. Reported-by: Kim Minhyoung <minhyoung.kim@lge.com> Cc: <stable@kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-09-03Merge branch 'fix/misc' into topic/miscTakashi Iwai6-27/+39
2010-09-03ALSA: usb-audio: fix detection of vendor-specific device protocol settingsClemens Ladisch6-26/+32
The Audio Class v2 support code in 2.6.35 added checks for the bInterfaceProtocol field. However, there are devices (usually those detected by vendor-specific quirks) that do not have one of the predefined values in this field, which made the driver reject them. To fix this regression, restore the old behaviour, i.e., assume that a device with an unknown bInterfaceProtocol field (other than UAC_VERSION_2) has more or less UAC-v1-compatible descriptors. [compile warning fixes by tiwai] Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Cc: Daniel Mack <daniel@caiaq.de> Cc: <stable@kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-09-03ALSA: usb-audio: add BOSS ME-25 supportClemens Ladisch1-0/+30
Add a quirk to make the BOSS ME-25 work. Many thanks to Kees van Veen. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-09-03ALSA: usb-audio: add Roland A-PRO supportClemens Ladisch1-0/+14
Add a quirk for the Roland/Cakewalk A-300PRO/A-500PRO/A-800PRO keyboards. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-09-03ALSA: usb-audio: add Edirol PCR-1 PCM supportClemens Ladisch1-2/+25
Add a quirk for the other logical device of the PCR-1 so that not only the MIDI interface but also the audio interface works. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-09-02ALSA: usb-audio: Assume first control interface is for audioDaniel Mack1-1/+7
For devices with more than one control interface, let's assume the first one contains the audio controls. Unfortunately, there is no field in any of the descriptors to tell us whether a control interface is for audio or MIDI controls, so a better check is not easy to implement. On a composite device with audio and MIDI functions, for example, the code currently overwrites chip->ctrl_intf, causing operations on the control interface to fail if they are issued after the device probe. Signed-off-by: Daniel Mack <daniel@caiaq.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-09-02ALSA: usb-audio: fix Fast Track Ultra (8R) 44.1 sample ratesClemens Ladisch2-7/+85
The M-Audio Fast Track Ultra series devices did not play sound correctly at 44.1/88.2 kHz. Changing the output endpoint attribute to adaptive fixes this. Signed-off-by: Felix Homann <fexpop@web.de> Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-08-18Merge branch 'fix/misc' into topic/miscTakashi Iwai1-0/+8
2010-08-18Merge branch 'topic/isa' into topic/miscTakashi Iwai1-1/+1
2010-08-15Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6Linus Torvalds1-0/+8
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6: ALSA: sound/usb/format: silence uninitialized variable warnings MAINTAINERS: Add Ian Lartey as comaintaner for Wolfson devices MAINTAINERS: Make Wolfson entry also cover CODEC drivers ASoC: Only tweak WM8994 chip configuration on devices up to rev D ASoC: Optimise DSP performance for WM8994 ALSA: hda - Fix dynamic ADC change working again ALSA: hda - Restrict PCM parameters per ELD information over HDMI sound: oss: sh_dac_audio.c removed duplicated #include
2010-08-15ALSA: sound/usb/format: silence uninitialized variable warningsDan Carpenter1-0/+8
Gcc complains that ret might be used uninitialized: sound/usb/format.c: In function ‘snd_usb_parse_audio_format’: sound/usb/format.c:354: warning: ‘ret’ may be used uninitialized in this function sound/usb/format.c:354: note: ‘ret’ was declared here sound/usb/format.c:414: warning: ‘ret’ may be used uninitialized in this function sound/usb/format.c:414: note: ‘ret’ was declared here I suppose it could be uninitialized if there is ever a UAC_VERSION_3 released. Anyway this patch is worthwhile if only to silence the gcc warning. Signed-off-by: Dan Carpenter <error27@gmail.com> Acked-by: Daniel Mack <daniel@caiaq.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-08-14ALSA: usb: USB3 SuperSpeed sound supportPaul Zimmerman6-19/+46
This is V2 of the patch, after feedback from Clemens and Daniel. This patch adds SuperSpeed support to the USB drivers under sound/. It adds tests for USB_SPEED_SUPER to the appropriate places that check for the USB speed. This patch has been tested with our SS USB3 device emulating a set of Yamaha speakers and a Logitech microphone, but with the descriptors modified to add USB3 support. It has also been tested with the real speakers and microphone, to make sure that USB2 devices still work. Signed-off-by: Paul Zimmerman <paulz@synopsys.com> Cc: Clemens Ladisch <clemens@ladisch.de> Cc: Daniel Mack <daniel@caiaq.de> Cc: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-08-07Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6Linus Torvalds11-99/+106
* 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6: (214 commits) ALSA: hda - Add pin-fix for HP dc5750 ALSA: als4000: Fix potentially invalid DMA mode setup ALSA: als4000: enable burst mode ALSA: hda - Fix initial capsrc selection in patch_alc269() ASoC: TWL4030: Capture route runtime DAPM ordering fix ALSA: hda - Add PC-beep whitelist for an Intel board ALSA: hda - More relax for pending period handling ALSA: hda - Define AC_FMT_* constants ALSA: hda - Fix beep frequency on IDT 92HD73xx and 92HD71Bxx codecs ALSA: hda - Add support for HDMI HBR passthrough ALSA: hda - Set Stream Type in Stream Format according to AES0 ALSA: hda - Fix Thinkpad X300 so SPDIF is not exposed ALSA: hda - FIX to not expose SPDIF on Thinkpad X301, since it does not have the ability to use SPDIF ASoC: wm9081: fix resource reclaim in wm9081_register error path ASoC: wm8978: fix a memory leak if a wm8978_register fail ASoC: wm8974: fix a memory leak if another WM8974 is registered ASoC: wm8961: fix resource reclaim in wm8961_register error path ASoC: wm8955: fix resource reclaim in wm8955_register error path ASoC: wm8940: fix a memory leak if wm8940_register return error ASoC: wm8904: fix resource reclaim in wm8904_register error path ...
2010-08-04Merge branch 'master' into for-nextJiri Kosina5-29/+124
2010-08-02ALSA: usb - Correct audio problem for Hauppage HVR-850 and others rel. to urb data alignJohn S Gruber1-8/+22
Match usb ids in usb/quirks-table.h for some Hauppage HVR-950Q models and for the HVR850 model to those ids at the end of au0828-cards.c Thanks to nhJm449 for pointing out the problem. Signed-off-by: John S Gruber <JohnSGruber@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-07-12fix comnment/printk typos concerning "empty"Uwe Kleine-König1-1/+1
Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2010-07-09ALSA: usb-audio: silence a superfluous warningClemens Ladisch1-4/+1
It is not advisable to print a warning when a device does not support setting the sample rate because this is perfectly valid for devices with a single rate or where rates are implicitly changed by selecting another alternate setting. Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-06-24ALSA: usb - Fix compile error with CONFIG_SND_DEBUG_VERBOSE=yTakashi Iwai1-1/+1
Replaced the forgotten cval->mixer->ctrlif. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-06-23ALSA: usb-audio: simplify control interface accessDaniel Mack8-44/+34
As the control interface is now carried in struct snd_usb_audio, we can simplify the API a little and also drop the private ctrlif field from struct usb_mixer_interface. Also remove a left-over function prototype in pcm.h. Signed-off-by: Daniel Mack <daniel@caiaq.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-06-23ALSA: usb-audio: move and add some commentsDaniel Mack2-10/+30
Also add a list of open topics. Signed-off-by: Daniel Mack <daniel@caiaq.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-06-23ALSA: usb-midi: whitespace fixesDaniel Mack1-7/+7
Signed-off-by: Daniel Mack <daniel@caiaq.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-06-23ALSA: usb-audio: unify UAC macros and struct namesDaniel Mack3-10/+10
Get rid of the last occurances of _v1 suffixes, and move the version number right after the "uac" string. Now things are consitent again. Sorry for the forth and back, but it just looks much nicer this way. Signed-off-by: Daniel Mack <daniel@caiaq.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-06-23ALSA: usb-audio: clean up includes in clock.cDaniel Mack1-15/+1
Signed-off-by: Daniel Mack <daniel@caiaq.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-06-23ALSA: usb-audio - Add volume resolution quirk for some Logitech webcamsAlexey Fisher1-0/+13
Some programs like Skype trying to set capture volume automatically. Normally it will tray, carefully step by step lover or higher, set the volume. In real word it work not really well, because devises and vendors lie about real audio settings. For example most Logitech webcams have 6400 or 3500 steps for capture volume. They do not tell that actual resolution is 384. So we have only 7 or 18 real steps. In this patch I set real resolution only for tested devices. Signed-off-by: Alexey Fisher <bug-track@fisher-privat.net> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-06-21ALSA: usb/endpoint, fix dangling pointer useJiri Slaby1-0/+1
Stanse found that in snd_usb_parse_audio_endpoints, there is a dangling pointer dereference. When snd_usb_parse_audio_format fails, fp is freed, and continue invoked. On the next loop, there is "fp && fp->altsetting == 1 && fp->channels == 1" test, but fp is set from the last iteration (but is bogus) and thus ilegally dereferenced. Set fp to NULL before "continue". Signed-off-by: Jiri Slaby <jslaby@suse.cz> Acked-by: Daniel Mack <daniel@caiaq.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-06-11ALSA: usb-audio: fix UAC2 control value queriesDaniel Mack1-5/+14
For RANGE requests, we should only query as much bytes as we're in fact interested in. For CUR requests, we shouldn't confuse the firmware with an overlong request but just ask for 2 bytes. This might need fixing in the future as it's not entirely clear when to dispatch 1-byte, 2-byte and 4-byte request blocks. For now, we assume everything is coded in 16bit - this works for all firmware implementations I've seen. Signed-off-by: Daniel Mack <daniel@caiaq.de> Reported-by: Alex Lee <alexlee188@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-06-11ALSA: usb-audio: parse UAC2 sample rate ranges correctlyDaniel Mack1-18/+74
A device may report its supported sample rates in ranges rather than in discrete triplets. The code used to only parse the MIN field instead of properly paying attention to the MAX and RES values. Also, handle RES values of 1 correctly and announce a continous sample rate range in this case. Signed-off-by: Daniel Mack <daniel@caiaq.de> Reported-by: Alex Lee <alexlee188@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-06-11ALSA: usb-audio: fix control messages for USB_RECIP_INTERFACEDaniel Mack3-6/+16
Control messages directed to an interface must have the interface number set in the lower 8 bits of wIndex. This wasn't done correctly for some clock and mixer messages. Signed-off-by: Daniel Mack <daniel@caiaq.de> Reported-by: Alex Lee <alexlee188@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2010-06-11ALSA: usb-audio: add check for faulty clock in parse_audio_format_rates_v2()Daniel Mack1-0/+6
Signed-off-by: Daniel Mack <daniel@caiaq.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>