ALSA: hda - Fix a wrong busy check in alt PCM open
PATCH 1/1 ALSA: hda - Fix a wrong busy check in alt PCM open
Currently, the alt PCM open callback returns -EBUSY when an independent HP is turned off, supposing that it conflicts with the main PCM. However, obviously, this check is wrong when the independent HP itself isn't enabled but the alt PCM was explicitly created via alc_dac_nid by a codec driver.
--- sound/pci/hda/hda_generic.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
sound/pci/hda/hda_generic.c +1 -1
@@ -5175,7 +5175,7 @@ static int alt_playback_pcm_open(struct hda_pcm_stream *hinfo,int err =0 ;mutex_lock (&spec->pcm_mutex); -if (!spec->indep_hp_enabled) +if (spec->indep_hp && !spec->indep_hp_enabled) err = -EBUSY ;else spec->active_streams |=1 <<STREAM_INDEP_HP ;
Signature · 1 line
2.4.5
Quoted 6 lines
Currently, the alt PCM open callback returns
-EBUSYwhen an independent HP is turned off, supposing that it conflicts with the main PCM. However, obviously, this check is wrong when the independent HP itself isn't enabled but the alt PCM was explicitly created viaalc_dac_nidby a codec driver.
The alt_pcm is created only when indep_hp == 1
When indep_hp_enable = 0, HP is reconnected to analog device stream , alt analog device return ebusy
This look like bug in indep_hp_possible() which should return false when HP and Line Out/Speaker share same DAC
There are exception even when HP and Line Out are assigned different DACs (e.g. those 6 channels HDA codecs ad1986a and alc66x does not support multistreaming)
Quoted 8 lines · Raymond Yau
Quoted 7 lines
Currently, the alt PCM open callback returns
-EBUSYwhen an independent HP is turned off, supposing that it conflicts with the main PCM. However, obviously, this check is wrong when the independent HP itself isn't enabled but the alt PCM was explicitly created viaalc_dac_nidby a codec driver.
Quoted 7 lines
The
alt_pcmis created only whenindep_hp== 1When
indep_hp_enable= 0, HP is reconnected to analog device stream , alt analog device return ebusyThis look like bug in
indep_hp_possible()which should return false when HP and Line Out/Speaker share same DAC
The problem happens in a very special case where the codec driver enables the alt PCM manually in a fixup. It doesn't exist in the current code, so this is no real problem, but just a hypothetical issue.
Takashi
Quoted 13 lines
Quoted 13 lines
Quoted 7 lines
Currently, the alt PCM open callback returns
-EBUSYwhen an independent HP is turned off, supposing that it conflicts with the main PCM. However, obviously, this check is wrong when the independent HP itself isn't enabled but the alt PCM was explicitly created viaalc_dac_nidby a codec driver.The
alt_pcmis created only whenindep_hp== 1When
indep_hp_enable= 0, HP is reconnected to analog device stream , alt analog device return ebusy
Quoted 10 lines
Quoted 1 line
This look like bug in
indep_hp_possible()which should return false whenHP
Quoted 1 line
and Line Out/Speaker share same DAC
The problem happens in a very special case where the codec driver enables the alt PCM manually in a fixup. It doesn't exist in the current code, so this is no real problem, but just a hypothetical issue.
This Intel Desktop motherboard is not in the support list of multistreaming
http://www.intel.com/support/motherboards/desktop/sb/CS-034206.htm
However , user can still enable Independent HP by using hint
multi_io = 0indep_hp = 1
This mean that function indep_hp_possible() should return false for those hda codecs which does not support multistreaming (e.g. ad1986a and alc66x)
+ /* clear indep_hp flag if not available */
+ if (spec->indep_hp && !indep_hp_possible(codec))
+ spec->indep_hp = 0;