From: Christopher N. Hesse Date: Mon, 27 Aug 2018 06:55:39 +0000 (+0200) Subject: a5xelte: amplifier: Fix pcm_open fail case X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=56b693cb590a20b59de3b867b06ce7e21a9ca887;p=GitHub%2FLineageOS%2Fandroid_device_samsung_a5xelte.git a5xelte: amplifier: Fix pcm_open fail case By default, we try to open card 0 devive 0 to play dummy audio which in turn enables the amplifier IC clocks for us. However, in some cases card 0 device 0 is already used when trying to enable the amplifier - catch this case and avoid a watchdog bite. Change-Id: I8eb5dc39fd289d0883df1bf71c31024cc3fbe358 --- diff --git a/amplifier/tfa.c b/amplifier/tfa.c index b56e199..b28f4dc 100644 --- a/amplifier/tfa.c +++ b/amplifier/tfa.c @@ -52,7 +52,7 @@ static void * write_dummy_data(void *param) { pcm = pcm_open(0, 0, PCM_OUT | PCM_MONOTONIC, &config); if (!pcm || !pcm_is_ready(pcm)) { ALOGE("pcm_open failed: %s", pcm_get_error(pcm)); - if (pcm) { + if (pcm && errno != EBUSY) { goto err_close_pcm; } goto exit;