summaryrefslogtreecommitdiff
path: root/sound/usb
AgeCommit message (Collapse)AuthorFilesLines
2012-09-28ALSA: snd-usb: fix next_packet_size calls for pause caseDaniel Mack1-1/+7
Also fix the calls to next_packet_size() for the pause case. This was missed in 245baf983 ("ALSA: snd-usb: fix calls to next_packet_size"). Signed-off-by: Daniel Mack <zonque@gmail.com> Reviewed-by: Takashi Iwai <tiwai@suse.de> Reported-and-tested-by: Christian Tefzer <ctrefzer@gmx.de> Cc: stable@kernel.org [ Taking directly because Takashi is on vacation - Linus ] Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2012-09-06ALSA: usb-audio: Fix bogus error messages for delay accountingTakashi Iwai1-0/+6
The recent fix for the missing fine delayed time adjustment gives strange error messages at each start of the playback stream, such as delay: estimated 0, actual 352 delay: estimated 353, actual 705 These come from the sanity check in retire_playback_urb(). Before the stream is activated via start_endpoints(), a few silent packets have been already sent. And at this point the delay account is still in the state as if the new packets are just queued, so the driver gets confused and spews the bogus error messages. For fixing the issue, we just need to check whether the received packet is valid, whether it's zero sized or not. Reported-by: Markus Trippelsdorf <markus@trippelsdorf.de> Cc: <stable@vger.kernel.org> [v3.5+] Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-31ALSA: snd-usb: fix cross-interface streaming devicesDaniel Mack1-0/+15
Commit 68e67f40b ("ALSA: snd-usb: move calls to usb_set_interface") saved us some unnecessary calls to snd_usb_set_interface() but ignored the fact that there is at least one device out there which operates on two endpoint in different interfaces simultaniously. Take care for this by catching the case where data and sync endpoints are located on different interfaces and calling snd_usb_set_interface() between the start of the two endpoints. Signed-off-by: Daniel Mack <zonque@gmail.com> Reported-by: Robert M. Albrecht <linux@romal.de> Cc: stable@kernel.org [v3.5+] Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-31ALSA: snd-usb: fix calls to next_packet_sizeDaniel Mack3-13/+8
In order to support devices with implicit feedback streaming models, packet sizes are now stored with each individual urb, and the PCM handling code which fills the buffers purely relies on the size fields now. However, calling snd_usb_audio_next_packet_size() for all possible packets in an URB at once, prior to letting the PCM code do its job does in fact not lead to the same behaviour than what the old code did: The PCM code will break its loop once a period boundary is reached, consequently using up less packets that it really could. As snd_usb_audio_next_packet_size() implements a feedback mechanism to the endpoints phase accumulator, the number of calls to that function matters, and when called too often, the data rate runs out of bounds. Fix this by making the next_packet function public, and call it from the PCM code as before if the packet data sizes are not defined. Signed-off-by: Daniel Mack <zonque@gmail.com> Cc: stable@kernel.org [v3.5+] Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-31ALSA: snd-usb: restore delay informationDaniel Mack1-3/+26
Parts of commit 294c4fb8 ("ALSA: usb: refine delay information with USB frame counter") were unfortunately lost during the refactoring of the snd-usb driver in 3.5. This patch adds them back, restoring the correct delay information behaviour. Signed-off-by: Daniel Mack <zonque@gmail.com> Cc: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Cc: stable@kernel.org [3.5+] Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-31ALSA: snd-usb: use list_for_each_safe for endpoint resourcesPavel Roskin1-2/+2
snd_usb_endpoint_free() frees the structure that contains its argument. Signed-off-by: Pavel Roskin <proski@gnu.org> Cc: stable@vger.kernel.org Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-30ALSA: snd-usb: Fix URB cancellation at stream startDaniel Mack3-11/+15
Commit e9ba389c5 ("ALSA: usb-audio: Fix scheduling-while-atomic bug in PCM capture stream") fixed a scheduling-while-atomic bug that happened when snd_usb_endpoint_start was called from the trigger callback, which is an atmic context. However, the patch breaks the idea of the endpoints reference counting, which is the reason why the driver has been refactored lately. Revert that commit and let snd_usb_endpoint_start() take care of the URB cancellation again. As this function is called from both atomic and non-atomic context, add a flag to denote whether the function may sleep. Signed-off-by: Daniel Mack <zonque@gmail.com> Cc: stable@kernel.org [3.5+] Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-16ALSA: usb-audio: Fix scheduling-while-atomic bug in PCM capture streamTakashi Iwai2-4/+3
A PCM capture stream on usb-audio causes a scheduling-while-atomic BUG, as reported in the bugzilla entry below. It's because snd_usb_endpoint_start() is called at first at trigger START for a capture stream, and this function contains the left-over EP deactivation codes. The problem doesn't happen for a playback stream because the function is called at PCM prepare time, which can sleep. This patch fixes the BUG by moving the EP deactivation code into the PCM prepare callback. Bugzilla: https://bugzilla.kernel.org/show_bug.cgi?id=46011 Cc: <stable@vger.kernel.org> [v3.5+] Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-08-01ALSA: snd-usb: fix clock source validity indexDaniel Mack1-1/+2
uac_clock_source_is_valid() uses the control selector value to access the bmControls bitmap of the clock source unit. This is wrong, as control selector values start from 1, while the bitmap uses all available bits. In other words, "Clock Validity Control" is stored in D3..2, not D5..4 of the clock selector unit's bmControls. Signed-off-by: Daniel Mack <zonque@gmail.com> Reported-by: Andreas Koch <andreas@akdesigninc.com> Cc: stable@kernel.org Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-07-18Merge branch 'topic/misc' into for-nextTakashi Iwai2-57/+104
Generic updates for sound 3.6
2012-07-13ALSA: snd-usb: move calls to usb_set_interfaceDaniel Mack2-89/+41
The rework of the snd-usb endpoint logic moved the calls to snd_usb_set_interface() into the snd_usb_endpoint implemenation. This changed the order in which these calls are issued to the device, and thereby caused regressions for some webcams. Fix this by moving the calls back to pcm.c for now to make it work again and use snd_usb_endpoint_activate() to really tear down all remaining URBs in the flight, consequently fixing another regression caused by USB packets on the wire after altsetting 0 has been selected. Signed-off-by: Daniel Mack <zonque@gmail.com> Reported-and-tested-by: Philipp Dreimann <philipp@dreimann.net> Reported-by: Joseph Salisbury <joseph.salisbury@canonical.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-07-06ALSA: usb-audio: Fix the first PCM interface assignmentTakashi Iwai1-2/+2
In the new PCM streaming logic, the interface number is assigned to usb stream instance (subs->interface) after the format and rate setups are succeeded, but some codes are still passing subs->interface as the reference to helper functions. This leads to initializing with an invalid iface number (-1). This patch replaces the wrong references with the ones from the target fmt correctly. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-06-27ALSA: snd-usb-caiaq: initialize card pointerDaniel Mack1-1/+1
Fixes the following warning: CC [M] sound/usb/caiaq/device.o sound/usb/caiaq/device.c: In function ‘snd_probe’: sound/usb/caiaq/device.c:500:16: warning: ‘card’ may be used uninitialized in this function [-Wmaybe-uninitialized] Signed-off-by: Daniel Mack <zonque@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-06-25ALSA: usb-audio: add BOSS GT-100 supportClemens Ladisch1-0/+30
Reported-by: John McFarland <mcfarljm@gmail.com> Tested-by: John McFarland <mcfarljm@gmail.com> Signed-off-by: Clemens Ladisch <clemens@ladisch.de> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-06-20ALSA: snd_usb_audio: ignore ctrl errors on QuickCam Pro for NotebooksOleksij Rempel1-0/+4
This webcam works mostly ok, exept with skype. Skype sends lots of ctrl messages to dynamically ajust record level. If for some reasons it pokes some error every thing goes broken: - first pulseaudio blocks sound for all apps - then video is reseted - then skype freez dmesg has lots of messages like: cannot set freq 16000 to ep 0x86" Setting ignore_ctl_error=1 fixes this problem. Signed-off-by: Oleksij Rempel <bug-track@fisher-privat.net> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-06-20ALSA: snd_usb_audio: ignore ctrl errors on QuickCam E3500Oleksij Rempel1-0/+4
if this cam is pluged in, pulse audio can't initiate capture device. dmesg has lots of messages like: "cannot set freq 16000 to ep 0x86" Setting ignore_ctl_error=1 fixes this problem. Signed-off-by: Oleksij Rempel <bug-track@fisher-privat.net> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-06-18ALSA: 6fire: use NULL instead of 0 for pointer assignmentDaniel Mack1-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>
2012-06-18ALSA: snd-usb: make snd_usb_substream_capture_trigger staticDaniel Mack1-1/+2
Signed-off-by: Daniel Mack <zonque@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-06-18ALSA: snd-usb: fix sync pipe checkDaniel Mack1-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>
2012-06-11ALSA: usb-audio: Convert table to preferred C99 formatMark Hills1-10/+64
Signed-off-by: Mark Hills <mark@pogo.org.uk> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-06-11ALSA: usb-audio: Use a table of mixer controlsMark Hills1-56/+49
Allow mixer controls to be provided clearly in a table, to avoid quantity of error checking at each use. Signed-off-by: Mark Hills <mark@pogo.org.uk> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-06-08ALSA: usb-audio: Fix substream assignmentsTakashi Iwai2-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>
2012-05-31ALSA: usb-audio: fix rate_list memory leakClemens Ladisch1-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>
2012-05-21ALSA: snd-usb: fix stream info output in /procDaniel Mack1-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>
2012-05-15ALSA: usb-audio - Call get_min_max_*() after determining the name stringTakashi Iwai1-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>
2012-05-11ALSA: usb-audio: Fix commentMark Hills1-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>
2012-04-24ALSA: snd-usb: fix some typos in endpoint.c documentationDaniel Mack1-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>
2012-04-24ALSA: usb-audio: sound/usb/endpoint.c: suppress warningAndrew Morton1-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>
2012-04-24ALSA: usb-audio: Add missing error checks in snd_ebox44_create_mixer()Takashi Iwai1-9/+29
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-04-24ALSA: usb-audio: M-Audio Fast Track Ultra: Add effect controlsFelix Homann2-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>
2012-04-24ALSA: usb-audio: Rename Fast Track Ultra mixer quirk functionsFelix Homann1-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>
2012-04-24ALSA: usb-audio: Add TLV to M-Audio Fast Track Ultra controlsFelix Homann1-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>
2012-04-24ALSA: usb-audio: Rename and export mixer_vol_tlvFelix Homann2-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>
2012-04-24ALSA: usb-audio: Unify M-Audio Fast Track Ultra and Ebox-44 mixer quirks.Felix Homann1-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>
2012-04-21ALSA: snd-usb: remove refactorization left-oversDaniel Mack2-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>
2012-04-18Merge branch 'topic/usb-endpoint' into topic/miscTakashi Iwai8-825/+1401
2012-04-15ALSA: snd-usb-audio: Replace mixer for Electrix Ebox-44Mark Hills2-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>
2012-04-15ALSA: snd-usb-audio: Skip un-parseable mixer units instead of erroringMark Hills1-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>
2012-04-13ALSA: usb: Remove obsoleted fields from struct snd_usb_substreamTakashi Iwai2-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>
2012-04-13ALSA: usb: Fix fill_max flag setTakashi Iwai1-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>
2012-04-13ALSA: usb: Remove unused variableTakashi Iwai1-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>
2012-04-13ALSA: snd-usb: add some documentationDaniel Mack1-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>
2012-04-13ALSA: snd-usb: add support for implicit feedbackDaniel Mack1-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>
2012-04-13ALSA: snd-usb: remove old streaming logicDaniel Mack2-859/+6
Signed-off-by: Daniel Mack <zonque@gmail.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-04-13ALSA: snd-usb: switch over to new endpoint streaming logicDaniel Mack6-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>
2012-04-13ALSA: snd-usb: implement new endpoint streaming modelDaniel Mack4-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>
2012-04-13ALSA: snd-usb: add snd_usb_audio-wide mutexDaniel Mack2-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>
2012-03-18Merge branch 'topic/misc' into for-linusTakashi Iwai16-63/+310
2012-03-15ALSA: usb-audio - Fix build error by consitification of rate listTakashi Iwai1-2/+4
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2012-02-25ALSA: snd-usb-6fire: Select missing SND_VMASTER option in KconfigTorsten Schenk1-0/+1
Signed-off-by: Torsten Schenk <torsten.schenk@zoho.com> Signed-off-by: Takashi Iwai <tiwai@suse.de>