diff mbox

2 speakers are assigned to the same DAC, this can't support 4.0/2.1 channles

Message ID 5576B419.5010505@canonical.com (mailing list archive)
State Accepted
Delegated to: Takashi Iwai
Headers show

Commit Message

Hui Wang June 9, 2015, 9:38 a.m. UTC
I am trying to enable the subwoofer speaker on a HP laptop, on this
machine, there are two speakers and one headphone, but the BIOS verb
only enabled one speaker(nid 0xd) and one headphone(nid 0xb), I need
to use quirk in the kernel driver to configure the second speaker
(subwoofer speaker, nid 0x10). Under current alsa driver, the
headphone will be assigned a dac (nid 0x13) and the 2 speakers will
be assigned a dac (nid 0x14), this assignment is not good since 2
speakers share the same dac, this means 2 speakers can't work
at the same time to support 4.0/2.1 channels.

On another Dell machine with realtek codec, there are also 2 speakers,
1 headphone and 2 dacs, on this machine, 1 speaker and 1 headphone are 
assigned
1 dac, and the other speaker is assigned another dac, so there is no
problem for this machine to support 4.0/2.1 channels.

Through debugging, I found on Dell machine, the speaker nid only has
one connection to dac (hardwired), so when driver assign dac to it, the
map_single() can successfully assign the each dac to the 2 speakers 
respectively.
But on that HP machine, the speaker has multiple connections for dac, the
map_single() can't work for this machine.


The alsa-info.txt for that HP machine is at 
http://pastebin.ubuntu.com/11667947/
The alsa-info.txt for that Dell machine is at 
http://pastebin.ubuntu.com/11667982/

To fix this problem, I can use the quirk in the driver to make the 
speaker have
only one connection for dac or do some change in the hda_generic.c like 
below, in
your opinion, which one is better or probably you have a different idea 
to fix this problem?

         SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x1941,

Comments

Raymond Yau June 9, 2015, 11:50 a.m. UTC | #1
2015-6-9 ??5:39 ? "hwang4" <hui.wang@canonical.com> ???
>
> I am trying to enable the subwoofer speaker on a HP laptop, on this
> machine, there are two speakers and one headphone, but the BIOS verb
> only enabled one speaker(nid 0xd) and one headphone(nid 0xb), I need
> to use quirk in the kernel driver to configure the second speaker
> (subwoofer speaker, nid 0x10). Under current alsa driver, the
> headphone will be assigned a dac (nid 0x13) and the 2 speakers will
> be assigned a dac (nid 0x14), this assignment is not good since 2
> speakers share the same dac, this means 2 speakers can't work
> at the same time to support 4.0/2.1 channels.
>
> On another Dell machine with realtek codec, there are also 2 speakers,
> 1 headphone and 2 dacs, on this machine, 1 speaker and 1 headphone are
assigned
> 1 dac, and the other speaker is assigned another dac, so there is no
> problem for this machine to support 4.0/2.1 channels.
>
> Through debugging, I found on Dell machine, the speaker nid only has
> one connection to dac (hardwired), so when driver assign dac to it, the
> map_single() can successfully assign the each dac to the 2 speakers
respectively.
> But on that HP machine, the speaker has multiple connections for dac, the
> map_single() can't work for this machine.
>
>
> The alsa-info.txt for that HP machine is at
http://pastebin.ubuntu.com/11667947/

Refer to 92HD91, you don't need 4 channel when there is band pass filter
for the subwoofer at the mono pin

2.2. Mono Output
The Mono Out port source selection, power state, and mute characteristics
are all independently
controlled by the mono output port controls. EQ does not apply to this
path. An internal 2nd order band-pass filter is provided to restrict the
output frequencies when using mono out to drive an exter-
nal amplified sub-woofer

> The alsa-info.txt for that Dell machine is at
http://pastebin.ubuntu.com/11667982/

The subwoofer is also at mono pin complex, are  there any low pass filter
for the subwoofer or vendor coeff need to be set ?

>
> To fix this problem, I can use the quirk in the driver to make the
speaker have
> only one connection for dac or do some change in the hda_generic.c like
below, in
> your opinion, which one is better or probably you have a different idea
to fix this problem?
>
Hui Wang June 9, 2015, 1:20 p.m. UTC | #2
On 06/09/2015 07:50 PM, Raymond Yau wrote:
> 2015-6-9 ??5:39 ? "hwang4" <hui.wang@canonical.com> ???
>> I am trying to enable the subwoofer speaker on a HP laptop, on this
>> machine, there are two speakers and one headphone, but the BIOS verb
>> only enabled one speaker(nid 0xd) and one headphone(nid 0xb), I need
>> to use quirk in the kernel driver to configure the second speaker
>> (subwoofer speaker, nid 0x10). Under current alsa driver, the
>> headphone will be assigned a dac (nid 0x13) and the 2 speakers will
>> be assigned a dac (nid 0x14), this assignment is not good since 2
>> speakers share the same dac, this means 2 speakers can't work
>> at the same time to support 4.0/2.1 channels.
>>
>> On another Dell machine with realtek codec, there are also 2 speakers,
>> 1 headphone and 2 dacs, on this machine, 1 speaker and 1 headphone are
> assigned
>> 1 dac, and the other speaker is assigned another dac, so there is no
>> problem for this machine to support 4.0/2.1 channels.
>>
>> Through debugging, I found on Dell machine, the speaker nid only has
>> one connection to dac (hardwired), so when driver assign dac to it, the
>> map_single() can successfully assign the each dac to the 2 speakers
> respectively.
>> But on that HP machine, the speaker has multiple connections for dac, the
>> map_single() can't work for this machine.
>>
>>
>> The alsa-info.txt for that HP machine is at
> http://pastebin.ubuntu.com/11667947/
>
> Refer to 92HD91, you don't need 4 channel when there is band pass filter
> for the subwoofer at the mono pin
Yes, you are right.
>
> 2.2. Mono Output
> The Mono Out port source selection, power state, and mute characteristics
> are all independently
> controlled by the mono output port controls. EQ does not apply to this
> path. An internal 2nd order band-pass filter is provided to restrict the
> output frequencies when using mono out to drive an exter-
> nal amplified sub-woofer
Where did you find this text? Does it mean there is a hardware low 
frequency pass filter inside the codec?
>
>> The alsa-info.txt for that Dell machine is at
> http://pastebin.ubuntu.com/11667982/
>
> The subwoofer is also at mono pin complex, are  there any low pass filter
> for the subwoofer or vendor coeff need to be set ?
I don't know it, I guess there is no hardware filter, it will work with 
the software low pass filter in the pulseaudio.
>
>> To fix this problem, I can use the quirk in the driver to make the
> speaker have
>> only one connection for dac or do some change in the hda_generic.c like
> below, in
>> your opinion, which one is better or probably you have a different idea
> to fix this problem?
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
Raymond Yau June 10, 2015, 1:30 a.m. UTC | #3
>>>
>>> I am trying to enable the subwoofer speaker on a HP laptop, on this
>>> machine, there are two speakers and one headphone, but the BIOS verb
>>> only enabled one speaker(nid 0xd) and one headphone(nid 0xb), I need
>>> to use quirk in the kernel driver to configure the second speaker
>>> (subwoofer speaker, nid 0x10). Under current alsa driver, the
>>> headphone will be assigned a dac (nid 0x13) and the 2 speakers will
>>> be assigned a dac (nid 0x14), this assignment is not good since 2
>>> speakers share the same dac, this means 2 speakers can't work
>>> at the same time to support 4.0/2.1 channels.
>>>
>>> On another Dell machine with realtek codec, there are also 2 speakers,
>>> 1 headphone and 2 dacs, on this machine, 1 speaker and 1 headphone are
>>
>> assigned
>>>
>>> 1 dac, and the other speaker is assigned another dac, so there is no
>>> problem for this machine to support 4.0/2.1 channels.
>>>
>>> Through debugging, I found on Dell machine, the speaker nid only has
>>> one connection to dac (hardwired), so when driver assign dac to it, the
>>> map_single() can successfully assign the each dac to the 2 speakers
>>
>> respectively.
>>>
>>> But on that HP machine, the speaker has multiple connections for dac,
the
>>> map_single() can't work for this machine.
>>>
>>>
>>> The alsa-info.txt for that HP machine is at
>>
>> http://pastebin.ubuntu.com/11667947/
>>
>> Refer to 92HD91, you don't need 4 channel when there is band pass filter
>> for the subwoofer at the mono pin
>
> Yes, you are right.
>
>>
>> 2.2. Mono Output
>> The Mono Out port source selection, power state, and mute characteristics
>> are all independently
>> controlled by the mono output port controls. EQ does not apply to this
>> path. An internal 2nd order band-pass filter is provided to restrict the
>> output frequencies when using mono out to drive an exter-
>> nal amplified sub-woofer
>
> Where did you find this text? Does it mean there is a hardware low
frequency pass filter inside the codec?

http://www.temposemi.com/products/pclaptop-hd/92hd91/

2.3. Mono output Band-Pass Filter
For many applications, the primary speakers are incapable of reproducing
low frequency audio. Therefore it is desirable to implement a woofer or
sub-woofer speaker. The mono output is ideal for this task. However, the
frequency response should be restricted to prevent interference with the
primary speakers. Typically an external filter, known as a cross-over
filter, is used. The mono processing path includes a band-pass filter with
programmable high and low cut-off frequencies to eliminate the need for an
external filter.

2.3.1. Mixer Filter Description The band-pass filter is derived from the
common biquadratic filter and provides a 12dB/octave roll-off. The filter
may be programmed for a -3dB lower band edge of: 63Hz, 80Hz, 100Hz, 120Hz,
150Hz, 200Hz, 315Hz, or 400Hz.

The filter may be programmed for a -3dB upper band edge of: 150Hz, 200Hz,
250Hz, 315Hz, 400Hz, 500Hz, 630Hz, or 800Hz.

The band-pass filter is enabled by default with a cut-off frequencies at
120Hz and 250Hz. The filter may be bypassed using the associated verb
(processing state verb
Hui Wang June 10, 2015, 3:18 a.m. UTC | #4
On 2015?06?10? 09:30, Raymond Yau wrote:
>>>> I am trying to enable the subwoofer speaker on a HP laptop, on this
>>>> machine, there are two speakers and one headphone, but the BIOS verb
>>>> only enabled one speaker(nid 0xd) and one headphone(nid 0xb), I need
>>>> to use quirk in the kernel driver to configure the second speaker
>>>> (subwoofer speaker, nid 0x10). Under current alsa driver, the
>>>> headphone will be assigned a dac (nid 0x13) and the 2 speakers will
>>>> be assigned a dac (nid 0x14), this assignment is not good since 2
>>>> speakers share the same dac, this means 2 speakers can't work
>>>> at the same time to support 4.0/2.1 channels.
>>>>
>>>> On another Dell machine with realtek codec, there are also 2 speakers,
>>>> 1 headphone and 2 dacs, on this machine, 1 speaker and 1 headphone are
>>> assigned
>>>> 1 dac, and the other speaker is assigned another dac, so there is no
>>>> problem for this machine to support 4.0/2.1 channels.
>>>>
>>>> Through debugging, I found on Dell machine, the speaker nid only has
>>>> one connection to dac (hardwired), so when driver assign dac to it, the
>>>> map_single() can successfully assign the each dac to the 2 speakers
>>> respectively.
>>>> But on that HP machine, the speaker has multiple connections for dac,
> the
>>>> map_single() can't work for this machine.
>>>>
>>>>
>>>> The alsa-info.txt for that HP machine is at
>>> http://pastebin.ubuntu.com/11667947/
>>>
>>> Refer to 92HD91, you don't need 4 channel when there is band pass filter
>>> for the subwoofer at the mono pin
>> Yes, you are right.
>>
>>> 2.2. Mono Output
>>> The Mono Out port source selection, power state, and mute characteristics
>>> are all independently
>>> controlled by the mono output port controls. EQ does not apply to this
>>> path. An internal 2nd order band-pass filter is provided to restrict the
>>> output frequencies when using mono out to drive an exter-
>>> nal amplified sub-woofer
>> Where did you find this text? Does it mean there is a hardware low
> frequency pass filter inside the codec?
>
> http://www.temposemi.com/products/pclaptop-hd/92hd91/
>
> 2.3. Mono output Band-Pass Filter
> For many applications, the primary speakers are incapable of reproducing
> low frequency audio. Therefore it is desirable to implement a woofer or
> sub-woofer speaker. The mono output is ideal for this task. However, the
> frequency response should be restricted to prevent interference with the
> primary speakers. Typically an external filter, known as a cross-over
> filter, is used. The mono processing path includes a band-pass filter with
> programmable high and low cut-off frequencies to eliminate the need for an
> external filter.
>
> 2.3.1. Mixer Filter Description The band-pass filter is derived from the
> common biquadratic filter and provides a 12dB/octave roll-off. The filter
> may be programmed for a -3dB lower band edge of: 63Hz, 80Hz, 100Hz, 120Hz,
> 150Hz, 200Hz, 315Hz, or 400Hz.
>
> The filter may be programmed for a -3dB upper band edge of: 150Hz, 200Hz,
> 250Hz, 315Hz, 400Hz, 500Hz, 630Hz, or 800Hz.
>
> The band-pass filter is enabled by default with a cut-off frequencies at
> 120Hz and 250Hz. The filter may be bypassed using the associated verb
> (processing state verb
Thanks very much, very useful information.


> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
>
>
Raymond Yau June 10, 2015, 4:59 a.m. UTC | #5
>
>>
>>> The alsa-info.txt for that Dell machine is at
>>
>> http://pastebin.ubuntu.com/11667982/
>>
>> The subwoofer is also at mono pin complex, are  there any low pass filter
>> for the subwoofer or vendor coeff need to be set ?
>
> I don't know it, I guess there is no hardware filter, it will work with
the software low pass filter in the pulseaudio.
>>

http://www.realtek.com.tw/products/productsView.aspx?Langid=1&PFid=27&Level=5&Conn=4&ProdID=166

The ALC269 integrates five hardware equalizer bands composed of one
low-pass filter, one high-pass filter, and three band-pass filters to
compensate for mini-speaker frequency response

Do you mean alc255 does not have tbr hardware equalizer ?
Hui Wang June 10, 2015, 6:42 a.m. UTC | #6
On 2015?06?10? 12:59, Raymond Yau wrote:
>
> >
> >>
> >>> The alsa-info.txt for that Dell machine is at
> >>
> >> http://pastebin.ubuntu.com/11667982/
> >>
> >> The subwoofer is also at mono pin complex, are  there any low pass 
> filter
> >> for the subwoofer or vendor coeff need to be set ?
> >
> > I don't know it, I guess there is no hardware filter, it will work 
> with the software low pass filter in the pulseaudio.
> >>
>
> http://www.realtek.com.tw/products/productsView.aspx?Langid=1&PFid=27&Level=5&Conn=4&ProdID=166
>
> The ALC269 integrates five hardware equalizer bands composed of one 
> low-pass filter, one high-pass filter, and three band-pass filters to 
> compensate for mini-speaker frequency response
>
> Do you mean alc255 does not have tbr hardware equalizer ?
>
I don't have alc255 datasheet, but according to the alc269 feature 
description, it is highly possible that alc255 also has hardware equalizer.

And do you know how to control those equalizer filters with software or 
do you know where we can find the detailed document for this part?
Raymond Yau June 11, 2015, 1:15 a.m. UTC | #7
>>>>>
>>>>> I am trying to enable the subwoofer speaker on a HP laptop, on this
>>>>> machine, there are two speakers and one headphone, but the BIOS verb
>>>>> only enabled one speaker(nid 0xd) and one headphone(nid 0xb), I need
>>>>> to use quirk in the kernel driver to configure the second speaker
>>>>> (subwoofer speaker, nid 0x10). Under current alsa driver, the
>>>>> headphone will be assigned a dac (nid 0x13) and the 2 speakers will
>>>>> be assigned a dac (nid 0x14), this assignment is not good since 2
>>>>> speakers share the same dac, this means 2 speakers can't work
>>>>> at the same time to support 4.0/2.1 channels.
>>>>>
>>>>> On another Dell machine with realtek codec, there are also 2 speakers,
>>>>> 1 headphone and 2 dacs, on this machine, 1 speaker and 1 headphone are
>>>>
>>>> assigned
>>>>>
>>>>> 1 dac, and the other speaker is assigned another dac, so there is no
>>>>> problem for this machine to support 4.0/2.1 channels.
>>>>>
>>>>> Through debugging, I found on Dell machine, the speaker nid only has
>>>>> one connection to dac (hardwired), so when driver assign dac to it,
the
>>>>> map_single() can successfully assign the each dac to the 2 speakers
>>>>
>>>> respectively.
>>>>>
>>>>> But on that HP machine, the speaker has multiple connections for dac,
>>
>> the
>>>>>
>>>>> map_single() can't work for this machine.
>>>>>
>>>>>
>>>>> The alsa-info.txt for that HP machine is at
>>>>
>>>> http://pastebin.ubuntu.com/11667947/
>>>>
>>>> Refer to 92HD91, you don't need 4 channel when there is band pass
filter
>>>> for the subwoofer at the mono pin
>>>
>>> Yes, you are right.
>>>
>>>> 2.2. Mono Output
>>>> The Mono Out port source selection, power state, and mute
characteristics
>>>> are all independently
>>>> controlled by the mono output port controls. EQ does not apply to this
>>>> path. An internal 2nd order band-pass filter is provided to restrict
the
>>>> output frequencies when using mono out to drive an exter-
>>>> nal amplified sub-woofer
>>>
>>> Where did you find this text? Does it mean there is a hardware low
>>
>> frequency pass filter inside the codec?
>>
>> http://www.temposemi.com/products/pclaptop-hd/92hd91/
>>
>> 2.3. Mono output Band-Pass Filter
>> For many applications, the primary speakers are incapable of reproducing
>> low frequency audio. Therefore it is desirable to implement a woofer or
>> sub-woofer speaker. The mono output is ideal for this task. However, the
>> frequency response should be restricted to prevent interference with the
>> primary speakers. Typically an external filter, known as a cross-over
>> filter, is used. The mono processing path includes a band-pass filter
with
>> programmable high and low cut-off frequencies to eliminate the need for
an
>> external filter.
>>
>> 2.3.1. Mixer Filter Description The band-pass filter is derived from the
>> common biquadratic filter and provides a 12dB/octave roll-off. The filter
>> may be programmed for a -3dB lower band edge of: 63Hz, 80Hz, 100Hz,
120Hz,
>> 150Hz, 200Hz, 315Hz, or 400Hz.
>>
>> The filter may be programmed for a -3dB upper band edge of: 150Hz, 200Hz,
>> 250Hz, 315Hz, 400Hz, 500Hz, 630Hz, or 800Hz.
>>
>> The band-pass filter is enabled by default with a cut-off frequencies at
>> 120Hz and 250Hz. The filter may be bypassed using the associated verb
>> (processing state verb
>
> Thanks very much, very useful information.
>
>

Do your codec revision support this mono out volume ?

7.4.31.AFG (NID = 01h): DAC3OutAmp (Mono Out Volume)

How do you assign the two volume control to headphone, speaker and
subwoofet ?
Hui Wang June 11, 2015, 2:15 a.m. UTC | #8
On 06/11/2015 09:15 AM, Raymond Yau wrote:
>>>>>> I am trying to enable the subwoofer speaker on a HP laptop, on this
>>>>>> machine, there are two speakers and one headphone, but the BIOS verb
>>>>>> only enabled one speaker(nid 0xd) and one headphone(nid 0xb), I need
>>>>>> to use quirk in the kernel driver to configure the second speaker
>>>>>> (subwoofer speaker, nid 0x10). Under current alsa driver, the
>>>>>> headphone will be assigned a dac (nid 0x13) and the 2 speakers will
>>>>>> be assigned a dac (nid 0x14), this assignment is not good since 2
>>>>>> speakers share the same dac, this means 2 speakers can't work
>>>>>> at the same time to support 4.0/2.1 channels.
>>>>>>
>>>>>> On another Dell machine with realtek codec, there are also 2 speakers,
>>>>>> 1 headphone and 2 dacs, on this machine, 1 speaker and 1 headphone are
>>>>> assigned
>>>>>> 1 dac, and the other speaker is assigned another dac, so there is no
>>>>>> problem for this machine to support 4.0/2.1 channels.
>>>>>>
>>>>>> Through debugging, I found on Dell machine, the speaker nid only has
>>>>>> one connection to dac (hardwired), so when driver assign dac to it,
> the
>>>>>> map_single() can successfully assign the each dac to the 2 speakers
>>>>> respectively.
>>>>>> But on that HP machine, the speaker has multiple connections for dac,
>>> the
>>>>>> map_single() can't work for this machine.
>>>>>>
>>>>>>
>>>>>> The alsa-info.txt for that HP machine is at
>>>>> http://pastebin.ubuntu.com/11667947/
>>>>>
>>>>> Refer to 92HD91, you don't need 4 channel when there is band pass
> filter
>>>>> for the subwoofer at the mono pin
>>>> Yes, you are right.
>>>>
>>>>> 2.2. Mono Output
>>>>> The Mono Out port source selection, power state, and mute
> characteristics
>>>>> are all independently
>>>>> controlled by the mono output port controls. EQ does not apply to this
>>>>> path. An internal 2nd order band-pass filter is provided to restrict
> the
>>>>> output frequencies when using mono out to drive an exter-
>>>>> nal amplified sub-woofer
>>>> Where did you find this text? Does it mean there is a hardware low
>>> frequency pass filter inside the codec?
>>>
>>> http://www.temposemi.com/products/pclaptop-hd/92hd91/
>>>
>>> 2.3. Mono output Band-Pass Filter
>>> For many applications, the primary speakers are incapable of reproducing
>>> low frequency audio. Therefore it is desirable to implement a woofer or
>>> sub-woofer speaker. The mono output is ideal for this task. However, the
>>> frequency response should be restricted to prevent interference with the
>>> primary speakers. Typically an external filter, known as a cross-over
>>> filter, is used. The mono processing path includes a band-pass filter
> with
>>> programmable high and low cut-off frequencies to eliminate the need for
> an
>>> external filter.
>>>
>>> 2.3.1. Mixer Filter Description The band-pass filter is derived from the
>>> common biquadratic filter and provides a 12dB/octave roll-off. The filter
>>> may be programmed for a -3dB lower band edge of: 63Hz, 80Hz, 100Hz,
> 120Hz,
>>> 150Hz, 200Hz, 315Hz, or 400Hz.
>>>
>>> The filter may be programmed for a -3dB upper band edge of: 150Hz, 200Hz,
>>> 250Hz, 315Hz, 400Hz, 500Hz, 630Hz, or 800Hz.
>>>
>>> The band-pass filter is enabled by default with a cut-off frequencies at
>>> 120Hz and 250Hz. The filter may be bypassed using the associated verb
>>> (processing state verb
>> Thanks very much, very useful information.
>>
>>
> Do your codec revision support this mono out volume ?
>
> 7.4.31.AFG (NID = 01h): DAC3OutAmp (Mono Out Volume)
I looks like the current driver does not use this to control the volume.
>
> How do you assign the two volume control to headphone, speaker and
> subwoofet ?
speaker and headphone are assigned to DAC0 (nid: 0x13), they use the DAC 
amplifier to control the volume.

subwoofer speaker is assigned to DAC1 (nid: 0x14), it use the DAC 
amplifier to contorl the volume.

> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
>
Raymond Yau June 11, 2015, 7:37 a.m. UTC | #9
>>>>>>>
>>>>>>> I am trying to enable the subwoofer speaker on a HP laptop, on this
>>>>>>> machine, there are two speakers and one headphone, but the BIOS verb
>>>>>>> only enabled one speaker(nid 0xd) and one headphone(nid 0xb), I need
>>>>>>> to use quirk in the kernel driver to configure the second speaker
>>>>>>> (subwoofer speaker, nid 0x10). Under current alsa driver, the
>>>>>>> headphone will be assigned a dac (nid 0x13) and the 2 speakers will
>>>>>>> be assigned a dac (nid 0x14), this assignment is not good since 2
>>>>>>> speakers share the same dac, this means 2 speakers can't work
>>>>>>> at the same time to support 4.0/2.1 channels.
>>>>>>>
>>>>>>> On another Dell machine with realtek codec, there are also 2
speakers,
>>>>>>> 1 headphone and 2 dacs, on this machine, 1 speaker and 1 headphone
are
>>>>>>
>>>>>> assigned
>>>>>>>
>>>>>>> 1 dac, and the other speaker is assigned another dac, so there is no
>>>>>>> problem for this machine to support 4.0/2.1 channels.
>>>>>>>
>>>>>>> Through debugging, I found on Dell machine, the speaker nid only has
>>>>>>> one connection to dac (hardwired), so when driver assign dac to it,
>>
>> the
>>>>>>>
>>>>>>> map_single() can successfully assign the each dac to the 2 speakers
>>>>>>
>>>>>> respectively.
>>>>>>>
>>>>>>> But on that HP machine, the speaker has multiple connections for
dac,
>>>>
>>>> the
>>>>>>>
>>>>>>> map_single() can't work for this machine.
>>>>>>>
>>>>>>>
>>>>>>> The alsa-info.txt for that HP machine is at
>>>>>>
>>>>>> http://pastebin.ubuntu.com/11667947/
>>>>>>
>>>>>> Refer to 92HD91, you don't need 4 channel when there is band pass
>>
>> filter
>>>>>>
>>>>>> for the subwoofer at the mono pin
>>>>>
>>>>> Yes, you are right.
>>>>>
>>>>>> 2.2. Mono Output
>>>>>> The Mono Out port source selection, power state, and mute
>>
>> characteristics
>>>>>>
>>>>>> are all independently
>>>>>> controlled by the mono output port controls. EQ does not apply to
this
>>>>>> path. An internal 2nd order band-pass filter is provided to restrict
>>
>> the
>>>>>>
>>>>>> output frequencies when using mono out to drive an exter-
>>>>>> nal amplified sub-woofer
>>>>>
>>>>> Where did you find this text? Does it mean there is a hardware low
>>>>
>>>> frequency pass filter inside the codec?
>>>>
>>>> http://www.temposemi.com/products/pclaptop-hd/92hd91/
>>>>
>>>> 2.3. Mono output Band-Pass Filter
>>>> For many applications, the primary speakers are incapable of
reproducing
>>>> low frequency audio. Therefore it is desirable to implement a woofer or
>>>> sub-woofer speaker. The mono output is ideal for this task. However,
the
>>>> frequency response should be restricted to prevent interference with
the
>>>> primary speakers. Typically an external filter, known as a cross-over
>>>> filter, is used. The mono processing path includes a band-pass filter
>>
>> with
>>>>
>>>> programmable high and low cut-off frequencies to eliminate the need for
>>
>> an
>>>>
>>>> external filter.
>>>>
>>>> 2.3.1. Mixer Filter Description The band-pass filter is derived from
the
>>>> common biquadratic filter and provides a 12dB/octave roll-off. The
filter
>>>> may be programmed for a -3dB lower band edge of: 63Hz, 80Hz, 100Hz,
>>
>> 120Hz,
>>>>
>>>> 150Hz, 200Hz, 315Hz, or 400Hz.
>>>>
>>>> The filter may be programmed for a -3dB upper band edge of: 150Hz,
200Hz,
>>>> 250Hz, 315Hz, 400Hz, 500Hz, 630Hz, or 800Hz.
>>>>
>>>> The band-pass filter is enabled by default with a cut-off frequencies
at
>>>> 120Hz and 250Hz. The filter may be bypassed using the associated verb
>>>> (processing state verb
>>>
>>> Thanks very much, very useful information.
>>>
>>>
>> Do your codec revision support this mono out volume ?
>>
>> 7.4.31.AFG (NID = 01h): DAC3OutAmp (Mono Out Volume)
>
> I looks like the current driver does not use this to control the volume.
>
>>
>> How do you assign the two volume control to headphone, speaker and
>> subwoofet ?
>
> speaker and headphone are assigned to DAC0 (nid: 0x13), they use the DAC
amplifier to control the volume.
>
> subwoofer speaker is assigned to DAC1 (nid: 0x14), it use the DAC
amplifier to contorl the volume.
>

Do pulseaudio like this config since there is no mute switch at pin complex
of idt codecs and no headphone playback volume/switch?

After applied your patch

Front playback volume/switch are shared by headphone and speaker
Base speaker playback volume/switch

But the other 4 channels  hda codecs vt1802 have speaker playback switch
and subwoofer playback switch

http://git.kernel.org/cgit/linux/kernel/git/tiwai/hda-emu.git/tree/codecs/vt1802-asus-g75
Hui Wang June 11, 2015, 8:33 a.m. UTC | #10
On 06/11/2015 03:37 PM, Raymond Yau wrote:
>>>>>>>> I am trying to enable the subwoofer speaker on a HP laptop, on this
>>>>>>>> machine, there are two speakers and one headphone, but the BIOS verb
>>>>>>>> only enabled one speaker(nid 0xd) and one headphone(nid 0xb), I need
>>>>>>>> to use quirk in the kernel driver to configure the second speaker
>>>>>>>> (subwoofer speaker, nid 0x10). Under current alsa driver, the
>>>>>>>> headphone will be assigned a dac (nid 0x13) and the 2 speakers will
>>>>>>>> be assigned a dac (nid 0x14), this assignment is not good since 2
>>>>>>>> speakers share the same dac, this means 2 speakers can't work
>>>>>>>> at the same time to support 4.0/2.1 channels.
>>>>>>>>
>>>>>>>> On another Dell machine with realtek codec, there are also 2
> speakers,
>>>>>>>> 1 headphone and 2 dacs, on this machine, 1 speaker and 1 headphone
> are
>>>>>>> assigned
>>>>>>>> 1 dac, and the other speaker is assigned another dac, so there is no
>>>>>>>> problem for this machine to support 4.0/2.1 channels.
>>>>>>>>
>>>>>>>> Through debugging, I found on Dell machine, the speaker nid only has
>>>>>>>> one connection to dac (hardwired), so when driver assign dac to it,
>>> the
>>>>>>>> map_single() can successfully assign the each dac to the 2 speakers
>>>>>>> respectively.
>>>>>>>> But on that HP machine, the speaker has multiple connections for
> dac,
>>>>> the
>>>>>>>> map_single() can't work for this machine.
>>>>>>>>
>>>>>>>>
>>>>>>>> The alsa-info.txt for that HP machine is at
>>>>>>> http://pastebin.ubuntu.com/11667947/
>>>>>>>
>>>>>>> Refer to 92HD91, you don't need 4 channel when there is band pass
>>> filter
>>>>>>> for the subwoofer at the mono pin
>>>>>> Yes, you are right.
>>>>>>
>>>>>>> 2.2. Mono Output
>>>>>>> The Mono Out port source selection, power state, and mute
>>> characteristics
>>>>>>> are all independently
>>>>>>> controlled by the mono output port controls. EQ does not apply to
> this
>>>>>>> path. An internal 2nd order band-pass filter is provided to restrict
>>> the
>>>>>>> output frequencies when using mono out to drive an exter-
>>>>>>> nal amplified sub-woofer
>>>>>> Where did you find this text? Does it mean there is a hardware low
>>>>> frequency pass filter inside the codec?
>>>>>
>>>>> http://www.temposemi.com/products/pclaptop-hd/92hd91/
>>>>>
>>>>> 2.3. Mono output Band-Pass Filter
>>>>> For many applications, the primary speakers are incapable of
> reproducing
>>>>> low frequency audio. Therefore it is desirable to implement a woofer or
>>>>> sub-woofer speaker. The mono output is ideal for this task. However,
> the
>>>>> frequency response should be restricted to prevent interference with
> the
>>>>> primary speakers. Typically an external filter, known as a cross-over
>>>>> filter, is used. The mono processing path includes a band-pass filter
>>> with
>>>>> programmable high and low cut-off frequencies to eliminate the need for
>>> an
>>>>> external filter.
>>>>>
>>>>> 2.3.1. Mixer Filter Description The band-pass filter is derived from
> the
>>>>> common biquadratic filter and provides a 12dB/octave roll-off. The
> filter
>>>>> may be programmed for a -3dB lower band edge of: 63Hz, 80Hz, 100Hz,
>>> 120Hz,
>>>>> 150Hz, 200Hz, 315Hz, or 400Hz.
>>>>>
>>>>> The filter may be programmed for a -3dB upper band edge of: 150Hz,
> 200Hz,
>>>>> 250Hz, 315Hz, 400Hz, 500Hz, 630Hz, or 800Hz.
>>>>>
>>>>> The band-pass filter is enabled by default with a cut-off frequencies
> at
>>>>> 120Hz and 250Hz. The filter may be bypassed using the associated verb
>>>>> (processing state verb
>>>> Thanks very much, very useful information.
>>>>
>>>>
>>> Do your codec revision support this mono out volume ?
>>>
>>> 7.4.31.AFG (NID = 01h): DAC3OutAmp (Mono Out Volume)
>> I looks like the current driver does not use this to control the volume.
>>
>>> How do you assign the two volume control to headphone, speaker and
>>> subwoofet ?
>> speaker and headphone are assigned to DAC0 (nid: 0x13), they use the DAC
> amplifier to control the volume.
>> subwoofer speaker is assigned to DAC1 (nid: 0x14), it use the DAC
> amplifier to contorl the volume.
> Do pulseaudio like this config since there is no mute switch at pin complex
> of idt codecs and no headphone playback volume/switch?
>
> After applied your patch
>
> Front playback volume/switch are shared by headphone and speaker
> Base speaker playback volume/switch
>
> But the other 4 channels  hda codecs vt1802 have speaker playback switch
> and subwoofer playback switch
Even without this patch, the base speaker and headphone already shared 
the same DAC and use single "Front Playback Volume" to control their 
volume, I did not see any problem from the pulseaudio/desktop so far.

http://pastebin.ubuntu.com/11667982/

About the sharing the switch between headphone and base speaker, this is 
a new situation, but I did not see obvious problem from 
pusleaudio/desktop as well.
> http://git.kernel.org/cgit/linux/kernel/git/tiwai/hda-emu.git/tree/codecs/vt1802-asus-g75
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
>
>
Raymond Yau June 11, 2015, 4:44 p.m. UTC | #11
2015-6-11 ??4:33 ? "Hui Wang" <hui.wang@canonical.com> ???
>
> On 06/11/2015 03:37 PM, Raymond Yau wrote:
>>>>>>>>>
>>>>>>>>> I am trying to enable the subwoofer speaker on a HP laptop, on
this
>>>>>>>>> machine, there are two speakers and one headphone, but the BIOS
verb
>>>>>>>>> only enabled one speaker(nid 0xd) and one headphone(nid 0xb), I
need
>>>>>>>>> to use quirk in the kernel driver to configure the second speaker
>>>>>>>>> (subwoofer speaker, nid 0x10). Under current alsa driver, the
>>>>>>>>> headphone will be assigned a dac (nid 0x13) and the 2 speakers
will
>>>>>>>>> be assigned a dac (nid 0x14), this assignment is not good since 2
>>>>>>>>> speakers share the same dac, this means 2 speakers can't work
>>>>>>>>> at the same time to support 4.0/2.1 channels.
>>>>>>>>>
>>>>>>>>> On another Dell machine with realtek codec, there are also 2
>>
>> speakers,
>>>>>>>>>
>>>>>>>>> 1 headphone and 2 dacs, on this machine, 1 speaker and 1 headphone
>>
>> are
>>>>>>>>
>>>>>>>> assigned
>>>>>>>>>
>>>>>>>>> 1 dac, and the other speaker is assigned another dac, so there is
no
>>>>>>>>> problem for this machine to support 4.0/2.1 channels.
>>>>>>>>>
>>>>>>>>> Through debugging, I found on Dell machine, the speaker nid only
has
>>>>>>>>> one connection to dac (hardwired), so when driver assign dac to
it,
>>>>
>>>> the
>>>>>>>>>
>>>>>>>>> map_single() can successfully assign the each dac to the 2
speakers
>>>>>>>>
>>>>>>>> respectively.
>>>>>>>>>
>>>>>>>>> But on that HP machine, the speaker has multiple connections for
>>
>> dac,
>>>>>>
>>>>>> the
>>>>>>>>>
>>>>>>>>> map_single() can't work for this machine.
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> The alsa-info.txt for that HP machine is at
>>>>>>>>
>>>>>>>> http://pastebin.ubuntu.com/11667947/
>>>>>>>>
>>>>>>>> Refer to 92HD91, you don't need 4 channel when there is band pass
>>>>
>>>> filter
>>>>>>>>
>>>>>>>> for the subwoofer at the mono pin
>>>>>>>
>>>>>>> Yes, you are right.
>>>>>>>
>>>>>>>> 2.2. Mono Output
>>>>>>>> The Mono Out port source selection, power state, and mute
>>>>
>>>> characteristics
>>>>>>>>
>>>>>>>> are all independently
>>>>>>>> controlled by the mono output port controls. EQ does not apply to
>>
>> this
>>>>>>>>
>>>>>>>> path. An internal 2nd order band-pass filter is provided to
restrict
>>>>
>>>> the
>>>>>>>>
>>>>>>>> output frequencies when using mono out to drive an exter-
>>>>>>>> nal amplified sub-woofer
>>>>>>>
>>>>>>> Where did you find this text? Does it mean there is a hardware low
>>>>>>
>>>>>> frequency pass filter inside the codec?
>>>>>>
>>>>>> http://www.temposemi.com/products/pclaptop-hd/92hd91/
>>>>>>
>>>>>> 2.3. Mono output Band-Pass Filter
>>>>>> For many applications, the primary speakers are incapable of
>>
>> reproducing
>>>>>>
>>>>>> low frequency audio. Therefore it is desirable to implement a woofer
or
>>>>>> sub-woofer speaker. The mono output is ideal for this task. However,
>>
>> the
>>>>>>
>>>>>> frequency response should be restricted to prevent interference with
>>
>> the
>>>>>>
>>>>>> primary speakers. Typically an external filter, known as a cross-over
>>>>>> filter, is used. The mono processing path includes a band-pass filter
>>>>
>>>> with
>>>>>>
>>>>>> programmable high and low cut-off frequencies to eliminate the need
for
>>>>
>>>> an
>>>>>>
>>>>>> external filter.
>>>>>>
>>>>>> 2.3.1. Mixer Filter Description The band-pass filter is derived from
>>
>> the
>>>>>>
>>>>>> common biquadratic filter and provides a 12dB/octave roll-off. The
>>
>> filter
>>>>>>
>>>>>> may be programmed for a -3dB lower band edge of: 63Hz, 80Hz, 100Hz,
>>>>
>>>> 120Hz,
>>>>>>
>>>>>> 150Hz, 200Hz, 315Hz, or 400Hz.
>>>>>>
>>>>>> The filter may be programmed for a -3dB upper band edge of: 150Hz,
>>
>> 200Hz,
>>>>>>
>>>>>> 250Hz, 315Hz, 400Hz, 500Hz, 630Hz, or 800Hz.
>>>>>>
>>>>>> The band-pass filter is enabled by default with a cut-off frequencies
>>
>> at
>>>>>>
>>>>>> 120Hz and 250Hz. The filter may be bypassed using the associated verb
>>>>>> (processing state verb
>>>>>
>>>>> Thanks very much, very useful information.
>>>>>
>>>>>
>>>> Do your codec revision support this mono out volume ?
>>>>
>>>> 7.4.31.AFG (NID = 01h): DAC3OutAmp (Mono Out Volume)
>>>
>>> I looks like the current driver does not use this to control the volume.

You can use hda-verb and use vendor specific get verb with afg node  to
find out whether you can get back the default values 0x7f

>>>
>>>> How do you assign the two volume control to headphone, speaker and
>>>> subwoofet ?
>>>
>>> speaker and headphone are assigned to DAC0 (nid: 0x13), they use the DAC
>>
>> amplifier to control the volume.
>>>
>>> subwoofer speaker is assigned to DAC1 (nid: 0x14), it use the DAC
>>
>> amplifier to contorl the volume.
>> Do pulseaudio like this config since there is no mute switch at pin
complex
>> of idt codecs and no headphone playback volume/switch?
>>
>> After applied your patch
>>
>> Front playback volume/switch are shared by headphone and speaker
>> Base speaker playback volume/switch
>>
>> But the other 4 channels  hda codecs vt1802 have speaker playback switch
>> and subwoofer playback switch
>
> Even without this patch, the base speaker and headphone already shared
the same DAC and use single "Front Playback Volume" to control their
volume, I did not see any problem from the pulseaudio/desktop so far.
>
> http://pastebin.ubuntu.com/11667982/

It won't happen with realtek alc2xx codec since the pin complex of most
Realtek codec support mute

> About the sharing the switch between headphone and base speaker, this is
a new situation, but I did not see obvious problem from pusleaudio/desktop
as well.
>>
>>
http://git.kernel.org/cgit/linux/kernel/git/tiwai/hda-emu.git/tree/codecs/vt1802-asus-g75
>>

Independent headphone should be disabled when headphone and internal
speaker of notebook share same DAC  or only enabled on desktop with codecs
support 2+2 , 7.1+2
Raymond Yau June 12, 2015, 1:34 a.m. UTC | #12
>>> The alsa-info.txt for that Dell machine is at
>>
>> http://pastebin.ubuntu.com/11667982/
>>
>> The subwoofer is also at mono pin complex, are  there any low pass filter
>> for the subwoofer or vendor coeff need to be set ?
>
> I don't know it, I guess there is no hardware filter, it will work with
the software low pass filter in the pulseaudio.
>>

The funcional block diagram indicate equaliser is only connected to port D
This mean only the internal speaker can use high pass filter

Do you mean your can hear high frequency from the subwoofer of alc255 ?
Hui Wang June 12, 2015, 3:32 a.m. UTC | #13
On 06/12/2015 09:34 AM, Raymond Yau wrote:
>>>> The alsa-info.txt for that Dell machine is at
>>> http://pastebin.ubuntu.com/11667982/
>>>
>>> The subwoofer is also at mono pin complex, are  there any low pass filter
>>> for the subwoofer or vendor coeff need to be set ?
>> I don't know it, I guess there is no hardware filter, it will work with
> the software low pass filter in the pulseaudio.
> The funcional block diagram indicate equaliser is only connected to port D
> This mean only the internal speaker can use high pass filter
>
> Do you mean your can hear high frequency from the subwoofer of alc255 ?
I am not sure about it, but enable/disable the SW lfe filter will make 
the sound of subwoofer different
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@alsa-project.org
> http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
>
>
diff mbox

Patch

diff --git a/sound/pci/hda/hda_generic.c b/sound/pci/hda/hda_generic.c
index ac0db16..8194ff1 100644
--- a/sound/pci/hda/hda_generic.c
+++ b/sound/pci/hda/hda_generic.c
@@ -1363,6 +1363,7 @@  static int try_assign_dacs(struct hda_codec 
*codec, int num_outs,
                                 dac = try_dac(codec, 
get_primary_out(codec, i), pin);
                         if (!dac)
                                 dac = try_dac(codec, dacs[0], pin);
                         if (!dac)
                                 dac = try_dac(codec, 
get_primary_out(codec, i), pin);
                         if (dac) {
@@ -1762,6 +1763,12 @@  static int fill_and_eval_dacs(struct hda_codec 
*codec,
                 if (err < 0)
                         return err;
                 badness += err;
+               /* if there are 2 speakers and both of them are assigned 
to the same dac,
+                  we need to increase the badness for this situation, 
because in this situation
+                  the 2 speakers can't work together to support 4.0/2.1 
channels */
+               if (cfg->speaker_outs == 2 && err < 
spec->extra_out_badness->no_dac &&
+                   spec->multiout.extra_out_nid[1] == 0)
+                       badness += spec->extra_out_badness->no_dac;
         }
         if (!spec->no_multi_io &&
             cfg->line_outs == 1 && cfg->line_out_type != 
AUTO_PIN_SPEAKER_OUT) {
diff --git a/sound/pci/hda/patch_sigmatel.c b/sound/pci/hda/patch_sigmatel.c
index bdcda6a..717259c 100644
--- a/sound/pci/hda/patch_sigmatel.c
+++ b/sound/pci/hda/patch_sigmatel.c
@@ -2764,6 +2764,8 @@  static const struct snd_pci_quirk 
stac92hd83xxx_fixup_tbl[] = {
                           "HP bNB13", STAC_HP_BNB13_EQ),
         SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x190e,
                           "HP ENVY TS", STAC_HP_ENVY_TS_BASS),
+       SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x1967,
+                         "HP ENVY TS", STAC_HP_ENVY_TS_BASS),
         SND_PCI_QUIRK(PCI_VENDOR_ID_HP, 0x1940,
                           "HP bNB13", STAC_HP_BNB13_EQ),