<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
  <meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
<blockquote cite="mid:200908032340.46394.d_baron@012.net.il" type="cite">
  <pre wrap="">On Tuesday 04 August 2009 02:19:33 you wrote:
  </pre>
  <blockquote type="cite">
    <blockquote type="cite">
      <pre wrap="">On Sun, 2009-08-02 at 16:45 +0300, David Baron wrote:
      </pre>
      <blockquote type="cite">
        <pre wrap="">What might be a jack-enabled equivalent of:

/usr/bin/ogg123 -d alsa&lt;1&gt;   (&lt;1&gt;  is and ogg file, obviously)

Preferrable would be something that will play through jack if the daemon
be running, alsa not (mplayer can work this way but this is a bit heavy
for a short file play, i.e., a signal from a program).
        </pre>
      </blockquote>
      <pre wrap="">mplayer fits the bill perfectly imho and I'm not convinced that it's
that heavy - it actually uses very little memory when just playing a
sound file (mp3, ogg, wave).
      </pre>
    </blockquote>
    <pre wrap="">Does mplayer auto sense if jack is being used and fall back to
pulse/gstreamer/esd/alsa/oss if not? Maybe David just needs a small
script that willl check the existance of a running jack and trigger the
correct commandline.
    </pre>
  </blockquote>
  <pre wrap=""><!---->Done in mplayer with option -ao jack,alsa (pulse can be in this list as well)!
  </pre>
</blockquote>
<br>
<br>
<br>
That's very handy to know.<br>
<br>
<br>
<blockquote cite="mid:200908032340.46394.d_baron@012.net.il" type="cite">
  <blockquote type="cite">
    <pre wrap="">Does anyone have an example of a bash command to check if jack is running?

ex. (untested)

!# /bin/bash

if(jack_connect 2&gt;&amp;1 | grep "server not running")

     alsaplayer -i text file.ogg

else

     alsaplayer -i text -o jack file.ogg

    </pre>
    <blockquote type="cite">
      <pre wrap="">If you want a program to have "signal sounds" an external sound player
is bulky regardless of the player used. Jack itself also sounds a bit
overkill. This sounds like the use-case for system sounds, esd, pulse,
etc.
      </pre>
    </blockquote>
    <pre wrap="">I agree. Do you want this feature to work so that you can hear the phone
calls when jack is running or do you have a more specific need for
piping the audio through jack?
    </pre>
  </blockquote>
  <pre wrap=""><!---->I am using the computer, possibly for listening or audio using jack or not. 
The applet needs to work regardless.
  </pre>
</blockquote>
<br>
<br>
I have a hunch that this will become a very common scenario so I might
whip up a quick toot for this problem as an example for future
reference... Would you be interested in added a section on your
experience?<br>
<br>
Just a few lines or a paragraph about what you needed to do and the
solution would be very useful.<br>
<br>
<br>
<blockquote cite="mid:200908032340.46394.d_baron@012.net.il" type="cite">
  <blockquote type="cite">
    <pre wrap="">IIUC the latest version of pulse will use jack if it is running and
reconfigure itself to use alsa directly when it is not running. This is
the point of the dbus code.

However I'm not 100% certain that Kjetils suggested method is the
correct way to achieve this. I was under the impression that the latest
version didn't need to be configured at all. The dbus code in jack2
would take care of the call to reconfigure the i/o sinks. I think
Kjetils suggestion means that jack has to be always on before pa is
started.
    </pre>
  </blockquote>
  <pre wrap=""><!---->It would seem that configuration needs jack running to pulse will fail to 
start.
  </pre>
</blockquote>
</body>
</html>