summaryrefslogtreecommitdiff
path: root/sound/usb
AgeCommit message (Collapse)Author
2021-02-08ALSA: usb-audio: More strict state change in EPTakashi Iwai
The endpoint management has bit flags to indicate the current state, and we're dealing two things: the running bit and the stopping bit. There is a thin window in transition from the running to the stopping in stop_urbs(), and as long as the bit flags are used, it's difficult to plug. This patch modifies the state management code to use the atomic int and follow the explicit three states, STOPPED, RUNNING and STOPPING. The state change is done via atomic_cmpxhg() for avoiding possible races, and check the state change more strictly. The unexpected state change is now handled as an error. Fixes: d0f09d1e4a88 ("ALSA: usb-audio: Refactoring endpoint URB deactivation") Cc: <stable@vger.kernel.org> Link: https://lore.kernel.org/r/20210206203052.15606-3-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-02-08ALSA: usb-audio: Handle invalid running state at releasing EPTakashi Iwai
When we stop an endpoint in release_urbs(), it ignores the inconsistent endpoint state and tries to release the resources. This shouldn't happen in theory, but it's still safer to abort the release and let the caller proper error handling. Also, stop_and_unlink_urbs() called from release_urbs() does two step works, and it's more straightforward to split this to two functions again, so that the call from the PCM trigger won't take the path with sleeping. This patch modifies the EP management code to adapt two points above. Fixes: d0f09d1e4a88 ("ALSA: usb-audio: Refactoring endpoint URB deactivation") Cc: <stable@vger.kernel.org> Link: https://lore.kernel.org/r/20210206203052.15606-2-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-02-05ALSA: usb-audio: add mixer quirks for Pioneer DJM-900NXS2Fabian Lesniak
This commit adds mixer quirks for the Pioneer DJM-900NXS2 mixer. This device has 6 capture channels, 5 of them allow setting the signal source. This adds controls for these, similar to the DJM-250Mk2. However, playpack channels are not controllable via software like on the 250Mk2, as they can only be set manually on the mixing console. Read-only controls showing the currently selected playback channels are omitted. Signed-off-by: Fabian Lesniak <fabian@lesniak-it.de> Link: https://lore.kernel.org/r/20210205215116.258724-2-fabian@lesniak-it.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-02-05ALSA: usb-audio: Add DJM750 to Pioneer mixer quirkOlivia Mackintosh
This allows for N different devices to use the pioneer mixer quirk for setting capture/record type and recording level. The impementation has not changed much with the exception of an additional mask on private_value to allow storing of a device index: DEVICE MASK 0xff000000 GROUP_MASK 0x00ff0000 VALUE_MASK 0x0000ffff This could be improved by changing the arrays of wValues for each channel to contain named definitions (e.g. SND_DJM_CAP_LINE). It would improve readability and perhaps would allow using the same array for multiple channels. The channel number can be specified on the control next to the wIndex. Feedback is very much appreciated as I'm not the most proficient C programmer but am learning as I go. Signed-off-by: Olivia Mackintosh <livvy@base.nu> Link: https://lore.kernel.org/r/20210205184256.10201-2-livvy@base.nu Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-02-05ALSA: usb-audio: Fix PCM buffer allocation in non-vmalloc modeTakashi Iwai
The commit f274baa49be6 ("ALSA: usb-audio: Allow non-vmalloc buffer for PCM buffers") introduced the mode to allocate coherent pages for PCM buffers, and it used bus->controller device as its DMA device. It turned out, however, that bus->sysdev is a more appropriate device to be used for DMA mapping in HCD code. This patch corrects the device reference accordingly. Note that, on most platforms, both point to the very same device, hence this patch doesn't change anything practically. But on platforms like xhcd-plat hcd, the change becomes effective. Fixes: f274baa49be6 ("ALSA: usb-audio: Allow non-vmalloc buffer for PCM buffers") Cc: <stable@vger.kernel.org> Link: https://lore.kernel.org/r/20210205144559.29555-1-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-02-05ALSA: usb-audio: Correct document for snd_usb_endpoint_free_all()Takashi Iwai
The kerndoc comment for the new function snd_usb_endpoint_free_all() had a typo wrt the argument name. Fix it. Fixes: 00272c61827e ("ALSA: usb-audio: Avoid unnecessary interface re-setup") Reported-by: Pierre-Louis Bossart <pierre-louis.bossart@linux.intel.com> Cc: <stable@vger.kernel.org> Link: https://lore.kernel.org/r/20210205082837.6327-1-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-02-02Merge branch 'for-linus' into for-nextTakashi Iwai
Back-merge the 5.11 devel branch for further patching. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-02-02ALSA: usb-audio: Add DJM-450 to the quirks tableOlivia Mackintosh
As with most Pioneer devices, the device descriptor is vendor specific and as such, the number of channels, the PCM format, endpoints and sample rate need to be specified. This device has 8 inputs and 8 outputs and a sample rate of 48000 only. The PCM format is S24_3LE like other devices. There seems to be an appetite for reducing duplication amongs these Pioneer patches but again, I feel this is a step to be taken after support has been added as it's not completely clear where the commonalities are. Signed-off-by: Olivia Mackintosh <livvy@base.nu> Link: https://lore.kernel.org/r/20210202134225.3217-3-livvy@base.nu Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-02-02ALSA: usb-audio: Add DJM450 to Pioneer format quirkOlivia Mackintosh
Like the DJM-750, ensure that the format control message is passed to the device when opening a stream. It seems as though fmt->sync_ep is not always set when this function is called hence the passing of the value at the call site. If this can be fixed, fmt->sync_up should be used as the wvalue. There doesn't seem to be a "cpu_to_le24" type function defined hence for the open code but I did see a similar thing done in Bluez lib. Perhaps we can get these definitions defined in byteorder.h. See hci_cpu_to_le24 in include/net/bluetooth/hci.h:2543 for similar usage. Signed-off-by: Olivia Mackintosh <livvy@base.nu> Link: https://lore.kernel.org/r/20210202134225.3217-2-livvy@base.nu Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-01-23ALSA: usb-audio: workaround for iface reset issueTakashi Iwai
The recently introduced sample rate validation code seems causing a problem on some devices; namely, after performing this, the bus gets screwed and it influences even on other USB devices. As a quick workaround, perform it only for the necessary devices; currently MOTU devices are known to need the valid altset checks, so filter out other devices. Fixes: 93db51d06b32 ("ALSA: usb-audio: Check valid altsetting at parsing rates for UAC2/3") Reported-by: Jamie Heilman <jamie@audible.transient.net> BugLink: https://bugzilla.suse.com/show_bug.cgi?id=1178203 Link: https://lore.kernel.org/r/20210123155842.22652-1-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-01-21ALSA: usb-audio: Fix "RANGE setting not yet supported" errorsTakashi Iwai
At probing a UAC2/UAC3 device like NUX MG-300 USB interface, we get error messages "RANGE setting not yet supported". It comes the place where the driver tries to determine the resolution of mixer volumes via SET_CUR_RES and GET_CUR_RES verbs. Those verbs aren't supported on UAC2 and UAC3, hence the driver warns like the above. Although the driver handles this error and works as expected, it's still ugly to show such errors unnecessarily. This patch papers over the errors by applying the resolution detection only for UAC1 and skipping it for UAC2/UAC3. Reported-by: Mike Oliphant <oliphant@nostatic.org> Link: https://lore.kernel.org/r/20210120213932.1971-2-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-01-21ALSA: usb-audio: Skip the clock selector inquiry for single connectionsTakashi Iwai
The current USB-audio driver gets an error at probing NUX MG-300 about parsing the clocks. This is because the firmware doesn't return the proper connection of the clock selector that is connected to a single clock; it's likely that the firmware was lazy^w optimized and the inquiry wasn't handled. Actually it makes little sense to inquire and set up the single connection explicitly. This patch fixes the issue by simply skipping the clock selector inquiry if it's a single connection. Reported-by: Mike Oliphant <oliphant@nostatic.org> Link: https://lore.kernel.org/r/20210120213932.1971-1-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-01-20ALSA: usb-audio: Fix hw constraints dependenciesTakashi Iwai
Since the recent refactoring, it's been reported that some USB-audio devices (typically webcams) are no longer detected properly by PulseAudio. The debug session revealed that it's failing at probing by PA to try the sample rate 44.1kHz while the device has discrete sample rates other than 44.1kHz. But the puzzle was that arecord works as is, and some other devices with the discrete rates work, either. After all, this turned out to be the lack of the dependencies in a few hw constraint rules: snd_pcm_hw_rule_add() has the (variable) arguments specifying the dependent parameters, and some functions didn't set the target parameter itself as the dependencies. This resulted in an invalid parameter that could be generated only in a certain call pattern. This bug itself has been present in the code, but it didn't trigger errors just because the rules were casually avoiding such a corner case. After the recent refactoring and cleanup, however, the hw constraints work "as expected", and the problem surfaced now. For fixing the problem above, this patch adds the missing dependent parameters to each snd_pcm_hw_rule() call. Fixes: bc4e94aa8e72 ("ALSA: usb-audio: Handle discrete rates properly in hw constraints") BugLink: http://bugzilla.opensuse.org/show_bug.cgi?id=1181014 Link: https://lore.kernel.org/r/20210120204554.30177-1-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-01-18ALSA: usb-audio: Add support for Pioneer DJM-750Olivia Mackintosh
This adds the Pioneer DJ DJM-750 to the quirks table and ensures skip_pioneer_sync_ep() is (also) called: this device uses the vendor ID of 0x08e4 (I'm not sure why they use multiple vendor IDs but many just like to be awkward it seems). Playback on all 8 channels works. I'll likely keep this working in the future and submit futher patches and improvements as necessary. Signed-off-by: Olivia Mackintosh <livvy@base.nu> Link: https://lore.kernel.org/r/20210118130621.77miiie47wp7mump@base.nu Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-01-18Merge branch 'for-linus' into for-nextTakashi Iwai
Back-merge of 5.11 devel branch for more works on USB-audio. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-01-18ALSA: usb-audio: Avoid implicit feedback on Pioneer devicesTakashi Iwai
For addressing the regression on Pioneer devices, we recently corrected the quirk code to enable the implicit feedback mode on those devices properly. However, the devices still showed problems with the full duplex operations with JACK, and after debug sessions, we figured out that the older kernels that had worked with JACK also didn't use the implicit feedback mode at all although they had the quirk code to enable it; instead, the old code worked just to skip the normal sync endpoint setup that would have been detected without it. IOW, what broke without the implicit-fb quirk in the past was the application of the normal sync endpoint that is actually the capture data endpoint on these devices. This patch covers the overseen piece: it modifies the quirk code again not to enable the implicit feedback mode but just to make the driver skipping the sync endpoint detection. This made the driver working with JACK full-duplex mode again. Still it's not quite clear why the implicit feedback doesn't work on those devices yet; maybe it's about some issues in the URB setup. But at least, with this patch, the driver should work in the level of the older kernels again. Fixes: 167c9dc84ec3 ("ALSA: usb-audio: Fix implicit feedback sync setup for Pioneer devices") Link: https://lore.kernel.org/r/20210118075816.25068-4-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-01-18ALSA: usb-audio: Set sample rate for all sharing EPs on UAC1Takashi Iwai
The UAC2/3 sample rate setup is based on the clock node, which is usually shared in the interface, and can't be re-setup without deselecting the interface once, and that's how the current code behaves. OTOH, the sample rate setup of UAC1 is per endpoint, hence we basically need to call for each endpoint usage even if those share the same interface. This patch fixes the behavior of UAC1 to call always snd_usb_init_sample_rate() in snd_usb_endpoint_configure(). Fixes: bf6313a0ff76 ("ALSA: usb-audio: Refactor endpoint management") Link: https://lore.kernel.org/r/20210118075816.25068-3-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-01-18ALSA: usb-audio: Fix UAC1 rate setup for secondary endpointsTakashi Iwai
The current sample rate setup function for UAC1 assumes only the first endpoint retrieved from the interface:altset pair, but the rate set up may be needed also for the secondary endpoint. Also, retrieving the endpoint number from the interface descriptor is redundant; we have already the target endpoint in the given audioformat object. This patch simplifies the code and corrects the target endpoint as described in the above. It simply refers to fmt->endpoint directly. Also, this patch drops the pioneer_djm_set_format_quirk() that is caleld from snd_usb_set_format_quirk(); this function does the sample rate setup but for the capture endpoint (0x82), and that's exactly what the change above fixes. Link: https://lore.kernel.org/r/20210118075816.25068-2-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-01-15ALSA: usb-audio: Convert the last strlcpy() usageTakashi Iwai
The last remaining usage of strlcpy() in USB-audio driver is the setup of the card longname string. Basically we need to know whether any non-empty string is set or not, and no real length is needed. Refactor the code and use strscpy() instead. After this change, strlcpy() is gone from all sound/* code. Link: https://lore.kernel.org/r/20210115100437.20906-1-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-01-15ALSA: usb-audio: Convert remaining strlcpy() to strscpy()Takashi Iwai
USB-audio driver still contains two calls of strlcpy() because the return size is evaluated. Basically it just checks whether the string is copied or not, but since strcpy() may return a negative error code, we should check the negative value and treat as filled. Link: https://lore.kernel.org/r/20210115095758.19707-1-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-01-13ALSA: usb-audio: Always apply the hw constraints for implicit fb syncTakashi Iwai
Since the commit 5a6c3e11c9c9 ("ALSA: usb-audio: Add hw constraint for implicit fb sync"), we apply the hw constraints for the implicit feedback sync to make the secondary open aligned with the already opened stream setup. This change assumed that the secondary open is performed after the first stream has been already set up, and adds the hw constraints to sync with the first stream's parameters only when the EP setup for the first stream was confirmed at the open time. However, most of applications handling the full-duplex operations do open both playback and capture streams at first, then set up both streams. This results in skipping the additional hw constraints since the counter-part stream hasn't been set up yet at the open of the second stream, and it eventually leads to "incompatible EP" error in the end. This patch corrects the behavior by always applying the hw constraints for the implicit fb sync. The hw constraint rules are defined so that they check the sync EP dynamically at each invocation, instead. This covers the concurrent stream setups better and lets the hw refine calls resolving to the right configuration. Also this patch corrects a minor error that has existed in the debug print that isn't built as default. Fixes: 5a6c3e11c9c9 ("ALSA: usb-audio: Add hw constraint for implicit fb sync") Link: https://lore.kernel.org/r/20210111081611.12790-1-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-01-08ALSA: usb-audio: Fix implicit feedback sync setup for Pioneer devicesTakashi Iwai
Pioneer devices have both playback and capture streams sharing the same iface/altsetting, and those need to be paired as implicit feedback. Instead of a half-baked (and broken) static quirk entry, set up more generically for those devices by checking the number of endpoints and the attribute of the secondary EP. Fixes: bf6313a0ff76 ("ALSA: usb-audio: Refactor endpoint management") Reported-by: František Kučera <konference@frantovo.cz> Link: https://lore.kernel.org/r/20210108075219.21463-6-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-01-08ALSA: usb-audio: Annotate the endpoint index in audioformatTakashi Iwai
There are devices that have multiple endpoints sharing the same iface/altset not only for sync but also for the actual streams, and the audioformat for such an endpoint needs to be handled with the proper endpoint index; otherwise it confuses the endpoint management. This patch extends the audioformat to annotate the endpoint index, and put the proper ep_idx=1 to Pioneer device quirk entries accordingly. Fixes: bf6313a0ff76 ("ALSA: usb-audio: Refactor endpoint management") Link: https://lore.kernel.org/r/20210108075219.21463-5-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-01-08ALSA: usb-audio: Avoid unnecessary interface re-setupTakashi Iwai
The current endpoint handling assumed (more or less) a unique 1:1 relation between the endpoint and the iface/altset. The exception was the sync EP without the implicit feedback which has usually the secondary EP of the same altset. This works fine for most devices, but it turned out that some unusual devices like Pinoeer's ones have both playback and capture endpoints in the same iface/altsetting and use both for the implicit feedback mode. For handling such a case, we need to extend the endpoint management to take the shared interface into account. This patch does that: it adds a new object snd_usb_iface_ref for managing the reference counts of the each USB interface that is used by each endpoint. The interface setup is performed only once for the (sharing) endpoints, and the doubly initialization is avoided. Along with this, the resource release of endpoints and interface refcounts are put into a single function, snd_usb_endpoint_free_all() instead of looping in the caller side. Fixes: bf6313a0ff76 ("ALSA: usb-audio: Refactor endpoint management") Link: https://lore.kernel.org/r/20210108075219.21463-4-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-01-08ALSA: usb-audio: Choose audioformat of a counter-part substreamTakashi Iwai
The implicit feedback mode needs to handle two endpoints and the choice of the audioformat object for the sync EP is important since this determines the compatibility of the hw_params. The current code uses the same audioformat object if both the main EP and the sync EP point to the same iface/altsetting. This was done in consideration of the non-implicit-fb sync EP handling, and it doesn't match well with the cases where actually to endpoints are defined in the sameiface / altsetting like a few Pioneer devices. Modify snd_usb_find_implicit_fb_sync_format() to pick up the audioformat that is assigned in the counter-part substreams primarily, so that the actual capture stream can be opened properly. We keep the same audioformat object only as a fallback in case nothing found, though. Fixes: 9fddc15e8039 ("ALSA: usb-audio: Factor out the implicit feedback quirk code") Link: https://lore.kernel.org/r/20210108075219.21463-3-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-01-08ALSA: usb-audio: Fix the missing endpoints creations for quirksTakashi Iwai
The recent change in the endpoint management moved the endpoint object creation from the stream open time to the parser of the audio descriptor. It works fine for the standard audio, but it overlooked the other places that create audio streams via quirks (QUIRK_AUDIO_FIXED_ENDPOINT) like the reported a few Pioneer devices; those call snd_usb_add_audio_stream() manually, hence they miss the endpoints, eventually resulting in the error at opening streams. Moreover, now the sync EP setup was moved to the explicit call of snd_usb_audioformat_set_sync_ep(), and this needs to be added for those places, too. This patch addresses those regressions for quirks. It adds a local helper function add_audio_stream_from_fixed_fmt(), which does the all needed tasks, and replaces the calls of snd_usb_add_audio_stream() with this new function. Fixes: 54cb31901b83 ("ALSA: usb-audio: Create endpoint objects at parsing phase") Reported-by: František Kučera <konference@frantovo.cz> Link: https://lore.kernel.org/r/20210108075219.21463-2-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-01-08ALSA: Convert strlcpy to strscpy when return value is unusedJoe Perches
strlcpy is deprecated. see: Documentation/process/deprecated.rst Change the calls that do not use the strlcpy return value to the preferred strscpy. Done with cocci script: @@ expression e1, e2, e3; @@ - strlcpy( + strscpy( e1, e2, e3); This cocci script leaves the instances where the return value is used unchanged. After this patch, sound/ has 3 uses of strlcpy() that need to be manually inspected for conversion and changed one day. $ git grep -w strlcpy sound/ sound/usb/card.c: len = strlcpy(card->longname, s, sizeof(card->longname)); sound/usb/mixer.c: return strlcpy(buf, p->name, buflen); sound/usb/mixer.c: return strlcpy(buf, p->names[index], buflen); Miscellenea: o Remove trailing whitespace in conversion of sound/core/hwdep.c Link: https://lore.kernel.org/lkml/CAHk-=wgfRnXz0W3D37d01q3JFkr_i_uTL=V6A6G1oUZcprmknw@mail.gmail.com/ Signed-off-by: Joe Perches <joe@perches.com> Acked-by: Mark Brown <broonie@kernel.org> Link: https://lore.kernel.org/r/22b393d1790bb268769d0bab7bacf0866dcb0c14.camel@perches.com Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-01-07Merge branch 'for-linus' into for-nextTakashi Iwai
Back-merge of 5.11-devel branch for syncing the result changes. Signed-off-by: Takashi Iwai <tiwai@suse.de>
2021-01-03ALSA: usb-audio: Add quirk for RC-505Timon Reinold
BOSS RC-505 (shown by lsusb as "Roland Corp. RC-505") does require the same quirk as these other BOSS devices. Without this quirk it is neither possible to capture audio from nor to write audio to the RC-505. Both just result in an empty audio stream. With these changes both capture and playback seem to work quite fine. MIDI funtionality was not tested. Tested-by: Harry Reinold <harry.reinold@posteo.de> Signed-off-by: Timon Reinold <tirei@agon.one> Link: https://lore.kernel.org/r/20210102210835.21268-1-tirei@agon.one Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-12-29ALSA: usb-audio: Add quirk for BOSS AD-10Takashi Iwai
BOSS AD-10 requires the very same quirk like other BOSS devices to enable the special implicit feedback mode. Reported-and-tested-by: Martin Passing <martin@passing.name> Link: https://lore.kernel.org/r/20201229083428.20467-1-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-12-25ALSA: usb: Use DIV_ROUND_UP() instead of open-coding itLars-Peter Clausen
Use DIV_ROUND_UP() instead of open-coding it. This documents intent and makes it more clear what is going on for the casual reviewer. Generated using the following the Coccinelle semantic patch. // <smpl> @@ expression x, y; @@ -(((x) + (y) - 1) / (y)) +DIV_ROUND_UP(x, y) // </smpl> Signed-off-by: Lars-Peter Clausen <lars@metafoo.de> Link: https://lore.kernel.org/r/20201223172229.781-11-lars@metafoo.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-12-23ALSA: usb-audio: Fix UBSAN warnings for MIDI jacksTakashi Iwai
The calculation of in_cables and out_cables bitmaps are done with the bit shift by the value from the descriptor, which is an arbitrary value, and can lead to UBSAN shift-out-of-bounds warnings. Fix it by filtering the bad descriptor values with the check of the upper bound 0x10 (the cable bitmaps are 16 bits). Reported-by: syzbot+92e45ae45543f89e8c88@syzkaller.appspotmail.com Cc: <stable@vger.kernel.org> Link: https://lore.kernel.org/r/20201223174557.10249-1-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-12-22ALSA: usb-audio: Add implicit feeback support for the BOSS GT-1Mike Oliphant
The BOSS GT-1 (USB ID 0582:01d6) requires implicit feedback like other similar BOSS devices. This patch adds this support. [ rearranged the table entry in the ID order -- tiwai ] Signed-off-by: Mike Oliphant <oliphant@nostatic.org> Link: https://lore.kernel.org/r/20201221215533.2511-1-oliphant@nostatic.org Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-12-21ALSA: usb-audio: Add alias entry for ASUS PRIME TRX40 PRO-STakashi Iwai
ASUS PRIME TRX40 PRO-S mobo with 0b05:1918 needs the same quirk alias for another ASUS mobo (0b05:1917) for the proper mixer mapping, etc. Add the corresponding entry. BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=210783 Cc: <stable@vger.kernel.org> Link: https://lore.kernel.org/r/20201221080159.24468-1-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-12-18ALSA: usb-audio: Disable sample read check if firmware doesn't give backTakashi Iwai
Some buggy firmware don't give the current sample rate but leaves zero. Handle this case more gracefully without warning but just skip the current rate verification from the next time. Cc: <stable@vger.kernel.org> Link: https://lore.kernel.org/r/20201218145858.2357-1-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-12-17ALSA: usb-audio: Add VID to support native DSD reproduction on FiiO devicesAmadej Kastelic
Add VID to support native DSD reproduction on FiiO devices. Tested-by: Amadej Kastelic <amadejkastelic7@gmail.com> Signed-off-by: Emilio Moretti <emilio.moretti@gmail.com> Signed-off-by: Amadej Kastelic <amadejkastelic7@gmail.com> Cc: <stable@vger.kernel.org> Link: https://lore.kernel.org/r/X9j7wdXSr4XyK7Bd@ryzen.localdomain Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-12-14ALSA: usb-audio: Fix potential out-of-bounds shiftTakashi Iwai
syzbot spotted a potential out-of-bounds shift in the USB-audio format parser that receives the arbitrary shift value from the USB descriptor. Add a range check for avoiding the undefined behavior. Reported-by: syzbot+df7dc146ebdd6435eea3@syzkaller.appspotmail.com Cc: <stable@vger.kernel.org> Link: https://lore.kernel.org/r/20201209084552.17109-1-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-12-14Merge branch 'for-linus' into for-nextTakashi Iwai
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-12-11ALSA: usb-audio: Fix control 'access overflow' errors from chmapTakashi Iwai
The current channel-map control implementation in USB-audio driver may lead to an error message like "control 3:0:0:Playback Channel Map:0: access overflow" when CONFIG_SND_CTL_VALIDATION is set. It's because the chmap get callback clears the whole array no matter which count is set, and rather the false-positive detection. This patch fixes the problem by clearing only the needed array range at usb_chmap_ctl_get(). Cc: <stable@vger.kernel.org> Link: https://lore.kernel.org/r/20201211130048.6358-1-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-12-10ALSA: usb-audio: Add implicit fb support for Steinberg UR22Takashi Iwai
Steinberg UR22 (with USB ID 0499:1509) requires the implicit feedback for the proper playback, otherwise it causes occasional cracks. This patch adds the corresponding the quirk table entry with the recently added generic implicit fb support. Reported-and-tested-by: Kilian <meschi@posteo.de> Link: https://lore.kernel.org/r/20201209161835.13625-1-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-11-30ALSA: usb-audio: Add quirk for Pioneer DJ DDJ-SR2Takashi Iwai
Yet another quirk for Pioneer DJ DDJ-SR2, which is quite similar like other DJ DDJ models but with slightly different EPs or channels. Reported-by: Geraldo <geraldogabriel@gmail.com> Link: https://lore.kernel.org/r/20201130083714.10640-1-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-11-28ALSA: usb-audio: Add support for Pioneer DJ DDJ-RR controllerDaniel Martin
This patch allows the Pioneer DJ DDJ-RR to be seen as a USB audio device under Linux and therefore usable in such applications as Mixxx. Tested Master Audio out, headphones (both output jacks) and microphone input. All work perfectly. Signed-off-by: Daniel Martin <dmanlfc@gmail.com> Link: https://lore.kernel.org/r/20201128084035.2958-1-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-11-27ALSA: usb-audio: US16x08: fix value count for level metersHector Martin
The level meter control returns 34 integers of info. This fixes: snd-usb-audio 3-1:1.0: control 2:0:0:Level Meter:0: access overflow Fixes: d2bb390a2081 ("ALSA: usb-audio: Tascam US-16x08 DSP mixer quirk") Cc: stable@vger.kernel.org Signed-off-by: Hector Martin <marcan@marcan.st> Link: https://lore.kernel.org/r/20201127132635.18947-1-marcan@marcan.st Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-11-23ALSA: usb-audio: Fix MOTU M-Series quirksDylan Robinson
Now that the usb audio driver correctly finds implicit feedback endpoints, the implicit feedback quirk for the MOTU M-Series is no longer required. This also removes some unnecessary vendor specific messages from the MOTU M-Series boot quirk. The removed vendor specific messages turned on vendor specific interrupts to the host every 32 samples. The only thing the boot quirk needs to do is wait for 2 seconds. Tested-by: Dylan Robinson <dylan_robinson@motu.com> Signed-off-by: Dylan Robinson <dylan_robinson@motu.com> Link: https://lore.kernel.org/r/20201123085347.19667-42-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-11-23ALSA: usb-audio: Fix quirks for other BOSS devicesTakashi Iwai
A few other BOSS devices (BR-80, GT-100v2, Katana) seem requiring the same quirk as BOSS GT-001, i.e. no implicit feedback for playback but tying with capture. Add and correct the corresponding quirk table entries for them. Reported-and-tested-by: Keith Milner <kamilner@superlative.org> Link: https://lore.kernel.org/r/20201123085347.19667-41-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-11-23ALSA: usb-audio: Add implicit_fb module optionTakashi Iwai
A new module option, implicit_fb, is added to specify the driver looking for the implicit feedback sync. This can be useful for a device that could be working better in the implicit feed back mode and user wants to test it quickly. When this works, we can add the quirk entry easily. Tested-by: Keith Milner <kamilner@superlative.org> Tested-by: Dylan Robinson <dylan_robinson@motu.com> Link: https://lore.kernel.org/r/20201123085347.19667-40-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-11-23ALSA: usb-audio: Add generic implicit fb parsingTakashi Iwai
This patch extends the implicit feedback mode parser code to check the description more generically, so that the quirk entries can be added without the explicit EP and interface numbers. The search is done for the next and the previous interface of the given altset, and if both entries are ASYNC mode and the direction matches, it just takes as the sync endpoint. The generic parser is applicable only for the playback stream. As of now, only a few M-Audio devices have been converted to use this mode. Tested-by: Keith Milner <kamilner@superlative.org> Tested-by: Dylan Robinson <dylan_robinson@motu.com> Link: https://lore.kernel.org/r/20201123085347.19667-39-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-11-23ALSA: usb-audio: Factor out the implicit feedback quirk codeTakashi Iwai
The code dealing with the implicit feedback mode grew recently, and it's becoming messy. As we receive more and more devices that need the similar handling, it's better to be processed through a table instead of the open code. This patch moves the code that is relevant with parsing the implicit feedback mode and some helpers into another file, implicit.c. The detection and the setup of the implicit feedback sync EPs are rewritten to use the ID/class matching table instead. There should be no functional changes. Tested-by: Keith Milner <kamilner@superlative.org> Tested-by: Dylan Robinson <dylan_robinson@motu.com> Link: https://lore.kernel.org/r/20201123085347.19667-38-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-11-23ALSA: usb-audio: Quirk for BOSS GT-001Takashi Iwai
The capture stream of BOSS GT-001 seems always requiring to be tied with the playback stream. OTOH, the playback stream of this device doesn't seem working in the implicit fb mode, per se, since the playback must be running before the capture stream. This patch tries to address the points above: - Avoid the implicit fb mode for the playback - Set up a fake sync EP for the capture stream with the hard-coded playback stream using the implicit fb mode Reported-by: Keith Milner <kamilner@superlative.org> Tested-by: Keith Milner <kamilner@superlative.org> Tested-by: Dylan Robinson <dylan_robinson@motu.com> Link: https://lore.kernel.org/r/20201123085347.19667-37-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-11-23ALSA: usb-audio: Show sync endpoint information in proc outputsTakashi Iwai
Now the sync endpoints have been parsed at the beginning and won't be changed dynamically, let's show them in the proc outputs for helping debugging. Tested-by: Keith Milner <kamilner@superlative.org> Tested-by: Dylan Robinson <dylan_robinson@motu.com> Link: https://lore.kernel.org/r/20201123085347.19667-36-tiwai@suse.de Signed-off-by: Takashi Iwai <tiwai@suse.de>