Skip to contentSkip to conversation

Digidesign Mbox 1 enhancements

PATCH In review Damien Zammit 3 participants 6 messages Nov 11, 2014 – Dec 30, 2014 Sound

lore
Share & tools
lore
#0 lore raw

v7 cover Digidesign Mbox 1 enhancements

Revision 7.

Damien Zammit (2):
ALSA: usb-audio: Add mixer control for Digidesign Mbox 1 clock source
ALSA: usb-audio: Add duplex mode for Digidesign Mbox 1 and enable
mixer

 sound/usb/mixer_maps.c   |   9 ++++
 sound/usb/mixer_quirks.c | 129 +++++++++++++++++++++++++++++++++++++++++++++++
 sound/usb/quirks-table.h |  41 +++++++++++----
 3 files changed, 170 insertions(+), 9 deletions(-)
Signature · 1 line
1.9.1
#1 lore raw

PATCH v7 1/2 ALSA: usb-audio: Add mixer control for Digidesign Mbox 1 clock source

This patch provides the infrastructure for the Digidesign Mbox 1 to have a mixer control for selecting the clock source. Valid options are Internal and S/PDIF external sync.
A non-documented command is sent to the device to enable this feature found by reverse engineering and bus snooping.

---
 sound/usb/mixer_maps.c   |   9 ++++
 sound/usb/mixer_quirks.c | 129 +++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 138 insertions(+)
sound/usb/mixer_maps.c +9 -0
index d1d72ff..1994d41 100644
@@ -179,6 +179,11 @@ static struct usbmix_name_map audigy2nx_map[] = {
 	{ 0 } /* terminator */
 };
 
+static struct usbmix_name_map mbox1_map[] = {
+	{ 1, "Clock" },
+	{ 0 } /* terminator */
+};
+
 static struct usbmix_selector_map c400_selectors[] = {
 	{
 		.id = 0x80,
@@ -416,6 +421,10 @@ static struct usbmix_ctl_map usbmix_ctl_maps[] = {
 		.map = aureon_51_2_map,
 	},
 	{
+		.id = USB_ID(0x0dba, 0x1000),
+		.map = mbox1_map,
+	},
+	{
 		.id = USB_ID(0x13e5, 0x0001),
 		.map = scratch_live_map,
 		.ignore_ctl_error = 1,
sound/usb/mixer_quirks.c +129 -0

141 lines not on this page · raw message

Signature · 1 line
1.9.1
#2 lore raw

PATCH v7 2/2 ALSA: usb-audio: Add duplex mode for Digidesign Mbox 1 and enable mixer

In reply to Damien Zammit

This patch provides duplex support for the Digidesign Mbox 1 sound card and has been a work in progress for about a year.
Users have confirmed on my website that previous versions of this patch have worked on the hardware and I have been testing extensively.

It also enables the mixer control for providing clock source selector based on the previous patch.
The sample rate has been hardcoded to 48kHz because it works better with the S/PDIF sync mode when the sample rate is locked. This is the highest rate that the device supports and no loss of functionality is observed by restricting the sample rate apart from the inability to selec a lower rate.

---
 sound/usb/quirks-table.h | 41 ++++++++++++++++++++++++++++++++---------
 1 file changed, 32 insertions(+), 9 deletions(-)
sound/usb/quirks-table.h +32 -9
index c657752..13f44fd 100644
@@ -2944,7 +2944,7 @@ YAMAHA_DEVICE(0x7010, "UB99"),
 		.data = (const struct snd_usb_audio_quirk[]){
 			{
 				.ifnum = 0,
-				.type = QUIRK_IGNORE_INTERFACE,
+				.type = QUIRK_AUDIO_STANDARD_MIXER,
 			},
 			{
 				.ifnum = 1,
@@ -2955,16 +2955,40 @@ YAMAHA_DEVICE(0x7010, "UB99"),
 					.iface = 1,
 					.altsetting = 1,
 					.altset_idx = 1,
-					.attributes = UAC_EP_CS_ATTR_SAMPLE_RATE,
+					.attributes = 0x4,
 					.endpoint = 0x02,
-					.ep_attr = 0x01,
-					.rates = SNDRV_PCM_RATE_44100 |
-						 SNDRV_PCM_RATE_48000,
-					.rate_min = 44100,
+					.ep_attr = USB_ENDPOINT_XFER_ISOC |
+						USB_ENDPOINT_SYNC_SYNC,
+					.maxpacksize = 0x130,
+					.rates = SNDRV_PCM_RATE_48000,
+					.rate_min = 48000,
 					.rate_max = 48000,
-					.nr_rates = 2,
+					.nr_rates = 1,
 					.rate_table = (unsigned int[]) {
-						44100, 48000
+						48000
+					}
+				}
+			},
+			{
+				.ifnum = 1,
+				.type = QUIRK_AUDIO_FIXED_ENDPOINT,
+				.data = &(const struct audioformat) {
+					.formats = SNDRV_PCM_FMTBIT_S24_3BE,
+					.channels = 2,
+					.iface = 1,
+					.altsetting = 1,
+					.altset_idx = 1,
+					.attributes = 0x4,
+					.endpoint = 0x81,
+					.ep_attr = USB_ENDPOINT_XFER_ISOC |
+						USB_ENDPOINT_SYNC_ASYNC,
+					.maxpacksize = 0x130,
+					.rates = SNDRV_PCM_RATE_48000,
+					.rate_min = 48000,
+					.rate_max = 48000,
+					.nr_rates = 1,
+					.rate_table = (unsigned int[]) {
+						48000
 					}
 				}
 			},
@@ -2972,7 +2996,6 @@ YAMAHA_DEVICE(0x7010, "UB99"),
 				.ifnum = -1
 			}
 		}
-
 	}
 },
 
Signature · 1 line
1.9.1
#3 lore raw
In reply to Damien Zammit

At Wed, 12 Nov 2014 01:09:53 +1100,

Quoted 8 lines · Damien Zammit

Revision 7.

Damien Zammit (2):
ALSA: usb-audio: Add mixer control for Digidesign Mbox 1 clock source
ALSA: usb-audio: Add duplex mode for Digidesign Mbox 1 and enable
mixer

Quoted 4 lines
 sound/usb/mixer_maps.c   |   9 ++++
 sound/usb/mixer_quirks.c | 129 +++++++++++++++++++++++++++++++++++++++++++++++
 sound/usb/quirks-table.h |  41 +++++++++++----
 3 files changed, 170 insertions(+), 9 deletions(-)

Thanks, applied now.
The From address was different from signed-off-by address, so I corrected the from address to follow s-o-b. Please keep consistent at the next time.

BTW, there is one thing missing for the support of this device: the mixer resume is likely incomplete. Currently the mixer resume tries to resubmit the cached setups, but it doesn't care about the non-standard commands quirks do. There will be some infrastructure change to enhance quirk's capabilities for resume and others in near future, and let's fix this issue there.

Takashi

#4 lore raw

Hi,

I am curious to know why this has not yet made it upstream. Any particular thing we might be waiting for? Maybe I can help with testing on the hardware?

Damien

Quoted 30 lines · Takashi Iwai

At Wed, 12 Nov 2014 01:09:53 +1100,

Quoted 8 lines · Damien Zammit

Revision 7.

Damien Zammit (2):
ALSA: usb-audio: Add mixer control for Digidesign Mbox 1 clock source
ALSA: usb-audio: Add duplex mode for Digidesign Mbox 1 and enable
mixer

Quoted 4 lines
 sound/usb/mixer_maps.c   |   9 ++++
 sound/usb/mixer_quirks.c | 129 +++++++++++++++++++++++++++++++++++++++++++++++
 sound/usb/quirks-table.h |  41 +++++++++++----
 3 files changed, 170 insertions(+), 9 deletions(-)

Thanks, applied now.
The From address was different from signed-off-by address, so I corrected the from address to follow s-o-b. Please keep consistent at the next time.

BTW, there is one thing missing for the support of this device: the mixer resume is likely incomplete. Currently the mixer resume tries to resubmit the cached setups, but it doesn't care about the non-standard commands quirks do. There will be some infrastructure change to enhance quirk's capabilities for resume and others in near future, and let's fix this issue there.

Takashi

#5 lore raw

At Sun, 28 Dec 2014 19:57:48 +1100,

Quoted 4 lines · Damien Zammit

Hi,

I am curious to know why this has not yet made it upstream.

Hm? I certainly wrote I applied your patches. They are already included in 3.19-rc1.

Takashi