Pause/Resume issue with SBLive
#1
I have a SBLive that I am using pass through with This card reports that it supports pause/resume, which it does as long as it is not through SPDIF.

This is a documented bug with this card that even affects windows.

After pause and then resume, the video resumes as expected, but the audio is messed up. Two things will occur.

1. There is still audio, but it is about 1/2 a second of each audio frame, so it stutters, but is not looping.

2. There is no audio

In both cases, the DTS/Dolby light on my amp flickers on/off with the signal. I have had this issue with XBMC for months now, the only solution to it when this occurs is to seek backwards.

I propose the following change to the DVDPlayer, but I am un-sure of the consequences of doing so as I do not understand much about demuxers.

Code:
Index: xbmc/cores/dvdplayer/DVDPlayer.cpp
===================================================================
--- xbmc/cores/dvdplayer/DVDPlayer.cpp  (revision 17664)
+++ xbmc/cores/dvdplayer/DVDPlayer.cpp  (working copy)
@@ -1522,6 +1522,7 @@
   CDVDMsg* pMsg;

   MsgQueueReturnCode ret = m_messenger.Get(&pMsg, 0);
+  double start;

   while (ret == MSGQ_OK)
   {
@@ -1562,7 +1563,7 @@
         CPlayerSeek m_pause(this);

         CDVDMsgPlayerSeekChapter &msg(*((CDVDMsgPlayerSeekChapter*)pMsg));
-        double start = DVD_NOPTS_VALUE;
+        start = DVD_NOPTS_VALUE;
        
         // This should always be the case.
         if(m_pDemuxer && m_pDemuxer->SeekChapter(msg.GetChapter(), &start))
@@ -1694,6 +1695,20 @@
         //        untill our buffers are somewhat filled
         if(m_pDemuxer)
           m_pDemuxer->SetSpeed(speed);
+
+       /* Fix audio sync issue when returning to normal speed (I have a buggy SBLive that needs this) */
+        if (speed == DVD_PLAYSPEED_NORMAL)
+        {
+          start = DVD_NOPTS_VALUE;
+          if (m_pDemuxer && m_pDemuxer->SeekTime(GetTime(), false, &start))
+          {
+            if(m_pSubtitleDemuxer)
+              m_pSubtitleDemuxer->SeekTime(GetTime(), false);
+          }
+          FlushBuffers(true);
+          SyncronizePlayers(SYNCSOURCE_ALL, DVD_NOPTS_VALUE);
+        }
+
       }
       else if (pMsg->IsType(CDVDMsg::PLAYER_CHANNEL_NEXT) || pMsg->IsType(CDVDMsg::PLAYER_CHANNEL_PREV))
       {

I am compiling right now to test this, but if anyone can comment on this please do so, I am unsure if calling "GetTime()" inside the message loop is thread safe, or if I should be passing "start" to "SyncronizePlayers" instead of "DVD_NOPTS_VALUE".

I have tried just calling "SyncronizePlayers" but it has had no effect.
I am not scared of SVN - Cutting my hands open on the bleeding edge.
Reply
#2
I have found the problem and the solution...

Alsa is reporting correctly that my card can pause, but it is not able to tell us that it can not pause in passthrough mode. Forcing "m_bCanPause" to false fixes the problem and pause/resume works as normal.

I have patched the source to get the device name and check if it is "SBLive!" and if so, set a new variable "m_bPassthroughPauseBroken" to true.

In the places where m_bCanPause was checked, I have changed them to:
Code:
if ((m_bCanPause) &! (b_bPassthrough && m_bPassthroughPauseBroken))

I am just waiting for my wife to finish watching her show so I can test it out, if all works I will post a patch.
I am not scared of SVN - Cutting my hands open on the bleeding edge.
Reply
#3
Patch ready Smile

See: http://trac.xbmc.org/ticket/5899
I am not scared of SVN - Cutting my hands open on the bleeding edge.
Reply
#4
*Bump*

Can someone review this code and if it is acceptable commit it to SVN?
I am not scared of SVN - Cutting my hands open on the bleeding edge.
Reply
#5
*BUMP* Why wont any of the devs even comment on this, this patch is required for anyone using ALSA on a SBLive with SPDIF... I have been running it for weeks now without a single hitch.
I am not scared of SVN - Cutting my hands open on the bleeding edge.
Reply
#6
I'm not sure any developer's have that sound card.

The patch itself looks like its a workaround for a bug in the hardware vendor's drivers. Perhaps another dev. would care to review?
Reply

Logout Mark Read Team Forum Stats Members Help
Pause/Resume issue with SBLive0