From 85e80e6734910478297f7e8ad2a3eb81b69ea383 Mon Sep 17 00:00:00 2001 From: hmz007 Date: Mon, 8 May 2023 20:14:06 +0800 Subject: [PATCH] android: tinyalsa_hal: fixes out device for nanopi6 box Signed-off-by: hmz007 --- hardware/rockchip/audio/tinyalsa_hal/audio_hw.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/hardware/rockchip/audio/tinyalsa_hal/audio_hw.c b/hardware/rockchip/audio/tinyalsa_hal/audio_hw.c index d838c4e9f3d..504995ccbe5 100644 --- a/hardware/rockchip/audio/tinyalsa_hal/audio_hw.c +++ b/hardware/rockchip/audio/tinyalsa_hal/audio_hw.c @@ -1267,7 +1267,9 @@ static void open_sound_card_policy(struct stream_out *out) struct audio_device *adev = out->dev; if (support) { out->num_configs = 0; - if(adev->dev_out[SND_OUT_SOUND_CARD_SPEAKER].card != SND_OUT_SOUND_CARD_UNKNOWN) { + if(out->device & (AUDIO_DEVICE_OUT_WIRED_HEADPHONE | AUDIO_DEVICE_OUT_WIRED_HEADSET)) { + // nothing + } else if(adev->dev_out[SND_OUT_SOUND_CARD_SPEAKER].card != SND_OUT_SOUND_CARD_UNKNOWN) { out->devices[out->num_configs++] = AUDIO_DEVICE_OUT_SPEAKER; } @@ -1281,7 +1283,7 @@ static void open_sound_card_policy(struct stream_out *out) } if(adev->dev_out[SND_OUT_SOUND_CARD_SPDIF].card != SND_OUT_SOUND_CARD_UNKNOWN){ - out->devices[out->num_configs++] = AUDIO_DEVICE_OUT_SPDIF; + out->devices[out->num_configs++] = AUDIO_DEVICE_OUT_SPDIF; } } }