| View previous topic :: View next topic |
| Author |
Message |
Anonymous Guest
|
Posted: Tue Jun 05, 2007 3:48 am Post subject: Ices 2 - Metadata Problems |
|
|
Hi all,
I recently installed and configured icecast2 in Kubuntu feisty fawn. I'm using ices2 as my source client and amarok as my media player. Everything works fine except for getting ices2 to accept the SIGUSR1 command to refresh the metadata.
I'm using a python script in amarok that updates my metadata file, reads the pid file, and then sends sigusr1 to the pid. This script updates the metadata file just fine, but doesn't seem to pass the sigusr1 command on to the proper pid. Ices also updates the pid with the correct value. The metadata updates properly in ices2 when i send the signal manually.
this is the relevant part of the amarok script:
| Code: |
def trackChange( self ):
thisArtist = "artist=" + os.popen("dcop amarok player artist").read()
thisTitle = "title=" + os.popen("dcop amarok player title").read()
#thisAlbum = "album=" + os.popen("dcop amarok player album").read()
#thisGenre = "genre=" + os.popen("dcop amarok player genre").read()
#thisTrack = "track=" + os.popen("dcop amarok player track").read()
#thisYear = "year=" + os.popen("dcop amarok player year").read()
#thisComment = "comment=" + os.popen("dcop amarok player comment").read()
metadataFile = open (self.icesMetadata, "w")
metadataFile.write(thisArtist + thisTitle) #+ thisAlbum + thisGenre + thisTrack + thisYear + thisComment)
metadataFile.close()
self.updateMetadata()
pass
def updateMetadata(self):
pidFile = open (self.icesPid, "r")
pid = pidFile.readline()
pidFile.close()
cmd = "kill -s SIGUSR1 " + pid
os.system(cmd)
|
and the input section of my ices2 config file:
| Code: |
<input>
<module>alsa</module>
<param name="rate">44100</param>
<param name="channels">2</param>
<param name="device">hw:0,0</param>
<!-- Read metadata (from stdin by default, or -->
<!-- filename defined below (if the latter, only on SIGUSR1) -->
<param name="metadata">1</param>
<param name="metadatafilename">/tmp/ices-metadata</param>
</input>
|
I was running ices2 as root and amarok as me, but realized that amarok could not send a signal to a root process, but running ices2 as me doesn't help either. For some reason as well, only the title field in the metadata is getting passed out to the client (when i send sigusr1 manually), even though icecast2 admin shows artist - title (all the commented portion of the script is my shot at fixing that, but it didn't). The pid and metadata file are configured properly in the script config window. I didn't write the python script, but I have enough programming experience with other languages to basically move through the flow of it. The rest of the file seems alright. It's too large to post, but i can post the file if it will be of any help. |
|
| Back to top |
|
 |
karlH Code Warrior

Joined: 13 Jun 2005 Posts: 5476 Location: UK
|
Posted: Tue Jun 05, 2007 11:07 am Post subject: |
|
|
make sure the metadata format is correct. ie
artist=.....
title=....
because that doesn't look like what you are doing.
The kill mechanism works fine in ices2, you can always check the ices log file to see if it was received.
karl. |
|
| Back to top |
|
 |
Anonymous Guest
|
Posted: Tue Jun 05, 2007 11:52 pm Post subject: |
|
|
Here's my current metadata file
| Code: |
artist=Steely Dan
title=Kid Charlemagne
|
this is the correct song playing currently in amarok
In my log file I see this when i start ices
| Code: |
[2007-06-05 19:44:51] INFO ices-core/main IceS 2.0.1 started...
[2007-06-05 19:44:51] INFO input-alsa/alsa_open_module Opened audio device hw:0,0
[2007-06-05 19:44:51] INFO input-alsa/alsa_open_module using 2 channel(s), 44100 Hz, buffer 371 ms
[2007-06-05 19:44:51] INFO input-alsa/alsa_open_module Starting metadata update thread
[2007-06-05 19:44:51] INFO audio/resample_initialise Initialised resampler for 2 channels, from 44100 Hz to 44100 Hz
[2007-06-05 19:44:51] INFO encode/encode_initialise Encoder initialising in VBR mode: 2 channel(s), 44100 Hz, quality 6.000000
[2007-06-05 19:44:51] INFO signals/signal_usr1_handler Metadata update requested
[2007-06-05 19:44:51] DBUG metadata/metadata_thread_signal meta thread wakeup
[2007-06-05 19:44:51] DBUG metadata/metadata_thread_signal reading metadata from "/tmp/ices-metadata"
[2007-06-05 19:44:51] INFO metadata/metadata_thread_signal tag 1 is artist=Anberlin
[2007-06-05 19:44:51] INFO metadata/metadata_thread_signal tag 2 is title=There Is No Mathematics To Love And Loss
[2007-06-05 19:44:51] INFO metadata/metadata_thread_signal Updating metadata
[2007-06-05 19:44:51] INFO stream/ices_instance_stream Connected to server: localhost:8000/ices.ogg
[2007-06-05 19:44:51] INFO audio/resample_initialise Initialised resampler for 2 channels, from 44100 Hz to 44100 Hz
[2007-06-05 19:44:51] DBUG encode/encode_clear Clearing encoder engine
[2007-06-05 19:44:51] INFO encode/encode_initialise Encoder initialising in VBR mode: 2 channel(s), 44100 Hz, quality 6.000000
|
No changes to the log file when I change the track in amarok
When I send SIGUSR1 manually, this is added to the log
| Code: |
[2007-06-05 19:47:01] INFO signals/signal_usr1_handler Metadata update requested
[2007-06-05 19:47:01] DBUG metadata/metadata_thread_signal meta thread wakeup
[2007-06-05 19:47:01] DBUG metadata/metadata_thread_signal reading metadata from "/tmp/ices-metadata"
[2007-06-05 19:47:01] INFO metadata/metadata_thread_signal tag 1 is artist=Lucas Prata
[2007-06-05 19:47:01] INFO metadata/metadata_thread_signal tag 2 is title=And She Said... (Saint Remix)
[2007-06-05 19:47:01] INFO metadata/metadata_thread_signal Updating metadata
[2007-06-05 19:47:01] INFO audio/resample_initialise Initialised resampler for 2 channels, from 44100 Hz to 44100 Hz
[2007-06-05 19:47:01] DBUG encode/encode_clear Clearing encoder engine
[2007-06-05 19:47:01] INFO encode/encode_initialise Encoder initialising in VBR mode: 2 channel(s), 44100 Hz, quality 6.000000
|
It's pretty clear that my script isn't sending the signal to ices2, but it does update the metafile. This probably isn't the best place for python questions, but if i run the command exactly as it is in the script from a console, the metadata updates. There's no log file for the the script unfortunately. I guess I'll try and get in touch with the guy that wrote it. |
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2002 phpBB Group subRebel style by ktauber
|