* [ANN] dtas 0.20.0 - duct tape audio suite for *nix
@ 2022-02-03 5:15 6% Eric Wong
0 siblings, 0 replies; 4+ results
From: Eric Wong @ 2022-02-03 5:15 UTC (permalink / raw)
To: dtas-all, ruby-talk
Free Software command-line tools for audio playback, mastering, and
whatever else related to audio. dtas follows the worse-is-better
philosophy and acts as duct tape to combine existing command-line tools
for flexibility and ease-of-development. dtas is currently implemented
in Ruby, Perl5, and some embedded shell, but may use other languages in
the future.
Changes:
dtas 0.20.0 - ruby 3.1+ compatibility, splitfx improvements
This release catches up with Psych (YAML) changes in Ruby 3.1+
Ruby 2.3+ is now the minimum version, though keep in mind the
ruby-core team already dropped support for it long ago.
Most of the features are focused on audio engineering
capabilities of dtas-splitfx. dtas-splitfx gains the --filter
switch, along with per-track environment variables and comments.
These new features have made my workflow significantly better.
dtas-archive supports explicit comments, and omits the default
SoX comment. To better cope with temporary and modified files
during editing, dtas-player metadata now checks ctime before
reusing the cache, handy for frequently-modified files.
"dtas-tl prune" is now supported to cull temporary files from
the player tracklist.
There's a few dtas-console improvements, too.
28 changes since v0.19.0 (2021-09-05):
archive: support comments, default to none
splitfx: use Etc.nprocessors for jobs if unspecified
dtas-console: set X11 terminal title iff DISPLAY is set
dtas-console: add 'i' toggle to show comments (metadata)
splitfx: fix track_zpad with integer arg
doc: drop ordered map from examples
player: reduce syscalls when splicing to single target
dtas-console: support Wayland terminal titles, too
console: workaround safe warnings in outdated `curses' gem
require Ruby 2.3+
get rid of DTAS.dedupe_str wrapper
move dtas-graph into script/, support Perl for dtas.sh
use YAML.unsafe_load in Psych 4.x (Ruby 3.1+)
deduplicate and freeze pathnames + metadata
player: remove omap conversion
dtas: drop unnecessary "require 'yaml'" statements
dtas-tl prune: cull missing files from tracklist
dtas-tl: drop encoding hacks, use binary stdout+stderr
use IO#wait_readable consistently
get rid of DTAS::Nonblock wrapper for Ruby <= 2.0
unix_accepted: drop Ruby < 2.3 support code
do not check IO#closed? before calling IO#close
splitfx: support per-track environment variables
splitfx: add --filter option to limit match to comments
player: expire sox metadata cache on file st_ctime changes
readahead: do not call -@ on non-String
splitfx: disallow combining --trim and --filter
splitfx: document changes ahead of 0.20.0 release
* homepage: https://80x24.org/dtas/
* https://80x24.org/dtas/INSTALL
* https://80x24.org/dtas/dtas-player.txt
* https://80x24.org/dtas/NEWS.atom
* git clone https://80x24.org/dtas.git
* dtas-all@nongnu.org (plain-text only, no HTML mail, please)
* mail archives: https://80x24.org/dtas-all/
nntps://news.public-inbox.org/inbox.comp.audio.dtas
imaps://anon:mous@public-inbox.org/inbox.comp.audio.dtas.0
nntp://7fh6tueqddpjyxjmgtdiueylzoqt6pt7hec3pukyptlmohoowvhde4yd.onion/inbox.comp.audio.dtas
imap://anon:mous@7fh6tueqddpjyxjmgtdiueylzoqt6pt7hec3pukyptlmohoowvhde4yd.onion/inbox.comp.audio.dtas.0
https://80x24.org/dtas-all/new.atom
note: .onion URLs require Tor: <https://www.torproject.org/>
^ permalink raw reply [relevance 6%]
* [PATCH 6/9] use IO#wait_readable consistently
@ 2022-01-23 21:37 5% ` Eric Wong
0 siblings, 0 replies; 4+ results
From: Eric Wong @ 2022-01-23 21:37 UTC (permalink / raw)
To: dtas-all
Since Ruby 2.3, it no longer checks FIONREAD, and we require
Ruby 2.3+ nowadays, so drop our IO.select-based workarounds.
---
bin/dtas-readahead | 16 ++--------------
lib/dtas/unix_client.rb | 4 ++--
2 files changed, 4 insertions(+), 16 deletions(-)
diff --git a/bin/dtas-readahead b/bin/dtas-readahead
index d3c6e79..75bfbe8 100755
--- a/bin/dtas-readahead
+++ b/bin/dtas-readahead
@@ -28,18 +28,6 @@
@redir = { err: null, out: null, in: null }.freeze
require 'pp'
-if RUBY_VERSION.to_r >= '2.3'.to_r
- # Old Rubies did FIONREAD, which breaks on SOCK_SEQPACKET
- def wait_read(w, timeout)
- w.to_io.wait_readable(timeout)
- end
-else
- def wait_read(w, timeout)
- r = IO.select([w], nil, nil, timeout)
- r ? r[0] : nil
- end
-end
-
def seek_to_cur_pos(cur_pid, fp)
cur_fd = []
fpst = fp.stat
@@ -120,7 +108,7 @@ def do_ra(fp, pos, w)
len -= n
# stop reading immediately if there's an event
- if wait_read(w, 0)
+ if w.to_io.wait_readable(0)
adj = @todo_ra
pos += size
break
@@ -220,7 +208,7 @@ def do_open(path)
fp.close if fp && !fp.closed?
fp = timeout = nil
end
- r = wait_read(w, timeout)
+ r = w.to_io.wait_readable(timeout)
p w.res_wait if r
rescue EOFError
abort "dtas-player exited"
diff --git a/lib/dtas/unix_client.rb b/lib/dtas/unix_client.rb
index 8aa953c..71f833c 100644
--- a/lib/dtas/unix_client.rb
+++ b/lib/dtas/unix_client.rb
@@ -1,4 +1,4 @@
-# Copyright (C) 2013-2020 all contributors <dtas-all@nongnu.org>
+# Copyright (C) all contributors <dtas-all@nongnu.org>
# License: GPL-3.0+ <https://www.gnu.org/licenses/gpl-3.0.txt>
# frozen_string_literal: true
require_relative '../dtas'
@@ -39,7 +39,7 @@ def req(args, timeout = nil)
end
def res_wait(timeout = nil)
- IO.select([@to_io], nil, nil, timeout)
+ @to_io.wait_readable(timeout)
nr = @to_io.nread
nr > 0 or raise EOFError, "unexpected EOF from server"
@to_io.recv(nr)
^ permalink raw reply related [relevance 5%]
* [PATCH 0/4] require Ruby 2.3+, support Ruby 3.1
@ 2022-01-20 18:34 14% Eric Wong
2022-01-20 18:34 4% ` [PATCH 1/4] require Ruby 2.3+ Eric Wong
0 siblings, 1 reply; 4+ results
From: Eric Wong @ 2022-01-20 18:34 UTC (permalink / raw)
To: dtas-all
I figure most workstation and laptop users will have Ruby 2.3+
by now, since the Ruby core team doesn't even support 2.5.
In any case, old versions of dtas remain available for users of
old Rubies; but AFAIK dtas hardly has users atm and isn't likely
to gain more.
Psych 4.x (YAML) distributed with Ruby 3.1 breaks some subtle cases
for us so 4/4 fixes them.
Eric Wong (4):
require Ruby 2.3+
get rid of DTAS.dedupe_str wrapper
move dtas-graph into script/, support Perl for dtas.sh
use YAML.unsafe_load in Psych 4.x (Ruby 3.1+)
bin/dtas-console | 4 ++--
bin/dtas-msinkctl | 4 ++--
bin/dtas-partstats | 12 +++---------
bin/dtas-readahead | 11 +++++------
bin/dtas-sinkedit | 7 +++----
bin/dtas-sourceedit | 7 +++----
bin/dtas-splitfx | 6 +++---
bin/dtas-tl | 4 ++--
dtas.gemspec | 4 ++--
dtas.sh | 7 ++++---
lib/dtas.rb | 28 ++++++----------------------
lib/dtas/compat_onenine.rb | 17 -----------------
lib/dtas/fadefx.rb | 4 ++--
lib/dtas/mlib.rb | 12 +++++-------
lib/dtas/partstats.rb | 5 ++---
lib/dtas/pipeline.rb | 5 +----
lib/dtas/player.rb | 4 ++--
lib/dtas/player/client_handler.rb | 6 +++---
lib/dtas/process.rb | 3 +--
lib/dtas/rg_state.rb | 4 ++--
lib/dtas/source/av_ff_common.rb | 6 +++---
lib/dtas/source/sox.rb | 6 +++---
lib/dtas/source/splitfx.rb | 4 ++--
lib/dtas/spawn_fix.rb | 10 ----------
lib/dtas/state_file.rb | 4 ++--
lib/dtas/watchable/fiddle_ino.rb | 4 ++--
{perl => script}/dtas-graph | 2 +-
test/test_encoding.rb | 4 ++--
test/test_format_change.rb | 4 ++--
test/test_player_client_handler.rb | 4 ++--
test/test_player_integration.rb | 15 +++++++--------
test/test_rg_integration.rb | 18 +++++++++---------
test/test_sink.rb | 4 ++--
test/test_splitfx.rb | 6 ++----
test/test_tfx.rb | 4 ++--
35 files changed, 94 insertions(+), 155 deletions(-)
delete mode 100644 lib/dtas/compat_onenine.rb
delete mode 100644 lib/dtas/spawn_fix.rb
rename {perl => script}/dtas-graph (97%)
^ permalink raw reply [relevance 14%]
* [PATCH 1/4] require Ruby 2.3+
2022-01-20 18:34 14% [PATCH 0/4] require Ruby 2.3+, support Ruby 3.1 Eric Wong
@ 2022-01-20 18:34 4% ` Eric Wong
0 siblings, 0 replies; 4+ results
From: Eric Wong @ 2022-01-20 18:34 UTC (permalink / raw)
To: dtas-all
This allows us to jettison a bunch of compatibility code since
we've started using Etc.nprocessors and String#- (uminus) in
more places. The Ruby core team doesn't support <= 2.5, even.
---
bin/dtas-partstats | 12 +++---------
bin/dtas-readahead | 3 +--
bin/dtas-sinkedit | 3 +--
bin/dtas-sourceedit | 3 +--
dtas.gemspec | 4 ++--
lib/dtas.rb | 13 ++-----------
lib/dtas/compat_onenine.rb | 17 -----------------
lib/dtas/partstats.rb | 3 +--
lib/dtas/pipeline.rb | 5 +----
lib/dtas/process.rb | 3 +--
lib/dtas/spawn_fix.rb | 10 ----------
test/test_player_integration.rb | 3 +--
test/test_splitfx.rb | 4 +---
13 files changed, 15 insertions(+), 68 deletions(-)
delete mode 100644 lib/dtas/compat_onenine.rb
delete mode 100644 lib/dtas/spawn_fix.rb
diff --git a/bin/dtas-partstats b/bin/dtas-partstats
index 884a6d1..6a0c9d4 100755
--- a/bin/dtas-partstats
+++ b/bin/dtas-partstats
@@ -1,5 +1,5 @@
#!/usr/bin/env ruby
-# Copyright (C) 2013-2020 all contributors <dtas-all@nongnu.org>
+# Copyright (C) all contributors <dtas-all@nongnu.org>
# License: GPL-3.0+ <https://www.gnu.org/licenses/gpl-3.0.txt>
# frozen_string_literal: true
# TODO
@@ -8,17 +8,11 @@
# - configurable output formatting
# - Sequel/SQLite support
require 'dtas/partstats'
+require 'etc'
infile = ARGV[0] or abort "usage: #$0 INFILE"
ps = DTAS::PartStats.new(infile)
-def nproc
- require 'etc'
- Etc.nprocessors
-rescue NoMethodError
- `nproc 2>/dev/null || echo 2`.to_i
-end
-
-opts = { jobs: nproc }
+opts = { jobs: Etc.nprocessors }
stats = ps.run(opts)
headers = ps.key_idx.to_a
diff --git a/bin/dtas-readahead b/bin/dtas-readahead
index 3eedd86..a1971bd 100755
--- a/bin/dtas-readahead
+++ b/bin/dtas-readahead
@@ -1,5 +1,5 @@
#!/usr/bin/env ruby
-# Copyright (C) 2015-2020 all contributors <dtas-all@nongnu.org>
+# Copyright (C) all contributors <dtas-all@nongnu.org>
# License: GPL-3.0+ <https://www.gnu.org/licenses/gpl-3.0.txt>
# frozen_string_literal: true
#
@@ -18,7 +18,6 @@
require 'dtas/process'
include DTAS::Process
-include DTAS::SpawnFix
trap(:CHLD) { DTAS::Process.reaper {} }
trap(:INT) { exit(0) }
trap(:TERM) { exit(0) }
diff --git a/bin/dtas-sinkedit b/bin/dtas-sinkedit
index 3393aac..8f96a97 100755
--- a/bin/dtas-sinkedit
+++ b/bin/dtas-sinkedit
@@ -1,5 +1,5 @@
#!/usr/bin/env ruby
-# Copyright (C) 2013-2020 all contributors <dtas-all@nongnu.org>
+# Copyright (C) all contributors <dtas-all@nongnu.org>
# License: GPL-3.0+ <https://www.gnu.org/licenses/gpl-3.0.txt>
# frozen_string_literal: true
require 'optparse'
@@ -68,7 +68,6 @@
buf = $stdin.read
commit_update.call(buf)
else
- include DTAS::SpawnFix
tmp = tmpyaml
tmp_path = tmp.path
do_update = lambda { commit_update.call(File.read(tmp_path)) }
diff --git a/bin/dtas-sourceedit b/bin/dtas-sourceedit
index 23362c2..e6603bf 100755
--- a/bin/dtas-sourceedit
+++ b/bin/dtas-sourceedit
@@ -1,5 +1,5 @@
#!/usr/bin/env ruby
-# Copyright (C) 2013-2020 all contributors <dtas-all@nongnu.org>
+# Copyright (C) all contributors <dtas-all@nongnu.org>
# License: GPL-3.0+ <https://www.gnu.org/licenses/gpl-3.0.txt>
# frozen_string_literal: true
require 'optparse'
@@ -55,7 +55,6 @@
buf = $stdin.read
commit_update.call(buf)
else
- include DTAS::SpawnFix
tmp = tmpyaml
tmp_path = tmp.path
do_update = lambda { commit_update.call(File.read(tmp_path)) }
diff --git a/dtas.gemspec b/dtas.gemspec
index 50ce370..e1bbb38 100644
--- a/dtas.gemspec
+++ b/dtas.gemspec
@@ -1,4 +1,4 @@
-# Copyright (C) 2013-2021 all contributors <dtas-all@nongnu.org>
+# Copyright (C) all contributors <dtas-all@nongnu.org>
# License: GPL-3.0+ <https://www.gnu.org/licenses/gpl-3.0.txt>
Gem::Specification.new do |s|
manifest = File.read('.gem-manifest').split(/\n/)
@@ -12,5 +12,5 @@
s.files = manifest
s.homepage = 'https://80x24.org/dtas.git/about/'
s.licenses = "GPL-3.0+"
- s.required_ruby_version = '>= 1.9.3'
+ s.required_ruby_version = '>= 2.3'
end
diff --git a/lib/dtas.rb b/lib/dtas.rb
index 1eac704..eb8f49d 100644
--- a/lib/dtas.rb
+++ b/lib/dtas.rb
@@ -1,4 +1,4 @@
-# Copyright (C) 2013-2020 all contributors <dtas-all@nongnu.org>
+# Copyright (C) all contributors <dtas-all@nongnu.org>
# License: GPL-3.0+ <https://www.gnu.org/licenses/gpl-3.0.txt>
# frozen_string_literal: true
@@ -9,15 +9,8 @@ module DTAS
# try to use the monotonic clock in Ruby >= 2.1, it is immune to clock
# offset adjustments and generates less garbage (Float vs Time object)
# :stopdoc:
- begin
+ def self.now # :nodoc:
::Process.clock_gettime(::Process::CLOCK_MONOTONIC)
- def self.now # :nodoc:
- ::Process.clock_gettime(::Process::CLOCK_MONOTONIC)
- end
- rescue NameError, NoMethodError
- def self.now # :nodoc:
- Time.now.to_f # Ruby <= 2.0
- end
end
@null = nil
@@ -48,7 +41,5 @@ def self.dedupe_str(str)
# :startdoc:
end
-require_relative 'dtas/compat_onenine'
-require_relative 'dtas/spawn_fix'
require_relative 'dtas/encoding'
DTAS.extend(DTAS::Encoding)
diff --git a/lib/dtas/compat_onenine.rb b/lib/dtas/compat_onenine.rb
deleted file mode 100644
index b65ea50..0000000
--- a/lib/dtas/compat_onenine.rb
+++ /dev/null
@@ -1,17 +0,0 @@
-# Copyright (C) 2013-2020 all contributors <dtas-all@nongnu.org>
-# License: GPL-3.0+ <https://www.gnu.org/licenses/gpl-3.0.txt>
-
-# Make Ruby 1.9.3 look like Ruby 2.0.0 to us
-# This exists for Debian wheezy users using the stock Ruby 1.9.3 install.
-# We'll drop this interface when Debian wheezy (7.0) becomes unsupported.
-class String # :nodoc:
- def b # :nodoc:
- dup.force_encoding(Encoding::BINARY)
- end
-end unless String.method_defined?(:b)
-
-def IO # :nodoc:
- def self.pipe # :nodoc:
- super.each { |io| io.close_on_exec = true }
- end
-end if RUBY_VERSION.to_f <= 1.9
diff --git a/lib/dtas/partstats.rb b/lib/dtas/partstats.rb
index 45eff34..8e9ee95 100644
--- a/lib/dtas/partstats.rb
+++ b/lib/dtas/partstats.rb
@@ -1,5 +1,5 @@
# -*- encoding: binary -*-
-# Copyright (C) 2013-2020 all contributors <dtas-all@nongnu.org>
+# Copyright (C) all contributors <dtas-all@nongnu.org>
# License: GPL-3.0+ <https://www.gnu.org/licenses/gpl-3.0.txt>
# frozen_string_literal: true
require_relative '../dtas'
@@ -11,7 +11,6 @@
class DTAS::PartStats # :nodoc:
CMD = 'sox "$INFILE" -n $TRIMFX $SOXFX stats $STATSOPTS'
include DTAS::Process
- include DTAS::SpawnFix
attr_reader :key_idx
attr_reader :key_width
diff --git a/lib/dtas/pipeline.rb b/lib/dtas/pipeline.rb
index eb2af89..1bebe87 100644
--- a/lib/dtas/pipeline.rb
+++ b/lib/dtas/pipeline.rb
@@ -1,12 +1,9 @@
-# Copyright (C) 2017-2020 all contributors <dtas-all@nongnu.org>
+# Copyright (C) all contributors <dtas-all@nongnu.org>
# License: GPL-3.0+ <https://www.gnu.org/licenses/gpl-3.0.txt>
# frozen_string_literal: true
require_relative '../dtas'
-require_relative 'spawn_fix'
module DTAS::Pipeline # :nodoc:
- include DTAS::SpawnFix
-
# Process.spawn wrapper which supports running Proc-like objects in
# a separate process, not just external commands.
# Returns the pid of the spawned process
diff --git a/lib/dtas/process.rb b/lib/dtas/process.rb
index f93a8c4..d00716f 100644
--- a/lib/dtas/process.rb
+++ b/lib/dtas/process.rb
@@ -1,4 +1,4 @@
-# Copyright (C) 2013-2020 all contributors <dtas-all@nongnu.org>
+# Copyright (C) all contributors <dtas-all@nongnu.org>
# License: GPL-3.0+ <https://www.gnu.org/licenses/gpl-3.0.txt>
# frozen_string_literal: true
require 'io/wait'
@@ -11,7 +11,6 @@
module DTAS::Process # :nodoc:
PIDS = {}
include DTAS::XS
- include DTAS::SpawnFix
def self.reaper
begin
diff --git a/lib/dtas/spawn_fix.rb b/lib/dtas/spawn_fix.rb
deleted file mode 100644
index b586130..0000000
--- a/lib/dtas/spawn_fix.rb
+++ /dev/null
@@ -1,10 +0,0 @@
-# Copyright (C) 2013-2020 all contributors <dtas-all@nongnu.org>
-# License: GPL-3.0+ <https://www.gnu.org/licenses/gpl-3.0.txt>
-# workaround for older Rubies: https://bugs.ruby-lang.org/issues/8770
-module DTAS::SpawnFix # :nodoc:
- def spawn(*args)
- super(*args)
- rescue Errno::EINTR
- retry
- end if RUBY_VERSION.to_f <= 2.1
-end
diff --git a/test/test_player_integration.rb b/test/test_player_integration.rb
index d2e11cf..e933f7b 100644
--- a/test/test_player_integration.rb
+++ b/test/test_player_integration.rb
@@ -1,10 +1,9 @@
-# Copyright (C) 2013-2020 all contributors <dtas-all@nongnu.org>
+# Copyright (C) all contributors <dtas-all@nongnu.org>
# License: GPL-3.0+ <https://www.gnu.org/licenses/gpl-3.0.txt>
# frozen_string_literal: true
require './test/player_integration'
class TestPlayerIntegration < Testcase
include PlayerIntegration
- include DTAS::SpawnFix
def test_cmd_rate
env = ENV.to_hash.merge(@fmt.to_env)
diff --git a/test/test_splitfx.rb b/test/test_splitfx.rb
index b6ae01f..cacda66 100644
--- a/test/test_splitfx.rb
+++ b/test/test_splitfx.rb
@@ -1,4 +1,4 @@
-# Copyright (C) 2013-2020 all contributors <dtas-all@nongnu.org>
+# Copyright (C) all contributors <dtas-all@nongnu.org>
# License: GPL-3.0+ <https://www.gnu.org/licenses/gpl-3.0.txt>
# frozen_string_literal: true
require 'yaml'
@@ -7,8 +7,6 @@
require_relative 'helper'
class TestSplitfx < Testcase
- include DTAS::SpawnFix
-
def tmp_err(path)
err = $stderr.dup
$stderr.reopen(path, 'a')
^ permalink raw reply related [relevance 4%]
Results 1-4 of 4 | reverse | options above
-- pct% links below jump to the message on this page, permalinks otherwise --
2022-01-20 18:34 14% [PATCH 0/4] require Ruby 2.3+, support Ruby 3.1 Eric Wong
2022-01-20 18:34 4% ` [PATCH 1/4] require Ruby 2.3+ Eric Wong
2022-01-23 21:37 [PATCH 0/9] various cuts for memory savings Eric Wong
2022-01-23 21:37 5% ` [PATCH 6/9] use IO#wait_readable consistently Eric Wong
2022-02-03 5:15 6% [ANN] dtas 0.20.0 - duct tape audio suite for *nix Eric Wong
Code repositories for project(s) associated with this public inbox
https://80x24.org/dtas.git/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).