summaryrefslogtreecommitdiffstats
path: root/sound/usb
Commit message (Collapse)AuthorAgeFilesLines
* ALSA: 6fire: use NULL instead of 0 for pointer assignmentDaniel Mack2012-06-181-1/+1
| | | | | | Signed-off-by: Daniel Mack <zonque@gmail.com> Cc: Torsten Schenk <torsten.schenk@zoho.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: snd-usb: make snd_usb_substream_capture_trigger staticDaniel Mack2012-06-181-1/+2
| | | | | Signed-off-by: Daniel Mack <zonque@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: snd-usb: fix sync pipe checkDaniel Mack2012-06-181-7/+11
| | | | | | | | | | | Fix a bogus sanity check for sync pipe in pcm.c. This flaw was introduced during the streaming logic refactorization. While at it, improve the error messages that are generated in such cases. Signed-off-by: Daniel Mack <zonque@gmail.com> Reported-and-tested-by: <ben@b1c1l1.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: usb-audio: Fix substream assignmentsTakashi Iwai2012-06-082-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In 3.5 kernel, the endpoint is assigned dynamically for the substreams, but the PCM assignment still checks the presence of the endpoint pointer. This ended up in duplicated PCM substream creations at probing time, resulting in kernel warnings like: WARNING: at fs/proc/generic.c:586 proc_register+0x169/0x1a6() Pid: 1152, comm: modprobe Not tainted 3.5.0-rc1-00110-g71fae7e #2 Call Trace: [<ffffffff8102a400>] warn_slowpath_common+0x83/0x9c [<ffffffff8102a4bc>] warn_slowpath_fmt+0x46/0x48 [<ffffffff813829ad>] ? add_preempt_count+0x39/0x3b [<ffffffff811292f0>] proc_register+0x169/0x1a6 [<ffffffff8112962e>] create_proc_entry+0x74/0x8c [<ffffffffa018eb63>] snd_info_register+0x3e/0xc3 [snd] [<ffffffffa01fde2e>] snd_pcm_new_stream+0xb1/0x404 [snd_pcm] [<ffffffffa024861f>] snd_usb_add_audio_stream+0xd2/0x230 [snd_usb_audio] [<ffffffffa0241d33>] ? snd_usb_parse_audio_format+0x252/0x34f [snd_usb_audio] [<ffffffff810d6b17>] ? kmem_cache_alloc_trace+0xab/0xbb [<ffffffffa0248c29>] snd_usb_parse_audio_interface+0x4ac/0x567 [snd_usb_audio] [<ffffffffa023f0ff>] snd_usb_create_stream+0xe9/0x125 [snd_usb_audio] [<ffffffffa023f9b1>] usb_audio_probe+0x62a/0x72c [snd_usb_audio] ..... This patch fixes the regression by checking the fixed endpoint number for each substream instead of the endpoint pointer. Reported-and-tested-by: Jamie Heilman <jamie@audible.transient.net> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: usb-audio: fix rate_list memory leakClemens Ladisch2012-05-311-0/+3
| | | | | | | | | | The array of sample rates is reallocated every time when opening the PCM device, but was freed only once when unplugging the device. Reported-by: "Alexander E. Patrakov" <patrakov@gmail.com> Cc: <stable@vger.kernel.org> Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: snd-usb: fix stream info output in /procDaniel Mack2012-05-211-0/+12
| | | | | | | | | Set some substream struct members to make the proc interface code work again. Signed-off-by: Daniel Mack <zonque@gmail.com> Reported-by: Felix Homann <linuxaudio@showlabor.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: usb-audio - Call get_min_max_*() after determining the name stringTakashi Iwai2012-05-151-13/+13
| | | | | | | | | get_min_max_with_quirks() must be called after the control id name string is determined, but the current code changes the id name string after calling the function. Reported-by: Christian Melki <christian.melki@ericsson.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: usb-audio: Fix commentMark Hills2012-05-111-10/+2
| | | | | | | | | | | Explained by Takashi in <s5hfwbtmz0q.wl%tiwai@suse.de> > The reason is because get_min_max*() isn't called in the place you > created these controls, and get_min_max() would be called only for > integer volumes later even if uninitialized. A short cut for booleans. Signed-off-by: Mark Hills <mark@pogo.org.uk> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: snd-usb: fix some typos in endpoint.c documentationDaniel Mack2012-04-241-25/+33
| | | | | | | Also be more specific about some details while at it. Signed-off-by: Daniel Mack <zonque@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: usb-audio: sound/usb/endpoint.c: suppress warningAndrew Morton2012-04-241-1/+1
| | | | | | | | | sound/usb/endpoint.c: In function 'queue_pending_output_urbs': sound/usb/endpoint.c:298: warning: 'packet' may be used uninitialized in this function Cc: Daniel Mack <zonque@gmail.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: usb-audio: Add missing error checks in snd_ebox44_create_mixer()Takashi Iwai2012-04-241-9/+29
| | | | Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: usb-audio: M-Audio Fast Track Ultra: Add effect controlsFelix Homann2012-04-242-0/+319
| | | | | | | | | | | This adds controls for the effects section on the FTU devices. Some of these controls need volume quirks. They are added to mixer.c. [fixed missing break by tiwai] Signed-off-by: Felix Homann <linuxaudio@showlabor.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: usb-audio: Rename Fast Track Ultra mixer quirk functionsFelix Homann2012-04-241-5/+5
| | | | | | | | This is in preparation for more FTU controls to come. Should help keeping names a bit shorter. Signed-off-by: Felix Homann <linuxaudio@showlabor.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: usb-audio: Add TLV to M-Audio Fast Track Ultra controlsFelix Homann2012-04-241-2/+2
| | | | | | | This adds db gain information to M-Audio Fast Track Ultra (8R) devices. Signed-off-by: Felix Homann <linuxaudio@showlabor.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: usb-audio: Rename and export mixer_vol_tlvFelix Homann2012-04-242-2/+5
| | | | | | | | Rename mixer_vol_tlv to snd_usb_mixer_vol_tlv and export it to make it reuseable in mixer_quirks.c. Signed-off-by: Felix Homann <linuxaudio@showlabor.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: usb-audio: Unify M-Audio Fast Track Ultra and Ebox-44 mixer quirks.Felix Homann2012-04-241-85/+125
| | | | | | | | | | | | Merge snd_maudio_ftu_create_ctl() and snd_ebox44_create_ctl() into snd_create_std_mono_ctl(). As opposed to the ftu and ebox-44 specific functions, a TLV callback can be specified for controls created by snd_create_std_mono_ctl(). [fixed minor checkpatch.pl warnings by tiwai] Signed-off-by: Felix Homann <linuxaudio@showlabor.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* ALSA: snd-usb: remove refactorization left-oversDaniel Mack2012-04-212-18/+1
| | | | | | | | Drop some struct members and definitions that became obsolete during the refactorization of the driver. Signed-off-by: Daniel Mack <zonque@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* Merge branch 'topic/usb-endpoint' into topic/miscTakashi Iwai2012-04-188-825/+1401
|\
| * ALSA: usb: Remove obsoleted fields from struct snd_usb_substreamTakashi Iwai2012-04-132-26/+21
| | | | | | | | | | | | | | Many fields have been moved to struct snd_usb_endpoint. Also fix the proc output to correspond to the new structure. Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * ALSA: usb: Fix fill_max flag setTakashi Iwai2012-04-131-1/+1
| | | | | | | | | | | | | | | | ep->fill_max is a 1 bit flag, thus it has to be boolean. sound/usb/endpoint.c: In function 'snd_usb_endpoint_set_params': sound/usb/endpoint.c:785: warning: overflow in implicit constant conversion Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * ALSA: usb: Remove unused variableTakashi Iwai2012-04-131-1/+0
| | | | | | | | | | | | | | sound/usb/endpoint.c: In function ‘deactivate_urbs’: sound/usb/endpoint.c:520:16: warning: unused variable ‘flags’ [-Wunused-variable] Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * ALSA: snd-usb: add some documentationDaniel Mack2012-04-131-11/+171
| | | | | | | | | | | | | | | | Document the new streaming code and some of the functions so that contributers can catch up easier. Signed-off-by: Daniel Mack <zonque@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * ALSA: snd-usb: add support for implicit feedbackDaniel Mack2012-04-131-11/+26
| | | | | | | | | | | | | | | | | | | | Implicit feedback is a streaming mode that does not rely on dedicated sync endpoints but uses the information provided by record streams to clock output streams. Now that the streaming logic is decoupled from the PCM streams, this is easy to implement. Signed-off-by: Daniel Mack <zonque@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * ALSA: snd-usb: remove old streaming logicDaniel Mack2012-04-132-859/+6
| | | | | | | | | | Signed-off-by: Daniel Mack <zonque@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * ALSA: snd-usb: switch over to new endpoint streaming logicDaniel Mack2012-04-136-119/+385
| | | | | | | | | | | | | | | | | | With the previous commit that added the new streaming model, all endpoint and streaming related code is now in endpoint.c, and pcm.c only acts as a wrapper for handling the packet's payload. Signed-off-by: Daniel Mack <zonque@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * ALSA: snd-usb: implement new endpoint streaming modelDaniel Mack2012-04-134-11/+1002
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This patch adds a new generic streaming logic for audio over USB. It defines a model (snd_usb_endpoint) that handles everything that is related to an USB endpoint and its streaming. There are functions to activate and deactivate an endpoint (which call usb_set_interface()), and to start and stop its URBs. It also has function pointers to be called when data was received or is about to be sent, and pointer to a sync slave (another snd_usb_endpoint) that is informed when data has been received. A snd_usb_endpoint knows about its state and implements a refcounting, so only the first user will actually start the URBs and only the last one to stop it will tear them down again. With this sort of abstraction, the actual streaming is decoupled from the pcm handling, which makes the "implicit feedback" mechanisms easy to implement. In order to split changes properly, this patch only adds the new implementation but leaves the old one around, so the the driver doesn't change its behaviour. The switch to actually use the new code is submitted separately. Signed-off-by: Daniel Mack <zonque@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * ALSA: snd-usb: add snd_usb_audio-wide mutexDaniel Mack2012-04-132-0/+3
| | | | | | | | | | | | | | This is needed for new card-wide list operations. Signed-off-by: Daniel Mack <zonque@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | ALSA: snd-usb-audio: Replace mixer for Electrix Ebox-44Mark Hills2012-04-152-0/+80
| | | | | | | | | | | | | | | | | | The mixer units from the firmware are corrupt, and even where they are valid they presents mono controls as L and R channels of stereo. Signed-off-by: Mark Hills <mark@pogo.org.uk> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | ALSA: snd-usb-audio: Skip un-parseable mixer units instead of erroringMark Hills2012-04-151-1/+1
|/ | | | | | | | | | | Some interfaces reference endpoints which do not exists. To accomodate these, do not fail completely, but skip over them. This allows the Electrix Ebox-44 with earlier firmware to be detected and used for audio. Signed-off-by: Mark Hills <mark@pogo.org.uk> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* Merge branch 'topic/misc' into for-linusTakashi Iwai2012-03-1816-63/+310
|\
| * ALSA: usb-audio - Fix build error by consitification of rate listTakashi Iwai2012-03-151-2/+4
| | | | | | | | Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * ALSA: snd-usb-6fire: Select missing SND_VMASTER option in KconfigTorsten Schenk2012-02-251-0/+1
| | | | | | | | | | Signed-off-by: Torsten Schenk <torsten.schenk@zoho.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * ALSA: snd-usb-6fire: add analog input volume controlTorsten Schenk2012-02-222-0/+73
| | | | | | | | | | | | | | Add a stereo volume control for analog input channel pair 1/2. Signed-off-by: Torsten Schenk <torsten.schenk@zoho.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * ALSA: snd-usb-6fire: add mute control for analog outputsTorsten Schenk2012-02-222-0/+96
| | | | | | | | | | | | | | Add a mute control for every analog output channel. Signed-off-by: Torsten Schenk <torsten.schenk@zoho.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * ALSA: snd-usb-6fire: add individual volume control for analog channelsTorsten Schenk2012-02-222-23/+126
| | | | | | | | | | | | | | Add a stereo volume control for every analog output pair 1/2, 3/4, 5/6. Signed-off-by: Torsten Schenk <torsten.schenk@zoho.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * ALSA: snd-usb-6fire: add tlv to controlsTorsten Schenk2012-02-221-25/+9
| | | | | | | | | | | | | | | | Remove the soft log-conversion and add a dB scale according to the DAC documentation instead. Signed-off-by: Torsten Schenk <torsten.schenk@zoho.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * ALSA: snd-usb-6fire: remove driver version informationTorsten Schenk2012-02-2212-13/+1
| | | | | | | | | | | | | | Remove unused driver version information from the individual files. Signed-off-by: Torsten Schenk <torsten.schenk@zoho.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * ALSA: usx2y: Fix typo in usbusx2yaudio.c and usx2yhwdeppcm.cMasanari Iida2012-02-152-3/+3
| | | | | | | | | | | | | | | | Correct spelling "propably" to "probably" and "activ" to "active" in sound/usb/usx2y/usbusx2yaudio.c and usx2yhwdeppcm.c Signed-off-by: Masanari Iida <standby24x7@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | ALSA: snd-usb-caiaq: Fix the return of XRUNMark Hills2012-02-221-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit 3702b08 added a lock, but did not account for the case of SNDRV_PCM_POS_XRUN, which would get immediately overwritten. This could be bundled into one if-else-if statement, but the goto helps to clarify the 'exceptional' case. Thanks to Andreas Pape for spotting this. Signed-off-by: Mark Hills <mark@pogo.org.uk> Acked-by: Daniel Mack <zonque@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | ALSA: usb-audio: avoid integer overflow in create_fixed_stream_quirk()Xi Wang2012-02-153-4/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | A malicious USB device could feed in a large nr_rates value. This would cause the subsequent call to kmemdup() to allocate a smaller buffer than expected, leading to out-of-bounds access. This patch validates the nr_rates value and reuses the limit introduced in commit 4fa0e81b ("ALSA: usb-audio: fix possible hang and overflow in parse_uac2_sample_rate_range()"). Signed-off-by: Xi Wang <xi.wang@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | ALSA: usb-audio: add Edirol UM-3G supportClemens Ladisch2012-02-081-0/+8
|/ | | | | Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* Merge branch 'for-linus' of ↵Linus Torvalds2012-01-1210-15/+56
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound: (526 commits) ASoC: twl6040 - Add method to query optimum PDM_DL1 gain ALSA: hda - Fix the lost power-setup of seconary pins after PM resume ALSA: usb-audio: add Yamaha MOX6/MOX8 support ALSA: virtuoso: add S/PDIF input support for all Xonars ALSA: ice1724 - Support for ooAoo SQ210a ALSA: ice1724 - Allow card info based on model only ALSA: ice1724 - Create capture pcm only for ADC-enabled configurations ALSA: hdspm - Provide unique driver id based on card serial ASoC: Dynamically allocate the rtd device for a non-empty release() ASoC: Fix recursive dependency due to select ATMEL_SSC in SND_ATMEL_SOC_SSC ALSA: hda - Fix the detection of "Loopback Mixing" control for VIA codecs ALSA: hda - Return the error from get_wcaps_type() for invalid NIDs ALSA: hda - Use auto-parser for HP laptops with cx20459 codec ALSA: asihpi - Fix potential Oops in snd_asihpi_cmode_info() ALSA: hdsp - Fix potential Oops in snd_hdsp_info_pref_sync_ref() ALSA: hda/cirrus - support for iMac12,2 model ASoC: cx20442: add bias control over a platform provided regulator ALSA: usb-audio - Avoid flood of frame-active debug messages ALSA: snd-usb-us122l: Delete calls to preempt_disable mfd: Put WM8994 into cache only mode when suspending ... Fix up trivial conflicts in: - arch/arm/mach-s3c64xx/mach-crag6410.c: renamed speyside_wm8962 to tobermory, added littlemill right next to it - drivers/base/regmap/{regcache.c,regmap.c}: duplicate diff that had already come in with other changes in the regmap tree
| * ALSA: usb-audio: add Yamaha MOX6/MOX8 supportClemens Ladisch2012-01-111-0/+26
| | | | | | | | | | Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * ALSA: usb-audio - Avoid flood of frame-active debug messagesTakashi Iwai2012-01-091-2/+3
| | | | | | | | | | | | | | | | | | | | | | With some buggy devices, the usb-audio driver may give "frame xxx active" kernel messages too often. Better to keep it as debug-only using snd_printdd(), and also add the rate-limit for avoiding floods. Bugzilla: https://bugzilla.novell.com/show_bug.cgi?id=738681 Cc: <stable@kernel.org> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * ALSA: snd-usb-us122l: Delete calls to preempt_disableKarsten Wiese2012-01-091-4/+2
| | | | | | | | | | | | | | | | They are not needed here. Signed-off-by: Karsten Wiese <fzu@wemgehoertderstaat.de> Cc: stable@kernel.org Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * ALSA: usb-audio: fix possible hang and overflow in ↵Xi Wang2012-01-081-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | parse_uac2_sample_rate_range() A malicious USB device may feed in carefully crafted min/max/res values, so that the inner loop in parse_uac2_sample_rate_range() could run for a long time or even never terminate, e.g., given max = INT_MAX. Also nr_rates could be a large integer, which causes an integer overflow in the subsequent call to kmalloc() in parse_audio_format_rates_v2(). Thus, kmalloc() would allocate a smaller buffer than expected, leading to a memory corruption. To exploit the two vulnerabilities, an attacker needs physical access to the machine to plug in a malicious USB device. This patch makes two changes. 1) The type of "rate" is changed to unsigned int, so that the loop could stop once "rate" is larger than INT_MAX. 2) Limit nr_rates to 1024. Suggested-by: Takashi Iwai <tiwai@suse.de> Signed-off-by: Xi Wang <xi.wang@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * ALSA: module_param: make bool parameters really boolRusty Russell2011-12-196-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | module_param(bool) used to counter-intuitively take an int. In fddd5201 (mid-2009) we allowed bool or int/unsigned int using a messy trick. It's time to remove the int/unsigned int option. For this version it'll simply give a warning, but it'll break next kernel version. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Signed-off-by: Takashi Iwai <tiwai@suse.de>
| * ALSA: snd-usb: added VOX ToneLab ST midi handlingSergiusz Urbaniak2011-12-121-0/+10
| | | | | | | | | | Signed-off-by: Sergiusz Urbaniak <sergiusz.urbaniak@googlemail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
* | Merge branch 'driver-core-next' into Linux 3.2Greg Kroah-Hartman2012-01-065-63/+6
|\ \ | |/ |/| | | | | | | | | | | | | | | | | | | This resolves the conflict in the arch/arm/mach-s3c64xx/s3c6400.c file, and it fixes the build error in the arch/x86/kernel/microcode_core.c file, that the merge did not catch. The microcode_core.c patch was provided by Stephen Rothwell <sfr@canb.auug.org.au> who was invaluable in the merge issues involved with the large sysdev removal process in the driver-core tree. Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
| * USB: convert sound/* to use module_usb_driver()Greg Kroah-Hartman2011-11-185-63/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This converts the drivers in sound/* to use the module_usb_driver() macro which makes the code smaller and a bit simpler. Added bonus is that it removes some unneeded kernel log messages about drivers loading and/or unloading. Cc: Jaroslav Kysela <perex@perex.cz> Cc: Takashi Iwai <tiwai@suse.de> Cc: Daniel Mack <zonque@gmail.com> Cc: Clemens Ladisch <clemens@ladisch.de> Cc: Torsten Schenk <torsten.schenk@zoho.com> Cc: Paul Gortmaker <paul.gortmaker@windriver.com> Cc: Karsten Wiese <fzu@wemgehoertderstaat.de> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>