Bug 2431 - Volume adjustment for Internet Radio
: Volume adjustment for Internet Radio
Status: RESOLVED FIXED
Product: Logitech Media Server
Classification: Unclassified
Component: Audio
: 7.4.0
: All All
: P2 enhancement with 56 votes (vote)
: 7.8.0
Assigned To: Michael Herger
:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2005-10-30 01:13 UTC by Hans Palm
Modified: 2013-06-12 13:34 UTC (History)
12 users (show)

See Also:
Category: ---


Attachments
Add pref to set default volume adjustment for internet streams (8.49 KB, patch)
2013-06-10 11:15 UTC, Michael Herger
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Hans Palm 2005-10-30 01:13:58 UTC
When adding Internet Radio stations manually (using an URL), the volume level 
may be very different from station to station. Add the possibility to add a 
bias volume adjustment to be saved somewhere, probably in a separate file due 
to the problems with Favorites/Playlist for Internet Radio stations. The URL 
of the Radio Station and the volume bias may be stored and used when the 
station is selected. A possible user interface for performing the adjustment 
is to add an information row just like Title/File Format etc that is displayed 
for a radio station using the right button and up/down. One row might 
be "Press RIGHT/LEFT for volume adjustment", making it possible to set a 
volume bias in dB.
Comment 1 Blackketter Dean 2005-10-30 10:35:00 UTC
Excellent idea.  Going to need to deal with this post 6.2.1.
Comment 2 Dan Sully 2006-08-04 16:32:36 UTC
This isn't going to happen for 6.5
Comment 3 Wolfgang Zeller 2007-04-08 09:55:42 UTC
very nice solution proposed here for this problem.

But until this can be realised, a simple single volume adjustment for Internet Radio would help a lot.
Comment 4 Chris Owens 2008-06-02 11:20:16 UTC
proposed: per-track/per-station gain field in new schema
Comment 5 James Richardson 2008-09-11 15:18:04 UTC
*** Bug 9338 has been marked as a duplicate of this bug. ***
Comment 6 Andy Grundman 2008-12-02 05:42:38 UTC
I had a thought that we could provide preset gain values for stations in Staff Picks for example.  You'd just need to record each station for an hour or so and run a ReplayGain analyzer on it.  I suggest someone start up a wiki page and begin making a list of recommended gain values for their favorite stations.  I guess we also need a way to manually set gain values per station so the values can be tested.  This will need to survive database wipes too.
Comment 7 Marc Auslander 2008-12-02 05:58:02 UTC
I think most users are not going to deal with recording (how?) and analyzing.

The original post is, IMHO, close to what I want.  The scenario.

I realize that every time I tune KUHF, it's too loud.  So the next time, instead of just lowering it, I select gain adjust, and then lower it.  Instead of lowering the normal gain, the change (up or down, of course) is set into the gain delta for KUHF.

Probably need some visual indication of the gain delta, either all the time or when gain adjust is selected.
Comment 8 Wolfgang Zeller 2008-12-02 07:20:15 UTC
All these ideas are very nice, but for starters it would help a lot if there was only one single volume offset for all internet radio.

If you are using replaygain, your medium loudness is already lowered to get the needed headroom. Internet radio is not tuned down like that. Quite opposite, most stations are using extreme compression techniques to sound louder. So everytime I am changing to a radio station, it almost blows me away. Sound like 12dB+.

So one single offset volume adjustment would help a lot for the beginning. I for myself most likely wouldn't care about station individual volume offsets and such fancy stuff.
Comment 9 Marc Auslander 2008-12-02 07:52:39 UTC
In my case, exactly one station is currently a serious outlier in volume.

I'm listening to public stations streaming classical music.
Comment 10 Tom Wynne 2008-12-02 07:58:56 UTC
(In reply to comment #8)
> All these ideas are very nice, but for starters it would help a lot if there
> was only one single volume offset for all internet radio.
> 
> If you are using replaygain, your medium loudness is already lowered to get the
> needed headroom. Internet radio is not tuned down like that. Quite opposite,
> most stations are using extreme compression techniques to sound louder. So
> everytime I am changing to a radio station, it almost blows me away. Sound like
> 12dB+.
> 
> So one single offset volume adjustment would help a lot for the beginning. I
> for myself most likely wouldn't care about station individual volume offsets
> and such fancy stuff.
> 

Not sure if this is always true.  The two internet radio sources I frequently use are last.fm and Capital FM London.  Last.fm is significantly quieter than Capital, which in terms of the volume adjustment on the Boom is about -20 (i.e. I need to set last.fm to about 60, Capital at about 40, in order to achieve the same listening level).
Comment 11 Andy Grundman 2008-12-02 08:44:08 UTC
Since you mentioned Last.fm, we should consider what to do for remote sources that are not radio streams and don't provide their own gain information.  Both Pandora and Slacker provide gain (Pandora perfectly, Slacker less so).  Rhapsody and Last.fm do not.  I recall that Last.fm applies gain to the actual audio during encoding (!) so perhaps they do all play at the same level.  So perhaps this bug could apply to Last.fm, but it wouldn't apply to Rhapsody for example.  Maybe I can talk Rhapsody into providing gain information for all their tracks, but that's probably unlikely.
Comment 12 Mark Lanctot 2008-12-02 09:03:06 UTC
I agree with Wolfgang.  While this is crude, it would help tremendously in my use case - going from local file playback to Internet radio and being blasted out of my skull!  Once I've adjusted the volume, the differences in volume between Internet radio stations are not nearly as big as the difference from my local files.

I believe this would be a simple fix which could be implemented quickly as perhaps a crude stopgap and refined later.  Perhaps the volume drop when switching to Internet radio could be adjustable.
Comment 13 Tom Wynne 2008-12-02 09:14:42 UTC
(In reply to comment #12)
> I agree with Wolfgang.  While this is crude, it would help tremendously in my
> use case - going from local file playback to Internet radio and being blasted
> out of my skull!  Once I've adjusted the volume, the differences in volume
> between Internet radio stations are not nearly as big as the difference from my
> local files.
> 
> I believe this would be a simple fix which could be implemented quickly as
> perhaps a crude stopgap and refined later.  Perhaps the volume drop when
> switching to Internet radio could be adjustable.
> 

Surely this would just cause the reverse problem if a blanket adjustment were applied to all non-local streams.  With last.fm, you'd almost certainly constantly have to manually *increase* the volume in order to have it at an appropriate level if you adjusted it with a fixed gain based on a much  louder station.

Of course there is the argument that it's much better to have to manually increase the volume of a quiet station than  to manually decrease a loud one (after it scares you half to death!)  :-)

I take it from one of the comments above that last.fm is somehow considered to be different than a true 'internet radio' station?
Comment 14 Andy Grundman 2008-12-02 09:18:04 UTC
Right, Last.fm is just a sequence of mp3 files, it is not a radio stream.
Comment 15 mooblie 2008-12-02 09:33:21 UTC
Could a favourite-specific user volume setting be kept with internet radio stations not only on SqueezeCentre, but also SqueezeNetwork please?  Thanks!
Comment 16 Moonbase 2009-01-10 07:01:35 UTC
Since many users are using ReplayGain, in my opinion this should be targeted at about the the same loudness level, if anyhow possible (i.e., 89 dB FS). Depending upon how the current code works it might be quite easy just to pass the "gain" parameter with radio streams. (Internet radio would always use what we otherwise would call "Replay Gain Track".)

Usually even Internet Radios target at some "known" output level (but use AGC and compressors/limiters heavily), it might be asked or found out.

I suggest storing it together with the station data (didn't yet look how SC does that), maybe in opml files or the like, so that it could be used by both SN and SC (and entered/changed by users that for instance store their own "radio URLs" as Favorites or the like).
Comment 17 Moonbase 2009-01-10 07:10:11 UTC
In my opinion, a "base" gain for stream-only internet radios could even be "automatically found out" by streaming a representative part of their program into a replay gain program that can read stdin, calculate the "album gain" from that input, and use that value as an overall starting point.

Am I mistaken? Thoughts on that?

The same could be done for radios that provide us with actual digital files (mp3, flac), but in this case it would be better of course of they would provide us with gain data (i.e., in the files' tags).
Comment 18 Andy Grundman 2009-01-10 08:39:40 UTC
I'm willing to add support for a gain attribute in OPML.  Just needs people to do the work of determining the correct gain values for different stations.
Comment 19 Moonbase 2009-01-10 21:46:21 UTC
Sounds great. Now if we could come up with a little gadget that would, say, read 10 radio streams at a time, pipe the audio data into some replay gainer, run that for some hours (or whatever time seems appropriate), and spit out the data into some text file that we could send back to slimdevices...

So we could kinda "let it run" besides our work and feed back the data to you.
And probably someone has to decide "who does which stations".

I'm pondering if we could maybe "misuse" the existing transcoding logic for that ... have it "transcode" into something that calculates RG, terminates reading the stream after x minutes, and writes the RG values somewhere. Or maybe lame or sox could be misused somehow ... send audio to the null device and store the station name and RG value somewhere.

Guess this needs some fresh ideas and a little testing so we could make it "easy" enough for people to participate. Either run something completely separate or maybe make up a plugin to run that from within SC.
Comment 20 Marc Auslander 2009-01-11 05:51:33 UTC
I know we can invent all sorts of high tech magic - but it costs to implement and maintain.

IMHO, the first step is to get a representation of gain delta for radio links.  That has to be in the base.

The next is a way to set the value.  The simplest is to input a number from the UI, but I don't think that's good enough.

What I'd like is a volume adjust mode that adjusts the delta instead of the volume.  When I tune to a station and its volume is wrong, go into that mode and adjust it.

More sophisticated stuff is, I think, the proper purview of third party plugins.
Comment 21 Moonbase 2009-01-11 08:05:18 UTC
I agree in principle. SC should only care about storing and applying ONE value per radio stream, and RG comes to mind since we already support that.

The magic I was talking about was actually a suggestion on how to get this value into the database/OPML in the first place (someone HAS to do it...).
Comment 22 John Wiesenmueller 2009-01-19 13:48:54 UTC
Keep it simple and plain. A (I)nternet (R)adio (S)tream (R)eplay (G)ain (D)ata(b)ase sounds nice, but it is a solution which could be handeled by a plugin, if somebody would like to maintain all the lost and changed radio links in the database after a short time. 

What about an option to set a delta gain (maybe call it output stream volume correction) for "every" Squeezecenter stored music source. A small slider (incl. value) to set during playback. Not exact and as good as a automatic replay gain but most people will understand how it works. The 2nd step could be an stream analyser to set an exact gain value.
Comment 23 James Richardson 2009-02-04 10:34:16 UTC
*** Bug 10954 has been marked as a duplicate of this bug. ***
Comment 24 Chris Buzek 2009-02-05 04:58:05 UTC
Will this enhancement also be available in SqueezeNetwork?
Comment 25 Boudy 2009-07-01 20:10:10 UTC
Would be groovy if this applied to other sources such as Pandora as well as the radio stations.
Comment 26 Andy Grundman 2009-07-01 20:15:25 UTC
Pandora and Slacker are the two services we have that already provide replay gain metadata. :)
Comment 27 Mike Walsh 2011-03-13 14:33:54 UTC
just a datapoint:

winamp uses RG.  however, some files a user has may not have or support RG tags.  so to keep these files from blowing up your stuff, since they usually are "louder" than the 89db ref level, winamp lets you set an amount of db adj to them.  so if no RG is found, -6db is applied to whatever the db level of the file without RG happens to be.  see the feature at prefs > playback > RG

obviously -6db may not always be appropriate, but i find it usually is close enough.  i can adjust it if i want to as well.  winamp doesn't apply this to internet streams afaict, but i see no reason why SBS couldn't do something similar to this for both RG-less files and net streams.  

in addition, winamp has the groovy feature of a RG "pre-amp" which lets you basically adjust what the RG ref level is going to be, so you can still maintain similar volume levels across files while at the same time make them all louder (or quieter).

the only thing winamp is missing is "smartgain."  SBS tho could use this stuff, and it would be the beginning to a more advanced solution to be done later for the net streams.
Comment 28 Mike Walsh 2011-03-13 14:41:26 UTC
related:

bug 3152

bug 4335

bug 4362

bug 4786

probably others as well...
Comment 29 Jim McAtee 2011-11-02 12:47:03 UTC
(In reply to comment #26)
> Pandora and Slacker are the two services we have that already provide replay
> gain metadata. :)

And are they actually being used when a player is configured to apply ReplayGain?

For internet radio, would it be possible to simple allow a user-entered RG value to be applied across the board? Overly simple, I know, but a very big problem that I have now is that when I use RG for local music, internet radio is unusable, especially when I have several players synced. It plays _so_ much louder that I can't even begin streaming a station without having to run around the house adjusting system volumes.
Comment 30 Mike Walsh 2011-11-02 12:59:49 UTC
Jim, thats basically what i suggested in comment 27

essentially a "system wide" RG setting to be applied to any given source, file or stream or whatever, that had no proper RG info.  the winamp default is -6db to such RGless things.  i should add that i don't know if it works on streams, but it does on files.  (in LMS, it would have to know "audio only")

its a bit tricky for SBS tho, since it does "soundcheck" as well, and who knows what else?  (WMP has its own thing i think, etc)  we'd just have to be sure to account for no RG, but soundcheck present, so SBS doesn't apply both the soundcheck value, AND the -6 no RG value, (or whatever thats set to).
Comment 31 Michael Herger 2013-06-07 15:41:36 UTC
*** Bug 4335 has been marked as a duplicate of this bug. ***
Comment 32 Michael Herger 2013-06-10 11:15:31 UTC
Created attachment 7699 [details]
Add pref to set default volume adjustment for internet streams

This patch allows a pref to Settings/Player/Audio to set a default volume adjustment for remote streams which do not come with their own RG value. It would use track rg for all remote sources. The default value is set to -5 (if RG is enabled).

Feedback is very welcome.
Comment 33 Michael Herger 2013-06-12 13:34:27 UTC
Merged to 7.8 - 8b98f49ae46b9ea52a871c0956d1f000cf005f98