Support for NUX MG-300 USB interface
Mike Oliphant
oliphant at nostatic.org
Mon Jan 18 22:15:26 CET 2021
Progress - thanks for the patch!
That got rid of the clock errors, and the the device now reports a 48000
sample rate, which is correct.
Unfortunately, it still isn't working properly. Playback doesn't seem to
work at all. Capture kind of works - it does record, but the audio is
extremely noisy.
Here is the current dmesg output when the device is connected.
Notable is the error "No valid sample rate available for 1:1, assuming a
firmware bug".
Also notable is "1:1 Set sample rate 48000, clock 40" - where "40" is the
id of the clock selector - "41" is the id of the actual clock source. So
maybe something is still getting wired up wrong?
[ 418.366449] usb 3-1.2: new high-speed USB device number 6 using ehci-pci
[ 418.479099] usb 3-1.2: config 1 interface 3 altsetting 0 bulk endpoint
0x4 has invalid maxpacket 256
[ 418.479118] usb 3-1.2: config 1 interface 3 altsetting 0 bulk endpoint
0x83 has invalid maxpacket 256
[ 418.480085] usb 3-1.2: New USB device found, idVendor=1fc9,
idProduct=8260, bcdDevice= 1.00
[ 418.480100] usb 3-1.2: New USB device strings: Mfr=1, Product=2,
SerialNumber=3
[ 418.480107] usb 3-1.2: Product: NUX MG-300 AUDIO
[ 418.480112] usb 3-1.2: Manufacturer: NUX
[ 418.480117] usb 3-1.2: SerialNumber: 2008101346
[ 418.482025] usb 3-1.2: No valid sample rate available for 1:1, assuming
a firmware bug
[ 418.482041] usb 3-1.2: 1:1: found sync_ep=0x81, iface=1, alt=1,
implicit_fb=0
[ 418.482049] usb 3-1.2: 1:1: add audio endpoint 0x1
[ 418.482078] usb 3-1.2: Creating new data endpoint #1
[ 418.482086] usb 3-1.2: Creating new sync endpoint #81
[ 418.482666] usb 3-1.2: 1:1 Set sample rate 48000, clock 40
[ 418.484525] usb 3-1.2: No valid sample rate available for 2:1, assuming
a firmware bug
[ 418.484545] usb 3-1.2: 2:1: add audio endpoint 0x82
[ 418.484584] usb 3-1.2: Creating new data endpoint #82
[ 418.484899] usb 3-1.2: 2:1 Set sample rate 48000, clock 40
[ 418.485800] usb 3-1.2: [10] FU [PCM Playback Switch] ch = 2, val = 0/1/1
[ 418.485822] usb 3-1.2: [10] FU [PCM Playback Switch] ch = 1, val = 0/1/1
[ 418.486484] usb 3-1.2: RANGE setting not yet supported
[ 418.487402] usb 3-1.2: [10] FU [PCM Playback Volume] ch = 2, val =
-16384/0/256
[ 418.487899] usb 3-1.2: RANGE setting not yet supported
[ 418.488774] usb 3-1.2: [10] FU [PCM Playback Volume] ch = 1, val =
-16384/0/256
[ 418.541357] usb 3-1.2: Open EP 0x82, iface=2:1, idx=0
[ 418.541363] usb 3-1.2: channels=2, rate=48000, format=S32_LE,
period_bytes=9592, periods=4, implicit_fb=0
[ 418.541367] usb 3-1.2: Setting usb interface 2:0 for EP 0x82
[ 418.541524] usb 3-1.2: 2:1 Set sample rate 48000, clock 40
[ 418.542000] usb 3-1.2: Setting params for data EP 0x82, pipe 0x10680
[ 418.542007] usb 3-1.2: Set up 12 URBS, ret=0
[ 418.542009] usb 3-1.2: Setting usb interface 2:1 for EP 0x82
[ 418.545012] usb 3-1.2: Closing EP 0x82 (count 1)
[ 418.545018] usb 3-1.2: Setting usb interface 2:0 for EP 0x82
[ 418.545157] usb 3-1.2: EP 0x82 closed
[ 418.545620] usb 3-1.2: Open EP 0x82, iface=2:1, idx=0
[ 418.545624] usb 3-1.2: channels=2, rate=48000, format=S32_LE,
period_bytes=9592, periods=4, implicit_fb=0
[ 418.545627] usb 3-1.2: Setting usb interface 2:0 for EP 0x82
[ 418.545893] usb 3-1.2: 2:1 Set sample rate 48000, clock 40
[ 418.546257] usb 3-1.2: Setting params for data EP 0x82, pipe 0x10680
[ 418.546263] usb 3-1.2: Set up 12 URBS, ret=0
[ 418.546266] usb 3-1.2: Setting usb interface 2:1 for EP 0x82
[ 418.546841] usb 3-1.2: Closing EP 0x82 (count 1)
[ 418.546845] usb 3-1.2: Setting usb interface 2:0 for EP 0x82
[ 418.547052] usb 3-1.2: EP 0x82 closed
[ 418.547467] usb 3-1.2: Open EP 0x1, iface=1:1, idx=0
[ 418.547470] usb 3-1.2: channels=2, rate=48000, format=S32_LE,
period_bytes=9592, periods=4, implicit_fb=0
[ 418.547473] usb 3-1.2: Open EP 0x81, iface=1:1, idx=1
[ 418.547476] usb 3-1.2: channels=2, rate=48000, format=S32_LE,
period_bytes=9592, periods=4, implicit_fb=0
[ 418.547478] usb 3-1.2: Setting usb interface 1:0 for EP 0x1
[ 418.547643] usb 3-1.2: 1:1 Set sample rate 48000, clock 40
[ 418.548129] usb 3-1.2: Setting params for data EP 0x1, pipe 0x8600
[ 418.548143] usb 3-1.2: Set up 12 URBS, ret=0
[ 418.548146] usb 3-1.2: Setting usb interface 1:1 for EP 0x1
[ 418.548420] usb 3-1.2: Setting params for sync EP 0x81, pipe 0x8680
[ 418.548425] usb 3-1.2: Set up 4 URBS, ret=0
[ 418.548443] usb 3-1.2: Starting data EP 0x1 (running 0)
[ 418.548474] usb 3-1.2: 12 URBs submitted for EP 0x1
[ 418.548477] usb 3-1.2: Starting sync EP 0x81 (running 0)
[ 418.548487] usb 3-1.2: 4 URBs submitted for EP 0x81
[ 418.549724] usb 3-1.2: Open EP 0x82, iface=2:1, idx=0
[ 418.549729] usb 3-1.2: channels=2, rate=48000, format=S32_LE,
period_bytes=9592, periods=4, implicit_fb=0
[ 418.549732] usb 3-1.2: Setting usb interface 2:0 for EP 0x82
[ 418.549888] usb 3-1.2: 2:1 Set sample rate 48000, clock 40
[ 418.550256] usb 3-1.2: Setting params for data EP 0x82, pipe 0x10680
[ 418.550259] usb 3-1.2: Set up 12 URBS, ret=0
[ 418.550261] usb 3-1.2: Setting usb interface 2:1 for EP 0x82
[ 418.550455] usb 3-1.2: Closing EP 0x82 (count 1)
[ 418.550460] usb 3-1.2: Setting usb interface 2:0 for EP 0x82
[ 418.550659] usb 3-1.2: EP 0x82 closed
[ 418.551298] usb 3-1.2: Open EP 0x82, iface=2:1, idx=0
[ 418.551303] usb 3-1.2: channels=2, rate=48000, format=S32_LE,
period_bytes=9592, periods=4, implicit_fb=0
[ 418.551307] usb 3-1.2: Setting usb interface 2:0 for EP 0x82
[ 418.551528] usb 3-1.2: 2:1 Set sample rate 48000, clock 40
[ 418.552021] usb 3-1.2: Setting params for data EP 0x82, pipe 0x10680
[ 418.552028] usb 3-1.2: Set up 12 URBS, ret=0
[ 418.552031] usb 3-1.2: Setting usb interface 2:1 for EP 0x82
[ 418.552168] usb 3-1.2: Stopping sync EP 0x81 (running 1)
[ 418.552174] usb 3-1.2: Stopping data EP 0x1 (running 1)
[ 418.566466] usb 3-1.2: Closing EP 0x1 (count 1)
[ 418.566472] usb 3-1.2: Setting usb interface 1:0 for EP 0x1
[ 418.566772] usb 3-1.2: EP 0x1 closed
[ 418.566775] usb 3-1.2: Closing EP 0x81 (count 1)
[ 418.566777] usb 3-1.2: Setting usb interface 1:0 for EP 0x81
[ 418.566954] usb 3-1.2: EP 0x81 closed
[ 418.567038] usb 3-1.2: Closing EP 0x82 (count 1)
[ 418.567040] usb 3-1.2: Setting usb interface 2:0 for EP 0x82
[ 418.567257] usb 3-1.2: EP 0x82 closed
[ 418.573720] usb 3-1.2: Open EP 0x1, iface=1:1, idx=0
[ 418.573724] usb 3-1.2: channels=2, rate=48000, format=S32_LE,
period_bytes=9592, periods=4, implicit_fb=0
[ 418.573727] usb 3-1.2: Open EP 0x81, iface=1:1, idx=1
[ 418.573729] usb 3-1.2: channels=2, rate=48000, format=S32_LE,
period_bytes=9592, periods=4, implicit_fb=0
[ 418.573732] usb 3-1.2: Setting usb interface 1:0 for EP 0x1
[ 418.573927] usb 3-1.2: 1:1 Set sample rate 48000, clock 40
[ 418.574564] usb 3-1.2: Setting params for data EP 0x1, pipe 0x8600
[ 418.574570] usb 3-1.2: Set up 12 URBS, ret=0
[ 418.574572] usb 3-1.2: Setting usb interface 1:1 for EP 0x1
[ 418.574659] usb 3-1.2: Setting params for sync EP 0x81, pipe 0x8680
[ 418.574662] usb 3-1.2: Set up 4 URBS, ret=0
[ 418.574676] usb 3-1.2: Starting data EP 0x1 (running 0)
[ 418.574700] usb 3-1.2: 12 URBs submitted for EP 0x1
[ 418.574701] usb 3-1.2: Starting sync EP 0x81 (running 0)
[ 418.574709] usb 3-1.2: 4 URBs submitted for EP 0x81
[ 418.575117] usb 3-1.2: Open EP 0x82, iface=2:1, idx=0
[ 418.575120] usb 3-1.2: channels=2, rate=48000, format=S32_LE,
period_bytes=9592, periods=4, implicit_fb=0
[ 418.575123] usb 3-1.2: Setting usb interface 2:0 for EP 0x82
[ 418.575384] usb 3-1.2: 2:1 Set sample rate 48000, clock 40
[ 418.575916] usb 3-1.2: Setting params for data EP 0x82, pipe 0x10680
[ 418.575926] usb 3-1.2: Set up 12 URBS, ret=0
[ 418.575928] usb 3-1.2: Setting usb interface 2:1 for EP 0x82
[ 418.576065] usb 3-1.2: Closing EP 0x82 (count 1)
[ 418.576069] usb 3-1.2: Setting usb interface 2:0 for EP 0x82
[ 418.576171] usb 3-1.2: EP 0x82 closed
[ 418.576574] usb 3-1.2: Open EP 0x82, iface=2:1, idx=0
[ 418.576578] usb 3-1.2: channels=2, rate=48000, format=S32_LE,
period_bytes=9592, periods=4, implicit_fb=0
[ 418.576581] usb 3-1.2: Setting usb interface 2:0 for EP 0x82
[ 418.576632] usb 3-1.2: 2:1 Set sample rate 48000, clock 40
[ 418.577128] usb 3-1.2: Setting params for data EP 0x82, pipe 0x10680
[ 418.577132] usb 3-1.2: Set up 12 URBS, ret=0
[ 418.577134] usb 3-1.2: Setting usb interface 2:1 for EP 0x82
[ 418.577404] usb 3-1.2: Stopping sync EP 0x81 (running 1)
[ 418.577408] usb 3-1.2: Stopping data EP 0x1 (running 1)
[ 418.594462] usb 3-1.2: Closing EP 0x1 (count 1)
[ 418.594469] usb 3-1.2: Setting usb interface 1:0 for EP 0x1
[ 418.594806] usb 3-1.2: EP 0x1 closed
[ 418.594810] usb 3-1.2: Closing EP 0x81 (count 1)
[ 418.594812] usb 3-1.2: Setting usb interface 1:0 for EP 0x81
[ 418.595093] usb 3-1.2: EP 0x81 closed
[ 418.595187] usb 3-1.2: Closing EP 0x82 (count 1)
[ 418.595189] usb 3-1.2: Setting usb interface 2:0 for EP 0x82
[ 418.595520] usb 3-1.2: EP 0x82 closed
[ 418.610935] usb 3-1.2: Open EP 0x1, iface=1:1, idx=0
[ 418.610943] usb 3-1.2: channels=2, rate=48000, format=S32_LE,
period_bytes=384000, periods=2, implicit_fb=0
[ 418.610946] usb 3-1.2: Open EP 0x81, iface=1:1, idx=1
[ 418.610949] usb 3-1.2: channels=2, rate=48000, format=S32_LE,
period_bytes=384000, periods=2, implicit_fb=0
[ 418.610952] usb 3-1.2: Setting usb interface 1:0 for EP 0x1
[ 418.611223] usb 3-1.2: 1:1 Set sample rate 48000, clock 40
[ 418.611990] usb 3-1.2: Setting params for data EP 0x1, pipe 0x8600
[ 418.612013] usb 3-1.2: Set up 12 URBS, ret=0
[ 418.612020] usb 3-1.2: Setting usb interface 1:1 for EP 0x1
[ 418.612281] usb 3-1.2: Setting params for sync EP 0x81, pipe 0x8680
[ 418.612285] usb 3-1.2: Set up 4 URBS, ret=0
[ 418.612363] usb 3-1.2: Starting data EP 0x1 (running 0)
[ 418.612389] usb 3-1.2: 12 URBs submitted for EP 0x1
[ 418.612390] usb 3-1.2: Starting sync EP 0x81 (running 0)
[ 418.612397] usb 3-1.2: 4 URBs submitted for EP 0x81
[ 418.613337] usb 3-1.2: 1:1 Start Playback PCM
[ 418.613810] usb 3-1.2: Open EP 0x82, iface=2:1, idx=0
[ 418.613813] usb 3-1.2: channels=2, rate=48000, format=S32_LE,
period_bytes=384000, periods=2, implicit_fb=0
[ 418.613815] usb 3-1.2: Setting usb interface 2:0 for EP 0x82
[ 418.614078] usb 3-1.2: 2:1 Set sample rate 48000, clock 40
[ 418.614639] usb 3-1.2: Setting params for data EP 0x82, pipe 0x10680
[ 418.614648] usb 3-1.2: Set up 12 URBS, ret=0
[ 418.614653] usb 3-1.2: Setting usb interface 2:1 for EP 0x82
[ 418.615844] usb 3-1.2: Starting data EP 0x82 (running 0)
[ 418.615879] usb 3-1.2: 12 URBs submitted for EP 0x82
[ 418.615882] usb 3-1.2: 2:1 Start Capture PCM
On Mon, Jan 18, 2021 at 11:19 AM Takashi Iwai <tiwai at suse.de> wrote:
> On Mon, 18 Jan 2021 18:54:57 +0100,
> Mike Oliphant wrote:
> >
> > Here is the dmesg output with dyndbg enabled. It looks like it is failing
> > to find the clock source, and hence cannot obtain the valid sample rates.
> >
> > It looks like it is finding the clock selector (id: 40), but
> > "uac_clock_selector_get_val()" is returning zero, and it never gets the
> > clock source (id: 41).
>
> Aha. Maybe the firmware doesn't expect it being asked as it's the
> single connection.
>
> Does the patch below help anything?
>
>
> Takashi
>
> --- a/sound/usb/clock.c
> +++ b/sound/usb/clock.c
> @@ -298,6 +298,11 @@ static int __uac_clock_find_source(struct
> snd_usb_audio *chip,
> if (selector) {
> int ret, i, cur;
>
> + if (selector->bNrInPins == 1) {
> + ret = 1;
> + goto find_source;
> + }
> +
> /* the entity ID we are looking for is a selector.
> * find out what it currently selects */
> ret = uac_clock_selector_get_val(chip, selector->bClockID);
> @@ -314,6 +319,7 @@ static int __uac_clock_find_source(struct
> snd_usb_audio *chip,
> return -EINVAL;
> }
>
> + find_source:
> cur = ret;
> ret = __uac_clock_find_source(chip, fmt,
> selector->baCSourceID[ret -
> 1],
>
More information about the Alsa-devel
mailing list