paraslash Paraslash Audio Streaming
About   News   Download   Documentation   Development

para_server

NAME
SYNOPSIS
DESCRIPTION
OPTIONS
LIST OF SERVER COMMANDS
COPYRIGHT
NAME

para_server - manage and stream audio files

SYNOPSIS

para_server [--help] [--detailed-help] [--version] [--config-file=<filename>] [--priority=<prio>] [--daemon] [--logfile=<filename>] [--user=<username>] [--group=<groupname>] [--loglevel=<severity>] [--log-timing] [--color=<when>] [--log-color=<color_spec>] [--listen-address=<addr>] [--port=<portnumber>] [--user-list=<path>] [--autoplay] [--autoplay-delay=<milliseconds>] [--announce-time=<milliseconds>] [--afs-database-dir=<directory>] [--afs-socket=<path>] [--afs-initial-mode=<specifier/name>] [--http-listen-address=<addr>] [--http-port=<portnumber>] [--http-default-deny] [--http-access=<a.b.c.d/n>] [--http-no-autostart] [--http-max-clients=<number>] [--dccp-listen-address=<addr>] [--dccp-port=<portnumber>] [--dccp-default-deny] [--dccp-access=<a.b.c.d/n>] [--dccp-no-autostart] [--dccp-max-clients=<number>] [--dccp-max-slice-size=<bytes>] [--dccp-data-slices-per-group=<count>] [--dccp-slices-per-group=<count>] [--udp-target=<host[:port]>] [--udp-default-port=<portnumber>] [--udp-no-autostart] [--udp-mcast-iface=<interface>] [--udp-header-interval=<milliseconds>] [--udp-ttl=<num>]

DESCRIPTION

para_server streams audio files over a local or remote network. It is controlled by para_client(1), which connects para_server through the paraslash control service.

On startup the server spawns a second process, the audio file selector, which maintains the database of all known audio files. This database contains file format, duration and tag information of each known file and statistics such as last-played time, and the number of times each file was streamed. Lyrics and cover art may be added to the database and associated with one or more audio files.

Besides ordinary playlists the audio file selector supports so-called moods. Moods instruct the server to determine the files to be streamed and their order in terms of properties stored in the database.

OPTIONS

Common options
The following options are implemented generically and are available for many of the commands.
-h
, --help

print help and exit

--detailed-help

print help, including all details, and exit

-V, --version

print version and exit

-c, --config-file=<filename>

path to alternative config file

default: ~/.paraslash/server.conf

para_server reads its config file right after parsing the options that were given at the command line. If an option is given both at the command line and in the config file, the value that was specified at the command line takes precedence.

--priority=<prio>

adjust scheduling priority

default: 0

The priority (also known as nice value) is a value in the range -20 to 19. Lower priorities cause more favorable scheduling. Since only privileged processes may request a negative priority, specifying a negative value works only if the daemon is started with root privileges.

-d, --daemon

run as background daemon

If this option is given and no logfile was specified, all messages go to /dev/null.

-L, --logfile=<filename>

where to write log output

If this option is not given, para_server writes the log messages to stderr.

-u, --user=<username>

run as the given user

para_server does not need any special privileges.

If started as root (EUID == 0) this option must be given at the command line (not in the configuration file) so that para_server can drop the root privileges right after parsing the command line options, but before parsing the configuration file. In this case, real/effective/saved UID are all set to the UID of <username>. As the configuration file is read afterwards, those options that have a default value depending on the UID (e.g. the directory for the configuration file) are computed by using the uid of <username>. This option has no effect if para_server is started as a non-root user (i.e. EUID != 0).

-g, --group=<groupname>

set group id

This option sets the group id according to <group>. This option is silently ignored if EUID != 0. Otherwise, real/effective GID and the saved set-group ID are all set to the GID given by <group>. Must not be given in the config file.

-l, --loglevel=<severity>

control amount of logging

values: debug, info, notice, warning, error, crit, emerg

Log only messages with severity greater or equal than the given value. Possible values:

debug: Produces really noisy output. info: Still noisy, but won’t fill up the disk quickly. notice: Indicates normal, but significant event. warning: Unexpected events that can be handled. error: Unhandled error condition. crit: System might be unreliable. emerg: Last message before exit.

-T, --log-timing

show milliseconds in log messages

Selecting this option causes milliseconds to be included in the log message output. This allows measuring of the interval between log messages in milliseconds which is useful for identifying timing problems.

-C, --color=<when>

activate color output

values: yes, no, auto

--log-color=<color_spec>

select a color for one type of log message

The format of <color_spec> is [<fg> [<bg>]] [<attr>].

Valid colors for <fg> and <bg> are "normal", "black", "red", "green", "yellow", "blue", "magenta", "cyan", and "white".

The <attr> value must be one of "bold", "dim", "ul", "blink", "reverse".

Examples:

--log-color "debug:green" --log-color "info:yellow bold" --log-color "notice:white red bold"

Options for para_server
--listen-address
=<addr>

local listening addresses for the control service

para_server listens on a TCP socket for incoming connections from para_client or para_audiod. This option controls on which addresses the server should listen. If the option is not given, the server listens on all local addresses (INADDR_ANY for IPv4 addresses, IN6ADDR_ANY_INIT for IPv6 addresses).

The argument specifies an IPv4 or an IPv6 address, either a numerical network address (for IPv4, numbers-and-dots notation as supported by inet_aton(3); for IPv6, hexadecimal string format as supported by inet_pton(3)), or a network hostname, whose network addresses is looked up and resolved. The address can optionally include a port number. For addresses for which no port number is given, the argument of the --port option (see below) is implied.

This option may be given multiple times. The server will then listen on each of the specified addresses.

Examples: 10.10.1.1, 10.10.1.2:2991, localhost, localhost:2991, [::1]:2991, [badc0de::1].

-p, --port=<portnumber>

listening port of the control service

default: 2990

This option applies only to addresses given to --listen-address (see above) which do no include a port number. If the default port is changed, the corresponding option of para_client must be used to connect to para_server.

--user-list=<path>

file which contains user names and credentials

This file contains one line per user of the form

user <username> <key> <perms>

See the manual for more information.

Options for the virtual streaming system
-a
, --autoplay

start streaming on startup

The default is to defer streaming until para_client connects and executes the "play" command.

--autoplay-delay=<milliseconds>

time to wait before streaming

default: 0

This option is ignored if --autplay is not given. Otherwise, its argument defines for how long streaming is delayed at startup.

This is useful in init scripts to set the delay large enough to make sure para_audiod is up when para_server starts to stream.

-A, --announce-time=<milliseconds>

grace time for data connections

default: 300

para_server tells para_audiod through the control service connection whether an audio stream is currently available. This option defines the delay between announcing the stream and sending the first chunk of audio data.

Options for the audio file selector
-D
, --afs-database-dir=<directory>

location of the afs database

The directory which contains the database for the audio file selector. The default is ~/.paraslash/afs_database-0.7.

If no database was found, the "init" command must be executed to initialize the database. Once initialized, audio files may added with the "add" command.

-s, --afs-socket=<path>

socket for afs connections

default: /var/paraslash/afs_command_socket-0.4

Server commands communicate with the audio file selector, via a local socket. This option specifies the location of the socket in the file system.

-i, --afs-initial-mode=<specifier/name>

mood or playlist to load on startup

The argument of this option consists of a prefix, either ’m/’ or ’p/’, to indicate whether a mood or a playlist should be loaded, followed by the name of the mood or playlist. Example:

--afs-initial-mode p/foo

loads the playlist named "foo".

If this option is not given, the dummy mood is loaded at startup.

Options for the http sender
--http-listen-address
=<addr>

listening addresses of the http sender

The http sender of para_server listens on this port for incoming data connections. This option controls on which addresses the http sender should listen. See the documentation of the --listen-address above for the format of the address argument and the defaults.

--http-port=<portnumber>

TCP port for http streaming

default: 8000

This option has the same meaning as --port, but applies to http data connections and applies to the addresses specified as arguments to --http-listen-address.

--http-default-deny

make the http access control list a whitelist

The default is to use blacklists, i.e. connections to the http sender are allowed unless the connecting host matches a pattern given by a http-access option. This option allows using access control lists the other way round: Connections are denied from hosts which are not explicitly allowed by one or more http-access options.

--http-access=<a.b.c.d/n>

add an entry to the http access control list

Add the given host/network to access control list (whitelist if http-default-deny was given, blacklist otherwise) before opening the tcp port. This option can be given multiple times. Example:

--http-access 192.168.0.0/24

whitelists/blacklists the 256 hosts 192.168.0.x.

This option may be given multiple times to blacklist/whitelist any number of hosts or networks.

--http-no-autostart

do not open TCP port for http streaming on startup

If this option is given, the http sender does not listen on its TCP port until the "sender" command is executed to open the port.

--http-max-clients=<number>

maximal number of simultaneous http connections

default: -1

The http sender will refuse connections if already that number of clients are currently connected. A non-positive value (the default) allows for an unlimited number of simultaneous connections.

Options for the dccp sender
--dccp-listen-address
=<addr>

listening addresses of the dccp sender

Like --http-listen-address, but for the dccp sender.

--dccp-port=<portnumber>

port for dccp streaming

default: 8000

See --http-port for details.

--dccp-default-deny

make the dccp access control list a whitelist

See http-default-deny for details.

--dccp-access=<a.b.c.d/n>

add an entry to the dccp access control list

See --http-access for details.

--dccp-no-autostart

do not open the DCCP port on startup

This is like --http-no-autostart but applies to the dccp sender.

--dccp-max-clients=<number>

maximal number of simultaneous dccp connections

default: -1

See --http-max-clients for details.

--dccp-max-slice-size=<bytes>

upper bound for the FEC slice size

default: 0

If this value is zero (the default) the dccp sender uses the maximum packet size (MPS) of the connection as the slice size. The MPS is a network parameter and depends on the path maximum transmission unit (path MTU) of an incoming connection, i.e. on the largest packet size that can be transmitted without causing fragmentation.

This option allows values less than the MPS in order to fine-tune application performance. Values greater than the MPS of an incoming connection can not be set.

--dccp-data-slices-per-group=<count>

the number of non-redundant slices per FEC group

default: 3

This determines the number of slices in each FEC group which are necessary to decode the group. The given number must be smaller than the argument to the --dccp-slices-per-group option below.

Note that the duration of a FEC group is proportional to the product dccp-max-slice-size * dccp-data-slices-per-group.

--dccp-slices-per-group=<count>

the total number of slices per FEC group

default: 4

This value must be larger than the value of the argument to --dccp-data-slices-per-group. The difference of the two values is the number of redundant slices, that is, the number of slices which may be lost without causing interruptions in the audio stream.

Increase this value if you are on a lossy network.

Options for the udp sender
--udp-target
=<host[:port]>

add udp target with optional port

Add the given host/port to the list of targets. The "host" argument can be either an IPv4/v6 address or hostname (RFC 3986 syntax). The "port" argument is an optional port number. If the "port" part is absent, the "--udp-default-port" value (see below) is used.

The following examples are possible targets: "10.10.1.2:8000" (host:port); "10.10.1.2" (with default port); "224.0.1.38:1500" (IPv4 multicast); "localhost:8001" (hostname with port); "[::1]:8001" (IPv6 localhost); "[badc0de::1]" (IPv6 host with default port); "[FF00::beef]:1500" (IPv6 multicast).

This option can be given multiple times, for multiple targets.

--udp-default-port=<portnumber>

default port for udp targets

default: 8000

--udp-no-autostart

do not send the audio stream to UDP targets

If this option is given, udp streaming may be activated at a later time by executing the "sender" command.

--udp-mcast-iface=<interface>

outgoing udp multicast interface

-H, --udp-header-interval=<milliseconds>

duration for sending header

default: 2000

As the udp sender has no idea about connected clients it sends the audio file header periodically if necessary. This option specifies the duration between subsequent headers are sent. Smaller values decrease the average time clients have to wait before starting playback, larger values decrease network traffic.

Note that this affects only ogg/* and wma streams. Other audio formats, including mp3, don’t need an audio file header.

-t, --udp-ttl=<num>

set time to live value

default: -1

This option applies exclusively to multicast UDPv4/v6 streaming.

For the sending UDPv4 socket it sets the multicast Time-To-Live value to "num". Traditional TTL scope values are: 0=host, 1=network, 32=same site, 64=same region, 128=same continent, 255=unrestricted. Please note however that this scoping is not a good solution: RFC 2365 e.g. presents a better alternative.

When using UDPv6 multicasting, the option sets the number of multicast hops (as described in RFC 3493); a value of -1 allows the kernel to auto-select the hop value.

LIST OF SERVER COMMANDS

The server process listens on a network socket and accepts connections from para_client or para_audiod. For the connection to succeed the connecting peer must authenticate as one of the users stored in the user table of para_server. Each entry of the user table contains the set of permission bits that are granted to the user. Authenticated users may execute one of the commands below if the set of permission bits of the command is a subset of the permission bits that are granted to the user.

add - add or update audio files
Usage: add [--all] [--lazy] [--force] [--verbose] [--] path...

Each path must be absolute and refer to either an audio file or a directory. In case of a directory, all audio files in that directory are added recursively. Note that the given paths refer to files or directories on the host on which para_server is running.
-a
, --all

add all files

The default is to add only files ending in a known suffix for a supported audio format.

-l, --lazy

add files lazily

If the path already exists in the database, skip this file. This operation is really cheap. Useful to update large directories after some files have been added.

-f, --force

force adding/updating

Recompute the audio format handler data even if a file with the same path and the same hash value exists.

-v, --verbose

enable verbose mode

Print what is being done.

Permissions: AFS_READ | AFS_WRITE

addatt - add new attribute(s)
Usage: addatt attribute...

This adds new attributes to the attribute table. At most 64 attributes may be defined.

Permissions: AFS_READ | AFS_WRITE

check - run integrity checks on database tables
Usage: check [--aft] [--attribute] [--mood] [--playlist]

If no options are given, all checks are run.
-a
, --aft

run audio file table checks

Report stale paths and invalid image and lyrics ids of the audio file table.

-A, --attribute

check for invalid attributes

Report audio files whose attribute bitmask is invalid, i.e., has a bit set which does not correspond to any attribute of the attribute table.

-m, --mood

check for invalid mood definitions

Run syntax checks on all moods of the mood table.

-p, --playlist

find invalid paths in playlists

Check all playlists for paths not contained in the audio file table.

Permissions: AFS_READ

cpsi - copy selected parts of the audio file selector info
Usage: cpsi [--attribute-bitmap] [--image-id] [--lyrics-id] [--lastplayed] [--numplayed] [--verbose] [--] source pattern...

If no option, or only --verbose is given, all fields of the audio file selector info structure are copied to each row of the audio file table whose path matches at least one of the given patterns. Otherwise, only those fields which correspond to the given options are copied.
-a
, --attribute-bitmap

copy the attribute bitmap

-i, --image-id

copy the image id

-y, --lyrics-id

copy the lyrics id

-l, --lastplayed

copy the lastplayed timestamp

-n, --numplayed

copy the numplayed counter

-v, --verbose

enable verbose mode

Permissions: AFS_READ | AFS_WRITE

ff - jump forward or backward in the current audio file
Usage: ff seconds

This enqueues a request to reposition the audio stream according to the argument, which may be a signed or an unsigned integer. Negative values correspond to backward jumps.

If a negative number is given whose absolute value exceeds the current postition of the stream, a jump to the beginning of the audio file is performed. If a positive amount of seconds is given which exceeds the remaining time of the audio file, the next audio file is loaded.

Permissions: VSS_READ | VSS_WRITE

help - list available commands or print command-specific help
Usage: help [--long] [--] [command]

When executed without any arguments, the available server commands are listed. Otherwise, if the first argument is the name of a server command, the description of this command is shown.
-l
, --long

show the long help text

If no non-option argument is supplied to the help subcommand and --long is not given, only the names of all subcommands are shown. With --long the purpose of each command is printed as well.

If the name of a subcommand is supplied and --long is given, the help text for the given subcommand contains the synopsis, the purpose and the description of the specified command, followed by the option list including summary and help text of each option. Without --long the description of the command and the option help are omitted.

Permissions: NO_PERMISSION_REQUIRED

hup - reload config file, log file and user list
Usage: hup

Reread the config file and the user list file, close and reopen the log file, and ask the afs process to do the same. Sending the HUP signal to the server process has the same effect as running this command.

Permissions: VSS_WRITE

init - initialize the database tables for the audio file selector
Usage: init [table_name...]

When invoked without arguments, this command creates all tables: audio_files, attributes, scores, moods, lyrics, images, playlists. Otherwise only the given tables are created.

Permissions: AFS_READ | AFS_WRITE

ll - Query or set the log level of the daemon
Usage: ll [severity]

If no argument is given, the command prints the severity string (one of the possible string arguments to --loglevel) which corresponds to the current loglevel. Otherwise, if the given argument is a severity string, the current log level is set accordingly.

jmp - reposition the current stream
Usage: jmp n

Set the ’R’ (reposition request) bit of the vss status flags and enqueue a request to jump to n% of the current audio file, where 0 <= n <= 100.

Permissions: VSS_READ | VSS_WRITE

ls - list audio files which match a pattern
Usage: ls [--listing-mode[=<mode>]] [--limit=<num>] [--basename] [--admissible[=<specifier/name>]] [--reverse] [--unix-date] [--sort=<order>] [--] [pattern...]

If no pattern is given, all files are listed. Otherwise, the command lists all files of the audio file table whose path matches at least one of the given patterns.
-l
, --listing-mode[=<mode>]

use alternative output format

default: long

The optional mode argument is either a single character or a word according to the following list.

short (s). List only the path or basename (last component of the path), depending on whether -p is also given. This listing mode acts as if --listing-mode had not been given.

long (l). Show detailed information. This is the default if no argument to --listing-mode is supplied.

verbose (v). Multi-line output, one row per data field stored in the audio file table.

parser-friendly (p). Like verbose listing mode, but use numerical values for the names of the output fields and prefix each line with a length field.

mbox (m). Generate output suitable to be viewed with a mail program. One "mail" per matching audio file.

chunk-table (c). Print path (or basename, depending on whether -p is also given), chunk time and chunk offsets.

-L, --limit=<num>

list at most this many files

An argument of zero means "unlimited". This is also the default which applies if the option is not given.

-b, --basename

list and match basenames only

Print only the basename of each matching file and match only the basenames of the paths stored in the audio file table against the given patterns. The default is to print and match the full path.

-a, --admissible[=<specifier/name>]

list only admissible files

default: .

If the optional argument is supplied, it must be of the form "p/foo" or "m/bar" (which refer to the playlist named "foo" and the mood named "bar", respectively). The command then restricts its output to the set of files which are admissible with respect to the thusly identified mood or playlist.

If no argument is given, or if the argument is the special value ".", the current mood or playlist is assumed.

-r, --reverse

reverse sort order

-d, --unix-date

print dates as seconds after the epoch

-s, --sort=<order>

change sort order

default: path

The sort order must be given as an required argument. Like for --listing-mode, this argument may either be a single character or a word, according to the following list.

path (p). Sort alphabetically by path or basename, depending on whether -b is given. This is the default if --sort is not given.

score (s). Iterate over the entries of the score table, rather than the audio file table. This sort order implies --admissible, since the score table contains only admissible files.

lastplayed (l)

numplayed (n)

frequency (f)

channels (c)

image-id (i)

lyrics-id (y)

bitrate (b)

duration (d)

audio-format (a)

hash (h)

If --sort is not given, path sort is implied.

Permissions: AFS_READ

lsatt - list attributes
Usage: lsatt [--id-sort] [--long] [--reverse]

Print the list of all defined attributes which match the given pattern. If no pattern is given, the full list is printed.
-i
, --id-sort

sort attributes by id

The default is to sort alphabetically by name.

Attributes are internally represented as an 64 bit array. The attribute id is the bit number in this array.

-l, --long

print long listing

The long listing prints the attribute id in addition to the name of the attribute. The id is printed as a decimal number and is separated from the name by a tab character.

-r, --reverse

reverse sort order

Permissions: AFS_READ

mvatt - rename an attribute
Usage: mvatt source dest

Rename the attribute given by the first argument to the destination given by the second argument. It is an error if the destination attribute exists.

Permissions: AFS_READ | AFS_WRITE

next - close the stream and start to stream the next audio file
Usage: next

Set the ’N’ (next audio file) bit of the vss status flags. This instructs the server to close the current stream, if any. The ’P’ (playing) bit is not modified by this command. If it is on, playing continues with the next audio file.

This command is equivalent to stop if paused, and has no effect if stopped.

Permissions: VSS_READ | VSS_WRITE

nomore - stop playing after current audio file
Usage: nomore

Set the ’O’ (no more) bit of the vss status flags which asks para_server to clear the ’P’ (playing) bit after the ’N’ (next audio file) bit transitions from off to on (because the end of the current audio file is reached). Use this command instead of stop if you don’t like sudden endings.

Permissions: VSS_READ | VSS_WRITE

pause - suspend the current stream
Usage: pause

Clear the ’P’ (playing) bit of the vss status flags.

Permissions: VSS_READ | VSS_WRITE

play - start or resume playback
Usage: play

Set the ’P’ (playing) bit of the vss status flags.

Permissions: VSS_READ | VSS_WRITE

rm - remove rows from the audio file table
Usage: rm [--verbose] [--force] [--pathname-match] [--] pattern...

Remove all rows of the audio file table which match any of the given patterns. Note that this affects only the database table; the command won’t touch your audio files on disk.
-v
, --verbose

print paths of deleted rows

-f, --force

don’t complain if nothing was removed

-p, --pathname-match

modify matching behaviour

Match a slash in the path only with a slash in pattern and not by an asterisk (*) or a question mark (?) metacharacter, nor by a bracket expression ([]) containing a slash (see fnmatch(3)).

Permissions: AFS_READ | AFS_WRITE

rmatt - remove attribute(s)
Usage: rmatt pattern...

Remove all attributes which match any given pattern. All information about the removed attributes in the audio file table is lost.

Permissions: AFS_READ | AFS_WRITE

select - activate a mood or a playlist
Usage: select [--verbose] [--] specifier/name

The specifier is either ’m’ or ’p’ to indicate whether a playlist or a mood should be activated. Example:

select m/foo

activates the mood named ’foo’.
-v
, --verbose

print information about the loaded mood or playlist

Permissions: AFS_READ | AFS_WRITE

sender - control paraslash senders
Usage: sender [sender subcmd [arguments]]

This command executes a subcommand for the given sender, which is one of "http", "dccp" or "udp". Various subcommands exist to print information about the sender, to activate and deactivate the sender, and to change the access permissions and targets. The following subcommands are available:

help, status, on, off, allow, deny, add, delete.

All senders support the first four commands. The "allow" and "deny" commands are supported by the http and the dccp senders while "add" and "delete" are only supported by the udp sender. If no sender is given, the list of available senders is shown.

Examples:

Get help for the udp sender (contains further examples):

sender udp help

Show the access control list and the number of connected clients of the http sender:

sender http status

Senders may be activated and deactivated independently of each other. The following command switches off the dccp sender:

sender dccp off

Add an UDP unicast for a client to the target list of the UDP sender:

sender udp add client.foo.org

Start UDP multicast, using the default multicast address:

sender udp add 224.0.1.38

Permissions: VSS_READ | VSS_WRITE

setatt - set or unset attributes
Usage: setatt attribute{+|-}... pattern...

Set (’+’) or unset (’-’) the given attributes for all audio files matching the given pattern. Example:

setatt rock+ punk+ pop- ’*foo.mp3’

sets the ’rock’ and the ’punk’ attribute and unsets the ’pop’ attribute of all files ending with ’foo.mp3’.

Permissions: AFS_READ | AFS_WRITE

si - print server info
Usage: si

Show server and afs PID, number of connections, uptime and more.

Permissions: NO_PERMISSION_REQUIRED

stat - print information about the current audio file
Usage: stat [--num=<num>] [--parser-friendly]
-n
, --num=<num>

number of times to show the status info

Exit after the status information has been shown num times. If this option is not given, the command runs in an endless loop.

-p, --parser-friendly

enable parser-friendly output

Show status item identifiers as numerical values and prefix each status item with its size in bytes.

Permissions: VSS_READ

stop - stop playback
Usage: stop

Clear the ’P’ (playing) bit and set the ’N’ (next audio file) bit of the vss status flags, effectively stopping playback.

Permissions: VSS_READ | VSS_WRITE

term - ask the server to terminate
Usage: term

Shut down the server. Instead of this command, you can also send SIGINT or SIGTERM to the para_server process. It should never be necessary to send SIGKILL.

Permissions: VSS_READ | VSS_WRITE

touch - manipulate the afs information of audio files
Usage: touch [--numplayed=<num>] [--lastplayed=<num>] [--image-id=<num>] [--lyrics-id=<num>] [--amp=<num>] [--verbose] [--pathname-match] [--] pattern...

This command modifies the afs info structure of all rows of the audio file table whose path matches at least one of the given patters.

If at least one option is given which takes a number as its argument, only those fields of the afs info structure are updated which correspond to the given options while all other fields stay unmodified.

If no such option is given, the lastplayed field is set to the current time and the value of the numplayed field is increased by one while all other fields are left unchanged. This mimics what happens when the virtual streaming system selects the file for streaming.

If the file is admissible for the current mood (or contained in the current playlist), its score is recomputed according to the changed values.
-n
, --numplayed=<num>

set the numplayed count manually

The numplayed count of an audio file is the number of times the file was selected for streaming. It is one of the inputs to the scoring function which determines the order in which admissible files are streamed.

The virtual streaming system increases this number automatically each time it opens the file for streaming.

-l, --lastplayed=<num>

set the lastplayed time manually

The lastplayed time of an audio file is the time when the file was last opened for streaming.

Like the numplayed count, it is an input for the scoring function and is updated automatically by the virtual streaming system.

The argument must be a number of seconds since the epoch. Example:

touch -l=$(date +%s) file

sets the lastplayed time of ’file’ to the current time.

-i, --image-id=<num>

set the image id

The afs info structure of each row of the audio file table contains a slot for the image id of the audio file that corresponds to the row. The image id stored in this slot refers to the key in the image table that identifies the blob.

When a new audio file is added to the audio file table, its image id starts out as zero, indicating that there is no image associated with the file. Setting the image id to a non-zero number associates the file with a particular blob of the image table, for example the cover art of the album in jpg format.

-y, --lyrics-id=<num>

set the lyrics id

This option works just like --image-id, but sets the lyrics ID rather than the image id.

-a, --amp=<num>

set the amplification value (0-255)

The amplification value of an audio file is a number which is stored in the afs info structure.

The value determines the scaling factor by which the amplitude of the decoded samples should be multiplied in order to normalize the volume. A value of zero means no amplification, 64 means the amplitude should be multiplied by a factor of two, 128 by three and so on.

The amp filter of para_audiod amplifies the volume according to this value.

-v, --verbose

explain what is being done

-p, --pathname-match

modify matching behaviour

Match a slash in the path only with a slash in pattern and not by an asterisk (*) or a question mark (?) metacharacter, nor by a bracket expression ([]) containing a slash (see fnmatch(3)).

Permissions: AFS_READ | AFS_WRITE

version - print the git version string of para_server
Usage: version [--verbose]
-v
, --verbose

print detailed (multi-line) version text

Permissions: NO_PERMISSION_REQUIRED

rmmood - remove moods blob(s)
Usage: rmmood pattern...

Remove all moods blobs which match any of the given patterns.

Permissions: AFS_READ | AFS_WRITE

mvmood - rename moods blob(s)
Usage: mvmood source dest

Rename moods source to dest. The command fails if the source moods does not exist or if the destination moods already exists.

Permissions: AFS_READ | AFS_WRITE

addmood - add a blob to the moods table
Usage: addmood moods_name

Read from stdin and ask the audio file selector to create a blob in the moods table. If the named blob already exists, it gets replaced with the new data.

Permissions: AFS_READ | AFS_WRITE

catmood - dump a moods blob to stdout
Usage: catmood moods_name

Permissions: AFS_READ

lsmood - list blobs of type moods which match a pattern
Usage: lsmood [--id-sort] [--long] [--reverse] [--] [pattern...]

Print the list of all blobs which match the given pattern. If no pattern is given, the full list is printed.
-i
, --id-sort

sort by identifier

The default is to sort alphabetically by name.

-l, --long

long listing

Print identifier and name. The default is to print only the name.

-r, --reverse

reverse sort order

Permissions: AFS_READ

rmpl - remove playlist blob(s)
Usage: rmpl pattern...

Remove all playlist blobs which match any of the given patterns.

Permissions: AFS_READ | AFS_WRITE

mvpl - rename playlist blob(s)
Usage: mvpl source dest

Rename playlist source to dest. The command fails if the source playlist does not exist or if the destination playlist already exists.

Permissions: AFS_READ | AFS_WRITE

addpl - add a blob to the playlist table
Usage: addpl playlist_name

Read from stdin and ask the audio file selector to create a blob in the playlist table. If the named blob already exists, it gets replaced with the new data.

Permissions: AFS_READ | AFS_WRITE

catpl - dump a playlist blob to stdout
Usage: catpl playlist_name

Permissions: AFS_READ

lspl - list blobs of type playlist which match a pattern
Usage: lspl [--id-sort] [--long] [--reverse] [--] [pattern...]

Print the list of all blobs which match the given pattern. If no pattern is given, the full list is printed.
-i
, --id-sort

sort by identifier

The default is to sort alphabetically by name.

-l, --long

long listing

Print identifier and name. The default is to print only the name.

-r, --reverse

reverse sort order

Permissions: AFS_READ

rmimg - remove image blob(s)
Usage: rmimg pattern...

Remove all image blobs which match any of the given patterns.

Permissions: AFS_READ | AFS_WRITE

mvimg - rename image blob(s)
Usage: mvimg source dest

Rename image source to dest. The command fails if the source image does not exist or if the destination image already exists.

Permissions: AFS_READ | AFS_WRITE

addimg - add a blob to the image table
Usage: addimg image_name

Read from stdin and ask the audio file selector to create a blob in the image table. If the named blob already exists, it gets replaced with the new data.

Permissions: AFS_READ | AFS_WRITE

catimg - dump a image blob to stdout
Usage: catimg image_name

Permissions: AFS_READ

lsimg - list blobs of type image which match a pattern
Usage: lsimg [--id-sort] [--long] [--reverse] [--] [pattern...]

Print the list of all blobs which match the given pattern. If no pattern is given, the full list is printed.
-i
, --id-sort

sort by identifier

The default is to sort alphabetically by name.

-l, --long

long listing

Print identifier and name. The default is to print only the name.

-r, --reverse

reverse sort order

Permissions: AFS_READ

rmlyr - remove lyrics blob(s)
Usage: rmlyr pattern...

Remove all lyrics blobs which match any of the given patterns.

Permissions: AFS_READ | AFS_WRITE

mvlyr - rename lyrics blob(s)
Usage: mvlyr source dest

Rename lyrics source to dest. The command fails if the source lyrics does not exist or if the destination lyrics already exists.

Permissions: AFS_READ | AFS_WRITE

addlyr - add a blob to the lyrics table
Usage: addlyr lyrics_name

Read from stdin and ask the audio file selector to create a blob in the lyrics table. If the named blob already exists, it gets replaced with the new data.

Permissions: AFS_READ | AFS_WRITE

catlyr - dump a lyrics blob to stdout
Usage: catlyr lyrics_name

Permissions: AFS_READ

lslyr - list blobs of type lyrics which match a pattern
Usage: lslyr [--id-sort] [--long] [--reverse] [--] [pattern...]

Print the list of all blobs which match the given pattern. If no pattern is given, the full list is printed.
-i
, --id-sort

sort by identifier

The default is to sort alphabetically by name.

-l, --long

long listing

Print identifier and name. The default is to print only the name.

-r, --reverse

reverse sort order

Permissions: AFS_READ

COPYRIGHT

Written by Andre Noll
Copyright (C) 2024 Andre Noll
License: GNU GPL version 2
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Report bugs to Andre Noll