Multistreaming Playback using Front Panel Headphone with realtek codec
Request for testers to test the patch
Multistreaming allows you to listen to one audio source through the back panel speakers and a second audio source through front panel headphones or speakers.
Hardware requirement
1) 10 channels realtek codec (e.g. alc892) which already work with model=auto
2) Headphone at front panel and Line out at rear panel
"hw:0,0" is used for the rear panel audio jack
"hw:0,2" is used for the front panel headphone when "Independent HP" is switched ON
Add an "Independent HP" switch to turn this feature on/off for desktop for those HDA codec
Test:
1) speaker-test -c 8 -t wav -Dhw:0,0
2) speaker-test -c 2 -t wav -Dhw:0,2
It will need modification to support this feature for those desktop with 8 channels codec
From bfcfd3245c56993057b52641baf694ac73501022 Mon Sep 17 00:00:00 2001
From: Raymond Yau <[email protected]>
Date: Wed, 4 May 2011 21:44:28 +0800
Subject: [PATCH ALSA hda] Add Multistreaming Playback using Front Panel Headphone for realtek codec
sound/pci/hda/patch_realtek.c +136 -2
@@ -340,6 +340,7 @@ struct alc_spec {* dig_out_nid and hp_nid are optional */ hda_nid_t alt_dac_nid; +int independent_hp;hda_nid_t slave_dig_outs[3 ];/* optional - for auto-parsing */ int dig_out_type;
@@ -1157,7 +1158,8 @@ static void update_speakers(struct hda_codec *codec)static void alc_hp_automute (struct hda_codec *codec) {struct alc_spec *spec = codec->spec; - +if (spec->independent_hp) +return ;if (!spec->automute)return ; spec->jack_present =
@@ -1645,6 +1647,85 @@ static void alc_init_auto_mic(struct hda_codec *codec) spec->unsol_event = alc_sku_unsol_event; } +static int alc_independent_hp_info (struct snd_kcontrol *kcontrol, +struct snd_ctl_elem_info *uinfo) +{ +static const char *const texts[] = {"OFF" ,"ON" ,NULL }; +int index; + uinfo->type =SNDRV_CTL_ELEM_TYPE_ENUMERATED ; + uinfo->count =1 ; + uinfo->value.enumerated.items =2 ; + index = uinfo->value.enumerated.item; +if (index >=2 ) + index =1 ; +strcpy (uinfo->value.enumerated.name, texts[index]); +return 0 ; +} + +static int alc_independent_hp_get (struct snd_kcontrol *kcontrol, +struct snd_ctl_elem_value *ucontrol) +{ +struct hda_codec *codec =snd_kcontrol_chip (kcontrol); +struct alc_spec *spec = codec->spec; + ucontrol->value.enumerated.item[0 ] = spec->independent_hp; +return 0 ; +} + +static int alc_independent_hp_put (struct snd_kcontrol *kcontrol, +struct snd_ctl_elem_value *ucontrol) +{ +struct hda_codec *codec =snd_kcontrol_chip (kcontrol); +struct alc_spec *spec = codec->spec; +unsigned int select = ucontrol->value.enumerated.item[0 ]; +if (spec->independent_hp != select) { + spec->independent_hp = select; +if (spec->independent_hp) + spec->multiout.hp_nid =0 ; +else + spec->multiout.hp_nid = spec->alt_dac_nid; +return 1 ; + } +return 0 ; +} + +static const struct snd_kcontrol_new alc_independent_hp_switch = { + .iface =SNDRV_CTL_ELEM_IFACE_MIXER , + .name ="Independent HP" , + .info = alc_independent_hp_info, + .get = alc_independent_hp_get, + .put = alc_independent_hp_put, +}; + +/* +Multistreaming playback using Headphone at Front Panel +Add Independent Headphone control only when there are +1) HP at Ext Front and Line Out at Ext Rear +*/ +static void add_independent_hp (struct hda_codec *codec,hda_nid_t pin, +hda_nid_t nid) +{ +struct alc_spec *spec = codec->spec; +struct snd_kcontrol_new *knew; +u32 hp_cfg, lo_cfg; + hp_cfg =snd_hda_codec_get_pincfg (codec, pin); + lo_cfg =snd_hda_codec_get_pincfg (codec, spec->autocfg.line_out_pins[0 ]); +if ((spec->autocfg.line_outs >=1 ) && + (nid != spec->multiout.dac_nids[HDA_FRONT ]) && + (get_defcfg_device (hp_cfg) ==AC_JACK_HP_OUT ) && + (get_defcfg_location (hp_cfg) ==AC_JACK_LOC_FRONT ) && + (get_defcfg_device (lo_cfg) ==AC_JACK_LINE_OUT ) && + (get_defcfg_location (lo_cfg) ==AC_JACK_LOC_REAR )) { + + spec->alt_dac_nid = nid; + + knew =alc_kcontrol_new (spec); +if (knew) { + *knew = alc_independent_hp_switch; + knew->name =kstrdup ("Independent HP" ,GFP_KERNEL ); + } + } +} +/* Could be any non-zero and even value. When used as fixup, tells * the driver to ignore any present sku defines. */
@@ -4138,6 +4219,19 @@ static int alc_check_power_status(struct hda_codec *codec, hda_nid_t nid) }#endif +static void activate_ctl (struct hda_codec *codec,const char *name,int active) +{ +struct snd_kcontrol *ctl =snd_hda_find_mixer_ctl (codec, name); +if (ctl) { + ctl->vd[0 ].access &= ~SNDRV_CTL_ELEM_ACCESS_INACTIVE ; + ctl->vd[0 ].access |= active ?0 :SNDRV_CTL_ELEM_ACCESS_INACTIVE ; + ctl->vd[0 ].access &= ~SNDRV_CTL_ELEM_ACCESS_WRITE ; + ctl->vd[0 ].access |= active ?SNDRV_CTL_ELEM_ACCESS_WRITE :0 ; +snd_ctl_notify (codec->bus->card, +SNDRV_CTL_EVENT_MASK_INFO , &ctl->id); + } +} +/* * Analog playback callbacks */
@@ -4169,6 +4263,34 @@ static int alc880_playback_pcm_cleanup(struct hda_pcm_stream *hinfo,return snd_hda_multi_out_analog_cleanup (codec, &spec->multiout); } +static int alc880_playback_pcm_close (struct hda_pcm_stream *hinfo, +struct hda_codec *codec, +struct snd_pcm_substream *substream) +{ +activate_ctl (codec,"Independent HP" ,1 ); +return 0 ; +} + +static int alc880_alt_playback_pcm_open (struct hda_pcm_stream *hinfo, +struct hda_codec *codec, +struct snd_pcm_substream *substream) +{ +struct alc_spec *spec = codec->spec; +if (spec->independent_hp) { +activate_ctl (codec,"Independent HP" ,0 ); +return 0 ; + } +return -EBUSY ; +} + +static int alc880_alt_playback_pcm_close (struct hda_pcm_stream *hinfo, +struct hda_codec *codec, +struct snd_pcm_substream *substream) +{ +activate_ctl (codec,"Independent HP" ,1 ); +return 0 ; +} +/* * Digital out */
@@ -4280,7 +4402,8 @@ static const struct hda_pcm_stream alc880_pcm_analog_playback = { .ops = { .open = alc880_playback_pcm_open, .prepare = alc880_playback_pcm_prepare, - .cleanup = alc880_playback_pcm_cleanup + .cleanup = alc880_playback_pcm_cleanup, + .close = alc880_playback_pcm_close }, };
@@ -4296,6 +4419,10 @@ static const struct hda_pcm_stream alc880_pcm_analog_alt_playback = { .channels_min = 2, .channels_max = 2,/* NID is set in alc_build_pcms */ + .ops = { + .open = alc880_alt_playback_pcm_open, + .close = alc880_alt_playback_pcm_close + }, };static const struct hda_pcm_stream alc880_pcm_analog_alt_capture = {
@@ -19049,6 +19176,9 @@ static int alc662_auto_create_extra_out(struct hda_codec *codec, hda_nid_t pin, err =alc662_add_sw_ctl (spec, pfx, mix,3 );if (err <0 )return err; + +if (strcmp (pfx,"Headphone" ) ==0 && spec->autocfg.line_outs ==4 ) +add_independent_hp (codec, pin, nid);return nid; }
@@ -19500,6 +19630,10 @@ static int patch_alc662(struct hda_codec *codec) spec->stream_analog_playback = &alc662_pcm_analog_playback; spec->stream_analog_capture = &alc662_pcm_analog_capture; +if (spec->alt_dac_nid) + spec->stream_analog_alt_playback = + &alc880_pcm_analog_alt_playback; + spec->stream_digital_playback = &alc662_pcm_digital_playback; spec->stream_digital_capture = &alc662_pcm_digital_capture;
Signature · 1 line
1.6.0.6
At Wed, 4 May 2011 23:42:24 +0800,
Quoted 7 lines · Raymond Yau
Request for testers to test the patch
Multistreaming allows you to listen to one audio source through the back panel speakers and a second audio source through front panel headphones or speakers.
Quoted 8 lines
Hardware requirement
1) 10 channels realtek codec (e.g. alc892) which already work with model=auto
2) Headphone at front panel and Line out at rear panel"hw:0,0" is used for the rear panel audio jack
"hw:0,2" is used for the front panel headphone when "Independent HP" is switched ON
I'd name it differently, e.g. "Headphone Stream Mode" taking "Slave" and "Independent", or such. An enum with "ON" and "OFF" is no sensible choice.
Takashi
2011/5/5 Takashi Iwai <[email protected]>
Quoted 23 lines
At Wed, 4 May 2011 23:42:24 +0800,
Quoted 5 lines · Raymond Yau
Request for testers to test the patch
Multistreaming allows you to listen to one audio source through the back panel speakers and a second audio source through front panel headphones
or
Quoted 10 lines
speakers.
Hardware requirement
1) 10 channels realtek codec (e.g. alc892) which already work with model=auto
2) Headphone at front panel and Line out at rear panel"hw:0,0" is used for the rear panel audio jack
"hw:0,2" is used for the front panel headphone when "Independent HP" is switched ONI'd name it differently, e.g. "Headphone Stream Mode" taking "Slave" and "Independent", or such. An enum with "ON" and "OFF" is no sensible choice.
Quoted 6 lines
Takashi
_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
Hi Raymond,
Looking at the specs of my motherboard (ASUS P7H55M-PRO) they wrote:
Realtek ALC892 8-Channel High Definition Audio CODEC
- BD Audio Layer Content Protection
- Support Jack-dectection, Multi-streaming,Front Panel Jack-Retasking (Mic in port)
- ASUS Noise Filter
- Optical S/PDIF out ports at back I/O
But from Realtek specs they wrote
" Ten DAC channels support 16/20/24-bit PCM format for 7.1 channel sound playback, plus 2 channels of concurrent independent stereo sound output (multiple streaming) through the front panel output "
An asus spec error? will be useful a test made on my motherboard?
About my problem, the audio card with the latest patches seems to work (but great noise when nothing is playing is present, i also tried to mute everything in alsamixer) so i could say "it works with model=auto"
I applied the patch, and build the kernel, this is my lastest alsa-info:
http://www.alsa-project.org/db/?f=61aa4129d0ea771ebc7226ea80c5c3ead24ef05c
"Loaded ALSA modules" is empty, but lsmod says:
dante log # lsmod|grep sndsnd_hda_codec_realtek 298841 1
snd_hda_intel 20936 0 snd_hda_codec 62886 2 snd_hda_codec_realtek,snd_hda_intel snd_hwdep 5484 1 snd_hda_codec
dante log #
I notice this in my dmesg
[ 12.805835] ALSA sound/pci/hda/patch_realtek.c:1842: realtek: No valid SSID, checking pincfg 0x4005e601 for NID 0x1d [ 12.805838] ALSA sound/pci/hda/patch_realtek.c:1858: realtek: Enabling init ASM_ID=0xe601 CODEC_ID=10ec0892 [ 12.805890] ALSA sound/pci/hda/patch_realtek.c:1569: realtek: Enable HP
auto-muting on NID 0x1b
Is normal "No valid SSID" ?
Alsa-conf still not find my sound card.
Sorry for the long story, but i would give you more informations as i can to help.
2011/5/5 Valerio tesei <[email protected]>
Quoted 6 lines
Hi Raymond,
About my problem, the audio card with the latest patches seems to work (but great noise when nothing is playing is present, i also tried to mute everything in alsamixer) so i could say "it works with model=auto"
I think it just partially works with model=auto
according to your alsa-info.sh
Quoted 2 lines
I applied the patch, and build the kernel, this is my lastest alsa-info:
http://www.alsa-project.org/db/?f=61aa4129d0ea771ebc7226ea80c5c3ead24ef05c
There are two sets of capture volume/switch and input sources controls but only one capture device
ARECORD
**** List of CAPTURE Hardware Devices ****
card 0: Intel [HDA Intel], device 0: ALC892 Analog [ALC892 Analog]
Subdevices: 1/1
Simple mixer control 'Input Source',0
Capabilities: cenum
Items: 'Rear Mic' 'Front Mic' 'Line'
Item0: 'Rear Mic'
Simple mixer control 'Input Source',1
Capabilities: cenum
Items: 'Rear Mic' 'Front Mic' 'Line'
Item0: 'Line'
What kind of noise ?
Do you mean that the noise can be hear in HP and all audio jacks at rear panel ?
Have you try those parameter in
http://git.alsa-project.org/?p=alsa-kernel.git;a=blob_plain;f=Documentation/sound/alsa/HD-Audio.txt
Assuming that you are using default devices in/usr/share/alsa/cards/HDA-Intel.conf
You should keep "PCM Playback Volume" at 0dB since it a softvol plugin
Simple mixer control 'PCM',0
Capabilities: pvolume penum
Playback channels: Front Left - Front Right
Limits: Playback 0 - 255
Mono:
Front Left: Playback 180 [71%] [-15.00dB]
Front Right: Playback 180 [71%] [-15.00dB]
control.36 {
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 180
value.1 180
}Quoted 5 lines
So i made the test, i correctly hear the tests, 7 outputs for the rear panel, and 2 for the front, but when i play the first test, i hear on the front panel some noise and realy crackly and whispered the tests when front left and front right are played, i guess it is not normal, may this help?
Can you compile the driver --with-debug=verbose ?
Check those hda_codec_setup_stream , hda_codec_prepare_stream and hda_codec_cleanup_stream
when the driver is init, "independent HP" is off by default so you should find one setup stream/cleanup stream for each DAC
when turn on , only four DAC is used when playing 8 channels
only 1 DAC is used for device 2
2011/5/7 Raymond Yau <[email protected]>
Quoted 5 lines
2011/5/5 Valerio tesei <[email protected]>
Quoted 3 lines
Hi Raymond,
Quoted 8 lines
Quoted 1 line
About my problem, the audio card with the latest patches seems to work
(but
Quoted 2 lines
great noise when nothing is playing is present, i also tried to mute everything in alsamixer) so i could say "it works with model=auto"
I think it just partially works with model=auto
This mean that i must wait that some one fix my sound card? I'm not able to do this by myself
Quoted 11 lines
according to your
alsa-info.shQuoted 2 lines
I applied the patch, and build the kernel, this is my lastest alsa-info:
http://www.alsa-project.org/db/?f=61aa4129d0ea771ebc7226ea80c5c3ead24ef05c
There are two sets of capture volume/switch and input sources controls but only one capture device
So the patch is not working for my hw, or I was wrong with configuration?
Quoted 56 lines
ARECORD
**** List of CAPTURE Hardware Devices ****
card 0: Intel [HDA Intel], device 0: ALC892 Analog [ALC892 Analog]
Subdevices: 1/1Simple mixer control 'Input Source',0
Capabilities: cenum
Items: 'Rear Mic' 'Front Mic' 'Line'
Item0: 'Rear Mic'
Simple mixer control 'Input Source',1
Capabilities: cenum
Items: 'Rear Mic' 'Front Mic' 'Line'
Item0: 'Line'What kind of noise ?
Do you mean that the noise can be hear in HP and all audio jacks at rear panel ?
Have you try those parameter in
http://git.alsa-project.org/?p=alsa-kernel.git;a=blob_plain;f=Documentation/sound/alsa/HD-Audio.txt
Assuming that you are using default devices in
/usr/share/alsa/cards/HDA-Intel.confYou should keep "PCM Playback Volume" at 0dB since it a softvol plugin
Simple mixer control 'PCM',0
Capabilities: pvolume penum
Playback channels: Front Left - Front Right
Limits: Playback 0 - 255
Mono:
Front Left: Playback 180 [71%] [-15.00dB]
Front Right: Playback 180 [71%] [-15.00dB]control.36 { 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 180 value.1 180 }
Quoted 8 lines
Quoted 5 lines
So i made the test, i correctly hear the tests, 7 outputs for the rear panel, and 2 for the front, but when i play the first test, i hear on the front panel some noise and realy crackly and whispered the tests when front left and front right are played, i guess it is not normal, may this help?
Can you compile the driver --with-debug=verbose ?
I'm building the kernel version of the alsa driver, using the kernel git from takashi, how could I pass the verbose parameter while building the kernel version of the driver, somethings in the sound/Makefile or i should enable the "Verbose printk" ?
Quoted 7 lines
Check those
hda_codec_setup_stream,hda_codec_prepare_streamandhda_codec_cleanup_streamwhen the driver is init, "independent HP" is off by default so you should find one setup stream/cleanup stream for each DAC
Quoted 8 lines
when turn on , only four DAC is used when playing 8 channels
only 1 DAC is used for device 2
_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
What about the rear / front problem that make hear only one channel at front and only one channel at rear is a configuration problem or a driver problem? I tried a lot deleting asound.state
Help me to collect the informations that you need, sorry for my noobish.
V.
2011/5/9 Valerio tesei <[email protected]>
Quoted 9 lines
2011/5/7 Raymond Yau <[email protected]>
Quoted 7 lines
2011/5/5 Valerio tesei <[email protected]>
Quoted 4 lines
Hi Raymond,
About my problem, the audio card with the latest patches seems to work
(but
Quoted 9 lines
Quoted 6 lines
Quoted 2 lines
great noise when nothing is playing is present, i also tried to mute everything in alsamixer) so i could say "it works with model=auto"
I think it just partially works with model=auto
This mean that i must wait that some one fix my sound card? I'm not able to do this by myself
What about the rear / front problem that make hear only one channel at
Quoted 5 lines
front
and only one channel at rear is a configuration problem or a driver problem?
you can use hda-analyzer to change the volume slider and mute switch in the path from [Audio Output] to [Pin Complex] ,the graph show all the connected path in thick blue line (same as datasheet) and the status line show the value of those mixers
Quoted 11 lines
according to your
alsa-info.shQuoted 2 lines
I applied the patch, and build the kernel, this is my lastest alsa-info:
http://www.alsa-project.org/db/?f=61aa4129d0ea771ebc7226ea80c5c3ead24ef05c
There are two sets of capture volume/switch and input sources controls but only one capture device
The auto model need to check whether HDA controller has enough stream for alt_capture device 2
Can you record from device 2 and device 0 from different mic or line in at the same time ?
after you force the driver to create device 2
if (!spec->adc_nids) {
spec->adc_nids = alc662_adc_nids;
spec->num_adc_nids = ARRAY_SIZE(alc662_adc_nids);
}
if (!spec->capsrc_nids)
spec->capsrc_nids = alc662_capsrc_nids;
if (!spec->cap_mixer)
set_capture_mixer(codec);+ spec->stream_analog_alt_capture = &alc880_pcm_analog_alt_capture;
if not, the driver may need to mute and remove the controls of second ADC
Quoted 8 lines
Quoted 8 lines
What kind of noise ?
Do you mean that the noise can be hear in HP and all audio jacks at rear panel ?
Quoted 6 lines
Quoted 5 lines
Quoted 5 lines
So i made the test, i correctly hear the tests, 7 outputs for the rear panel, and 2 for the front, but when i play the first test, i hear on the front panel some noise and realy crackly and whispered the tests when front left and front right are played, i guess it is not normal, may this help?
if you turn on "Independent HP" but still hear sound when you are playing sound to rear panel,
The logic in snd_hda_multi_out_analog_prep()
1) set up line_out[0] to use Front DAC
2) set up HP if (!mout->no_share_stream &&
mout->hp_nid && mout->hp_nid != nids[HDA_FRONT])
3) copy front to extra out if (!mout->no_share_stream && mout->extra_out_nid[i])
4) setup other line_out up to request channel
5) copy front to remain line_out
so you need to check the system log whether the correct [Audio Output] are used in 2, 4, 6, 8 channels playback
when playing stereo, the left channel is copy to the center and the right channel is copy to the subwoofer for the orange jack. because of (5)
My patch is based on "auto" model can create a "Headphone Playback Volume" on a DAC which is not already used by multi_out (rear panel jacks for multichannel playback)
The "Independent HP" is off by default so it is as same as the original model="auto"
so mout->hp_nid must not be null
Node 0x1b [Pin Complex] wcaps 0x40058f: Stereo Amp-In Amp-Out Amp-In caps: ofs=0x00, nsteps=0x03, stepsize=0x27, mute=0
Amp-In vals: [0x00 0x00]
Amp-Out caps: ofs=0x00, nsteps=0x00, stepsize=0x00, mute=1 Amp-Out vals: [0x00 0x00]
Pincap 0x0001373e: IN OUT HP EAPD Detect Trigger Vref caps: HIZ 50 GRD 80 100
EAPD 0x2: EAPD
Pin Default 0x02214820: [Jack] HP Out at Ext Front Conn = 1/8, Color = Green
DefAssociation = 0x2, Sequence = 0x0
Pin-ctls: 0xc0: OUT HP 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*
If the noise already appear with model=auto without my patch
a) you can force the driver connect HP to 0x0c (the mixer of Front DAC) , but there won't be any "Headphone Volume Control" in this path
static int alc662_auto_create_extra_out(struct hda_codec *codec, hda_nid_t pin,
const char *pfx)
{
struct alc_spec *spec = codec->spec;
hda_nid_t nid, mix;
int err;
if (!pin)
return 0;
nid = alc_auto_look_for_dac(codec, pin);
+ nid = 0;
if (!nid) {b) you can disable the copy front mode by
comment the code related to 3) and 5)
c) study the info about anti -pop mode (EPSS) in the datasheet
d) disable the unsolicited event for hp automute
e) disable sticky stream
spec->no_sticky_stream = 1
2011/5/5 Takashi Iwai <[email protected]>
Quoted 19 lines
At Wed, 4 May 2011 23:42:24 +0800,
Quoted 5 lines · Raymond Yau
Request for testers to test the patch
Multistreaming allows you to listen to one audio source through the back panel speakers and a second audio source through front panel headphones
or
Quoted 10 lines
speakers.
Hardware requirement
1) 10 channels realtek codec (e.g. alc892) which already work with model=auto
2) Headphone at front panel and Line out at rear panel"hw:0,0" is used for the rear panel audio jack
"hw:0,2" is used for the front panel headphone when "Independent HP" is switched ON
Quoted 6 lines
I'd name it differently, e.g. "Headphone Stream Mode" taking "Slave" and "Independent", or such. An enum with "ON" and "OFF" is no sensible choice.
Takashi
Use "Independent HP" just because patch_via.c already used it so it is better to use a standard name for all hda codecs
At Fri, 6 May 2011 11:30:16 +0800,
Quoted 26 lines · Raymond Yau
2011/5/5 Takashi Iwai <[email protected]>
Quoted 23 lines
At Wed, 4 May 2011 23:42:24 +0800,
Quoted 5 lines · Raymond Yau
Request for testers to test the patch
Multistreaming allows you to listen to one audio source through the back panel speakers and a second audio source through front panel headphones
or
Quoted 10 lines
speakers.
Hardware requirement
1) 10 channels realtek codec (e.g. alc892) which already work with model=auto
2) Headphone at front panel and Line out at rear panel"hw:0,0" is used for the rear panel audio jack
"hw:0,2" is used for the front panel headphone when "Independent HP" is switched ONI'd name it differently, e.g. "Headphone Stream Mode" taking "Slave" and "Independent", or such. An enum with "ON" and "OFF" is no sensible choice.
Quoted 5 lines
Quoted 2 lines
Takashi
Use "Independent HP" just because
patch_via.calready used it so it is better to use a standard name for all hda codecs
Yeah, I know. But this name is confusing, so better to change in patch_via.c as well.
Takashi
2011/5/6 Takashi Iwai <[email protected]>
Quoted 11 lines
Quoted 4 lines
Use "Independent HP" just because
patch_via.calready used it so it is better to use a standard name for all hda codecsYeah, I know. But this name is confusing, so better to change in
patch_via.cas well.Takashi
To force pulseaudio to get the correct subdevice for via codec, you may need to add "subdevice 0" to HDA-intel.conf
since subdevice 0 support multichannel but subdevice 1 only support stereo
playback.pcm {
type softvol
slave.pcm {
type hw
card $CARD
+ subdevice 0
}
control {
name "PCM Playback Volume"
card $CARD
}
}HDA-Intel.pcm.surround40.0 cards.HDA-Intel.pcm.front.0 HDA-Intel.pcm.surround51.0 cards.HDA-Intel.pcm.front.0 HDA-Intel.pcm.surround71.0 cards.HDA-Intel.pcm.front.0
At Sat, 7 May 2011 11:48:19 +0800,
Quoted 21 lines · Raymond Yau
2011/5/6 Takashi Iwai <[email protected]>
Quoted 11 lines
Quoted 4 lines
Use "Independent HP" just because
patch_via.calready used it so it is better to use a standard name for all hda codecsYeah, I know. But this name is confusing, so better to change in
patch_via.cas well.Takashi
To force pulseaudio to get the correct subdevice for via codec, you may need to add "subdevice 0" to HDA-intel.conf
since subdevice 0 support multichannel but subdevice 1 only support stereo
Quoted 12 lines
playback.pcm {
type softvol
slave.pcm {
type hw
card $CARD
+ subdevice 0
}
control {
name "PCM Playback Volume"
card $CARD
}
}OK, fixed now. Thanks.
Takashi
2011/5/9 Takashi Iwai <[email protected]>
Quoted 39 lines
At Sat, 7 May 2011 11:48:19 +0800,
Quoted 6 lines · Raymond Yau
2011/5/6 Takashi Iwai <[email protected]>
Quoted 3 lines
Quoted 3 lines
Use "Independent HP" just because
patch_via.calready used it so itis
Quoted 10 lines
Quoted 8 lines
Quoted 1 line
better to use a standard name for all hda codecs
Yeah, I know. But this name is confusing, so better to change in
patch_via.cas well.Takashi
To force pulseaudio to get the correct subdevice for via codec, you may
need
Quoted 3 lines
to add "subdevice 0" to HDA-intel.conf
since subdevice 0 support multichannel but subdevice 1 only support
stereo
Quoted 14 lines
playback.pcm { type softvol slave.pcm { type hw card $CARD + subdevice 0 } control { name "PCM Playback Volume" card $CARD } }
Quoted 5 lines
OK, fixed now. Thanks.
Takashi
But dmix still fail and you cannot use dmix with subdevice 1
Quoted 1 line
Quoted 1 line
I'd name it differently, e.g. "Headphone Stream Mode" taking "Slave" and
"Independent", or such. An enum with "ON" and "OFF" is no sensible choice.
The main point is how can the user find out which subdevice or device is used for "Headphone Stream"
Neither "aplay -l " nor "aplay -L' provide any useful information to the user
APLAY
**** List of PLAYBACK Hardware Devices ****
card 0: SB [HDA ATI SB], device 0: VT1708S Analog [VT1708S Analog]
Subdevices: 1/2
Subdevice #0: subdevice #0
Subdevice #1: subdevice #1
ARECORD
**** List of CAPTURE Hardware Devices ****
card 0: SB [HDA ATI SB], device 0: VT1708S Analog [VT1708S Analog]
Subdevices: 2/2
Subdevice #0: subdevice #0
Subdevice #1: subdevice #1
At Tue, 10 May 2011 14:42:45 +0800,
Quoted 42 lines · Raymond Yau
2011/5/9 Takashi Iwai <[email protected]>
Quoted 39 lines
At Sat, 7 May 2011 11:48:19 +0800,
Quoted 6 lines · Raymond Yau
2011/5/6 Takashi Iwai <[email protected]>
Quoted 3 lines
Quoted 3 lines
Use "Independent HP" just because
patch_via.calready used it so itis
Quoted 10 lines
Quoted 8 lines
Quoted 1 line
better to use a standard name for all hda codecs
Yeah, I know. But this name is confusing, so better to change in
patch_via.cas well.Takashi
To force pulseaudio to get the correct subdevice for via codec, you may
need
Quoted 3 lines
to add "subdevice 0" to HDA-intel.conf
since subdevice 0 support multichannel but subdevice 1 only support
stereo
Quoted 14 lines
playback.pcm { type softvol slave.pcm { type hw card $CARD + subdevice 0 } control { name "PCM Playback Volume" card $CARD } }
Quoted 7 lines
Quoted 5 lines
OK, fixed now. Thanks.
Takashi
But dmix still fail and you cannot use dmix with subdevice 1
Please elaborate. You can use dmix with subdevice 1 when you write your own config. "front" definition is not for other but the primary device. It's no definition for every output device.
Quoted 8 lines
Quoted 1 line
Quoted 1 line
I'd name it differently, e.g. "Headphone Stream Mode" taking "Slave" and
"Independent", or such. An enum with "ON" and "OFF" is no sensible choice.
The main point is how can the user find out which subdevice or device is used for "Headphone Stream"
Neither "aplay -l " nor "aplay -L' provide any useful information to the user
Yeah, because there is no standard definition for such streams. We need to start from defining it at first.
Takashi
Il 04/05/2011 17:42, Raymond Yau ha scritto:
Quoted 22 lines
Request for testers to test the patch
Multistreaming allows you to listen to one audio source through the back panel speakers and a second audio source through front panel headphones or speakers.
Hardware requirement
1) 10 channels realtek codec (e.g. alc892) which already work with model=auto
2) Headphone at front panel and Line out at rear panel"hw:0,0" is used for the rear panel audio jack
"hw:0,2" is used for the front panel headphone when "Independent HP" is switched ONAdd an "Independent HP" switch to turn this feature on/off for desktop for those HDA codec
Test:
1) speaker-test -c 8 -t wav -Dhw:0,0
2) speaker-test -c 2 -t wav -Dhw:0,2
Quoted 8 lines
It will need modification to support this feature for those desktop with 8 channels codec
_______________________________________________
Alsa-devel mailing list
[email protected]
http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
So i made the test, i correctly hear the tests, 7 outputs for the rear panel, and 2 for the front, but when i play the first test, i hear on the front panel some noise and realy crackly and whispered the tests when front left and front right are played, i guess it is not normal, may this help?
Signature · 4 lines
*Email:* [email protected] *Cellulare:* +39.3394768306 *Gtalk:* [email protected] *LinkedIn:* http://www.linkedin.com/pub/valerio-tesei/22/a87/577
2011/5/6 Valerio Tesei <[email protected]>
Quoted 26 lines
Il 04/05/2011 17:42, Raymond Yau ha scritto:
Quoted 4 lines
Request for testers to test the patch
Multistreaming allows you to listen to one audio source through the back panel speakers and a second audio source through front panel headphones
or
Quoted 7 lines
speakers.
Hardware requirement
1) 10 channels realtek codec (e.g. alc892) which already work with model=auto
2) Headphone at front panel and Line out at rear panelQuoted 5 lines
"hw:0,0" is used for the rear panel audio jack
"hw:0,2" is used for the front panel headphone when "Independent HP" is switched ONAdd an "Independent HP" switch to turn this feature on/off for desktop
for
Quoted 7 lines
those HDA codec
Test:
1) speaker-test -c 8 -t wav -Dhw:0,0
2) speaker-test -c 2 -t wav -Dhw:0,2It will need modification to support this feature for those desktop with
Quoted 9 lines
8
Quoted 2 lines
channels codec
So i made the test, i correctly hear the tests, 7 outputs for the rear panel, and 2 for the front, but when i play the first test, i hear on the front panel some noise and realy crackly and whispered the tests when front left and front right are played, i guess it is not normal, may this help?
using hda-emu , it seem that the "Headpone Playback Switch" still using 0x0c instead of 0x26
Quoted 1 line
get 11
send: NID=0x1b, VERB=0xba0(get_amp_gain_mute,O:L#0), PARM=0x0
receive: 0x0
send: NID=0x1b, VERB=0xb80(get_amp_gain_mute,O:R#0), PARM=0x0
receive: 0x0
11 Headphone Playback Switch:0
MIN/MAX: 0/1, VAL: [1] [1]
Quoted 1 line
set 11 0 0
send: NID=0xc, VERB=0xb20(get_amp_gain_mute,I:L#0), PARM=0x0
receive: 0x0
send: NID=0xc, VERB=0xb00(get_amp_gain_mute,I:R#0), PARM=0x0
receive: 0x0
send: NID=0x1b, VERB=0x3a0(set_amp_gain_mute,O:L#0), PARM=0x80
send: NID=0x1b, VERB=0x390(set_amp_gain_mute,O:R#0), PARM=0x80
Quoted 1 line
set 11 1 1
send: NID=0x1b, VERB=0x3a0(set_amp_gain_mute,O:L#0), PARM=0x0
send: NID=0x1b, VERB=0x390(set_amp_gain_mute,O:R#0), PARM=0x0
Node 0x1b [Pin Complex] wcaps 0x40058f: Stereo Amp-In Amp-Out
Control: name="Headphone Playback Switch", index=0, device=0
ControlAmp: chs=3, dir=Out, idx=0, ofs=0
Amp-In caps: ofs=0x00, nsteps=0x03, stepsize=0x27, mute=0
Amp-In vals: [0x00 0x00]
Amp-Out caps: ofs=0x00, nsteps=0x00, stepsize=0x00, mute=1
Amp-Out vals: [0x00 0x00]
Pincap 0x0001373e: IN OUT HP EAPD Detect Trigger
Vref caps: HIZ 50 GRD 80 100
EAPD 0x0:
Pin Default 0x02214820: [Jack] HP Out at Ext Front
Conn = 1/8, Color = Green
DefAssociation = 0x2, Sequence = 0x0
Pin-ctls: 0xc0: OUT HP VREF_HIZ
Unsolicited: tag=04, enabled=1
Power states: D0 D1 D2 D3
Power: setting=D0, actual=D0
Connection: 5
0x0c 0x0d 0x0e 0x0f 0x26*