MP2 - V2.1 [MP2-563] WASAPI not working for sample rates > 48 kHz (2 Viewers)

Status
Not open for further replies.

Helios61

Retired Team Member
  • Premium Supporter
  • January 30, 2008
    4,587
    873
    62
    NRW
    Home Country
    Germany Germany
    Can you please play such a 6ch file with a high sample rate in MP1 and post the log?
    i need to compare the results.
    Have found a solution for missing AVR. Will do some tests tomorrow morning.
     

    hwahrmann

    Development Group
  • Team MediaPortal
  • September 15, 2004
    4,633
    2,457
    Vienna, Austria
    Home Country
    Austria Austria
    Thanks. From a first look, i can see no difference in the flags being used to init wasapi. It is the same in MP1 and MP2.

    Can you please run the same test on MP2 and post me the client log please?
     

    Helios61

    Retired Team Member
  • Premium Supporter
  • January 30, 2008
    4,587
    873
    62
    NRW
    Home Country
    Germany Germany
    Logs are attached ->

    Code:
    [2017-02-22 14:13:26,802] [35558  ] [BassPlay ] [DEBUG] - BassLibrary: WASAPI device info: Name="VSX-930 (Intel(R) Display-Audio)", Driver="WASAPI", Channels=8, MinRate=32000, MaxRate=192000, Latency=0ms
    [2017-02-22 14:13:26,803] [35559  ] [BassPlay ] [DEBUG] - BassLibrary: BASS: ---------------------------------------------
    [2017-02-22 14:13:26,803] [35559  ] [BassPlay ] [DEBUG] - BassLibrary: BASS: Buffer Length: 25344
    [2017-02-22 14:13:26,803] [35559  ] [BassPlay ] [DEBUG] - BassLibrary: BASS: Channels: 6
    [2017-02-22 14:13:26,804] [35560  ] [BassPlay ] [DEBUG] - BassLibrary: BASS: Frequency: 48000
    [2017-02-22 14:13:26,804] [35560  ] [BassPlay ] [DEBUG] - BassLibrary: BASS: Format: BASS_WASAPI_FORMAT_FLOAT
    [2017-02-22 14:13:26,804] [35560  ] [BassPlay ] [DEBUG] - BassLibrary: BASS: InitFlags: BASS_WASAPI_AUTOFORMAT, BASS_WASAPI_BUFFER, BASS_WASAPI_EVENT
    [2017-02-22 14:13:26,804] [35560  ] [BassPlay ] [DEBUG] - BassLibrary: BASS: Exclusive: False
    [2017-02-22 14:13:26,805] [35561  ] [BassPlay ] [DEBUG] - BassLibrary: BASS: ---------------------------------------------
    [2017-02-22 14:13:26,805] [35561  ] [BassPlay ] [INFO ] - BassLibrary: BASS: WASAPI Device successfully initialised
    [2017-02-22 14:13:26,805] [35561  ] [BassPlay ] [DEBUG] - BassLibrary: BASS: Creating new 6 channel mixer for frequency 48000
    [2017-02-22 14:13:26,805] [35561  ] [BassPlay ] [DEBUG] - BassLibrary: Stream type: BASS_CTYPE_STREAM_MIXER

    IMO the issue is related to the not working exclusive mode. MP2 falls back to shared mode.

    The difference:
    MP1
    Code:
    BASS: Format: BASS_WASAPI_FORMAT_24BIT

    MP2
    Code:
    BASS: Format: BASS_WASAPI_FORMAT_FLOAT
     
    Last edited:

    hwahrmann

    Development Group
  • Team MediaPortal
  • September 15, 2004
    4,633
    2,457
    Vienna, Austria
    Home Country
    Austria Austria
    That's not the problem, because we are already failing when trying to init the wasapi device.

    MP1:
    Code:
    if (BassWasapi.BASS_WASAPI_Init(_bassPlayer.DeviceNumber, stream.ChannelInfo.freq, outputChannels,
                                          initFlags | BASSWASAPIInit.BASS_WASAPI_BUFFER, Convert.ToSingle(Config.BufferingMs / 1000.0), 0f, _wasapiProc, IntPtr.Zero))
    .....

    MP2:
    Code:
    bool result = BassWasapi.BASS_WASAPI_Init(_deviceNo, _inputStream.SampleRate, _inputStream.Channels, _flags, 0.5f, 0f, _streamWriteProcDelegate, IntPtr.Zero);

    They are both using the same device number, the sample rate and number of channels from the stream, which we see in the logs.

    And also the same flags are being used.
     

    hwahrmann

    Development Group
  • Team MediaPortal
  • September 15, 2004
    4,633
    2,457
    Vienna, Austria
    Home Country
    Austria Austria
    @Helios61: I think i found it. it is the Buffer size, which seems to be too big.
    In MP2 we have a fixed buffer size of 500ms, whereas in MP1 it is configureable.

    I guess, when you set the buffer size in MP1 to 500ms, you will end up with the same problem as in MP2.
     

    hwahrmann

    Development Group
  • Team MediaPortal
  • September 15, 2004
    4,633
    2,457
    Vienna, Austria
    Home Country
    Austria Austria
    Looking at the Bass forum. This seems to be a problem of 2.4.0.0, which we are using inside MP.
    I am just about to update the latest Bass versions in our nuget, as i promised the MP1 guys to do so.

    We shall be able to test then this case against the new library
     

    HTPCSourcer

    Retired Team Member
  • Premium Supporter
  • May 16, 2008
    11,418
    2,335
    Home Country
    Germany Germany
    Maybe it is a good idea, if we make the buffer size configureable.
    That's quite some work.

    Have you identified a value that is working for you?
     

    Helios61

    Retired Team Member
  • Premium Supporter
  • January 30, 2008
    4,587
    873
    62
    NRW
    Home Country
    Germany Germany
    I think i found it. it is the Buffer size, which seems to be too big.
    In MP2 we have a fixed buffer size of 500ms, whereas in MP1 it is configureable.
    Have configured the same buffer size (221ms) as in MP1, unfortunately the same issue. Logs are attached.
    I guess, when you set the buffer size in MP1 to 500ms, you will end up with the same problem as in MP2.
    With buffer size 500ms playback in MP1 fails completely. Logs are attached.
    That's quite some work.
    But i think, it makes sense. OK, it isn't a big task to edit the .xml file, but i think for the most cases 500ms is to much.
     
    Last edited:
    Status
    Not open for further replies.

    Users who are viewing this thread

    Top Bottom