xpra icon
Bug tracker and wiki

Changes between Version 22 and Version 23 of Sound


Ignore:
Timestamp:
12/11/13 10:19:37 (7 years ago)
Author:
Antoine Martin
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Sound

    v22 v23  
     1{{{#!div class="box"
    12= Sound =
    23
    34Once the sound has started forwarding (and not before), you may get more diagnostic messages by setting {{{XPRA_SOUND_DEBUG=1}}}. (see [/wiki/Debugging Debugging])
    45{{{XPRA_SOUND_QUEUE_TIME}}} can be used to control the default amount of buffering on the receiver.
     6}}}
    57
     8
     9{{{#!div class="box"
    610== Status and Platform Quircks ==
    7 Sound is fairly stable in v0.9.x onwards on Posix platforms, as long as you use the latest version (see #396), there are still quirks to be ironed out for MS Windows (see #362) and OSX (see #379)
     11Sound is fairly stable in v0.9.x onwards on Posix platforms, as long as you use the latest version (see #396), there are still quirks to be ironed out for MS Windows (see #362) and OSX (see #379).
     12[[BR]]
     13The only codec that is widely used is '''mp3'''.
     14
     15[[BR]]
    816
    917Useful development documentation:
     
    1220* [http://gstreamer.freedesktop.org/data/doc/gstreamer/head/manual/html/chapter-buffering.html Buffering]
    1321* [http://docs.gstreamer.com/display/GstSDK/Basic+tutorial+12%3A+Streaming Basic tutorial: Streaming]
     22}}}
    1423
    1524
     25{{{#!div class="box"
    1626== Requirements ==
    1727You will need:
     
    2030* a server with pulseaudio installed (for going beyond the simple test step)
    2131* users must be "pulseaudio-enabled" - whatever that means in terms of permissions and user setup (policy, user group, etc: this is distribution specific)
     32}}}
    2233
     34
     35{{{#!div class="box"
    2336== Standalone Tests ==
    2437You can run the following test commands to run/test individual parts of the sound pipeline:
     
    2942* {{{./xpra/sound/src.py}}} will dump the sound coming from the pulseaudio server to a file until interrupted (named {{{Sound_Record.exe}}} on MS Windows)
    3043* {{{./xpra/sound/sink.py}}} will play a sound file until interrupted - a "cheap mp3 player" ({{{Sound_Play.exe}}} on MS Windows)
     44}}}
    3145
    3246
     47{{{#!div class="box"
    3348== Test Sound Source Setup ==
    3449The easiest way of testing that a system is capable of forwarding and receiving sound is on a Posix system (Linux, BSD, etc).
     
    4358You should then hear a constant (rather annoying) tone.
    4459Getting this far ensures that sound forwarding does work on this system, albeit from a fake source instead of a pulseaudio server.
     60}}}
    4561
    4662
     63{{{#!div class="box"
    4764== Test Sound Output ==
    4865Since we use [http://gstreamer.freedesktop.org/ GStreamer] for sound support, the first thing to do is to check if gstreamer sound output works on your system.
     
    5370If the {{{autoaudiosink}}} does not work for you, you may want to try other options (availability varies): {{{pulsesink}}} ({{{PulseAudio}}}), {{{osxaudiosink}}} (OSX), {{{directsoundsink}}} (MS Windows), {{{alsasink}}} / {{{osssink}}} / {{{oss4sink}}} / {{{jackaudiosink}}} (Posix).
    5471If this does not work, please refer to [http://gstreamer.freedesktop.org/data/doc/gstreamer/head/gstreamer/html/gst-running.html Running GStreamer Applications] documentation (in particular {{{GST_DEBUG}}})
     72}}}
    5573
     74
     75{{{#!div class="box"
    5676== Simple Diagnostics ==
    5777Things to look for:
     
    6585}}}
    6686* {{{pavucontrol}}} both on the client and inside the xpra session (see example screenshots below)
     87}}}
    6788
     89
     90{{{#!div class="box"
    6891== Using an existing pulseaudio server ==
    6992Next, we want to add pulseaudio, but without starting it ourselves, so we can simply re-use the existing server that gets started with most modern desktops.
     
    90113}}}
    91114Getting this far should ensure that all the components are installed, enabled and that the xpra server found the pulseaudio device to connect to.
     115}}}
    92116
     117
     118{{{#!div class="box"
    93119== Test Remote Setup ==
    94120Using a second client machine (or a second desktop session, virtual machine, etc), we can connect this new client to the server and get the sound from the desktop session forwarded to the client.
     
    96122{{{pavucontrol}}} on the server should show an Xpra entry in the {{{Recording}}} tab.
    97123The client should show an Xpra entry in the {{{Playback}}} tab (or whatever mixer/sound tool you have installed) - see screenshots below.
     124}}}
    98125
     126
     127{{{#!div class="box"
    99128== Full Setup ==
    100129Finally, we may want an xpra session to use a dedicated pulseaudio server.
     
    135164
    136165And yet more log messages as your start a sound application in this xpra session.
     166}}}
    137167
     168
     169{{{#!div class="box"
    138170== ALSA, OSS, etc ==
    139171The instructions above will make sound work with all applications that use pulseaudio for output.
    140172For those that do not, please see [http://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/PerfectSetup PulseAudio Perfect Setup] to route their sound to pulseaudio.
     173}}}
    141174
    142175
    143 
     176{{{#!div class="box"
    144177== Screenshots ==
    145178* Sound information displayed on session info (with speaker enabled and running and microphone disabled):
     
    154187[[BR]]
    155188[[Image(/raw-attachment/wiki/Sound/pavucontrol-server.png)]]
     189}}}