All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] New quirk for USB DAC 08bb:2704
@ 2011-02-12 22:53 Omari Stephens
  2011-02-14 17:10 ` Takashi Iwai
  0 siblings, 1 reply; 4+ messages in thread
From: Omari Stephens @ 2011-02-12 22:53 UTC (permalink / raw)
  To: alsa-devel

[-- Attachment #1: Type: text/plain, Size: 1139 bytes --]

Howdy, all

I have one of these:
http://www.chordelectronics.co.uk/products_detail.asp?id=63

It's got one of these USB DACs inside
ID 08bb:2704 Texas Instruments Japan

The DAC has a single mixer control, Master, which allows you to adjust 
volume and mute/unmute.  The fun thing is that the volume adjustment has 
no effect whatsoever.  On machines running pulse, this means that output 
will be at 0dB pretty much all the time.  (Of course, this is true of 
non-pulse machines also).

The attached patch disables the Master control, which causes pulse to 
control levels entirely in software, as it should for this device.

The main downside to this patch is that, while the volume part of the 
Master control is non-functional, the mute/unmute aspect does work as 
expected.  I couldn't figure out how to change the Master control to 
just a mute/unmute control, but if someone has suggestions on what to 
do, that'd be appreciated.  Judging by the comments in the code (and 
contrary to what I wrote in the map comment), I presume the mute/unmute 
control is the only reason why 08bb:2702 isn't doing this same thing.

Cheers,
--xsdg

[-- Attachment #2: 0001-Add-a-quirk-to-ignore-the-Master-volume-control-on-0.patch --]
[-- Type: text/x-patch, Size: 2192 bytes --]

>From 3061b0fa281ea812f0767bc9df6bae7b8016d0d0 Mon Sep 17 00:00:00 2001
From: Omari Stephens <xsdg@xsdg.org>
Date: Sat, 12 Feb 2011 20:36:04 +0000
Subject: [PATCH] Add a quirk to ignore the Master volume control on 08bb:2704

---
 mixer.c      |    6 ++++++
 mixer_maps.c |   19 ++++++++++++++++++-
 2 files changed, 24 insertions(+), 1 deletions(-)

diff --git a/mixer.c b/mixer.c
index 3ed3901..38d5d77 100644
--- a/mixer.c
+++ b/mixer.c
@@ -1192,6 +1192,12 @@ static int parse_audio_feature_unit(struct mixer_build *state, int unitid, void
 		/* disable non-functional volume control */
 		master_bits &= ~UAC_CONTROL_BIT(UAC_FU_VOLUME);
 		break;
+	case USB_ID(0x08bb, 0x2704):
+		snd_printk(KERN_INFO
+			   "usbmixer: master volume quirk for PCM2704 chip\n");
+		/* disable non-functional volume control */
+		master_bits &= ~UAC_CONTROL_BIT(UAC_FU_VOLUME);
+		break;
 	}
 	if (channels > 0)
 		first_ch_bits = snd_usb_combine_bytes(bmaControls + csize, csize);
diff --git a/mixer_maps.c b/mixer_maps.c
index f1324c4..40edd9b 100644
--- a/mixer_maps.c
+++ b/mixer_maps.c
@@ -208,11 +208,23 @@ static struct usbmix_name_map live24ext_map[] = {
 /* LineX FM Transmitter entry - needed to bypass controls bug */
 static struct usbmix_name_map linex_map[] = {
 	/* 1: IT pcm */
-	/* 2: OT Speaker */ 
+	/* 2: OT Speaker */
 	{ 3, "Master" }, /* FU: master volume - left / right / mute */
 	{ 0 } /* terminator */
 };
 
+/* This DAC (08bb:2704) has a single "Volume" control which isn't actually
+ * connected to anything.  The 08bb:2702 device is based off the LineX map, so
+ * presumably the 2704 one is similar but more broken.
+ */
+static struct usbmix_name_map ti_broken_usb_dac_map[] = {
+	/* 1: IT pcm */
+	/* 2: OT Speaker */
+	{ 3, NULL }, /* Master (not connected to anything) */
+	{ 0 }
+};
+
+
 static struct usbmix_name_map maya44_map[] = {
 	/* 1: IT line */
 	{ 2, "Line Playback" }, /* FU */
@@ -355,6 +367,11 @@ static struct usbmix_ctl_map usbmix_ctl_maps[] = {
 		.ignore_ctl_error = 1,
 	},
 	{
+		.id = USB_ID(0x08bb, 0x2704),
+		.map = ti_broken_usb_dac_map,
+		.ignore_ctl_error = 1,
+	},
+	{
 		.id = USB_ID(0x0a92, 0x0091),
 		.map = maya44_map,
 	},
-- 
1.7.2.3


[-- Attachment #3: Type: text/plain, Size: 160 bytes --]

_______________________________________________
Alsa-devel mailing list
Alsa-devel@alsa-project.org
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] New quirk for USB DAC 08bb:2704
  2011-02-12 22:53 [PATCH] New quirk for USB DAC 08bb:2704 Omari Stephens
@ 2011-02-14 17:10 ` Takashi Iwai
  2011-02-14 21:16   ` Omari Stephens
  0 siblings, 1 reply; 4+ messages in thread
From: Takashi Iwai @ 2011-02-14 17:10 UTC (permalink / raw)
  To: Omari Stephens; +Cc: alsa-devel

At Sat, 12 Feb 2011 22:53:25 +0000,
Omari Stephens wrote:
> 
> Howdy, all
> 
> I have one of these:
> http://www.chordelectronics.co.uk/products_detail.asp?id=63
> 
> It's got one of these USB DACs inside
> ID 08bb:2704 Texas Instruments Japan
> 
> The DAC has a single mixer control, Master, which allows you to adjust 
> volume and mute/unmute.  The fun thing is that the volume adjustment has 
> no effect whatsoever.  On machines running pulse, this means that output 
> will be at 0dB pretty much all the time.  (Of course, this is true of 
> non-pulse machines also).
> 
> The attached patch disables the Master control, which causes pulse to 
> control levels entirely in software, as it should for this device.
> 
> The main downside to this patch is that, while the volume part of the 
> Master control is non-functional, the mute/unmute aspect does work as 
> expected.  I couldn't figure out how to change the Master control to 
> just a mute/unmute control, but if someone has suggestions on what to 
> do, that'd be appreciated.  Judging by the comments in the code (and 
> contrary to what I wrote in the map comment), I presume the mute/unmute 
> control is the only reason why 08bb:2702 isn't doing this same thing.

The patch looks good to me.  Could you give your sign-off?


thanks,

Takashi

> 
> Cheers,
> --xsdg
> [2 0001-Add-a-quirk-to-ignore-the-Master-volume-control-on-0.patch <text/x-patch (7bit)>]
> >From 3061b0fa281ea812f0767bc9df6bae7b8016d0d0 Mon Sep 17 00:00:00 2001
> From: Omari Stephens <xsdg@xsdg.org>
> Date: Sat, 12 Feb 2011 20:36:04 +0000
> Subject: [PATCH] Add a quirk to ignore the Master volume control on 08bb:2704
> 
> ---
>  mixer.c      |    6 ++++++
>  mixer_maps.c |   19 ++++++++++++++++++-
>  2 files changed, 24 insertions(+), 1 deletions(-)
> 
> diff --git a/mixer.c b/mixer.c
> index 3ed3901..38d5d77 100644
> --- a/mixer.c
> +++ b/mixer.c
> @@ -1192,6 +1192,12 @@ static int parse_audio_feature_unit(struct mixer_build *state, int unitid, void
>  		/* disable non-functional volume control */
>  		master_bits &= ~UAC_CONTROL_BIT(UAC_FU_VOLUME);
>  		break;
> +	case USB_ID(0x08bb, 0x2704):
> +		snd_printk(KERN_INFO
> +			   "usbmixer: master volume quirk for PCM2704 chip\n");
> +		/* disable non-functional volume control */
> +		master_bits &= ~UAC_CONTROL_BIT(UAC_FU_VOLUME);
> +		break;
>  	}
>  	if (channels > 0)
>  		first_ch_bits = snd_usb_combine_bytes(bmaControls + csize, csize);
> diff --git a/mixer_maps.c b/mixer_maps.c
> index f1324c4..40edd9b 100644
> --- a/mixer_maps.c
> +++ b/mixer_maps.c
> @@ -208,11 +208,23 @@ static struct usbmix_name_map live24ext_map[] = {
>  /* LineX FM Transmitter entry - needed to bypass controls bug */
>  static struct usbmix_name_map linex_map[] = {
>  	/* 1: IT pcm */
> -	/* 2: OT Speaker */ 
> +	/* 2: OT Speaker */
>  	{ 3, "Master" }, /* FU: master volume - left / right / mute */
>  	{ 0 } /* terminator */
>  };
>  
> +/* This DAC (08bb:2704) has a single "Volume" control which isn't actually
> + * connected to anything.  The 08bb:2702 device is based off the LineX map, so
> + * presumably the 2704 one is similar but more broken.
> + */
> +static struct usbmix_name_map ti_broken_usb_dac_map[] = {
> +	/* 1: IT pcm */
> +	/* 2: OT Speaker */
> +	{ 3, NULL }, /* Master (not connected to anything) */
> +	{ 0 }
> +};
> +
> +
>  static struct usbmix_name_map maya44_map[] = {
>  	/* 1: IT line */
>  	{ 2, "Line Playback" }, /* FU */
> @@ -355,6 +367,11 @@ static struct usbmix_ctl_map usbmix_ctl_maps[] = {
>  		.ignore_ctl_error = 1,
>  	},
>  	{
> +		.id = USB_ID(0x08bb, 0x2704),
> +		.map = ti_broken_usb_dac_map,
> +		.ignore_ctl_error = 1,
> +	},
> +	{
>  		.id = USB_ID(0x0a92, 0x0091),
>  		.map = maya44_map,
>  	},
> -- 
> 1.7.2.3
> 
> [3  <text/plain; us-ascii (7bit)>]
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] New quirk for USB DAC 08bb:2704
  2011-02-14 17:10 ` Takashi Iwai
@ 2011-02-14 21:16   ` Omari Stephens
  2011-02-14 22:32     ` Takashi Iwai
  0 siblings, 1 reply; 4+ messages in thread
From: Omari Stephens @ 2011-02-14 21:16 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: alsa-devel

On 02/14/2011 05:10 PM, Takashi Iwai wrote:
> At Sat, 12 Feb 2011 22:53:25 +0000,
> Omari Stephens wrote:
>>
>> Howdy, all
>>
>> I have one of these:
>> http://www.chordelectronics.co.uk/products_detail.asp?id=63
>>
>> It's got one of these USB DACs inside
>> ID 08bb:2704 Texas Instruments Japan
>>
>> The DAC has a single mixer control, Master, which allows you to adjust
>> volume and mute/unmute.  The fun thing is that the volume adjustment has
>> no effect whatsoever.  On machines running pulse, this means that output
>> will be at 0dB pretty much all the time.  (Of course, this is true of
>> non-pulse machines also).
>>
>> The attached patch disables the Master control, which causes pulse to
>> control levels entirely in software, as it should for this device.
>>
>> The main downside to this patch is that, while the volume part of the
>> Master control is non-functional, the mute/unmute aspect does work as
>> expected.  I couldn't figure out how to change the Master control to
>> just a mute/unmute control, but if someone has suggestions on what to
>> do, that'd be appreciated.  Judging by the comments in the code (and
>> contrary to what I wrote in the map comment), I presume the mute/unmute
>> control is the only reason why 08bb:2702 isn't doing this same thing.
>
> The patch looks good to me.  Could you give your sign-off?
Oops; sorry (haven't submitted a kernel patch before).  Will do.

That said, I have some friends with the same device, and at least one 
says that the volume control works fine for him, so I want to do a bit 
more investigation before this quirk gets added.  Will send email when I 
get things figured out a little more.

--xsdg

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] New quirk for USB DAC 08bb:2704
  2011-02-14 21:16   ` Omari Stephens
@ 2011-02-14 22:32     ` Takashi Iwai
  0 siblings, 0 replies; 4+ messages in thread
From: Takashi Iwai @ 2011-02-14 22:32 UTC (permalink / raw)
  To: Omari Stephens; +Cc: alsa-devel

At Mon, 14 Feb 2011 21:16:18 +0000,
Omari Stephens wrote:
> 
> On 02/14/2011 05:10 PM, Takashi Iwai wrote:
> > At Sat, 12 Feb 2011 22:53:25 +0000,
> > Omari Stephens wrote:
> >>
> >> Howdy, all
> >>
> >> I have one of these:
> >> http://www.chordelectronics.co.uk/products_detail.asp?id=63
> >>
> >> It's got one of these USB DACs inside
> >> ID 08bb:2704 Texas Instruments Japan
> >>
> >> The DAC has a single mixer control, Master, which allows you to adjust
> >> volume and mute/unmute.  The fun thing is that the volume adjustment has
> >> no effect whatsoever.  On machines running pulse, this means that output
> >> will be at 0dB pretty much all the time.  (Of course, this is true of
> >> non-pulse machines also).
> >>
> >> The attached patch disables the Master control, which causes pulse to
> >> control levels entirely in software, as it should for this device.
> >>
> >> The main downside to this patch is that, while the volume part of the
> >> Master control is non-functional, the mute/unmute aspect does work as
> >> expected.  I couldn't figure out how to change the Master control to
> >> just a mute/unmute control, but if someone has suggestions on what to
> >> do, that'd be appreciated.  Judging by the comments in the code (and
> >> contrary to what I wrote in the map comment), I presume the mute/unmute
> >> control is the only reason why 08bb:2702 isn't doing this same thing.
> >
> > The patch looks good to me.  Could you give your sign-off?
> Oops; sorry (haven't submitted a kernel patch before).  Will do.
> 
> That said, I have some friends with the same device, and at least one 
> says that the volume control works fine for him, so I want to do a bit 
> more investigation before this quirk gets added.  Will send email when I 
> get things figured out a little more.

OK, let me know if it's ready.


thanks,

Takashi

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2011-02-14 22:32 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-02-12 22:53 [PATCH] New quirk for USB DAC 08bb:2704 Omari Stephens
2011-02-14 17:10 ` Takashi Iwai
2011-02-14 21:16   ` Omari Stephens
2011-02-14 22:32     ` Takashi Iwai

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.