| View previous topic :: View next topic |
| Author |
Message |
Anonymous Guest
|
Posted: Wed Mar 05, 2008 10:43 am Post subject: Metadata Question again |
|
|
hey i wanted to ask how is the refresh intervall of ices2 if it reads metadata from a file?
i want to allways set just 1 metadata pair of artist and title in a textfile where ices2 gets the information from and update that file with a perl script but i dont know how and when will ices get the new information since im not using a playlist. |
|
| Back to top |
|
 |
karlH Code Warrior

Joined: 13 Jun 2005 Posts: 5476 Location: UK
|
Posted: Wed Mar 05, 2008 1:39 pm Post subject: |
|
|
The documentation indicates that the metadata is reread when it starts streaming and when a USR1 signal is received.
karl. |
|
| Back to top |
|
 |
Anonymous Guest
|
Posted: Wed Mar 05, 2008 1:57 pm Post subject: |
|
|
| yea thats what i found also but 1st what us an USR1 signal and 2nd i need to get ices to read it again when i update the file with my perl script else i see no chance to have correcct title and artist information when a song changes because i stream them live via line-in but in an fixed order |
|
| Back to top |
|
 |
karlH Code Warrior

Joined: 13 Jun 2005 Posts: 5476 Location: UK
|
Posted: Wed Mar 05, 2008 2:24 pm Post subject: |
|
|
kill -USR1 <pid of ices>
That will send the signal and ices will catch it and process the metadata file. How you initiate the kill is up to you, it could it via a song change plugin or a web page link. Ideally you want it occuring just after the new contents are written to the metadata file.
karl. |
|
| Back to top |
|
 |
Anonymous Guest
|
Posted: Wed Mar 05, 2008 2:27 pm Post subject: |
|
|
| but USR1 will foce ices to restart right? wont i drop my listeners then? or wont there be a time of sinlence then? |
|
| Back to top |
|
 |
karlH Code Warrior

Joined: 13 Jun 2005 Posts: 5476 Location: UK
|
Posted: Wed Mar 05, 2008 2:31 pm Post subject: |
|
|
no, USR1 will tell ices to reissue a new logical stream which is what has to happen for new metadata. The connection is not dropped.
karl. |
|
| Back to top |
|
 |
Anonymous Guest
|
Posted: Wed Mar 05, 2008 2:43 pm Post subject: |
|
|
ok cool i started to code my script and it looks like this for the moment :
| Quote: |
#!/usr/local/bin/perl
open (MYFILE, 'playlist.txt');
while (<MYFILE>)
{
$alles = $_;
@alles = split(',',$alles);
system("echo \"artist=@alles[0]\" > /home/streaming/metadata.txt");
system("echo \"title=@alles[1]\" >> /home/streaming/metadata.txt");
sleep(@alles[2]);
}
close (MYFILE); |
so i have to use this kill -USR1 ices2 in the end of the loop to get the updated metadatas huh?
EDIT
oh for your information the file i get the stuff from looks like:
<artist>,<title>,<length in seconds> |
|
| Back to top |
|
 |
karlH Code Warrior

Joined: 13 Jun 2005 Posts: 5476 Location: UK
|
Posted: Wed Mar 05, 2008 3:55 pm Post subject: |
|
|
That sort of thing, obviously a kill takes a pid which can be from the pidfile written by ices. A killall will take a name but if you have more than one ices process then all of them will get a USR1
karl. |
|
| Back to top |
|
 |
Anonymous Guest
|
Posted: Wed Mar 05, 2008 4:07 pm Post subject: |
|
|
oh thats good im not using more than 1 ices so i can easyly take killall thx very much im gonna try it very soon and give a feedback.
sofar thx for the great help  |
|
| Back to top |
|
 |
Anonymous Guest
|
Posted: Thu Mar 06, 2008 11:49 am Post subject: |
|
|
wow it works pretty fine but obviosly i have to start my mp3 player and the script at the same time but nevermind btw the scipt posted above was wrong so i gonna post the new one soon maybe sum1 else could need it (even though i am absolutly new to this materia but nevertheless its funny)  |
|
| Back to top |
|
 |
|