Skip to contentSkip to conversation

What-did-you-plugin-dialog

DISCUSSION Raymond Yau 2 participants 8 messages Dec 1, 2013 – Dec 4, 2013 11 messages not in the archive Sound

lore
Share & tools
lore
#11 lore raw
In reply to a message not in the archive

:

Quoted 16 lines
Quoted 2 lines

can post the output of alsa-info.sh after jack retasking ?

Before retasking:

http://www.alsa-project.org/db/?f=fd97b8194e205b4f91127bca74ad7c9b2cd93ab9

After retasking blue line in, pin ID 0x1a as Line out (Side):

http://www.alsa-project.org/db/?f=d56f9a6d0692c9a8d5c88f43100a6cb78407c163

Note that retasking did not work: attempting to play a 8-channel wav file through hw:1,0 resulted in an "Invalid argument" error.

FWIW, here is what hdajackretask printed to the console:

Quoted 17 lines

0x11 0x99430130
0x12 0x4037c540
0x14 0x01014010
0x15 0x01011012
0x16 0x01016011
0x17 0x411111f0
0x18 0x01a19050
0x19 0x02a19060
0x1a 0x01014413
0x1b 0x02214020
0x1c 0x411111f0
0x1d 0x4045e601
0x1e 0x01452140
0x1f 0x411111f0
1

you need root privilege for hdajackretask to write the firmware file to /lib/firmware and modify /etc/modprobe.d/alsa-lbase.conf to use the firmware file

can you try the patch which add "channel mode" control which allow you to switch from 6ch to 8ch

it is not clear that the "Line jack" control is used for detect the blue jack state or reflect the line In is no longer available after it is retasked as output jack

sound/pci/hda/hda_generic.c +9 -6
index 3067ed4..c64ad95 100644
@@ -1375,6 +1375,8 @@ static int fill_multi_ios(struct hda_codec *codec,
 			if (spec->multi_ios >= 2)
 				break;
 		}
+		if ((cfg->line_outs + spec->multi_ios) == 4)
+			break;
 	}
  end_fill:
 	if (badness)
@@ -1385,7 +1387,7 @@ static int fill_multi_ios(struct hda_codec *codec,
 		else
 			return badness; /* no badness if nothing found */
 	}
-	if (!hardwired && spec->multi_ios < 2) {
+	if (!hardwired && spec->multi_ios < 1) {
 		/* cancel newly assigned paths */
 		spec->paths.used -= spec->multi_ios - old_pins;
 		spec->multi_ios = old_pins;
@@ -1583,7 +1585,8 @@ static int fill_and_eval_dacs(struct hda_codec *codec,
 				   spec->main_out_badness);
 
 	if (!spec->no_multi_io && fill_mio_first &&
-	    cfg->line_outs == 1 && cfg->line_out_type != AUTO_PIN_SPEAKER_OUT) {
+	    (cfg->line_outs == 1 || cfg->line_outs ==3) &&
+	    cfg->line_out_type != AUTO_PIN_SPEAKER_OUT) {
 		/* try to fill multi-io first */
 		err = fill_multi_ios(codec, cfg->line_out_pins[0], false);
 		if (err < 0)
@@ -1650,11 +1653,11 @@ static int fill_and_eval_dacs(struct hda_codec *codec,
 	spec->ext_channel_count = spec->min_channel_count =
 		spec->multiout.num_dacs * 2;
 
-	if (spec->multi_ios == 2) {
-		for (i = 0; i < 2; i++)
+	if (spec->multi_ios > 0) {
+		for (i = 0; i < spec->multi_ios; i++)
 			spec->private_dac_nids[spec->multiout.num_dacs++] =
 				spec->multi_io[i].dac;
-	} else if (spec->multi_ios) {
+	} else {
 		spec->multi_ios = 0;
 		badness += BAD_MULTI_IO;
 	}
@@ -1891,7 +1894,7 @@ static int create_multi_out_ctls(struct hda_codec *codec,
 	int i, err, noutputs;
 
 	noutputs = cfg->line_outs;
-	if (spec->multi_ios > 0 && cfg->line_outs < 3)
+	if (spec->multi_ios > 0)
 		noutputs += spec->multi_ios;
 
 	for (i = 0; i < noutputs; i++) {

_______________________________________________
pulseaudio-discuss mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss

#12 lore raw

2013/12/1 Raymond Yau <[email protected]>:

Quoted 35 lines

:

Quoted 17 lines
Quoted 3 lines

can post the output of alsa-info.sh after jack retasking ?

Before retasking:

http://www.alsa-project.org/db/?f=fd97b8194e205b4f91127bca74ad7c9b2cd93ab9

After retasking blue line in, pin ID 0x1a as Line out (Side):

http://www.alsa-project.org/db/?f=d56f9a6d0692c9a8d5c88f43100a6cb78407c163

Note that retasking did not work: attempting to play a 8-channel wav file through hw:1,0 resulted in an "Invalid argument" error.

FWIW, here is what hdajackretask printed to the console:

Quoted 16 lines

0x11 0x99430130
0x12 0x4037c540
0x14 0x01014010
0x15 0x01011012
0x16 0x01016011
0x17 0x411111f0
0x18 0x01a19050
0x19 0x02a19060
0x1a 0x01014413
0x1b 0x02214020
0x1c 0x411111f0
0x1d 0x4045e601
0x1e 0x01452140
0x1f 0x411111f0
1

Quoted 6 lines

you need root privilege for hdajackretask to write the firmware file to /lib/firmware and modify /etc/modprobe.d/alsa-lbase.conf to use the firmware file

can you try the patch which add "channel mode" control which allow you to switch from 6ch to 8ch

I have tested the patch. In 8ch mode, it works without any overrides in the sense that the side channels go to the blue jack if I choose 8ch mode. In the 6ch mode, the line input also works (tested by using headphones as a very bad microphone-like source).

Here is alsa-info in the 6ch mode:

http://www.alsa-project.org/db/?f=d152698d4b2d9589d4c5f14e0c8e6d4978c8fbd0

And in 8ch mode:

http://www.alsa-project.org/db/?f=4d5d14fbb559819fd82e7731e656be7efcfab439

Pulseaudio is not smart enough to decide by itself that it can toggle the control and add 7.1 profiles. If I toggle the control manually and restart pulseaudio, they appear.

If the role of the "Line jack" control is still unclear, just say so and tell me what to do to figure it out.

Signature · 1 line
Alexander E. Patrakov
#13 lore raw
Quoted 53 lines
Quoted 5 lines
Quoted 5 lines

Before retasking:

http://www.alsa-project.org/db/?f=fd97b8194e205b4f91127bca74ad7c9b2cd93ab9

Quoted 4 lines
Quoted 4 lines

After retasking blue line in, pin ID 0x1a as Line out (Side):

http://www.alsa-project.org/db/?f=d56f9a6d0692c9a8d5c88f43100a6cb78407c163

Quoted 23 lines
Quoted 6 lines

Note that retasking did not work: attempting to play a 8-channel wav file through hw:1,0 resulted in an "Invalid argument" error.

FWIW, here is what hdajackretask printed to the console:

Quoted 16 lines

0x11 0x99430130
0x12 0x4037c540
0x14 0x01014010
0x15 0x01011012
0x16 0x01016011
0x17 0x411111f0
0x18 0x01a19050
0x19 0x02a19060
0x1a 0x01014413
0x1b 0x02214020
0x1c 0x411111f0
0x1d 0x4045e601
0x1e 0x01452140
0x1f 0x411111f0
1

Quoted 2 lines

you need root privilege for hdajackretask to write the firmware file to /lib/firmware and modify /etc/modprobe.d/alsa-lbase.conf to use the

firmware

Quoted 4 lines

file

can you try the patch which add "channel mode" control which allow you to switch from 6ch to 8ch

I have tested the patch. In 8ch mode, it works without any overrides in the sense that the side channels go to the blue jack if I choose 8ch mode. In the 6ch mode, the line input also works (tested by using headphones as a very bad microphone-like source).

Here is alsa-info in the 6ch mode:

http://www.alsa-project.org/db/?f=d152698d4b2d9589d4c5f14e0c8e6d4978c8fbd0

And in 8ch mode:

Quoted 10 lines

http://www.alsa-project.org/db/?f=4d5d14fbb559819fd82e7731e656be7efcfab439

Pulseaudio is not smart enough to decide by itself that it can toggle the control and add 7.1 profiles. If I toggle the control manually and restart pulseaudio, they appear.

If the role of the "Line jack" control is still unclear, just say so and tell me what to do to figure it out.

http://cgit.freedesktop.org/pulseaudio/pulseaudio/plain/src/modules/alsa/mixer/paths/analog-input-linein.conf

pulseaudio use "Line Jack" to determine whether line in is available or not

In 8ch mode, do the "Line jack" return true when you plugged "Side Speaker" ?

pactl list

should "line in" list as not available when channel mode changed to "8 ch" ?

Should changes in "channel mode" , "Headphone Mic jack mode" or "Mic Jack Mode" trigger an event so that pulseaudio server probe the sound card again ?

There is still bug in the patch

should check (cfg->line_out + spec->multi_ios) >= 3 instead of spec->multi_ios > 0 so that the channel mode is not added for notebook with line out and mic jack

#14 lore raw

2013/12/1 Raymond Yau <[email protected]>:

Quoted 56 lines
Quoted 56 lines
Quoted 34 lines
Quoted 17 lines

Before retasking:

http://www.alsa-project.org/db/?f=fd97b8194e205b4f91127bca74ad7c9b2cd93ab9

After retasking blue line in, pin ID 0x1a as Line out (Side):

http://www.alsa-project.org/db/?f=d56f9a6d0692c9a8d5c88f43100a6cb78407c163

Note that retasking did not work: attempting to play a 8-channel wav file through hw:1,0 resulted in an "Invalid argument" error.

FWIW, here is what hdajackretask printed to the console:

Quoted 16 lines

0x11 0x99430130
0x12 0x4037c540
0x14 0x01014010
0x15 0x01011012
0x16 0x01016011
0x17 0x411111f0
0x18 0x01a19050
0x19 0x02a19060
0x1a 0x01014413
0x1b 0x02214020
0x1c 0x411111f0
0x1d 0x4045e601
0x1e 0x01452140
0x1f 0x411111f0
1

Quoted 8 lines

you need root privilege for hdajackretask to write the firmware file to /lib/firmware and modify /etc/modprobe.d/alsa-lbase.conf to use the firmware
file

can you try the patch which add "channel mode" control which allow you to
switch from 6ch to 8ch

I have tested the patch. In 8ch mode, it works without any overrides in the sense that the side channels go to the blue jack if I choose 8ch mode. In the 6ch mode, the line input also works (tested by using headphones as a very bad microphone-like source).

Here is alsa-info in the 6ch mode:

http://www.alsa-project.org/db/?f=d152698d4b2d9589d4c5f14e0c8e6d4978c8fbd0

And in 8ch mode:

http://www.alsa-project.org/db/?f=4d5d14fbb559819fd82e7731e656be7efcfab439

Quoted 7 lines
Quoted 7 lines

Pulseaudio is not smart enough to decide by itself that it can toggle the control and add 7.1 profiles. If I toggle the control manually and restart pulseaudio, they appear.

If the role of the "Line jack" control is still unclear, just say so and tell me what to do to figure it out.

I will test everything later today, when I return home. However, I have questions about the tests.

Quoted 2 lines

In 8ch mode, do the "Line jack" return true when you plugged "Side Speaker" ?

Do I understand correctly that I need to look at "amixer -c1 contents" output?

Quoted 3 lines

Should changes in "channel mode" , "Headphone Mic jack mode" or "Mic Jack Mode" trigger an event so that pulseaudio server probe the sound card again ?

How can I verify this? Is it enough to look at pulseaudio -vvv output?

Signature · 1 line
Alexander E. Patrakov
#16 lore raw
In reply to Raymond Yau

2013/12/1 Raymond Yau <[email protected]>:

Quoted 5 lines

There is still bug in the patch

should check (cfg->line_out + spec->multi_ios) >= 3 instead of spec->multi_ios > 0 so that the channel mode is not added for notebook with line out and mic jack

I assume you are talking about the part that applies to create_multi_out_ctls(). In that case, NAK - the change leads to non-creation of the 6ch / 8ch "channel mode" control on my board.

Signature · 1 line
Alexander E. Patrakov
#17 lore raw
In reply to Raymond Yau

2013/12/1 Raymond Yau <[email protected]>:

All tests below were done with the original patch, as the suggested modification breaks 8ch mode here.

Quoted 2 lines

In 8ch mode, do the "Line jack" return true when you plugged "Side Speaker" ?

Yes, the state reflects whether something is plugged into the blue jack.

Quoted 3 lines

pactl list

should "line in" list as not available when channel mode changed to "8 ch" ?

Unfortunately, it is "available" if there is something plugged in and "mot available" if there is nothing plugged in.

Quoted 3 lines

Should changes in "channel mode" , "Headphone Mic jack mode" or "Mic Jack Mode" trigger an event so that pulseaudio server probe the sound card again ?

Changes in "channel mode" do not trigger anything that pulseaudio -vvv considers loggable. Changes from 8ch to 6ch do not cause the 7.1 profiles to disappear.

The device has no controls that contain "mic jack mode" as a substring and are controllable via alsamixer.

Signature · 1 line
Alexander E. Patrakov
#15 lore raw
In reply to Alexander E. Patrakov
Quoted 39 lines
Quoted 6 lines
Quoted 6 lines
Quoted 5 lines

can you try the patch which add "channel mode" control which allow you to
switch from 6ch to 8ch

Quoted 8 lines
Quoted 8 lines

I have tested the patch. In 8ch mode, it works without any overrides in the sense that the side channels go to the blue jack if I choose 8ch mode. In the 6ch mode, the line input also works (tested by using headphones as a very bad microphone-like source).

Here is alsa-info in the 6ch mode:

http://www.alsa-project.org/db/?f=d152698d4b2d9589d4c5f14e0c8e6d4978c8fbd0

Quoted 4 lines
Quoted 4 lines

And in 8ch mode:

http://www.alsa-project.org/db/?f=4d5d14fbb559819fd82e7731e656be7efcfab439

Quoted 8 lines
Quoted 8 lines

Pulseaudio is not smart enough to decide by itself that it can toggle the control and add 7.1 profiles. If I toggle the control manually and restart pulseaudio, they appear.

If the role of the "Line jack" control is still unclear, just say so and tell me what to do to figure it out.

I will test everything later today, when I return home. However, I have questions about the tests.

Quoted 1 line

In 8ch mode, do the "Line jack" return true when you plugged "Side

Speaker"

Quoted 1 line

?

Do I understand correctly that I need to look at "amixer -c1 contents" output?

Quoted 8 lines
Quoted 2 lines

Should changes in "channel mode" , "Headphone Mic jack mode" or "Mic Jack Mode" trigger an event so that pulseaudio server probe the sound card

again

Quoted 1 line

?

How can I verify this? Is it enough to look at pulseaudio -vvv output?

if your computer chassis does not have front audio panel and you want to use headphone with line out jacks the rear panel

just use early patching to add hints

add_out_jack_modes=1

or

add the following line to patch_realtek.c

spec->gen.add_jack_modes = 1

this create "Line Out Jack Mode" control on those line out jacks and "Headphone Jack Mode" on headphone jacks which pincap support OUT and HP,

your headphone plugged into Line Out jack still be regarded as Line Out and use Front Playback Volume

http://cgit.freedesktop.org/pulseaudio/pulseaudio/commit/src/modules/alsa/mixer/profile-sets/default.conf?id=ecf3ab2b5788c85c237eeb6429bd1d525b9ac0cc

http://cgit.freedesktop.org/pulseaudio/pulseaudio/tree/src/modules/alsa/mixer/paths/analog-output-lineout.conf

as add_out_jack_modes is depreciated , you will have "Front Mic Jack Mode" , "Rear Mic Jack Mode" and "Line Jack Mode" controls

The function of these kind of controls are to change the function of the corresponding jacks

the function of the "channel mode" control have one more function in addition to change the input jacks to surround output jacks ,is to change playback mode from stereo to support multi-channels playback

however "channel mode" change to "8ch" does not imply "Line in" jack must be retasked (e.g. both rear mic and line in are retaskable)

for those 3stack desktop Line In is retasked as output but for those 5 stack desktop , Line In is still input jacks when "channel mode" is "6ch"

the possible way is to check the pin ctls and vref of the node is match with the name of the jack detection control, also the driver might set pin ctl to zero to mute the output

Node 0x1a [Pin Complex] wcaps 0x40058f: Stereo Amp-In Amp-Out
Control: name="Side Playback Switch", index=0, device=0

    ControlAmp: chs=3, dir=Out, idx=0, ofs=0
  Control: name="Line Boost Volume", index=0, device=0
    ControlAmp: chs=3, dir=In, idx=0, ofs=0
  Control: name="Line Jack", index=0, device=0
  Amp-In caps: ofs=0x00, nsteps=0x03, stepsize=0x27, mute=0
  Amp-In vals:  [0x03 0x03]
  Amp-Out caps: ofs=0x00, nsteps=0x00, stepsize=0x00, mute=1
  Amp-Out vals:  [0x00 0x00]
  Pincap 0x00003736: IN OUT Detect Trigger
    Vref caps: HIZ 50 GRD 80 100
  Pin Default 0x0181305f: [Jack] Line In at Ext Rear
    Conn = 1/8, Color = Blue
    DefAssociation = 0x5, Sequence = 0xf
  Pin-ctls: 0x40: OUT VREF_HIZ
  Unsolicited: tag=04, enabled=1
  Power states:  D0 D1 D2 D3 EPSS
  Power: setting=D0, actual=D0
  Connection: 5
     0x0c 0x0d 0x0e 0x0f* 0x26

_______________________________________________
pulseaudio-discuss mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss

#18 lore raw
In reply to Alexander E. Patrakov
Quoted 9 lines

All tests below were done with the original patch, as the suggested modification breaks 8ch mode here.

Quoted 1 line

In 8ch mode, do the "Line jack" return true when you plugged "Side

Speaker"

Quoted 1 line

?

Yes, the state reflects whether something is plugged into the blue jack.

Quoted 9 lines
Quoted 3 lines

pactl list

should "line in" list as not available when channel mode changed to "8

ch" ?

Unfortunately, it is "available" if there is something plugged in and "mot available" if there is nothing plugged in.

https://www.kernel.org/doc/Documentation/sound/alsa/HD-Audio-Controls.txt

Mic Jack Mode, Line Jack Mode, etc
These enum controls the direction and the bias of the input jack pins. Depending on the jack type, it can set as "Mic In" and "Line In", for determining the input bias, or it can be set to "Line Out" when the pin is a multi-I/O jack for surround channels.

the switching from 6ch to 8ch can also be implemented using Line Jack Mode too

Simple mixer control 'Line Jack Mode',0
Items: 'Mic In' 'Line In' 'Side Line Out'
Item0: 'Side Line Out'

_______________________________________________
pulseaudio-discuss mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/pulseaudio-discuss