Bug 7937 - problem with parsing ogg file headers
: problem with parsing ogg file headers
Status: CLOSED FIXED
Product: Logitech Media Server
Classification: Unclassified
Component: Misc
: 7.1
: PC Debian Linux
: P1 major (vote)
: 7.x
Assigned To: Andy Grundman
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2008-04-22 07:07 UTC by Keyzer Suze
Modified: 2009-07-31 10:19 UTC (History)
1 user (show)

See Also:
Category: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Keyzer Suze 2008-04-22 07:07:41 UTC
I am having problems playing oggs files with this version 19009

An example
This is the vorbis info on the file
=====================
vorbiscomment 11.Bizarre_Love_Triangle.ogg
ARTIST=New Order
ALBUM=Substance 1987 Disc 1
TITLE=Bizarre Love Triangle
TRACKNUMBER=11
=====================

this is from the errorlog
=====================
[08-04-22 08:42:50.3288] Slim::Utils::Misc::msg (1329) Warning: [08:42:50.3282] This is not an Ogg bitstream (no OggS header). at /usr/share/squeezecenter/lib/Ogg/Vorbis/Header/PurePerl.pm line 138.
[08-04-22 08:42:50.3369] Slim::Utils::Misc::msg (1329) Warning: [08:42:50.3367] Use of uninitialized value in addition (+) at /usr/share/squeezecenter/lib/Ogg/Vorbis/Header/PurePerl.pm line 199.
[08-04-22 08:42:50.3372] Slim::Utils::Misc::msg (1329) Warning: [08:42:50.3369] Use of uninitialized value in seek at /usr/share/squeezecenter/lib/Ogg/Vorbis/Header/PurePerl.pm line 202.
[08-04-22 08:42:50.3376] Slim::Utils::Misc::msg (1329) Warning: [08:42:50.3374] No comment header? at /usr/share/squeezecenter/lib/Ogg/Vorbis/Header/PurePerl.pm line 262.
[08-04-22 08:42:50.3379] Slim::Utils::Misc::msg (1329) Warning: [08:42:50.3377] Ogg::Vorbis::Header::PurePerl: Didn't find an ogg header - invalid file?
=====================

Seems like it can't handle there being now comment field (guessing by the error message)

I am running squeezecenter on debian amd64

Alex
Comment 1 Andy Grundman 2008-04-22 07:46:20 UTC
Please attach the file.
Comment 2 Andy Grundman 2008-04-23 10:02:22 UTC
Keyzer, can you get me a broken file ASAP?  Would like to fix this before 7.0.1.
Comment 3 Keyzer Suze 2008-04-23 14:38:19 UTC
Hi

Would love to, but when I attempt to recreate it for the same file it doesn't always work - so I am guessing it is not a problem with the file itself.

I have added 

logWarning("Ogging ->".$file);
in Ogg.pm and see if I can track it down from there

Comment 4 Keyzer Suze 2008-04-23 15:10:08 UTC
Let me correct that I have added a logWarning to 
/usr/share/squeezecenter/lib/Ogg/Vorbis/Header/PurePerl.pm

seems like it gets called from other places apart from Ogg.pm

I add this 
warn $data->{'filename'};
to /usr/share/squeezecenter/lib/Ogg/Vorbis/Header/PurePerl.pm @ 137

but it seem like filename isn't always set (sorry looking for a quick hack to find the problem).

The file it failed on the first time, did not fail the second time (even after a restart of the server).

What I do to get the problem to occur is

load a playlist (about 20-30 songs), then start clicking around the playlist, which causes this error to occur. what I notice as well is I get decode errors on the player at the same time (squeezeslave).

My gut feeling (only a feeling) is that, this is a plugin problem, i installed a whole lot of plugins before (since removed, but not sure what has been left behind).  SC gets slow and unresponsive at these times.  If I load the play list and then let it play I normally don't have any problems.

I will read up a bit more on getting filenames from perl filehandles if i can and try some more, also maybe a stack dump as well to see where this call has come from

alex
Comment 5 Andy Grundman 2008-04-23 15:54:57 UTC
Are you running 7.1 and seeking within Ogg files?  That might be part of your problem, especially if Squeezeslave doesn't support it.  Try using a real player.
Comment 6 Keyzer Suze 2008-04-23 20:54:44 UTC
Hi

Yep 7.1, I will try the SB3, but I haven't been trying to seek at all.  The only thing I try is to change tracks whilst the other is still playing.
Comment 7 Keyzer Suze 2008-04-24 15:09:36 UTC
Andy I have tried with a SB3 and having had a play with it for a while (about the same time as with squeezeslave), I have not seen these errors come up.


I presume by your comments and by investigating a bit, that the sb3 doesn't handle ogg natively and there for doesn't suffer from the this, where as squeezeslave does and suffers from the problem because of the inability to search (ff or fr) a ogg stream.

looks like it can be closed then
Comment 8 Andy Grundman 2008-04-24 15:20:58 UTC
SB does support native Ogg, and has some problems with it, but in general it works fine.
Comment 9 Keyzer Suze 2008-04-24 21:22:45 UTC
Hi

I think I have spoken too soon, I have upgraded to 19102.  I got the errors again, whilst loading a playlist to a SB3.  Scenario sc was freshly restarted and the SB3 had been reboot.  And the play list wasn't active on any device.

I did a quick strace on squeezecenter as I had removed the debug code (and lost on the upgrade).

So I think we should re open the bug
Comment 10 Keyzer Suze 2008-04-24 21:24:15 UTC
Hi

I think I have spoken too soon, I have upgraded to 19102.  I got the errors again, whilst loading a playlist to a SB3.  Scenario sc was freshly restarted and the SB3 had been reboot.  And the play list wasn't active on any device.

I did a quick strace on squeezecenter as I had removed the debug code (and lost on the upgrade). Seem like it was scanning each of the files

So I think we should re open the bug
Comment 11 Keyzer Suze 2008-04-25 01:23:18 UTC
Hi

I have added a Carp::cluck at
137 /usr/share/squeezecenter/lib/Ogg/Vorbis/Header/PurePerl.pm
this is just before the warning - seems like an appropriate place

this is the output

[08-04-25 18:14:13.0212] Slim::Utils::Misc::msg (1329) Warning: [18:14:13.0208]  at /usr/share/squeezecenter/lib/Ogg/Vorbis/Header/PurePerl.pm line 139
        Ogg::Vorbis::Header::PurePerl::_checkHeader('HASH(0x5522610)') called at /usr/share/squeezecenter/lib/Ogg/Vorbis/Header/PurePerl.pm line 100
        Ogg::Vorbis::Header::PurePerl::_init('HASH(0x5522610)') called at /usr/share/squeezecenter/lib/Ogg/Vorbis/Header/PurePerl.pm line 48
        Ogg::Vorbis::Header::PurePerl::new('Ogg::Vorbis::Header::PurePerl', 'GLOB(0x5a4e9c0)') called at /usr/share/perl5/Slim/Formats/Ogg.pm line 252
        Slim::Formats::Ogg::getInitialAudioBlock('Slim::Formats::Ogg', 'FileHandle=GLOB(0x53d93a0)') called at /usr/share/perl5/Slim/Player/Source.pm line 2052
        Slim::Player::Source::openSong('Slim::Player::Squeezebox2=ARRAY(0x5688b40)', 'undef') called at /usr/share/perl5/Slim/Player/Source.pm line 377
        Slim::Player::Source::playmode('Slim::Player::Squeezebox2=ARRAY(0x5688b40)', 'play') called at /usr/share/perl5/Slim/Player/Source.pm line 1291
        Slim::Player::Source::jumpto('Slim::Player::Squeezebox2=ARRAY(0x5688b40)', 7, 'undef') called at /usr/share/perl5/Slim/Control/Commands.pm line 754  
        Slim::Control::Commands::__ANON__() called at /usr/share/perl5/Slim/Control/Commands.pm line 809
        Slim::Control::Commands::playlistJumpCommand('Slim::Control::Request=HASH(0x58405e0)') called at /usr/share/perl5/Slim/Control/Request.pm line 1753  
        eval {...} called at /usr/share/perl5/Slim/Control/Request.pm line 1753
        Slim::Control::Request::execute('Slim::Control::Request=HASH(0x58405e0)') called at /usr/share/perl5/Slim/Web/JSONRPC.pm line 354
        Slim::Web::JSONRPC::requestMethod('HASH(0x5a3c6b0)') called at /usr/share/perl5/Slim/Web/JSONRPC.pm line 201
        eval {...} called at /usr/share/perl5/Slim/Web/JSONRPC.pm line 201
        Slim::Web::JSONRPC::handleURI('Slim::Web::HTTP::ClientConn=GLOB(0x5968700)', 'HTTP::Response=HASH(0x5a3ba50)') called at /usr/share/perl5/Slim/Web/HTTP.pm line 497
        Slim::Web::HTTP::processHTTP('Slim::Web::HTTP::ClientConn=GLOB(0x5968700)') called at /usr/share/perl5/Slim/Networking/Select.pm line 243
        eval {...} called at /usr/share/perl5/Slim/Networking/Select.pm line 243
        Slim::Networking::Select::select(0.422580718994141) called at /usr/sbin/squeezecenter-server line 503
        main::idle() called at /usr/sbin/squeezecenter-server line 453
        main::main() called at /usr/sbin/squeezecenter-server line 1012


This was against a SB3, what i did was load a playlist with about 20-30 songs and then quickly select 2 or 3 different tracks. SC seemsed to freeze for a while and then became responsive again. These were left in the server.log file
Comment 12 Andy Grundman 2008-04-25 05:40:11 UTC
Could you reproduce with --debug scan.scanner,player.source?

I think I have actually seen this too, I think the problem might be SC is trying to scan a non-Ogg file as Ogg.  Did you have some non-Ogg files in the playlist?
Comment 13 Andy Grundman 2008-04-25 06:55:36 UTC
I see the problem, the $client->streamformat can get confused and try to find an initial audio block using the wrong format class.  This is only a 7.1+ issue.
Comment 14 Andy Grundman 2008-04-25 06:58:18 UTC
And the reason for the delay is the _skipID3Header function, it is scanning the entire file looking for OggS.  I'll fix this to give up after some small amount of data (or actually check for an ID3 header).
Comment 15 Andy Grundman 2008-04-25 08:43:44 UTC
I fixed the Ogg parser so it will at least fail a lot quicker when it has to seek through the whole file.  I'll look at fixing the invalid streamformat issue soon.
Comment 16 Andy Grundman 2008-04-25 09:18:17 UTC
Fixed in 7.1 change 19168.  The streamformat was not being set early enough.
Comment 17 James Richardson 2008-07-10 13:53:48 UTC
Keyzer:

Can you please test the latest 7.1 nightly build.  Reopen this bug if you still sen an issue.
Comment 18 James Richardson 2008-07-16 15:50:00 UTC
Keyzer, please retest with SqueezeCenter 7.1-21796.  if you still see the error, then reopen the bug with added comments.
Comment 19 Chris Owens 2008-07-30 15:27:17 UTC
This bug has now been fixed in the 7.1 release version of SqueezeCenter!  Please download the new version from http://www.slimdevices.com if you haven't already.  

If you are still experiencing this problem, feel free to reopen the bug with your new comments and we'll have another look.
Comment 20 James Richardson 2008-12-15 12:32:25 UTC
This bug has been fixed in the 7.3.0 release version of SqueezeCenter!

Please download the new version from http://www.slimdevices.com/su_downloads.html if you haven't already.  

If you are still experiencing this problem, feel free to reopen the bug with your new comments and we'll have another look.
Comment 21 Chris Owens 2009-07-31 10:19:44 UTC
Reduce number of active targets for SC