Mailing List Archive

MythMusic taking FOREVER!!!!!!
I just installed the version of mythMusic that is available on the myth
website, then ran it .. .no mp3s yet... quit ... mount a samba share with
about 4 gb's of mp3's and reran. this is where it gets fun.... i hit the
mythmusic button and it just stopped... its goin thru the files on my other
pc .. but DAMN slowly!

Any way to speed it up or should i just let it crawl thru?

Justin
Re: MythMusic taking FOREVER!!!!!! [ In reply to ]
On Saturday 31 May 2003 06:44 pm, Justin Hunt wrote:
> I just installed the version of mythMusic that is available on the myth
> website, then ran it .. .no mp3s yet... quit ... mount a samba share with
> about 4 gb's of mp3's and reran. this is where it gets fun.... i hit the
> mythmusic button and it just stopped... its goin thru the files on my other
> pc .. but DAMN slowly!
>
> Any way to speed it up or should i just let it crawl thru?

You can either:
- Contribute a patch to speed up the length calculation for mp3 files.
- Switch to oggs.
- Wait for it to finish.

I'd prefer the first option, but no-one else has done this, and I don't use
mp3 files.

Isaac
Re: MythMusic taking FOREVER!!!!!! [ In reply to ]
Justin Hunt said:
> I just installed the version of mythMusic that is available on the myth
> website, then ran it .. .no mp3s yet... quit ... mount a samba share
> with about 4 gb's of mp3's and reran. this is where it gets fun.... i
> hit the mythmusic button and it just stopped... its goin thru the files
> on my other pc .. but DAMN slowly!
>
Pffft! Try it with 29GB of MP3s!!

> Any way to speed it up or should i just let it crawl thru?
>
I have the same setup. I mount a samba share with all my MP3s. Like I
said, I have nearly 30GB of 'em. I've had to rebuild the database several
times. Now, if I ever have to run a fresh music scan (rebuilding the DB)
I do it at night when I'm about to go to sleep :) Good news is, now that
frontend is separate from backend, you should be able to run another
instance of frontend if you need to. That way, you can still use the
other components (mythtv, gallery, game, etc.).

Keep in mind, you won't need to wait this long EVERY time you launch
mythmusic :)

Jeremy
Re: MythMusic taking FOREVER!!!!!! [ In reply to ]
This situation has greatly improved in the CVS version of mythmusic.

- Sped up overall music cataloging process
- Music catalog is only read on FIRST startup, after that only by explicit
user action
- Music cataloging is kicked off in its own thread

-JAC


On Saturday 31 May 2003 07:22 pm, Jeremy Oddo wrote:
> Justin Hunt said:
> > I just installed the version of mythMusic that is available on the myth
> > website, then ran it .. .no mp3s yet... quit ... mount a samba share
> > with about 4 gb's of mp3's and reran. this is where it gets fun.... i
> > hit the mythmusic button and it just stopped... its goin thru the files
> > on my other pc .. but DAMN slowly
Re: MythMusic taking FOREVER!!!!!! [ In reply to ]
On Saturday 31 May 2003 09:46 pm, Joseph A. Caputo wrote:
> This situation has greatly improved in the CVS version of mythmusic.
>
> - Sped up overall music cataloging process
> - Music catalog is only read on FIRST startup, after that only by explicit
> user action
> - Music cataloging is kicked off in its own thread

Heh, true, but it's still reading in the entire file for mp3s to determine the
song length, and it doesn't need to be doing so. Makes it slow, especially
over a network.

Isaac
RE: MythMusic taking FOREVER!!!!!! [ In reply to ]
I looked at that code and was wondering about that. IIRC it's accurate to
take the file length less the size of the ID3 headers and calculate the time
using the bitrate. Also i think there is an ID3v2 tag for song length,
although i may be confusing that one with asf headers.

-----Original Message-----
From: mythtv-users-bounces@snowman.net
[mailto:mythtv-users-bounces@snowman.net]On Behalf Of Isaac Richards
Sent: Saturday, May 31, 2003 7:36 PM
To: Discussion about mythtv
Subject: Re: [mythtv-users] MythMusic taking FOREVER!!!!!!


On Saturday 31 May 2003 09:46 pm, Joseph A. Caputo wrote:
> This situation has greatly improved in the CVS version of mythmusic.
>
> - Sped up overall music cataloging process
> - Music catalog is only read on FIRST startup, after that only by explicit
> user action
> - Music cataloging is kicked off in its own thread

Heh, true, but it's still reading in the entire file for mp3s to determine
the
song length, and it doesn't need to be doing so. Makes it slow, especially
over a network.

Isaac
_______________________________________________
mythtv-users mailing list
mythtv-users@snowman.net
http://lists.snowman.net/cgi-bin/mailman/listinfo/mythtv-users
Re: MythMusic taking FOREVER!!!!!! [ In reply to ]
On Saturday 31 May 2003 10:52 pm, Dan Conti wrote:
> I looked at that code and was wondering about that. IIRC it's accurate to
> take the file length less the size of the ID3 headers and calculate the
> time using the bitrate. Also i think there is an ID3v2 tag for song length,
> although i may be confusing that one with asf headers.

It's a little more complicated than that for VBR files, but that works for CBR
if you subtract out the tag length, yeah.

Isaac
Re: MythMusic taking FOREVER!!!!!! [ In reply to ]
> You can either:
> - Contribute a patch to speed up the length calculation for mp3 files.
> - Switch to oggs.
> - Wait for it to finish.
>
> I'd prefer the first option, but no-one else has done this, and I don't use
> mp3 files.

I was adding something like 110 gigs over my dorm's crappy 10baseT and
didn't feel like waiting forever, so I used this. Seemed to work
fine. If the bitrate stays constant for the first 32 frames, it
assumes CBR and estimates the total time.

(This is from before the CVS crashed last month, so I can't easily
make an up-to-date patch right now)

-jim

--- /home/jim/.em/backup/!home!src!myth!mythmusic-debian-snapshot!mythmusic!maddecoder.cpp.~1.9.~ 2003-04-26 23:46:06.000000000 -0400
+++ maddecoder.cpp 2003-05-01 00:16:04.000000000 -0400
@@ -5,6 +5,7 @@
#include <math.h>
#include <stdio.h>
#include <qregexp.h>
+#include <sys/stat.h>
using namespace std;

#include <mad.h>
@@ -632,6 +633,11 @@
timer = mad_timer_zero;

FILE *input = fopen(filename.ascii(), "r");
+ struct stat s;
+ fstat(fileno(input),&s);
+
+ unsigned long old_bitrate = 0;
+ int vbr=0, checked=0;

while (1)
{
@@ -657,11 +663,25 @@
int tagsize = id3_tag_query(stream.this_frame,
stream.bufend -
stream.this_frame);
- if (tagsize > 0)
+ if (tagsize > 0) {
mad_stream_skip(&stream, tagsize);
+ s.st_size -= tagsize;
+ }
}
- }
- mad_timer_add(&timer, header.duration);
+ } else {
+ if (checked == 0)
+ old_bitrate = header.bitrate;
+ else if (header.bitrate != old_bitrate)
+ vbr = 1;
+ if (checked == 32 && vbr == 0) // Assume CBR
+ {
+ length = (s.st_size * 8) / (old_bitrate / 1000);
+ goto gotlength;
+ }
+ checked++;
+
+ mad_timer_add(&timer, header.duration);
+ }
}

if (stream.error != MAD_ERROR_BUFLEN)
@@ -671,13 +691,15 @@
buflen -= stream.next_frame - &buffer[0];
}

+ length = mad_timer_count(timer, MAD_UNITS_MILLISECONDS);
+
+gotlength:
+
mad_header_finish(&header);
mad_stream_finish(&stream);

fclose(input);

- length = mad_timer_count(timer, MAD_UNITS_MILLISECONDS);
-
Metadata *retdata = new Metadata(filename, artist, album, title, genre,
year, tracknum, length);
Re: MythMusic taking FOREVER!!!!!! [ In reply to ]
On Saturday 31 May 2003 10:44 pm, Justin Hunt wrote:
> I just installed the version of mythMusic that is available on the myth
> website, then ran it .. .no mp3s yet... quit ... mount a samba share with
> about 4 gb's of mp3's and reran. this is where it gets fun.... i hit the
> mythmusic button and it just stopped... its goin thru the files on my other
> pc .. but DAMN slowly!
>
> Any way to speed it up or should i just let it crawl thru?


This is improved in current CVS (in case your scan isn't done yet).

- thor