All of lore.kernel.org
 help / color / mirror / Atom feed
* Smart 5.1 function not working on VIA VT1708S with *three* jacks on mainboard
@ 2010-06-30 22:02 Viliam Kubis
  2010-07-06 22:19 ` Fwd: " Viliam Kubis
  0 siblings, 1 reply; 12+ messages in thread
From: Viliam Kubis @ 2010-06-30 22:02 UTC (permalink / raw)
  To: alsa-devel; +Cc: tiwai, loganli, lydiawang

Hello, for quite some time the "Smart 5.1" function in alsa is not working  
properly when motherboard has only 3 audio jacks.

Me and Raymond on alsa-bugtracker have been trying to solve the issue for  
a long time but were unsuccessful.

Please take a look at this alsa bug ticket:  
https://bugtrack.alsa-project.org/alsa-bug/view.php?id=4895

It contains A LOT of info on the problem + steps that we tried, which  
included patching the code.

Synthom : NO "Surround" , "Center" and "LFE" Control and switch with  
VT1708S on a motherboard with 3 audio jacks
Also NO surround sound.

speaker-test -c 4 -t wav -Dsurround40

Channels count (4) not available for playbacks: Invalid argument
Setting of hwparams failed: Invalid argument

Please advise if you can.

Thank you
Best Regards
Viliam Kubis

-- 
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/

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

* Fwd: Smart 5.1 function not working on VIA VT1708S with *three* jacks on mainboard
  2010-06-30 22:02 Smart 5.1 function not working on VIA VT1708S with *three* jacks on mainboard Viliam Kubis
@ 2010-07-06 22:19 ` Viliam Kubis
  2010-07-08  6:33   ` Clemens Ladisch
  0 siblings, 1 reply; 12+ messages in thread
From: Viliam Kubis @ 2010-07-06 22:19 UTC (permalink / raw)
  To: alsa-devel

Please at least reply, or guide me through the process to fix this bug!

------- Forwarded message -------
From: "Viliam Kubis" <viliam.kubis@gmail.com>
To: alsa-devel@alsa-project.org
Cc: lydiawang@viatech.com.cn, loganli@viatech.com.cn, tiwai@suse.de
Subject: Smart 5.1 function not working on VIA VT1708S with *three* jacks  
on mainboard
Date: Thu, 01 Jul 2010 00:02:30 +0200

Hello, for quite some time the "Smart 5.1" function in alsa is not working
properly when motherboard has only 3 audio jacks.

Me and Raymond on alsa-bugtracker have been trying to solve the issue for
a long time but were unsuccessful.

Please take a look at this alsa bug ticket:
https://bugtrack.alsa-project.org/alsa-bug/view.php?id=4895

It contains A LOT of info on the problem + steps that we tried, which
included patching the code.

Synthom : NO "Surround" , "Center" and "LFE" Control and switch with
VT1708S on a motherboard with 3 audio jacks
Also NO surround sound.

speaker-test -c 4 -t wav -Dsurround40

Channels count (4) not available for playbacks: Invalid argument
Setting of hwparams failed: Invalid argument

Please advise if you can.

Thank you
Best Regards
Viliam Kubis


-- 
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/

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

* Re: Smart 5.1 function not working on VIA VT1708S with *three* jacks on mainboard
  2010-07-06 22:19 ` Fwd: " Viliam Kubis
@ 2010-07-08  6:33   ` Clemens Ladisch
  2010-07-09  1:32     ` Raymond Yau
                       ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Clemens Ladisch @ 2010-07-08  6:33 UTC (permalink / raw)
  To: Viliam Kubis, Lydia Wang; +Cc: alsa-devel

Viliam Kubis wrote:
> Hello, for quite some time the "Smart 5.1" function in alsa is not working
> properly when motherboard has only 3 audio jacks.
> 
> speaker-test -c 4 -t wav -Dsurround40
> 
> Channels count (4) not available for playbacks: Invalid argument

Please try the patch below.

(This function uses 0x12 and 0x13 as the NIDs for the center/LFE and
side DACs.  Shouldn't these be 0x24 and 0x25, as per the datasheet?)

--- a/sound/pci/hda/patch_via.c
+++ b/sound/pci/hda/patch_via.c
@@ -2265,6 +2265,13 @@ static int vt1708_auto_fill_dac_nids(str
 		}
 	}
 
+	/* for Smart 5.1, line/mic inputs double as output pins */
+	if (cfg->line_outs == 1) {
+		spec->multiout.num_dacs = 3;
+		spec->multiout.dac_nids[AUTO_SEQ_SURROUND] = 0x11;
+		spec->multiout.dac_nids[AUTO_SEQ_CENLFE] = 0x12;
+	}
+
 	return 0;
 }

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

* Re: Smart 5.1 function not working on VIA VT1708S with *three* jacks on mainboard
  2010-07-08  6:33   ` Clemens Ladisch
@ 2010-07-09  1:32     ` Raymond Yau
       [not found]       ` <op.vfkm5fn9y9cctd@localhost>
       [not found]     ` <op.vfi12awty9cctd@localhost>
       [not found]     ` <op.vfi2hgary9cctd@localhost>
  2 siblings, 1 reply; 12+ messages in thread
From: Raymond Yau @ 2010-07-09  1:32 UTC (permalink / raw)
  To: ALSA Development Mailing List

2010/7/8 Clemens Ladisch <clemens@ladisch.de>

> Viliam Kubis wrote:
> > Hello, for quite some time the "Smart 5.1" function in alsa is not
> working
> > properly when motherboard has only 3 audio jacks.
> >
> > speaker-test -c 4 -t wav -Dsurround40
> >
> > Channels count (4) not available for playbacks: Invalid argument
>
> Please try the patch below.
>
> (This function uses 0x12 and 0x13 as the NIDs for the center/LFE and
> side DACs.  Shouldn't these be 0x24 and 0x25, as per the datasheet?)
>

Node 0x12 seem to be for digital out since it connected to node 0x20

I guess we still lack the info about the retasking of pink and blue jack to
the surround output


Node 0x12 [Audio Output] wcaps 0x611: Stereo Digital
  Control: name="IEC958 Playback Con Mask", index=0, device=0
  Control: name="IEC958 Playback Pro Mask", index=0, device=0
  Control: name="IEC958 Playback Default", index=0, device=0
  Control: name="IEC958 Playback Switch", index=0, device=0
  Control: name="IEC958 Default PCM Playback Switch", index=0, device=0
  Device: name="VT1708S Digital", type="SPDIF", device=1
  Converter: stream=5, channel=0
  Digital: Enabled
  Digital category: 0x0
  PCM:
    rates [0x5e0]: 44100 48000 88200 96000 192000
    bits [0xe]: 16 20 24
    formats [0x1]: PCM
  Power states:  D0 D1 D2 D3
  Power: setting=D0, actual=D0


Node 0x20 [Pin Complex] wcaps 0x400701: Stereo Digital
  Pincap 0x00000010: OUT
  Pin Default 0x074311f0: [Jack] SPDIF Out at Ext Rear Panel
    Conn = ATAPI, Color = Black
    DefAssociation = 0xf, Sequence = 0x0
    Misc = NO_PRESENCE
  Pin-ctls: 0x40: OUT
  Power states:  D0 D1 D2 D3
  Power: setting=D0, actual=D0
  Connection: 1
     0x12

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

* Re: Smart 5.1 function not working on VIA VT1708S with *three* jacks on mainboard
       [not found]     ` <op.vfi12awty9cctd@localhost>
@ 2010-07-09 11:04       ` Viliam Kubis
  0 siblings, 0 replies; 12+ messages in thread
From: Viliam Kubis @ 2010-07-09 11:04 UTC (permalink / raw)
  To: clemens, alsa-devel

Hello, I have patched the vt1708s_auto_fill_dac_nids function instead. I
have left values 0x11 and 0x12 for surround and cen/lfe, althrough it
might be 0x11 and 0x24 for vt1708S as originally specified in
vt1708s_auto_fill_dac_nids switch statement. The whole function looks
like this:

  static int vt1708S_auto_fill_dac_nids(struct via_spec *spec,
  				     const struct auto_pin_cfg *cfg)
  {
  	int i;
  	hda_nid_t nid;

  	spec->multiout.num_dacs = cfg->line_outs;

  	spec->multiout.dac_nids = spec->private_dac_nids;

  	for (i = 0; i < 4; i++) {
  		nid = cfg->line_out_pins[i];
  		if (nid) {
  			/* config dac list */
  			switch (i) {
  			case AUTO_SEQ_FRONT:
  				spec->multiout.dac_nids[i] = 0x10;
  				break;
  			case AUTO_SEQ_CENLFE:
  				spec->multiout.dac_nids[i] = 0x24;
  				break;
  			case AUTO_SEQ_SURROUND:
  				printk(KERN_INFO "***PATCH CREATING SURROUND DAC_NID");
  				spec->multiout.dac_nids[i] = 0x11;
  				break;
  			case AUTO_SEQ_SIDE:
  				spec->multiout.dac_nids[i] = 0x25;
  				break;
  			}
  		}
  	}
  	
  	if (cfg->line_outs == 1)
  	{
  		printk(KERN_INFO "***PATCH 08/07/10");
  		spec->multiout.num_dacs = 3;
  		spec->multiout.dac_nids[AUTO_SEQ_SURROUND] = 0x11;
  		spec->multiout.dac_nids[AUTO_SEQ_CENLFE] = 0x12;
	}

  	return 0;
  }

  The patch is in effect since the following is visible in dmesg after the
  driver is loaded:

  ***PATCH 08/07/10
  ***PATCH CREATING Surround CONTROL
  ***PATCH HDA max_channels = 6
  ***PATCH playback stream channels_max = 6
  Smart 5.1 Patch installed NEW
  ***PATCH Setting 64 mode [out=64] for pin index 0 nid 26
  ***PATCH Setting 64 mode [out=64] for pin index 1 nid 30
  ***PATCH Setting 64 mode [out=64] for pin index 2 nid 27

  printk(KERN_INFO "***PATCH CREATING SURROUND DAC_NID"); This line does
  not print since cfg->line_out_pins[AUTO_SEQ_SURROUND] is not filled at
  that time, but we fix it in the new if block.

  Surround still does not work (still the same, the rear speakers are
  soundless).

  On Thu, 08 Jul 2010 08:33:34 +0200, Clemens Ladisch <clemens@ladisch.de>
  wrote:

>> _auto_fill_dac_nids
>


-- 
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/

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

* Re: Smart 5.1 function not working on VIA VT1708S with *three* jacks on mainboard
       [not found]     ` <op.vfi2hgary9cctd@localhost>
@ 2010-07-09 11:05       ` Viliam Kubis
  2010-07-12  6:57         ` Clemens Ladisch
  0 siblings, 1 reply; 12+ messages in thread
From: Viliam Kubis @ 2010-07-09 11:05 UTC (permalink / raw)
  To: Clemens Ladisch, alsa-devel

I have tried the patch on clean (unpatched) patch_via.c. dmesg prints
out ***PATCH 08/07/10 as expected, but the surround does not work.
Surround and cen/lfe controls are also not created for alsamixer without
other patches. What does work is specifying -Dsurround40 for
speaker-test but there is no sound from rear speakers. If you want, I
can post the whole patched patch_via.c somewhere or we can work on new
patches starting with this one.

  On Thu, 08 Jul 2010 08:33:34 +0200, Clemens Ladisch <clemens@ladisch.de>
  wrote:

>> Viliam Kubis wrote:
>>> Hello, for quite some time the "Smart 5.1" function in alsa is not  
>>> working
>>> properly when motherboard has only 3 audio jacks.
>>>
>>> speaker-test -c 4 -t wav -Dsurround40
>>>
>>> Channels count (4) not available for playbacks: Invalid argument
>>
>> Please try the patch below.
>>
>> (This function uses 0x12 and 0x13 as the NIDs for the center/LFE and
>> side DACs.  Shouldn't these be 0x24 and 0x25, as per the datasheet?)
>>
>> --- a/sound/pci/hda/patch_via.c
>> +++ b/sound/pci/hda/patch_via.c
>> @@ -2265,6 +2265,13 @@ static int vt1708_auto_fill_dac_nids(str
>>  		}
>>  	}
>> +	/* for Smart 5.1, line/mic inputs double as output pins */
>> +	if (cfg->line_outs == 1) {
>> +		spec->multiout.num_dacs = 3;
>> +		spec->multiout.dac_nids[AUTO_SEQ_SURROUND] = 0x11;
>> +		spec->multiout.dac_nids[AUTO_SEQ_CENLFE] = 0x12;
>> +	}
>> +
>>  	return 0;
>>  }
>>
>


-- 
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/

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

* Re: Smart 5.1 function not working on VIA VT1708S with *three* jacks on mainboard
       [not found]       ` <op.vfkm5fn9y9cctd@localhost>
@ 2010-07-09 11:05         ` Viliam Kubis
  0 siblings, 0 replies; 12+ messages in thread
From: Viliam Kubis @ 2010-07-09 11:05 UTC (permalink / raw)
  To: Raymond Yau, alsa-devel

It might be. It is important not to mix VT1708 and VT1708S. For VT1708S,
the following DACs are used in code:

  /* config dac list */
  switch (i) {
  case AUTO_SEQ_FRONT:
  	spec->multiout.dac_nids[i] = 0x10;
  	break;
  case AUTO_SEQ_CENLFE:
  	spec->multiout.dac_nids[i] = 0x24;
  	break;
  case AUTO_SEQ_SURROUND:
  	spec->multiout.dac_nids[i] = 0x11;
  	break;
  case AUTO_SEQ_SIDE:
  	spec->multiout.dac_nids[i] = 0x25;
  	break;
  }

  So 0x12 is not used for any of the surround outputs.

  On Fri, 09 Jul 2010 03:32:13 +0200, Raymond Yau
  <superquad.vortex2@gmail.com> wrote:

>> 2010/7/8 Clemens Ladisch <clemens@ladisch.de>
>>
>>> Viliam Kubis wrote:
>>> > Hello, for quite some time the "Smart 5.1" function in alsa is not
>>> working
>>> > properly when motherboard has only 3 audio jacks.
>>> >
>>> > speaker-test -c 4 -t wav -Dsurround40
>>> >
>>> > Channels count (4) not available for playbacks: Invalid argument
>>>
>>> Please try the patch below.
>>>
>>> (This function uses 0x12 and 0x13 as the NIDs for the center/LFE and
>>> side DACs.  Shouldn't these be 0x24 and 0x25, as per the datasheet?)
>>>
>>
>> Node 0x12 seem to be for digital out since it connected to node 0x20
>>
>> I guess we still lack the info about the retasking of pink and blue  
>> jack to
>> the surround output
>>
>>
>> Node 0x12 [Audio Output] wcaps 0x611: Stereo Digital
>>   Control: name="IEC958 Playback Con Mask", index=0, device=0
>>   Control: name="IEC958 Playback Pro Mask", index=0, device=0
>>   Control: name="IEC958 Playback Default", index=0, device=0
>>   Control: name="IEC958 Playback Switch", index=0, device=0
>>   Control: name="IEC958 Default PCM Playback Switch", index=0, device=0
>>   Device: name="VT1708S Digital", type="SPDIF", device=1
>>   Converter: stream=5, channel=0
>>   Digital: Enabled
>>   Digital category: 0x0
>>   PCM:
>>     rates [0x5e0]: 44100 48000 88200 96000 192000
>>     bits [0xe]: 16 20 24
>>     formats [0x1]: PCM
>>   Power states:  D0 D1 D2 D3
>>   Power: setting=D0, actual=D0
>>
>>
>> Node 0x20 [Pin Complex] wcaps 0x400701: Stereo Digital
>>   Pincap 0x00000010: OUT
>>   Pin Default 0x074311f0: [Jack] SPDIF Out at Ext Rear Panel
>>     Conn = ATAPI, Color = Black
>>     DefAssociation = 0xf, Sequence = 0x0
>>     Misc = NO_PRESENCE
>>   Pin-ctls: 0x40: OUT
>>   Power states:  D0 D1 D2 D3
>>   Power: setting=D0, actual=D0
>>   Connection: 1
>>      0x12
>> _______________________________________________
>> Alsa-devel mailing list
>> Alsa-devel@alsa-project.org
>> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
>


-- 
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/

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

* Re: Smart 5.1 function not working on VIA VT1708S with *three* jacks on mainboard
  2010-07-09 11:05       ` Viliam Kubis
@ 2010-07-12  6:57         ` Clemens Ladisch
  2010-07-12 10:58           ` Viliam Kubis
  0 siblings, 1 reply; 12+ messages in thread
From: Clemens Ladisch @ 2010-07-12  6:57 UTC (permalink / raw)
  To: Viliam Kubis; +Cc: alsa-devel

Viliam Kubis wrote:
> I have tried the patch ..., but the surround does not work.

Okay, next try:

--- a/sound/pci/hda/patch_via.c
+++ b/sound/pci/hda/patch_via.c
@@ -552,24 +552,30 @@ static void via_auto_init_hp_out(struct
 	}
 }
 
+static int is_smart51_pins(struct via_spec *spec, hda_nid_t pin);
+
 static void via_auto_init_analog_input(struct hda_codec *codec)
 {
 	struct via_spec *spec = codec->spec;
+	unsigned int ctl;
 	int i;
 
 	for (i = 0; i < AUTO_PIN_LAST; i++) {
 		hda_nid_t nid = spec->autocfg.input_pins[i];
+		if (!nid)
+			continue;
 
+		if (spec->smart51_enabled && is_smart51_pins(spec, nid))
+			ctl = PIN_OUT;
+		else if (i <= AUTO_PIN_FRONT_MIC)
+			ctl = PIN_VREF50;
+		else
+			ctl = PIN_IN;
 		snd_hda_codec_write(codec, nid, 0,
-				    AC_VERB_SET_PIN_WIDGET_CONTROL,
-				    (i <= AUTO_PIN_FRONT_MIC ?
-				     PIN_VREF50 : PIN_IN));
-
+				    AC_VERB_SET_PIN_WIDGET_CONTROL, ctl);
 	}
 }
 
-static int is_smart51_pins(struct via_spec *spec, hda_nid_t pin);
-
 static void set_pin_power_state(struct hda_codec *codec, hda_nid_t nid,
 				unsigned int *affected_parm)
 {
@@ -658,6 +664,8 @@ static void set_jack_power_state(struct
 		/* PW0 (19h), SW1 (18h), AOW1 (11h) */
 		parm = AC_PWRST_D3;
 		set_pin_power_state(codec, 0x19, &parm);
+		if (spec->smart51_enabled)
+			parm = AC_PWRST_D0;
 		snd_hda_codec_write(codec, 0x18, 0, AC_VERB_SET_POWER_STATE,
 				    parm);
 		snd_hda_codec_write(codec, 0x11, 0, AC_VERB_SET_POWER_STATE,
@@ -667,6 +675,8 @@ static void set_jack_power_state(struct
 		if (is_8ch) {
 			parm = AC_PWRST_D3;
 			set_pin_power_state(codec, 0x22, &parm);
+			if (spec->smart51_enabled)
+				parm = AC_PWRST_D0;
 			snd_hda_codec_write(codec, 0x26, 0,
 					    AC_VERB_SET_POWER_STATE, parm);
 			snd_hda_codec_write(codec, 0x24, 0,
@@ -3915,6 +3925,13 @@ static int vt1708S_auto_fill_dac_nids(st
 		}
 	}
 
+	/* for Smart 5.1, line/mic inputs double as output pins */
+	if (cfg->line_outs == 1) {
+		spec->multiout.num_dacs = 3;
+		spec->multiout.dac_nids[AUTO_SEQ_SURROUND] = 0x11;
+		spec->multiout.dac_nids[AUTO_SEQ_CENLFE] = 0x24;
+	}
+
 	return 0;
 }
 
@@ -3932,7 +3949,8 @@ static int vt1708S_auto_create_multi_out
 	for (i = 0; i <= AUTO_SEQ_SIDE; i++) {
 		nid = cfg->line_out_pins[i];
 
-		if (!nid)
+		/* for Smart 5.1, there are always at least six channels */
+		if (!nid && i > AUTO_SEQ_CENLFE)
 			continue;
 
 		nid_vol = nid_vols[i];

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

* Re: Smart 5.1 function not working on VIA VT1708S with *three* jacks on mainboard
  2010-07-12  6:57         ` Clemens Ladisch
@ 2010-07-12 10:58           ` Viliam Kubis
  2010-07-22 20:36             ` Simon Schubert
  0 siblings, 1 reply; 12+ messages in thread
From: Viliam Kubis @ 2010-07-12 10:58 UTC (permalink / raw)
  To: Clemens Ladisch; +Cc: alsa-devel

Oh my god!! It actually works!!! :) At first speaker-test was not working,  
but with

[kbs1@localhost a]$ speaker-test -c4 -twav -Dsurround40 <--------- THIS

speaker-test 1.0.23

Playback device is surround40
Stream parameters are 48000Hz, S16_LE, 4 channels
WAV file(s)
Rate set to 48000Hz (requested 48000Hz)
Buffer size range from 32 to 8192
Period size range from 16 to 4096
Using max buffer size 8192
Periods = 4
was set period_size = 2048
was set buffer_size = 8192
  0 - Front Left
  1 - Front Right
  3 - Rear Right <-------------- THIS PLAYS
  2 - Rear Left <-------------- AND THIS PLAYS!!
Time per period = 5.718945
  0 - Front Left
^C
[kbs1@localhost a]$

Finally! My audio experience is now at a whole new level. Thank you very  
much, I will post this patch to alsa-bugtracker and close the bug, I was  
starting to think that this is a kernel problem, but now it just works  
GREAT.

Maybe you can add this patch to official alsa-driver version on next  
release.

Have a nice day!
Best Regards
Viliam Kubis

On Mon, 12 Jul 2010 08:57:59 +0200, Clemens Ladisch <clemens@ladisch.de>  
wrote:

> Viliam Kubis wrote:
>> I have tried the patch ..., but the surround does not work.
>
> Okay, next try:
>
> --- a/sound/pci/hda/patch_via.c
> +++ b/sound/pci/hda/patch_via.c
> @@ -552,24 +552,30 @@ static void via_auto_init_hp_out(struct
>  	}
>  }
> +static int is_smart51_pins(struct via_spec *spec, hda_nid_t pin);
> +
>  static void via_auto_init_analog_input(struct hda_codec *codec)
>  {
>  	struct via_spec *spec = codec->spec;
> +	unsigned int ctl;
>  	int i;
> 	for (i = 0; i < AUTO_PIN_LAST; i++) {
>  		hda_nid_t nid = spec->autocfg.input_pins[i];
> +		if (!nid)
> +			continue;
> +		if (spec->smart51_enabled && is_smart51_pins(spec, nid))
> +			ctl = PIN_OUT;
> +		else if (i <= AUTO_PIN_FRONT_MIC)
> +			ctl = PIN_VREF50;
> +		else
> +			ctl = PIN_IN;
>  		snd_hda_codec_write(codec, nid, 0,
> -				    AC_VERB_SET_PIN_WIDGET_CONTROL,
> -				    (i <= AUTO_PIN_FRONT_MIC ?
> -				     PIN_VREF50 : PIN_IN));
> -
> +				    AC_VERB_SET_PIN_WIDGET_CONTROL, ctl);
>  	}
>  }
> -static int is_smart51_pins(struct via_spec *spec, hda_nid_t pin);
> -
>  static void set_pin_power_state(struct hda_codec *codec, hda_nid_t nid,
>  				unsigned int *affected_parm)
>  {
> @@ -658,6 +664,8 @@ static void set_jack_power_state(struct
>  		/* PW0 (19h), SW1 (18h), AOW1 (11h) */
>  		parm = AC_PWRST_D3;
>  		set_pin_power_state(codec, 0x19, &parm);
> +		if (spec->smart51_enabled)
> +			parm = AC_PWRST_D0;
>  		snd_hda_codec_write(codec, 0x18, 0, AC_VERB_SET_POWER_STATE,
>  				    parm);
>  		snd_hda_codec_write(codec, 0x11, 0, AC_VERB_SET_POWER_STATE,
> @@ -667,6 +675,8 @@ static void set_jack_power_state(struct
>  		if (is_8ch) {
>  			parm = AC_PWRST_D3;
>  			set_pin_power_state(codec, 0x22, &parm);
> +			if (spec->smart51_enabled)
> +				parm = AC_PWRST_D0;
>  			snd_hda_codec_write(codec, 0x26, 0,
>  					    AC_VERB_SET_POWER_STATE, parm);
>  			snd_hda_codec_write(codec, 0x24, 0,
> @@ -3915,6 +3925,13 @@ static int vt1708S_auto_fill_dac_nids(st
>  		}
>  	}
> +	/* for Smart 5.1, line/mic inputs double as output pins */
> +	if (cfg->line_outs == 1) {
> +		spec->multiout.num_dacs = 3;
> +		spec->multiout.dac_nids[AUTO_SEQ_SURROUND] = 0x11;
> +		spec->multiout.dac_nids[AUTO_SEQ_CENLFE] = 0x24;
> +	}
> +
>  	return 0;
>  }
> @@ -3932,7 +3949,8 @@ static int vt1708S_auto_create_multi_out
>  	for (i = 0; i <= AUTO_SEQ_SIDE; i++) {
>  		nid = cfg->line_out_pins[i];
> -		if (!nid)
> +		/* for Smart 5.1, there are always at least six channels */
> +		if (!nid && i > AUTO_SEQ_CENLFE)
>  			continue;
> 		nid_vol = nid_vols[i];


-- 
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/

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

* Re: Smart 5.1 function not working on VIA VT1708S with *three* jacks on mainboard
  2010-07-12 10:58           ` Viliam Kubis
@ 2010-07-22 20:36             ` Simon Schubert
  0 siblings, 0 replies; 12+ messages in thread
From: Simon Schubert @ 2010-07-22 20:36 UTC (permalink / raw)
  To: alsa-devel

Viliam Kubis <viliam.kubis <at> gmail.com> writes:
> Oh my god!! It actually works!!! :) At first speaker-test was not working,  
> but with
> 
[..]
> Finally! My audio experience is now at a whole new level. Thank you very  
> much, I will post this patch to alsa-bugtracker and close the bug, I was  
> starting to think that this is a kernel problem, but now it just works  
> GREAT.
> 
> Maybe you can add this patch to official alsa-driver version on next  
> release.

This patch makes 5.1 analog surround work for me.  I'm using an ASUS P5Q-VM DO 
which has a VIA VT1708S.  The mainboard has three analog jacks in the rear and 
an on-board jumper for two front jacks.

cheers
  simon

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

* Re: Smart 5.1 function not working on VIA VT1708S with *three* jacks on mainboard
  2010-07-10  9:41 Raymond Yau
@ 2010-07-10 12:39 ` Viliam Kubis
  0 siblings, 0 replies; 12+ messages in thread
From: Viliam Kubis @ 2010-07-10 12:39 UTC (permalink / raw)
  To: ALSA Development Mailing List, Raymond Yau

But my speakers only come with two jacks for input. One for the front  
speakers and one for rear speakers. So I cannot connect the speakers to  
all three jacks. I have compiled alsa with --with-debug=full configure  
option to see which pins it has auto-parsed:

HDA Intel 0000:00:14.2: PCI INT A disabled
HDA Intel 0000:00:14.2: PCI INT A -> GSI 16 (level, low) -> IRQ 16
ALSA hda_codec.c:4408: autoconfig: line_outs=1 (0x1c/0x0/0x0/0x0/0x0)
ALSA hda_codec.c:4412:    speaker_outs=0 (0x0/0x0/0x0/0x0/0x0)
ALSA hda_codec.c:4416:    hp_outs=1 (0x1d/0x0/0x0/0x0/0x0)
ALSA hda_codec.c:4417:    mono: mono_out=0x0
ALSA hda_codec.c:4420:    dig-out=0x20/0x0
ALSA hda_codec.c:4428:    inputs: mic=0x1a, fmic=0x1e, line=0x1b,  
fline=0x0, cd=0x1f, aux=0x0

However in function smart51_get, the following condition

if (ctl & AC_PINCTL_IN_EN
     && !(ctl & AC_PINCTL_OUT_EN))
{
	printk(KERN_INFO "*** PATCH on=0 in via_smart51_get()");
	on = 0;
}

will never be true, so smart51_get will always set  
*ucontrol->value.integer.value to 1. (printk line will not execute)

Smart 5.1 control gets created and appears to be "working". However  
surround output does not work.

On Sat, 10 Jul 2010 11:41:35 +0200, Raymond Yau  
<superquad.vortex2@gmail.com> wrote:

>>> It might be. It is important not to mix VT1708 and VT1708S. For  
>>> VT1708S,
> the following DACs are used in code:
>
>   /* config dac list */
>   switch (i) {
>   case AUTO_SEQ_FRONT:
>   	spec->multiout.dac_nids[i] = 0x10;
>   	break;
>   case AUTO_SEQ_CENLFE:
>   	spec->multiout.dac_nids[i] = 0x24;
>   	break;
>   case AUTO_SEQ_SURROUND:
>   	spec->multiout.dac_nids[i] = 0x11;
>   	break;
>   case AUTO_SEQ_SIDE:
>   	spec->multiout.dac_nids[i] = 0x25;
>   	break;
>   }
>
>>>  So 0x12 is not used for any of the surround outputs.
>
> I think your testing config is not compiled with smart 5.1 requirement
>
> Refer to smart51_get() , this function exepct red jack and blue jack
> are configued to Output
>
> But you still plugged in Mic into the pink jack according to your photo.
>
> Your speakers have to plugged in both pink and blue jacks
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel


-- 
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/

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

* Re: Smart 5.1 function not working on VIA VT1708S with *three* jacks on mainboard
@ 2010-07-10  9:41 Raymond Yau
  2010-07-10 12:39 ` Viliam Kubis
  0 siblings, 1 reply; 12+ messages in thread
From: Raymond Yau @ 2010-07-10  9:41 UTC (permalink / raw)
  To: ALSA Development Mailing List

>> It might be. It is important not to mix VT1708 and VT1708S. For VT1708S,
the following DACs are used in code:

  /* config dac list */
  switch (i) {
  case AUTO_SEQ_FRONT:
  	spec->multiout.dac_nids[i] = 0x10;
  	break;
  case AUTO_SEQ_CENLFE:
  	spec->multiout.dac_nids[i] = 0x24;
  	break;
  case AUTO_SEQ_SURROUND:
  	spec->multiout.dac_nids[i] = 0x11;
  	break;
  case AUTO_SEQ_SIDE:
  	spec->multiout.dac_nids[i] = 0x25;
  	break;
  }

>>  So 0x12 is not used for any of the surround outputs.

I think your testing config is not compiled with smart 5.1 requirement

Refer to smart51_get() , this function exepct red jack and blue jack
are configued to Output

But you still plugged in Mic into the pink jack according to your photo.

Your speakers have to plugged in both pink and blue jacks

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

end of thread, other threads:[~2010-07-22 20:50 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-06-30 22:02 Smart 5.1 function not working on VIA VT1708S with *three* jacks on mainboard Viliam Kubis
2010-07-06 22:19 ` Fwd: " Viliam Kubis
2010-07-08  6:33   ` Clemens Ladisch
2010-07-09  1:32     ` Raymond Yau
     [not found]       ` <op.vfkm5fn9y9cctd@localhost>
2010-07-09 11:05         ` Viliam Kubis
     [not found]     ` <op.vfi12awty9cctd@localhost>
2010-07-09 11:04       ` Viliam Kubis
     [not found]     ` <op.vfi2hgary9cctd@localhost>
2010-07-09 11:05       ` Viliam Kubis
2010-07-12  6:57         ` Clemens Ladisch
2010-07-12 10:58           ` Viliam Kubis
2010-07-22 20:36             ` Simon Schubert
2010-07-10  9:41 Raymond Yau
2010-07-10 12:39 ` Viliam Kubis

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.