about summary refs log tree commit homepage
path: root/lib/dtas
DateCommit message (Collapse)
2020-02-03doc: update copyrights for 2020
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
2020-01-06watchable: use fiddle for inotify support
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.
2020-01-06buffer: replace sleepy_penguin with fiddle
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).
2020-01-06provide fiddle-based eventfd implementation
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.
2020-01-06pipe: avoid loading sleepy_penguin
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.
2019-11-02player: automatically pause if last sink dies
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/
2019-11-02buffer/splice: pass kwargs as-is to tee/splice
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.
2019-01-02splice: fix missing F_NONBLOCK flag for single output
This fixes hanging when using a single audio output for Linux users using splice.
2019-01-02dtas 0.16.0 v0.16.0
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
2019-01-02use sleepy_penguin 3.5+ for splice and tee support
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
2019-01-02mlib: fix unused variable warning
2019-01-02dtas/watchable: check SystemCallError
Sometimes files become unreadable.
2018-01-30mlib: ignore files with nil times
It happens with some video files, apparently.
2018-01-30mlib: use flock to get around SQLite busy errors
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.
2018-01-29mlib: remove redundant tag massaging and encoding
Redundant since ("player: support guessing encodings for comments")
2018-01-29mlib: compatibility with Sequel 5.x
Apparently some degree of thread-safety is being enforced; not sure I agree, but oh well...
2018-01-29get rid of Windows-31J regexps
Oops, a Perlism crept in :x
2018-01-29player: support guessing encodings for comments
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.
2017-04-28pipeline: new module for running process pipelines
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
2017-03-02deduplicate strings using String#-@ (uminus) in Ruby 2.5+
This is faster than relying on eval() for older Rubies. https://bugs.ruby-lang.org/issues/13077 Ruby 2.5 is targetted for release in December 2017.
2017-01-11source/sox: relax comment NAME restriction
This is needed for the "ALBUM ARTIST" tag which has a space in the name. This is looser than <http://www.xiph.org/vorbis/doc/v-comment.html>, but probably good enough for practical purposes.
2017-01-06rg_state: fix no-op gain detection
Seeing tiny (or zero) values for the "gain" effect is an eyesore in process table output, and a waste of CPU cycles in sox. So stop using the "gain" effect for imperceptible changes in volume. While we're at it, remove the pointless knobs for setting this, too. They were never documented and I doubt anybody would want to tweak them at runtime.
2017-01-02buffer/splice: remove MAX_SIZE constant
We do not need it at runtime, only for testing on Linux-like systems
2017-01-02source/sox: simplify conditional, slightly
One normal method dispatch is probably preferable to two optimized instructions + immediate.
2016-12-31player: freeze sink name to avoid needless dup
Ruby Hashes will automatically create frozen copies of unfrozen strings used as hash keys to avoid accidental mutation. Pre-freeze keys explicitly so the Ruby VM will not need to create the frozen copy.
2016-12-27http -> https, and relocate homepage to https://80x24.org/dtas/
HTTPS allows some level of security(*) and we've actually supported it on 80x24.org for many months, now. So, point new readers to it. Moving away from hostname-based homepages will allow us to save on subjectAltName space (and bandwith) when negotiating an HTTPS connection. We'll also have an .onion mirror for Tor users, soon, too; in case we can't afford to pay ICANN in the future. (assuming TLS libraries don't have any more Heartblead-level bugs in them, CAs aren't compromised, MITM HTTPS stripping proxies don't get in your way, and your certificate bundle isn't compromised).
2016-12-27source/sox: integrate mcache support to reduce soxi calls
This should improve performance with slow filesystems or systems with slow spawn performance.
2016-12-26introduce mcache class for caching audio metadata
We often waste cycles rerunning commands we don't need to run frequently. Introduce a short term cache for these.
2016-12-26format.from_file: reduce soxi invocations
Spawning processes under Ruby on Linux is relatively cheap, but may not be for other OSes and it's still cheaper to spawn fewer processes.
2016-12-07splitfx: more consistently generate fade_in effects
No reason to generate the command in a different place than fade_out.
2016-11-26mlib: use transaction for removing stale entries
This ought to avoid busy DB errors.
2016-04-24player: extra "cue" seeking functionality
These commands allow easier jumping within a track marked by embedded CUE sheets. I've found them helpful for tracking out large recordings of multiple tracks (e.g. vinyl transfers or live concert recordings).
2016-04-11player: "cue prev" reliably hits previous cue breakpoint
Seeking around a track should not be done relative to a previous seek, but should rather be analogous to the "tl prev" command to skip around the tracklist. I'm not sure what drugs I was on when I originally wrote this original version, but I'm fairly certain this is a bugfix and not intentional behavior.
2016-03-18sigevent/pipe: require file for DTAS::Nonblock properly
This fixes a bug introduced in 0.12.0 which only affects non-sleepy_penguin users. Fixes: d3cf61b05d95 ("switch to exception-free non-blocking I/O")
2016-02-09av_ff_common: fixes for libav-tools under Debian Jessie
Newer avprobe outputs a new format, fix our parser to workaround this while remaining compatible with the old one in Debian wheezy. Additionally, ffprobe is no longer available as a link to avprobe.
2016-01-25player: support "consume" mode for tracklist
When activated, this boolean deletes a song from the tracklist after it is played.
2016-01-25mlib: use more appropriate methods
.each on a Sequel dataset is more appropriate for the way we emit comments. And using Array#map! is more efficient when we do not need the original array.
2016-01-25mlib: support --force option
We will allow forcing updates since upgrading dependent software (e.g. sox, avprobe, ffprobe) may allow previously-ignored files to become support
2016-01-25mlib: support all formats of player
Almost, we will need to get a list of all suffixes supported by ffprobe or avprobe. This could prove tricky..
2016-01-25source/sox: try_to_fail_harder is a normal method
The @last_failed state is in the parent object, not the dup-ed object we fork off of.
2016-01-24source/sox: explicitly freeze comment keys
We load them frequently enough that the garbage is not worth it.
2016-01-24String#split with a single-byte instead of regexp
This reduces memory usage as a Regexp object is hundreds of bytes and a single-byte string object is only 40 bytes that is deduped within the VM.
2016-01-24player: avoid allocation on sort
Hash#keys already allocates a new array, so we may sort it in place without worrying about side effects and avoiding an extra allocation.
2016-01-17mlib: fix foreign-key ordering issues with delete
We need to ensure children and comments are all deleted before parents are.
2016-01-05tracklist: reshuffle tracklist when exhausted
For now, shuffle means "random without repeats". So avoid repeating ourselves by shuffling when we've reached the end of the shuffled tracklist and have no more tracks to go. Whenever a client restarts the player or hits the loop for repeat, we'll have a freshly shuffled list for them to listen to.
2016-01-05tracklist: fix off-by-one error on track removal
@pos is an array index, and should never go beyond the last element.
2016-01-05console: show tracklist shuffle status, too
We support this feature, so it should probably be shown along with the repeat status of the tracklist. Ensure we notify all of our listeners about the status change in player, too.
2016-01-04player: replaygain: avoid unnecessary ignoring
It is possible for a file to only have one of the ReplayGain tags we need and not the previous-required REPLAYGAIN_TRACK_GAIN tag. So do not reject the entire series of tags if a file has the one we want.
2016-01-02copyright updates for 2016
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] git://git.savannah.gnu.org/gnulib.git
2016-01-02source/splitfx: stringify comments
It's easier to leave numerics unquoted in YAML; so automatically stringify comments comming from the YAML file.