paraslash.git
13 years agoMinor makesock() fixes.
Andre Noll [Sun, 10 Oct 2010 16:51:17 +0000 (18:51 +0200)]
Minor makesock() fixes.

On getaddrinfo() or setsockopt() errors, we leak the flowopts and/or
the local/remote address info structure. Fix this by jumping to the
cleanup section at the bottom of makesock() rather than returning
early without cleaning up.

Moreover, we can not rely on errno containing a valid error code in the
cleanup part of the function because flowopt_cleanup() calls free()
which usually resets errno. So use the error code provided via "rc"
if possible and fall back to the new -E_MAKESOCK if rc is non-negative
to make sure we return a negative value on errors.

13 years agoNEWS update.
Andre Noll [Sun, 14 Nov 2010 14:35:33 +0000 (15:35 +0100)]
NEWS update.

13 years agoMerge branch 't/server_optional'
Andre Noll [Sun, 14 Nov 2010 14:32:45 +0000 (15:32 +0100)]
Merge branch 't/server_optional'

13 years agomanual: Add a section on rebuild of the "next" branch.
Andre Noll [Sun, 31 Oct 2010 12:20:30 +0000 (13:20 +0100)]
manual: Add a section on rebuild of the "next" branch.

13 years agoNEWS update.
Andre Noll [Sun, 31 Oct 2010 11:59:11 +0000 (12:59 +0100)]
NEWS update.

13 years agoMake build of para_server optional.
Andre Noll [Sun, 12 Sep 2010 21:30:59 +0000 (23:30 +0200)]
Make build of para_server optional.

para_server is the only executables which requires libosl, so do not consider
it a fatal error if libosl could not be located. This allows to build the
paraslash package for example on client-only machines which do not need
para_server anyway.

13 years agovss: Avoid potential double free of FEC parameters.
Andre Noll [Mon, 16 Aug 2010 07:29:59 +0000 (09:29 +0200)]
vss: Avoid potential double free of FEC parameters.

If an error occurs in initialize_fec_client() we free the FEC parameter
structure but do not invalidate it. It's both easier and safer to
free this struct just before allocating it.

13 years agoIntroduce per group slice sizes.
Andre Noll [Sat, 7 Aug 2010 16:36:45 +0000 (18:36 +0200)]
Introduce per group slice sizes.

While the FEC parameters k and n are fixed, the size of a FEC slice may
be different for each FEC group. This patch exploits this freedom and
implements variable sized FEC slices for the DCCP and UDP transports.

Two new functions, compute_group_size() and compute_slice_size(),
are introduced which try to compute an optimal size for the entire
FEC group and the slice size of the group respectively.

The group size is chosen such that the group duration is approximately
150ms. Larger values cause too much latency while smaller groups use
the available bandwidth ineffectively. Several contraints such as
the maximal packet size are taken into account when computing the
group size.

Once the group size is known, a suitable slice size is chosen. It
should be as small as possible to avoid unnecessary FEC calculations
but must be large enough to guarantee that the k data slices suffice
to encode the header (if needed) and the data chunk(s).

13 years agovss: need_audio_header(): Change return value to bool.
Andre Noll [Sat, 7 Aug 2010 16:33:04 +0000 (18:33 +0200)]
vss: need_audio_header(): Change return value to bool.

Obviously an equivalent transformation.

13 years agoCompute the maximal chunk size only once.
Andre Noll [Sat, 7 Aug 2010 15:46:44 +0000 (17:46 +0200)]
Compute the maximal chunk size only once.

This patch adds the new field max_chunk_size to struct audio_file_data.
It is initialized in the afs process when the chunk table is saved,
just before the audio_file_data struct is passed to the server process.

The vss code benefits from this change since it can just use the
new information rather than calling afh_get_largest_chunk_size()
to recompute the maximal chunk size from scratch whenever a new
client connects.

Since vss.c was the only user of afh_get_largest_chunk_size(), we
may kill this function.

13 years agoReplace ROUND_UP by DIV_ROUND_UP and use it everywhere.
Andre Noll [Sat, 7 Aug 2010 15:07:12 +0000 (17:07 +0200)]
Replace ROUND_UP by DIV_ROUND_UP and use it everywhere.

13 years agoRemove FEC parameter max_slice_bytes.
Andre Noll [Sat, 24 Jul 2010 18:11:08 +0000 (20:11 +0200)]
Remove FEC parameter max_slice_bytes.

It is no longer a FEC parameter as its value is determined at runtime
from the MPS of the connection.

So replace ->max_slice_bytes of struct fec_client_parms by the new
->mps field of struct fec_client.

13 years agoSimplify vss_send().
Andre Noll [Sat, 24 Jul 2010 16:52:37 +0000 (18:52 +0200)]
Simplify vss_send().

13 years agoReplace check for stream_chunk < 0 by state == NONE.
Andre Noll [Sat, 24 Jul 2010 16:46:25 +0000 (18:46 +0200)]
Replace check for stream_chunk < 0 by state == NONE.

The two conditions are equivalent but the latter form is more readable.

13 years agoFEC initialization cleanups.
Andre Noll [Sat, 7 Aug 2010 14:50:59 +0000 (16:50 +0200)]
FEC initialization cleanups.

Initialization was performed in two steps: During vss_send and
during compute_next_fec_slice(). This patch moves the init code
for fec clients to the single location.

13 years agovss: Cleanup num_slices().
Andre Noll [Sat, 7 Aug 2010 14:45:41 +0000 (16:45 +0200)]
vss: Cleanup num_slices().

This makes num_slices() take ints rather than uint8_t arguments which
avoids nasty integer overflows and allows to drop the result parameter
since the result is now contained in the return value.

Moreover, num_slices() now takes the number of redundant slices as
an additional argument, so that this value has to be comuted only
once in the caller.

13 years agoNEWS update.
Andre Noll [Sun, 24 Oct 2010 11:58:12 +0000 (13:58 +0200)]
NEWS update.

13 years agoMerge branch 't/sched_cleanups'
Andre Noll [Sun, 17 Oct 2010 11:04:55 +0000 (13:04 +0200)]
Merge branch 't/sched_cleanups'

13 years agopara.h, recv.h: Move parts marked with \cond to bottom.
Andre Noll [Mon, 11 Oct 2010 20:38:38 +0000 (22:38 +0200)]
para.h, recv.h: Move parts marked with \cond to bottom.

This makes doxygen much happier as it does no longer spit out
tons of messages like

warning: documentation for unknown define VERSION_TEXT found.

13 years agoMerge remote branch 'refs/remotes/fml/master'
Andre Noll [Mon, 11 Oct 2010 19:21:57 +0000 (21:21 +0200)]
Merge remote branch 'refs/remotes/fml/master'

13 years agoudp_recv: Add missing line break in log messages.
Andre Noll [Mon, 11 Oct 2010 19:15:12 +0000 (21:15 +0200)]
udp_recv: Add missing line break in log messages.

Also reduce the line length a bit and fix a whitespace issue.

13 years agopara.h: Fix typo in comment.
Andre Noll [Mon, 11 Oct 2010 13:38:12 +0000 (15:38 +0200)]
para.h: Fix typo in comment.

13 years agoweb/download.html: Recommend downloading the snapshot tarball.
Andre Noll [Sun, 10 Oct 2010 20:02:14 +0000 (22:02 +0200)]
web/download.html: Recommend downloading the snapshot tarball.

Mention that the git tarball is a snapshot of the master branch and
is expected to be more stable than the released versions.

13 years agoNEWS update.
Andre Noll [Sun, 10 Oct 2010 19:43:52 +0000 (21:43 +0200)]
NEWS update.

13 years agodccp_send: Fix com_off().
Andre Noll [Sun, 10 Oct 2010 19:37:03 +0000 (21:37 +0200)]
dccp_send: Fix com_off().

This command made para_server sefgault due to the FEC client structure being
freed, but still used from vss.c. Fix this serious bug by first calling
dccp_shutdown_clients() which removes all FEC clients.

13 years agoaudiod: Handle crashes of para_server more robustly.
Andre Noll [Sun, 10 Oct 2010 19:32:58 +0000 (21:32 +0200)]
audiod: Handle crashes of para_server more robustly.

In case para_server dies unexpectedly, para_audiod may still have a partial status
item in the buffer tree node of the client task which can lead to a busy loop.

Fix this by flushing the input queue and invalidate the current audio format to prevent
recreating a buffer tree before the status task resumes.

There is already flush_input_queue() in buffer_tree.c but that can't be called by audiod.c
as it is a static function. Make it public and rename it to btr_drain() which is shorter and
more to the point and has the usual btr_ prefix.

13 years agoAdd missing documentation of moods_event_handler() and btr_free_node().
Andre Noll [Sun, 10 Oct 2010 16:17:53 +0000 (18:17 +0200)]
Add missing documentation of moods_event_handler() and btr_free_node().

13 years agoconnect_local_socket(): Silence noisy debug message.
Andre Noll [Tue, 5 Oct 2010 06:10:54 +0000 (08:10 +0200)]
connect_local_socket(): Silence noisy debug message.

13 years agosched: Use built-in instead of open-coded timeout helpers.
Andre Noll [Sun, 1 Aug 2010 17:56:10 +0000 (19:56 +0200)]
sched: Use built-in instead of open-coded timeout helpers.

In many places, sched_min_delay() or sched_request_timeout() are
open-coded.  Use the corresponding helpers from sched.c instead and
rename the "timeout" parameter of sched_request_timeout() to avoid
warnings on old gcc versions.

13 years agoImprove filter help text.
Andre Noll [Mon, 23 Aug 2010 13:25:07 +0000 (15:25 +0200)]
Improve filter help text.

- Mention that "efficient way" means zero-copy,

- Replace "filter options" by "options for a particular filter",

- Replace -f by --filter.

13 years agonet: Rename create_remote_socket() connect_local_socket().
Andre Noll [Mon, 23 Aug 2010 13:14:48 +0000 (15:14 +0200)]
net: Rename create_remote_socket() connect_local_socket().

It's all about local unix domain sockets, so avoid the word
"remote". Also, this function does not create the socket special
in /var/paraslash.

13 years agofade: Print the mixer device.
Andre Noll [Mon, 23 Aug 2010 11:39:16 +0000 (13:39 +0200)]
fade: Print the mixer device.

Otherwise the error "no such file" can be misleading.

13 years agoafh: Chunk numbers are zero-based.
Andre Noll [Tue, 17 Aug 2010 20:11:24 +0000 (22:11 +0200)]
afh: Chunk numbers are zero-based.

This makes the numbers match what para_server logs.

13 years agoFix an invalid-free-bug in the ogg audio format handler code.
Andre Noll [Mon, 9 Aug 2010 22:15:04 +0000 (00:15 +0200)]
Fix an invalid-free-bug in the ogg audio format handler code.

In process_ogg_packets(), if ogg_sync_pageout() fails, we jmp to
the out label where "stream" is being freed by ogg_stream_clear()
without being initialized.

This causes para_afh and para_server to segfault in libogg:

*** glibc detected *** para_afh: munmap_chunk(): invalid pointer: 0x6f890d42 ***
======= Backtrace: =========
/usr/lib/glibc/lib/libc.so.6(+0x66e5a)[0x6f712e5a]
/usr/lib/glibc/lib/libc.so.6(+0x68021)[0x6f714021]
/usr/local/lib/libogg.so.0(ogg_stream_clear+0x2f)[0x6f891adf]
para_afh[0x804cb52]
para_afh[0x804cbeb]
para_afh[0x804ce59]
para_afh[0x804be71]
para_afh[0x804a97c]
/usr/lib/glibc/lib/libc.so.6(__libc_start_main+0xd9)[0x6f6c2c79]
para_afh[0x8049991]

Fix this bug by returning the error code directly rather than jumping
to "out".

13 years agonew codename, reset version to git
Andre Noll [Fri, 6 Aug 2010 12:13:56 +0000 (14:13 +0200)]
new codename, reset version to git

13 years agothe paraslash-0.4.4 release tarball
Andre Noll [Fri, 6 Aug 2010 12:09:52 +0000 (14:09 +0200)]
the paraslash-0.4.4 release tarball

13 years agoparaslash 0.4.4 v0.4.4
Andre Noll [Fri, 6 Aug 2010 12:05:04 +0000 (14:05 +0200)]
paraslash 0.4.4

13 years agomanual: Minor cleanups.
Andre Noll [Mon, 2 Aug 2010 07:12:16 +0000 (09:12 +0200)]
manual: Minor cleanups.

- Mention that OGG/Speex also needs periodic audio file headers, reword
this sentence.

- para_write now understands formats != 16 bit, so remove this restriction also
from the documentation. Also mention that the sample format is being read from
the wav header, if present.

- Typo fix.

13 years agoFix typo in write_common.h.
Andre Noll [Sun, 1 Aug 2010 17:48:30 +0000 (19:48 +0200)]
Fix typo in write_common.h.

This makes doxygen happy again.

13 years agoRename some variables to avoid warnings on old gcc versions.
Andre Noll [Sun, 1 Aug 2010 17:46:32 +0000 (19:46 +0200)]
Rename some variables to avoid warnings on old gcc versions.

Fortunately, gcc-4 no longer warns on these. However, gcc-3.3 is still supported
for compiling paraslash, so rename "index" to "idx" and "conf" to "config" to get
rid of warnings of the form

wmadec_filter.c:1013: warning: declaration of `index' shadows a global declaration

Add documentation of ->free_config() while we're at it.

13 years agoNEWS update.
Andre Noll [Sun, 1 Aug 2010 17:38:33 +0000 (19:38 +0200)]
NEWS update.

13 years agoMerge branch 't/speex'
Andre Noll [Sun, 1 Aug 2010 11:26:42 +0000 (13:26 +0200)]
Merge branch 't/speex'

13 years agoMerge branch 't/error2'
Andre Noll [Sun, 1 Aug 2010 11:25:59 +0000 (13:25 +0200)]
Merge branch 't/error2'

13 years agoNEWS update
Andre Noll [Thu, 29 Jul 2010 18:55:12 +0000 (20:55 +0200)]
NEWS update

13 years agoMerge branch 't/bits_per_sample'
Andre Noll [Thu, 29 Jul 2010 18:52:06 +0000 (20:52 +0200)]
Merge branch 't/bits_per_sample'

13 years agoalsa: Add a missing "goto again" statement.
Andre Noll [Mon, 26 Jul 2010 11:02:56 +0000 (13:02 +0200)]
alsa: Add a missing "goto again" statement.

Without this the return value of btr_node_status() might be incorrect
as the wrong minimal input queue size was used.

13 years agoAdd a reference to the speex home page.
Andre Noll [Thu, 29 Jul 2010 16:25:41 +0000 (18:25 +0200)]
Add a reference to the speex home page.

Also mention the name of the speex Debian package.

13 years agoAdd missing documentation of rfds parameter of accept_sender_client().
Andre Noll [Tue, 27 Jul 2010 21:19:31 +0000 (23:19 +0200)]
Add missing documentation of rfds parameter of accept_sender_client().

Fixes

/home/work/maan/scm/paraslash/send_common.c:260: warning: The following parameters of accept_sender_client(struct sender_status *ss, fd_set *rfds) are not documented:
parameter 'rfds'

13 years agoaacdec: Fix a brown paper bag bug.
Andre Noll [Mon, 26 Jul 2010 11:05:42 +0000 (13:05 +0200)]
aacdec: Fix a brown paper bag bug.

Oops, we were using PARA_MAX() instead of PARA_MIN() to determine
the number of bytes to convert in the next run.  This silly bug could
lead to a segfault in the aacdec filter. Moreover, the assertion in
buffer_tree.c that would have caught the bug was _also_ b0rken.

But it's not my fault. I blame Grover of the Sesame street for both
bugs. He did explain the difference between near and far, although
this knowledge is next to useless for a programmer. And he did not
say a single word about MIN and MAX, or true and false. No wonder
such bugs happen.

13 years agoMake autoconf-2.66 happy.
Andre Noll [Mon, 5 Jul 2010 21:42:31 +0000 (23:42 +0200)]
Make autoconf-2.66 happy.

This removes more lines than it adds and avoids the following warning;

configure.ac:689: warning: AC_DEFINE_UNQUOTED: `
configure.ac:689:       result=
configure.ac:689:       for i in $status_items; do
configure.ac:689:               result="$result SI_$(echo $i | tr 'a-z' 'A-Z')' is not a valid preprocessor define value

13 years agoUse a perl script to create error2.h
Andre Noll [Sun, 4 Jul 2010 09:23:28 +0000 (11:23 +0200)]
Use a perl script to create error2.h

This is *much* faster than the shell code in configure. Perl is
required anyway for help2man, so this patch does not introduce
additional requirements on the build system.

13 years agoAdd support for the speex codec.
Andre Noll [Tue, 22 Jun 2010 22:53:46 +0000 (00:53 +0200)]
Add support for the speex codec.

This patch adds support for yet another audio format: speex, a
CELP-based codec designed for speech.

As speex is usually used in combination with the OGG container format,
we only support this combination. The new OGG/Speex audio format
handler provides a callback structure for the generic ogg code,
very similar to the OGG/Vorbis audio format handler.

The new speex code is split over three source files: spx_afh.c contains
the audio format handler, spxdec_filter.c the decoder and spx_common.c
common functions used by both audio format handler and decoder.

Many thanks to Jean-Marc Valin, the author of the reference
implementation of the speex decoder. Reusing parts of his code made
it easy to support speex within paraslash.

13 years agoogg: Separate ogg from vorbis code.
Andre Noll [Tue, 22 Jun 2010 21:14:03 +0000 (23:14 +0200)]
ogg: Separate ogg from vorbis code.

This moves vorbis-independent code from ogg_afh.c to the new file
ogg_afh_common.c so that it can be used also for the speex audio
format handler that is added by subsequent patches.

The patch introduces a generic callback structure which contains a
function pointer used to call back into the vorbis code once for each
of the three ogg packets of the audio file header.

13 years agoKill supported_audio_formats().
Andre Noll [Tue, 22 Jun 2010 20:00:28 +0000 (22:00 +0200)]
Kill supported_audio_formats().

It's kind of silly to have a function that just returns a constant string
which is known at compile time. Even more silly is to contruct this string
using an #ifdef for each optional audio format when we already
constructed the space-separated list of supported audio formats during
configure.

So just use AC_DEFINE_UNQUOTED() in configure.ac to make the
list of supported audio formats available via config.h and get rid of
supported_audio_formats(). Rename it to SERVER_AUDIO_FORMATS
and kill a useless space character while we're at it.

13 years agoContent complete, some external links missing.
Andre Noll [Mon, 3 May 2010 06:57:10 +0000 (08:57 +0200)]
Content complete, some external links missing.

13 years agoCosmetics: Rename samplerate to sample_rate.
Andre Noll [Wed, 30 Jun 2010 12:09:56 +0000 (14:09 +0200)]
Cosmetics: Rename samplerate to sample_rate.

A subsequent patch will introduce sample_format which looks much nicer
than sampleformat. So let's use the underscored variant throughout.

13 years agowrite: Support audio formats != 16 bit little endian.
Andre Noll [Mon, 12 Jul 2010 15:28:58 +0000 (17:28 +0200)]
write: Support audio formats != 16 bit little endian.

This adds the new --sample_format option to para_write and teaches
the check_wav_task to read the sample format from the wav header
rather than assuming 16 bit little endian.

The alsa, oss and osx writers all ask the upper buffer tree nodes
for the current audio format. For para_write the check_wav task
answers this query by using the value given at the command line,
looking at the wav header, or using 16 bit little endian as the
default answer.

For para_audiod, the current decoder answers this query. In this
case the audio format is either 16 bit little endian or 16 bit
big endian, depending on the endianness of the machine.

13 years agowrite: Make get_btr_value() return void.
Andre Noll [Thu, 1 Jul 2010 09:44:16 +0000 (11:44 +0200)]
write: Make get_btr_value() return void.

Asking upper buffer tree nodes for the sample rate and the channels
count should never fail, because the writer only asks if there is
already some output data to process.

So, replace the tests by assertions, change the return value
of get_btr_value() to void and fix up all callers accordingly.
This simplifies the code a bit.

13 years agoIntroduce decoder_execute().
Andre Noll [Wed, 30 Jun 2010 17:04:30 +0000 (19:04 +0200)]
Introduce decoder_execute().

All four decoders support the same two commands: "sample_rate"
and "channels". This patch adds a public function to filter_common.c
which implements these two commands and is called by all decoders.
This allows to kill four copies of code with identical functionality.

13 years agoDeduplicate --channels and --sample-rate.
Andre Noll [Wed, 30 Jun 2010 16:40:47 +0000 (18:40 +0200)]
Deduplicate --channels and --sample-rate.

These options are identical for all writers. Moreover, they only
make sense for para_write but are ignored for para_audiod.

So move these options from the writer-specific ggo file to write.m4,
the config file for para_write. The writers obtain the sample rate
and the channels count as before via the buffer tree exec mechanism,
but it is now the check_wav node rather than the btr node of the writer
that computes this information from the given option, the wav header
or the builtin default.

The new HANDLE_EXEC macro contains the logic for determining the
source of both the sample rate and the channels count.

13 years agoCosmetics: Rename samplerate to sample_rate.
Andre Noll [Wed, 30 Jun 2010 12:09:56 +0000 (14:09 +0200)]
Cosmetics: Rename samplerate to sample_rate.

A subsequent patch will introduce sample_format which looks much nicer
than sampleformat. So let's use the underscored variant throughout.

13 years agofilter.h: Add some missing documentation.
Andre Noll [Sat, 10 Jul 2010 11:24:36 +0000 (13:24 +0200)]
filter.h: Add some missing documentation.

13 years agonew codename, reset version to git
Andre Noll [Mon, 5 Jul 2010 15:29:59 +0000 (17:29 +0200)]
new codename, reset version to git

13 years agothe paraslash-0.4.3 release tarball
Andre Noll [Mon, 5 Jul 2010 15:25:03 +0000 (17:25 +0200)]
the paraslash-0.4.3 release tarball

13 years agoparaslash 0.4.3 v0.4.3
Andre Noll [Mon, 5 Jul 2010 15:19:12 +0000 (17:19 +0200)]
paraslash 0.4.3

13 years agoRemove some unused error codes.
Andre Noll [Mon, 5 Jul 2010 06:19:53 +0000 (08:19 +0200)]
Remove some unused error codes.

13 years agoaudiod: Set the audio format restart barrier also when closing the receiver.
Andre Noll [Sun, 4 Jul 2010 21:27:37 +0000 (23:27 +0200)]
audiod: Set the audio format restart barrier also when closing the receiver.

When the current audio file changes, it may happen that para_audiod's receiver
detects the EOF condition before the status has been updated to reflect the file
change. In this case, para_audiod might restart the old receiver even if a
different audio format is about to be streamed next.

This patch adds a per audio format 200ms delay which starts at receiver close time.
During this time interval the receiver for this audio format will not be started again.

13 years agogui: Replace also \r and \f by spaces.
Andre Noll [Sun, 4 Jul 2010 21:17:41 +0000 (23:17 +0200)]
gui: Replace also \r and \f by spaces.

id3 comments might contain these characters which can mess up the curses output.

13 years agooggdec: Introduce a small delay on stream start.
Andre Noll [Sun, 4 Jul 2010 21:16:01 +0000 (23:16 +0200)]
oggdec: Introduce a small delay on stream start.

This patch avoids buffer underruns when using the http receiver.

13 years agoSuppress gcc warning when compiling cmdline files.
Andre Noll [Tue, 29 Jun 2010 06:35:45 +0000 (08:35 +0200)]
Suppress gcc warning when compiling cmdline files.

Use -Wno-unused-function when compiling *.cmdline.o files
to get rid of the annoying warning

cmdline/mp3dec_filter.cmdline.c:174:1: warning: 'free_string_field' defined but not used

13 years agosched: Fix SCHED_DEBUG.
Andre Noll [Mon, 28 Jun 2010 18:46:04 +0000 (20:46 +0200)]
sched: Fix SCHED_DEBUG.

Oops, brown paper bag bug.

13 years agoNEWS update
Andre Noll [Mon, 28 Jun 2010 12:00:14 +0000 (14:00 +0200)]
NEWS update

13 years agoMerge branch 't/udp_lookup'
Andre Noll [Mon, 28 Jun 2010 11:19:21 +0000 (13:19 +0200)]
Merge branch 't/udp_lookup'

13 years agoMerge branch 't/sched_debug'
Andre Noll [Mon, 28 Jun 2010 11:17:48 +0000 (13:17 +0200)]
Merge branch 't/sched_debug'

13 years agoMerge branch 't/decoder_latency'
Andre Noll [Mon, 28 Jun 2010 11:13:43 +0000 (13:13 +0200)]
Merge branch 't/decoder_latency'

13 years agooss_write: Add missing btr_merge().
Andre Noll [Sat, 26 Jun 2010 10:57:06 +0000 (12:57 +0200)]
oss_write: Add missing btr_merge().

Without this patch, the oss writer could detect an EOF condition
even if more data is available.

13 years agoNEWS update.
Andre Noll [Wed, 23 Jun 2010 18:56:07 +0000 (20:56 +0200)]
NEWS update.

13 years agoMerge branch 't/dccp_fec'
Andre Noll [Wed, 23 Jun 2010 18:55:08 +0000 (20:55 +0200)]
Merge branch 't/dccp_fec'

13 years agoweb: Mention the new What's cooking page.
Andre Noll [Wed, 23 Jun 2010 16:05:53 +0000 (18:05 +0200)]
web: Mention the new What's cooking page.

13 years agoNEWS: Remove header.
Andre Noll [Wed, 23 Jun 2010 14:36:12 +0000 (16:36 +0200)]
NEWS: Remove header.

The "NEWS" header is now automatically generated by the scripts that
run grutatxt on the NEWS file and insert the "What's cooking" link.

13 years agoMakefile: Remove oggdec_filter from $all_ggos.
Andre Noll [Wed, 23 Jun 2010 14:34:05 +0000 (16:34 +0200)]
Makefile: Remove oggdec_filter from $all_ggos.

This should have been removed already in the previous patch. With
oggdec_filter still present in $all_ggos, the "tarball" target
can not be made.

13 years agofec: make max_slice_size optional
Gerrit Renker [Sun, 13 Jun 2010 09:30:47 +0000 (11:30 +0200)]
fec: make max_slice_size optional

The default max_slice_size for FEC is the MTU. This patch changes the parser
to make the specification of the max_slice_size optional (for cases using a
slice size less than the MTU).

Other changes:
 * added udp sender help documentation;
 * simplified parse_fec_url() (no additional strlen() needed).

13 years agosender: miscellaneous cleanups
Gerrit Renker [Sun, 13 Jun 2010 09:30:47 +0000 (11:30 +0200)]
sender: miscellaneous cleanups

This collects various minor syntactical changes into a single patch:
 * replace indirection 'ut->sc->xxx' by 'sc->xxx' where possible;
 * more elegant way of duplicating sc->name string;
 * udp_delete_target() now takes sender_client as argument;
 * added IPv4-address:port example for udp_help();
 * revised the definition of E_ADDRESS_LOOKUP (it means what it says)
   and replaced two inappropriate uses by assert(): in each case this
   error value was used to point to an unsupported adress family. But
   since the only supported network protocol is IP, if the case happens,
   it means a bug and should be marked as such.
--
 error.h       |    2 -
 para_audioc   |binary
 error.h       |    2 -
 send_common.c |    2 -
 udp_recv.c    |    4 ---
 udp_send.c    |   64 +++++++++++++++++++++++++++++-----------------------------
 4 files changed, 35 insertions(+), 37 deletions(-)

13 years agoudp: refuse to add the same target twice
Gerrit Renker [Sun, 13 Jun 2010 09:30:47 +0000 (11:30 +0200)]
udp: refuse to add the same target twice

Based on the preceding patches, this turns the UDP targets list into a set.

13 years agoudp: transition to use sender_client 'name' field
Gerrit Renker [Sun, 13 Jun 2010 09:30:47 +0000 (11:30 +0200)]
udp: transition to use sender_client 'name' field

This replaces all occurrences of ut->host/ut->port in the UDP sender with a
'canonical' socket name contained in the embedded sender_client struct.

This field is filled in as soon as the target is added and persists across
shutting down / restarting it.

The host/port fields are now obsolete, thus removed.

13 years agoudp: integrate resolve hook
Gerrit Renker [Sun, 13 Jun 2010 09:30:47 +0000 (11:30 +0200)]
udp: integrate resolve hook

This integrates the new resolve hook into the UDP sender; exploiting the
invariant that the 'port' of sender_command_data structure is now always set.

It further reuses the new resolve_target() function for the pre-configured
sender targets. This is necessary to unify the syntax (otherwise the
server.conf would have to be limited to IP-addresses only), and allows to
use hostnames in the server configuration file.

The worst case that can here be anticipated is that unresolvable targets are
specified in server.conf. In this case the server hangs for circa 20 seconds
per unresolvable target, and then concludes with error messages such as:

 (8355) init_vss_task: initializing udp sender
 ...
 (8355) udp_add_target: adding to target list (10.0.0.2:8000)
 (8355) makesock: can not resolve UDP address funzt.net#8000: Name or service not known.
 (8355) udp_init_target_list: not adding requested target 'funzt.net'
 (8355) makesock: can not resolve UDP address funzt.also.net#8000: Name or service not known.
 (8355) udp_init_target_list: not adding requested target 'funzt.also.net'
 (8355) udp_send_init: udp sender init complete

13 years agosender: add a hook to resolve target names
Gerrit Renker [Sun, 13 Jun 2010 09:30:47 +0000 (11:30 +0200)]
sender: add a hook to resolve target names

This adds a function pointer to interpret and resolve a given URL string in
a target-specific manner, filling in the target's defaults if omitted.

The hook is used for the add/delete commands, currently implemented for UDP.

13 years agonet: host/port string convention
Gerrit Renker [Sun, 13 Jun 2010 09:30:46 +0000 (11:30 +0200)]
net: host/port string convention

This updates the implementation of host_and_port() in such a way that its
output can again be used as input of parse_url():

 * the separator for host and port is now ':' instead of '#';
 * port numbers (services) are now always represented as numbers
   (reverting an earlier change);
 * IPv6 addresses are enclosed in square brackets.

This convention makes it easier to copy&paste output from paraslash commands
(including scripting), and to store target information in a format that is
easy to resolve/reuse at a later stage.

13 years agoRemove oggdec_filter.ggo.
Andre Noll [Tue, 22 Jun 2010 20:25:44 +0000 (22:25 +0200)]
Remove oggdec_filter.ggo.

The two options are no longer used.

13 years agoMake new dccp FEC parameters optional.
Andre Noll [Sat, 19 Jun 2010 18:58:32 +0000 (20:58 +0200)]
Make new dccp FEC parameters optional.

Defaults should do for most scenarios.

13 years agoReduce decoder latency.
Andre Noll [Fri, 18 Jun 2010 20:46:22 +0000 (22:46 +0200)]
Reduce decoder latency.

If large/many FEC slices are used, the decoder gets large amounts of
data in one chunk. Currently it decodes as much as it can which may
take several 100 milliseconds on slow machines -- enough to cause
buffer underruns for the alsa writer.

This patch teaches the decoders to convert only a small amount of data
in one go in order to give the other buffer tree nodes a chance to run.

13 years agodccp_send: Add command line options for FEC parameters.
Andre Noll [Fri, 18 Jun 2010 08:40:06 +0000 (10:40 +0200)]
dccp_send: Add command line options for FEC parameters.

ATM, these are hardcoded as MPS/3/4. This patch allows to impose
an upper bound on the slice size and to change the number of (data)
slices of a FEC group.

13 years agosched: Add debug mode.
Andre Noll [Wed, 16 Jun 2010 20:39:57 +0000 (22:39 +0200)]
sched: Add debug mode.

This adds the compile-time switch SCHED_DEBUG to activate debug
mode for the scheduler. If activated, it measures the time spent in
each post_select() function and prints warning messages if this time
interval is too large.

This patch has no effect if SCHED_DEBUG is not set.

13 years agoPrint a log message if the sender command fails.
Andre Noll [Mon, 14 Jun 2010 15:09:04 +0000 (17:09 +0200)]
Print a log message if the sender command fails.

Currently there is no infrastructure for passing down a value from vss,
which runs in parent context, to the child process. In particular,
we can not pass the return value of the sender subcommand handlers
to com_sender() to propagate it to the client.

However, we may easily write a log message that explains the cause
of the error, which is not optimal, but better than nothing.

Thanks to Gerrit Renker who pointed out this flaw.

13 years agoudp_send: add a time window for errors
Gerrit Renker [Sun, 30 May 2010 16:10:42 +0000 (18:10 +0200)]
udp_send: add a time window for errors

This implements a grace period during which ICMP Destination Unreachable /
Port Unreachable are ignored from the peer, with the purpose of catching
 * synchronisation problems (e.g., receiver started after sender);
 * unforeseen events (e.g. delays, reboot, reconfiguration).

To avoid receiving persistent errors from unicast UDP clients, two time
windows are used:
 (a) The 'error-allowed' period t_A
     This time window starts when the first ECONNREFUSED error is seen
     and ends after t_A seconds. The value of t_A is a guess which should
     cover the expected time needed to sort any receiver problems out.
 (b) The 'error-free' period t_B
     During the t_B seconds following the interval t_A, no further
     connection errors are accepted; if an ECONNREFUSED is seen it
     will cause the target to be evicted from the list.

This windowing process restarts itself, i.e. the first error seen after
t_A+t_B will reset the counters.

The following examples illustrate the algorithm, where 'x' indicates
receipt of an ICMP error message.

 1) Some errors received during initial receiver setup

    |-x-x-x-x-x-x-x--|------------|------....
    |
    t_0              t_0 + t_A    t_0+t_A+t_B

    Since no errors are received after t_0 + t_A, no action will be taken.

 2) Persistent errors

    |-x-x-x-x-x-x-x-x|-x-x-x-x-x-x|
    |
    t_0              t_0 + t_A    t_0+t_A+t_B

    The first error received after t_0+t_A evicts the target.

 3) Recurring short errors

    |-x-x-x-x-x-x-x--|-//--|--------//---|-x-x-x-x-x-x-x--|------------|---...
    |
    t_0                    t_0+t_A+t_B   t_1              t_1+t_A      t_1+t_A+t_B

    Here the counter is reset at the first error after t_1. Since no more errors
    were seen after t_1+t_A, streaming continues.

For simplicity, the implementation uses t_A = t_B = 30 seconds.

The behaviour with an unavailable receiver is now:
May 24 18:08:16 (0) (2702) vss_send: sending 123:0 (548 bytes)
May 24 18:08:18 (0) (2702) vss_send: sending 132:2 (548 bytes)
May 24 18:08:18 (2) (2702) udp_check_socket_state: Evicting 10.0.0.2#8000 after 31 seconds of connection errors.

May 24 19:34:55 (0) (2702) vss_send: sending 5:14 (1232 bytes)
May 24 19:35:10 (0) (2702) vss_send: sending 11:3 (1232 bytes)
May 24 19:35:10 (2) (2702) udp_check_socket_state: Evicting 3ffe::2#8000 after 31 seconds of connection errors.

13 years agoudp: initialize common structure only once
Gerrit Renker [Sun, 30 May 2010 16:06:33 +0000 (18:06 +0200)]
udp: initialize common structure only once

When temporarily closing the UDP stream (e.g. due to 'next' or 'ff'
command), the UDP file descriptor need not be closed.  Hence this
patch moves its initialization into the add_target() function.

The patch also factors global variables out of mcast_sender_setup() function.

13 years agoudp_send: Do not send the current chunk if queue is not empty.
Andre Noll [Sun, 23 May 2010 16:58:22 +0000 (18:58 +0200)]
udp_send: Do not send the current chunk if queue is not empty.

In this case we have enqueued other data _and_ the current chunk already.

13 years agoMove send_chunk() from send_common.c to http_send.c.
Andre Noll [Sun, 23 May 2010 06:42:04 +0000 (08:42 +0200)]
Move send_chunk() from send_common.c to http_send.c.

Due to the previous changes, this function is no longer a generic function
as it is only used by the http sender. So move it to http_send.c and make it static,
along with the queue_chunk_or_shutdown() helper which is only called from
send_chunk().

13 years agocleanup: remove redundant 'max length' argument
Gerrit Renker [Sun, 23 May 2010 05:43:04 +0000 (07:43 +0200)]
cleanup: remove redundant 'max length' argument

This removes the redundant 'max_size_bytes' argument of
 * write_nonblocking(),
 * send_queued_chunks(), and
 * send_chunk(),
since it was set to 0 in all cases.

13 years agoudp_send: send data in MMS-sized chunks
Gerrit Renker [Sun, 23 May 2010 05:43:04 +0000 (07:43 +0200)]
udp_send: send data in MMS-sized chunks

This determines the Maximum Message Size for the UDPv4/v6 layer; using
the earlier functions. The outcome is used to set the FEC slice size,
initialisation of the UDP client has also been moved to the init_fec()
function.