Version 2.8.0 beta (2 Viewers)

Symphy

Retired Team Member
  • Premium Supporter
  • August 25, 2007
    501
    151
    Groningen
    Home Country
    Netherlands Netherlands
    @Helios61
    Thanx for the logs. Good testing! Scrolling further down in your first log would have told me MP does play it correctly :)

    I think the problem is PureAudio not handling the 5.0 channellayout properly. It tries to initialize the WASAPI device to 5 channels which is probably not supported. Instead it should map to a 5.1 configuration.

    Hopefully i can find some time coming weekend to fix it!
     

    Wiedmann

    Portal Pro
    June 22, 2007
    107
    28
    Home Country
    Germany Germany
    • Added WASAPI support.
    Fine, a step forward :)

    In a first test on my desktop (not htpc) WASAPI Exclusive is working, but not in Event mod (only Push). Of course this is normally working with my sound device. Maybe a problem with BASSWASAPIFormat?
    Code:
    [2014-01-29 23:11:24,955] [Log    ] [PureAudio.Main] [INFO ] - Determined stream content type: PCM
    [2014-01-29 23:11:24,958] [Log    ] [PureAudio.Main] [DEBUG] - Starting session...
    [2014-01-29 23:11:24,959] [Log    ] [PureAudio.Main] [DEBUG] - BASSPlayer.ResetSessionState() called...
    [2014-01-29 23:11:24,961] [Log    ] [PureAudio.Main] [DEBUG] - Stream info: chans = 2, freq = 44100, origres = 0, ctype = BASS_CTYPE_STREAM_MP3
    [2014-01-29 23:11:24,965] [Log    ] [PureAudio.Main] [DEBUG] - Initializing WASAPI device: Lautsprecher (SoundMAX Integrated Digital HD Audio)...
    [2014-01-29 23:11:25,043] [Log    ] [PureAudio.Main] [INFO ] - Using WASAPI Device Lautsprecher (SoundMAX Integrated Digital HD Audio)
    [2014-01-29 23:11:25,047] [Log    ] [PureAudio.Main] [DEBUG] - Device info: outputs = 2, minrate = 8000, maxrate = 192000, latency = 50
    [2014-01-29 23:11:25,049] [Log    ] [PureAudio.Main] [DEBUG] - Creating new ringbuffer with 2000 ms delay...
    [2014-01-29 23:11:25,053] [Log    ] [PureAudio.Main] [DEBUG] - Creating sinkstream...
    [2014-01-29 23:11:25,058] [Log    ] [PureAudio.Main] [DEBUG] - Preparing mixerstream...
    [2014-01-29 23:11:25,059] [Log    ] [PureAudio.Main] [DEBUG] - Using 2 channels...
    [2014-01-29 23:11:25,059] [Log    ] [PureAudio.Main] [DEBUG] - Creating mixerstream...
    [2014-01-29 23:11:25,115] [Log    ] [PureAudio.Main] [DEBUG] - Plugging sinkstream into mixer...
    [2014-01-29 23:11:25,117] [Log    ] [PureAudio.Main] [DEBUG] - Mixing Matrix: matrix[0, 0] = 1
    [2014-01-29 23:11:25,118] [Log    ] [PureAudio.Main] [DEBUG] - Mixing Matrix: matrix[0, 1] = 0
    [2014-01-29 23:11:25,118] [Log    ] [PureAudio.Main] [DEBUG] - Mixing Matrix: matrix[1, 0] = 0
    [2014-01-29 23:11:25,119] [Log    ] [PureAudio.Main] [DEBUG] - Mixing Matrix: matrix[1, 1] = 1
    [2014-01-29 23:11:25,126] [Log    ] [PureAudio.Main] [DEBUG] - Creating WASAPI outputstream...
    [2014-01-29 23:11:25,128] [Log    ] [PureAudio.Main] [DEBUG] - Plugging mixerstream into outputmixer...
    [2014-01-29 23:11:25,130] [Log    ] [PureAudio.Main] [DEBUG] - Creating visualization stream...
    [2014-01-29 23:11:25,139] [Log    ] [PureAudio.Main] [DEBUG] - Initializing WASAPI handler...
    [2014-01-29 23:11:25,215] [Error  ] [PureAudio.Main] [ERROR] - PureAudio: _WASAPIHandler.Init failed: BASS_ERROR_UNKNOWN.
    Must do a deeper look...

    About the source code:
    - The current Post/PreBuild - scripts doesn't work for me, because I have spaces in my paths. You have to quote these.
    - "High-End Music Player Plugin" is a good description. Should also be set in xmp2. And the current plugin requires MediaPortal 1.6.0, and not 1.2.0.

    Just look at my diff to get an idea.

    Update:
    On my HTPC with a different sound device event mode is also not working.
     

    Attachments

    • PureAudio.diff
      6.5 KB
    Last edited:

    Symphy

    Retired Team Member
  • Premium Supporter
  • August 25, 2007
    501
    151
    Groningen
    Home Country
    Netherlands Netherlands
    @Wiedmann
    Thanx for your input. Even though you seem to be the only one with spaces in your development paths :), i can agree with your proposed changes, and will include them in the next release. May just remove the 1.2.0 dependency from the xmp2 though, doesn't seem functional.

    Have you verified the wasapi event mode of your audiodevices actually do work with other software like foobar? Not all devices support it...
     

    Symphy

    Retired Team Member
  • Premium Supporter
  • August 25, 2007
    501
    151
    Groningen
    Home Country
    Netherlands Netherlands
    @Helios61

    Could you test this for me? Should play 5.0 flacs correctly.
     

    Attachments

    • PureAudio_0.2.8.0_Beta_50fix.mpe1
      105 KB

    Symphy

    Retired Team Member
  • Premium Supporter
  • August 25, 2007
    501
    151
    Groningen
    Home Country
    Netherlands Netherlands
    Been playing around with event mode...
    On my onboard realtek device the combi exclusive/event doesn't work either. Shared/event does.
    On my esi maya44 both combi's work.
    Either the realtek doesn't support exclusive/event or there's a bug in the BASS lib. Not much i can do about it right now.
     

    Helios61

    Retired Team Member
  • Premium Supporter
  • January 30, 2008
    4,587
    873
    62
    NRW
    Home Country
    Germany Germany
    Hi @Symphy !

    Thanks for your efforts, but unfortunately with the new version playback of this file doesn't start. Logs are attached.

    Best regards,
    Helios
     

    Symphy

    Retired Team Member
  • Premium Supporter
  • August 25, 2007
    501
    151
    Groningen
    Home Country
    Netherlands Netherlands
    @Helios61
    Thanx for the test. Did you run that test with event mode enabled or disabled? Could you send that file to me?
     

    Wiedmann

    Portal Pro
    June 22, 2007
    107
    28
    Home Country
    Germany Germany
    @Wiedmann
    Even though you seem to be the only one with spaces in your development paths
    Ok, for me that's: "%VisualStudioDir%\Projects\MediaPortal\pureaudio-mediaportal-plugin"
    with "%VisualStudioDir%": "%USERPROFILE%\Documents\Visual Studio 2010"
    (and "%USERPROFILE%" is also having a space)

    Have you verified the wasapi event mode of your audiodevices actually do work with other software like foobar? Not all devices support it...
    With foobar it's working.


    Been playing around with event mode...
    On my onboard realtek device the combi exclusive/event doesn't work either. Shared/event does.
    On my esi maya44 both combi's work.
    Either the realtek doesn't support exclusive/event or there's a bug in the BASS lib. Not much i can do about it right now.

    This code is also working:
    Code:
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    
    using Un4seen.Bass;
    using Un4seen.BassWasapi;
    using Un4seen.Bass.AddOn.Mix;
    
    namespace BassTest
    {
        class Program
        {
            static void Main(string[] args)
            {
                try
                {
                    BassWasapiHandler _wasapi;
    
                    Bass.BASS_Init(-1, 44100, BASSInit.BASS_DEVICE_DEFAULT, IntPtr.Zero);
    
                    int stream = Bass.BASS_StreamCreateFile("test.mp3", 0, 0, BASSFlag.BASS_STREAM_DECODE | BASSFlag.BASS_SAMPLE_FLOAT);
    
                    _wasapi = new BassWasapiHandler(Bass.BASS_GetDevice() - 1, true, true, 44100, 2, 0f, 0f);
                    _wasapi.AddOutputSource(stream, BASSFlag.BASS_STREAM_DECODE | BASSFlag.BASS_SAMPLE_FLOAT);
                    _wasapi.Init();
                    _wasapi.Start();
    
                    Console.WriteLine("Press any key to exit");
                    Console.ReadKey(false);
                }
                catch (Exception)
                {
                    Console.WriteLine(Bass.BASS_ErrorGetCode());
                }
            }
        }
    }
     

    Symphy

    Retired Team Member
  • Premium Supporter
  • August 25, 2007
    501
    151
    Groningen
    Home Country
    Netherlands Netherlands
    Hi @Wiedmann ,

    What version of bass.net exactly are you using? The constructor overloads in 2.4.10.0 (which comes with MP) do not match the documentation that comes with 2.4.10.3. See intellisense.

    When using your code with 2.4.10.0, it doesn't use event mode as far as i can see. The following code will enable event mode:
    Code:
    _wasapi = new BassWasapiHandler(Bass.BASS_GetDevice() - 1, true, true, true, 44100, 2, 0f, 0f);

    Apart from that, your errorhandling won't work.
    Only the BassWasapiHandler constructor throws exceptions, which disappear into nowhere in your catch.
    For all other methods and bass functions you need to look at the boolean return value and check BASS_ErrorGetCode when false.

    bass.net is giving me these 3 constructor overloads:
    Code:
    public BassWasapiHandler(int device, bool exclusive, int freq, int chans, float buffer, float period);
    public BassWasapiHandler(int device, bool exclusive, bool sessionVol, int freq, int chans, float buffer, float period);
    public BassWasapiHandler(int device, bool exclusive, bool sessionVol, bool eventSystem, int freq, int chans, float buffer, float period);
     
    Last edited:

    Users who are viewing this thread

    Top Bottom