On Tuesday 04 August 2009 02:19:33 you wrote:
  
On Sun, 2009-08-02 at 16:45 +0300, David Baron wrote:
      
What might be a jack-enabled equivalent of:

/usr/bin/ogg123 -d alsa<1>   (<1>  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).
        
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).
      
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.
    
Done in mplayer with option -ao jack,alsa (pulse can be in this list as well)!
  



That's very handy to know.


Does anyone have an example of a bash command to check if jack is running?

ex. (untested)

!# /bin/bash

if(jack_connect 2>&1 | grep "server not running")

     alsaplayer -i text file.ogg

else

     alsaplayer -i text -o jack file.ogg

    
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.
      
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?
    
I am using the computer, possibly for listening or audio using jack or not. 
The applet needs to work regardless.
  


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?

Just a few lines or a paragraph about what you needed to do and the solution would be very useful.


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.
    
It would seem that configuration needs jack running to pulse will fail to 
start.