From patchwork Tue Feb 2 00:02:37 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Olivia Mackintosh X-Patchwork-Id: 12060267 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E3128C433DB for ; Tue, 2 Feb 2021 00:04:28 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E307364ECE for ; Tue, 2 Feb 2021 00:04:27 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E307364ECE Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=base.nu Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id DAB4E170D; Tue, 2 Feb 2021 01:03:35 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz DAB4E170D DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1612224266; bh=CxBLWtcF8He+R+qjFk+JxBSL4N+2JE0AbA56t2Rn0cE=; h=Date:From:To:Subject:Cc:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=s2T9LSZL0Hvg7IHc/1Iarel/LdyavhsFCw2jMjobNmliTk5chGXnkvw3u2J23tgez Te4UanIwt1Ir9QfwMmVdxVOSoJqEVS4oOIa23PzKn6Uh2TyeHR42oSNiOb6ElauNZ/ 0VLUaU2FZNkl7jGrryPyEciEnND8z3ZHKF2F85Ps= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 318DEF80155; Tue, 2 Feb 2021 01:03:35 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 8145CF80155; Tue, 2 Feb 2021 01:03:33 +0100 (CET) Received: from hellmouth.base.nu (hellmouth.base.nu [192.248.168.186]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 44BDBF80152 for ; Tue, 2 Feb 2021 01:03:31 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 44BDBF80152 Received: from baphomet.hell ( [192.168.179.1]) by hellmouth.base.nu (OpenSMTPD) with ESMTP id 4f526ad0; Tue, 2 Feb 2021 00:03:29 +0000 (UTC) Received: from baphomet.hell (localhost [127.0.0.1]) by baphomet.hell (OpenSMTPD) with ESMTP id feb0657c; Tue, 2 Feb 2021 00:03:03 +0000 (GMT) Received: from base.nu ([192.168.178.2]) by baphomet.hell with ESMTPSA id 0bkpBLeWGGCH1AAAnQSWfg (envelope-from ); Tue, 02 Feb 2021 00:02:47 +0000 Date: Tue, 2 Feb 2021 00:02:37 +0000 From: Olivia Mackintosh To: alsa-devel@alsa-project.org Subject: [PATCH 1/2] ALSA: usb-audio: Add DJM450 to Pioneer format quirk Message-ID: <20210202000237.z2hxauysouuf3ice@base.nu> MIME-Version: 1.0 Content-Disposition: inline Cc: Takashi Iwai X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" 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. --- sound/usb/quirks.c | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/sound/usb/quirks.c b/sound/usb/quirks.c index e196e364cef1..08300954a50e 100644 --- a/sound/usb/quirks.c +++ b/sound/usb/quirks.c @@ -1470,6 +1470,23 @@ static void set_format_emu_quirk(struct snd_usb_substream *subs, subs->pkt_offset_adj = (emu_samplerate_id >= EMU_QUIRK_SR_176400HZ) ? 4 : 0; } +static int pioneer_djm_set_format_quirk(struct snd_usb_substream *subs, + u16 windex) +{ + unsigned int cur_rate = subs->data_endpoint->cur_rate; + u8 sr[3]; + // Convert to little endian + sr[0] = cur_rate&0xff; + sr[1] = (cur_rate>>8)&0xff; + sr[2] = (cur_rate>>16)&0xff; + usb_set_interface(subs->dev, 0, 1); + // we should derive windex from fmt-sync_ep but it's not set + snd_usb_ctl_msg(subs->stream->chip->dev, + usb_rcvctrlpipe(subs->stream->chip->dev, 0), + 0x01, 0x22, 0x0100, windex, &sr, 0x0003); + return 0; +} + void snd_usb_set_format_quirk(struct snd_usb_substream *subs, const struct audioformat *fmt) { @@ -1483,6 +1500,9 @@ void snd_usb_set_format_quirk(struct snd_usb_substream *subs, case USB_ID(0x534d, 0x2109): /* MacroSilicon MS2109 */ subs->stream_offset_adj = 2; break; + case USB_ID(0x2b73, 0x0013): /* Pioneer DJM-450 */ + pioneer_djm_set_format_quirk(subs, 0x0082); + break; } } From patchwork Tue Feb 2 00:03:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Olivia Mackintosh X-Patchwork-Id: 12060269 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7A564C433DB for ; Tue, 2 Feb 2021 00:05:01 +0000 (UTC) Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 91CB864EDC for ; Tue, 2 Feb 2021 00:05:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 91CB864EDC Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=base.nu Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=alsa-devel-bounces@alsa-project.org Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id DE6571766; Tue, 2 Feb 2021 01:04:08 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz DE6571766 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1612224299; bh=gKuvCEfrbMf6VmGgIeF2MKPZSOfSHYnIVwIWAK2khDw=; h=Date:From:To:Subject:Cc:List-Id:List-Unsubscribe:List-Archive: List-Post:List-Help:List-Subscribe:From; b=VgzAwxRAp+ufs03yTrZej5JZEV23JLtWZOwFrJhsQ4VvwZJM37u+rX5WX9B/l43gV Rk8aY5++W9vbPdGhmqZmK4dfizZwNNNdjVCBsLW/IDUIyhlTqwZQFxJEFqD9U45Eui a+ULcksgYeCGvOI3oi4W4OgigWGueCV+a/elKNh4= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 333E5F80152; Tue, 2 Feb 2021 01:04:07 +0100 (CET) Received: by alsa1.perex.cz (Postfix, from userid 50401) id CFCA8F8015A; Tue, 2 Feb 2021 01:04:05 +0100 (CET) Received: from hellmouth.base.nu (hellmouth.base.nu [192.248.168.186]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 8F37BF800E2 for ; Tue, 2 Feb 2021 01:04:01 +0100 (CET) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 8F37BF800E2 Received: from baphomet.hell ( [192.168.179.1]) by hellmouth.base.nu (OpenSMTPD) with ESMTP id 5eb67017; Tue, 2 Feb 2021 00:04:00 +0000 (UTC) Received: from baphomet.hell (localhost [127.0.0.1]) by baphomet.hell (OpenSMTPD) with ESMTP id b79cbb27; Tue, 2 Feb 2021 00:03:55 +0000 (GMT) Received: from base.nu ([192.168.178.2]) by baphomet.hell with ESMTPSA id LalhDOuWGGBtHQAAnQSWfg (envelope-from ); Tue, 02 Feb 2021 00:03:47 +0000 Date: Tue, 2 Feb 2021 00:03:36 +0000 From: Olivia Mackintosh To: alsa-devel@alsa-project.org Subject: [PATCH 2/2] ALSA: usb-audio: Add DJM-450 to the quirks table Message-ID: <20210202000336.7qk5wjllf7nj4cak@base.nu> MIME-Version: 1.0 Content-Disposition: inline Cc: Takashi Iwai X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" 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 --- sound/usb/quirks-table.h | 57 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 57 insertions(+) diff --git a/sound/usb/quirks-table.h b/sound/usb/quirks-table.h index 93d55cd1a5a4..1165a5ac60f2 100644 --- a/sound/usb/quirks-table.h +++ b/sound/usb/quirks-table.h @@ -3817,6 +3817,63 @@ AU0828_DEVICE(0x2040, 0x7270, "Hauppauge", "HVR-950Q"), } } }, +{ + /* + * Pioneer DJ DJM-450 + * PCM is 8 channels out @ 48 fixed (endpoint 0x01) + * and 8 channels in @ 48 fixed (endpoint 0x82). + */ + USB_DEVICE_VENDOR_SPEC(0x2b73, 0x0013), + .driver_info = (unsigned long) &(const struct snd_usb_audio_quirk) { + .ifnum = QUIRK_ANY_INTERFACE, + .type = QUIRK_COMPOSITE, + .data = (const struct snd_usb_audio_quirk[]) { + { + .ifnum = 0, + .type = QUIRK_AUDIO_FIXED_ENDPOINT, + .data = &(const struct audioformat) { + .formats = SNDRV_PCM_FMTBIT_S24_3LE, + .channels = 8, // outputs + .iface = 0, + .altsetting = 1, + .altset_idx = 1, + .endpoint = 0x01, + .ep_attr = USB_ENDPOINT_XFER_ISOC| + USB_ENDPOINT_SYNC_ASYNC, + .rates = SNDRV_PCM_RATE_48000, + .rate_min = 48000, + .rate_max = 48000, + .nr_rates = 1, + .rate_table = (unsigned int[]) { 48000 } + } + }, + { + .ifnum = 0, + .type = QUIRK_AUDIO_FIXED_ENDPOINT, + .data = &(const struct audioformat) { + .formats = SNDRV_PCM_FMTBIT_S24_3LE, + .channels = 8, // inputs + .iface = 0, + .altsetting = 1, + .altset_idx = 1, + .endpoint = 0x82, + .ep_idx = 1, + .ep_attr = USB_ENDPOINT_XFER_ISOC| + USB_ENDPOINT_SYNC_ASYNC| + USB_ENDPOINT_USAGE_IMPLICIT_FB, + .rates = SNDRV_PCM_RATE_48000, + .rate_min = 48000, + .rate_max = 48000, + .nr_rates = 1, + .rate_table = (unsigned int[]) { 48000 } + } + }, + { + .ifnum = -1 + } + } + } +}, #undef USB_DEVICE_VENDOR_SPEC #undef USB_AUDIO_DEVICE