Bug Airplay & cu.lrclyrics
#1
There is a problem with airplay when cu.lrclyrics is installed.
What happens is that cu.lrclyrics open and closes the pipe (really for nothing)
Actually it should not - but anyway.

The first clients are the audiodecoder & the producer (Airplay), then cu.lrclyrics
comes into play and open/closes the pipe (still the two other clients).
But if you check what happens in pipe close - m_bOpen is set to false.

Now the audiodecoder can not read anything since m_bOpen is false (See Pipe::Read)
reading an eof instead.

I have moved the pipe->Close call in PipesManager::ClosePipe to within the
RefCount() == 0 condition and that solves the problem.

Regards

MrHipp
Reply
#2
How about solving this annoyance in the addon instead?
AppleTV4/iPhone/iPod/iPad: HowTo find debug logs and everything else which the devs like so much: click here
HowTo setup NFS for Kodi: NFS (wiki)
HowTo configure avahi (zeroconf): Avahi_Zeroconf (wiki)
READ THE IOS FAQ!: iOS FAQ (wiki)
Reply
#3
You fight about it Wink But for correctness it should also be solved in PipesManager (what happens the next time someone makes the same mistake?) Or PipesManager should be stopped from multiple readers.
(with for me appears silly)
Reply
#4
(2014-11-15, 17:51)Memphiz Wrote: How about solving this annoyance in the addon instead?

patches welcome.
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#5
Not a patch but maybe like this:
Code:
def Open(self,file):
        self.audioStart = 0
        self.f = None
        ext = os.path.splitext(file)[1].lower()
        if   ext == '.mp3':
           self.f = xbmcvfs.File(file)  
           self.AnalyzeMp3()
        elif ext == '.ogg':
           self.f = xbmcvfs.File(file)
           self.AnalyzeOgg()
        elif ext == '.wma':
          self.f = xbmcvfs.File(file)  
          self.AnalyzeWma()
        elif ext == '.flac':
          self.f = xbmcvfs.File(file)
        elif ext == '.ape':
          self.f = xbmcvfs.File(file)
        elif ext == '.wav':
          self.f = xbmcvfs.File(file)
        else:    # not supported format
            raise UnknownFormat
Reply
#6
mr hipp maybe you could show me both your proposals as a patch (diff) instead of verbal description and code snippet? So i get even a feeling for what you are talking about.
AppleTV4/iPhone/iPod/iPad: HowTo find debug logs and everything else which the devs like so much: click here
HowTo setup NFS for Kodi: NFS (wiki)
HowTo configure avahi (zeroconf): Avahi_Zeroconf (wiki)
READ THE IOS FAQ!: iOS FAQ (wiki)
Reply
#7
mr hipp what about preventing the analysis by checking the protocol (no streams should ne analyzed i guess - so check for pipe://)?
AppleTV4/iPhone/iPod/iPad: HowTo find debug logs and everything else which the devs like so much: click here
HowTo setup NFS for Kodi: NFS (wiki)
HowTo configure avahi (zeroconf): Avahi_Zeroconf (wiki)
READ THE IOS FAQ!: iOS FAQ (wiki)
Reply
#8
Patch for xbmc

Code:
xbmc/filesystem/PipesManager.cpp | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/xbmc/filesystem/PipesManager.cpp b/xbmc/filesystem/PipesManager.cpp
index 7389abf..e84fb08 100644
--- a/xbmc/filesystem/PipesManager.cpp
+++ b/xbmc/filesystem/PipesManager.cpp
@@ -318,9 +318,9 @@ void         PipesManager::ClosePipe(XFILE::Pipe *pipe)
     return ;
  
   pipe->DecRef();
-  pipe->Close();
   if (pipe->RefCount() == 0)
   {
+    pipe->Close();
     m_pipes.erase(pipe->GetName());
     delete pipe;
   }

patch for cu.lrclyrics . Not tested in any way. This patch only opens a stream if it as valid extension.

Code:
resources/lib/audiofile.py | 26 ++++++++++++++++----------
1 file changed, 16 insertions(+), 10 deletions(-)

diff --git a/resources/lib/audiofile.py b/resources/lib/audiofile.py
index 977e1c0..74f1633 100644
--- a/resources/lib/audiofile.py
+++ b/resources/lib/audiofile.py
@@ -20,18 +20,24 @@ class AudioFile(object):

     def Open(self,file):
         self.audioStart = 0
-        self.f = xbmcvfs.File(file)
+        self.f = None
         ext = os.path.splitext(file)[1].lower()
-        if   ext == '.mp3':  self.AnalyzeMp3()
-        elif ext == '.ogg':  self.AnalyzeOgg()
-        elif ext == '.wma':  self.AnalyzeWma()
-        #elif ext == '.flac':  self.AnalyzeFlac()
-        elif ext == '.flac': pass
-        elif ext == '.ape': pass
-        elif ext == '.wav': pass
+        if   ext == '.mp3':
+            self.f = xbmcvfs.File(file)
+            self.AnalyzeMp3()
+        elif ext == '.ogg':
+            self.f = xbmcvfs.File(file)
+            self.AnalyzeOgg()
+        elif ext == '.wma':
+            self.f = xbmcvfs.File(file)
+            self.AnalyzeWma()
+        elif ext == '.flac':
+            self.f = xbmcvfs.File(file)
+        elif ext == '.ape':
+            self.f = xbmcvfs.File(file)
+        elif ext == '.wav':
+            self.f = xbmcvfs.File(file)
         else:    # not supported format
-            self.f.close()
-            self.f = None
             raise UnknownFormat

     def Close(self):
Reply
#9
Thx - now i got you and See the validity
AppleTV4/iPhone/iPod/iPad: HowTo find debug logs and everything else which the devs like so much: click here
HowTo setup NFS for Kodi: NFS (wiki)
HowTo configure avahi (zeroconf): Avahi_Zeroconf (wiki)
READ THE IOS FAQ!: iOS FAQ (wiki)
Reply
#10
Thx for solving this:

https://github.com/xbmc/xbmc/pull/5741
AppleTV4/iPhone/iPod/iPad: HowTo find debug logs and everything else which the devs like so much: click here
HowTo setup NFS for Kodi: NFS (wiki)
HowTo configure avahi (zeroconf): Avahi_Zeroconf (wiki)
READ THE IOS FAQ!: iOS FAQ (wiki)
Reply
#11
(2014-11-16, 20:07)Mr Hipp Wrote: patch for cu.lrclyrics . Not tested in any way. This patch only opens a stream if it as valid extension.

Code:
resources/lib/audiofile.py | 26 ++++++++++++++++----------
1 file changed, 16 insertions(+), 10 deletions(-)

diff --git a/resources/lib/audiofile.py b/resources/lib/audiofile.py
index 977e1c0..74f1633 100644
--- a/resources/lib/audiofile.py
+++ b/resources/lib/audiofile.py
@@ -20,18 +20,24 @@ class AudioFile(object):

     def Open(self,file):
         self.audioStart = 0
-        self.f = xbmcvfs.File(file)
+        self.f = None
         ext = os.path.splitext(file)[1].lower()
-        if   ext == '.mp3':  self.AnalyzeMp3()
-        elif ext == '.ogg':  self.AnalyzeOgg()
-        elif ext == '.wma':  self.AnalyzeWma()
-        #elif ext == '.flac':  self.AnalyzeFlac()
-        elif ext == '.flac': pass
-        elif ext == '.ape': pass
-        elif ext == '.wav': pass
+        if   ext == '.mp3':
+            self.f = xbmcvfs.File(file)
+            self.AnalyzeMp3()
+        elif ext == '.ogg':
+            self.f = xbmcvfs.File(file)
+            self.AnalyzeOgg()
+        elif ext == '.wma':
+            self.f = xbmcvfs.File(file)
+            self.AnalyzeWma()
+        elif ext == '.flac':
+            self.f = xbmcvfs.File(file)
+        elif ext == '.ape':
+            self.f = xbmcvfs.File(file)
+        elif ext == '.wav':
+            self.f = xbmcvfs.File(file)
         else:    # not supported format
-            self.f.close()
-            self.f = None
             raise UnknownFormat

     def Close(self):

i've added it in slightly different way:
https://github.com/ronie/script.cu.lrcly...7d13c8932d


also need to prevent opening the stream to search for embedded lyrics:
https://github.com/ronie/script.cu.lrcly...caa444bd9a

afaik that should cover all the places in the addon where it opens/closes the stream,
but since i don't have an airplay setup, i won't be able to test it myself.
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply

Logout Mark Read Team Forum Stats Members Help
Airplay & cu.lrclyrics0