Discussion:
Troubleshooting new USB audio device
(too old to reply)
Caelia Chapin
2017-02-22 00:51:23 UTC
Permalink
Hello, all--

I have a brand new Denon MCX8000 DJ controller which I would like to use
with Mixxx (open source DJ software) on my Linux laptop. If you're not
familiar with DJ controllers, it's basically a MIDI controller that
includes its own sound card. Denon does not publish detailed specs for the
sound card, but it is a 24-bit, 44100k, USB 2.0 audio device. And since
this particular controller can run standalone (i.e. unconnected to any
computer), I have determined that the sound card works - that is, it plays
music and sounds fine.

However, I am having trouble getting the sound working with Linux. My
system is a Lenovo Thinkpad T410 running 64-bit Manjaro Linux, with all
packages updated last night - so I have version 1.1.3 of alsa-lib and
alsa-utils.

Here's what I'm finding:

aplay -l
....
card 1: MCX8000 [DENON DJ MCX8000], device 0: USB Audio [USB Audio]
Subdevices: 1/1
Subdevice #0: subdevice #0

aplay -L
....
default:CARD=MCX8000
DENON DJ MCX8000, USB Audio
Default Audio Device
sysdefault:CARD=MCX8000
DENON DJ MCX8000, USB Audio
Default Audio Device
....
[additional entries for various values of surroundNN]

When I run alsamixer, DENON DJ MCX8000 is one of the sound cards I can
select; when I do select it, the results depend on the kernel version. With
older kernels, no playback or capture devices are shown for this card; with
a 4.9 or 4.10 kernel, a single playback device is shown:

MULTI Validity

However, the info at the top of the screen says it is [Off], and in the
center of screen where a volume slider might be, MM is displayed - meaning
"muted," I suppose. And there does not seem to be any way to change the
state of that control.

Finally, the crux of the matter. When I run Mixxx and attempt to select the
MCX8000 as the output device, the GUI pops up an "unknown error" message.
But when I run Mixxx in debug mode, I am able to capture following more
detailed error:

Debug [Main]: Opening stream with id 4
Expression 'r' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 2092
Expression 'PaAlsaStreamComponent_FinishConfigure( &self->playback,
hwParamsPlayback, outParams, self->primeBuffers, realSr, outputLatency )'
failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 2733
Expression 'PaAlsaStream_Configure( stream, inputParameters,
outputParameters, sampleRate, framesPerBuffer, &inputLatency,
&outputLatency, &hostBufferSizeMode )' failed in
'src/hostapi/alsa/pa_linux_alsa.c', line: 2838
Warning [Main]: Error opening stream: Unanticipated host error

So, is anyone able to understand what the issue is here? Is there any hope
of getting this soundcard working? Any suggestions for additional
troubleshooting?

Thanks in advance for any insights.

--
Caelia Chapin
Clemens Ladisch
2017-02-22 08:09:38 UTC
Permalink
Post by Caelia Chapin
When I run alsamixer, DENON DJ MCX8000 is one of the sound cards I can
select; when I do select it, the results depend on the kernel version.
With older kernels, no playback or capture devices are shown for this
card
MULTI Validity
Alsamixer does not show devices; it shows mixer controls. Apparently,
your device does not have any useful mixer controls accessible by
software.
Post by Caelia Chapin
When I run Mixxx and attempt to select the MCX8000 as the output
device, the GUI pops up an "unknown error" message. But when I run
Mixxx in debug mode, I am able to capture following more detailed
Expression 'r' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 2092
Expression 'PaAlsaStreamComponent_FinishConfigure( &self->playback, hwParamsPlayback, outParams, self->primeBuffers, realSr, outputLatency )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 2733
Expression 'PaAlsaStream_Configure( stream, inputParameters, outputParameters, sampleRate, framesPerBuffer, &inputLatency, &outputLatency, &hostBufferSizeMode )' failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 2838
These messages come from PulseAudio. AFAIK it has problems handling
devices that do not fit into the normal 2.0 or 5.1 schema.

Do aplay/arecord work?


Regards,
Clemens
Caelia Chapin
2017-02-22 10:11:36 UTC
Permalink
Hi, Clemens-

Thanks for your reply ...
Post by Clemens Ladisch
Post by Caelia Chapin
MULTI Validity
Alsamixer does not show devices; it shows mixer controls. Apparently,
your device does not have any useful mixer controls accessible by
software.
Okay, that makes sense. Just out of curiosity, do you know what "multi
validity" means? I Googled the phrase but did not find any explanation.
Post by Clemens Ladisch
Post by Caelia Chapin
Mixxx in debug mode, I am able to capture following more detailed
2092
Post by Caelia Chapin
Expression 'PaAlsaStreamComponent_FinishConfigure( &self->playback,
hwParamsPlayback, outParams, self->primeBuffers, realSr, outputLatency )'
failed in 'src/hostapi/alsa/pa_linux_alsa.c', line: 2733
Post by Caelia Chapin
Expression 'PaAlsaStream_Configure( stream, inputParameters,
outputParameters, sampleRate, framesPerBuffer, &inputLatency,
&outputLatency, &hostBufferSizeMode )' failed in 'src/hostapi/alsa/pa_linux_alsa.c',
line: 2838
These messages come from PulseAudio. AFAIK it has problems handling
devices that do not fit into the normal 2.0 or 5.1 schema.
Actually it's not PulseAudio, but rather PortAudio (I found the file and
functions cited in the error message in the PortAudio source code).

[ Thanks for saying that, though. You led me to discover that I actually
had PulseAudio running. I have a longstanding policy of not using
PulseAudio, since it almost always causes problems for me. I have now
removed it from my system ;-) ]
Post by Clemens Ladisch
Do aplay/arecord work?
I don't know if I should be able to record - that would be an unusual thing
to do with a DJ controller.

Aplay, however, does not seem to do what it should. Here are some results:

$ aplay -Ddefault:CARD=MCX8000 -v test.wav
ALSA lib pcm_direct.c:1055:(snd1_pcm_direct_initialize_slave) unable to
install hw params
ALSA lib pcm_dmix.c:1064:(snd_pcm_dmix_open) unable to initialize slave
aplay: main:788: audio open error: No such device or address

$ aplay -Dsurround51:CARD=MCX8000,DEV=0 -v pj.wav
Playing WAVE 'pj.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo
aplay: set_params:1270: Broken configuration for this PCM: no
configurations available

$ aplay -Dsurround40:CARD=MCX8000,DEV=0 -v pj.wav
Playing WAVE 'pj.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo
aplay: set_params:1299: Sample format non available
Available formats:
- S32_LE

... and, after converting to signed 32-bit:

$ aplay -Dsurround40:CARD=MCX8000,DEV=0 -v pj2.wav
Playing WAVE 'pj2.wav' : Signed 32 bit Little Endian, Rate 44100 Hz,
Stereo
aplay: set_params:1305: Channels count non available


Thanks,
Caelia
Caelia Chapin
2017-02-22 10:21:22 UTC
Permalink
Post by Caelia Chapin
Post by Clemens Ladisch
Do aplay/arecord work?
I don't know if I should be able to record - that would be an unusual
thing to do with a DJ controller.
However, for the sake of completeness, I plugged in a mic and attempted to
record my voice with arecord - I got the 'channels count non available'
error.
Clemens Ladisch
2017-02-22 15:12:57 UTC
Permalink
do you know what "multi validity" means?
It shows whether the clock source named "Multi" is current valid.
$ aplay -Ddefault:CARD=MCX8000 -v test.wav
Try "-D plughw:MCX8000" instead.


Regards,
Clemens
Caelia Chapin
2017-02-22 20:25:20 UTC
Permalink
On Wed, Feb 22, 2017 at 8:12 AM, Clemens Ladisch <***@ladisch.de> wrote:

Try "-D plughw:MCX8000" instead.

Oh. That does not actually play the sound, but it does yield some possibly
interesting info:

$ aplay -Dplughw:MCX8000 pj.wav
Playing WAVE 'pj.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo
aplay: set_params:1363: Unable to install hw params:
ACCESS: RW_INTERLEAVED
FORMAT: S16_LE
SUBFORMAT: STD
SAMPLE_BITS: 16
FRAME_BITS: 32
CHANNELS: 2
RATE: 44100
PERIOD_TIME: (125011 125012)
PERIOD_SIZE: 5513
PERIOD_BYTES: 22052
PERIODS: (3 4)
BUFFER_TIME: 500000
BUFFER_SIZE: 22050
BUFFER_BYTES: 88200
TICK_TIME: 0
Clemens Ladisch
2017-02-23 07:29:23 UTC
Permalink
Post by Clemens Ladisch
Try "-D plughw:MCX8000" instead.
$ aplay -Dplughw:MCX8000 pj.wav
Playing WAVE 'pj.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo
Hmm. Any error messages in the system log?


Regards,
Clemens
Caelia Chapin
2017-02-23 10:05:51 UTC
Permalink
Post by Caelia Chapin
Post by Caelia Chapin
$ aplay -Dplughw:MCX8000 pj.wav
Playing WAVE 'pj.wav' : Signed 16 bit Little Endian, Rate 44100 Hz,
Stereo
Hmm. Any error messages in the system log?
Just this*:

Feb 23 03:02:58 benizake kernel: usb 2-1.2.1: clock source 65 is not
valid, cannot use

* I think. I used to be pretty good at reading error logs, but have not
really mastered journalctl. However, I ran 'journalctl -f', and the above
was the only new message that appeared when I tried to play a WAV file.

Thanks,
Caelia
Clemens Ladisch
2017-02-23 12:14:55 UTC
Permalink
Post by Clemens Ladisch
Post by Caelia Chapin
$ aplay -Dplughw:MCX8000 pj.wav
Playing WAVE 'pj.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo
Hmm. Any error messages in the system log?
Feb 23 03:02:58 benizake kernel: usb 2-1.2.1: clock source 65 is not valid, cannot use
So this is the only clock source that the device has, and it does not work.

This might be a bug in the firmware of your device (I guess the driver
shipped with it does not bother to ask for the clock source status, and so
this function was never tested).

Do you know how to recompile your kernel?


Regards,
Clemens
Caelia Chapin
2017-02-23 12:36:27 UTC
Permalink
Post by Clemens Ladisch
This might be a bug in the firmware of your device (I guess the driver
shipped with it does not bother to ask for the clock source status, and so
this function was never tested).
Do you know how to recompile your kernel?
Yes, I've done it many times - though it has been a few years. What
specific customizations would you suggest?
Clemens Ladisch
2017-02-23 12:47:22 UTC
Permalink
Post by Clemens Ladisch
This might be a bug in the firmware of your device (I guess the driver
shipped with it does not bother to ask for the clock source status, and so
this function was never tested).
Do you know how to recompile your kernel?
Yes, I've done it many times - though it has been a few years. What specific customizations would you suggest?
In sound/usb/clock.c, around line 192, try to remove this:

if (validate && !uac_clock_source_is_valid(chip, entity_id)) {
usb_audio_err(chip,
"clock source %d is not valid, cannot use\n",
entity_id);
return -ENXIO;
}


Regards,
Clemens
Caelia Chapin
2017-02-24 20:41:51 UTC
Permalink
Hi, Clemens--
Post by Clemens Ladisch
Post by Clemens Ladisch
This might be a bug in the firmware of your device (I guess the
driver
Post by Clemens Ladisch
shipped with it does not bother to ask for the clock source status,
and so
Post by Clemens Ladisch
this function was never tested).
Do you know how to recompile your kernel?
Yes, I've done it many times - though it has been a few years. What
specific customizations would you suggest?
if (validate && !uac_clock_source_is_valid(chip, entity_id)) {
usb_audio_err(chip,
"clock source %d is not valid, cannot use\n",
entity_id);
return -ENXIO;
}
Yes, that did the trick! Thank you very much for your assistance.

I do have a couple of quick follow-up questions:

1) I presume the code I removed exists for a reason. Are there likely to be
any adverse side effects from this kernel modification?

2) I would like to contact Denon about this issue. I think it should not be
necessary to hack the kernel in order to get this sound card working; from
what you have said it seems like this is a problem the manufacturer should
fix. Whether they will or not is another question, since this is evidently
not a problem for Windows or Mac users (I mean, it's an expensive piece of
pro audio gear, and I think it is inconceivable that a problem like this
could exist on those platforms without people complaining loudly). But if
it's a matter of standards compliance and doesn't take a huge amount of
work to fix, maybe? Can you state definitively that failing to respond to
the clock source query is incorrect behavior?

Best regards,
Caelia
Clemens Ladisch
2017-02-25 09:25:42 UTC
Permalink
Post by Caelia Chapin
Post by Clemens Ladisch
if (validate && !uac_clock_source_is_valid(chip, entity_id)) {
usb_audio_err(chip,
"clock source %d is not valid, cannot use\n",
entity_id);
return -ENXIO;
}
I presume the code I removed exists for a reason. Are there likely to be
any adverse side effects from this kernel modification?
The worst case is that some other device actually does not have a valid
clock source, and that the driver does attempt to send samples anyway,
which will then silently fail.

As long as the driver cannot automatically select another valid clock
source, it might be a better idea to ignore this.
Post by Caelia Chapin
Can you state definitively that failing to respond to the clock source
query is incorrect behavior?
This device does not fail to _respond_ to the query, it _does_ respond,
and the response says "I cannot play at the moment".

Or it is missing the descriptor for the clock source. Please re-add
the code (but remove the "return -ENXIO;"), and add logging to check
whether it is the first "if (!cs_desc)" at the beginning of the
uac_clock_source_is_valid() function that aborts, or if this function
runs through to the end. If it cannot find that descriptor, please
show the output of "lsusb -v" for this device.

In either case, this would be a definitive error of the firmware.


Regards,
Clemens

Loading...