paraslash.git
14 years agopara_client: use the error subsystem
Andre [Tue, 6 Jun 2006 08:33:17 +0000 (10:33 +0200)]
para_client: use the error subsystem

14 years agoclient: always log to stderr
Andre [Tue, 6 Jun 2006 06:10:16 +0000 (08:10 +0200)]
client: always log to stderr

14 years agodccp_send/http_send: add all fds to close_on_fork_list
Andre [Tue, 6 Jun 2006 01:01:59 +0000 (03:01 +0200)]
dccp_send/http_send: add all fds to close_on_fork_list

This caused para_audiod not to recognize the receiver eof because a
child of the server still had the peer fd open. Nasty.

14 years agostruct writer: kill unused write_pointer and update documentation
Andre [Tue, 6 Jun 2006 00:23:10 +0000 (02:23 +0200)]
struct writer: kill unused write_pointer and update documentation

The file writer even had an implementation of the unused write function.

14 years agoaudiod: kill is_frozen() test
Andre [Tue, 6 Jun 2006 00:05:32 +0000 (02:05 +0200)]
audiod: kill is_frozen() test

Just compute the time difference in open_current_receiver()
and set the scheduler timeout accordingly if neccessary.

14 years agofix multiple simultaneous writers
Andre [Mon, 5 Jun 2006 23:13:11 +0000 (01:13 +0200)]
fix multiple simultaneous writers

This broke during the integration of the writers into para_audiod
was was noticed only recently.

14 years agosimplify writer node group
Andre [Mon, 5 Jun 2006 20:51:43 +0000 (22:51 +0200)]
simplify writer node group

It's not neccessary to register a task for each writer in the wng.
So use only one task for the wng that calls the writer's pre_select()
and post_select().

14 years agosched: nuke "flag" field of struct task
Andre [Mon, 5 Jun 2006 19:46:17 +0000 (21:46 +0200)]
sched: nuke "flag" field of struct task

It is unused. Kill PRE_ADD_TAIL and POST_ADD_TAIL too.

14 years agoget_task_list(): construct a more detailed list
Andre [Mon, 5 Jun 2006 19:41:15 +0000 (21:41 +0200)]
get_task_list(): construct a more detailed list

14 years agodo not ignore SIGPIPE
Andre [Mon, 5 Jun 2006 19:40:10 +0000 (21:40 +0200)]
do not ignore SIGPIPE

this _might_ solve problems with hanging audiod process. Also, mention the
name of the receiver in the task status.

14 years agoalsa_writer pre_select: Only set a small timeout if really neccessary.
Andre [Mon, 5 Jun 2006 19:38:17 +0000 (21:38 +0200)]
alsa_writer pre_select: Only set a small timeout if really neccessary.

14 years agogttp_send: kill http_shutdown_clients_real()
Andre [Mon, 5 Jun 2006 19:18:16 +0000 (21:18 +0200)]
gttp_send: kill http_shutdown_clients_real()

as it is identical to http_shutdown_clients().

14 years agohttp_send: shutdown clients even if status is not yet HTTP_STREAMING
Andre [Sun, 4 Jun 2006 23:36:58 +0000 (01:36 +0200)]
http_send: shutdown clients even if status is not yet HTTP_STREAMING

It's better to let the client reconnect than to send a stream it did not
expect. Clean up a superfluous return statement.

14 years agowrite_common: get rid of POST_ADD_TAIL
Andre [Sun, 4 Jun 2006 23:32:34 +0000 (01:32 +0200)]
write_common: get rid of POST_ADD_TAIL

just register the tasks the other way round.

14 years agoMore audiod fixes
Andre [Sun, 4 Jun 2006 20:59:38 +0000 (22:59 +0200)]
More audiod fixes

The bug-quality rises. This patch fixes

the select timeout after receiver open. As the pre_select
function of the receiver just opened will be called _after_
the upcoming select call, we might block for the time of that
call. Only afterwards, the receiver can change the timeout. Fix
this problem by changing the timeout to a minimum from within
start_receiver() (which gets called by audiod_pre_select()).

Resume on server restart. This was broken by design as it
used sleep() and also caused problems with the alsa writer
being restarted too early. We can do much better with the
new scheduler, so introduce a new field "restart_barrier" in
struct status_task and restart para_client and the receivers
not before this time.

Also, set the default timeout to a ridiculous value to detect further
timeout problems and do not kill the decoders even if the status pipe
went south.

14 years agofilter_chain: Don't return eof too early
Andre [Sun, 4 Jun 2006 19:52:00 +0000 (21:52 +0200)]
filter_chain: Don't return eof too early

The current code may miss to transform the remaining buffer if the
receiver has already deactivated its task. Check for the number of
loaded bytes in the input buffer of the filter chain and return eof
only if nothing is loaded.

14 years agoadd some debugging to fd.c
Andre [Sun, 4 Jun 2006 19:48:34 +0000 (21:48 +0200)]
add some debugging to fd.c

Detect an invalid fd if passed to para_fd_set and abort in this case.
A typical "values of beta will cause dom!" candidate.

14 years agokill some dead code
Andre [Sun, 4 Jun 2006 19:45:21 +0000 (21:45 +0200)]
kill some dead code

if pdd is NULL, we have more serious problems, so kill the check.

14 years agosome audiod fixes
Andre [Sun, 4 Jun 2006 19:44:17 +0000 (21:44 +0200)]
some audiod fixes

comment out code for unregistering the receiver node from close_receiver.

kill all decoders if !playing

try to close slots in audiod_post_select() rather than in pre_select().
This should fix BADFD error from select().

14 years agohttp_recv/dccp_recv: simplify post_select()
Andre [Thu, 1 Jun 2006 20:12:47 +0000 (22:12 +0200)]
http_recv/dccp_recv: simplify post_select()

14 years agosched/audiod feature: task list and kill
Andre [Thu, 1 Jun 2006 17:54:45 +0000 (19:54 +0200)]
sched/audiod feature: task list and kill

This allows to control the internal state of the scheduler.

14 years agotrivial loglevel adjustements
Andre [Thu, 1 Jun 2006 03:18:31 +0000 (05:18 +0200)]
trivial loglevel adjustements

14 years agohttp_recv: set the eof flag on buffer overruns.
Andre [Wed, 31 May 2006 21:04:14 +0000 (23:04 +0200)]
http_recv: set the eof flag on buffer overruns.

14 years agoFix wng_open error handling.
Andre [Wed, 31 May 2006 21:03:19 +0000 (23:03 +0200)]
Fix wng_open error handling.

if wn->open() failed, undo all work and set the eof flag in the wng.

14 years agoalsa_writer: use non-blocking open mode.
Andre [Wed, 31 May 2006 21:01:08 +0000 (23:01 +0200)]
alsa_writer: use non-blocking open mode.

fixes hangs in para_audiod.

14 years agofix dccp sender/receiver
Andre [Wed, 31 May 2006 02:38:56 +0000 (04:38 +0200)]
fix dccp sender/receiver

the server side broke during the afs header cleanup, the client side
had a fatal pointer bug and missed to set the return value in its
pre_select function.

14 years agofix audiod on/off/sb commands
Andre [Tue, 30 May 2006 01:23:11 +0000 (03:23 +0200)]
fix audiod on/off/sb commands

Unregister all running tasks in all running slots. That's much
cleaner than using the dirty hack with rn->eof we had before.

14 years agomore audiod fixes
Andre [Tue, 30 May 2006 00:49:10 +0000 (02:49 +0200)]
more audiod fixes

introduce output_eof in struct receiver_node to give the receivers
a chance to see if the connected consumer of the receiver data
died in case of an error.

Some eof fixes and cleanups also on the writer side.

We're coming closer.

14 years agoalsa_writer: switch back to buffer_time-based timeout calculation
Andre [Tue, 30 May 2006 00:40:04 +0000 (02:40 +0200)]
alsa_writer: switch back to buffer_time-based timeout calculation

Fixes alsa software mixing

14 years agoaudio: fix handling of sample_rate and channels count.
Andre [Mon, 29 May 2006 23:05:54 +0000 (01:05 +0200)]
audio: fix handling of sample_rate and channels count.

This was utterly broken for both para_write and para_audiod as
the writer didn't have a chance to see the computed value from
the filter/wav header.

Fix it by introducing two new pointers in struct writer_node_group
which point to the corresponding variables in struct
filter/check_wav_task.

Tested with 22KHz mono files.

14 years agowng: fix two critical bugs
Andre [Mon, 29 May 2006 22:56:35 +0000 (00:56 +0200)]
wng: fix two critical bugs

the open functions of the writers in a writer node group
might be interested to know which group they belong to.
Unfortunately, the old code called open before initializing
the "wng" pointer of the writer node.

The second bug triggers for example if invalid receiver options are
given. In this case wng_close() is called with a NULL-argument as
the wng has not been opened yet. The solution is to check for NULL
pointers and return immediately in this case.

14 years agoaacdec: detect buffer overrun and return an errror.
Andre [Mon, 29 May 2006 22:51:32 +0000 (00:51 +0200)]
aacdec: detect buffer overrun and return an errror.

Also, increase the output buffer size and don't try to decode
if the output buffer is already filled at least 60%.

14 years agoMerge branch 'sched'
Andre [Mon, 29 May 2006 02:18:16 +0000 (04:18 +0200)]
Merge branch 'sched'

14 years agocosmetics
Andre [Mon, 29 May 2006 02:13:34 +0000 (04:13 +0200)]
cosmetics

14 years agomore audiod improvements
Andre [Mon, 29 May 2006 02:05:10 +0000 (04:05 +0200)]
more audiod improvements

Make cmd_task and audiod_task local, add more documentation and fix the
eof handling of the ortp receiver.

14 years agoaudiod: remove bogus check_timeouts()
Andre [Mon, 29 May 2006 01:04:53 +0000 (03:04 +0200)]
audiod: remove bogus check_timeouts()

With the new scheduler, audiod doesn't really know any more,
the number of transfered bytes. So kill that code for now.

14 years agoaudiod: clean up wng_event_handler()
Andre [Mon, 29 May 2006 00:52:22 +0000 (02:52 +0200)]
audiod: clean up wng_event_handler()

It should only unregister the wng task. closing is done from
close_decoder_if_idle(), an ugly name. Rename this function to
try_to_close_slot().

14 years agofix writer node group eof
Andre [Mon, 29 May 2006 00:27:08 +0000 (02:27 +0200)]
fix writer node group eof

The old code did not set the eof flag at all. This patch fixes the problem
and contains also some loglevel and log message text improvements.

14 years agoaudiod: fix nasty thinko
Andre [Sun, 28 May 2006 23:19:20 +0000 (01:19 +0200)]
audiod: fix nasty thinko

"ret" was used where "writer_num" is correct. This makes the "-w" option
of para_audiod work again. Fix another typo too.

14 years agoMinor random fixes.
Andre [Sun, 28 May 2006 22:05:16 +0000 (00:05 +0200)]
Minor random fixes.

gcc is happy now.

14 years agotypo
Andre [Sun, 28 May 2006 21:30:51 +0000 (23:30 +0200)]
typo

14 years agoaudiod help update.
Andre [Sun, 28 May 2006 21:13:47 +0000 (23:13 +0200)]
audiod help update.

14 years agoalsa_writer: use alsa's buffer time
Andre [Sun, 28 May 2006 21:07:12 +0000 (23:07 +0200)]
alsa_writer: use alsa's buffer time

to compute the time of the next chunk. Also, activate non-blocking mode.

14 years agoFix default filter setup
Andre [Sun, 28 May 2006 20:51:16 +0000 (22:51 +0200)]
Fix default filter setup

The previous patch broke it.

14 years agomore small audiod cleanups.
Andre [Sun, 28 May 2006 20:03:38 +0000 (22:03 +0200)]
more small audiod cleanups.

nothing exciting here.

14 years agoaudiod: get rid of all calls to gettimeofday().
Andre [Sun, 28 May 2006 19:53:57 +0000 (21:53 +0200)]
audiod: get rid of all calls to gettimeofday().

Use a global variable instead that gets updated from within
audio_pre_select() and audiod_post_select().

14 years agoaudiod: split init_stream_io()
Andre [Sun, 28 May 2006 19:35:51 +0000 (21:35 +0200)]
audiod: split init_stream_io()

It consists of three independent parts.

14 years agoOpen the filters from within audiod_pre_select()
Andre [Sun, 28 May 2006 19:12:35 +0000 (21:12 +0200)]
Open the filters from within audiod_pre_select()

14 years agoaudiod: avoid another gettimeofday() call
Andre [Sun, 28 May 2006 19:05:49 +0000 (21:05 +0200)]
audiod: avoid another gettimeofday() call

The sched struct already contains the current time.

14 years agoaudiod: kill close_writer()
Andre [Sun, 28 May 2006 18:59:39 +0000 (20:59 +0200)]
audiod: kill close_writer()

This is better handled by the wng event handler.

14 years agoaudiod: kill some dead code
Andre [Sun, 28 May 2006 18:51:01 +0000 (20:51 +0200)]
audiod: kill some dead code

14 years agointegrate writers into para_audiod
Andre [Sun, 28 May 2006 18:49:05 +0000 (20:49 +0200)]
integrate writers into para_audiod

Seems to work, but might still be full of bugs.

14 years agoannounce upcoming features
Andre [Sun, 28 May 2006 15:42:27 +0000 (17:42 +0200)]
announce upcoming features

14 years agoconfigure.ac: add writer objects to para_audiod.
Andre [Sun, 28 May 2006 05:35:13 +0000 (07:35 +0200)]
configure.ac: add writer objects to para_audiod.

14 years agopara_write: Own commandline parsers for each writer
Andre [Fri, 26 May 2006 14:48:15 +0000 (16:48 +0200)]
para_write: Own commandline parsers for each writer

14 years agoconvert para_audiod to the new scheduler.
Andre [Thu, 25 May 2006 21:57:48 +0000 (23:57 +0200)]
convert para_audiod to the new scheduler.

As expected, this was a bit harder. It works, but I'm sure there are
plenty of bugs left. Fortnunately, this doesn't matter much right now,
because the next step will be the integration of the writers into the
para_audiod executable. This will lead to major code simplifications,
so let's defer the bug-hunting until this integration is complete.

14 years agointroduce input_eof and ouput_eof
Andre [Thu, 25 May 2006 13:53:00 +0000 (15:53 +0200)]
introduce input_eof and ouput_eof

para_filter/para_audiod needs this. For example, it is pointless to
convert more audiod data if the writing application is no longer active.

14 years agoconvert para_filter to the new scheduler
Andre [Thu, 25 May 2006 12:49:03 +0000 (14:49 +0200)]
convert para_filter to the new scheduler

This was again straight forward.

14 years agorename struct filter_chain_info to filter_chain
Andre [Wed, 24 May 2006 01:45:28 +0000 (03:45 +0200)]
rename struct filter_chain_info to filter_chain

14 years agoMake para_recv use the new scheduler.
Andre [Wed, 24 May 2006 01:29:27 +0000 (03:29 +0200)]
Make para_recv use the new scheduler.

This was pretty straight-forward, but it broke audiod badly. The plan
is first to convert para_filter, then para_audiod. It this works out well,
para_server will be converted as well.

14 years agoerror.h: kill some unused errors
Andre [Tue, 23 May 2006 22:23:21 +0000 (00:23 +0200)]
error.h: kill some unused errors

14 years agoRename error handler() to event_handler()
Andre [Tue, 23 May 2006 21:49:31 +0000 (23:49 +0200)]
Rename error handler() to event_handler()

14 years agosimplify sched: nuke PRE_EOF_IS_ERROR
Andre [Tue, 23 May 2006 21:45:42 +0000 (23:45 +0200)]
simplify sched: nuke PRE_EOF_IS_ERROR

Much too simple to get it wrong. Instead, treat zero as success and
make all tasks return negative if they wish to have their error handler
called. A subsequent patch will rename error_handler to event_handler.

14 years agocheck_wav: return error on premature end of file.
Andre [Tue, 23 May 2006 18:47:31 +0000 (20:47 +0200)]
check_wav: return error on premature end of file.

14 years agoMake the wng->eof a pointer.
Andre [Tue, 23 May 2006 18:27:23 +0000 (20:27 +0200)]
Make the wng->eof a pointer.

The receiver/stdin_reader already have a corresponding field.

This patch also fixes a bug in the alsa_writer which was introduced
by the previous patch. This bug caused a playback delay of one second.

14 years agofirst version of the universal paraslash scheduler
Andre [Tue, 23 May 2006 17:27:08 +0000 (19:27 +0200)]
first version of the universal paraslash scheduler

14 years agofix serious typo
Andre [Fri, 19 May 2006 12:12:27 +0000 (14:12 +0200)]
fix serious typo

That max should actually be a min..

14 years agoerror.h: new macro SS_NAME
Andre [Thu, 18 May 2006 15:07:43 +0000 (17:07 +0200)]
error.h: new macro SS_NAME

expands to the name of the given subsystem.

14 years agoafs.c: fix documentation of afs_preselect()
Andre [Thu, 18 May 2006 12:42:05 +0000 (14:42 +0200)]
afs.c: fix documentation of afs_preselect()

14 years agomp3_afh.c/ogg_afh.c: fix doxygen file documentation
Andre [Wed, 17 May 2006 20:41:51 +0000 (22:41 +0200)]
mp3_afh.c/ogg_afh.c: fix doxygen file documentation

14 years agorename mp3.c to mp3_afh.c and ogg.c to ogg_afh.c
Andre [Wed, 17 May 2006 19:47:27 +0000 (21:47 +0200)]
rename mp3.c to mp3_afh.c and ogg.c to ogg_afh.c

14 years agosplit afs.h
Andre [Wed, 17 May 2006 19:38:52 +0000 (21:38 +0200)]
split afs.h

move the audio format handler stuff to the new afh.h header file
which isn't included by any of the senders.

14 years agomajor afs cleanup
Andre [Wed, 17 May 2006 19:22:59 +0000 (21:22 +0200)]
major afs cleanup

This patch  makes afs.c the only user of the audio format handler
arry afl[] in order to completely separate audio format handling from
audio file sending.

This is achieved by providing the new helper functions afs_get_header()
and afs_chunk_time(). audio file senders may call these functions
without knowledge of struct audio_format. This allows to get rid of
the "af" parameter for the pre_select and post_select functions of
struct sender.

Related to this cleanup is the removal of match_audio_file_name() from db.c
which also depended on afl[]. This function was essentially identical to
afs.c's guess_audio_format(), so make the latter public and use it from
within db.c.

14 years agoaac audio format handler: fix end of file timeout
Andre [Wed, 17 May 2006 19:00:26 +0000 (21:00 +0200)]
aac audio format handler: fix end of file timeout

20 x chunk_time is plenty, but lets be conservative here.

14 years agofix audiod command line option handling.
Andre [Wed, 17 May 2006 15:39:31 +0000 (17:39 +0200)]
fix audiod command line option handling.

The previous patch broke this.

14 years agoupdate grab_client_new() documentation
Andre [Wed, 17 May 2006 13:57:58 +0000 (15:57 +0200)]
update grab_client_new() documentation

14 years agograb: use grab_client_cmdline_parser_string()
Andre [Tue, 16 May 2006 19:38:04 +0000 (21:38 +0200)]
grab: use grab_client_cmdline_parser_string()

No more need to use split_args().

14 years agoMake aac work with any bitrate.
Andre [Tue, 16 May 2006 16:38:18 +0000 (18:38 +0200)]
Make aac work with any bitrate.

By replacing the hardcoded 23ms timeout by a timeout
computed from the audio spec config.

14 years agoafs.c: Fix 'initialization from incompatible pointer type warning'
Andre [Sun, 14 May 2006 02:04:01 +0000 (04:04 +0200)]
afs.c: Fix 'initialization from incompatible pointer type warning'

These were missed by the previous patch.

14 years agostruct audio_format_handler: use proper pointer type for the init function
Andre [Sun, 14 May 2006 01:48:07 +0000 (03:48 +0200)]
struct audio_format_handler: use proper pointer type for the init function

14 years agoweb/download text update
Andre [Sun, 14 May 2006 00:42:56 +0000 (02:42 +0200)]
web/download text update

14 years agoimproved info status items for the playlist selector
Andre [Sat, 13 May 2006 23:45:21 +0000 (01:45 +0200)]
improved info status items for the playlist selector

With this patch, the three "dbinfo" status items contain the current
dir, the number of entries in the playlist, and the previous/next
entry in the list.

14 years agoimproved info text for the random selector.
Andre [Sat, 13 May 2006 22:06:02 +0000 (00:06 +0200)]
improved info text for the random selector.

It now reports random_dir, the dir of the current audio file and
the number of audio files found in random_dir.

14 years agorandom/mysql selector: make it find m4a files
Andre [Sat, 13 May 2006 21:18:44 +0000 (23:18 +0200)]
random/mysql selector: make it find m4a files

This is achieved by adding an array of typical suffixes
for the audio format to struct audio_format_handler.

14 years agoRename struct audio format to audio_format_handler
Andre [Sat, 13 May 2006 20:46:34 +0000 (22:46 +0200)]
Rename struct audio format to audio_format_handler

14 years agofix audiod decoder flags for aac
Andre [Sat, 13 May 2006 20:26:55 +0000 (22:26 +0200)]
fix audiod decoder flags for aac

Do not try to encode the audio format in a single digit. Just use

0: off
1: receiver activated
2: writer started
3: receiver activated and writer is running

regardless of the audio format.

14 years agofix init message of the playlist selector.
Andre [Sat, 13 May 2006 20:20:54 +0000 (22:20 +0200)]
fix init message of the playlist selector.

The prefix "dbinfo1:" was missing.

14 years agoadd a close function for the aac audio format handler.
Andre [Sat, 13 May 2006 20:01:36 +0000 (22:01 +0200)]
add a close function for the aac audio format handler.

Without this, we're leaking one fd per audio file...

14 years agoKill duplicate para_fread()
Andre [Sat, 13 May 2006 19:55:51 +0000 (21:55 +0200)]
Kill duplicate para_fread()

This was contained in aac_afh.c as well as in mp3.c. Move it
to fd.c and add documentation.

14 years agodocumentation update
Andre [Sat, 13 May 2006 19:38:39 +0000 (21:38 +0200)]
documentation update

mention aac and clarify the audiod section in INSTALL

14 years agoMinor aac cleanup
Andre [Sat, 13 May 2006 17:19:28 +0000 (19:19 +0200)]
Minor aac cleanup

Use size_t and ssize_t rather than a mixture of several other types.
This also makes gcc on Darwin STFU.

14 years agoaac afh: do not send the huge audio file header
Andre [Sat, 13 May 2006 16:37:45 +0000 (18:37 +0200)]
aac afh: do not send the huge audio file header

14 years agoaac: error cleanup
Andre [Sat, 13 May 2006 05:09:52 +0000 (07:09 +0200)]
aac: error cleanup

put each aac-related error message to its proper subsystem

14 years agoaac: add GPL headers to all files
Andre [Sat, 13 May 2006 04:35:34 +0000 (06:35 +0200)]
aac: add GPL headers to all files

and some other minor cleanups.

14 years agoaac: move aac_find_stsz from aac_common.c to to aac_afh.c
Andre [Sat, 13 May 2006 04:20:17 +0000 (06:20 +0200)]
aac: move aac_find_stsz from aac_common.c to to aac_afh.c

It is only used there.

14 years agoaac: make find_stco() return the first offset
Andre [Sat, 13 May 2006 04:07:22 +0000 (06:07 +0200)]
aac: make find_stco() return the first offset

rather than the number of offsets which is rather uninteresting.
Also, rename this function to aac_find_entry() and return the
correct number of frames to para_server.

14 years agoSome more aacdec cleanups
Andre [Sat, 13 May 2006 03:35:14 +0000 (05:35 +0200)]
Some more aacdec cleanups

rename the "decoder" field to "handle" as it is of type NeAACDecHandle.
Fix some typos in comments and make two more variables local.

14 years agoaacdec: Rename some functions
Andre [Sat, 13 May 2006 03:23:31 +0000 (05:23 +0200)]
aacdec: Rename some functions

14 years agoaacdec: "consumed" is only used in mp4dec()
Andre [Sat, 13 May 2006 03:21:56 +0000 (05:21 +0200)]
aacdec: "consumed" is only used in mp4dec()

Remove it from struct private_aacdec_data.

14 years agoaacdec: inbuf and inbuf_len are only used in mp3dec()
Andre [Sat, 13 May 2006 03:14:45 +0000 (05:14 +0200)]
aacdec: inbuf and inbuf_len are only used in mp3dec()

No need to keep them around in the private_data struct.