The Purpose of zapmcc

The zapmcc (ZapDvb Media Control Center) application provides some of the logic to combine multiple standard applications (like viewers and players) so that they can akt together as a Multi Media Center:

When using media like TV, radio, DVDs, CDs or recorded Video or Audio users will usually not be focused on starting an application, loading a file and later closing that application again. Instead one would like to choose a source (for example a TV channel, a CD or a recorded movie) and let some software decide which application to start. It is also important that applications (the CD player for example) get automatically terminated when the user wants to open another source (a TV channel for example).

For most functions zapmcc will need some sort of GUI. Currently (until version 0.50) such a preliminary GUI is provided for KDE only. That GUI is quite simple and uses the kdialog application. This has the disadvantage of being sometimes a bit slow and of not looking very appealing. On the other hand it is fairly complete and supports all important functions (notably managing background batch recording via atd and cron).

One of the ideas behind zapmcc is to make the GUI pluggable. Future versions of this software will contain a specification of the GUI protocol so that alternate GUIs can be implemented. One could even consider implementing a simple command-line interface.

KDE users usually do not call zapmcc directly. Instead they use .desktop files (e.g. menu entries) that do this for them (see KDE Example). A convenient way to call zapmcc manually would be to press the keys Alt-F2 to launch KDE's Run Command dialog and to enter something like zapmcc kill (which would stop all ZapDvb background and foreground activities).

Related Information ...

Command Line Options

The general call syntax is (options can be abbreviated to three letters, the use of the -- prefix is optional):

zapmcc [options] [--] [args...]

Calling zapmcc is the recommended method of using ZapDvb components. When no action or menu option is given, main is implied.

Options that select an Environment
cmd Do not use a GUI, run in console mode. This option is currently almost unsupported.
kde Run a KDE GUI. This option is required if nocheck is used, otherwise KDE will be auto-detected.
nocheck   Disables a check that assures that the selected GUI is running. This option is typically used in menu items of a GUI (here checking would not make sense as the menu system can't be used outside it's GUI).
lirc Initialize the LIRC programs. Starts the lircd daemon (only if not yet running), lircex, lircmd and irxevent). On exit the lircd daemon is not terminated but the other tools are. KDE's LIRC support is not used.
nowait Forks to run in background (use this to start actions from LIRC).
settop Start ZapDvb in set-top box mode - this will show the main menu with some settop box specific additions. This option is intended to be used by the zapdvb_box helper, which itself gets started via /etc/inittab in run-level 4.
Options that select a Player Action
audio Play an audio file. If needed the command shows an open file dialog to select a file. Currently Juk (recommended) and Noatun are supported.
cd Launch the CD player (currently only KSCd is supported) to play a CD.
dvd Prompts for a DVB track and launches the DVD player. Remark: MPlayer or Xine can play DVDs but this is illegal in some countries. Some distributions remove the DVD support from these programs.
radio Plays a life radio channel. A menu will open to select a channel.
radio0..3 Explicitly specify the source number (e.g one of multiple channel lists/DVB cards). radio and radio0 are synonyms. Optional argument: the name of a radio channel.
tv Shows a life TV channel. A menu will open to select a channel.
tv0..3 Explicitly specify the source number (e.g one of multiple channel lists/DVB cards). tv and tv0 are synonyms. Optional argument: the name of a tv channel.
video Play a MPEG video file. This command shows an open file dialog to select a file. Optional argument: a file or folder path can be passed.
image Start a still image viewer. Currently gwenview (preferred) and kuickshow are supported.
Menu Options
edit Start the MPEG editor to edit an audio .mp2 file or a .mpg video file. Optional argument: a file path can be passed. The function is also used to merge multiple files (as created by the zapdvb capture feature). Optional argument: a folder path can be passed.
help Display a brief usage summary and quit.
jobs Show a menu to manage background recording. Atd and cron jobs can be created, cancelled or listed from this menu.
kill Stop all ZapDvb background and foreground activities. When ZapDvb is configured to run in shared mode (e.g. where all background activities use the zapdvb user account) this option is the only way to cancel a running background job!
main Show the main menu from where most functions described in this text can be reached.
more Show the current context menu (if there is any).
quit Exit from ZapMcc without asking any question.
Navigation Options
ok Confirm the current menu or dialog.
cancel Cancel the current menu or dialog.
prev ...
next ...
first ...
last ...
exec0..9 Execute a user defined command (see [zapgop] in zapdvb.conf).
execa..f More user defined commands.
show Switch focus cycling through desktop windows.

Usage Examples

A KDE Desktop File ...
[Desktop Entry]
Encoding=UTF-8
Name=ZapDvb TV Menu
Comment=Display the ZapDvb Life TV Menu
Comment[de]=Das ZapDvb Life TV Menü anzeigen
Exec=/usr/local/bin/zapmcc --kde --nocheck --tv
Icon=tv
Type=Application
Starting the MPEG Editor to edit Captured Data...
zapmcc --edit /home/Video/Capture  # for video (see config file for path)
# or ...
zapmcc --edit /home/Audio/Capture  # for video (see config file for path)

Remarks on KDE and Artsd

Under Linux sound drivers used to be very primitive and were unable to play multiple streams at a time. To overcome this limitation KDE uses a background program that serves as a mixer (among many other things) and that is called artsd (Advanced Real Time Sound Daemon). It is relatively simple to make an application artsd aware, but many authors still don't support artsd (including MPlayer, Xine or mpg123). Unfortunately artsd opens on the sound device (for example /dev/dsp0) so that other applications do not get access.

Most applications are designed to wait until the sound device gets available again. Luckily artsd can be convinced to release the sound device after some time of inactivity so that other applications can access it (the default time is 60 seconds!). zapmcc uses the artsshell tool to set the time to release the sound device to two seconds. This helps but is still not perfect. There are two other tools that can be used to make artsd share its sound device with non artsd aware applications.


 # artscat does forward sound data via stdin to artsd ...

zapdvb sputnik -x "mpg123 -s -" | artscat

 # artscat would work in some scenarios. Unfortunately it is difficult to use
 # with zapdvb. You might need an extra shell if you want to use artscat from
 # the zapdvb.conf file:

cmdaudio0=/bin/sh -c "mpg123 -s - | artscat"

 # the other tool is artsdsp, but this does not work with all applications ..

zapdvb sputnik -x "artsdsp artsdsp mpg123 -"  # see comment in config file!

Unfortunately artsdsp does not work with MPlayer (or Xine) and artscat cannot be used either.