Xpra: Ticket #662: Audio usability improvements

Please allow audio codec selection from menu (similar to video encodings). Also please introduce per-codec audio buffering config options. Also it will be useful to have audio codec priority order config option to change hardcoded CODEC_ORDER = [MP3, WAVPACK, WAV, FLAC, SPEEX]. Thanks.



Sun, 24 Aug 2014 04:12:25 GMT - Antoine Martin: owner, status changed; milestone set

Please allow audio codec selection from menu (similar to video encodings).


The codecs are defined in the order that has been most tested, I fear that flac and speex are likely to not work very well out of the box, if at all. Exposing them via the gui would make it more likely that the user would end up with a non functional sound setup.

Also please introduce per-codec audio buffering config options.


Hmm could do. I would prefer if we chose the right buffering options for each encoding automatically, which might be do-able, just needs time spent testing all the platforms and network combinations. Of which there are many. And since it works well enough with mp3 on most platforms, and that wavpack works well enough as a fallback... there is little incentive to work on this.

That said, you can play with:

XPRA_SOUND_QUEUE_TIME=450 xpra attach ...

And if you find a better value, re-assign to afarr for further testing and maybe we can tweak the defaults. Per-codec, and per-platform if needed.

The one thing that is in favour of this change is usage over very jittery connections, like 3G, but since we have statistical data on the connection latency we could take this into account to calculate an appropriate buffer delay / size automatically.

Note: the reason why the default buffer queue is so long is because on some platforms (OSX: #379), overruns and underruns are expensive to deal with. Other related tickets: #362, #400


useful to have audio codec priority order config option to change hardcoded


To some extent, you can already affect this order by omitting some codecs from the speaker-codec and microphone-codec lists.


Mon, 13 Jul 2015 05:30:39 GMT - rektide: cc set


Fri, 17 Jun 2016 08:01:59 GMT - Antoine Martin: owner, status changed

The codec order will honour the speaker-codec and microphone-codec options, trivial fix in r12849 (which I may backport). It will still default to the pre-defined codec order if those command line / config file options are left unset. You can see these default values by running xpra _sound_query.


As for the buffering suggestion, that's unlikely to change because:

and unless proven otherwise, the defaults (vorbis or opus) are the best codecs for almost every possible use case - both in terms of quality, compression ratio and latency: #1074


Tue, 12 Jul 2016 16:51:50 GMT - Antoine Martin: milestone changed

Milestone renamed


Sun, 21 Aug 2016 09:55:49 GMT - Antoine Martin: milestone changed

Milestone renamed


Wed, 15 Feb 2017 11:35:26 GMT - Antoine Martin: status changed; resolution set

As per comment:3, closing.


Sat, 23 Jan 2021 05:02:17 GMT - migration script:

this ticket has been moved to: https://github.com/Xpra-org/xpra/issues/662