This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/audio_alsa.c b/audio_alsa.c | |
index 62db843f..ac0a978e 100644 | |
--- a/audio_alsa.c | |
+++ b/audio_alsa.c | |
@@ -75,7 +75,7 @@ static void *alsa_buffer_monitor_thread_code(void *arg); | |
static void volume(double vol); | |
static void do_volume(double vol); | |
static int prepare(void); | |
-static int do_play(void *buf, int samples); | |
+static int do_play(void *buf, int samples, int sample_type, uint32_t timestamp, uint64_t playtime); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/audio_alsa.c b/audio_alsa.c | |
index 62db843f..e8f5634a 100644 | |
--- a/audio_alsa.c | |
+++ b/audio_alsa.c | |
@@ -75,7 +75,7 @@ static void *alsa_buffer_monitor_thread_code(void *arg); | |
static void volume(double vol); | |
static void do_volume(double vol); | |
static int prepare(void); | |
-static int do_play(void *buf, int samples); | |
+static int do_play(void *buf, int samples, int sample_type, uint32_t timestamp, uint64_t playtime); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/audio_alsa.c b/audio_alsa.c | |
index 62db843f..33394481 100644 | |
--- a/audio_alsa.c | |
+++ b/audio_alsa.c | |
@@ -75,7 +75,7 @@ static void *alsa_buffer_monitor_thread_code(void *arg); | |
static void volume(double vol); | |
static void do_volume(double vol); | |
static int prepare(void); | |
-static int do_play(void *buf, int samples); | |
+static int do_play(void *buf, int samples, int sample_type, uint32_t timestamp, uint64_t playtime); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/audio_alsa.c b/audio_alsa.c | |
index 62db843f..d89d1ed7 100644 | |
--- a/audio_alsa.c | |
+++ b/audio_alsa.c | |
@@ -1450,6 +1450,7 @@ static int standard_delay_and_status(snd_pcm_state_t *state, snd_pcm_sframes_t * | |
state_temp = snd_pcm_state(alsa_handle); | |
if ((state_temp == SND_PCM_STATE_RUNNING) || (state_temp == SND_PCM_STATE_DRAINING)) { | |
ret = snd_pcm_delay(alsa_handle, &delay_temp); | |
+ debug(2, "the delay is %ld frames. ret: %d", delay_temp, ret); | |
} else { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/audio_alsa.c b/audio_alsa.c | |
index 62db843f..9cb824a1 100644 | |
--- a/audio_alsa.c | |
+++ b/audio_alsa.c | |
@@ -1450,6 +1450,7 @@ static int standard_delay_and_status(snd_pcm_state_t *state, snd_pcm_sframes_t * | |
state_temp = snd_pcm_state(alsa_handle); | |
if ((state_temp == SND_PCM_STATE_RUNNING) || (state_temp == SND_PCM_STATE_DRAINING)) { | |
ret = snd_pcm_delay(alsa_handle, &delay_temp); | |
+ debug(2, "the delay is %" PRId64 " frames", delay_temp); | |
} else { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/audio_alsa.c b/audio_alsa.c | |
index 62db843f..9cb9cd5d 100644 | |
--- a/audio_alsa.c | |
+++ b/audio_alsa.c | |
@@ -1889,6 +1889,12 @@ static int play(void *buf, int samples, __attribute__((unused)) int sample_type, | |
__attribute__((unused)) uint32_t timestamp, | |
__attribute__((unused)) uint64_t playtime) { | |
+ if (sample_type == play_samples_are_timed) { | |
+ int64_t lead_time = playtime - get_absolute_time_in_ns(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
import sys | |
all_data = b'' | |
while True: | |
data = sys.stdin.buffer.read(4096) | |
if not data: | |
break |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# card 2 | |
pi@raspberrypi:~/pifi $ aplay --list-devices | |
**** List of PLAYBACK Hardware Devices **** | |
card 0: b1 [bcm2835 HDMI 1], device 0: bcm2835 HDMI 1 [bcm2835 HDMI 1] | |
Subdevices: 4/4 | |
Subdevice #0: subdevice #0 | |
Subdevice #1: subdevice #1 | |
Subdevice #2: subdevice #2 | |
Subdevice #3: subdevice #3 | |
card 1: Headphones [bcm2835 Headphones], device 0: bcm2835 Headphones [bcm2835 Headphones] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/piwall2/broadcaster/videobroadcaster.py b/piwall2/broadcaster/videobroadcaster.py | |
index 87fe66e..85eab4c 100644 | |
--- a/piwall2/broadcaster/videobroadcaster.py | |
+++ b/piwall2/broadcaster/videobroadcaster.py | |
@@ -1,3 +1,5 @@ | |
+import errno | |
+import fcntl | |
import os | |
import shlex | |
import signal |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/piwall2/broadcaster/videobroadcaster.py b/piwall2/broadcaster/videobroadcaster.py | |
index 5ad7495..509d433 100644 | |
--- a/piwall2/broadcaster/videobroadcaster.py | |
+++ b/piwall2/broadcaster/videobroadcaster.py | |
@@ -65,91 +65,92 @@ class VideoBroadcaster: | |
attempt = 1 | |
max_attempts = 2 | |
while attempt <= max_attempts: | |
try: | |
self.__broadcast_internal() |