[PATCH] quirk for Pioneer DJ DJM-250MK2 usb sound card
Fabian Lesniak
fabian at lesniak-it.de
Thu Mar 26 11:03:27 CET 2020
Hi František,
a few months ago, I was working on patches to support the DJM-900MK2
mixer. I guess they are using a similar format on this mixer, at least
your quirk is similar to mine. I did not submit these patches yet
because I could not figure out a proper way to support both input and
output. I'm not an expert on usb audio, but I'll share my thoughts. At
least on the 900MK2, both playback and recording use the same interface:
I: If#= 0 Alt= 1 #EPs= 2 Cls=ff(vend.) Sub=00 Prot=00 Driver=snd-usb-audio
E: Ad=01(O) Atr=05(Isoc) MxPS=1024 Ivl=125us
E: Ad=82(I) Atr=05(Isoc) MxPS=1024 Ivl=125us
Thus, I introduced a quirk with .ifnum=0 for both capture and playback.
The problem is that the device accepts sample rate change commands for
the capture endpoint 0x82 only. Both endpoints are then configured to
that sample rate. Contrary to that, snd-usb-audio expects that playback
and recording is on two independent interface that both accept sample
rate changes and can operate on different sample rates.
My first approach was introducing a quirk in sound/usb/clock.c,
set_sample_rate_v1(). The quirk rejected changes to the sample rate of
one interface when the other was already in use by returning EBUSY. This
did work only if the capture endpoint was started before playback, which
was not predictable when using pulseaudio. Can anyone help on that? Is
there a supported device which I can look at that only allows the same
sample rate on both endpoints?
Cheers
Fabian
Am 26.03.20 um 10:20 schrieb Jaroslav Kysela:
> Dne 04. 03. 20 v 17:03 František Kučera napsal(a):
>> Dne 24. 02. 20 v 17:29 František Kučera napsal(a):
>>> Hello,
>>>
>>> I have created a quirk that adds support for the Pioneer DJ
>>> DJM-250MK2 mixer (acts like a USB sound card, but Vendor Specific
>>> Class).
>>>
>>> Output (from computer to card) is working: 8 channels, 48 000 Hz,
>>> S24_3LE.
>>>
>>> Input is not working. I tried, but I was unable to make it working
>>> even under an officially supported OS with Pioneer drivers -
>>> Audacity or Mixxx see the channels, but there is no signal. It
>>> probably works only with Pioneer proprietary application. But I hope
>>> that even mere output support will be useful for someone. (it is
>>> usable for playback, just not for DVS)
>>>
>>> Franta
>>>
>>> Signed-off-by: František Kučera <franta-linux at frantovo.cz>
>>> ---
>>> sound/usb/quirks-table.h | 42
>>> ++++++++++++++++++++++++++++++++++++++++++
>>> 1 file changed, 42 insertions(+)
>>>
>>> diff --git a/sound/usb/quirks-table.h b/sound/usb/quirks-table.h
>>> index d187aa6d50db..dcaf9eed9a41 100644
>>> --- a/sound/usb/quirks-table.h
>>> +++ b/sound/usb/quirks-table.h
>>> @@ -3592,5 +3592,47 @@ AU0828_DEVICE(0x2040, 0x7270, "Hauppauge",
>>> "HVR-950Q"),
>>> }
>>> }
>>> },
>>> +{
>>> + /*
>>> + * Pioneer DJ DJM-250MK2
>>> + * PCM is 8 channels out @ 48 fixed (endpoints 0x01).
>>> + * The output from computer to the mixer is usable.
>>> + *
>>> + * The input (phono or line to computer) is not working.
>>> + * It should be at endpoint 0x82 and probably also 8 channels,
>>> + * but it seems that it works only with Pioneer proprietary
>>> software.
>>> + * Even on officially supported OS, the Audacity was unable
>>> to record
>>> + * and Mixxx to recognize the control vinyls.
>>> + */
>>> + USB_DEVICE_VENDOR_SPEC(0x2b73, 0x0017),
>>> + .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 = -1
>>> + }
>>> + }
>>> + }
>>> +},
>>> #undef USB_DEVICE_VENDOR_SPEC
>>>
>> Can anyone review this patch please?
>
> Takashi, could you put this patch to sound-next ? A partial support is
> better than no support.
>
> Jaroslav
>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <http://mailman.alsa-project.org/pipermail/alsa-devel/attachments/20200326/35bf8879/attachment.sig>
More information about the Alsa-devel
mailing list