Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 44b3427c authored by Alexy Joseph's avatar Alexy Joseph
Browse files

hal: enable HPX fade-in when seeking restarts offload playback

During streaming playback when DTS HPX is enabled, while seeking
the playback pauses and fadeout is triggered, so need to trigger
fadein after seek is complete and playback restarts.

Change-Id: I90ea549f403fb75ef7476f23532bcc1a60a69ba2
parent 5f5e167b
Loading
Loading
Loading
Loading
+8 −12
Original line number Diff line number Diff line
@@ -150,20 +150,16 @@ static void fade_node(bool need_data) {
    if (strncmp("true", prop, sizeof("true")))
        return;
    int fd, n = 0;
    if ((fd = open(FADE_NOTIFY_FILE, O_RDONLY)) < 0)
        ALOGV("No fade node");
    else {
        ALOGV("fade node exists, remove it before creating it");
        close(fd);
        remove(FADE_NOTIFY_FILE);
    }
    if ((fd = open(FADE_NOTIFY_FILE, O_TRUNC|O_WRONLY)) < 0) {
        ALOGV("No fade node, create one");
        fd = creat(FADE_NOTIFY_FILE, S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH);
    char *str = need_data ? "need" : "have";
        if (fd < 0) {
        ALOGE("DTS_EAGLE_HAL (%s): opening fade notifier node failed", __func__);
            ALOGE("DTS_EAGLE_HAL (%s): Creating fade notifier node failed", __func__);
            return;
        }
        chmod(FADE_NOTIFY_FILE, S_IRWXU|S_IRGRP|S_IXGRP|S_IROTH);
    }
    char *str = need_data ? "need" : "have";
    n = write(fd, str, strlen(str));
    close(fd);
    if (n > 0)
+1 −0
Original line number Diff line number Diff line
@@ -2114,6 +2114,7 @@ static ssize_t out_write(struct audio_stream_out *stream, const void *buffer,
        }
        if (!out->playback_started && ret >= 0) {
            compress_start(out->compr);
            audio_extn_dts_eagle_fade(adev, true, out);
            out->playback_started = 1;
            out->offload_state = OFFLOAD_STATE_PLAYING;