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

Status
Not open for further replies.

morpheus_xx

Retired Team Member
  • Team MediaPortal
  • March 24, 2007
    12,073
    7,459
    Home Country
    Germany Germany
    Broken WASAPI exclusive mode for sampling rates > 48Khz
    I tried to reproduce this issue but could not yet. In mean time I have bought a new AVR which supports higher rates, so in principle I should be able to reproduce.

    Here is what I tested (was it a sample file from you?):

    [2017-01-01 17:37:16,323] [452779 ] [Thread113] [INFO ] - BassLibrary: Preparing for playback: 'BassAudioFileInputSource: D:\MusicTest\01 - Destiny's Child - Independent woman no. 1.dsf'
    [2017-01-01 17:37:16,324] [452780 ] [BassPlay ] [DEBUG] - BassLibrary: Playing next input source 'BassAudioFileInputSource: D:\MusicTest\01 - Destiny's Child - Independent woman no. 1.dsf'
    [2017-01-01 17:37:16,327] [452783 ] [BassPlay ] [DEBUG] - BassLibrary: PlaybackSession: Creating output stream
    [2017-01-01 17:37:16,328] [452784 ] [BassPlay ] [DEBUG] - BassLibrary: Stream type: BASS_CTYPE_STREAM
    [2017-01-01 17:37:16,332] [452788 ] [BassPlay ] [DEBUG] - BassLibrary: Stream type: BASS_CTYPE_STREAM
    [2017-01-01 17:37:16,325] [452781 ] [AMQ 'UPnPRendererPlugin'] [DEBUG] - Player Started
    [2017-01-01 17:37:16,335] [452791 ] [BassPlay ] [DEBUG] - BassLibrary: Stream type: BASS_CTYPE_STREAM
    [2017-01-01 17:37:16,339] [452795 ] [BassPlay ] [DEBUG] - BassLibrary: Stream type: BASS_CTYPE_STREAM_MIXER
    [2017-01-01 17:37:16,388] [452844 ] [BassPlay ] [DEBUG] - BassLibrary: OutputDeviceManager.SetInputStream()
    [2017-01-01 17:37:16,390] [452846 ] [BassPlay ] [DEBUG] - BassLibrary: OutputDeviceManager.ResetInputStream()
    [2017-01-01 17:37:16,391] [452847 ] [BassPlay ] [DEBUG] - BassLibrary: Instantiating output device
    [2017-01-01 17:37:16,653] [453109 ] [BassPlay ] [INFO ] - BassLibrary: Initializing WASAPI device 'VSX-S510 (Intel(R) Display-Audio)' (device no 20)
    [2017-01-01 17:37:16,654] [453110 ] [BassPlay ] [DEBUG] - BassLibrary: Calling SetInputStream()
    [2017-01-01 17:37:16,667] [453123 ] [BassPlay ] [DEBUG] - BassLibrary: BASS: Try to init WASAPI with a samplerate of 88200 and 6 channels
    [2017-01-01 17:37:16,706] [453163 ] [BassPlay ] [WARN ] - BassLibrary: BASS: Failed to initialize WASAPI exclusive mode for samplerate of 88200 and 6 channels. Trying fallback to shared mode.
    [2017-01-01 17:37:16,708] [453165 ] [BassPlay ] [DEBUG] - BassLibrary: BASS: Init WASAPI shared mode with Event driven system enabled.
    [2017-01-01 17:37:16,709] [453166 ] [BassPlay ] [DEBUG] - BassLibrary: BASS: Try to init WASAPI with a samplerate of 88200 and 6 channels
    [2017-01-01 17:37:16,762] [453218 ] [BassPlay ] [DEBUG] - BassLibrary: WASAPI device info: Name="VSX-S510 (Intel(R) Display-Audio)", Driver="WASAPI", Channels=8, MinRate=32000, MaxRate=192000, Latency=0ms
    [2017-01-01 17:37:16,763] [453219 ] [BassPlay ] [DEBUG] - BassLibrary: BASS: ---------------------------------------------
    [2017-01-01 17:37:16,765] [453221 ] [BassPlay ] [DEBUG] - BassLibrary: BASS: Buffer Length: 50688
    [2017-01-01 17:37:16,766] [453222 ] [BassPlay ] [DEBUG] - BassLibrary: BASS: Channels: 6
    [2017-01-01 17:37:16,767] [453223 ] [BassPlay ] [DEBUG] - BassLibrary: BASS: Frequency: 96000
    [2017-01-01 17:37:16,769] [453225 ] [BassPlay ] [DEBUG] - BassLibrary: BASS: Format: BASS_WASAPI_FORMAT_FLOAT
    [2017-01-01 17:37:16,770] [453226 ] [BassPlay ] [DEBUG] - BassLibrary: BASS: InitFlags: BASS_WASAPI_AUTOFORMAT, BASS_WASAPI_BUFFER, BASS_WASAPI_EVENT
    [2017-01-01 17:37:16,771] [453227 ] [BassPlay ] [DEBUG] - BassLibrary: BASS: Exclusive: False
    [2017-01-01 17:37:16,772] [453228 ] [BassPlay ] [DEBUG] - BassLibrary: BASS: ---------------------------------------------
    [2017-01-01 17:37:16,774] [453230 ] [BassPlay ] [INFO ] - BassLibrary: BASS: WASAPI Device successfully initialised
    [2017-01-01 17:37:16,775] [453231 ] [BassPlay ] [DEBUG] - BassLibrary: BASS: Creating new 6 channel mixer for frequency 96000
    [2017-01-01 17:37:16,777] [453233 ] [BassPlay ] [DEBUG] - BassLibrary: Stream type: BASS_CTYPE_STREAM_MIXER

    My current findings (remember: new hardware and not looked into this since long time):
    • WASAPI exclusive mode was not sucessfully enabled for 88.2 kHz.
    • Windows sound test does not output sample sound when using 88.2 kHz as well, so I guess this rate is not supported by my AVR
    • 2nd try is then the shared mode using the mixer. Here the default rate and the channel configuration of Windows is used. As I also changed my HTPC mainboard, I didn't change those settings again (where default 48kHz/2ch).
    Can you provide me clear steps how I can reproduce the downsampling issue? Best would also be to provide a matching testfile, from hardware side I should be able to test now.

    The AVR lists following modes as supported (88.2 not working though):
    [2017-01-01 17:30:52,906] [69362 ] [BassPlay ] [DEBUG] - BassLibrary: Collecting device info
    [2017-01-01 17:30:52,927] [69384 ] [BassPlay ] [DEBUG] - BassLibrary: Check BASS_WASAPI_EXCLUSIVE mode
    [2017-01-01 17:30:53,013] [69469 ] [BassPlay ] [DEBUG] - BassLibrary: - 32000 Hz / 2 ch: BASS_WASAPI_FORMAT_24BIT
    [2017-01-01 17:30:53,027] [69483 ] [BassPlay ] [DEBUG] - BassLibrary: - 32000 Hz / 4 ch: BASS_WASAPI_FORMAT_24BIT
    [2017-01-01 17:30:53,041] [69498 ] [BassPlay ] [DEBUG] - BassLibrary: - 32000 Hz / 6 ch: BASS_WASAPI_FORMAT_24BIT
    [2017-01-01 17:30:53,054] [69511 ] [BassPlay ] [DEBUG] - BassLibrary: - 32000 Hz / 8 ch: BASS_WASAPI_FORMAT_24BIT
    [2017-01-01 17:30:53,074] [69530 ] [BassPlay ] [DEBUG] - BassLibrary: - 44100 Hz / 2 ch: BASS_WASAPI_FORMAT_24BIT
    [2017-01-01 17:30:53,087] [69543 ] [BassPlay ] [DEBUG] - BassLibrary: - 44100 Hz / 4 ch: BASS_WASAPI_FORMAT_24BIT
    [2017-01-01 17:30:53,102] [69558 ] [BassPlay ] [DEBUG] - BassLibrary: - 44100 Hz / 6 ch: BASS_WASAPI_FORMAT_24BIT
    [2017-01-01 17:30:53,114] [69570 ] [BassPlay ] [DEBUG] - BassLibrary: - 44100 Hz / 8 ch: BASS_WASAPI_FORMAT_24BIT
    [2017-01-01 17:30:53,134] [69590 ] [BassPlay ] [DEBUG] - BassLibrary: - 48000 Hz / 2 ch: BASS_WASAPI_FORMAT_24BIT
    [2017-01-01 17:30:53,148] [69604 ] [BassPlay ] [DEBUG] - BassLibrary: - 48000 Hz / 4 ch: BASS_WASAPI_FORMAT_24BIT
    [2017-01-01 17:30:53,220] [69676 ] [BassPlay ] [DEBUG] - BassLibrary: - 48000 Hz / 6 ch: BASS_WASAPI_FORMAT_24BIT
    [2017-01-01 17:30:53,234] [69690 ] [BassPlay ] [DEBUG] - BassLibrary: - 48000 Hz / 8 ch: BASS_WASAPI_FORMAT_24BIT
    [2017-01-01 17:30:53,253] [69709 ] [BassPlay ] [DEBUG] - BassLibrary: - 88200 Hz / 2 ch: BASS_WASAPI_FORMAT_24BIT
    [2017-01-01 17:30:53,266] [69723 ] [BassPlay ] [DEBUG] - BassLibrary: - 88200 Hz / 4 ch: BASS_WASAPI_FORMAT_24BIT
    [2017-01-01 17:30:53,280] [69737 ] [BassPlay ] [DEBUG] - BassLibrary: - 88200 Hz / 6 ch: BASS_WASAPI_FORMAT_24BIT
    [2017-01-01 17:30:53,294] [69750 ] [BassPlay ] [DEBUG] - BassLibrary: - 88200 Hz / 8 ch: BASS_WASAPI_FORMAT_24BIT
    [2017-01-01 17:30:53,313] [69769 ] [BassPlay ] [DEBUG] - BassLibrary: - 96000 Hz / 2 ch: BASS_WASAPI_FORMAT_24BIT
    [2017-01-01 17:30:53,326] [69782 ] [BassPlay ] [DEBUG] - BassLibrary: - 96000 Hz / 4 ch: BASS_WASAPI_FORMAT_24BIT
    [2017-01-01 17:30:53,341] [69797 ] [BassPlay ] [DEBUG] - BassLibrary: - 96000 Hz / 6 ch: BASS_WASAPI_FORMAT_24BIT
    [2017-01-01 17:30:53,353] [69809 ] [BassPlay ] [DEBUG] - BassLibrary: - 96000 Hz / 8 ch: BASS_WASAPI_FORMAT_24BIT
    [2017-01-01 17:30:53,375] [69831 ] [BassPlay ] [DEBUG] - BassLibrary: - 192000 Hz / 2 ch: BASS_WASAPI_FORMAT_16BIT
    [2017-01-01 17:30:53,391] [69848 ] [BassPlay ] [DEBUG] - BassLibrary: - 192000 Hz / 4 ch: BASS_WASAPI_FORMAT_16BIT
    [2017-01-01 17:30:53,407] [69863 ] [BassPlay ] [DEBUG] - BassLibrary: - 192000 Hz / 6 ch: BASS_WASAPI_FORMAT_16BIT
    [2017-01-01 17:30:53,422] [69878 ] [BassPlay ] [DEBUG] - BassLibrary: - 192000 Hz / 8 ch: BASS_WASAPI_FORMAT_16BIT
    [2017-01-01 17:30:53,423] [69879 ] [BassPlay ] [DEBUG] - BassLibrary: Check BASS_WASAPI_SHARED mode
    [2017-01-01 17:30:53,483] [69940 ] [BassPlay ] [DEBUG] - BassLibrary: - 48000 Hz / 2 ch: BASS_WASAPI_FORMAT_FLOAT

    EDIT HTPCSourcer:
    @Helios61 , posting moved into dedicated bug thread.
     
    Last edited by a moderator:

    Helios61

    Retired Team Member
  • Premium Supporter
  • January 30, 2008
    4,587
    873
    62
    NRW
    Home Country
    Germany Germany
    I will take a look at this tomorrow afternoon.
     

    Helios61

    Retired Team Member
  • Premium Supporter
  • January 30, 2008
    4,587
    873
    62
    NRW
    Home Country
    Germany Germany
    Hi, have tried to test some files. Unfortunately playback of audiofiles completely fails (WASAPI & DS). i've noticed this error in logfile:

    Code:
    [2017-01-02 14:17:33,415] [54597  ] [BassPlay ] [ERROR] - Exception in player main thread
    System.Reflection.TargetInvocationException: Ein Aufrufziel hat einen Ausnahmefehler verursacht. ---> MediaPortal.Extensions.BassLibraries.BassLibraryException: Error calling function BASS_WASAPI_Init(): BASS_ERROR_DRIVER
       bei MediaPortal.UI.Players.BassPlayer.OutputDevices.WASAPIOutputDevice.SetInputStream(BassStream stream, Boolean passThrough)
       bei MediaPortal.UI.Players.BassPlayer.PlayerComponents.OutputDeviceManager.SetInputStream(BassStream stream, Boolean passThrough)
       bei MediaPortal.UI.Players.BassPlayer.PlayerComponents.PlaybackSession.Initialize(IInputSource inputSource)
       bei MediaPortal.UI.Players.BassPlayer.PlayerComponents.PlaybackSession.Create(Controller controller)
       bei MediaPortal.UI.Players.BassPlayer.PlayerComponents.PlaybackProcessor.MoveToNextInputSource_Sync()
       --- Ende der internen Ausnahmestapelüberwachung ---
       bei System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor)
       bei System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[] parameters, Object[] arguments)
       bei System.Delegate.DynamicInvokeImpl(Object[] args)
       bei MediaPortal.UI.Players.BassPlayer.Controller.PlayerThreadMain()

    Logs are attached.
     

    morpheus_xx

    Retired Team Member
  • Team MediaPortal
  • March 24, 2007
    12,073
    7,459
    Home Country
    Germany Germany
    • Thread starter
    • Moderator
    • #4
    Did you select proper devices inside configuration before?
    Can you post more details on used files (format, bitrate etc)
     

    HTPCSourcer

    Retired Team Member
  • Premium Supporter
  • May 16, 2008
    11,418
    2,335
    Home Country
    Germany Germany
    Hi,

    I looked at it and didn't have problems to play my own files here. Could you provide a test sample so that we all deal with the very same test data when testing?

    One question about your own setup: if the rip is 44.1 kHz, i.e. CD standard, Wasapi would not convert this into a higher sample rate for replay on your AVR - unless you have forced Windows to always use a higher rate. I've read somewhere that Wasapi was having some issues in such situations although this may be outdated.
     

    Helios61

    Retired Team Member
  • Premium Supporter
  • January 30, 2008
    4,587
    873
    62
    NRW
    Home Country
    Germany Germany
    Did you select proper devices inside configuration before?
    I do, but i think the question goes into the right direction. I've noticed this issue first after switching on my TV (HDMI Connection to AVR). At this moment sounddevice changed in Windows from AVR to TV (with the same sound specifications, sample rate, bit depht, channel layout).
    For testing i will find time tomorrow.

    One question about your own setup: if the rip is 44.1 kHz, i.e. CD standard, Wasapi would not convert this into a higher sample rate for replay on your AVR - unless you have forced Windows to always use a higher rate.
    Yes, thats right. WASAPI exclusive should output the stream "bitperfect" without Windows Mixxer.

    I looked at it and didn't have problems to play my own files here. Could you provide a test sample so that we all deal with the very same test data when testing?
    The test above was a simple CD rip. Another testsamples i've uploadet already to our ftp server and you will find a lot of great testfiles at http://www.2l.no/hires/index.html.
     

    HTPCSourcer

    Retired Team Member
  • Premium Supporter
  • May 16, 2008
    11,418
    2,335
    Home Country
    Germany Germany

    HTPCSourcer

    Retired Team Member
  • Premium Supporter
  • May 16, 2008
    11,418
    2,335
    Home Country
    Germany Germany
    Obviously my own test system is not doing complete bitstream as it only has to loudspeakers attached to it. This is how my player settings look like though:

    Wasapi.JPG
     

    Helios61

    Retired Team Member
  • Premium Supporter
  • January 30, 2008
    4,587
    873
    62
    NRW
    Home Country
    Germany Germany
    So I would rather assume your problems to be linked to your system setup.
    No, i do not think so, because playback is working fine in Musicbee (the same BASS Engine as in MP2) and Foobar2000.
     
    Status
    Not open for further replies.

    Users who are viewing this thread

    Top Bottom