- Thread starter
- Moderator
- #201
@hwahrmann
1) I have pinpointed the code which is causing trouble with Rockstar
BassAudioEngine.Initialize() calling Bass.BASS_Init(0, 48000, 0, IntPtr.Zero, Guid.Empty)
BassAudioEngine.InitBass() calling Bass.BASS_Init(0, 48000, 0, IntPtr.Zero, Guid.Empty
If either of these lines are executed, Rockstar is only able to play one song until MP is restarted. I'm not sure why this is but it would be nice to get this properly fixed.
EDIT: More progress
After first playback starts, Bass.BASS_GetDevice() returns "1" which is correct device and everything works fine. But when playback is stopped, GetDevice returns "0" which is the "no sound device" initialized by above and the second playback won't work.
Then, if I use Bass.BASS_SetDevice(1) before playback, everything works fine. The problem with this is that this is an ugly hack and I don't actually know which device should be used (which device is actually the initialized one).
I'm not sure why switch to "0 no sound device" is done and where. Also I'm not sure why this no sound device should be initialized at all in MediaPortal?
2) Current BassAudioEngine code has few glitches
- Bug: if (Config.SoundDevice == "Default Sound Device") should be "Default DirectSound Device" at least in my system
- BassRegistration.BassRegistration.Register(); is called twice
- _initialized = true; is called twice (not sure if this is a bug)
I need the "No Sound" Device, because ASIO and WASAPI have their own init.
In RockStar you use the DirectSound Device. So if you have selected BASS Player and set the sounddevice in MP Config, then InitBass should select the right device.
Are you doing something in addition to what is shown ion your Stop Method? e.g. Freeing BASS?
Device Number #1 is always the default sound device set in the mixer