Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

split dependency between sound encoders and decoders #1204

Closed
totaam opened this issue May 21, 2016 · 11 comments
Closed

split dependency between sound encoders and decoders #1204

totaam opened this issue May 21, 2016 · 11 comments
Labels

Comments

@totaam
Copy link
Collaborator

totaam commented May 21, 2016

Issue migrated from trac ticket # 1204

component: sound | priority: critical | resolution: fixed

2016-05-21 13:09:48: antoine created the issue


We don't need the decoder to use the codec for encoding and vice versa.
Problem is that we probe them all at once and then register the codec name.
As of r12638, we disable opus with osx because it fails when use for encoding, but I believe it still works fine for decoding... which we should still be able to use.

@totaam
Copy link
Collaborator Author

totaam commented Jun 12, 2016

2016-06-12 05:49:46: antoine changed owner from antoine to afarr

@totaam
Copy link
Collaborator Author

totaam commented Jun 12, 2016

2016-06-12 05:49:46: antoine commented


Done in r12798. Makes the code a lot better and more readable, also helps cleaning up the changes added for #1212. Somewhat related to #1227.

It allows us to have opus decoding on osx with gstreamer 1.x, we can enable aac decoding/encoding even if we don't have the other half (decoding/encoding), ie: we may have faac but not faad. (see #1194#comment:2)

@afarr: this is mostly a FYI, the output of "xpra/sound/gstreamer_util.py -v" is a little bit different (should be clearer)


Output of GStreamer_info -v on OSX (trimmed):

* opus+gdp :
  - opusdec               gdpdepay
* opus :
  - opusdec               oggdemux

@totaam
Copy link
Collaborator Author

totaam commented Jun 25, 2016

2016-06-25 01:44:06: afarr commented


Odd... installed 0.18.0 r12856 osx client, and tried GStreamer_info -v. While I'm seeing the same "opus+gdp" output as above... I'm not seeing the same output regarding opus/opusdec (though I am seeing a missing ['oggdemux'] from ('oggdemux',) message.

I'm also seeing warning that the client is failing to import GStreamer 1.0, followed by some tracebacks:

trying to import GStreamer 1.0 using <function import_gst1 at 0x100800ed8>
import_gst1()
Warning failed to import GStreamer 1.0
Traceback (most recent call last):
  File "/Users/Schadenfreude/Desktop/xpra-catalog/xpra-ant-18-12856/Xpra.app/Contents/Resources/lib/python/xpra/sound/gstreamer_util.py", line 357, in import_gst
    _gst = import_function()
  File "/Users/Schadenfreude/Desktop/xpra-catalog/xpra-ant-18-12856/Xpra.app/Contents/Resources/lib/python/xpra/sound/gstreamer_util.py", line 229, in import_gst1
    import gi
ImportError: No module named gi

@totaam
Copy link
Collaborator Author

totaam commented Jun 25, 2016

2016-06-25 01:46:47: afarr changed owner from afarr to antoine

@totaam
Copy link
Collaborator Author

totaam commented Jun 25, 2016

2016-06-25 01:46:47: afarr commented


Come to think of it, since those clips are liable to induce some head scratching... I'll go ahead and attach the full output (and also assign this back to you, so I can feel like I'm catching up a little):

Schadenfreude:Helpers Schadenfreude$ ./GStreamer_info -v
OSX: GST_BUNDLE_CONTENTS=/Users/Schadenfreude/Desktop/xpra-catalog/xpra-ant-18-12856/Xpra.app/Contents
GStreamer 1.0 environment: {'PATH': '/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin', 'GST_PLUGIN_SCANNER': '/Users/Schadenfreude/Desktop/xpra-catalog/xpra-ant-18-12856/Xpra.app/Contents/Helpers/gst-plugin-scanner-1.0', 'GST_BUNDLE_CONTENTS': '/Users/Schadenfreude/Desktop/xpra-catalog/xpra-ant-18-12856/Xpra.app/Contents', 'GI_TYPELIB_PATH': '/Users/Schadenfreude/Desktop/xpra-catalog/xpra-ant-18-12856/Xpra.app/Contents/Resources/lib/girepository-1.0', 'GST_PLUGIN_PATH': '/Users/Schadenfreude/Desktop/xpra-catalog/xpra-ant-18-12856/Xpra.app/Contents/Resources/lib/gstreamer-1.0'}
GStreamer 1.0 sys.path=, /Users/Schadenfreude/Desktop/xpra-catalog/xpra-ant-18-12856/Xpra.app/Contents/Resources/lib/pygtk/2.0, /Users/Schadenfreude/Desktop/xpra-catalog/xpra-ant-18-12856/Xpra.app/Contents/Resources/lib/python, /Users/Schadenfreude/Desktop/xpra-catalog/xpra-ant-18-12856/Xpra.app/Contents/Resources/lib/python/lib-dynload, /Users/Schadenfreude/Desktop/xpra-catalog/xpra-ant-18-12856/Xpra.app/Contents/Resources/lib, /Users/Schadenfreude/Desktop/xpra-catalog/xpra-ant-18-12856/Xpra.app/Contents/Helpers, /Users/Schadenfreude/Desktop/xpra-catalog/xpra-ant-18-12856/Xpra.app/Contents/Resources/lib/python27.zip, /Users/Schadenfreude/Desktop/xpra-catalog/xpra-ant-18-12856/Xpra.app/Contents/Resources/lib/python2.7, /Users/Schadenfreude/Desktop/xpra-catalog/xpra-ant-18-12856/Xpra.app/Contents/Resources/lib/python2.7/plat-darwin, /Users/Schadenfreude/Desktop/xpra-catalog/xpra-ant-18-12856/Xpra.app/Contents/Resources/lib/python2.7/plat-mac, /Users/Schadenfreude/Desktop/xpra-catalog/xpra-ant-18-12856/Xpra.app/Contents/Resources/lib/python2.7/plat-mac/lib-scriptpackages, /Users/Schadenfreude/Desktop/xpra-catalog/xpra-ant-18-12856/Xpra.app/Contents/Resources/lib/python2.7/lib-tk, /Users/Schadenfreude/Desktop/xpra-catalog/xpra-ant-18-12856/Xpra.app/Contents/Resources/lib/python2.7/lib-old, /Users/Schadenfreude/Desktop/xpra-catalog/xpra-ant-18-12856/Xpra.app/Contents/Resources/lib/python2.7/lib-dynload, /Users/Schadenfreude/Desktop/xpra-catalog/xpra-ant-18-12856/Xpra.app/Contents/Resources/lib/python/lib/python2.7/site-packages.zip, /Users/Schadenfreude/Desktop/xpra-catalog/xpra-ant-18-12856/Xpra.app/Contents/Resources/lib/python/lib/python2.7/site-packages
trying to import GStreamer 1.0 using <function import_gst1 at 0x100800ed8>
import_gst1()
Warning failed to import GStreamer 1.0
Traceback (most recent call last):
  File "/Users/Schadenfreude/Desktop/xpra-catalog/xpra-ant-18-12856/Xpra.app/Contents/Resources/lib/python/xpra/sound/gstreamer_util.py", line 357, in import_gst
    _gst = import_function()
  File "/Users/Schadenfreude/Desktop/xpra-catalog/xpra-ant-18-12856/Xpra.app/Contents/Resources/lib/python/xpra/sound/gstreamer_util.py", line 229, in import_gst1
    import gi
ImportError: No module named gi
OSX: GST_BUNDLE_CONTENTS=/Users/Schadenfreude/Desktop/xpra-catalog/xpra-ant-18-12856/Xpra.app/Contents
GStreamer 0.10 environment: {'PATH': '/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/bin', 'GST_PLUGIN_SCANNER': '/Users/Schadenfreude/Desktop/xpra-catalog/xpra-ant-18-12856/Xpra.app/Contents/Helpers/gst-plugin-scanner-0.10', 'GST_BUNDLE_CONTENTS': '/Users/Schadenfreude/Desktop/xpra-catalog/xpra-ant-18-12856/Xpra.app/Contents', 'GST_PLUGIN_PATH': '/Users/Schadenfreude/Desktop/xpra-catalog/xpra-ant-18-12856/Xpra.app/Contents/Resources/lib/gstreamer-0.10'}
GStreamer 0.10 sys.path=, /Users/Schadenfreude/Desktop/xpra-catalog/xpra-ant-18-12856/Xpra.app/Contents/Resources/lib/pygtk/2.0, /Users/Schadenfreude/Desktop/xpra-catalog/xpra-ant-18-12856/Xpra.app/Contents/Resources/lib/python, /Users/Schadenfreude/Desktop/xpra-catalog/xpra-ant-18-12856/Xpra.app/Contents/Resources/lib/python/lib-dynload, /Users/Schadenfreude/Desktop/xpra-catalog/xpra-ant-18-12856/Xpra.app/Contents/Resources/lib, /Users/Schadenfreude/Desktop/xpra-catalog/xpra-ant-18-12856/Xpra.app/Contents/Helpers, /Users/Schadenfreude/Desktop/xpra-catalog/xpra-ant-18-12856/Xpra.app/Contents/Resources/lib/python27.zip, /Users/Schadenfreude/Desktop/xpra-catalog/xpra-ant-18-12856/Xpra.app/Contents/Resources/lib/python2.7, /Users/Schadenfreude/Desktop/xpra-catalog/xpra-ant-18-12856/Xpra.app/Contents/Resources/lib/python2.7/plat-darwin, /Users/Schadenfreude/Desktop/xpra-catalog/xpra-ant-18-12856/Xpra.app/Contents/Resources/lib/python2.7/plat-mac, /Users/Schadenfreude/Desktop/xpra-catalog/xpra-ant-18-12856/Xpra.app/Contents/Resources/lib/python2.7/plat-mac/lib-scriptpackages, /Users/Schadenfreude/Desktop/xpra-catalog/xpra-ant-18-12856/Xpra.app/Contents/Resources/lib/python2.7/lib-tk, /Users/Schadenfreude/Desktop/xpra-catalog/xpra-ant-18-12856/Xpra.app/Contents/Resources/lib/python2.7/lib-old, /Users/Schadenfreude/Desktop/xpra-catalog/xpra-ant-18-12856/Xpra.app/Contents/Resources/lib/python2.7/lib-dynload, /Users/Schadenfreude/Desktop/xpra-catalog/xpra-ant-18-12856/Xpra.app/Contents/Resources/lib/python/lib/python2.7/site-packages.zip, /Users/Schadenfreude/Desktop/xpra-catalog/xpra-ant-18-12856/Xpra.app/Contents/Resources/lib/python/lib/python2.7/site-packages
trying to import GStreamer 0.10 using <function import_gst0_10 at 0x100800f50>
import_gst0_10()
import_gst0_10() pygst=<module 'pygst' from '/Users/Schadenfreude/Desktop/xpra-catalog/xpra-ant-18-12856/Xpra.app/Contents/Resources/lib/python/pygst.pyc'>
Python GStreamer version 0.10.36 for Python 2.7
Loaded Python GStreamer version 0.10.36 for Python 2.7
found the following plugins: ['3gppmux', 'aacparse', 'ac3parse', 'amrparse', 'appsink', 'appsrc', 'audioamplify', 'audiochebband', 'audiocheblimit', 'audioconvert', 'audiodynamic', 'audioecho', 'audiofirfilter', 'audioiirfilter', 'audioinvert', 'audiokaraoke', 'audiopanorama', 'audiorate', 'audioresample', 'audiotestsrc', 'audiowsincband', 'audiowsinclimit', 'bin', 'capsfilter', 'dcaparse', 'faac', 'faad', 'fakesink', 'fakesrc', 'fdsink', 'fdsrc', 'filesink', 'filesrc', 'flacparse', 'funnel', 'gdpdepay', 'gdppay', 'gppmux', 'identity', 'input-selector', 'ismlmux', 'lame', 'lamemp3enc', 'mad', 'matroskademux', 'matroskamux', 'matroskaparse', 'mj2mux', 'mp3parse', 'mp4mux', 'mpegaudioparse', 'multiqueue', 'opusdec', 'opusenc', 'opusparse', 'oss4mixer', 'oss4sink', 'oss4src', 'osxaudiosink', 'osxaudiosrc', 'output-selector', 'pipeline', 'qtdemux', 'qtmoovrecover', 'qtmux', 'queue', 'queue2', 'rtpopusdepay', 'rtpopuspay', 'rtpxqtdepay', 'tee', 'typefind', 'valve', 'volume', 'wavenc', 'wavparse', 'webmmux', 'xingmux']
GStreamer plugins found: 3gppmux, aacparse, ac3parse, amrparse, appsink, appsrc, audioamplify, audiochebband, audiocheblimit, audioconvert, audiodynamic, audioecho, audiofirfilter, audioiirfilter, audioinvert, audiokaraoke, audiopanorama, audiorate, audioresample, audiotestsrc, audiowsincband, audiowsinclimit, bin, capsfilter, dcaparse, faac, faad, fakesink, fakesrc, fdsink, fdsrc, filesink, filesrc, flacparse, funnel, gdpdepay, gdppay, gppmux, identity, input-selector, ismlmux, lame, lamemp3enc, mad, matroskademux, matroskamux, matroskaparse, mj2mux, mp3parse, mp4mux, mpegaudioparse, multiqueue, opusdec, opusenc, opusparse, oss4mixer, oss4sink, oss4src, osxaudiosink, osxaudiosrc, output-selector, pipeline, qtdemux, qtmoovrecover, qtmux, queue, queue2, rtpopusdepay, rtpopuspay, rtpxqtdepay, tee, typefind, valve, volume, wavenc, wavparse, webmmux, xingmux

GStreamer version: 0.10.36
PyGStreamer version: 0.10.22

missing ['vorbisenc'] from ('vorbisenc', 'gdppay')
missing ['vorbisdec'] from ('vorbisdec', 'gdpdepay')
missing ['vorbisenc'] from ('vorbisenc', 'webmmux')
missing ['vorbisdec'] from ('vorbisdec', 'matroskademux')
missing ['flacenc', 'oggmux'] from ('flacenc', 'oggmux')
missing ['flacdec', 'oggdemux'] from ('flacdec', 'oggdemux')
missing ['flacenc'] from ('flacenc', 'gdppay')
missing ['flacdec'] from ('flacparse ! flacdec', 'gdpdepay')
missing ['oggmux'] from ('opusenc', 'oggmux')
missing ['oggdemux'] from ('opusdec', 'oggdemux')
avoiding opus+gdp on Mac OS X
missing ['speexenc', 'oggmux'] from ('speexenc', 'oggmux')
missing ['speexdec', 'oggdemux'] from ('speexdec', 'oggdemux')
missing ['speexenc'] from ('speexenc', 'gdppay')
missing ['speexdec'] from ('speexdec', 'gdpdepay')
missing ['wavpackenc'] from ('wavpackenc', None)
missing ['wavpackparse', 'wavpackdec'] from ('wavpackparse ! wavpackdec', None)
initialized sound codecs:
  - encoder/decoder       (de)payloader         stream-compressor     
* opus+gdp :
  - opusdec               gdpdepay                                    
* mp3 :
  - lamemp3enc                                                        
  - mp3parse ! mad                                                    
* aac+gdp :
  - faac                  gdppay                                      
  - faad                  gdpdepay                                    
* aac+mpeg4 :
  - faac                  mp4mux                                      
  - faad                  qtdemux                                     
* raw+gdp+lz4 :
  -                       gdppay                lz4                   
  -                       gdpdepay              lz4                   
* raw+gdp+lzo :
  -                       gdppay                lzo                   
  -                       gdpdepay              lzo                   
* raw+gdp :
  -                       gdppay                                      
  -                       gdpdepay                                    
* wav+lz4 :
  - wavenc                                      lz4                   
  - wavparse                                    lz4                   
* wav+lzo :
  - wavenc                                      lzo                   
  - wavparse                                    lzo                   
* wav :
  - wavenc                                                            
  - wavparse                                                          
encoders:           mp3, aac+gdp, aac+mpeg4, raw+gdp+lz4, raw+gdp+lzo, raw+gdp, wav+lz4, wav+lzo, wav
decoders:           opus+gdp, mp3, aac+gdp, aac+mpeg4, raw+gdp+lz4, raw+gdp+lzo, raw+gdp, wav+lz4, wav+lzo, wav
missing ['oggmux'] from ('oggmux',)
muxers:             gdp, mka, mpeg4
missing ['oggdemux'] from ('oggdemux',)
demuxers:           gdp, mka, mpeg4
stream compressors: lz4, lzo
get_source_plugins() no pulsesrc: No module named pulseaudio.pulseaudio_util
source plugins:     osxaudiosrc, oss4src, osxaudiosrc, audiotestsrc
get_sink_plugins() no pulsesink: No module named pulseaudio.pulseaudio_util
sink plugins:       osxaudiosink, oss4sink
get_default_sink() no pulsesink: No module named pulseaudio.pulseaudio_util
get_sink_plugins() no pulsesink: No module named pulseaudio.pulseaudio_util
default sink:       osxaudiosink

@totaam
Copy link
Collaborator Author

totaam commented Jun 25, 2016

2016-06-25 06:02:22: antoine changed owner from antoine to afarr

@totaam
Copy link
Collaborator Author

totaam commented Jun 25, 2016

2016-06-25 06:02:22: antoine commented


All the problems come from ImportError: No module named gi: without this you don't get the bindings for gstreamer 1.x, and you'll be missing a lot of codecs as a result.

And since the only osx build for r12856 is a 64-bit one, I'll guess that this is the one you used for testing. 64-bit builds are not ready yet, see #840. r12903 will make it more prominent by showing "64-bit" in the version string.

Try again with a regular build and things should work (I've just tested again).

@totaam
Copy link
Collaborator Author

totaam commented Jul 12, 2016

2016-07-12 17:52:23: antoine commented


Milestone renamed

@totaam
Copy link
Collaborator Author

totaam commented Aug 19, 2016

2016-08-19 21:16:56: afarr changed status from new to closed

@totaam
Copy link
Collaborator Author

totaam commented Aug 19, 2016

2016-08-19 21:16:56: afarr set resolution to fixed

@totaam
Copy link
Collaborator Author

totaam commented Aug 19, 2016

2016-08-19 21:16:56: afarr commented


Well well, tried again with 1.0 13165 osx client, and lo it worked as previously hoped.

GStreamer version: 1.6.4.0
PyGStreamer version: 3.16.2

skipping flac+ogg to avoid obscure 'not-negotiated' errors
missing ['mp3parse'] from ('mp3parse ! mad', None)
skipping wav+lzo: missing lzo
avoiding opus+gdp on Mac OS X
skipping raw+gdp+lzo: missing lzo
initialized sound codecs:
  - encoder/decoder       (de)payloader         stream-compressor     
* opus+gdp :
  - opusdec               gdpdepay                                    
* opus+ogg :
  - opusenc               oggmux                                      
  - opusdec               oggdemux                                    
* vorbis+gdp :
  - vorbisenc             gdppay                                      
  - vorbisdec             gdpdepay                                    
* vorbis+mka :
  - vorbisenc             webmmux                                     
  - vorbisdec             matroskademux                               
* flac+gdp :
  - flacenc               gdppay                                      
  - flacparse ! flacdec   gdpdepay                                    
* mp3 :
  - lamemp3enc                                                        
  - mpegaudioparse ! mad                                              
* aac+gdp :
  - faac                  gdppay                                      
  - faad                  gdpdepay                                    
* aac+mpeg4 :
  - faac                  mp4mux                                      
  - faad                  qtdemux                                     
* raw+gdp+lz4 :
  -                       gdppay                lz4                   
  -                       gdpdepay              lz4                   
* raw+gdp :
  -                       gdppay                                      
  -                       gdpdepay                                    
* wav+lz4 :
  - wavenc                                      lz4                   
  - wavparse                                    lz4                   
* wav :
  - wavenc                                                            
  - wavparse                                                          
* wavpack :
  - wavpackenc                                                        
  - wavpackparse ! wavpackdec                                            
* speex+gdp :
  - speexenc              gdppay                                      
  - speexdec              gdpdepay                                    
* speex+ogg :
  - speexenc              oggmux                                      
  - speexdec              oggdemux                                    
encoders:           opus+ogg, vorbis+gdp, vorbis+mka, flac+gdp, mp3, aac+gdp, aac+mpeg4, raw+gdp+lz4, raw+gdp, wav+lz4, wav, wavpack, speex+gdp, speex+ogg
decoders:           opus+gdp, opus+ogg, vorbis+gdp, vorbis+mka, flac+gdp, mp3, aac+gdp, aac+mpeg4, raw+gdp+lz4, raw+gdp, wav+lz4, wav, wavpack, speex+gdp, speex+ogg
muxers:             gdp, ogg, mka, mpeg4
demuxers:           gdp, ogg, mka, mpeg4
stream compressors: lz4
get_source_plugins() no pulsesrc: No module named pulseaudio.pulseaudio_util
source plugins:     osxaudiosrc, oss4src, osxaudiosrc, audiotestsrc
get_sink_plugins() no pulsesink: No module named pulseaudio.pulseaudio_util
sink plugins:       osxaudiosink, oss4sink
get_default_sink() no pulsesink: No module named pulseaudio.pulseaudio_util
get_sink_plugins() no pulsesink: No module named pulseaudio.pulseaudio_util
default sink:       osxaudiosink

I would just note that the GStreamer info in the Xpra.app/Contents/Resources/bin directory does not work as elegantly (I had to kill the terminal tab to get out of the shell created)... on the other hand, Xpra.app/Contents/Helpers/GStreamer_info is quite handy.

Closing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant