diff --git a/sources/spdif/source.go b/sources/spdif/source.go index 3dbb469..b94e2a1 100644 --- a/sources/spdif/source.go +++ b/sources/spdif/source.go @@ -80,6 +80,10 @@ func (s *SPDIFSource) Enable() error { if err != nil { return err } + // If no bitrate, asume soundcard is sleeping, try to wake up with a random bitrate + if sr == 0 { + sr = 44100 + } s.Bitrate = sr // If no bitrate, asume soundcard is sleeping, try to wake up with a random bitrate diff --git a/ui/src/lib/components/Inputs.svelte b/ui/src/lib/components/Inputs.svelte index 691a494..155c3bc 100644 --- a/ui/src/lib/components/Inputs.svelte +++ b/ui/src/lib/components/Inputs.svelte @@ -25,7 +25,7 @@ {/if} {#each $inputsList as input, iid} - {#if showInactives || input.active} + {#if input.streams && (showInactives || input.active)} {#each Object.keys(input.streams) as idstream} {@const title = input.streams[idstream]}
  • diff --git a/ui/src/lib/components/SourceSelection.svelte b/ui/src/lib/components/SourceSelection.svelte index 276f0c8..4d05335 100644 --- a/ui/src/lib/components/SourceSelection.svelte +++ b/ui/src/lib/components/SourceSelection.svelte @@ -4,12 +4,15 @@ let activating_source = null; async function clickSource(src) { activating_source = src.id; - if (src.enabled) { - await src.deactivate(); - await sources.refresh(); - } else { - await src.activate(); - await sources.refresh(); + try { + if (src.enabled) { + await src.deactivate(); + await sources.refresh(); + } else { + await src.activate(); + await sources.refresh(); + } + } catch { } activating_source = null; } diff --git a/ui/src/routes/+layout.svelte b/ui/src/routes/+layout.svelte index fda31dd..4b57188 100644 --- a/ui/src/routes/+layout.svelte +++ b/ui/src/routes/+layout.svelte @@ -48,7 +48,7 @@
    - {#if input.streams.length} + {#if input.streams && input.streams.length} {#each Object.keys(input.streams) as idstream} {@const title = input.streams[idstream]} {title}