m4_define(PROGRAM, para_filter) [suite filter] version-string = GIT_VERSION() [supercommand para_filter] purpose = decode or process audio data from STDIN to STDOUT [description] This program transforms the audio stream read from STDIN by chaining one or more filters. A common mode of operation is to decode an mp3 file with the mp3dec filter, but many other filters exist which transform the audio stream in different ways. [/description] m4_include(common-option-section.m4) m4_include(help.m4) m4_include(detailed-help.m4) m4_include(version.m4) m4_include(loglevel.m4) m4_include(per-command-options-section.m4) [option filter] short_opt = f summary = add one filter to the filter chain arg_info = required_arg arg_type = string flag multiple typestr = filter_spec [help] A filter specifier begins with the name of a supported filter, optionally followed by zero or more options for the named filter. Filter name and options must be separated by whitespace. If the there is at least one option, the filter specifier needs to be quoted like this: --filter 'compress --inertia 5 --damp 2' This option may be specified multiple times to 'pipe' the stream through all given filters (in a single thread without copying the data). The same filter may appear more than once, and order matters. [/help] [section Examples] .IP \(bu 4 Decode a wma file to wav format: .EX \ para_filter -f wmadec -f wav < file.wma > file.wav .EE .IP \(bu 4 Amplify a raw audio file by a factor of 1.5: .EX \ para_filter -f amp --amp 32 < foo.raw > bar.raw .EE [/section] t/paraslash/tree/ggo/makefile?h=v0.4.6&id=d0d27cfa56d05eaa0e5567c75adfe606eab2957e'>treecommitdiff
path: root/ggo/makefile (unfollow)
Commit message (Collapse)Author
2011-11-20client: Implement interactive mode.Andre Noll
This makes para_client enter an interactive session when started with no command. Command line history and command completion are available in interactive sessions. This populates the previously empty files interactive.h and interactive.c which contain the readline/interactive specific part. Everything in these files is independent of para_client. Conversely, client.c and client_common.c are independent of readline. The public API defined in interactive.h was designed to be reused from other applications. In fact, a subsequent commit changes para_audioc to offer interactive sessions as well.
2011-11-20string: Introduce compute_word_num().Andre Noll
The completion code needs to determine the word the curser is currently on. Libreadline only provides the start and end position of the current word in the line buffer, but not the word number. This patch adds compute_word_num() to string.c which uses the same algorithm as create_argv() to determine the word boundaries.
2011-11-20configure: Introduce checks for libreadline.Andre Noll
This adds interactive.o to the object list of para_client if readline was found and links para_client against libreadline in this case. The new source files interactive.c and interactive.h are empty for now.
2011-11-20client: Split client_open() and client_close().Andre Noll
For interactive para_client sessions, we set up the client configuration from the values given at the command line and in the config file just as we do for non-interactive mode. However, in interactive mode we must be able to execute arbitrary many client commands using the same configuration. client_open() sets up the configuration from the command line arguments and client_close() destroys the configuration, so both functions do more than what is needed in interactive mode. This patch splits client_open() into two functions client_parse_config() and client_connect(). The old client_open() remains with the same semantics as before, it just calls both of the new functions(). In the same spirit, client_close() is split into client_disconnect(), which closes the file descriptor and deallocates the ressources of the current command but does not free the configuration. This allows to re-use the client configuration multiple times for interactive sessions.
2011-11-20sched: Allow more than one running scheduler instance.Andre Noll
The interactive completion code must be able to run a second, independent scheduler instance for generating the possible completions. This is currently not possible because the pre_select and post_select list heads of the scheduler are defined globally in sched.c. This patch moves these list heads from sched.c to struct sched. This leaves only the global "now" variable in sched.c, but it is OK to update this from all scheduler instances, so it can stay. Moving the two list heads to struct sched requires that several public functions, among them register_task(), grow an additional parameter. The (mostly trivial) changes that update all callers to provide the new argument make the patch rather invasive, unfortunately.
2011-11-20Teach command_util to print also completions.Andre Noll
This adds completion mode to command_util.sh. When exectuted in this mode, it prints array initializers for all supported commands. This will be used to generate the array of completers for para_client and para_audiod.
2011-11-20Allow switching between different log methods at runtime.Andre Noll
Currently, para_client defines its para_log function via the INIT_STDERR_LOGGING() macro which generates a log function that writes to stderr. However, we will need to switch to a different, curses-aware logging function when operating in interactive mode. To support more than one log method the type of para_log is changed from a function to a (public) pointer variable. This variable is supposed to point to the log function currently in use so that the application can simply set para_log differently in order to switch between log functions. The patch also changes the INIT_STDERR_LOGGING() macro to receive the name of the log function to be defined and to let para_log point to the newly defined function.
2011-11-20command_util: Fix quoting in template_loop().Andre Noll
Without this additional quoting, the command usage string is incorrect in case the template contains square brackets. For example, the usage of the lsblob commands was printed as Usage: lspl [-i] [-l] [-r] t rather than the desired Usage: lspl [-i] [-l] [-r] [pattern] because the command "echo [pattern]" prints "t" since there is a subdirectory called "t" in the source tree.
2011-11-17Compilation fix for FreeBSD.Andre Noll
Commit 25ca796b (daemon: Introduce parent_waits flag for daemonize().) broke the compilation on FreeBSD due to signal.h not being included. This patch adds the missing include.
2011-11-13doc: Add flac documentation to manual and FEATURES.Andre Noll
2011-11-13Implement the flac decoding filter.Andre Noll
This replaces the dummy functions in flacdec_filter.c by a working implementation. Although it contains an ugly workaround for a shortcoming in the flac library, see the comment in read_cb() for details, it seems to work fine.
2011-11-13Implement the flac audio format handler.Andre Noll
This adds another audio format to para_server and para_afh. Since meta data tags flac are essentially vorbis comments, they are fully supported. However, the audio format handler accepts only flac files with fixed block size, and ogg/flac is not supported either at this point.
2011-11-13Initial support for FLAC (the free lossless audio codec).Andre Noll
This adds tests for flac headers and libraries to configure.ac and adds configure options to override the default location of these files. Moreover, a (non-working) implementation of the flac audio format handler and the flac decoder are introduced. All new functions are defined as empty dummies to be filled with content in subsequent commits.
2011-11-13btr: Introduce btr_next_buffer_omit().Andre Noll
This function is useful for the flac decoder.
2011-11-13Make vorbis comment helper functions generic.Andre Noll
copy_comment() and copy_if_tag_type() are useful also to the new flac audio format handler, so move these functions to string.c and make them public. Rename them to safe_strdup() and key_value_copy() respectively, as this is more to the point.
2011-11-13Calculate width of audio formats in ls output.Andre Noll
Currently the field width for the audio format is hard-coded as three as the name of each supported audio format (mp3, ogg, aac, wma, spx) consists of three characters. However, with the forthcoming flac support, this is no longer true since "flac" consists of four characters. So the ls command must calculate the maximal field width of the audio formats of all listed files. This is achieved by introducing the new audio_format_width member of struct ls_widths.
2011-11-13stdin: Increase input buffer.Andre Noll
Some flac files may contain the contain arbitrary large metadata at the beginning and libflac wants to see this data in one go. 128K should be enough for most cases.
2011-11-13daemon: Introduce parent_waits flag for daemonize().Andre Noll
In daemon mode, para_server should not detach from the console until it is listening on its command socket. The previous approach turned out to be buggy and has been reverted in the previous commit. This second attempt tries to get it right. It adds a boolean parameter "parent_waits" to daemonize(). After daemonize() has forked, the parent process does not exit immediately if parent_waits is true but waits until the child process sends SIGTERM to its parent, or exits. para_server makes use of the new flag in server_init(). The daemon process (child) sends SIGTERM to its parent after the command socket has been initialized. para_audiod, on the other hand, does not need this feature, so it calls daemonize() with parent_waits == false to get the old behaviour.
2011-11-13Revert "server: Listen on command socket before daemonizing."Andre Noll
This reverts commit 7a4b6d5f19976ceac581f6dc235fcbd9b30c767f, which was a rather bad idea because it caused the afs process to inherit the open file descriptor of the command socket, so two processes listened on the command socket at the same time. Even worse, the afs process also inherited the command task in its scheduler setup, causing it to answer incoming connections as well. In fact it was more or less random which of the two processes served an incoming connection. If it was the afs process, interesting things happened in the command handler due to its address space being a copy of the afs process, where parts of what is needed for some commands not properly set up. For example the si and the sender commands segfaulted due to a NULL pointer dereference. It's weird that this bug was not noticed earlier.
2011-11-12vss: Avoid read-overflowing the header buffer for ogg streams.Andre Noll
valgrind complains because of invalid reads/writes in vss.c: ==998== Invalid write of size 1 ==998== at 0x8050B09: vss_post_select (vss.c:574) ==998== by 0x806106C: schedule (sched.c:71) ==998== by 0x804EE04: main (server.c:579) ==998== Address 0x46d99bc is 0 bytes after a block of size 548 alloc'd ==998== at 0x4028A3B: realloc (vg_replace_malloc.c:632) ==998== by 0x805356B: para_realloc (string.c:40) ==998== by 0x80506EC: vss_post_select (vss.c:331) ==998== by 0x806106C: schedule (sched.c:71) ==998== by 0x804EE04: main (server.c:579) ==998== ... ==5543== Invalid read of size 1 ==5543== at 0x8050EBD: vss_post_select (vss.c:1099) ==5543== by 0x806108E: schedule (sched.c:71) ==5543== by 0x804EE04: main (server.c:579) ==5543== Address 0x47c70ac is 0 bytes after a block of size 3,956 alloc'd ==5543== at 0x4028A3B: realloc (vg_replace_malloc.c:632) ==5543== by 0x805358D: para_realloc (string.c:40) ==5543== by 0x80642AA: add_ogg_page (ogg_afh.c:78) ==5543== by 0x8064458: vorbis_get_header_callback (ogg_afh.c:132) ==5543== by 0x8063EF1: process_ogg_packets (ogg_afh_common.c:48) ==5543== by 0x8063F9A: ogg_get_file_info (ogg_afh_common.c:144) ==5543== by 0x8064200: vorbis_get_header (ogg_afh.c:149) ==5543== by 0x804FDD9: recv_afs_result (vss.c:1006) ==5543== by 0x80503F4: vss_post_select (vss.c:1124) ==5543== by 0x806108E: schedule (sched.c:71) ==5543== by 0x804EE04: main (server.c:579) The problem is that for ogg streams chunk 0 points to a buffer on the heap rather than to the mapped audio file, but we are checking the buffer bounds against the memory map. The fix consists of two parts. (a) We now treat a FEC group special if it starts at chunk zero: Such a group now contains only this single chunk. (b) When setting up the FEC group we always compare the buffer bounds against the start of the first buffer in the group rather than the memory map.
2011-11-11vss: Don't prefault header.Andre Noll
Commit 7bba6232 (vss: Mmap audio files using MAP_POPULATE.) introduced read-ahead for chunks of the mmapped audio file. However, it missed the fact that for ogg streams chunk 0 is created on the fly and stored in a dynamically allocated buffer. Read-ahead on this buffer is likely to access memory not owned by the process and might lead to a segfault. Fix this bug by not performing read-ahead for chunk zero.
2011-11-06com_lsblob: Print an error message if no blob matched.Andre Noll
Just to be consistent with other commands.
2011-11-06com_ls: Print an error message if no file matched.Andre Noll
In case at least one pattern was given and no matches were found, the ls command returned with no output at all. This makes it print a "no matches" error message instead.
2011-11-06catblob: Fix "no matches" message.Andre Noll
The catblob commands are supposed to print this message only if none of the given patterns matches any blob in the database. However, in case all of the matching blobs are empty, we do print the message. The problem is that the match count is not being increased due to cat_blob() returning negative for empty blobs. This count is computed in action_if_pattern_matches() which calls cat_blob() as its action handler which in turn calls osl_open_disk_object(). But this function returns -E_OSL_EMPTY for empty blobs, and cat_blob() just passes through this value. This patch changes cat_blob() so that it explicitly checks for -E_OSL_EMPTY and returns zero in this case so that the match counter will be increased.
2011-11-06afs: Make catblob commands print an error if no blob matched.Andre Noll
This is straight-forward given the new generic num_matches counter which was introduced in the previous patch.
2011-11-06afs: Provide generic counter for matching rows.Andre Noll
Several afs commands implemented their own counters, often only to find out whether they should print an error message because no rows matched the given pattern(s). This patch makes counting matching rows generic by increasing the new pattern_match_data->num_matches counter in action_if_pattern_matches() so that all commands which use this facility for iterating over all audio files can evaluate the counter afterwards. This allows to remove several per-command counters.
2011-11-02web: Rework text on download page.Andre Noll
The git link to kernel.org was defunct and is probably not the best pointer anyway. These days everybody knows git, so let's simply not link to any git page. This patch also reorders the three options for downloading (clone repo, download snaphot, download release) so that git comes first.
2011-11-01http_recv: Fill both buffer pool buffers simultaneously.Andre Noll
This changes http_recv_post_select() to call readv_nonblock() rather than read_nonblock() to read data from the socket, just like the udp and dccp receivers do. This saves one iteration of the scheduler loop if the end of the buffer pool area is reached.
2011-11-01recv: Make ->btrp and ->fd generic.Andre Noll
All three receivers maintain a file descriptor and a buffer tree pool per connection. Currently these are part of the receiver node's private_data structure, which is a needless code duplication. This patch moves both fields to the generic struct receiver_node. Since the private_data structure of the udp and dccp receivers contained no other fields, this allows to get rid of it completely for these two receivers.
2011-10-18alsa: Improve error diagnostics.Andre Noll
Always print the alsa error string corresponding to the failed library call. This allows to get rid of all but one alsa errors in error.h.
2011-10-18alsa: Make two variables local to alsa_init().Andre Noll
The two members buffer_frames and buffer_time of struct private_alsa_data are only needed in alsa_init(), so make them local. Rename buffer_frames to buffer_size since this is the value returned by snd_pcm_hw_params_get_buffer_size().
2011-10-18alsa: Dump the configuration on startup.Andre Noll
Currently we log selected alsa parameters, but it is sometimes useful to see the full configuration. This patch adds a call to snd_pcm_dump() to alsa_init() which obtains the alsa hardware and software configuration. It is printed for loglevels info and debug.
2011-10-18alsa: Avoid busy loop with dmix.Andre Noll
When using alsa's direct mixing plugin, the alsa poll fd might be ready for IO even though nothing can be written to the alsa handle. This leads to a busy loop in para_audiod and para_write and makes these applications eat up considerable amounts of CPU time during playback. This patch fixes the problem by reading from the alsa fd after a failed write. It also adjusts the test for when to return early from alsa_post_select(). The old code was not wrong, however, since we should never reach the test if poll_fd is negative.
2011-10-18Makefile: Remove unused variable man_pages_in.Andre Noll
This variable is defined but never used, so it is safe to remove it.
2011-10-18Makefile: Drop dependencies on *_command_list.[ch].Andre Noll
It is enough to let para_audiod and para_server depend on their object files only as these object files in turn depend on _command_list.[ch], so Mr Transitivity does the work for us.