BassPlayer: Adding WASAPI support | Page 3

Discussion in 'Plugin Development' started by morpheus_xx, March 23, 2014.

  1. hwahrmann
    • Team MediaPortal

    hwahrmann Development Group

    Joined:
    September 15, 2004
    Messages:
    4,502
    Likes Received:
    1,640
    Gender:
    Male
    Location:
    Vienna, Austria
    Ratings:
    +2,267 / 1
    Home Country:
    Austria Austria
    A Mixer stream is always active, unless you initalize it to stop, when nothing is fed into it.
    So when you add a song to the mixer you need to set a SyncPos to "current mixer position + length of song just added".
    This will then signal and you know that the song has ended, and you can add the next siong from the playlistz or stop playback, if it was the last song.



    THat's the SetSyncPos in MP1 MixerStream.cs line 385
     
    • Like Like x 1
  2. Google AdSense Guest Advertisement



    to hide all adverts.
  3. hwahrmann
    • Team MediaPortal

    hwahrmann Development Group

    Joined:
    September 15, 2004
    Messages:
    4,502
    Likes Received:
    1,640
    Gender:
    Male
    Location:
    Vienna, Austria
    Ratings:
    +2,267 / 1
    Home Country:
    Austria Austria
    For that special case, which i fixed in MP1, you need to have a Mixer Matrix, which assigns the channels correctly

    See MixerStream.cs line 676
     
    • Like Like x 2
  4. morpheus_xx
    • Team MediaPortal

    morpheus_xx Lead Dev MP2

    Joined:
    March 24, 2007
    Messages:
    11,090
    Likes Received:
    4,766
    Ratings:
    +6,826 / 11
    Home Country:
    Germany Germany
    Show System Specs
    I've added this code already, but it doesn't work. When I debugged it, the duration of input was "0", so maybe this is the root cause?

    I will cleanup my working copy and push it, could you check it please?

    The channel mixing I will do as last step, because this changes the "processing chain" (although the current classes are only pass through stubs)
     
  5. morpheus_xx
    • Team MediaPortal

    morpheus_xx Lead Dev MP2

    Joined:
    March 24, 2007
    Messages:
    11,090
    Likes Received:
    4,766
    Ratings:
    +6,826 / 11
    Home Country:
    Germany Germany
    Show System Specs
    • Like Like x 2
  6. mrj

    mrj Portal Pro

    Joined:
    January 27, 2012
    Messages:
    251
    Likes Received:
    45
    Ratings:
    +101 / 1
    Show System Specs
    Hi morpheus_xx
    Maybe you need to set the BASS_MIXER_END flag for the mixer stream as discussed here
    /mrj

    //Edit
    Also discussed here
    /mrj
     
    Last edited: March 31, 2014
  7. morpheus_xx
    • Team MediaPortal

    morpheus_xx Lead Dev MP2

    Joined:
    March 24, 2007
    Messages:
    11,090
    Likes Received:
    4,766
    Ratings:
    +6,826 / 11
    Home Country:
    Germany Germany
    Show System Specs
    Thanks for all answers. I finally found the cause: When I registered on "PlaybackEnd", I always got a crash from unmanaged side. The problem was a implicit delegate creation, so callback was already GCed.
    (a thread to similar problem explained it here http://stackoverflow.com/questions/4855513/callbackoncollecteddelegate-was-detected)

    Only known issue is the channel mapping. Before touching this, I will try this build on my HTPC :D

    Testbuild in 1st post!
     
    • Like Like x 4
    • Thank You! Thank You! x 2
  8. Holzi
    • Team MediaPortal

    Holzi Super Moderator

    Joined:
    April 21, 2010
    Messages:
    7,928
    Likes Received:
    1,591
    Gender:
    Male
    Location:
    Ba-Wü
    Ratings:
    +2,228 / 8
    Home Country:
    Germany Germany
    Show System Specs
    Testing this and it works fine if only one player is active. As soon as there are more players (especially video and music file) there are problems like freezing video while start playing music concurrently and being unable to change audio streams between players. :)
    Changing back to DirectSound solved these issues.
    Thanks!
     
  9. morpheus_xx
    • Team MediaPortal

    morpheus_xx Lead Dev MP2

    Joined:
    March 24, 2007
    Messages:
    11,090
    Likes Received:
    4,766
    Ratings:
    +6,826 / 11
    Home Country:
    Germany Germany
    Show System Specs
    Can you check this in Wasapi shared mode? (in settings uncheck "exclusive") I guess it would also work if different audio devices are selected for audio and video.
    I'm afraid it might need more changes in player management to support switching input of exclusive opened audio devices.
     
  10. Holzi
    • Team MediaPortal

    Holzi Super Moderator

    Joined:
    April 21, 2010
    Messages:
    7,928
    Likes Received:
    1,591
    Gender:
    Male
    Location:
    Ba-Wü
    Ratings:
    +2,228 / 8
    Home Country:
    Germany Germany
    Show System Specs
    In shared mode the video doesn't freeze if you start playing audio concurrently but you can't change to the audio stream of the other player. Furthermore you are unable to mute (happens also in exclusive mode).
    If the music (mp3 file) ends the audio stream from the video is played on. (correct behaviour :)).

    Screenshot:
    1.png
     
    • Thank You! Thank You! x 1
  11. Lehmden
    • Premium Supporter

    Lehmden Retired Team Member

    Joined:
    December 17, 2010
    Messages:
    11,904
    Likes Received:
    2,151
    Gender:
    Male
    Location:
    Lehmden
    Ratings:
    +3,628 / 28
    Home Country:
    Germany Germany
    Show System Specs
    Hi.
    I think this is as expected. WASAPI don't change a bit on Audio Stream. So no volume control and no mute...
     
    • Agree Agree x 2
Loading...

Users Viewing Thread (Users: 0, Guests: 0)

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice
  • About The Project

    The vision of the MediaPortal project is to create a free open source media centre application, which supports all advanced media centre functions, and is accessible to all Windows users.

    In reaching this goal we are working every day to make sure our software is one of the best.

             

  • Support MediaPortal!

    The team works very hard to make sure the community is running the best HTPC-software. We give away MediaPortal for free but hosting and software is not for us.

    Care to support our work with a few bucks? We'd really appreciate it!