From 2b50886ed00722dfb63ef740a3537eaa6abf2725 Mon Sep 17 00:00:00 2001 From: Pierre-Olivier Mercier Date: Fri, 29 Nov 2024 09:58:09 +0100 Subject: [PATCH 1/3] spdif: Handle soundcard asleep, try to wake up with a random bitrate --- sources/spdif/source.go | 4 ++++ 1 file changed, 4 insertions(+) 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 From 24342f506234f66ef45e81ab6d485b627b2bf8c1 Mon Sep 17 00:00:00 2001 From: Pierre-Olivier Mercier Date: Mon, 16 Dec 2024 18:55:29 +0100 Subject: [PATCH 2/3] Fix undefined input.streams error --- ui/src/lib/components/Inputs.svelte | 2 +- ui/src/routes/+layout.svelte | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) 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/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} From 0fd9baaf71cc861aa2e41cabc94ef5f6a4172834 Mon Sep 17 00:00:00 2001 From: Pierre-Olivier Mercier Date: Tue, 17 Dec 2024 21:15:49 +0100 Subject: [PATCH 3/3] Fix never released activating_source --- ui/src/lib/components/SourceSelection.svelte | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) 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; }