einsteinx2/WaveBox

libbass not working on Linux (X-Server required. Check your DISPLAY environment variable)

Closed this issue · 4 comments

I just fixed the DLL map for libbass, but I am now encountering the following while trying to use it to play back a song.

Why in the world would I need an X server to play back music? Any ideas?

2013-05-15 18:01:10,973 INFO WaveBox.Singletons.Jukebox [0] - Playing song: 02 - Peace Of Mind.flac
2013-05-15 18:01:10,973 INFO WaveBox.Singletons.Jukebox [0] - Setting up BASS
2013-05-15 18:01:10,977 INFO WaveBox.Singletons.Jukebox [0] - BASS buffer size: 500ms
2013-05-15 18:01:11,033 INFO WaveBox.Singletons.Jukebox [0] - Re-initializing BASS

Unhandled Exception: System.TypeInitializationException: An exception was thrown by the type initializer for System.Windows.Forms.WindowsFormsSynchronizationContext ---> System.TypeInitializationException: An exception was thrown by the type initializer for System.Windows.Forms.XplatUI ---> System.ArgumentNullException: Could not open display (X-Server required. Check you DISPLAY environment variable)
Parameter name: Display
  at System.Windows.Forms.XplatUIX11.SetDisplay (IntPtr display_handle) [0x00000] in <filename unknown>:0
  at System.Windows.Forms.XplatUIX11..ctor () [0x00000] in <filename unknown>:0
  at System.Windows.Forms.XplatUIX11.GetInstance () [0x00000] in <filename unknown>:0
  at System.Windows.Forms.XplatUI..cctor () [0x00000] in <filename unknown>:0
  --- End of inner exception stack trace ---
  at System.Windows.Forms.Theme.get_MenuAccessKeysUnderlined () [0x00000] in <filename unknown>:0
  at System.Windows.Forms.SystemInformation.get_MenuAccessKeysUnderlined () [0x00000] in <filename unknown>:0
  at System.Windows.Forms.Control..ctor () [0x00000] in <filename unknown>:0
  at (wrapper remoting-invoke-with-check) System.Windows.Forms.Control:.ctor ()
  at System.Windows.Forms.WindowsFormsSynchronizationContext..cctor () [0x00000] in <filename unknown>:0
  --- End of inner exception stack trace ---
  at System.Windows.Forms.Control..ctor () [0x00000] in <filename unknown>:0
  at System.Windows.Forms.ScrollableControl..ctor () [0x00000] in <filename unknown>:0
  at System.Windows.Forms.ContainerControl..ctor () [0x00000] in <filename unknown>:0
  at System.Windows.Forms.Form..ctor () [0x00000] in <filename unknown>:0
  at Un4seen.Bass.a..ctor (Boolean A_0, Int32 A_1) [0x00000] in <filename unknown>:0
  at (wrapper remoting-invoke-with-check) Un4seen.Bass.a:.ctor (bool,int)
  at Un4seen.Bass.Bass.a (System.Object A_0) [0x00000] in <filename unknown>:0

This is probably a Bass.NET issue (the .NET wrapper library we're using). I'll look into it.

As mentioned here (http://www.un4seen.com/forum/?topic=13840.msg96482#msg96482) Bass.Net ships with a few extensions that require a display, and apparently initializes them in it's constructor. I've contacted the Bass.Net developer to request a version without the WinForms requirement. If he's unable or unwilling to provide one, we'll just need to write an interop class with the methods we use and forego using Bass.Net.

Great, thanks for your help, Ben! Let me know when you hear back.

So I did hear back from him a while ago, and he was saying there's no reason it would require a display. I just haven't had time to look into it yet.