PDA

View Full Version : sox, replaygain, and ogg



mlmurray
2005-10-21, 08:38
I have a SqueezeBox 1, thus when I listen to an *.ogg file it must either be converted to wav or mp3 format in order to be played.

I have quite a few files in ogg format and I have tagged them all using vorbisgain to generate the appropriate replaygain tags. Slimserver reads these tags fine in the web interface, but, of course, when sox or oggdec decodes them it ignores the replaygain tags so I'm out of luck with that.

I did note that sox has a -v (volume) option, that I think can be set using the replaygain value in dB. I'm wondering if there is a variable available to be used in convert.conf for setting the -v option (you know, like $FILE$ or $QUALITY$ or $BITRATE$)? I was hoping for something like $GAIN$.

On a side note, I was using mplayer to decode *.oggs using the following line in slimserver-convert.conf:

[mplayer] -novideo -ao pcm:file=/dev/fd/4 $FILE$ 4>&1 1>/dev/null
Alas, since I've upgrade Ubuntu linux to Breezy (5.10), this hasn't been working. It looks like only root can write to /dev/fd/4 now and the song stops playing just a few (maybe 10) seconds into the song. I wouldn't mind getting this working again, but I'd also like to get replaygain support in sox since it is the default program to transcode ogg files in slimserver.

I would appreciate any ideas and guidance.

mlmurray
2005-10-22, 08:45
I have a SqueezeBox 1, thus when I listen to an *.ogg file it must either be converted to wav or mp3 format in order to be played.

I have quite a few files in ogg format and I have tagged them all using vorbisgain to generate the appropriate replaygain tags. Slimserver reads these tags fine in the web interface, but, of course, when sox or oggdec decodes them it ignores the replaygain tags so I'm out of luck with that.

I did note that sox has a -v (volume) option, that I think can be set using the replaygain value in dB. I'm wondering if there is a variable available to be used in convert.conf for setting the -v option (you know, like $FILE$ or $QUALITY$ or $BITRATE$)? I was hoping for something like $GAIN$.

On a side note, I was using mplayer to decode *.oggs using the following line in slimserver-convert.conf:

[mplayer] -novideo -ao pcm:file=/dev/fd/4 $FILE$ 4>&1 1>/dev/null
Alas, since I've upgrade Ubuntu linux to Breezy (5.10), this hasn't been working. It looks like only root can write to /dev/fd/4 now and the song stops playing just a few (maybe 10) seconds into the song. I wouldn't mind getting this working again, but I'd also like to get replaygain support in sox since it is the default program to transcode ogg files in slimserver.

I would appreciate any ideas and guidance.



Replying to my own post... Okay, it looks like a confluence of changes conspired to confound me, but I think I've sorted though it.

The changes?

I updated mplayer from 1.0pre6 to 1.0pre7 so, much of the time, I just had the slimserver-convert.conf line wrong.

I had updated Ubuntu Hoary to Breezy and somehow not all of the perl modules that I had installed previously came accross, so when I started slimserver, it asked me to install several, which I did as a regular user (not root) using the built-in utility (pretty slick, actually). The fact that they were not installed as root, I think caused the problem with not being able to write to /dev/fd/4.

I subsequently installed the afore mentioned perl modules "normally", throught apt-get. Once I did this, and got rid of the modules slimserver had download for me, things started working fine again. Well, with one exception. Apparantly, my distribution's version of DBI.pm (perl 5.8.7) conflicts with the version that comes with Slimserver, so I had to rename the slimserver version (DBI.pm.old).

I realize most of these problems were brought on through upgrading an my own meddling, but I thought it important to post the results in case someone else encounters similar problems and goes searching through these forums for an answer.

Although, the ability to use the replaygain value from slimserver (6.2) as a variable in convert.conf, I still think might be useful, if it's possible. Is there someplace to look in the documentation for a list of those variables?

Spies
2005-10-22, 09:38
"Although, the ability to use the replaygain value from slimserver (6.2)
as a variable in convert.conf, I still think might be useful, if it's
possible. Is there someplace to look in the documentation for a list
of those variables?"

I was hoping to do this exact thing! I want to be able to plug the
replaygain value in slimserver into the --scale option of LAME while
transcoding. This way I would get replaygained mp3 streams from
slimsever independent of file type as long as the source files
replaygain tags are recognized by slimserver. However I have not seen
a response to my previous posts on the subject so I do not know if
this is even possible, Steven



On 10/22/05, mlmurray <mlmurray.1xb91b (AT) no-mx (DOT) forums.slimdevices.com> wrote:
>
> mlmurray Wrote:
> > I have a SqueezeBox 1, thus when I listen to an *.ogg file it must
> > either be converted to wav or mp3 format in order to be played.
> >
> > I have quite a few files in ogg format and I have tagged them all using
> > vorbisgain to generate the appropriate replaygain tags. Slimserver
> > reads these tags fine in the web interface, but, of course, when sox or
> > oggdec decodes them it ignores the replaygain tags so I'm out of luck
> > with that.
> >
> > I did note that sox has a -v (volume) option, that I think can be set
> > using the replaygain value in dB. I'm wondering if there is a variable
> > available to be used in convert.conf for setting the -v option (you
> > know, like $FILE$ or $QUALITY$ or $BITRATE$)? I was hoping for
> > something like $GAIN$.
> >
> > On a side note, I was using mplayer to decode *.oggs using the
> > following line in slimserver-convert.conf:
> > >
> Code:
> --------------------
> > > [mplayer] -novideo -ao pcm:file=/dev/fd/4 $FILE$ 4>&1 1>/dev/null
> --------------------
> > >
> > Alas, since I've upgrade Ubuntu linux to Breezy (5.10), this hasn't
> > been working. It looks like only root can write to /dev/fd/4 now and
> > the song stops playing just a few (maybe 10) seconds into the song. I
> > wouldn't mind getting this working again, but I'd also like to get
> > replaygain support in sox since it is the default program to
> > transcode ogg files in slimserver.
> >
> > I would appreciate any ideas and guidance.
>
>
>
> Replying to my own post... Okay, it looks like a confluence of changes
> conspired to confound me, but I think I've sorted though it.
>
> The changes?
>
> I updated mplayer from 1.0pre6 to 1.0pre7 so, much of the time, I just
> had the slimserver-convert.conf line wrong.
>
> I had updated Ubuntu Hoary to Breezy and somehow not all of the perl
> modules that I had installed previously came accross, so when I started
> slimserver, it asked me to install several, which I did as a regular
> user (not root) using the built-in utility (pretty slick, actually).
> The fact that they were not installed as root, I think caused the
> problem with not being able to write to /dev/fd/4.
>
> I subsequently installed the afore mentioned perl modules "normally",
> throught apt-get. Once I did this, and got rid of the modules
> slimserver had download for me, things started working fine again.
> Well, with one exception. Apparantly, my distribution's version of
> DBI.pm (perl 5.8.7) conflicts with the version that comes with
> Slimserver, so I had to rename the slimserver version (DBI.pm.old).
>
> I realize most of these problems were brought on through upgrading an
> my own meddling, but I thought it important to post the results in case
> someone else encounters similar problems and goes searching through
> these forums for an answer.
>
> Although, the ability to use the replaygain value from slimserver (6.2)
> as a variable in convert.conf, I still think might be useful, if it's
> possible. Is there someplace to look in the documentation for a list
> of those variables?
>
>
> --
> mlmurray
>

sdevans
2005-11-01, 08:17
I've been unable to use mplayer to decode my ogg files to accomplish replaygain at all. I'm pretty sure I've got mplayer working ok as I'm using the older version that is compatible with AlienBBC out of the box.

Any advice on getting replaygain to work, as I finally got it working on flac files, but it's sort of pointless when an ogg file comes along on the playlist....

thanks

Stephen.

sdevans
2005-11-01, 08:25
In addition I've had some success with a different version of oggdec that does support replaygain, however it chokes pretty quickly. Playback of one file is ok, but trying to skip forward or back on a playlist seems to stop it. I'm assuming the arguments sent to it by slimserver aren't interpreted properly, though -r for replaygain added to the convert.conf is.

Anyone got any ideas?

mlmurray
2005-11-01, 08:38
Here are the ogg lines from my "old" slimserver-convert.conf file:



ogg wav * *
[mplayer] -novideo -ao pcm -aofile /dev/fd/4 $FILE$ 4>&1 1>/dev/null

ogg mp3 * *
[mplayer] -novideo -ao pcm -aofile /dev/fd/4 $FILE$ 4>&1 1>/dev/null | $lame$ --silent -q $QUALITY$ -b $BITRATE$ - -


Note that the -ao and -aofile options are different for the latest version of mplayer - see my first post above for the differences. You might also have to comment out the ogg aiff lines in convert.conf (or just uncheck them in the Server Settings) just to be sure they don't conflict.

You may also want to quickly check to make sure mplayer can actually play oggs by trying to play one using the command line out your computers speakers just to make sure you're not missing an codecs or libraries that mplayer may require in order to play oggs.

Good luck!