All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] fix headphone settings and master volume (Conexant CX20551 0x103c30b2)
@ 2009-03-08 20:19 Gregorio Guidi
  2009-03-09 11:50 ` Takashi Iwai
  0 siblings, 1 reply; 12+ messages in thread
From: Gregorio Guidi @ 2009-03-08 20:19 UTC (permalink / raw)
  To: alsa-devel

Hi, I have an Intel HDA card, Conexant CX20551 (Waikiki) model,
Subsystem Id: 0x103c30b2 (HP DV2000 series).

With these settings, there are 4 volume controls: "PCM-2" and "Speaker" to 
control speakers, "PCM" and "Headphone" to control headphones.
At the moment "PCM-2", "Speaker", "PCM" work fine, but "Headphone" has no effect 
(also reported inside bug #3091).

With the following patch, the "Headphone" volume/switch work 
as intended, with no effect on other functionalities.

--- patch_conexant.c    2009-03-08 21:10:14.000000000 +0100
+++ patch_conexant.c.new        2009-03-08 21:09:51.000000000 +0100
@@ -1357,7 +1357,7 @@
        {0x17, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_IN|AC_PINCTL_VREF_50 },
        /* HP, Speaker  */
        {0x13, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP },
-       {0x13, AC_VERB_SET_CONNECT_SEL,0x1},
+       {0x13, AC_VERB_SET_CONNECT_SEL,0x0},
        {0x1d, AC_VERB_SET_CONNECT_SEL,0x0},
        /* Record selector: Mic */
        {0x12, AC_VERB_SET_CONNECT_SEL,0x03},


Also, there is no "Master" control to set the volume for both speakers and 
headphones. The patch below adds a master volume (and a master 
switch) that work ok for me. By the way, with the patch the light on the mute 
button changes between blue and red, which is a nice plus.

--- patch_conexant.c    2009-03-08 21:11:14.000000000 +0100
+++ patch_conexant.c.new        2009-03-08 21:11:01.000000000 +0100
@@ -1293,6 +1293,15 @@
        HDA_CODEC_MUTE("Speaker Playback Switch", 0x1d, 0x00, HDA_OUTPUT),
        HDA_CODEC_VOLUME("Headphone Playback Volume", 0x13, 0x00, HDA_OUTPUT),
        HDA_CODEC_MUTE("Headphone Playback Switch", 0x13, 0x00, HDA_OUTPUT),
+       HDA_BIND_VOL("Master Playback Volume", &cxt5047_bind_master_vol),
+       {
+               .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
+               .name = "Master Playback Switch",
+               .info = cxt_eapd_info,
+               .get = cxt_eapd_get,
+               .put = cxt5047_hp_master_sw_put,
+               .private_value = 0x13,
+       },

        {}
 };


I am no expert of Conexant hardware and I don't know if those changes are 
correct for all the devices that share the same code (the 103c:30xx), but 
I'm confident that they are the right ones for the 103c:30b2 device.

Can someone take a look? Thanks.

Gregorio Guidi

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

* Re: [PATCH] fix headphone settings and master volume (Conexant CX20551 0x103c30b2)
  2009-03-08 20:19 [PATCH] fix headphone settings and master volume (Conexant CX20551 0x103c30b2) Gregorio Guidi
@ 2009-03-09 11:50 ` Takashi Iwai
  2009-03-09 14:49   ` Gregorio Guidi
  0 siblings, 1 reply; 12+ messages in thread
From: Takashi Iwai @ 2009-03-09 11:50 UTC (permalink / raw)
  To: Gregorio Guidi; +Cc: alsa-devel

At Sun, 8 Mar 2009 21:19:41 +0100,
Gregorio Guidi wrote:
> 
> Hi, I have an Intel HDA card, Conexant CX20551 (Waikiki) model,
> Subsystem Id: 0x103c30b2 (HP DV2000 series).
> 
> With these settings, there are 4 volume controls: "PCM-2" and "Speaker" to 
> control speakers, "PCM" and "Headphone" to control headphones.
> At the moment "PCM-2", "Speaker", "PCM" work fine, but "Headphone" has no effect 
> (also reported inside bug #3091).

Does the current driver work with model=laptop-hp option?


thanks,

Takashi

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

* Re: [PATCH] fix headphone settings and master volume (Conexant CX20551 0x103c30b2)
  2009-03-09 11:50 ` Takashi Iwai
@ 2009-03-09 14:49   ` Gregorio Guidi
  2009-03-09 15:04     ` Takashi Iwai
  0 siblings, 1 reply; 12+ messages in thread
From: Gregorio Guidi @ 2009-03-09 14:49 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: alsa-devel

On Monday 09 March 2009 12:50:10 Takashi Iwai wrote:
> At Sun, 8 Mar 2009 21:19:41 +0100,
>
> Gregorio Guidi wrote:
> > Hi, I have an Intel HDA card, Conexant CX20551 (Waikiki) model,
> > Subsystem Id: 0x103c30b2 (HP DV2000 series).
> >
> > With these settings, there are 4 volume controls: "PCM-2" and "Speaker"
> > to control speakers, "PCM" and "Headphone" to control headphones.
> > At the moment "PCM-2", "Speaker", "PCM" work fine, but "Headphone" has no
> > effect (also reported inside bug #3091).
>
> Does the current driver work with model=laptop-hp option?

I did try the laptop-hp option. I got only two controls: PCM and Master, PCM 
controlled both speakers and headphones, while Master controlled only the 
headphones (in fact the "Master" control for model=laptop-hp is the same as 
the "Headphone" control for model=laptop with the patch). There is no automute 
when plugging headphones.

By the way, I was incorrect: also with model=laptop (the default) "PCM" 
controls both speakers and headphones (PCM-2 only the speakers).

Let me know if you need info or you have something to test.

Gregorio Guidi

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

* Re: [PATCH] fix headphone settings and master volume (Conexant CX20551 0x103c30b2)
  2009-03-09 14:49   ` Gregorio Guidi
@ 2009-03-09 15:04     ` Takashi Iwai
  2009-03-09 19:19       ` Gregorio Guidi
  0 siblings, 1 reply; 12+ messages in thread
From: Takashi Iwai @ 2009-03-09 15:04 UTC (permalink / raw)
  To: Gregorio Guidi; +Cc: alsa-devel

At Mon, 9 Mar 2009 15:49:47 +0100,
Gregorio Guidi wrote:
> 
> On Monday 09 March 2009 12:50:10 Takashi Iwai wrote:
> > At Sun, 8 Mar 2009 21:19:41 +0100,
> >
> > Gregorio Guidi wrote:
> > > Hi, I have an Intel HDA card, Conexant CX20551 (Waikiki) model,
> > > Subsystem Id: 0x103c30b2 (HP DV2000 series).
> > >
> > > With these settings, there are 4 volume controls: "PCM-2" and "Speaker"
> > > to control speakers, "PCM" and "Headphone" to control headphones.
> > > At the moment "PCM-2", "Speaker", "PCM" work fine, but "Headphone" has no
> > > effect (also reported inside bug #3091).
> >
> > Does the current driver work with model=laptop-hp option?
> 
> I did try the laptop-hp option. I got only two controls: PCM and Master, PCM 
> controlled both speakers and headphones, while Master controlled only the 
> headphones (in fact the "Master" control for model=laptop-hp is the same as 
> the "Headphone" control for model=laptop with the patch). There is no automute 
> when plugging headphones.
> 
> By the way, I was incorrect: also with model=laptop (the default) "PCM" 
> controls both speakers and headphones (PCM-2 only the speakers).

OK.

> Let me know if you need info or you have something to test.

Could you run alsa-info with --no-upload and give the generated file?
The script is found at:
	http://www.alsa-project.org/alsa-info.sh

We can use vmaster to control these stuff nowadays without strange
eapd hack for a master control.


thanks,

Takashi

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

* Re: [PATCH] fix headphone settings and master volume (Conexant CX20551 0x103c30b2)
  2009-03-09 15:04     ` Takashi Iwai
@ 2009-03-09 19:19       ` Gregorio Guidi
  2009-03-10 14:49         ` Takashi Iwai
  0 siblings, 1 reply; 12+ messages in thread
From: Gregorio Guidi @ 2009-03-09 19:19 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: alsa-devel

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

On Monday 09 March 2009 16:04:56 Takashi Iwai wrote:
> At Mon, 9 Mar 2009 15:49:47 +0100,
>
> Gregorio Guidi wrote:
> > On Monday 09 March 2009 12:50:10 Takashi Iwai wrote:
> > > At Sun, 8 Mar 2009 21:19:41 +0100,
> > >
> > > Gregorio Guidi wrote:
> > > > Hi, I have an Intel HDA card, Conexant CX20551 (Waikiki) model,
> > > > Subsystem Id: 0x103c30b2 (HP DV2000 series).
> > > >
> > > > With these settings, there are 4 volume controls: "PCM-2" and
> > > > "Speaker" to control speakers, "PCM" and "Headphone" to control
> > > > headphones. At the moment "PCM-2", "Speaker", "PCM" work fine, but
> > > > "Headphone" has no effect (also reported inside bug #3091).
> > >
> > > Does the current driver work with model=laptop-hp option?
> >
> > I did try the laptop-hp option. I got only two controls: PCM and Master,
> > PCM controlled both speakers and headphones, while Master controlled only
> > the headphones (in fact the "Master" control for model=laptop-hp is the
> > same as the "Headphone" control for model=laptop with the patch). There
> > is no automute when plugging headphones.
> >
> > By the way, I was incorrect: also with model=laptop (the default) "PCM"
> > controls both speakers and headphones (PCM-2 only the speakers).
>
> OK.
>
> > Let me know if you need info or you have something to test.
>
> Could you run alsa-info with --no-upload and give the generated file?
> The script is found at:
> 	http://www.alsa-project.org/alsa-info.sh
>
> We can use vmaster to control these stuff nowadays without strange
> eapd hack for a master control.

All right, alsa-info.txt is attached.
Version running is the one in kernel 2.6.28.7 plus the two patches.

Gregorio


[-- Attachment #2: alsa-info.txt --]
[-- Type: text/plain, Size: 15552 bytes --]

upload=true&script=true&cardinfo=
!!################################
!!ALSA Information Script v 0.4.56
!!################################

!!Script ran on: Mon Mar  9 19:03:25 UTC 2009


!!Linux Distribution
!!------------------

Gentoo Base System release 1.12.11.1


!!Kernel Information
!!------------------

Kernel release:    2.6.28.7
Operating System:  GNU/Linux
Architecture:      i686
Processor:         Genuine Intel(R) CPU T2250 @ 1.73GHz
SMP Enabled:       Yes


!!ALSA Version
!!------------

Driver version:     1.0.18rc3
Library version:    1.0.17a
Utilities version:  1.0.17


!!Loaded ALSA modules
!!-------------------



!!Sound Servers on this system
!!----------------------------

aRts:
      Installed - Yes (/usr/kde/3.5/bin/artsd)
      Running - No


!!Soundcards recognised by ALSA
!!-----------------------------

 0 [Intel          ]: HDA-Intel - HDA Intel
                      HDA Intel at 0xd4340000 irq 22


!!PCI Soundcards installed in the system
!!--------------------------------------

00:1b.0 Audio device: Intel Corporation 82801G (ICH7 Family) High Definition Audio Controller (rev 02)


!!Advanced information - PCI Vendor/Device/Susbsystem ID's
!!--------------------------------------------------------

00:1b.0 0403: 8086:27d8 (rev 02)
	Subsystem: 103c:30b2


!!Loaded sound module options
!!--------------------------


!!HDA-Intel Codec information
!!---------------------------
--startcollapse--

Codec: Conexant CX20551 (Waikiki)
Address: 0
Vendor Id: 0x14f15047
Subsystem Id: 0x103c30b2
Revision Id: 0x100000
Modem Function Group: 0x2
Default PCM:
    rates [0x40]: 48000
    bits [0x2]: 16
    formats [0x1]: PCM
Default Amp-In caps: N/A
Default Amp-Out caps: N/A
GPIO: io=0, o=0, i=0, unsolicited=0, wake=0
Node 0x10 [Audio Output] wcaps 0x41d: Stereo Amp-Out
  Amp-Out caps: ofs=0x17, nsteps=0x1e, stepsize=0x05, mute=1
  Amp-Out vals:  [0x1e 0x1e]
  Converter: stream=0, channel=0
  PCM:
    rates [0x40]: 48000
    bits [0x2]: 16
    formats [0x1]: PCM
  Power: setting=D0, actual=D0
Node 0x11 [Audio Output] wcaps 0x611: Stereo Digital
  Converter: stream=0, channel=0
  Digital: Enabled
  Digital category: 0x0
  PCM:
    rates [0x40]: 48000
    bits [0x2]: 16
    formats [0x1]: PCM
  Power: setting=D0, actual=D0
Node 0x12 [Audio Input] wcaps 0x100d1b: Stereo Amp-In R/L
  Amp-In caps: ofs=0x00, nsteps=0x0e, stepsize=0x05, mute=1
  Amp-In vals:  [0x80 0x80] [0x80 0x80] [0x80 0x80] [0x0e 0x0e] [0x80 0x80] [0x80 0x80]
  Converter: stream=0, channel=0
  SDI-Select: 0
  PCM:
    rates [0x40]: 48000
    bits [0x2]: 16
    formats [0x1]: PCM
  Power: setting=D0, actual=D0
  Connection: 6
     0x19 0x14 0x15 0x1a* 0x16 0x10
Node 0x13 [Pin Complex] wcaps 0x40058d: Stereo Amp-Out
  Amp-Out caps: ofs=0x1f, nsteps=0x1e, stepsize=0x05, mute=1
  Amp-Out vals:  [0x0f 0x0f]
  Pincap 0x0001001c: OUT HP EAPD Detect
  EAPD 0x2: EAPD
  Pin Default 0x0221101f: [Jack] HP Out at Ext Front
    Conn = 1/8, Color = Black
    DefAssociation = 0x1, Sequence = 0xf
  Pin-ctls: 0xc0: OUT HP
  Unsolicited: tag=37, enabled=1
  Power: setting=D0, actual=D0
  Connection: 3
     0x19* 0x10 0x16
Node 0x14 [Pin Complex] wcaps 0x40058d: Stereo Amp-Out
  Amp-Out caps: ofs=0x1f, nsteps=0x1e, stepsize=0x05, mute=1
  Amp-Out vals:  [0x1f 0x1f]
  Pincap 0x0000033c: IN OUT HP Detect
    Vref caps: HIZ 50
  Pin Default 0x02a1102e: [Jack] Mic at Ext Front
    Conn = 1/8, Color = Black
    DefAssociation = 0x2, Sequence = 0xe
  Pin-ctls: 0x20: IN VREF_HIZ
  Unsolicited: tag=00, enabled=0
  Power: setting=D0, actual=D0
  Connection: 2
     0x19* 0x16
Node 0x15 [Pin Complex] wcaps 0x40058d: Stereo Amp-Out
  Amp-Out caps: ofs=0x1f, nsteps=0x1e, stepsize=0x05, mute=1
  Amp-Out vals:  [0x1f 0x1f]
  Pincap 0x0000033c: IN OUT HP Detect
    Vref caps: HIZ 50
  Pin Default 0x40000180: [N/A] Line Out at Ext N/A
    Conn = Unknown, Color = Unknown
    DefAssociation = 0x8, Sequence = 0x0
    Misc = NO_PRESENCE
  Pin-ctls: 0x21: IN VREF_50
  Unsolicited: tag=38, enabled=1
  Power: setting=D0, actual=D0
  Connection: 3
     0x1c 0x19* 0x16
Node 0x16 [Pin Complex] wcaps 0x400401: Stereo
  Pincap 0x00000060: IN Balanced
  Pin Default 0x94330121: [Fixed] CD at Int Right
    Conn = ATAPI, Color = Unknown
    DefAssociation = 0x2, Sequence = 0x1
    Misc = NO_PRESENCE
  Pin-ctls: 0x20: IN
  Power: setting=D0, actual=D0
Node 0x17 [Pin Complex] wcaps 0x400481: Stereo
  Pincap 0x00000324: IN Detect
    Vref caps: HIZ 50
  Pin Default 0x95a70122: [Fixed] Mic at Int Top
    Conn = Analog, Color = Unknown
    DefAssociation = 0x2, Sequence = 0x2
    Misc = NO_PRESENCE
  Pin-ctls: 0x21: IN VREF_50
  Unsolicited: tag=00, enabled=0
  Power: setting=D0, actual=D0
Node 0x18 [Pin Complex] wcaps 0x400701: Stereo Digital
  Pincap 0x00000010: OUT
  Pin Default 0x04440131: [Jack] SPDIF Out at Ext Right
    Conn = RCA, Color = Unknown
    DefAssociation = 0x3, Sequence = 0x1
    Misc = NO_PRESENCE
  Pin-ctls: 0x00:
  Power: setting=D0, actual=D0
  Connection: 1
     0x11
Node 0x19 [Audio Mixer] wcaps 0x20050b: Stereo Amp-In
  Amp-In caps: ofs=0x17, nsteps=0x1e, stepsize=0x05, mute=1
  Amp-In vals:  [0x17 0x17] [0x80 0x80] [0x80 0x80] [0x17 0x17]
  Power: setting=D0, actual=D0
  Connection: 4
     0x10 0x1b 0x1a 0x16
Node 0x1a [Audio Selector] wcaps 0x30050d: Stereo Amp-Out
  Amp-Out caps: ofs=0x00, nsteps=0x03, stepsize=0x1f, mute=0
  Amp-Out vals:  [0x01 0x01]
  Power: setting=D0, actual=D0
  Connection: 3
     0x15 0x14 0x17*
Node 0x1b [Audio Selector] wcaps 0x300501: Stereo
  Power: setting=D0, actual=D0
  Connection: 2
     0x14* 0x15
Node 0x1c [Audio Output] wcaps 0x41d: Stereo Amp-Out
  Amp-Out caps: ofs=0x17, nsteps=0x1e, stepsize=0x05, mute=1
  Amp-Out vals:  [0x97 0x97]
  Converter: stream=0, channel=0
  PCM:
    rates [0x40]: 48000
    bits [0x2]: 16
    formats [0x1]: PCM
  Power: setting=D0, actual=D0
Node 0x1d [Pin Complex] wcaps 0x40058d: Stereo Amp-Out
  Amp-Out caps: ofs=0x1f, nsteps=0x1e, stepsize=0x05, mute=1
  Amp-Out vals:  [0x8f 0x8f]
  Pincap 0x00000314: OUT Detect
    Vref caps: HIZ 50
  Pin Default 0x92170110: [Fixed] Speaker at Int Front
    Conn = Analog, Color = Unknown
    DefAssociation = 0x1, Sequence = 0x0
    Misc = NO_PRESENCE
  Pin-ctls: 0x40: OUT VREF_HIZ
  Unsolicited: tag=00, enabled=0
  Power: setting=D0, actual=D0
  Connection: 3
     0x1c* 0x19 0x16
Node 0x1e [Vendor Defined Widget] wcaps 0xf00000: Mono
--endcollapse--


!!ALSA Device nodes
!!-----------------

crw-rw---- 1 root audio 116,  0 Mar  9  2009 /dev/snd/controlC0
crw-rw---- 1 root audio 116, 24 Mar  9 19:46 /dev/snd/pcmC0D0c
crw-rw---- 1 root audio 116, 16 Mar  9 19:46 /dev/snd/pcmC0D0p
crw-rw---- 1 root audio 116, 17 Mar  9  2009 /dev/snd/pcmC0D1p
crw-rw---- 1 root audio 116, 33 Mar  9  2009 /dev/snd/timer


!!Aplay/Arecord output
!!------------

APLAY

**** List of PLAYBACK Hardware Devices ****
card 0: Intel [HDA Intel], device 0: CONEXANT Analog [CONEXANT Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: Intel [HDA Intel], device 1: Conexant Digital [Conexant Digital]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

ARECORD

**** List of CAPTURE Hardware Devices ****
card 0: Intel [HDA Intel], device 0: CONEXANT Analog [CONEXANT Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

!!Amixer output
!!-------------

!!-------Mixer controls for card 0 [Intel]

Card hw:0 'Intel'/'HDA Intel at 0xd4340000 irq 22'
  Mixer name	: 'Conexant CX20551 (Waikiki)'
  Components	: 'HDA:14f15047,103c30b2,00100000'
  Controls      : 23
  Simple ctrls  : 11
Simple mixer control 'Master',0
  Capabilities: pvolume pswitch pswitch-joined
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 30
  Mono:
  Front Left: Playback 15 [50%] [-24.00dB] [on]
  Front Right: Playback 15 [50%] [-24.00dB] [on]
Simple mixer control 'Headphone',0
  Capabilities: pvolume pswitch
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 30
  Mono:
  Front Left: Playback 15 [50%] [-24.00dB] [on]
  Front Right: Playback 15 [50%] [-24.00dB] [on]
Simple mixer control 'PCM',0
  Capabilities: pvolume pswitch
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 255
  Mono:
  Front Left: Playback 255 [100%] [0.00dB] [on]
  Front Right: Playback 255 [100%] [0.00dB] [on]
Simple mixer control 'PCM-2',0
  Capabilities: volume pswitch
  Playback channels: Front Left - Front Right
  Capture channels: Front Left - Front Right
  Limits: 0 - 30
  Front Left: 23 [77%] [0.00dB] Playback [off]
  Front Right: 23 [77%] [0.00dB] Playback [off]
Simple mixer control 'Mic Bypass',0
  Capabilities: cvolume cswitch
  Capture channels: Front Left - Front Right
  Limits: Capture 0 - 30
  Front Left: Capture 0 [0%] [-34.50dB] [off]
  Front Right: Capture 0 [0%] [-34.50dB] [off]
Simple mixer control 'Mic Gain',0
  Capabilities: volume pswitch
  Playback channels: Front Left - Front Right
  Capture channels: Front Left - Front Right
  Limits: 0 - 3
  Front Left: 1 [33%] [8.00dB] Playback [off]
  Front Right: 1 [33%] [8.00dB] Playback [off]
Simple mixer control 'IEC958',0
  Capabilities: pswitch pswitch-joined
  Playback channels: Mono
  Mono: Playback [on]
Simple mixer control 'IEC958 Default PCM',0
  Capabilities: pswitch pswitch-joined
  Playback channels: Mono
  Mono: Playback [on]
Simple mixer control 'Capture',0
  Capabilities: cvolume cswitch
  Capture channels: Front Left - Front Right
  Limits: Capture 0 - 14
  Front Left: Capture 14 [100%] [21.00dB] [on]
  Front Right: Capture 14 [100%] [21.00dB] [on]
Simple mixer control 'Digital',0
  Capabilities: cvolume
  Capture channels: Front Left - Front Right
  Limits: Capture 0 - 120
  Front Left: Capture 120 [100%] [30.00dB]
  Front Right: Capture 120 [100%] [30.00dB]
Simple mixer control 'Speaker',0
  Capabilities: pvolume pswitch
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 30
  Mono:
  Front Left: Playback 15 [50%] [-24.00dB] [off]
  Front Right: Playback 15 [50%] [-24.00dB] [off]


!!Alsactl output
!!-------------

--startcollapse--
state.Intel {
	control.1 {
		comment.access 'read write'
		comment.type INTEGER
		comment.count 2
		comment.range '0 - 30'
		comment.dbmin -3450
		comment.dbmax 1050
		iface MIXER
		name 'Mic Bypass Capture Volume'
		value.0 0
		value.1 0
	}
	control.2 {
		comment.access 'read write'
		comment.type BOOLEAN
		comment.count 2
		iface MIXER
		name 'Mic Bypass Capture Switch'
		value.0 false
		value.1 false
	}
	control.3 {
		comment.access 'read write'
		comment.type INTEGER
		comment.count 2
		comment.range '0 - 3'
		comment.dbmin 0
		comment.dbmax 2400
		iface MIXER
		name 'Mic Gain Volume'
		value.0 1
		value.1 1
	}
	control.4 {
		comment.access 'read write'
		comment.type BOOLEAN
		comment.count 2
		iface MIXER
		name 'Mic Gain Switch'
		value.0 false
		value.1 false
	}
	control.5 {
		comment.access 'read write'
		comment.type INTEGER
		comment.count 2
		comment.range '0 - 14'
		comment.dbmin 0
		comment.dbmax 2100
		iface MIXER
		name 'Capture Volume'
		value.0 14
		value.1 14
	}
	control.6 {
		comment.access 'read write'
		comment.type BOOLEAN
		comment.count 2
		iface MIXER
		name 'Capture Switch'
		value.0 true
		value.1 true
	}
	control.7 {
		comment.access 'read write'
		comment.type INTEGER
		comment.count 2
		comment.range '0 - 30'
		comment.dbmin -3450
		comment.dbmax 1050
		iface MIXER
		name 'PCM Volume'
		value.0 30
		value.1 30
	}
	control.8 {
		comment.access 'read write'
		comment.type BOOLEAN
		comment.count 2
		iface MIXER
		name 'PCM Switch'
		value.0 true
		value.1 true
	}
	control.9 {
		comment.access 'read write'
		comment.type INTEGER
		comment.count 2
		comment.range '0 - 30'
		comment.dbmin -3450
		comment.dbmax 1050
		iface MIXER
		name 'PCM-2 Volume'
		value.0 23
		value.1 23
	}
	control.10 {
		comment.access 'read write'
		comment.type BOOLEAN
		comment.count 2
		iface MIXER
		name 'PCM-2 Switch'
		value.0 false
		value.1 false
	}
	control.11 {
		comment.access 'read write'
		comment.type INTEGER
		comment.count 2
		comment.range '0 - 30'
		comment.dbmin -4650
		comment.dbmax -150
		iface MIXER
		name 'Speaker Playback Volume'
		value.0 15
		value.1 15
	}
	control.12 {
		comment.access 'read write'
		comment.type BOOLEAN
		comment.count 2
		iface MIXER
		name 'Speaker Playback Switch'
		value.0 false
		value.1 false
	}
	control.13 {
		comment.access 'read write'
		comment.type INTEGER
		comment.count 2
		comment.range '0 - 30'
		comment.dbmin -4650
		comment.dbmax -150
		iface MIXER
		name 'Headphone Playback Volume'
		value.0 15
		value.1 15
	}
	control.14 {
		comment.access 'read write'
		comment.type BOOLEAN
		comment.count 2
		iface MIXER
		name 'Headphone Playback Switch'
		value.0 true
		value.1 true
	}
	control.15 {
		comment.access 'read write'
		comment.type INTEGER
		comment.count 2
		comment.range '0 - 30'
		comment.dbmin -4650
		comment.dbmax -150
		iface MIXER
		name 'Master Playback Volume'
		value.0 15
		value.1 15
	}
	control.16 {
		comment.access 'read write'
		comment.type BOOLEAN
		comment.count 1
		iface MIXER
		name 'Master Playback Switch'
		value true
	}
	control.17 {
		comment.access read
		comment.type IEC958
		comment.count 1
		iface MIXER
		name 'IEC958 Playback Con Mask'
		value '0fff000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'
	}
	control.18 {
		comment.access read
		comment.type IEC958
		comment.count 1
		iface MIXER
		name 'IEC958 Playback Pro Mask'
		value '0f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'
	}
	control.19 {
		comment.access 'read write'
		comment.type IEC958
		comment.count 1
		iface MIXER
		name 'IEC958 Playback Default'
		value '0400000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000'
	}
	control.20 {
		comment.access 'read write'
		comment.type BOOLEAN
		comment.count 1
		iface MIXER
		name 'IEC958 Playback Switch'
		value true
	}
	control.21 {
		comment.access 'read write'
		comment.type BOOLEAN
		comment.count 1
		iface MIXER
		name 'IEC958 Default PCM Playback Switch'
		value true
	}
	control.22 {
		comment.access 'read write user'
		comment.type INTEGER
		comment.count 2
		comment.range '0 - 255'
		comment.tlv '0000000100000008ffffec1400000014'
		comment.dbmin -5100
		comment.dbmax 0
		iface MIXER
		name 'PCM Playback Volume'
		value.0 255
		value.1 255
	}
	control.23 {
		comment.access 'read write user'
		comment.type INTEGER
		comment.count 2
		comment.range '0 - 120'
		comment.tlv '0000000100000008fffff44800000032'
		comment.dbmin -3000
		comment.dbmax 3000
		iface MIXER
		name 'Digital Capture Volume'
		value.0 120
		value.1 120
	}
}
--endcollapse--


!!All Loaded Modules
!!------------------

Module
ppp_async
ppp_generic
slhc
option
usbserial



[-- 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	[flat|nested] 12+ messages in thread

* Re: [PATCH] fix headphone settings and master volume (Conexant CX20551 0x103c30b2)
  2009-03-09 19:19       ` Gregorio Guidi
@ 2009-03-10 14:49         ` Takashi Iwai
  2009-03-11 21:22           ` Gregorio Guidi
  0 siblings, 1 reply; 12+ messages in thread
From: Takashi Iwai @ 2009-03-10 14:49 UTC (permalink / raw)
  To: Gregorio Guidi; +Cc: alsa-devel

At Mon, 9 Mar 2009 20:19:35 +0100,
Gregorio Guidi wrote:
> 
> On Monday 09 March 2009 16:04:56 Takashi Iwai wrote:
> > At Mon, 9 Mar 2009 15:49:47 +0100,
> >
> > Gregorio Guidi wrote:
> > > On Monday 09 March 2009 12:50:10 Takashi Iwai wrote:
> > > > At Sun, 8 Mar 2009 21:19:41 +0100,
> > > >
> > > > Gregorio Guidi wrote:
> > > > > Hi, I have an Intel HDA card, Conexant CX20551 (Waikiki) model,
> > > > > Subsystem Id: 0x103c30b2 (HP DV2000 series).
> > > > >
> > > > > With these settings, there are 4 volume controls: "PCM-2" and
> > > > > "Speaker" to control speakers, "PCM" and "Headphone" to control
> > > > > headphones. At the moment "PCM-2", "Speaker", "PCM" work fine, but
> > > > > "Headphone" has no effect (also reported inside bug #3091).
> > > >
> > > > Does the current driver work with model=laptop-hp option?
> > >
> > > I did try the laptop-hp option. I got only two controls: PCM and Master,
> > > PCM controlled both speakers and headphones, while Master controlled only
> > > the headphones (in fact the "Master" control for model=laptop-hp is the
> > > same as the "Headphone" control for model=laptop with the patch). There
> > > is no automute when plugging headphones.
> > >
> > > By the way, I was incorrect: also with model=laptop (the default) "PCM"
> > > controls both speakers and headphones (PCM-2 only the speakers).
> >
> > OK.
> >
> > > Let me know if you need info or you have something to test.
> >
> > Could you run alsa-info with --no-upload and give the generated file?
> > The script is found at:
> > 	http://www.alsa-project.org/alsa-info.sh
> >
> > We can use vmaster to control these stuff nowadays without strange
> > eapd hack for a master control.
> 
> All right, alsa-info.txt is attached.
> Version running is the one in kernel 2.6.28.7 plus the two patches.

Thanks, that helps for debugging.

Looking through the current patch_conexant.c, there are other messy
codes there, too.  So I cleaned up and fixed it on sound git tree
now.  Any chance to try it out?  The GIT tree is found at:

   git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6.git

and the snapshot tarball for external alsa-driver module build is

   ftp://ftp.kernel.org/pub/linux/kernel/people/tiwai/snapshot/alsa-driver-snapshot.tar.gz


Takashi

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

* Re: [PATCH] fix headphone settings and master volume (Conexant CX20551 0x103c30b2)
  2009-03-10 14:49         ` Takashi Iwai
@ 2009-03-11 21:22           ` Gregorio Guidi
  2009-03-12  6:43             ` Takashi Iwai
  0 siblings, 1 reply; 12+ messages in thread
From: Gregorio Guidi @ 2009-03-11 21:22 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: alsa-devel

On Tuesday 10 March 2009 15:49:38 Takashi Iwai wrote:
> At Mon, 9 Mar 2009 20:19:35 +0100,
>
> ...
>
> Thanks, that helps for debugging.
>
> Looking through the current patch_conexant.c, there are other messy
> codes there, too.  So I cleaned up and fixed it on sound git tree
> now.  Any chance to try it out?  The GIT tree is found at:
>
>    git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6.git

I managed to test a kernel snapshot with the latest changes, thanks for taking 
the time to refactor and clean up the code there.
There are still issues, though: at the moment, the "Speaker" control does not 
work. Consequently, automute does not work and Master only controls 
headphones.

I think there is a problem with this changeset:
http://git.kernel.org/?p=linux/kernel/git/tiwai/sound-2.6.git;a=commitdiff;h=5b3a7440cbabdda07cfb3dcf4a07e0115a3dff9a

Specifically, I had to revert part of that patch to get all the functionality 
back. The bits I reverted are in the patch at the end of the mail.

It looks like these two lines:
	static hda_nid_t cxt5047_dac_nids[2] = { 0x10, 0x1c };
	...
	{0x1d, AC_VERB_SET_CONNECT_SEL, 0x0}

are needed to have a working "Speaker" control, you probably know better than 
me what it means. 
I also readded the "PCM-2" lines. While not strictly necessary, if they are 
not there the speaker volume is stuck at a very low level and cannot be 
raised, as if the PCM-2 volume starts at a low value at boot. Actually, if I 
recall correctly the low speaker volume was a problem in early versions of the 
driver and the "PCM-2" controls were introduced for that reason.
But obviously if there is a way to avoid the widget 0x1c and have a working 
"Speaker" control that would be best.

Hope this makes some sense to you.

Gregorio

--- patch_conexant.c.orig       2009-03-11 22:02:44.000000000 +0100
+++ patch_conexant.c    2009-03-11 22:03:09.000000000 +0100
@@ -1165,7 +1165,7 @@
 /* Conexant 5047 specific */
 #define CXT5047_SPDIF_OUT      0x11

-static hda_nid_t cxt5047_dac_nids[1] = { 0x10 }; /* 0x1c */
+static hda_nid_t cxt5047_dac_nids[2] = { 0x10, 0x1c };
 static hda_nid_t cxt5047_adc_nids[1] = { 0x12 };
 static hda_nid_t cxt5047_capsrc_nids[1] = { 0x1a };

@@ -1263,6 +1263,8 @@
        HDA_CODEC_MUTE("Capture Switch", 0x12, 0x03, HDA_INPUT),
        HDA_CODEC_VOLUME("PCM Volume", 0x10, 0x00, HDA_OUTPUT),
        HDA_CODEC_MUTE("PCM Switch", 0x10, 0x00, HDA_OUTPUT),
+       HDA_CODEC_VOLUME("PCM-2 Volume", 0x1c, 0x00, HDA_OUTPUT),
+       HDA_CODEC_MUTE("PCM-2 Switch", 0x1c, 0x00, HDA_OUTPUT),
        {
                .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
                .name = "Master Playback Switch",
@@ -1294,7 +1296,7 @@
        /* HP, Speaker  */
        {0x13, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP },
        {0x13, AC_VERB_SET_CONNECT_SEL, 0x0}, /* mixer(0x19) */
-       {0x1d, AC_VERB_SET_CONNECT_SEL, 0x1}, /* mixer(0x19) */
+       {0x1d, AC_VERB_SET_CONNECT_SEL, 0x0}, /* mixer(0x19) */
        /* Record selector: Mic */
        {0x12, AC_VERB_SET_CONNECT_SEL,0x03},
        {0x19, AC_VERB_SET_AMP_GAIN_MUTE,

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

* Re: [PATCH] fix headphone settings and master volume (Conexant CX20551 0x103c30b2)
  2009-03-11 21:22           ` Gregorio Guidi
@ 2009-03-12  6:43             ` Takashi Iwai
  2009-03-12 14:00               ` Gregorio Guidi
  0 siblings, 1 reply; 12+ messages in thread
From: Takashi Iwai @ 2009-03-12  6:43 UTC (permalink / raw)
  To: Gregorio Guidi; +Cc: alsa-devel

At Wed, 11 Mar 2009 22:22:39 +0100,
Gregorio Guidi wrote:
> 
> On Tuesday 10 March 2009 15:49:38 Takashi Iwai wrote:
> > At Mon, 9 Mar 2009 20:19:35 +0100,
> >
> > ...
> >
> > Thanks, that helps for debugging.
> >
> > Looking through the current patch_conexant.c, there are other messy
> > codes there, too.  So I cleaned up and fixed it on sound git tree
> > now.  Any chance to try it out?  The GIT tree is found at:
> >
> >    git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6.git
> 
> I managed to test a kernel snapshot with the latest changes, thanks for taking 
> the time to refactor and clean up the code there.

Thanks for testing.

> There are still issues, though: at the moment, the "Speaker" control does not 
> work. Consequently, automute does not work and Master only controls 
> headphones.

Hm, doesn't "Speaker" give any change if you unplug the headphone?
It should change the output volume of widget 0x1d.  If it's true, there
can be a few reasons:

A. The real speaker output pin isn't 0x1d but another pin

B. The widget 0x1d has a problem with connection to 0x19

C. The widget 0x1d has no output amp control despite the description

> I think there is a problem with this changeset:
> http://git.kernel.org/?p=linux/kernel/git/tiwai/sound-2.6.git;a=commitdiff;h=5b3a7440cbabdda07cfb3dcf4a07e0115a3dff9a
> 
> Specifically, I had to revert part of that patch to get all the functionality 
> back. The bits I reverted are in the patch at the end of the mail.
> 
> It looks like these two lines:
> 	static hda_nid_t cxt5047_dac_nids[2] = { 0x10, 0x1c };
> 	...
> 	{0x1d, AC_VERB_SET_CONNECT_SEL, 0x0}
> 
> are needed to have a working "Speaker" control, you probably know better than 
> me what it means. 
> I also readded the "PCM-2" lines. While not strictly necessary, if they are 
> not there the speaker volume is stuck at a very low level and cannot be 
> raised, as if the PCM-2 volume starts at a low value at boot. Actually, if I 
> recall correctly the low speaker volume was a problem in early versions of the 
> driver and the "PCM-2" controls were introduced for that reason.
> But obviously if there is a way to avoid the widget 0x1c and have a working 
> "Speaker" control that would be best.

With this change, still "Headphone" volume control (and "Master")
doesn't work?  If so, the case C above must be correct.

Also, try to figure out whether case A is right or not.  You can
change the amp volume or the connection of each pin widget via
hda-verb (or hda_analyzer), assuming you built with hwdep enabled.
See Documentation/sounds/alsa/HD-Audio.txt for details.

Anyway, it'd be also helpful if you give alsa-info output on both
working and non-working cases (also with HP plugged / unplugged).


thanks,

Takashi

> Hope this makes some sense to you.
> 
> Gregorio
> 
> --- patch_conexant.c.orig       2009-03-11 22:02:44.000000000 +0100
> +++ patch_conexant.c    2009-03-11 22:03:09.000000000 +0100
> @@ -1165,7 +1165,7 @@
>  /* Conexant 5047 specific */
>  #define CXT5047_SPDIF_OUT      0x11
> 
> -static hda_nid_t cxt5047_dac_nids[1] = { 0x10 }; /* 0x1c */
> +static hda_nid_t cxt5047_dac_nids[2] = { 0x10, 0x1c };
>  static hda_nid_t cxt5047_adc_nids[1] = { 0x12 };
>  static hda_nid_t cxt5047_capsrc_nids[1] = { 0x1a };
> 
> @@ -1263,6 +1263,8 @@
>         HDA_CODEC_MUTE("Capture Switch", 0x12, 0x03, HDA_INPUT),
>         HDA_CODEC_VOLUME("PCM Volume", 0x10, 0x00, HDA_OUTPUT),
>         HDA_CODEC_MUTE("PCM Switch", 0x10, 0x00, HDA_OUTPUT),
> +       HDA_CODEC_VOLUME("PCM-2 Volume", 0x1c, 0x00, HDA_OUTPUT),
> +       HDA_CODEC_MUTE("PCM-2 Switch", 0x1c, 0x00, HDA_OUTPUT),
>         {
>                 .iface = SNDRV_CTL_ELEM_IFACE_MIXER,
>                 .name = "Master Playback Switch",
> @@ -1294,7 +1296,7 @@
>         /* HP, Speaker  */
>         {0x13, AC_VERB_SET_PIN_WIDGET_CONTROL, PIN_HP },
>         {0x13, AC_VERB_SET_CONNECT_SEL, 0x0}, /* mixer(0x19) */
> -       {0x1d, AC_VERB_SET_CONNECT_SEL, 0x1}, /* mixer(0x19) */
> +       {0x1d, AC_VERB_SET_CONNECT_SEL, 0x0}, /* mixer(0x19) */
>         /* Record selector: Mic */
>         {0x12, AC_VERB_SET_CONNECT_SEL,0x03},
>         {0x19, AC_VERB_SET_AMP_GAIN_MUTE,
> 

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

* Re: [PATCH] fix headphone settings and master volume (Conexant CX20551 0x103c30b2)
  2009-03-12  6:43             ` Takashi Iwai
@ 2009-03-12 14:00               ` Gregorio Guidi
  2009-03-12 14:18                 ` Takashi Iwai
  0 siblings, 1 reply; 12+ messages in thread
From: Gregorio Guidi @ 2009-03-12 14:00 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: alsa-devel

On Thursday 12 March 2009 07:43:27 Takashi Iwai wrote:
> At Wed, 11 Mar 2009 22:22:39 +0100,
>
> Gregorio Guidi wrote:
> > On Tuesday 10 March 2009 15:49:38 Takashi Iwai wrote:
> > > At Mon, 9 Mar 2009 20:19:35 +0100,
> > >
> > > ...
> > >
> > > Thanks, that helps for debugging.
> > >
> > > Looking through the current patch_conexant.c, there are other messy
> > > codes there, too.  So I cleaned up and fixed it on sound git tree
> > > now.  Any chance to try it out?  The GIT tree is found at:
> > >
> > >    git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6.git
> >
> > I managed to test a kernel snapshot with the latest changes, thanks for
> > taking the time to refactor and clean up the code there.
>
> Thanks for testing.
>
> > There are still issues, though: at the moment, the "Speaker" control does
> > not work. Consequently, automute does not work and Master only controls
> > headphones.
>
> Hm, doesn't "Speaker" give any change if you unplug the headphone?
> It should change the output volume of widget 0x1d.  If it's true, there
> can be a few reasons:
>
> A. The real speaker output pin isn't 0x1d but another pin
>
> B. The widget 0x1d has a problem with connection to 0x19
>
> C. The widget 0x1d has no output amp control despite the description

To clarify: the speakers make sounds, but volume control and muting do not 
work.

Actually, now that I start to understand how these widget connections work, I 
see the problem is simpler: after changing the 0x1d connection (routing the 
speakers to 0x19) with {0x1d, AC_VERB_SET_CONNECT_SEL, 0x1}, you have to 
update the other places where the 0x1d widget is used (see patch). This also 
explains the problem originally reported where Headphone didn't work (here and 
in bug #3091).

With just the following patch applied on top of the git tree everything works 
nicely (Headphone, Speaker, Master, automute all work as expected).

diff -Nur sound-2.6.git.orig/sound/pci/hda/patch_conexant.c 
sound-2.6.git/sound/pci/hda/patch_conexant.c
--- sound-2.6.git.orig/sound/pci/hda/patch_conexant.c   2009-03-12 
14:56:20.000000000 +0100
+++ sound-2.6.git/sound/pci/hda/patch_conexant.c        2009-03-12 
14:29:48.000000000 +0100
@@ -1196,7 +1196,7 @@
         * the headphone jack
         */
        bits = (!spec->hp_present && spec->cur_eapd) ? 0 : HDA_AMP_MUTE;
-       snd_hda_codec_amp_stereo(codec, 0x1d, HDA_OUTPUT, 0,
+       snd_hda_codec_amp_stereo(codec, 0x1d, HDA_OUTPUT, 0x01,
                                 HDA_AMP_MUTE, bits);
        bits = spec->cur_eapd ? 0 : HDA_AMP_MUTE;
        snd_hda_codec_amp_stereo(codec, 0x13, HDA_OUTPUT, 0,
@@ -1214,7 +1214,7 @@
                                     AC_VERB_GET_PIN_SENSE, 0) & 0x80000000;

        bits = (spec->hp_present || !spec->cur_eapd) ? HDA_AMP_MUTE : 0;
-       snd_hda_codec_amp_stereo(codec, 0x1d, HDA_OUTPUT, 0,
+       snd_hda_codec_amp_stereo(codec, 0x1d, HDA_OUTPUT, 0x01,
                                 HDA_AMP_MUTE, bits);
 }

@@ -1276,7 +1276,7 @@
 };

 static struct snd_kcontrol_new cxt5047_hp_spk_mixers[] = {
-       HDA_CODEC_VOLUME("Speaker Playback Volume", 0x1d, 0x00, HDA_OUTPUT),
+       HDA_CODEC_VOLUME("Speaker Playback Volume", 0x1d, 0x01, HDA_OUTPUT),
        HDA_CODEC_VOLUME("Headphone Playback Volume", 0x13, 0x00, HDA_OUTPUT),
        {}
 };

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

* Re: [PATCH] fix headphone settings and master volume (Conexant CX20551 0x103c30b2)
  2009-03-12 14:00               ` Gregorio Guidi
@ 2009-03-12 14:18                 ` Takashi Iwai
  2009-03-12 14:35                   ` Gregorio Guidi
  0 siblings, 1 reply; 12+ messages in thread
From: Takashi Iwai @ 2009-03-12 14:18 UTC (permalink / raw)
  To: Gregorio Guidi; +Cc: alsa-devel

At Thu, 12 Mar 2009 15:00:35 +0100,
Gregorio Guidi wrote:
> 
> On Thursday 12 March 2009 07:43:27 Takashi Iwai wrote:
> > At Wed, 11 Mar 2009 22:22:39 +0100,
> >
> > Gregorio Guidi wrote:
> > > On Tuesday 10 March 2009 15:49:38 Takashi Iwai wrote:
> > > > At Mon, 9 Mar 2009 20:19:35 +0100,
> > > >
> > > > ...
> > > >
> > > > Thanks, that helps for debugging.
> > > >
> > > > Looking through the current patch_conexant.c, there are other messy
> > > > codes there, too.  So I cleaned up and fixed it on sound git tree
> > > > now.  Any chance to try it out?  The GIT tree is found at:
> > > >
> > > >    git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6.git
> > >
> > > I managed to test a kernel snapshot with the latest changes, thanks for
> > > taking the time to refactor and clean up the code there.
> >
> > Thanks for testing.
> >
> > > There are still issues, though: at the moment, the "Speaker" control does
> > > not work. Consequently, automute does not work and Master only controls
> > > headphones.
> >
> > Hm, doesn't "Speaker" give any change if you unplug the headphone?
> > It should change the output volume of widget 0x1d.  If it's true, there
> > can be a few reasons:
> >
> > A. The real speaker output pin isn't 0x1d but another pin
> >
> > B. The widget 0x1d has a problem with connection to 0x19
> >
> > C. The widget 0x1d has no output amp control despite the description
> 
> To clarify: the speakers make sounds, but volume control and muting do not 
> work.
> 
> Actually, now that I start to understand how these widget connections work, I 
> see the problem is simpler: after changing the 0x1d connection (routing the 
> speakers to 0x19) with {0x1d, AC_VERB_SET_CONNECT_SEL, 0x1}, you have to 
> update the other places where the 0x1d widget is used (see patch). This also 
> explains the problem originally reported where Headphone didn't work (here and 
> in bug #3091).
> 
> With just the following patch applied on top of the git tree everything works 
> nicely (Headphone, Speaker, Master, automute all work as expected).

Wow, that's a nice finding!  Yes, this explains everything.

In the HD-audio specification, the amp volume selection of a pin
widget is defined ambiguously.  Usually, the input amp takes the
index, at least for other widget types.  However, the input amp for a
pin widget means the recording (the "input" from the pin jack) while
the output amp corresponds to the output level from the jack.  So,
there is an inconsistency in the definition.

Normally, the other vendors don't use the index for the pin output
amp -- i.e. no index selection for output amps.  But it seems that
conexant codec uses it.  That's why we are fooled by this for such a
long time...

Anyway, the patch looks good.  Could you give your sign-off?


thanks,

Takashi

> diff -Nur sound-2.6.git.orig/sound/pci/hda/patch_conexant.c 
> sound-2.6.git/sound/pci/hda/patch_conexant.c
> --- sound-2.6.git.orig/sound/pci/hda/patch_conexant.c   2009-03-12 
> 14:56:20.000000000 +0100
> +++ sound-2.6.git/sound/pci/hda/patch_conexant.c        2009-03-12 
> 14:29:48.000000000 +0100
> @@ -1196,7 +1196,7 @@
>          * the headphone jack
>          */
>         bits = (!spec->hp_present && spec->cur_eapd) ? 0 : HDA_AMP_MUTE;
> -       snd_hda_codec_amp_stereo(codec, 0x1d, HDA_OUTPUT, 0,
> +       snd_hda_codec_amp_stereo(codec, 0x1d, HDA_OUTPUT, 0x01,
>                                  HDA_AMP_MUTE, bits);
>         bits = spec->cur_eapd ? 0 : HDA_AMP_MUTE;
>         snd_hda_codec_amp_stereo(codec, 0x13, HDA_OUTPUT, 0,
> @@ -1214,7 +1214,7 @@
>                                      AC_VERB_GET_PIN_SENSE, 0) & 0x80000000;
> 
>         bits = (spec->hp_present || !spec->cur_eapd) ? HDA_AMP_MUTE : 0;
> -       snd_hda_codec_amp_stereo(codec, 0x1d, HDA_OUTPUT, 0,
> +       snd_hda_codec_amp_stereo(codec, 0x1d, HDA_OUTPUT, 0x01,
>                                  HDA_AMP_MUTE, bits);
>  }
> 
> @@ -1276,7 +1276,7 @@
>  };
> 
>  static struct snd_kcontrol_new cxt5047_hp_spk_mixers[] = {
> -       HDA_CODEC_VOLUME("Speaker Playback Volume", 0x1d, 0x00, HDA_OUTPUT),
> +       HDA_CODEC_VOLUME("Speaker Playback Volume", 0x1d, 0x01, HDA_OUTPUT),
>         HDA_CODEC_VOLUME("Headphone Playback Volume", 0x13, 0x00, HDA_OUTPUT),
>         {}
>  };
> 
> 
> 

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

* Re: [PATCH] fix headphone settings and master volume (Conexant CX20551 0x103c30b2)
  2009-03-12 14:18                 ` Takashi Iwai
@ 2009-03-12 14:35                   ` Gregorio Guidi
  2009-03-12 16:11                     ` Takashi Iwai
  0 siblings, 1 reply; 12+ messages in thread
From: Gregorio Guidi @ 2009-03-12 14:35 UTC (permalink / raw)
  To: Takashi Iwai; +Cc: alsa-devel

On Thursday 12 March 2009 15:18:56 Takashi Iwai wrote:
> At Thu, 12 Mar 2009 15:00:35 +0100,
>
> Gregorio Guidi wrote:
> > On Thursday 12 March 2009 07:43:27 Takashi Iwai wrote:
> > > At Wed, 11 Mar 2009 22:22:39 +0100,
> > >
> > > Gregorio Guidi wrote:
> > > > On Tuesday 10 March 2009 15:49:38 Takashi Iwai wrote:
> > > > > At Mon, 9 Mar 2009 20:19:35 +0100,
> > > > >
> > > > > ...
> > > > >
> > > > > Thanks, that helps for debugging.
> > > > >
> > > > > Looking through the current patch_conexant.c, there are other messy
> > > > > codes there, too.  So I cleaned up and fixed it on sound git tree
> > > > > now.  Any chance to try it out?  The GIT tree is found at:
> > > > >
> > > > >   
> > > > > git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6.git
> > > >
> > > > I managed to test a kernel snapshot with the latest changes, thanks
> > > > for taking the time to refactor and clean up the code there.
> > >
> > > Thanks for testing.
> > >
> > > > There are still issues, though: at the moment, the "Speaker" control
> > > > does not work. Consequently, automute does not work and Master only
> > > > controls headphones.
> > >
> > > Hm, doesn't "Speaker" give any change if you unplug the headphone?
> > > It should change the output volume of widget 0x1d.  If it's true, there
> > > can be a few reasons:
> > >
> > > A. The real speaker output pin isn't 0x1d but another pin
> > >
> > > B. The widget 0x1d has a problem with connection to 0x19
> > >
> > > C. The widget 0x1d has no output amp control despite the description
> >
> > To clarify: the speakers make sounds, but volume control and muting do
> > not work.
> >
> > Actually, now that I start to understand how these widget connections
> > work, I see the problem is simpler: after changing the 0x1d connection
> > (routing the speakers to 0x19) with {0x1d, AC_VERB_SET_CONNECT_SEL, 0x1},
> > you have to update the other places where the 0x1d widget is used (see
> > patch). This also explains the problem originally reported where
> > Headphone didn't work (here and in bug #3091).
> >
> > With just the following patch applied on top of the git tree everything
> > works nicely (Headphone, Speaker, Master, automute all work as expected).
>
> Wow, that's a nice finding!  Yes, this explains everything.
>
> In the HD-audio specification, the amp volume selection of a pin
> widget is defined ambiguously.  Usually, the input amp takes the
> index, at least for other widget types.  However, the input amp for a
> pin widget means the recording (the "input" from the pin jack) while
> the output amp corresponds to the output level from the jack.  So,
> there is an inconsistency in the definition.
>
> Normally, the other vendors don't use the index for the pin output
> amp -- i.e. no index selection for output amps.  But it seems that
> conexant codec uses it.  That's why we are fooled by this for such a
> long time...
>
> Anyway, the patch looks good.  Could you give your sign-off?

Sure.

Update the places where the 0x1d widget is used for Conexant 5047, fixing 
mismatch introduced after changing the connection.

Signed-off-by: Gregorio Guidi <gregorio.guidi@gmail.com>

diff -Nur sound-2.6.git.orig/sound/pci/hda/patch_conexant.c 
sound-2.6.git/sound/pci/hda/patch_conexant.c
--- sound-2.6.git.orig/sound/pci/hda/patch_conexant.c   2009-03-12 
14:56:20.000000000 +0100
+++ sound-2.6.git/sound/pci/hda/patch_conexant.c        2009-03-12 
14:29:48.000000000 +0100
@@ -1196,7 +1196,7 @@
         * the headphone jack
         */
        bits = (!spec->hp_present && spec->cur_eapd) ? 0 : HDA_AMP_MUTE;
-       snd_hda_codec_amp_stereo(codec, 0x1d, HDA_OUTPUT, 0,
+       snd_hda_codec_amp_stereo(codec, 0x1d, HDA_OUTPUT, 0x01,
                                 HDA_AMP_MUTE, bits);
        bits = spec->cur_eapd ? 0 : HDA_AMP_MUTE;
        snd_hda_codec_amp_stereo(codec, 0x13, HDA_OUTPUT, 0,
@@ -1214,7 +1214,7 @@
                                     AC_VERB_GET_PIN_SENSE, 0) & 0x80000000;

        bits = (spec->hp_present || !spec->cur_eapd) ? HDA_AMP_MUTE : 0;
-       snd_hda_codec_amp_stereo(codec, 0x1d, HDA_OUTPUT, 0,
+       snd_hda_codec_amp_stereo(codec, 0x1d, HDA_OUTPUT, 0x01,
                                 HDA_AMP_MUTE, bits);
 }

@@ -1276,7 +1276,7 @@
 };

 static struct snd_kcontrol_new cxt5047_hp_spk_mixers[] = {
-       HDA_CODEC_VOLUME("Speaker Playback Volume", 0x1d, 0x00, HDA_OUTPUT),
+       HDA_CODEC_VOLUME("Speaker Playback Volume", 0x1d, 0x01, HDA_OUTPUT),
        HDA_CODEC_VOLUME("Headphone Playback Volume", 0x13, 0x00, HDA_OUTPUT),
        {}
 };

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

* Re: [PATCH] fix headphone settings and master volume (Conexant CX20551 0x103c30b2)
  2009-03-12 14:35                   ` Gregorio Guidi
@ 2009-03-12 16:11                     ` Takashi Iwai
  0 siblings, 0 replies; 12+ messages in thread
From: Takashi Iwai @ 2009-03-12 16:11 UTC (permalink / raw)
  To: Gregorio Guidi; +Cc: alsa-devel

At Thu, 12 Mar 2009 15:35:37 +0100,
Gregorio Guidi wrote:
> 
> On Thursday 12 March 2009 15:18:56 Takashi Iwai wrote:
> > At Thu, 12 Mar 2009 15:00:35 +0100,
> >
> > Gregorio Guidi wrote:
> > > On Thursday 12 March 2009 07:43:27 Takashi Iwai wrote:
> > > > At Wed, 11 Mar 2009 22:22:39 +0100,
> > > >
> > > > Gregorio Guidi wrote:
> > > > > On Tuesday 10 March 2009 15:49:38 Takashi Iwai wrote:
> > > > > > At Mon, 9 Mar 2009 20:19:35 +0100,
> > > > > >
> > > > > > ...
> > > > > >
> > > > > > Thanks, that helps for debugging.
> > > > > >
> > > > > > Looking through the current patch_conexant.c, there are other messy
> > > > > > codes there, too.  So I cleaned up and fixed it on sound git tree
> > > > > > now.  Any chance to try it out?  The GIT tree is found at:
> > > > > >
> > > > > >   
> > > > > > git://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound-2.6.git
> > > > >
> > > > > I managed to test a kernel snapshot with the latest changes, thanks
> > > > > for taking the time to refactor and clean up the code there.
> > > >
> > > > Thanks for testing.
> > > >
> > > > > There are still issues, though: at the moment, the "Speaker" control
> > > > > does not work. Consequently, automute does not work and Master only
> > > > > controls headphones.
> > > >
> > > > Hm, doesn't "Speaker" give any change if you unplug the headphone?
> > > > It should change the output volume of widget 0x1d.  If it's true, there
> > > > can be a few reasons:
> > > >
> > > > A. The real speaker output pin isn't 0x1d but another pin
> > > >
> > > > B. The widget 0x1d has a problem with connection to 0x19
> > > >
> > > > C. The widget 0x1d has no output amp control despite the description
> > >
> > > To clarify: the speakers make sounds, but volume control and muting do
> > > not work.
> > >
> > > Actually, now that I start to understand how these widget connections
> > > work, I see the problem is simpler: after changing the 0x1d connection
> > > (routing the speakers to 0x19) with {0x1d, AC_VERB_SET_CONNECT_SEL, 0x1},
> > > you have to update the other places where the 0x1d widget is used (see
> > > patch). This also explains the problem originally reported where
> > > Headphone didn't work (here and in bug #3091).
> > >
> > > With just the following patch applied on top of the git tree everything
> > > works nicely (Headphone, Speaker, Master, automute all work as expected).
> >
> > Wow, that's a nice finding!  Yes, this explains everything.
> >
> > In the HD-audio specification, the amp volume selection of a pin
> > widget is defined ambiguously.  Usually, the input amp takes the
> > index, at least for other widget types.  However, the input amp for a
> > pin widget means the recording (the "input" from the pin jack) while
> > the output amp corresponds to the output level from the jack.  So,
> > there is an inconsistency in the definition.
> >
> > Normally, the other vendors don't use the index for the pin output
> > amp -- i.e. no index selection for output amps.  But it seems that
> > conexant codec uses it.  That's why we are fooled by this for such a
> > long time...
> >
> > Anyway, the patch looks good.  Could you give your sign-off?
> 
> Sure.
> 
> Update the places where the 0x1d widget is used for Conexant 5047, fixing 
> mismatch introduced after changing the connection.
> 
> Signed-off-by: Gregorio Guidi <gregorio.guidi@gmail.com>

Thanks, applied now.


Takashi

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

end of thread, other threads:[~2009-03-12 16:11 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2009-03-08 20:19 [PATCH] fix headphone settings and master volume (Conexant CX20551 0x103c30b2) Gregorio Guidi
2009-03-09 11:50 ` Takashi Iwai
2009-03-09 14:49   ` Gregorio Guidi
2009-03-09 15:04     ` Takashi Iwai
2009-03-09 19:19       ` Gregorio Guidi
2009-03-10 14:49         ` Takashi Iwai
2009-03-11 21:22           ` Gregorio Guidi
2009-03-12  6:43             ` Takashi Iwai
2009-03-12 14:00               ` Gregorio Guidi
2009-03-12 14:18                 ` Takashi Iwai
2009-03-12 14:35                   ` Gregorio Guidi
2009-03-12 16:11                     ` 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.