about summary refs log tree commit homepage
path: root/lib/dtas
DateCommit message (Collapse)
2013-09-01player: explicitly stop+wait for sink death at_exit
This allows me to hit Ctrl-C on a dtas-player(1) process, wait on termination of the player, and immediately restart it without worrying about sink conflicts upon restart. Before this change, sinks would continue running for a bit (depending on buffer sizes).
2013-09-01player/client_handler: cleanup to avoid redundant code
stop_sinks is already defined, so avoid repeating this loop
2013-09-01player: add "state dump" command to serialize state
This helps in case dtas-player is hit with SIGKILL or the system crashes. This does not fsync(2) as that could introduce delays on slow filesystems. Users should open the file manually and fsync themselves if they need to.
2013-09-01source/{av,ff}: probe harder for audio in weird containers
Some containers (e.g. large VOBs) are not easily probed and require additional options for avprobe/ffprobe to find audio streams. We do this by looping and increasing the duration/size of the probe to find new audio streams. This seems to work reasonably well for some DVD rips I have until seeking is required. This breaks if the seek point (including seeks for source effects) exceeds the avprobe/ffprobe -analyzeduration. Anyways, I recommend extracting the audio stream (without transcoding) out of the VOB container as the best way to go. Something like: avconv -analyzeduration 2G -probesize 2G \ -i input.vob -vn -sn -c:a copy -map 0:$STREAM_NR output.ext
2013-08-31disclaimer: disambiguate between dtas/$PROGNAME
The whole dtas project is committed to giving as much rope as users need!
2013-08-30av_ff_common: fix undefined var in astream fallback
This is reproducible on a video file with a mono audio stream when attempting playback in stereo.
2013-08-29rg: avoid adding gain if fallback_gain + preamp is near zero
No need to add the vol effect if it's going to be a noop.
2013-08-29remove "encoding: binary" header use
We don't need it since IO#read(bytes, buf) will convert to ASCII-8BIT anyways. Everywhere else, we ensure path names are already binary. We do this mainly at the client layer before using Shellwords to escape the paths. We also must be careful about parsing output from soxi/avprobe which can show us metadata in whatever encoding is in the file. We must still handle data from parsing command output as binary, as the encoding of file metadata tends to vary. This also should buy us Syck compatibility for Ruby 1.9.3 users on Debian systems where Ruby 1.9.3 still uses Syck.
2013-08-28add license/copyright headers/footers to all files
All files we distribute in the tarball need to have a copyright/license specified for Savannah. We don't need the example state file anymore.
2013-08-27av_ff_common: zero samples on streams of unknown length
It's possible to get zero samples when playing streams of unknown length (e.g. over Icecast over HTTP)
2013-08-27player: fix sink auto-restart on "sink ed" changes
I should really write a test case for this, maybe later.
2013-08-26:nodoc: core classes in 1.9 compat layer
No we do not want to confuse `ri' users with this.
2013-08-26av_ff_common: :nodoc: this constant and add TODO item
We expose no public API, so avoid cluttering users disk space with useless ri/rdoc and avoid cluttering the web with HTML nobody will read.
2013-08-26client_handler: remove redundant checks for @current.pid
@current is only set if is active with a pid, now, so all of our checks for @current.pid are redundant and confusing.
2013-08-26player: do not assign @current until successful spawn
This should hopefully prevent us from getting wedged if we hit an error while preparing to spawn (or during spawn).
2013-08-26source/sox: cleanup error handling, quiet redundant warnings
Showing the warning for the same file over and over again is annoying when seeking a file handled by avconv/ffmpeg, so stop doing it. While we're at it, the error handling for __load_comments is totally redundant (absent of race conditions if another process modifies the file). However, if we do hit races, all the other soxi invocations would be racy, too; but we really just shouldn't care about such a corner case in here.
2013-08-26add lightly-tested ffmpeg support
Since ffmpeg/ffprobe are wrappers around their libav-variants, I haven't had the chance to actually test with "real" ffmpeg, but the usage is probably similar enough to not matter.
2013-08-26source/sox: bail out if zero samples are detected
soxi may not handle some files correctly and detect zero samples without error-ing out. If sox can't detect the sample count or the file is really empty, then there's no point trying futher and we'll fall back to avconv.
2013-08-26player: break out gracefully if a file is totally unplayable
Sometimes we'll enqueue the wrong file and avconv won't be able to handle it.
2013-08-26player: restart sinks on "sink ed" modification
This is for consistency with source handlers.
2013-08-26player: sink ed pipe_size= disallows nils
While we're at it, add a test for this functionality, too.
2013-08-26dtas-{sink,source}edit: reduce redundant code
These two are similar enough that it's possible to share some code between them and also increase user-friendliness at the same time.
2013-08-26player: flesh out multi-source in protocol/sourceedit
We should be fully-capable of managing any number of options to try sources in.
2013-08-26cleanup multi-source handling between sox and av
This should better prepare us to make "source ed" into "source <av|sox> ed" and set per-source priorities. We also now treat @env consistently for all per-source commands (such as soxi/avprobe) so we can be sure we're using the same installation of sox or libav if using a non-standard PATH, or if we want to set AV_LOG_FORCE_NOCOLOR
2013-08-26process (qx): disambiguate err/err_str, add no_raise
I forgot :err is already handled by Process.spawn, so split out the functionality into err_str where we want to use it. Also, add a :no_raise flag which will allow us to better handle avprobe/soxi calls which can fail and avoid needless exceptions.
2013-08-26process: remove redundant "xs" method
Shellwords.join is an identical method and there's no reason not to use it.
2013-08-25process: allow passing env to qx
This should allow us to more easily transfer user-configured environment variables to helper tools (avprobe/soxi).
2013-08-25player: fix logic around sink death/respawns
We do not need a respawn flag, since we already infer expected vs unexpected sink death by checking the @targets array. Additionally, next_source must always check @current before calling, and not clobber the existing @current because that would cause two source processes writing into the same pipe.
2013-08-25format: fix switching to floating point samples
Regexps are hard to write sometimes :x Anyways, we should support using floating-point internally for users who prefer it.
2013-08-25source/av: handle multiple audio streams w/ proper sample rate
We need to tell sox to use and resample to the _player_ format instead of the source format. Otherwise 48000 Hz audio (common for video?) sounds very slow when attempting to play back on the default 44100 Hz. It is also likely preferable to choose the audio stream which matches the player channel count instead of letting sox automatically invoke the remix effect. Before this change, playing 6-channel, 48000 Hz source into a sink expecting stereo, 44100 Hz is rather disturbing... While we're at it, clarify the spawn code for the sox source, too. We can drop the test_format_from_file test now, since it's probably overkill at this point.
2013-08-25preliminary support for avconv/avprobe from libav
avconv is capable of outputting to the .sox format, greatly simplifying our life as it enables us to easily apply sox effects on a per-source file basis. dtas-sourceedit and the "source" protocol commands will need to change to support internal priorities (like sink).
2013-08-25format: decouple from soxi
We'll be supporting reading the format from avprobe and ffprobe, so we should avoid tying ourselves to soxi
2013-08-25split out source handling to prepare for avconv/ffmpeg support
We should've done this at the start, but we didn't.
2013-08-25player: remove unreachable branch
a sink can never have respawn set and not be active
2013-08-25command: remove kill, we no longer rely on it
Instead, we rely on closing the pipe (EOF or SIGPIPE) to stop sources and sinks. This way we remove the possibility of old and new processes operating on the same pipe and causing strange audio overlaps.
2013-08-25unix_client: remove non-SOCK_SEQPACKET support
It's too much work for me to attempt to wedge SOCK_DGRAM or SOCK_STREAM support into this. SOCK_SEQPACKET is the best use of _my_ time and I have limited patience for crippled OSes. Linux has had this forever and FreeBSD 9 supports SOCK_SEQPACKET already, so maybe this will be another way to nudge developers of other OSes into supporting SOCK_SEQPACKET. If somebody can provide clean patches to support SOCK_DGRAM or SOCK_STREAM, I'll accept them.
2013-08-25set REPLAYGAIN_* vars for source command as documented
We documented this behavior in dtas-player.txt but failed to implement it. Now our behavior matches the documentation!
2013-08-25more cleanups for packaging and documentation v0.0.0
Rename COPYRIGHT -> COPYING, as that seems to be the more common name for the GPLv3 license file. Kill all rdoc, since I don't agree with HTML documentation and we do not expose any Ruby APIs.
2013-08-25remove sink_reader_play
It was never fully-realized and too crazy/complex to be worth it. In case we ever need it in the future, git will remember it for us.
2013-08-25player: preserve format across invocations
We maintain most everything else, so we should maintain this, too.
2013-08-24player: cd/pwd handlers for manipulating working directory
Some effects may be easier to save/store with relative directory paths, so allow changing this at runtime.
2013-08-24initial commit