diff options
author | Takashi Iwai <tiwai@suse.de> | 2018-02-20 11:33:45 -0500 |
---|---|---|
committer | Takashi Iwai <tiwai@suse.de> | 2018-02-22 05:51:36 -0500 |
commit | 7229b12f5da33d5c376ee264f063703844b8092d (patch) | |
tree | b00055f5c15546419747de25152f707ee232a187 | |
parent | fdcc968a3b290407bcba9d4c90e2fba6d8d928f1 (diff) |
ALSA: x86: hdmi: Add single_port option for compatible behavior
The recent support for the multiple PCM devices allowed user to use
multiple HDMI/DP outputs, but at the same time, the PCM stream
assignment has been changed, too. Due to that, the former PCM#0
(there was only one stream in the past) is likely assigned to a
different one (e.g. PCM#2), and it ends up with the regression when
user sticks with the fixed configuration using the device#0.
Although the multiple monitor support shouldn't matter when user
deploys the backend like PulseAudio that checks the jack detection
state, the behavior change isn't always acceptable for some users.
As a mitigation, this patch introduces an option to switch the
behavior back to the old-good-days: when the new option,
single_port=1, is passed, the driver creates only a single PCM device,
and it's assigned to the first connected one, like the earlier
versions did. The option is turned off as default still to support
the multiple monitors.
Fixes: 8a2d6ae1f737 ("ALSA: x86: Register multiple PCM devices for the LPE audio card")
Reported-and-tested-by: Hubert Mantel <mantel@metadox.de>
Signed-off-by: Takashi Iwai <tiwai@suse.de>
-rw-r--r-- | sound/x86/intel_hdmi_audio.c | 14 |
1 files changed, 11 insertions, 3 deletions
diff --git a/sound/x86/intel_hdmi_audio.c b/sound/x86/intel_hdmi_audio.c index a0951505c7f5..96115c401292 100644 --- a/sound/x86/intel_hdmi_audio.c +++ b/sound/x86/intel_hdmi_audio.c | |||
@@ -50,6 +50,7 @@ | |||
50 | /*standard module options for ALSA. This module supports only one card*/ | 50 | /*standard module options for ALSA. This module supports only one card*/ |
51 | static int hdmi_card_index = SNDRV_DEFAULT_IDX1; | 51 | static int hdmi_card_index = SNDRV_DEFAULT_IDX1; |
52 | static char *hdmi_card_id = SNDRV_DEFAULT_STR1; | 52 | static char *hdmi_card_id = SNDRV_DEFAULT_STR1; |
53 | static bool single_port; | ||
53 | 54 | ||
54 | module_param_named(index, hdmi_card_index, int, 0444); | 55 | module_param_named(index, hdmi_card_index, int, 0444); |
55 | MODULE_PARM_DESC(index, | 56 | MODULE_PARM_DESC(index, |
@@ -57,6 +58,9 @@ MODULE_PARM_DESC(index, | |||
57 | module_param_named(id, hdmi_card_id, charp, 0444); | 58 | module_param_named(id, hdmi_card_id, charp, 0444); |
58 | MODULE_PARM_DESC(id, | 59 | MODULE_PARM_DESC(id, |
59 | "ID string for INTEL Intel HDMI Audio controller."); | 60 | "ID string for INTEL Intel HDMI Audio controller."); |
61 | module_param(single_port, bool, 0444); | ||
62 | MODULE_PARM_DESC(single_port, | ||
63 | "Single-port mode (for compatibility)"); | ||
60 | 64 | ||
61 | /* | 65 | /* |
62 | * ELD SA bits in the CEA Speaker Allocation data block | 66 | * ELD SA bits in the CEA Speaker Allocation data block |
@@ -1579,7 +1583,11 @@ static irqreturn_t display_pipe_interrupt_handler(int irq, void *dev_id) | |||
1579 | static void notify_audio_lpe(struct platform_device *pdev, int port) | 1583 | static void notify_audio_lpe(struct platform_device *pdev, int port) |
1580 | { | 1584 | { |
1581 | struct snd_intelhad_card *card_ctx = platform_get_drvdata(pdev); | 1585 | struct snd_intelhad_card *card_ctx = platform_get_drvdata(pdev); |
1582 | struct snd_intelhad *ctx = &card_ctx->pcm_ctx[port]; | 1586 | struct snd_intelhad *ctx; |
1587 | |||
1588 | ctx = &card_ctx->pcm_ctx[single_port ? 0 : port]; | ||
1589 | if (single_port) | ||
1590 | ctx->port = port; | ||
1583 | 1591 | ||
1584 | schedule_work(&ctx->hdmi_audio_wq); | 1592 | schedule_work(&ctx->hdmi_audio_wq); |
1585 | } | 1593 | } |
@@ -1816,7 +1824,7 @@ static int hdmi_lpe_audio_probe(struct platform_device *pdev) | |||
1816 | init_channel_allocations(); | 1824 | init_channel_allocations(); |
1817 | 1825 | ||
1818 | card_ctx->num_pipes = pdata->num_pipes; | 1826 | card_ctx->num_pipes = pdata->num_pipes; |
1819 | card_ctx->num_ports = pdata->num_ports; | 1827 | card_ctx->num_ports = single_port ? 1 : pdata->num_ports; |
1820 | 1828 | ||
1821 | for_each_port(card_ctx, port) { | 1829 | for_each_port(card_ctx, port) { |
1822 | struct snd_intelhad *ctx = &card_ctx->pcm_ctx[port]; | 1830 | struct snd_intelhad *ctx = &card_ctx->pcm_ctx[port]; |
@@ -1824,7 +1832,7 @@ static int hdmi_lpe_audio_probe(struct platform_device *pdev) | |||
1824 | 1832 | ||
1825 | ctx->card_ctx = card_ctx; | 1833 | ctx->card_ctx = card_ctx; |
1826 | ctx->dev = card_ctx->dev; | 1834 | ctx->dev = card_ctx->dev; |
1827 | ctx->port = port; | 1835 | ctx->port = single_port ? -1 : port; |
1828 | ctx->pipe = -1; | 1836 | ctx->pipe = -1; |
1829 | 1837 | ||
1830 | INIT_WORK(&ctx->hdmi_audio_wq, had_audio_wq); | 1838 | INIT_WORK(&ctx->hdmi_audio_wq, had_audio_wq); |