Andre [Mon, 6 Mar 2006 20:51:19 +0000 (21:51 +0100)]
net.h: use proper type for the addrlen parameter of para_accept() also in prototype
An earlier patch changed that parameter from size_t to socklen_t
but missed to update also the corresponding prototype in net.h. Thanks to
Steffen Klassert for pointing this out.
Andre [Sun, 5 Mar 2006 12:40:43 +0000 (13:40 +0100)]
para_filter: Fix and improve help text for --list_filters
The old help text still used colons as separators. Mark those filters
which have their own command line parser with a star in the filter
list. Some trivial whitespace fixes also.
Andre [Thu, 23 Feb 2006 17:29:45 +0000 (18:29 +0100)]
Fix --device bug
Duuuh, the --device option never worked because "plug:swmix" was harcoded
in play.c instead of using the value from the configuration. Even worse,
the default in play.ggo was _also_ set to "plug:swmix". Replace that by
"plughw:0,0".
This patch also simplifies and optimizes play_pcm().
Anyway, software mixing is still recommended. Here's an aprropriate
/etc/asound.conf:
---------------------------------------------------- /etc/asound.conf
pcm.swmix {
type dmix
# any unique number here
ipc_key 313
ipc_perm 0666
slave {
pcm "hw:0,0"
# these settings may require tweaking for different sound
# cards; this is for the Powerbook's built-in snd-powermac
# probably not required at all for well-behaved cards...
period_time 0
period_size 1024
buffer_size 8192
# mentioning rate fixes wrong speed/pitch in native ALSA stuff
# rate 44100
}
}
pcm.dsp0 {
type plug
slave.pcm "swmix"
}
ctl.mixer0 {
type hw
card 0
}
pcm.!default {
type plug
slave.pcm "swmix"
}
---------------------------------------------------------------------
a Use the
: Use a large input
buffer and For one, the
Andre [Tue, 21 Feb 2006 14:52:45 +0000 (15:52 +0100)]
fix the plm database tool
(Re)loading the playlist uses the new mutex and
shm helpers and is hopefully a race-free implementation.
It works as follows:
The plm init function (parent, server context) reserves
a shared memory area (client data) as well as two unlocked
mutexes. The first mutex serializes access for racing clients
that want to replace the playlist. The second mutex serializes
the access between parent and child (com_lpl()).
com_lpl() loads the playlist from the client into a tmp buffer.
It then creates a shm area (client_shm) and copies that buffer
to the area. Further, another mutex (shm) is created. This
mutex is initially locked.
Next, it grabs the client lock and the server lock, and updates
client_data with the id of client_shm. Then the parent is
woken up (SIGUSR1) and the server lock is released. com_lpl()
finally goes to sleep by acquiring the shm lock.
In this situation, only the parent may run. It grabs the
server lock, reads client_data to attach client_shm and
reloads the playlist with data from client_shm. When ready,
the parent detaches client_shm, and drops the shm lock and
the server lock.
This wakes up com_lpl() which destroys client_shm, the
shm mutex and the tmp buffer.