Skip to contentSkip to conversation

UAC2 clock selector for AudioBox 1818VSL

DISCUSSION [email protected] 2 participants 4 messages Sep 6, 2012 – Sep 10, 2012 1 message not in the archive Sound

lore
Share & tools
lore
#0 lore raw

Hi!
I'm attempting to get the "Clock Selector" mixer control to work with
the PreSonus AudioBox 1818VSL (a UAC2 device).

The control shows up in amixer as an enumerated value, but I don't seem to be able to set it (I've tried amixer, alsactl, and setting it programmatically). The possible values are correct (listing Internal Clock, S/PDIF Clock, and ADAT Clock as possible options); It just doesn't appear to take my setting, by which I mean amixer doesn't update the settings, I still have the occasional click when the sampling rates match over S/PDIF and I attempt to use external sync. No error is returned.

After digging around USB specs and ALSA's usb/mixer.c and being unfamiliar with both the USB audio spec and the inner workings of ALSA, I thought it'd be best to ask the list about this: How would I check to see if ALSA is asking the device to change clock source at all?

-Louis

#1 lore raw

Hi,

Quoted 12 lines · On 06.09.2012 22:20, [email protected] wrote:

Hi!
I'm attempting to get the "Clock Selector" mixer control to work with
the PreSonus AudioBox 1818VSL (a UAC2 device).

The control shows up in amixer as an enumerated value, but I don't seem to be able to set it (I've tried amixer, alsactl, and setting it programmatically). The possible values are correct (listing Internal Clock, S/PDIF Clock, and ADAT Clock as possible options); It just doesn't appear to take my setting, by which I mean amixer doesn't update the settings, I still have the occasional click when the sampling rates match over S/PDIF and I attempt to use external sync. No error is returned.

Quoted 4 lines

After digging around USB specs and ALSA's usb/mixer.c and being unfamiliar with both the USB audio spec and the inner workings of ALSA, I thought it'd be best to ask the list about this: How would I check to see if ALSA is asking the device to change clock source at all?

Hmm. A clock selector is handled like any other control entity on the hardware. Some thoughts:

- Are you able to control other settings like the volume?

- It's fairly common for devices to not accept a new clock source setting if they can't lock to the external source within some time. Did you connect anything to the digital inputs?

- Are you able to control that setting with the native Mac OS X driver? (IOW, without installing a 3rd-party driver)

Also, please send the output of "lsusb -v" for that device.

Daniel

A message that is not in the archive (sent off-list or not yet received): 192dce6984143a00813e593a60c5a5f4.squirrel@master.museresearch.com

#3 lore raw
Quoted 10 lines · On 07.09.2012 19:57, [email protected] wrote:

Hi Daniel,
Thanks for the quick reply. I am able to set the clock on my Mac, though
I do need to do further tests and make sure that the sync is actually reliable there. The setting is available from the built-in, standard OS X audio setup application "Audio MIDI Setup".

There should be a S/PDIF clock signal going to the digital inputs on the device. Some of the other controls such as per-channel mute also appear to work. I've also attached the lsusb output.

Quoted 5 lines

There are some other details that may be relevant, but I didn't want to make my initial post too long/confusing because these extra details may end up just being a red herring: Each mixer element name (as seen in amixer) is prefixed with "AudioBox 1818 VSL Clock Selector" even if it is not a clock selector.

That strange but I believe not related. We should still fix that :)

Quoted 5 lines

I am confident though that the control I've been
playing with is the clock selector because it lists the different clock types as options. I also see this when I plug the device in or load the ALSA driver:

Quoted 16 lines

ALSA sound/usb/mixer.c:342 cannot get ctl value: req = 0x83, wValue = 0x201, wIndex = 0xa00, type = 4
ALSA sound/usb/mixer.c:846 10:0: cannot get min/max values for control 2 (id 10)
ALSA sound/usb/mixer.c:342 cannot get ctl value: req = 0x83, wValue = 0x200, wIndex = 0xa00, type = 4
ALSA sound/usb/mixer.c:846 10:0: cannot get min/max values for control 2 (id 10)
ALSA sound/usb/mixer.c:342 cannot get ctl value: req = 0x83, wValue = 0x201, wIndex = 0xb00, type = 4
ALSA sound/usb/mixer.c:846 11:0: cannot get min/max values for control 2 (id 11)
ALSA sound/usb/mixer.c:342 cannot get ctl value: req = 0x83, wValue = 0x200, wIndex = 0xb00, type = 4
ALSA sound/usb/mixer.c:846 11:0: cannot get min/max values for control 2 (id 11)

Do you see any messages when you try to set the clock selector with amixer?

If you're running a recent kernel, try the following patch. That will produce log messages for each mixer related control packet that is sent out to the device.

Thanks,
Daniel

sound/usb/mixer.c +3 -0
index 4f40ba8..fce9b88 100644
@@ -446,6 +446,9 @@ int snd_usb_mixer_set_ctl_value(struct usb_mixer_elem_info *cval,
 				    USB_RECIP_INTERFACE | USB_TYPE_CLASS | USB_DIR_OUT,
 				    validx, snd_usb_ctrl_intf(chip) | (cval->id << 8),
 				    buf, val_len) >= 0) {
+			snd_printk(" DEBUG: %s(): request %08x requesttype %08x, value %04x, index %04x, size %d\n",
+					__func__, request, USB_RECIP_INTERFACE | USB_TYPE_CLASS | USB_DIR_OUT,
+					validx, snd_usb_ctrl_intf(chip) | (cval->id << 8), val_len);
 			snd_usb_autosuspend(chip);
 			return 0;
 		}
#4 lore raw

Hi Daniel,
I've applied the patch, and this is the output. When I call it with
value 0, nothing happens. When I set it to higher values, it looks like some (attempted?) communication happens with the device. I added another debug line which spits out the value_set parameter also.

[root@TestName linux-3.4.5-2.muse1.rt13.2.fc15.x86_64]# amixer -c 2 cset numid=5,iface=MIXER,name='AudioBox 1818 VSL Clock Selector' 0

numid=5,iface=MIXER,name='AudioBox 1818 VSL Clock Selector'
; type=ENUMERATED,access=rw------,values=1,items=3 ; Item #0 'AudioBox 1818 VSL Internal Clock'
; Item #1 'AudioBox 1818 VSL S/PDIF Clock'
; Item #2 'AudioBox 1818 VSL ADAT Clock'
: values=0

[root@TestName linux-3.4.5-2.muse1.rt13.2.fc15.x86_64]# amixer -c 2 cset numid=5,iface=MIXER,name='AudioBox 1818 VSL Clock Selector' 1

numid=5,iface=MIXER,name='AudioBox 1818 VSL Clock Selector'
; type=ENUMERATED,access=rw------,values=1,items=3 ; Item #0 'AudioBox 1818 VSL Internal Clock'
; Item #1 'AudioBox 1818 VSL S/PDIF Clock'
; Item #2 'AudioBox 1818 VSL ADAT Clock'
: values=0

Sep 10 09:45:16 TestName kernel: [ 4486.890466] ALSA sound/usb/mixer.c:444
Called with value_set=2
Sep 10 09:45:16 TestName kernel: [ 4486.890566] ALSA sound/usb/mixer.c:476
 DEBUG: snd_usb_mixer_set_ctl_value(): request 00000001 requesttype

00000021, value 0100, index 2800, size 2

[root@TestName linux-3.4.5-2.muse1.rt13.2.fc15.x86_64]# amixer -c 2 cset numid=5,iface=MIXER,name='AudioBox 1818 VSL Clock Selector' 2

numid=5,iface=MIXER,name='AudioBox 1818 VSL Clock Selector'
; type=ENUMERATED,access=rw------,values=1,items=3 ; Item #0 'AudioBox 1818 VSL Internal Clock'
; Item #1 'AudioBox 1818 VSL S/PDIF Clock'
; Item #2 'AudioBox 1818 VSL ADAT Clock'
: values=0

Sep 10 09:45:20 TestName kernel: [ 4490.090214] ALSA sound/usb/mixer.c:444
Called with value_set=3
Sep 10 09:45:20 TestName kernel: [ 4490.090256] ALSA sound/usb/mixer.c:476
 DEBUG: snd_usb_mixer_set_ctl_value(): request 00000001 requesttype

00000021, value 0100, index 2800, size 2

Louis

Quoted 45 lines
Quoted 6 lines

There are some other details that may be relevant, but I didn't want to make my initial post too long/confusing because these extra details may end up just being a red herring: Each mixer element name (as seen in amixer) is prefixed with "AudioBox 1818 VSL Clock Selector" even if it is
not a clock selector.

That strange but I believe not related. We should still fix that :)

Quoted 5 lines

I am confident though that the control I've been
playing with is the clock selector because it lists the different clock types as options. I also see this when I plug the device in or load the ALSA driver:

Quoted 16 lines

ALSA sound/usb/mixer.c:342 cannot get ctl value: req = 0x83, wValue = 0x201, wIndex = 0xa00, type = 4
ALSA sound/usb/mixer.c:846 10:0: cannot get min/max values for control 2 (id 10)
ALSA sound/usb/mixer.c:342 cannot get ctl value: req = 0x83, wValue = 0x200, wIndex = 0xa00, type = 4
ALSA sound/usb/mixer.c:846 10:0: cannot get min/max values for control 2 (id 10)
ALSA sound/usb/mixer.c:342 cannot get ctl value: req = 0x83, wValue = 0x201, wIndex = 0xb00, type = 4
ALSA sound/usb/mixer.c:846 11:0: cannot get min/max values for control 2 (id 11)
ALSA sound/usb/mixer.c:342 cannot get ctl value: req = 0x83, wValue = 0x200, wIndex = 0xb00, type = 4
ALSA sound/usb/mixer.c:846 11:0: cannot get min/max values for control 2 (id 11)

Do you see any messages when you try to set the clock selector with amixer?

If you're running a recent kernel, try the following patch. That will produce log messages for each mixer related control packet that is sent out to the device.

Thanks,
Daniel