alsa-project / alsa-lib

The Advanced Linux Sound Architecture (ALSA) - library
GNU Lesser General Public License v2.1
345 stars 176 forks source link

use-case: Add new LatencyOffsetMs field #332

Closed afq984 closed 1 year ago

afq984 commented 1 year ago

Some drivers do not report accurate latencies. Add a LatencyOffsetMs UCM Value allow adding a static offset to the reported latency.

ossilator commented 1 year ago

wouldn't it be better to fix the drivers instead? the amount of work required shouldn't be all that different, and the drivers could certainly deliver more authoritative values.

afq984 commented 1 year ago

@cujomalainey @baili0411

cujomalainey commented 1 year ago

wouldn't it be better to fix the drivers instead? the amount of work required shouldn't be all that different, and the drivers could certainly deliver more authoritative values.

Agreed, but given the severe lack of implementation of the delay callback it's unlikely to be fixed within our scope anytime soon (or even at all, especially with the amount of legacy closed source DSP firmware in the kernel). This is more of an RFC currently as a stop gap to provide platforms delay knowledge where we don't have it. I definitely agree in an ideal world it would just be a functional kernel callback.

ossilator commented 1 year ago

let's assume the worst-case of a closed source driver. for how many of these is it (still) relevant to obtain accurate latencies? for how many would a constant latency offset be actually adequate?

cujomalainey commented 1 year ago

let's assume the worst-case of a closed source driver. for how many of these is it (still) relevant to obtain accurate latencies? for how many would a constant latency offset be actually adequate?

In our context, it's Intel (Skylake and SOF IPC 3), and Qualcomm adsp. All our other platforms bypass or don't have DSPs.

More might appear in the future with us supporting hardware we didn't design but that is at least our starting point.

cujomalainey commented 1 year ago

Looks like we have settled on an internal config for now. @afq984 can you close this?