everything related to duct tape audio suite (dtas)
 help / color / Atom feed
* sound card interruptions
@ 2019-10-07 20:07 Rene Maurer
  2019-10-08  8:32 ` Eric Wong
  2019-11-02 21:16 ` [PATCH] player: automatically pause if last sink dies Eric Wong
  0 siblings, 2 replies; 5+ messages in thread
From: Rene Maurer @ 2019-10-07 20:07 UTC (permalink / raw)
  To: dtas-all

Hello

I am using dtas for years now and I am very happy with it. It is
outstanding.

I have a question concerning interruptions between computer and sound
card (USB). In case this happens dtas-player immediately deletes the
current playing song as well as the player queue.

This behavior is logical. Is it still possibe to avoid this, so that
dtas continues playing at the same position as before the interruption
(and without clearing the queue)?

Best regards
René


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: sound card interruptions
  2019-10-07 20:07 sound card interruptions Rene Maurer
@ 2019-10-08  8:32 ` Eric Wong
  2019-10-08 12:03   ` Rene Maurer
  2019-11-02 21:16 ` [PATCH] player: automatically pause if last sink dies Eric Wong
  1 sibling, 1 reply; 5+ messages in thread
From: Eric Wong @ 2019-10-08  8:32 UTC (permalink / raw)
  To: Rene Maurer; +Cc: dtas-all

Rene Maurer <rmnet@mailc.net> wrote:
> Hello
> 
> I am using dtas for years now and I am very happy with it. It is
> outstanding.

Good to know.  I've mostly abandoned Ruby, but still use dtas
every day, too :>

> I have a question concerning interruptions between computer and sound
> card (USB). In case this happens dtas-player immediately deletes the
> current playing song as well as the player queue.

Is that from a loose USB cable?  Sometimes they wear out if
you're constantly unplugging/replugging it.

I think it actually tries everything in the queue and fails
every single one before stopping.  I honestly haven't looked
at the code in a long time.

> This behavior is logical. Is it still possibe to avoid this, so that
> dtas continues playing at the same position as before the interruption
> (and without clearing the queue)?

Not sure.  I'm not sure if play(1) exits with enough info to
know it's a recoverable error or not.  I'll have look into it
when I get the chance (maybe in a few weeks, been busy on
other stuff).


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: sound card interruptions
  2019-10-08  8:32 ` Eric Wong
@ 2019-10-08 12:03   ` Rene Maurer
  0 siblings, 0 replies; 5+ messages in thread
From: Rene Maurer @ 2019-10-08 12:03 UTC (permalink / raw)
  To: Eric Wong; +Cc: dtas-all

Eric Wong <e@80x24.org> wrote:
> Rene Maurer <rmnet@mailc.net> wrote:

> Is that from a loose USB cable?  Sometimes they wear out if
> you're constantly unplugging/replugging it.

USB cable is ok. I assume it is the computer hardware (or DAC). It
happened three times in the last two years. So very rarely...


> I think it actually tries everything in the queue and fails
> every single one before stopping.

Yes that is exactly what I can see.

>> This behavior is logical. Is it still possibe to avoid this, so that
>> dtas continues playing at the same position as before the interruption
>> (and without clearing the queue)?
>
> Not sure.  I'm not sure if play(1) exits with enough info to
> know it's a recoverable error or not.  I'll have look into it
> when I get the chance (maybe in a few weeks, been busy on
> other stuff).

Thanks.


^ permalink raw reply	[flat|nested] 5+ messages in thread

* [PATCH] player: automatically pause if last sink dies
  2019-10-07 20:07 sound card interruptions Rene Maurer
  2019-10-08  8:32 ` Eric Wong
@ 2019-11-02 21:16 ` Eric Wong
  2019-11-10  7:36   ` Rene Maurer
  1 sibling, 1 reply; 5+ messages in thread
From: Eric Wong @ 2019-11-02 21:16 UTC (permalink / raw)
  To: Rene Maurer; +Cc: dtas-all

Attempting to play (and fail) every song in the queue or
tracklist is not ideal when a the USB/HDMI cable to the sound
device gets unplugged by accident.

When tee-ing to multiple sinks, we will still gracefully continue
if one goes dead and there are remaining sinks.

Suggested-by: Rene Maurer
Link: https://80x24.org/dtas-all/874l0kb9qm.fsf@loco10.cumparsita.ch/
---
 lib/dtas/player.rb | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/lib/dtas/player.rb b/lib/dtas/player.rb
index 37f2c96..61d29d2 100644
--- a/lib/dtas/player.rb
+++ b/lib/dtas/player.rb
@@ -282,7 +282,7 @@ def sink_death(sink, status)
     if deleted[0]
       warn("#{sink.name} died unexpectedly: #{status.inspect}")
       deleted.each { |t| drop_target(t) }
-      __current_drop unless @targets[0]
+      do_pause unless @targets[0]
       return # sink stays dead if it died unexpectedly
     end
 
@@ -451,7 +451,7 @@ def __current_drop(src = @current)
   # pull data from sink_buf into @targets, source feeds into sink_buf
   def sink_iter
     wait_iter = broadcast_iter(@sink_buf, @targets)
-    __current_drop if nil == wait_iter # sink error, stop source
+    do_pause if nil == wait_iter # sink error, stop source
     return wait_iter if @current
 
     # no source left to feed sink_buf, drain the remaining data


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] player: automatically pause if last sink dies
  2019-11-02 21:16 ` [PATCH] player: automatically pause if last sink dies Eric Wong
@ 2019-11-10  7:36   ` Rene Maurer
  0 siblings, 0 replies; 5+ messages in thread
From: Rene Maurer @ 2019-11-10  7:36 UTC (permalink / raw)
  To: Eric Wong; +Cc: dtas-all

Eric Wong <e@80x24.org> wrote:
> Attempting to play (and fail) every song in the queue or
> tracklist is not ideal when a the USB/HDMI cable to the sound
> device gets unplugged by accident.
>
> When tee-ing to multiple sinks, we will still gracefully continue
> if one goes dead and there are remaining sinks.

I have tried it with different USB soundcards. After an interruption the
player goes to pause. When the cable is plugged in again, the player
stays in pause until <dtas-ctl play> is executed.

Thank you very much.


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, back to index

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-07 20:07 sound card interruptions Rene Maurer
2019-10-08  8:32 ` Eric Wong
2019-10-08 12:03   ` Rene Maurer
2019-11-02 21:16 ` [PATCH] player: automatically pause if last sink dies Eric Wong
2019-11-10  7:36   ` Rene Maurer

everything related to duct tape audio suite (dtas)

Archives are clonable:
	git clone --mirror https://80x24.org/dtas-all
	git clone --mirror http://ou63pmih66umazou.onion/dtas-all

Example config snippet for mirrors

Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.audio.dtas
	nntp://ou63pmih66umazou.onion/inbox.comp.audio.dtas

 note: .onion URLs require Tor: https://www.torproject.org/

AGPL code for this site: git clone https://public-inbox.org/public-inbox.git