xine as audio player and cddb problem

everything about the next not so big update

Moderator: Moderator

lorenzodes
master
Posts: 772
Joined: Sun Mar 11, 2007 4:50 pm
Location: move.l 4.w,a6

xine as audio player and cddb problem

Postby lorenzodes » Sat Mar 17, 2007 1:56 pm

Today I have recompiled mms to use xine as audio player (alsaplayer supports fewer audio formats) and noticed it was unable to retrieve track information from freedb.freedb.org:8880. Sniffing the connection I found out an error in the cddb query <ID num>. It is definitely a xine-lib problem (I am using the latest cvs build). Am I the only one who's having it?
"I’m not frightened of dying, anytime will do, I don’t mind. Why should I be frightened of dying? There’s no reason for it, you gotta go sometime"

lorenzodes
master
Posts: 772
Joined: Sun Mar 11, 2007 4:50 pm
Location: move.l 4.w,a6

Postby lorenzodes » Sat Mar 17, 2007 3:02 pm

I have fixed the bug in xine-lib (specificly in ./src/input/input_cdda.c). Now album information is retrieved and saved, but still mms refuses to show titletracks. What am I missing here? :(
"I’m not frightened of dying, anytime will do, I don’t mind. Why should I be frightened of dying? There’s no reason for it, you gotta go sometime"

User avatar
arj
Site Admin
Posts: 2316
Joined: Thu Dec 01, 2005 8:51 pm
Location: Denmark
Contact:

Postby arj » Sun Mar 18, 2007 1:07 pm

Strange.

Mms tries to get the info from xine here:

audio:3373

Code: Select all

    audio_state->p->gather_info();


You can see if xine has the correct info using:

xine.cpp:99

Code: Select all

const char *meta_info = xine_get_meta_info(stream, XINE_META_INFO_TITLE);
  title = (meta_info) ? meta_info : "";
  meta_info = xine_get_meta_info(stream, XINE_META_INFO_ARTIST);
  artist = (meta_info) ? meta_info : "";
  meta_info = xine_get_meta_info(stream, XINE_META_INFO_ALBUM);
  album = (meta_info) ? meta_info : "";


So just insert some cout's and see what XINE thinks the metadata is. Then you can see if it's a problem with xine or mms.

lorenzodes
master
Posts: 772
Joined: Sun Mar 11, 2007 4:50 pm
Location: move.l 4.w,a6

Postby lorenzodes » Sun Mar 18, 2007 1:16 pm

arj wrote:Strange.

Mms tries to get the info from xine here:

audio:3373

Code: Select all

    audio_state->p->gather_info();


You can see if xine has the correct info using:

xine.cpp:99

Code: Select all

const char *meta_info = xine_get_meta_info(stream, XINE_META_INFO_TITLE);
  title = (meta_info) ? meta_info : "";
  meta_info = xine_get_meta_info(stream, XINE_META_INFO_ARTIST);
  artist = (meta_info) ? meta_info : "";
  meta_info = xine_get_meta_info(stream, XINE_META_INFO_ALBUM);
  album = (meta_info) ? meta_info : "";


So just insert some cout's and see what XINE thinks the metadata is. Then you can see if it's a problem with xine or mms.


I am puzzled. All those fields are empty (i.e. "" strings).

I have made a proggie, based on the xine client example, and I can retrieve info via xine_get_meta_info... :(
"I’m not frightened of dying, anytime will do, I don’t mind. Why should I be frightened of dying? There’s no reason for it, you gotta go sometime"

lorenzodes
master
Posts: 772
Joined: Sun Mar 11, 2007 4:50 pm
Location: move.l 4.w,a6

Postby lorenzodes » Sun Mar 18, 2007 2:08 pm

So, if i get your code right, you recurse all the tracks in a CD using xine_play() and for each of them execute xine_get_meta_info() to get song details, then you build the playlist?

Would it be possible to retrieve the local file where xine stores those details? That would make the process faster.
"I’m not frightened of dying, anytime will do, I don’t mind. Why should I be frightened of dying? There’s no reason for it, you gotta go sometime"

User avatar
arj
Site Admin
Posts: 2316
Joined: Thu Dec 01, 2005 8:51 pm
Location: Denmark
Contact:

Postby arj » Sun Mar 18, 2007 3:15 pm

Yes that's correct. Well Xine should cache things so that it shouldn't be much slower than simply reading the file where it's stored (for caching purposes).

lorenzodes
master
Posts: 772
Joined: Sun Mar 11, 2007 4:50 pm
Location: move.l 4.w,a6

Postby lorenzodes » Sun Mar 18, 2007 3:40 pm

arj wrote:Yes that's correct. Well Xine should cache things so that it shouldn't be much slower than simply reading the file where it's stored (for caching purposes).


Well, I tried this:

Code: Select all

=== modified file 'xine.cpp'
--- xine.cpp    2006-09-28 22:16:00 +0000
+++ xine.cpp    2007-03-18 15:14:53 +0000
@@ -98,11 +99,13 @@
 {
   const char *meta_info = xine_get_meta_info(stream, XINE_META_INFO_TITLE);
   title = (meta_info) ? meta_info : "";
+  printf ("Titolo %s\n",(meta_info) ? meta_info : "<sconosciuto>");
   meta_info = xine_get_meta_info(stream, XINE_META_INFO_ARTIST);
+  printf ("Artista %s\n",(meta_info) ? meta_info : "<sconosciuto>");
   artist = (meta_info) ? meta_info : "";
   meta_info = xine_get_meta_info(stream, XINE_META_INFO_ALBUM);
   album = (meta_info) ? meta_info : "";
-
+  printf ("Album %s\n",(meta_info) ? meta_info : "<sconosciuto>");
   int position_, length_ = 0;
   int t = 0, ret = 0;

When I run mms, even if I don't select to play CD audios, I get these:

loading last saved playlist
Titolo <sconosciuto>
Artista <sconosciuto>
Album <sconosciuto>
Titolo <sconosciuto>
Artista <sconosciuto>
Album <sconosciuto>
Titolo <sconosciuto>
Artista <sconosciuto>
Album <sconosciuto>
Titolo <sconosciuto>
Artista <sconosciuto>
Album <sconosciuto>
Titolo <sconosciuto>
Artista <sconosciuto>
Album <sconosciuto>
Titolo <sconosciuto>
Artista <sconosciuto>
Album <sconosciuto>
Titolo <sconosciuto>
Artista <sconosciuto>
Album <sconosciuto>
Titolo <sconosciuto>
Artista <sconosciuto>
Album <sconosciuto>
Titolo <sconosciuto>
Artista <sconosciuto>
Album <sconosciuto>
etc. etc.

Mms keeps trying to get info about CD tracks *forever*.
"I’m not frightened of dying, anytime will do, I don’t mind. Why should I be frightened of dying? There’s no reason for it, you gotta go sometime"

lorenzodes
master
Posts: 772
Joined: Sun Mar 11, 2007 4:50 pm
Location: move.l 4.w,a6

Postby lorenzodes » Sun Mar 18, 2007 3:46 pm

This makes it all work for me (dunno why):

Code: Select all

=== modified file 'xine.cpp'
--- xine.cpp    2006-09-28 22:16:00 +0000
+++ xine.cpp    2007-03-18 15:55:39 +0000
@@ -87,10 +87,10 @@
 }

 void Xine::gather_info()
-{
+{
   stream_mutex.enterMutex();
   check_stream();
-  gather_info_internal();
+//  gather_info_internal();
   stream_mutex.leaveMutex();
 }



So, it's gather_info that messes it up. Why does it get called ad infinutum?
p.s.: yes, I know that my patch breaks elapsed time in music reproduction, but I rather have track titles.
"I’m not frightened of dying, anytime will do, I don’t mind. Why should I be frightened of dying? There’s no reason for it, you gotta go sometime"

lorenzodes
master
Posts: 772
Joined: Sun Mar 11, 2007 4:50 pm
Location: move.l 4.w,a6

Postby lorenzodes » Sun Mar 18, 2007 4:44 pm

Ok, this is much better (it fixes metadata retrieval without breaking elapsed time):

Code: Select all

=== modified file 'xine.cpp'
--- xine.cpp    2006-09-28 22:16:00 +0000
+++ xine.cpp    2007-03-18 16:39:19 +0000
@@ -87,10 +87,13 @@
 }

 void Xine::gather_info()
-{
+{
   stream_mutex.enterMutex();
   check_stream();
-  gather_info_internal();
+  if (xine_get_status(stream) ==XINE_STATUS_IDLE){
+              printf("I shouldn't be here\n");
+  }else
+       gather_info_internal(); //Don't execute gather_info_internal() if there's no mrl
   stream_mutex.leaveMutex();
 }

@@ -98,11 +101,13 @@
 {
   const char *meta_info = xine_get_meta_info(stream, XINE_META_INFO_TITLE);
   title = (meta_info) ? meta_info : "";
+  printf ("Titolo %s\n",(meta_info) ? meta_info : "<sconosciuto>");
   meta_info = xine_get_meta_info(stream, XINE_META_INFO_ARTIST);
+  printf ("Artista %s\n",(meta_info) ? meta_info : "<sconosciuto>");
   artist = (meta_info) ? meta_info : "";
   meta_info = xine_get_meta_info(stream, XINE_META_INFO_ALBUM);
   album = (meta_info) ? meta_info : "";
-
+  printf ("Album %s\n",(meta_info) ? meta_info : "<sconosciuto>");
   int position_, length_ = 0;
   int t = 0, ret = 0;


There's a lot of output that may be unnecessary, but it helped me find the problem.
"I’m not frightened of dying, anytime will do, I don’t mind. Why should I be frightened of dying? There’s no reason for it, you gotta go sometime"

User avatar
arj
Site Admin
Posts: 2316
Joined: Thu Dec 01, 2005 8:51 pm
Location: Denmark
Contact:

Postby arj » Sun Mar 18, 2007 8:50 pm

Thanks. Patch looks good. I'll apply it as 1119.


Return to “1.0.9”

Who is online

Users browsing this forum: No registered users and 1 guest