0

I would like to have some timeout for pulseaudio operation. What's default timeout for operation in pulseaudio library ?

bool wait_operation(pa_operation *_op)
{
    using namespace std::chrono;
    auto start = steady_clock::now();
    decltype(duration_cast<milliseconds>(start - start).count()) dur;
    do
    {
        int operres = pa_operation_get_state(_op);
        if (operres == PA_OPERATION_DONE)
            return true;
        if (operres == PA_OPERATION_CANCELLED)
            return false;
        auto end = steady_clock::now();
        dur = duration_cast<std::chrono::milliseconds>(end - start).count();
        pa_threaded_mainloop_wait(m_mloop);
    }while(dur < PULSE_OPERATION_TIMEOUT);
    return false;
}
    op = pa_context_get_sink_info_list(m_ctx, on_dev_sink, udata);
    //pa_threaded_mainloop_wait(m_mloop);
    if (!wait_operation(op))
    {
        pa_operation_unref(op);
        pa_threaded_mainloop_unlock(m_mloop);
        printf("pulse: error operation \n");
        return;
    }

Can i know how to get pulseaudio operation timeout ?

user2672165
  • 2,986
  • 19
  • 27
Yuriy
  • 1
  • 2
  • Isn't this D-Bus timeout that is `_DBUS_DEFAULT_TIMEOUT_VALUE` in libdbus, default 25 sec? – 273K Jul 30 '23 at 18:14
  • As said that https://stackoverflow.com/questions/13403314/contacting-pulse-audio-over-dbus pulseaudio doesn't use dbus on Ubuntu. – Yuriy Aug 01 '23 at 10:44

0 Answers0