Skip to content

Commit

Permalink
Flag fixed latency inputs as likely incompatible in UI
Browse files Browse the repository at this point in the history
There is currently a bug in PulseAudio that prevents
devices with fixed latency from working. See #30
  • Loading branch information
lawl committed Jul 20, 2020
1 parent 37b35ce commit 3fc46d2
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 5 deletions.
12 changes: 8 additions & 4 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,11 @@ import (
//go:generate go run scripts/embedlicenses.go

type input struct {
ID string
Name string
isMonitor bool
checked bool
ID string
Name string
isMonitor bool
checked bool
dynamicLatency bool
}

func main() {
Expand Down Expand Up @@ -94,6 +95,9 @@ func main() {
inp.Name = sources[i].PropList["device.description"]
inp.isMonitor = (sources[i].MonitorSourceIndex != 0xffffffff)

//PA_SOURCE_DYNAMIC_LATENCY = 0x0040U
inp.dynamicLatency = sources[i].Flags&uint32(0x0040) != 0

inputs = append(inputs, inp)
}

Expand Down
6 changes: 5 additions & 1 deletion ui.go
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,11 @@ func updatefn(w *nucular.Window, ui *uistate) {
}

w.LayoutFitWidth(ui.sourceListColdWidthIndex, 0)
w.Label(el.Name, "LC")
if el.dynamicLatency {
w.Label(el.Name, "LC")
} else {
w.LabelColored("(incompatible?) "+el.Name, "LC", orange)
}
}

w.Row(30).Dynamic(1)
Expand Down

0 comments on commit 3fc46d2

Please sign in to comment.