BassPlayer: Adding WASAPI support (3 Viewers)

morpheus_xx

Retired Team Member
  • Team MediaPortal
  • March 24, 2007
    12,073
    7,459
    Home Country
    Germany Germany
    • Thread starter
    • Moderator
    • #11
    Yes, this was the reason :D Shared mode requires a mixer stream, now playback works fine!!!

    While implementing this in MP2, I found that MP1 seem to leak GCHandles: they are created in many places but are not freed.
     
    B

    BassFan

    Guest
    Yes, this was the reason :D Shared mode requires a mixer stream, now playback works fine!!!

    While implementing this in MP2, I found that MP1 seem to leak GCHandles: they are created in many places but are not freed.

    Puhh... :)
    that is good then happy with Wasapi to.

    @morpheus_xx While implementing this in MP2, I found that MP1 seem to leak GCHandles: they are created in many places but are not freed.
    Thanks for the info.. should be a part for @hwahrmann to. :)
    i'm work only on Visualization stuff :(

    greets
     
    Last edited by a moderator:

    morpheus_xx

    Retired Team Member
  • Team MediaPortal
  • March 24, 2007
    12,073
    7,459
    Home Country
    Germany Germany
    • Thread starter
    • Moderator
    • #13
    Progress is good now, I'm working on configuration (selection of DirectSound/WASAPI, device selection, exclusive mode yes/no).
     

    morpheus_xx

    Retired Team Member
  • Team MediaPortal
  • March 24, 2007
    12,073
    7,459
    Home Country
    Germany Germany
    • Thread starter
    • Moderator
    • #14
    Good news! First post is updated with a test plugin! It can be used with any MP2 Alpha 4 or newer build.

    Configuration and playback works fine (both shared and exclusive mode). Also "gapless playback" works here!

    Please test this and report results :D
     

    Lehmden

    Retired Team Member
  • Premium Supporter
  • December 17, 2010
    12,553
    3,934
    Lehmden
    Home Country
    Germany Germany
    Hi.
    Tested it and I'm excited. Normal "CD Quality"- MP3 are played at a notable higher quality now. HiRes Audio Files are played as much as the hardware can deliver. No bugs so far. Really great job.(y)
    Only downside is the lost of cross fading but that's the price we have to pay for pure sound...
     

    Helios61

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

    First, big Thanks for this great job, i'm really impressed. Made some quick tests and most is working great and as exspected (especially gapless playback). Only two issues i've noticed:
    1. Multichannel files with samplingrate >48 KHz will be resampled to 48 KHz. It's odd, playback of 2ch/24bit/96KHz is working fine! Log is attached (Client.rar).
    2. Channel mapping of 5.0 files is wrong (channels.rar):
    • L -> L
    • C -> C
    • R -> R
    • RR -> LFE
    • RL -> RR
    Hier scheint der Fehler zu liegen ->
    Code:
    [2014-03-29 08:50:47,066] [22768  ] [Thread9  ] [INFO ] - BassPlayer: Stream info: FLAC, 88200Hz, 4.1, 24bit
    Bass player mapps 4.1 channels, instead of 5.0!

    Again big Thanks
    Helios
     

    Attachments

    • Client.rar
      13.5 KB
    • channels.rar
      11.4 KB
    Last edited:

    morpheus_xx

    Retired Team Member
  • Team MediaPortal
  • March 24, 2007
    12,073
    7,459
    Home Country
    Germany Germany
    • Thread starter
    • Moderator
    • #17
    1. Multichannel files with samplingrate >48 KHz will be resampled to 48 KHz. It's odd, playback of 2ch/24bit/96KHz is working fine! Log is attached (Client.rar).
    I have same result here: although bass tells me this is a supported format, Init() call will fail Then it switches back to shared mode.
    [2014-03-29 08:35:19,668] [26701 ] [BassPlay ] [DEBUG] - BassPlayer: BASS: Try to init WASAPI with a samplerate of 96000 and 6 channels
    [2014-03-29 08:35:19,677] [26710 ] [BassPlay ] [WARN ] - BassPlayer: BASS: Failed to initialize WASAPI exclusive mode for samplerate of 96000 and 6 channels. Trying fallback to shared mode.
    [2014-03-29 08:35:19,677] [26710 ] [BassPlay ] [DEBUG] - BassPlayer: BASS: Init WASAPI shared mode with Event driven system enabled.
    [2014-03-29 08:35:19,677] [26710 ] [BassPlay ] [DEBUG] - BassPlayer: BASS: Try to init WASAPI with a samplerate of 96000 and 6 channels
    [2014-03-29 08:35:19,685] [26718 ] [BassPlay ] [DEBUG] - BassPlayer: Collecting device info
    [2014-03-29 08:35:19,691] [26724 ] [BassPlay ] [DEBUG] - BassPlayer: WASAPI device info: Name="Lautsprecher (Realtek High Definition Audio)", Driver="WASAPI", Channels=6, MinRate=48000, MaxRate=48000, Latency=0ms
    Is "Lautsprecher (Realtek High Definition Audio)" the right device?

    I'm currently working on the problem, that playback end is not working in shared mode: I don't get an event that input stream has ended, so it plays silence for infinity, although MP2 player shows "stopped".
     

    morpheus_xx

    Retired Team Member
  • Team MediaPortal
  • March 24, 2007
    12,073
    7,459
    Home Country
    Germany Germany
    • Thread starter
    • Moderator
    • #19
    No, i've just seen this log entry too. Configured is 'LG TV (Intel(R) Display-Audio)'!
    Device selection for Shared mode is fixed now. New build in first post!

    @BassFan @hwahrmann I still fighting an issue with the Mixer in shared mode. While in all other cases the stream end is handled correctly (DirectSound, WASAPI exclusive), the shared mode doesn't seem stop playback.

    I tried to attach handlers for Stream end like:
    Bass.BASS_ChannelSetSync(stream.Handle, BASSSync.BASS_SYNC_FREE | BASSSync.BASS_SYNC_MIXTIME, 0, OnPlaybackEnd,...

    But this doesn't work in current code: no callback happens and mixer will be read after finish. How do I get noticed of playback end in this case?
     
    Last edited:
    B

    BassFan

    Guest
    if your use mixer then your should work with mixer not with stream.
    this can not fired the sync proc if your replace mixer stream with a normal stream handle

    also is that
    Code:
    stream.Handle
    a mixer handle ?
    if not! then that will never fired if the stream which playing a mixer stream handle.

    your work with mixer_handle ..
    and create s sync for normal stream.handle?

    sorry not understand the naming issues :confused:;)
    _mixer for Mixter stream
    _stream for normal Stream

    greets
     
    Last edited by a moderator:

    Users who are viewing this thread

    Top Bottom