Skip to content

Commit

Permalink
[ALSA] hda-codec - Allow opening SPDIF while analog dup mode
Browse files Browse the repository at this point in the history
Allow opening the dedicated SPDIF stream while running on analog dup
mode.  Then the SPDIF stream is once reset and assigned for the new
stream.  It's useful for exclusive SPDIF output like AC3/DTS.
(In the former version, you had to close once the analog stream to
 play the exclusive digital stream.)

Signed-off-by: Takashi Iwai <tiwai@suse.de>
Signed-off-by: Jaroslav Kysela <perex@suse.cz>
  • Loading branch information
Takashi Iwai authored and Jaroslav Kysela committed May 11, 2007
1 parent f12ab1e commit 5930ca4
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions sound/pci/hda/hda_codec.c
Original file line number Diff line number Diff line change
Expand Up @@ -1916,10 +1916,9 @@ static void setup_dig_out_stream(struct hda_codec *codec, hda_nid_t nid,
int snd_hda_multi_out_dig_open(struct hda_codec *codec, struct hda_multi_out *mout)
{
mutex_lock(&codec->spdif_mutex);
if (mout->dig_out_used) {
mutex_unlock(&codec->spdif_mutex);
return -EBUSY; /* already being used */
}
if (mout->dig_out_used == HDA_DIG_ANALOG_DUP)
/* already opened as analog dup; reset it once */
snd_hda_codec_setup_stream(codec, mout->dig_out_nid, 0, 0, 0);
mout->dig_out_used = HDA_DIG_EXCLUSIVE;
mutex_unlock(&codec->spdif_mutex);
return 0;
Expand Down

0 comments on commit 5930ca4

Please sign in to comment.