BassPlayer: Adding WASAPI support (2 Viewers)

morpheus_xx

Lead Dev MP2
  • Team MediaPortal
  • March 24, 2007
    11,760
    7,117
    Home Country
    Germany Germany
    Country flag
    • 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

    Lead Dev MP2
  • Team MediaPortal
  • March 24, 2007
    11,760
    7,117
    Home Country
    Germany Germany
    Country flag
    • 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

    Lead Dev MP2
  • Team MediaPortal
  • March 24, 2007
    11,760
    7,117
    Home Country
    Germany Germany
    Country flag
    • 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,347
    3,798
    Lehmden
    Home Country
    Germany Germany
    Country flag
    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
    871
    59
    NRW
    Home Country
    Germany Germany
    Country flag
    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 · Views: 147
    • channels.rar
      11.4 KB · Views: 144
    Last edited:

    morpheus_xx

    Lead Dev MP2
  • Team MediaPortal
  • March 24, 2007
    11,760
    7,117
    Home Country
    Germany Germany
    Country flag
    • 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

    Lead Dev MP2
  • Team MediaPortal
  • March 24, 2007
    11,760
    7,117
    Home Country
    Germany Germany
    Country flag
    • 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

    Similar threads

    Hello!!! I use a handy app called catchin' sync to roughly check the AV sync of audio/video on my HTPC/TV. It's not as accurate as a dedicated opto-electronic calibrator but it's more than adequate for this application and much better than trying to do things by eye (even when the lack of sync is massively obvious, subjective...
    Hello!!! I use a handy app called catchin' sync to roughly check the AV sync of audio/video on my HTPC/TV. It's not as accurate as...
    Hello!!! I use a handy app called catchin' sync to roughly check the AV sync of audio/video on my HTPC/TV. It's not as accurate as...
    Replies
    0
    Views
    342
    It is looking and working very well now and I am almost at the point of switching my HTPC to MP2, madvr would definitely push me over the edge for sure.;)
    It is looking and working very well now and I am almost at the point of switching my HTPC to MP2, madvr would definitely push me...
    We are proud to present MediaPortal 2.3 MediaPortal 2.3 is a full-blown media center software that addresses the most common user...
    Replies
    4
    Views
    2K
    Updated with the guide to install an Intel HDMI audio Device that can stream 192kHz/24bit. If you have any question, feel free to reply here.
    Updated with the guide to install an Intel HDMI audio Device that can stream 192kHz/24bit. If you have any question, feel free to...
    I switched to MePo 2 with the release of MePo 2.1.1, and in the last months I focused on learning the program and fine tuning it...
    Replies
    8
    Views
    2K
    I should probably add, it does the same thing with all audio files I've tried, FLAC and MP3. I've also tried updating my drivers but no luck
    I should probably add, it does the same thing with all audio files I've tried, FLAC and MP3. I've also tried updating my drivers...
    Hi, I'm having a problem playing music in Mediaportal 1.18 It plays the first track without problems, but then stops and is unable...
    Replies
    1
    Views
    811
    • Locked
    It would be great if you then posted a comment in your bug thread. I will mark the thread as "fixed", assuming that the change has made (or will make) its way into the master.
    It would be great if you then posted a comment in your bug thread. I will mark the thread as "fixed", assuming that the change has...
    Hi, i've noticed, that MP2 crashed to desktop, if you try to play an audiofile after changing WASAPI exclusiv audio device...
    Replies
    24
    Views
    3K
    Top Bottom