useless mpg123 processes hanging around

Home » Asterisk Users » useless mpg123 processes hanging around
Asterisk Users 7 Comments

Running Asterisk 1.6.2.11 on debian 5.0.6 with mpg123 1.4.3

when i start asterisk, i immediately see two mpg123 processes spawned
which sit there forever. I can’t imagine it’s normal behavior, but if
it is, please explain 🙂

# /etc/init.d/asterisk stop
stopping asterisk.
#[…]
# /etc/init.d/asterisk start
starting asterisk.
# psg aster
root 14573 1 0 16:29 pts/2 00:00:00 /bin/sh
/usr/sbin/safe_asterisk
root 14577 14573 0 16:29 pts/2 00:00:00 /usr/sbin/asterisk -f
-vvvg -c
root 14665 12726 0 16:33 pts/2 00:00:00 grep aster
# psg mpg123
root 14605 14577 0 16:29 pts/2 00:00:00 mpg123 -q -s –mono -r
8000 -b 2048 -f 4096 file1.mp3 file2.mp3 file3.mp3
root 14606 14605 0 16:29 pts/2 00:00:00 mpg123 -q -s –mono -r
8000 -b 2048 -f 4096 file1.mp3 file2.mp3 file3.mp3
root 14609 12726 0 16:29 pts/2 00:00:00 grep mpg

they look rather worthless:

# strace -p 14605
Process 14605 attached – interrupt to quit
select(0, NULL, NULL, NULL, {0, 152000}) = 0 (Timeout)
select(0, NULL, NULL, NULL, {0, 170000}) = 0 (Timeout)
select(0, NULL, NULL, NULL, {0, 170000}) = 0 (Timeout)
select(0, NULL, NULL, NULL, {0, 170000}) = 0 (Timeout)
select(0, NULL, NULL, NULL, {0, 170000}) = 0 (Timeout)

killing them off doesnt seem to affect anything, except when stopping
asterisk:

Beginning asterisk shutdown….
Executing last minute cleanups
== Destroying musiconhold processes
[Nov 4 16:29:39] WARNING[14554]: res_musiconhold.c:1508
moh_class_destructor: Unable to send a SIGHUP to MOH process?!!: No such
process
Asterisk cleanly ending (0).

# egrep -v ‘^$|^;’ musiconhold.conf
[general]
; decrease consumable cpu cycles and memory
; disabled by default
[default]
mode=quietmp3
directory=/var/lib/asterisk/mohmp3
sort=random

Anyone have ideas if/how I can change this behavior?

7 thoughts on - useless mpg123 processes hanging around

  • On Thu, Nov 4, 2010 at 3:51 PM, Jeremy Kister
    wrote:

    It is because you’re using quietmp3 as your mode.

  • _____

    href=”mailto:asterisk-users-bounces@lists.digium.com”>asterisk-users-bounces@lists.digium.com
    [mailto:asterisk-users-bounces@lists.digium.com] On Behalf Of Warren Selby
    Sent: Thursday, November 04, 2010 4:07 PM

    On Thu, Nov 4, 2010 at 3:51 PM, Jeremy Kister
    wrote:

    Running Asterisk 1.6.2.11 on debian 5.0.6 with mpg123 1.4.3

    when i start asterisk, i immediately see two mpg123 processes spawned
    which sit there forever. I can’t imagine it’s normal behavior, but if
    it is, please explain 🙂

    # egrep -v ‘^$|^;’ musiconhold.conf
    [general]
    ; decrease consumable cpu cycles and memory
    ; disabled by default
    [default]
    mode=quietmp3
    directory=/var/lib/asterisk/mohmp3
    sort=random

    Anyone have ideas if/how I can change this behavior?

    It is because you’re using quietmp3 as your mode.

    “Normal” Behavior is in the eye of the beholder. Is “safe-asterisk” the
    reason for 2 instances of mpg123? (just for my own information).

  • Can you explain what the processes are doing?

    killing them doesn’t affect music on hold or any other mp3 playback.

    strace shows that their behavior doesnt change during a call.

  • On Thu, Nov 4, 2010 at 4:22 PM, Jeremy Kister
    wrote:

    I’ve never really looked that closely at them, sorry. Are they causing some
    kind of issue on your box, or are you just curious?

  • just curious; i didnt think it was the expected behavior and wanted to
    fix it.

    It actually appears that the child mpg123 does do something, and the
    parent is in a continuous loop making sure the child is alive.

    So for the archives, i suppose asterisk spawns these off once so that it
    can be used as a single source for all channels, rather than spawning
    off one mpg123 for each channel.

  • In the ‘files’ mode Asterisk plays the music separately for each
    channel. If you use mpg123 or any other streamer, there is a single
    stream per class.