Andre Noll [Wed, 2 Apr 2008 07:56:54 +0000 (09:56 +0200)]
Simplify activate_inactive_grab_clients().
Andre Noll [Tue, 1 Apr 2008 22:46:02 +0000 (00:46 +0200)]
NEWS update.
Andre Noll [Tue, 1 Apr 2008 22:41:49 +0000 (00:41 +0200)]
audiod: Get rid of the audiod task.
It's simpler to start/stop the decoders from status_pre_select()
because this is the point where we get the recent status info from
para_server.
In particular, this allows to kill the min_delay crap in
the audiod_pre_select() which now gets called from
status_pre_select(). Rename it to start_stop_decoders() as
this is what that function does.
Andre Noll [Tue, 1 Apr 2008 21:26:22 +0000 (23:26 +0200)]
Fix com_stat() for arguments greater than one.
It behaved like it was given a non-positive arg in this case.
Andre Noll [Tue, 1 Apr 2008 21:24:29 +0000 (23:24 +0200)]
Fix another bug in stdout.c.
This one caused the first chunk of data to be swallowed.
Andre Noll [Tue, 1 Apr 2008 20:42:17 +0000 (22:42 +0200)]
client.c: Add status info.
Andre Noll [Tue, 1 Apr 2008 20:42:00 +0000 (22:42 +0200)]
client.c: Fix error value of supervisor task.
Andre Noll [Tue, 1 Apr 2008 20:41:05 +0000 (22:41 +0200)]
Fix a bug in stdout.c.
Andre Noll [Tue, 1 Apr 2008 20:18:31 +0000 (22:18 +0200)]
Make unregister_task() static.
It has no more users outside sched.c.
Andre Noll [Tue, 1 Apr 2008 20:17:11 +0000 (22:17 +0200)]
Update documentation for stdin.c and stdout.c.
It contained some outdated comments.
Andre Noll [Tue, 1 Apr 2008 20:16:23 +0000 (22:16 +0200)]
stdin: Don't set sit->loaded.
It's pointless because the only users of stdin allocate a
static struct for the stdin task.
Andre Noll [Tue, 1 Apr 2008 20:09:41 +0000 (22:09 +0200)]
Fix two typos in stdin.c.
Andre Noll [Tue, 1 Apr 2008 20:07:56 +0000 (22:07 +0200)]
Kill unused wng_unregister().
Andre Noll [Tue, 1 Apr 2008 20:05:46 +0000 (22:05 +0200)]
wng_open(): Defer registering the wng task.
This way we do not have to unregister it on errors.
Andre Noll [Tue, 1 Apr 2008 20:01:28 +0000 (22:01 +0200)]
audiod: Rewrite status task logic.
As the status task does not use any file descriptors, it's
OK to do everything in one function. So kill status_post_select()
and move the code to status_pre_select().
Andre Noll [Tue, 1 Apr 2008 19:59:24 +0000 (21:59 +0200)]
unregister_task(): Print what caused the task to shutdown.
Andre Noll [Tue, 1 Apr 2008 19:57:33 +0000 (21:57 +0200)]
unregister_task(): Set error status to E_TASK_UNREGISTERED
This way the users know when it's safe to free the memory
containing the task struct.
Andre Noll [Tue, 1 Apr 2008 19:55:26 +0000 (21:55 +0200)]
kill_task(): Only set task error status.
It's not safe to call unregister_task() at this point as
this function might be called from pre_select() or post_select().
Just set the task's error value to -E_TASK_KILLED. The task
will then be unregistered on the next iteration of the
scheduler loop.
Andre Noll [Tue, 1 Apr 2008 17:01:40 +0000 (19:01 +0200)]
Merge commit 'remotes/fml/master'
Andre Noll [Tue, 1 Apr 2008 09:29:11 +0000 (11:29 +0200)]
afs.c: Make open_next_audio_file() static.
Andre Noll [Tue, 1 Apr 2008 09:28:52 +0000 (11:28 +0200)]
afs.c: Get rid of unregister_tasks().
Call shed_shutdown() instead. Also make read errors from the
afs - server pipe fatal.
Andre Noll [Mon, 31 Mar 2008 23:07:03 +0000 (01:07 +0200)]
audiod: Don't unregister tasks, just set the error value.
This is a first step to get rid of unregister_task().
Andre Noll [Mon, 31 Mar 2008 22:23:58 +0000 (00:23 +0200)]
filter: Switch from linked lists to arrays.
The number of filters is known and never changes, so it's easier
to use arrays.
Andre Noll [Mon, 31 Mar 2008 20:35:06 +0000 (22:35 +0200)]
sched: Only call pre/post select hooks if tasks are not in error state.
Andre Noll [Mon, 31 Mar 2008 17:08:34 +0000 (19:08 +0200)]
Fix afs shutdown.
In case para_server dies, the afs process must unregister all
tasks in order to shut down cleanly.
Andre Noll [Mon, 31 Mar 2008 12:02:15 +0000 (14:02 +0200)]
Documentation updates and cleanups.
Andre Noll [Mon, 31 Mar 2008 11:56:15 +0000 (13:56 +0200)]
sched.c: Cosmetic cleanups.
Andre Noll [Mon, 31 Mar 2008 11:52:51 +0000 (13:52 +0200)]
afs: Shutdown the scheduler if a fatal signal was caught.
This fixes the problem that the afs database was not marked clean
and thus had to be checked if para_server was interupted by a
signal.
Andre Noll [Mon, 31 Mar 2008 11:51:02 +0000 (13:51 +0200)]
Export sched_shutdown().
Andre Noll [Mon, 31 Mar 2008 11:50:43 +0000 (13:50 +0200)]
sched.c: Add checks for empty lists.
This allows to call shed_shutdown() from the pre/post select hooks
of the tasks.
Andre Noll [Mon, 31 Mar 2008 11:15:37 +0000 (13:15 +0200)]
audiod.c: Fix stat task restarting.
Andre Noll [Mon, 31 Mar 2008 11:11:46 +0000 (13:11 +0200)]
ungegister_task(): Set task error value to -E_TASK_KILLED.
This way, one can be sure that a negative value in t->error means
this task will not be scheduled again.
Andre Noll [Sun, 30 Mar 2008 20:56:16 +0000 (22:56 +0200)]
Simplify the scheduling code.
- Get rid of sched->select_ret. Tasks shouldn't care about the
return value of the select call.
- Kill task->private_data. Use container_of() instead.
- Remove task->event_handler. It is never necessary and only
makes the code more convoluted. The scheduler unregisters
tasks as soon as either the pre_select or the post_select
functions return an error.
- Rename task->ret to task->error and get rid of a couple
of error fields in other structs that usually only contained
a copy of the task's error value.
This conversion likely introduces many bugs that have to be
shaken out in subsequent patches. Hopefully it will result in
less error-prone code in the long run.
Andre Noll [Sun, 30 Mar 2008 14:21:02 +0000 (16:21 +0200)]
Add documentation for the loglevel argument of para_server.
Andre Noll [Sun, 30 Mar 2008 14:20:24 +0000 (16:20 +0200)]
Increase aggressiveness of the compress filter.
Andre Noll [Sat, 29 Mar 2008 11:42:54 +0000 (12:42 +0100)]
Fix lsatt command.
Andre Noll [Tue, 25 Mar 2008 07:47:34 +0000 (08:47 +0100)]
Fix afs signal handling.
afs must not abort on SIGPIPE as the client may close the
connection at any time. This bug was there forever but showed
up only now because the recent callback changes made the afs
process write to the command handler socket multiple times.
Also ignore SIGUSR1 instead of catching and ignoring it.
Andre Noll [Tue, 25 Mar 2008 00:19:21 +0000 (01:19 +0100)]
Update doxygen documentation.
Andre Noll [Mon, 24 Mar 2008 23:18:01 +0000 (00:18 +0100)]
Complete the afs callback conversion.
This makes it possible for the callbacks to pass a partial
result buffer through the command handler <-> callback socket.
This removes a serious limitation of previous paraslash-0.3.x
versions: As callbacks could not send data directly to the
command handler they had to store the full command output in
a buffer. This buffer was sent to the command handler after the
callback returns.
The problem with this approach is that it caused the callbacks
to allocate large amounts of memory. If that amount exceeded what
can be stored in a shared memory area (32MB on Linux), the command
even failed.
The fix consists of adding a max_size field and a max_size_handler
function pointer to the para_buffer structure. Whenever para_printf()
would need to allocate more memory than specified by max_size, it
calls the max_size_handler which is supposed to send out the data.
para_printf then prints the requested data into the old but now
empty buffer.
Almost all users set the max_size_handler to pass_buffer_as_shm(),
a helper function implemented in afs.c that copies the buffer to
a shared memory area and sends its identifier through the socket.
Andre Noll [Mon, 24 Mar 2008 15:04:21 +0000 (16:04 +0100)]
Introduce pass_object_as_shm().
This singles out the code for passing data from the callback
to the command handler. The plan is to change the callbacks
so that they call this function whenever the result buffer
is too large to fit into a shared memory area.
Andre Noll [Mon, 24 Mar 2008 14:20:28 +0000 (15:20 +0100)]
make send_callback_request() and friends take a result handler.
This is a first step to overcome a design flaw in the afs
callback code: The output of the commands is currently
stored in an osl object that is copied to a shared memory
area whose shmid is passed back to the command handler
via the local socket. This method limits the size of the
command output to the maximal size that can be stored in
a shared memory area which is not enough to hold large
outputs like that of ls -c.
This patch allows the command handlers to pass a result handler
function instead of an osl object. This result handler is
called for each shared memory area that gets sent through the
local socket.
Further patches will change the callbacks so that they pass
multiple result buffers instead of returning a single buffer.
This has the additional advantage that partial command output
produced by the callback can be sent even before the callback
returns. This parital output is seen immediately by the command
handler.
Andre Noll [Wed, 19 Mar 2008 20:51:46 +0000 (21:51 +0100)]
Fix use of uninitialized afhi->header_len.
In aft's add_one_audio_file() we set the header len and
the header offset to zero so that the get_file_info()
functions of the audio format handlers that do not use
headers don't need to zero these fields.
However, this is not the right place to do that as para_afh
also calls get_file_info() via compute_afhi() but missed to
clear these fields which leads to a segmentation fault.
Fix this bug by moving the zeroing to compute_afhi().
Andre Noll [Mon, 17 Mar 2008 09:49:41 +0000 (10:49 +0100)]
Fix compilation of para_fade in certain cases.
We really need to do the _cmdline_objs and _errlist_objs dance
in configure.ac.
Also, fix the configure warning message in case linux/soundcard.h
was found but alsa wasn't, and remove the object list of para_fsck
from Makefile.in.
Andre Noll [Mon, 17 Mar 2008 08:43:33 +0000 (09:43 +0100)]
Merge commit 'remotes/meins/master'
Andre Noll [Mon, 17 Mar 2008 08:41:08 +0000 (09:41 +0100)]
fsck.c: Fix typo.
Spotted and fixed by Gerrit Renker.
Andre Noll [Mon, 17 Mar 2008 06:40:48 +0000 (07:40 +0100)]
signal.c: Cosmetics.
Andre Noll [Mon, 17 Mar 2008 06:36:40 +0000 (07:36 +0100)]
Kill unused error code SIGNAL_READ.
Andre Noll [Mon, 17 Mar 2008 06:34:29 +0000 (07:34 +0100)]
Fix para_next_signal().
The function returned zero in case of errors..
Andre Noll [Sun, 16 Mar 2008 13:16:17 +0000 (14:16 +0100)]
Let the daemon option depend on the logfile option.
This allows to remove the check in server.c.
Andre Noll [Sun, 16 Mar 2008 13:12:11 +0000 (14:12 +0100)]
More detailed and much nicer para_server man page.
Andre Noll [Sat, 15 Mar 2008 18:12:32 +0000 (19:12 +0100)]
afh.c: Use write_all() instead of write().
Andre Noll [Sat, 15 Mar 2008 18:09:53 +0000 (19:09 +0100)]
Move write_all() from net.c to fd.c.
This way it can be used also for programs that don't need
networking.
Andre Noll [Sat, 15 Mar 2008 18:06:22 +0000 (19:06 +0100)]
net.c: Rename sendall() to write_all().
It actually uses write(), not send().
Andre Noll [Sat, 15 Mar 2008 18:03:18 +0000 (19:03 +0100)]
Implement streaming mode for para_afh.
Andre Noll [Sat, 15 Mar 2008 18:02:27 +0000 (19:02 +0100)]
Move the get_chunk and the get_header functions from vss.c to afh.c.
Also move compute_chunk_time() to time.c.
Andre Noll [Fri, 14 Mar 2008 20:29:24 +0000 (21:29 +0100)]
Add missing files for para_afh.
It's too easy to miss with git..
Andre Noll [Fri, 14 Mar 2008 09:01:47 +0000 (10:01 +0100)]
Merge commit 'remotes/meins/master'
Andre Noll [Fri, 14 Mar 2008 08:33:37 +0000 (09:33 +0100)]
Add para_afh to web pages.
Andre Noll [Thu, 13 Mar 2008 23:16:54 +0000 (00:16 +0100)]
Get rid of E_BAD_AUDIO_FILE_SUFFIX.
It's value was never used.
Andre Noll [Thu, 13 Mar 2008 23:11:12 +0000 (00:11 +0100)]
Implement para_afh: The stand-alone audio file handler.
Andre Noll [Thu, 13 Mar 2008 23:07:20 +0000 (00:07 +0100)]
aft.c: Move definition of "buf" down a bit.
Andre Noll [Thu, 13 Mar 2008 21:33:03 +0000 (22:33 +0100)]
osl.c: Simplify comment.
Andre Noll [Thu, 13 Mar 2008 21:32:14 +0000 (22:32 +0100)]
afs.c: Cosmetic comment cleanup.
Andre Noll [Thu, 13 Mar 2008 21:08:33 +0000 (22:08 +0100)]
configure.ac: para_audiod is optional.
So add it only to all_executables if at least one audio
format is supported.
Andre Noll [Thu, 13 Mar 2008 15:49:58 +0000 (16:49 +0100)]
Fix documentation of select command.
As pointed out by Gerrit Renker, the help text still used the old
syntax that changed in
f010019b9e89b814699bd6a94edaa8cde9cbd45c
Andre Noll [Wed, 12 Mar 2008 21:57:24 +0000 (22:57 +0100)]
Add new ls option: -lc to print out the chunk table.
Andre Noll [Sat, 23 Feb 2008 19:27:46 +0000 (20:27 +0100)]
new codename, reset version to git
Andre Noll [Sat, 23 Feb 2008 19:22:08 +0000 (20:22 +0100)]
the paraslash-0.3.1 release tarball
Andre Noll [Sat, 23 Feb 2008 19:19:05 +0000 (20:19 +0100)]
paraslash 0.3.1
Andre Noll [Sat, 23 Feb 2008 19:18:39 +0000 (20:18 +0100)]
para.h: Change copyright year to 2008.
Andre Noll [Mon, 18 Feb 2008 00:42:16 +0000 (01:42 +0100)]
FEATURES: Fix a typo and use uniform capitalization for list items.
Andre Noll [Mon, 18 Feb 2008 00:28:26 +0000 (01:28 +0100)]
NEWS update.
Andre Noll [Mon, 18 Feb 2008 00:28:03 +0000 (01:28 +0100)]
string.c: Fix a typo.
Andre Noll [Sun, 17 Feb 2008 21:13:13 +0000 (22:13 +0100)]
server.c: Add missing newline in log message.
Andre Noll [Sun, 17 Feb 2008 21:12:39 +0000 (22:12 +0100)]
Kill superfluous "%s" in log messages.
Andre Noll [Sun, 17 Feb 2008 21:01:46 +0000 (22:01 +0100)]
osl_core: Fix some typos in documentation.
Andre Noll [Sun, 17 Feb 2008 20:55:19 +0000 (21:55 +0100)]
server.c: Clarify fatal log message.
And kill the superfluous "%s" parameter.
Andre Noll [Sun, 17 Feb 2008 20:54:02 +0000 (21:54 +0100)]
daemon.c: Minor logging impreovments.
Andre Noll [Sun, 17 Feb 2008 20:53:21 +0000 (21:53 +0100)]
Be more careful in daemon_init().
setsid(), chdir() and dup2() all may fail. So check the
return value.
Andre Noll [Sun, 17 Feb 2008 20:52:21 +0000 (21:52 +0100)]
audiod.c: Don't log to /dev/null.
There's no point in computing the log message if we are
going to write it to /dev/null.
Andre Noll [Sun, 17 Feb 2008 13:14:10 +0000 (14:14 +0100)]
Add documentation of struct sender status.
Andre Noll [Sat, 16 Feb 2008 19:25:48 +0000 (20:25 +0100)]
com_touch(): Print a message if no audio files matched.
Andre Noll [Sat, 16 Feb 2008 19:25:10 +0000 (20:25 +0100)]
Doxify send_common.c.
Andre Noll [Sat, 16 Feb 2008 14:33:50 +0000 (15:33 +0100)]
Sender code consolidation, on/off commands for the dccp sender.
This patch moves a bunch of code from the http sender to
send_common.c to make it available also for the dccp sender.
To this aim a new structure sender_status is introduced which
holds the configuration and the current status of the http/dccp
sender. Most of the new functions in send_common.c take a pointer
to such a structure.
This allows to implement the off/on/allow/deny/info commands
as a one-liner for both the dccp and the http sender.
The new server config option dccp_max_clients allows to restrict the
number of simultaneous connections to the dccp sender.
Andre Noll [Wed, 13 Feb 2008 18:36:08 +0000 (19:36 +0100)]
acl.c: Trivial whitespace cleanups.
Andre Noll [Mon, 11 Feb 2008 19:33:50 +0000 (20:33 +0100)]
user_list: Fix doxygen \param.
Andre Noll [Mon, 11 Feb 2008 19:33:20 +0000 (20:33 +0100)]
init_random_seed(): Use para_open() to open /dev/urandom.
Clean up this function while at it.
Andre Noll [Mon, 11 Feb 2008 19:32:17 +0000 (20:32 +0100)]
Doxyfile: Remove HAVE_MYSQL define.
Andre Noll [Mon, 11 Feb 2008 19:31:52 +0000 (20:31 +0100)]
Remove duplicate error code.
We had AFS_SHORT_READ and SHORT_AFS_READ.
Andre Noll [Sun, 10 Feb 2008 13:30:30 +0000 (14:30 +0100)]
Remove para_mkstemp().
It's unused.
Andre Noll [Sun, 10 Feb 2008 13:20:36 +0000 (14:20 +0100)]
NEWS update.
Andre Noll [Sun, 10 Feb 2008 13:20:09 +0000 (14:20 +0100)]
Speed up audiod_pre_select.
Catch the common case early in the function to minimize the
number of checks for that case.
Andre Noll [Sun, 10 Feb 2008 13:19:02 +0000 (14:19 +0100)]
compress.c: Get rid of min_gain.
Always use no amplification, i.e. 1 << pcd->conf->inertia_arg as
the minimal gain.
Andre Noll [Sun, 10 Feb 2008 13:17:25 +0000 (14:17 +0100)]
string.c: Documentation cleanups.
Andre Noll [Sun, 10 Feb 2008 13:16:42 +0000 (14:16 +0100)]
Get rid of E_MKSTEMP and E_FCHMOD.
Use the system errno instead.
Andre Noll [Sun, 10 Feb 2008 11:49:29 +0000 (12:49 +0100)]
Speed up open_current_receiver().
To my surprise, this function showed up in the profiling info.
This is due to the fact that the old code was parsing the
FORMAT status item in audiod_pre_select() which gets called
on each iteration of the sheduler. However, this status item
gets only modified on audio file change.
So parse the status item string only once, when we receive it,
and store the current audio format number in the new field of
struct status_task.
Andre Noll [Sat, 9 Feb 2008 19:33:36 +0000 (20:33 +0100)]
compress_filter.ggo: Decrease block size from 16 to 15.
This means twice as many volume adjustments.
Andre Noll [Sat, 9 Feb 2008 19:32:36 +0000 (20:32 +0100)]
compress.c: Simplify volume adjusting code.
There's no need to distinguish the cases sample > 0 and
sample < 0. Work with its absolute value instead and get
rid of some similar code in the hot path.
Also print a log message in case clipping occurs.
Andre Noll [Sat, 9 Feb 2008 18:53:28 +0000 (19:53 +0100)]
compress.c: Cosmetics.
Andre Noll [Sat, 9 Feb 2008 18:42:05 +0000 (19:42 +0100)]
user_list.c: Minor documentation impreovements.