Date | Commit message (Collapse) |
|
Similar to the switch in dtas-archive(1), I got tired of having
to manually add stats to all the rips I was tracking out.
|
|
Using MSG_EOR with these local sockets is not necessary, and
appears to trigger a truncation bug on OpenBSD 7.3.
Link: https://marc.info/?i=20230826020759.M335788@dcvr
|
|
As with soxi(1), waiting for ffprobe(1) or avprobe(1) is still
an expensive operation despite Process.spawn being optimized to
use vfork(2).
|
|
As with sox, these will be dealing with legacy encodings
and badly-encoding software until the end of days, so do
our best to fix them up.
|
|
When this project started avconv was favored in Debian,
but that hasn't been the case in many years. Increase
the priority of ffmpeg to match the current situation in
Debian.
|
|
ffprobe aways says `track' instead of `TRACKNUMBER'; but
the rest of our code follows FLAC metadata conventions;
so use `TRACKNUMBER'.
(avprobe is untested since the libav project is dead)
|
|
For users of the CPU-saving bypass mode (e.g. "format rate=bypass"),
this fixes a bug when enqueueing a 44.1kHz immediately after a
48kHz file (or vice-versa).
Note: gapless playback with different rates/channels between
tracks has never been supported with bypass mode enabled.
Bypass only allows opportunistic gapless when sequential tracks
have the same format.
|
|
Sometimes I get non-English song titles and copy+paste them from
non-UTF8 texts.
|
|
Sometimes the command fails on certain tracks, and we need to
use the proper track object for error reporting.
|
|
They're two different ways of accomplishing roughly the same thing,
but --filter can be more flexible given the use of per-track
environment variables.
|
|
We still need the TTL to deal with fuse.sshfs and maybe other weird
FSes which don't return the st_ctime properly.
|
|
This can allow filtering for tracks with a given comment
declared via the ".#{COMMENT}" mechanism or the track title.
If no prefix is given (before the '='), then all comment
values are matched.
|
|
This allows setting the `FX' env on a per-track basis, since
some recordings may have massive dynamic shifts which aren't
desirable for casual listening or broadcast playback.
|
|
IO#close is idempotent since Ruby 2.3, so reduce our instruction
footprint to save some memory.
|
|
This should save a little bit of memory for current users.
|
|
We require 2.3+, nowadays, so jettison a bunch of code.
|
|
Since Ruby 2.3, it no longer checks FIONREAD, and we require
Ruby 2.3+ nowadays, so drop our IO.select-based workarounds.
|
|
We use DTAS.yaml_load to wrap all YAML.*load calls, but
we still need "require 'yaml'" for various .to_yaml calls.
|
|
"omap" is specific to Ruby and makes interopability with other
languages more difficult.
While it's true environment variables are stored as an ordered
array of C strings (see environ(7)); order doesn't matter in
practice. Everyone in the real world treats the environment as
an unordered key-value store.
Followup-to: cac63517e7f751cc (doc: drop ordered map from examples, 2022-01-07)
|
|
This ought to save some memory for dtas-player and
dtas-readahead users with multiple instances of the same
track(s) on their track list.
|
|
Psych 4.x defaults to "nanny mode" to handle untrusted data.
This causes breakage with since YAML references (aliases)
emitted by dtas-player can't be handled by Psych clients under
Ruby 3.1. Since dtas is single user and is a shell designed to
run arbitrary code, favor the new YAML.unsafe_load API which
behaves like the old YAML.load in Ruby <= 3.0.
|
|
Ruby 2.3+ supports String#@-, though it did not deduplicate
strings. But 2.5 is already old at this point and most users
can be expected to have it.
This gives some memory regressions for Ruby <= 2.4 users,
but cuts down on the code we maintain and reduces bytecode
overhead for 2.5+ users.
|
|
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.
|
|
splice(2) alone does not give enough information as to whether
the source or destination is blocking. However, as far as audio
playback chain goes, the sink should ALWAYS be the limiting
factor as decoder sources need to be able to produce data at
least as fast as the audio is being played (otherwise there'll
be audible drops).
Thus, we bias the select(2) into waiting on a targets on if we
splice(2) less than the data we requested.
|
|
This is a rarely-needed corner-case, but I just needed to use
this feature.
|
|
This allows dtas-player to play files with wonky filenames
when piping ffmpeg (or avconv) to sox. SoX-only code
dtas-player paths are not affected since they don't require
an extra Bourne shell.
All of our internal shell pipelines quote "$INFILE",
anyways, so there was never any need to escape for those.
This may cause compatibility problems for splitfx users, but
splitfx is probably too esoteric to have any users besides
myself. And I expect anybody editing audio with dtas-splitfx to
pick shell-friendly filenames.
dtas-player is far more general, and likely to encounter
shell-unfriendly filenames which require quoting.
|
|
POSIX filesystems do not enforce encodings, so we'll convert
non-UTF-8 filenames to blobs for SQLite instead of failing on
encoding errors. This should allow us to work on collections
which feature legacy encodings.
|
|
Ruby case/when is not like C with fall-through, so we can't
rely on fall-through behavior to use CharlockHolmes to detect
legacy encodings.
|
|
Using relative seek (Up/Dn/PgUp/PgDn) with dtas-console while
dtas-player is paused was causing non-sensical/confusing results
on unpause.
So clamp the minimum seek time to 0s the same way we clamp
during playback.
|
|
Write the contents of "stderr". This is useful for capturing the
per-track output of the sox(1) "stats" effect when combined with
parallel "--jobs".
|
|
We can flush when all comments are buffered to avoid a writev(2)
syscall on every comment.
|
|
Using the 'update-copyright' script from gnulib[1]:
git ls-files | UPDATE_COPYRIGHT_HOLDER='all contributors' \
UPDATE_COPYRIGHT_USE_INTERVALS=2 \
xargs /path/to/gnulib/build-aux/update-copyright
[1] https://git.savannah.gnu.org/git/gnulib.git
|
|
We have String#unpack at our disposal for working with "struct
inotify_event", so use it instead of depending on an extension
which requires a compiler and development headers to install.
|
|
Fiddle exists on all Ruby 1.9.2+ installations and seems
alright. Since splice is a Linux-only API, we don't need to
worry about the values of constants changing (and they're
architecture-independent).
|
|
sleepy_penguin requires a compiler and development headers to
install, so it could be a PITA to install for users on
distro-provided Ruby. Allow fiddle since it's part of the Ruby
standard library since 1.9.2 and users won't have to install
anything else.
|
|
The values of F_{GET,SET}PIPE_SZ are architecture-independent
and stable in Linux (unlike Ruby :P), so we won't need to bother
loading an extra .so here for two constants.
|
|
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/
|
|
Ruby 2.7.0dev will warn when hashes are passed and intended
for use as kwargs unless we expand the hash via "**TRY",
but "**" is Ruby 2.0+ syntax and I guess we still support
1.9.3 for the time being.
|
|
This fixes hanging when using a single audio output for
Linux users using splice.
|
|
A bunch of minor fixes and cleanups accumulating for the past
two years since the last release. It's tough to remember to
make releases when I'm always running the latest version from
git :x
Most notably, "io_splice" is no longer used for dtas-linux
users since "sleepy_penguin" includes all the functionality
we use. This is to reduce memory overhead from extra DSOs(*)
There's also some deprecation warning fixes for the
still-undocumented "dtas-mlib" command.
12 changes since v0.15.0 (2017-04-07):
pipeline: new module for running process pipelines
console: ensure time calculations are done in UTC
Rakefile: update path for uploads
player: support guessing encodings for comments
get rid of Windows-31J regexps
mlib: compatibility with Sequel 5.x
mlib: remove redundant tag massaging and encoding
mlib: use flock to get around SQLite busy errors
mlib: ignore files with nil times
dtas/watchable: check SystemCallError
mlib: fix unused variable warning
use sleepy_penguin 3.5+ for splice and tee support
(*) https://udrepper.livejournal.com/8790.html
|
|
Eliminate loading of the io_splice RubyGem to reduce memory overhead.
Extra DSOs are wasteful and io_splice is being phased oiut for
sleepy_penguin, which encapsulates more Linux-specific functionality
anyways.
cf. https://udrepper.livejournal.com/8790.html
|
|
|
|
Sometimes files become unreadable.
|
|
It happens with some video files, apparently.
|
|
The SQLite busy waiting scheme isn't great for usability
and the busy timeout is done by sleep+backoff. I prefer
to say we only support filesystems with flock() for our
little DB.
|
|
Redundant since ("player: support guessing encodings for comments")
|
|
Apparently some degree of thread-safety is being enforced;
not sure I agree, but oh well...
|
|
Oops, a Perlism crept in :x
|
|
This can be helpful for end users and is close to what other
players use. We can fallback to Encoding.default_external by
default (typically UTF-8) and then again using `charlock_holmes'
if installed.
Note: path names remain binary, because that's how proper
filesystems operate.
|
|
This should allow us easily to manipulate process pipelines
as an array of arrays.
Originally posted at
http://blade.nagaokaut.ac.jp/cgi-bin/scat.rb/ruby/ruby-talk/435624
|