Was cooking for almost two weeks.
f8931d Simplify i9e_line_handler.
f99dbe i9e: Fix a prompt display issue
cf39e4 audioc: Abstract out connection code.
@[ -z "$(Q)" ] || echo 'CC $<'
$(Q) $(CC) -c -o $@ $(CPPFLAGS) $(DEBUG_CPPFLAGS) @mad_cppflags@ $<
+$(object_dir)/compress_filter.o: compress_filter.c | $(object_dir)
+ @[ -z "$(Q)" ] || echo 'CC $<'
+ $(Q) $(CC) -c -o $@ $(CPPFLAGS) $(DEBUG_CPPFLAGS) -O3 $<
+
$(object_dir)/aacdec_filter.o: aacdec_filter.c | $(object_dir)
@[ -z "$(Q)" ] || echo 'CC $<'
$(Q) $(CC) -c -o $@ $(CPPFLAGS) $(DEBUG_CPPFLAGS) @faad_cppflags@ $<
- The obsolete gettimeofday() function has been replaced
by clock_gettime() on systems which support it.
- Speed and usability improvements for para_gui.
+ - para_client now restores the fd flags of stdin and stdout
+ on shutdown.
+ - Performance improvements for the compress filter.
+ - Improved downloads web page.
-----------------------------------------
0.4.12 (2012-12-20) "volatile relativity"
H: no amplification, 64 means the amplitude should be multiplied
H: by a factor of two, 128 by three and so on.
H:
-H: This value is used by the compress filter.
+H: This value is used by the amp filter.
H:
H: -v Verbose mode. Explain what is being done.
H:
op = para_malloc(length);
for (i = 0; i < length / 2; i++) {
/* be careful in that heat, my dear */
- int sample = *ip++, adjusted_sample = (PARA_ABS(sample) *
- pcd->current_gain) >> gain_shift;
- if (adjusted_sample > 32767) { /* clip */
- PARA_NOTICE_LOG("clip: sample: %d, adjusted sample: %d\n",
- sample, adjusted_sample);
- adjusted_sample = 32767;
+ int sample = *ip++;
+ bool neg = false;
+
+ if (sample < 0) {
+ sample = -sample;
+ neg = true;
+ }
+ sample *= pcd->current_gain;
+ sample >>= gain_shift;
+ if (sample > 32767) { /* clip */
+ sample = 32767;
pcd->current_gain = (3 * pcd->current_gain +
(1 << pcd->conf->inertia_arg)) / 4;
pcd->peak = 0;
- } else
- pcd->peak = PARA_MAX(pcd->peak, adjusted_sample);
- op[i] = sample >= 0? adjusted_sample : -adjusted_sample;
+ } else if (sample > pcd->peak)
+ pcd->peak = sample;
+ op[i] = neg? -sample : sample;
if (++pcd->num_samples & mask)
continue;
// PARA_DEBUG_LOG("gain: %u, peak: %u\n", pcd->current_gain,
static void add_spaces(WINDOW* win, unsigned int num)
{
char space[] = " ";
- unsigned sz = sizeof(space);
+ unsigned sz = sizeof(space) - 1; /* number of spaces */
while (num >= sz) {
waddstr(win, space);
dev = "/dev/mixer";
PARA_INFO_LOG("opening %s\n", dev);
ret = para_open(dev, O_RDWR, 42);
- if (ret < 0)
+ if (ret < 0) {
+ PARA_ERROR_LOG("could not open %s\n", dev);
return ret;
+ }
h = para_malloc(sizeof(*h));
h->fd = ret;
*handle = h;
sz = btr_pool_get_buffer(sit->btrp, &buf);
if (sz == 0)
return 0;
+ if (sit->must_set_nonblock_flag) {
+ ret = mark_fd_nonblocking(STDIN_FILENO);
+ if (ret < 0)
+ goto err;
+ sit->must_set_nonblock_flag = false;
+ }
/*
* Do not use the maximal size to avoid having only a single buffer
* reference for the whole pool. This is bad because if that single
return 0;
err:
btr_remove_node(&sit->btrn);
+ /* Revert to blocking mode if necessary. */
+ fcntl(STDIN_FILENO, F_SETFL, sit->fd_flags);
//btr_pool_free(sit->btrp);
return ret;
}
* \param sit The stdin task structure.
*
* This fills in the pre/post select function pointers of the task structure
- * given by \a sit. Moreover, the stdin file desctiptor is set to nonblocking
- * mode, and a buffer tree is created.
+ * given by \a sit and creates a buffer tree for I/O.
*/
void stdin_set_defaults(struct stdin_task *sit)
{
sit->task.post_select = stdin_post_select;
sit->btrp = btr_pool_new("stdin", 128 * 1024);
sprintf(sit->task.status, "stdin reader");
- ret = mark_fd_nonblocking(STDIN_FILENO);
- if (ret >= 0)
- return;
- PARA_EMERG_LOG("%s\n", para_strerror(-ret));
- exit(EXIT_FAILURE);
+ /*
+ * Both STDIN_FILENO and STDOUT_FILENO may refer to the same open file
+ * description (the terminal), and thus share the same file status
+ * flags. In order to not interfere with the stdout task, we only get
+ * the file status flags for STDIN here and save a copy. The nonblock
+ * flag is set later on the first read.
+ */
+ ret = fcntl(STDIN_FILENO, F_GETFL);
+ if (ret < 0) {
+ PARA_EMERG_LOG("F_GETFL: %s\n", strerror(errno));
+ exit(EXIT_FAILURE);
+ }
+ sit->fd_flags = ret;
+ sit->must_set_nonblock_flag = (sit->fd_flags & O_NONBLOCK) == 0;
}
struct btr_node *btrn;
/** Use a buffer pool to minimize memcpy due to alignment problems. */
struct btr_pool *btrp;
+ /** The descriptor flags of STDIN at startup. */
+ int fd_flags;
+ /** Whether we have to set STDIN to nonblocking mode. */
+ bool must_set_nonblock_flag;
};
void stdin_set_defaults(struct stdin_task *sit);
if (!FD_ISSET(STDOUT_FILENO, &s->wfds))
return 0;
+ if (sot->must_set_nonblock_flag) {
+ ret = mark_fd_nonblocking(STDOUT_FILENO);
+ if (ret < 0)
+ goto out;
+ sot->must_set_nonblock_flag = false;
+ }
for (;;) {
sz = btr_next_buffer(btrn, &buf);
if (sz == 0)
btr_consume(btrn, ret);
}
out:
- if (ret < 0)
+ if (ret < 0) {
btr_remove_node(&sot->btrn);
+ /* Revert to blocking mode if necessary. */
+ fcntl(STDOUT_FILENO, F_SETFL, sot->fd_flags);
+ }
return ret;
}
/**
* \param sot The stdout task structure.
*
* This fills in the pre/post select function pointers of the task structure
- * given by \a sot and sets the stdout file descriptor to nonblocking mode.
+ * given by \a sot.
*/
void stdout_set_defaults(struct stdout_task *sot)
{
sot->task.pre_select = stdout_pre_select;
sot->task.post_select = stdout_post_select;
sprintf(sot->task.status, "stdout");
- ret = mark_fd_nonblocking(STDOUT_FILENO);
- if (ret >= 0)
- return;
- PARA_EMERG_LOG("%s\n", para_strerror(-ret));
- exit(EXIT_FAILURE);
+
+ /* See stdin.c for details. */
+ ret = fcntl(STDOUT_FILENO, F_GETFL);
+ if (ret < 0) {
+ PARA_EMERG_LOG("F_GETFL: %s\n", strerror(errno));
+ exit(EXIT_FAILURE);
+ }
+ sot->fd_flags = ret;
+ sot->must_set_nonblock_flag = (sot->fd_flags & O_NONBLOCK) == 0;
}
struct task task;
/** Stdout is always a leaf node in the buffer tree. */
struct btr_node *btrn;
+ /** The descriptor flags of STDOUT at startup. */
+ int fd_flags;
+ /** Whether we have to set STDOUT to nonblocking mode. */
+ bool must_set_nonblock_flag;
};
void stdout_set_defaults(struct stdout_task *sot);
<h1>Download</h1>
<hr>
-<p> Clone the git repository by executing </p>
+Paraslash is only available as source code, no binary packages are
+provided at this point. There are several ways to download the source:
-<p> <b> git clone git://paraslash.systemlinux.org/git paraslash </b> </p>
+<ul>
+ <li> <em> git</em>.
-<p> Or grab the <a href="releases/paraslash-git.tar.bz2">tarball</a>
-of the current master branch, or download the latest version from the
-<a href="releases/">download directory</a>. All regular releases are
-<a href="PUBLIC_KEY">cryptographically signed</a>. Since development
-takes place in separate topic branches the master branch is expected
-to be more stable than any of the released versions. </p>
+ Clone the git repository by executing
+
+ <p> <pre> <kbd> git clone git://paraslash.systemlinux.org/git paraslash </kbd> </pre> </p>
+
+ <p> The repository contains the full history of the
+ project since 2006, all work in progress and the source
+ code for the web pages. Choosing this option allows to
+ check out any of the four integration branches maint,
+ master, next, pu (see the
+
+ <a href="manual.html#git_branches">git_branches</a>
+
+ section of the manual). All previous releases
+ correspond to tagged commits and may be checked out
+ as well. Since development takes place in separate
+ topic branches the master branch is expected to be
+ more stable than any of the released versions. </p>
+
+ <p> Compiling from git requires additional tools,
+ notably the autoconf package must be installed. </p>
+
+ </li>
+
+ <li> <em> regular releases</em>.
+
+ All released versions can be downloaded as compressed
+ tarballs from the
+
+ <a href="releases/">download directory</a>.
+
+ These tarballs are
+
+ <a href="PUBLIC_KEY">cryptographically signed</a>
+
+ and contain a pre-generated configure script. They
+ can be compiled and installed without autoconf.
+
+ </li>
+
+ <li> <em>master tarballs</em>.
+
+ Whenever significant changes are incorporated a
+
+ <a href="releases/paraslash-git.tar.bz2">tarball</a>
+
+ of the current master branch is created. All changes in
+ this tarball will be included in the next release. Like
+ for regular releases, a configure script is provided
+ for convenience.
+
+ </li>
+
+ <li> <em>gitweb snapshots</em>.
+
+ The
+
+ <a href="/gitweb/gitweb.cgi?p=.git;a=summary">gitweb</a>
+
+ page contains a snapshot link for each revision. This
+ allows to get a specific revision without downloading
+ the full history.
+
+ </li>
+</ul>