[alsa-devel] What does 0dB refer to? (Logitech USB Speakers)
Heya!
I think I discussed this with both James and Takashi a while back: it would be great if we could initialize the sound card mixers in a better way by default and not everything set to 0. i.e. for output only PCM should be active, at a sensible volume, no bass/treble/3d enabled or whatever. All other sources should be muted. And that for input the mic jack should be active and nothing else, again. Right now people too often have to invest a lot of time to find the right controls to toggle/change in the mixer to get something sensible out of the speakers.
Some distributions have started to ship special scripts that try to initialize the volumes properly. I know for the Fedora case that this tool is very very simple, and just initializes PCM and Master to 70% and that's basically it. It would be highly preferable if we had a sane tool like this from alsa upstream, which would set the default values to 0dB, possibly as an extension to "alsactl".
I started to hack something similar to this as part of PulseAudio: if PA finds that the PCM slider is not really useful for volume control (no attenuation to at least -60dB, too few steps, no seperate controls for all channels, ...) it falls back to software volume control, however tries to initialize the the slider to 0dB first.
Now the thing is, this mostly works fine, however on one of my devices, a pair of external Logitech USB speakers (ID 046d:0a04 Logitech, Inc. V20 portable speakers), the dB scale seems to be totally bogus. According to ALSA volume ranges from -41 dB to +3dB. However, Every setting > -41 dB makes audio awfully loud. Really, really fucking loud that is. Disco loud. As loud that the speakers start jump around centimeters due to the massive vibrations. Setting the volume to 0dB with those speakers really makes you fear you are trashing them.
I somehow expected that the magic "0dB" setting in ALSA would refer to some sane default, where the final output would have a sensible volume. In this case this is not so. I am thus wondering how ALSA actually defines 0dB? Is this a bug in the hardware that should be worked around in ALSA? Is this an ALSA bug?
Lennart
On Fri, Apr 11, 2008 at 10:46:11PM +0200, Lennart Poettering wrote:
Some distributions have started to ship special scripts that try to initialize the volumes properly. I know for the Fedora case that this tool is very very simple, and just initializes PCM and Master to 70% and that's basically it. It would be highly preferable if we had a sane tool like this from alsa upstream, which would set the default values to 0dB, possibly as an extension to "alsactl".
It's not the desktop case but for embedded systems there's a similar need to manage what general applications see of the audio configuration. The plan there was to handle this via something like the scenario API[1]. Obviously, the use case is completely different - usually end users won't be doing installations and the people doing the configuration will have written an ASoC machine driver and have a very good idea how the system is wired up. You will also much more frequently get dynamic changes in the set of active controls based on what the system is doing.
As an example of the sort of use case an embedded system might have consider a smart phone. When used as a media player the controls will be configured for audio playback through, say, the headphone jack but if the user decides to place a call software will need to reroute the audio so that the telephony subsystem is connected to an appropriate microphone and speaker.
I started to hack something similar to this as part of PulseAudio: if PA finds that the PCM slider is not really useful for volume control (no attenuation to at least -60dB, too few steps, no seperate controls for all channels, ...) it falls back to software volume control, however tries to initialize the the slider to 0dB first.
The plan with the scenario API was to export a list of the controls that most software should be looking at in the current scenario. This sounds very similar to what you're talking about here - providing a way for the system management bits of the system to tell normal applications what to work with.
On Fri, Apr 11, 2008 at 10:46:11PM +0200, Lennart Poettering wrote:
Heya!
I think I discussed this with both James and Takashi a while back: it would be great if we could initialize the sound card mixers in a better way by default and not everything set to 0. i.e. for output only PCM should be active, at a sensible volume, no bass/treble/3d enabled or whatever. All other sources should be muted. And that for input the mic jack should be active and nothing else, again. Right now people too often have to invest a lot of time to find the right controls to toggle/change in the mixer to get something sensible out of the speakers.
Some distributions have started to ship special scripts that try to initialize the volumes properly. I know for the Fedora case that this tool is very very simple, and just initializes PCM and Master to 70% and that's basically it. It would be highly preferable if we had a sane tool like this from alsa upstream, which would set the default values to 0dB, possibly as an extension to "alsactl".
This would have to be on a case by case basis. On pro audio cards like RME and some of the ice1712 cards the last thing you want is a mixer starting with anything unmuted. Professional studio monitor speakers tend to be very expensive.
I started to hack something similar to this as part of PulseAudio: if PA finds that the PCM slider is not really useful for volume control (no attenuation to at least -60dB, too few steps, no seperate controls for all channels, ...) it falls back to software volume control, however tries to initialize the the slider to 0dB first.
Now the thing is, this mostly works fine, however on one of my devices, a pair of external Logitech USB speakers (ID 046d:0a04 Logitech, Inc. V20 portable speakers), the dB scale seems to be totally bogus. According to ALSA volume ranges from -41 dB to +3dB. However, Every setting > -41 dB makes audio awfully loud. Really, really fucking loud that is. Disco loud. As loud that the speakers start jump around centimeters due to the massive vibrations. Setting the volume to 0dB with those speakers really makes you fear you are trashing them.
I somehow expected that the magic "0dB" setting in ALSA would refer to some sane default, where the final output would have a sensible volume. In this case this is not so. I am thus wondering how ALSA actually defines 0dB? Is this a bug in the hardware that should be worked around in ALSA? Is this an ALSA bug?
As an audio engineer I'd expect 0dB to mean "no attenuation". On pro ADCs and DACs, 0dB is usually full scale, ie. clipping. Not everyone is an audio engineer of course, so expectations will vary.
John
Lennart Poettering wrote:
Heya!
I think I discussed this with both James and Takashi a while back: it would be great if we could initialize the sound card mixers in a better way by default and not everything set to 0. i.e. for output only PCM should be active, at a sensible volume, no bass/treble/3d enabled or whatever. All other sources should be muted. And that for input the mic jack should be active and nothing else, again. Right now people too often have to invest a lot of time to find the right controls to toggle/change in the mixer to get something sensible out of the speakers.
Some distributions have started to ship special scripts that try to initialize the volumes properly. I know for the Fedora case that this tool is very very simple, and just initializes PCM and Master to 70% and that's basically it. It would be highly preferable if we had a sane tool like this from alsa upstream, which would set the default values to 0dB, possibly as an extension to "alsactl".
I started to hack something similar to this as part of PulseAudio: if PA finds that the PCM slider is not really useful for volume control (no attenuation to at least -60dB, too few steps, no seperate controls for all channels, ...) it falls back to software volume control, however tries to initialize the the slider to 0dB first.
Now the thing is, this mostly works fine, however on one of my devices, a pair of external Logitech USB speakers (ID 046d:0a04 Logitech, Inc. V20 portable speakers), the dB scale seems to be totally bogus. According to ALSA volume ranges from -41 dB to +3dB. However, Every setting > -41 dB makes audio awfully loud. Really, really fucking loud that is. Disco loud. As loud that the speakers start jump around centimeters due to the massive vibrations. Setting the volume to 0dB with those speakers really makes you fear you are trashing them.
I somehow expected that the magic "0dB" setting in ALSA would refer to some sane default, where the final output would have a sensible volume. In this case this is not so. I am thus wondering how ALSA actually defines 0dB? Is this a bug in the hardware that should be worked around in ALSA? Is this an ALSA bug?
Lennart
The 0dB is a gain value. So 0dB means that the input to the mixer element exactly equals the output from the mixer element. So 0dB ensures no distortion will occur. It is fine to set the 0dB for all output mixer controls except one. The problem comes with the "Master" control, where 0dB generally means the maximum possible volume. The correct setting of this is therefore very dependent on the type of amplification that is being done after the sound card master output. Everyone's setup will vary. But, on my system a value between -40dB and -30dB seems about ok. The user will hear sound, but it will not be too loud.
I suppose we will need to canvas people on the best value to use.
Your report about anything over -41dB is way too loud does present a problem. Obviously, the controls for some sound cards are still calibrated wrong. Unfortunately, the calibration of USB sound cards is not left to ALSA, but in fact the sound card manufacturer sets up the calibration tables for us, so for your Logitech speakers, ALSA would have to add a specific quirk.
Finally, does anyone else think -40dB for the Master, and 0dB for all other controls is too loud for the default or not?
James
On Sat, Apr 12, 2008 at 12:15:18PM +0100, James Courtier-Dutton wrote:
Finally, does anyone else think -40dB for the Master, and 0dB for all other controls is too loud for the default or not?
On my system, anything other than minimum gain and muted across the board is too loud. There has to be a clear distinction between pro/semi-pro vs. consumer hardware. If a desktop computer doesn't give sound by default it's inconvenient. If a recording engineer blows up a 20000 euro pair of speakers because he expected things to start muted, it's more than inconvenient.
John
On Sat, 12.04.08 13:01, John Rigg (aldev@sound-man.co.uk) wrote:
On Sat, Apr 12, 2008 at 12:15:18PM +0100, James Courtier-Dutton wrote:
Finally, does anyone else think -40dB for the Master, and 0dB for all other controls is too loud for the default or not?
On my system, anything other than minimum gain and muted across the board is too loud. There has to be a clear distinction between pro/semi-pro vs. consumer hardware. If a desktop computer doesn't give sound by default it's inconvenient. If a recording engineer blows up a 20000 euro pair of speakers because he expected things to start muted, it's more than inconvenient.
Hmm, I guess it's better not to run Fedora on pro hardware, then. ;-)
Lennart
On Sat, 12.04.08 12:15, James Courtier-Dutton (James@superbug.co.uk) wrote:
I somehow expected that the magic "0dB" setting in ALSA would refer to some sane default, where the final output would have a sensible volume. In this case this is not so. I am thus wondering how ALSA actually defines 0dB? Is this a bug in the hardware that should be worked around in ALSA? Is this an ALSA bug?
The 0dB is a gain value. So 0dB means that the input to the mixer element exactly equals the output from the mixer element. So 0dB ensures no distortion will occur. It is fine to set the 0dB for all output mixer controls except one. The problem comes with the "Master" control, where 0dB generally means the maximum possible volume.
In the case of the USB speakers there is no Master, only PCM. And it is that PCM volume that is the offender.
My I thus assume that we can say that for all but the last element in the series 0db means avg input power equals avg output power, and for the last one 0db means max? That would fit on what you are saying but also match my usb speakers, not depending on the existance of a "Master".
The correct setting of this is therefore very dependent on the type of amplification that is being done after the sound card master output. Everyone's setup will vary. But, on my system a value between -40dB and -30dB seems about ok. The user will hear sound, but it will not be too loud. I suppose we will need to canvas people on the best value to use.
With all hw I tested this scheme actually seems to work fine. (-40dB, Intel HDA, those Logitech speakers, Terratech Aureon 5.1.)
Your report about anything over -41dB is way too loud does present a problem. Obviously, the controls for some sound cards are still calibrated wrong. Unfortunately, the calibration of USB sound cards is not left to ALSA, but in fact the sound card manufacturer sets up the calibration tables for us, so for your Logitech speakers, ALSA would have to add a specific quirk.
Actually, it is fine with -40dB, not just -41dB. But then it gets rapidly too loud.
Finally, does anyone else think -40dB for the Master, and 0dB for all other controls is too loud for the default or not?
Works fine with my hardware at least ;-)
My scheme in PA will thus now be:
1) Initialize Master to -40dB 2) If there is no master, initialize PCM to -40dB 3) If there is a master, initialize PCM to 0dB
Does that sound reasonable?
Lennart
Lennart Poettering wrote:
On Sat, 12.04.08 12:15, James Courtier-Dutton (James@superbug.co.uk) wrote:
I somehow expected that the magic "0dB" setting in ALSA would refer to some sane default, where the final output would have a sensible volume. In this case this is not so. I am thus wondering how ALSA actually defines 0dB? Is this a bug in the hardware that should be worked around in ALSA? Is this an ALSA bug?
The 0dB is a gain value. So 0dB means that the input to the mixer element exactly equals the output from the mixer element. So 0dB ensures no distortion will occur. It is fine to set the 0dB for all output mixer controls except one. The problem comes with the "Master" control, where 0dB generally means the maximum possible volume.
In the case of the USB speakers there is no Master, only PCM. And it is that PCM volume that is the offender.
My I thus assume that we can say that for all but the last element in the series 0db means avg input power equals avg output power, and for the last one 0db means max? That would fit on what you are saying but also match my usb speakers, not depending on the existance of a "Master".
The correct setting of this is therefore very dependent on the type of amplification that is being done after the sound card master output. Everyone's setup will vary. But, on my system a value between -40dB and -30dB seems about ok. The user will hear sound, but it will not be too loud. I suppose we will need to canvas people on the best value to use.
With all hw I tested this scheme actually seems to work fine. (-40dB, Intel HDA, those Logitech speakers, Terratech Aureon 5.1.)
Your report about anything over -41dB is way too loud does present a problem. Obviously, the controls for some sound cards are still calibrated wrong. Unfortunately, the calibration of USB sound cards is not left to ALSA, but in fact the sound card manufacturer sets up the calibration tables for us, so for your Logitech speakers, ALSA would have to add a specific quirk.
Actually, it is fine with -40dB, not just -41dB. But then it gets rapidly too loud.
Finally, does anyone else think -40dB for the Master, and 0dB for all other controls is too loud for the default or not?
Works fine with my hardware at least ;-)
My scheme in PA will thus now be:
- Initialize Master to -40dB
- If there is no master, initialize PCM to -40dB
- If there is a master, initialize PCM to 0dB
Does that sound reasonable?
Lennart
That sounds reasonable for now. Professional sound card users will maybe just have to remember to mute the master control before connecting their speakers.
I don't understand why your sound card is OK at -40dB but too loud at -41dB. It does not make any sense. There must be a bug there, because -41dB should be quieter than -40dB.
James
On Saturday 12 April 2008 20:14:44 James Courtier-Dutton wrote:
That sounds reasonable for now. Professional sound card users will maybe just have to remember to mute the master control before connecting their speakers.
This is very, very dangerous - not only can it harm the equipment, it can also harm the user. 0dBFS equals >121dB at a distance 2m away from my head, and I have a *small* setup.
To be honest, I think I would then insert a switch in the RME driver that will enable the outputs only after the RME mixer application has been started.
Flo
Florian Faber wrote:
On Saturday 12 April 2008 20:14:44 James Courtier-Dutton wrote:
That sounds reasonable for now. Professional sound card users will maybe just have to remember to mute the master control before connecting their speakers.
This is very, very dangerous - not only can it harm the equipment, it can also harm the user. 0dBFS equals >121dB at a distance 2m away from my head, and I have a *small* setup.
To be honest, I think I would then insert a switch in the RME driver that will enable the outputs only after the RME mixer application has been started.
Flo
Thats not very helpful really. What value should we set it to then? Another alternative could be to leave everything at 0dB except the master. For the master we could select say minimum dB + 12. So, if the Master ranged from -70 to 0 dB, we would set Master to -70 + 12 = -58dB.
Would that suit everyone better.
James
James Courtier-Dutton wrote:
Florian Faber wrote:
On Saturday 12 April 2008 20:14:44 James Courtier-Dutton wrote:
That sounds reasonable for now. Professional sound card users will maybe just have to remember to mute the master control before connecting their speakers.
This is very, very dangerous - not only can it harm the equipment, it can also harm the user. 0dBFS equals >121dB at a distance 2m away from my head, and I have a *small* setup.
To be honest, I think I would then insert a switch in the RME driver that will enable the outputs only after the RME mixer application has been started.
Flo
Thats not very helpful really. What value should we set it to then? Another alternative could be to leave everything at 0dB except the master. For the master we could select say minimum dB + 12. So, if the Master ranged from -70 to 0 dB, we would set Master to -70 + 12 = -58dB.
Would that suit everyone better.
James
Note this should be set after boot up. All ALSA drivers in the kernel should still default to muted. Once the value has been set, it is remember over a reboot and changed from the kernel mutes in a boot up init.d script.
James
On 12-04-08 21:26, James Courtier-Dutton wrote:
Another alternative could be to leave everything at 0dB except the master. For the master we could select say minimum dB + 12. So, if the Master ranged from -70 to 0 dB, we would set Master to -70 + 12 = -58dB.
Would that suit everyone better.
On the aforementioned cs4236 which has a master -94.5 to +12 dB, 0dB actually is the sane default (and the value I keep it at). It is an idea to also init master to 0 dB iff master isn't just attenuation?
Rene.
On Sat, 12.04.08 21:37, Rene Herman (rene.herman@keyaccess.nl) wrote:
For the master we could select say minimum dB + 12. So, if the Master ranged from -70 to 0 dB, we would set Master to -70 + 12 = -58dB.
Would that suit everyone better.
On the aforementioned cs4236 which has a master -94.5 to +12 dB, 0dB actually is the sane default (and the value I keep it at). It is an idea to also init master to 0 dB iff master isn't just attenuation?
Maybe this should be considered a driver bug?
Shouldn't we require from all ALSA drivers that -30 dB on the master is a "sane default"? Otherwise I am not sure what the dB scale is worth anyway if humans don't have the slightest idea what they actually could mean.
I mean, the biggest problem with integer volume scales was that nobody had the knew what they actually meant. Now it turns out that the dB scale exported in ALSA these days ain't any better either, since still noone knows what 0db actually refers too.
Why not just say that -30db on master should be a "sane default" volume level, and 0db on all others. If a driver doesn't follow this it's a buggy driver.
It shouldn't be too difficult to fix the volume calculation in the drivers accordingly.
Lennart
On 14-04-08 18:48, Lennart Poettering wrote:
On Sat, 12.04.08 21:37, Rene Herman (rene.herman@keyaccess.nl) wrote:
For the master we could select say minimum dB + 12. So, if the Master ranged from -70 to 0 dB, we would set Master to -70 + 12 = -58dB.
Would that suit everyone better.
On the aforementioned cs4236 which has a master -94.5 to +12 dB, 0dB actually is the sane default (and the value I keep it at). It is an idea to also init master to 0 dB iff master isn't just attenuation?
Maybe this should be considered a driver bug?
No. It's a straighforward export of the hardware. If ALSA were to start hiding the hardware I were to start hiding ALSA -- in a dumpster.
And do not set Reply-To. You turn all CCs into To's for one and make others go through the troubl;e of fixing it again. If you can't be bothered with mail to your inbox stop posting to linux lists.
Rene.
On Mon, 14.04.08 19:00, Rene Herman (rene.herman@keyaccess.nl) wrote:
Would that suit everyone better.
On the aforementioned cs4236 which has a master -94.5 to +12 dB, 0dB actually is the sane default (and the value I keep it at). It is an idea to also init master to 0 dB iff master isn't just attenuation?
Maybe this should be considered a driver bug?
No. It's a straighforward export of the hardware. If ALSA were to start hiding the hardware I were to start hiding ALSA -- in a dumpster.
Good joke. ALSA applies quirks an fixes in drivers all the time. Calling that "hiding the hardware" is stupid.
The dB scale is a _relative_ scale. To make any sense there needs to be some reference level defined. Right now, there is not, in ALSA. And hence, the dB scales are pretty to look at, but very useless unless you know your hardware very, very well. Which probably 99,99% of the people do not, because they didn't write the driver they are using, or because they are no super-guru-pro-audio-freaks.
All I am asking for is that ALSA is fixed and and starts to define what the reference level is supposed to be. And then, the drivers need to be fixed to follow this reference level and apply some offsets to what the hw specs say.
Right now the dB levels in ALSA have no value at all because the reference level is random and unknown. If someone claims otherwise then he probably doesn't have any clue what he's talking of but feels like a total guru because he's looking on dB scales.
And do not set Reply-To. You turn all CCs into To's for one and make others go through the troubl;e of fixing it again. If you can't be bothered with mail to your inbox stop posting to linux lists.
Oh, come one. Get a clue. I love you too.
Lennart
On 14-04-08 19:24, Lennart Poettering wrote:
Good joke. ALSA applies quirks an fixes in drivers all the time. Calling that "hiding the hardware" is stupid.
Fixes require a bug. The only bug here is in your brain.
The dB scale is a _relative_ scale. To make any sense there needs to be
No, it is not. 0 dB is the value where no on-card amplification takes place. If that seems to turn out louder from one card to the next even with the same equipment behind that line-out then that's unfortunate and we could fix it per-card defaults. What we definitely cannot do is redefine 0 dB to mean something else as you were suggesting for my cs4236 because you can be damn sure _I_ want to know the value where no onboard amplification or attenuation takes place. I control volume on the external amp hooked up to the card.
Rene.
On Tue, 15.04.08 00:47, Rene Herman (rene.herman@keyaccess.nl) wrote:
The dB scale is a _relative_ scale. To make any sense there needs to be
No, it is not.
Oh, really? It's not a relative scale anymore? Ouch, what a mess. Now I went to university and stuff, and now it turns out that they were totally wrong and dB ain't no relative scale anymore. I want my money back!
Dude, hush, hush, fix Wikipedia! It still says: "The decibel (dB) is a logarithmic unit of measurement that expresses the magnitude of a physical quantity _relative_ _to_ a specified or implied _reference_ _level_".
Lennart
On 15-04-08 01:57, Lennart Poettering wrote:
On Tue, 15.04.08 00:47, Rene Herman (rene.herman@keyaccess.nl) wrote:
The dB scale is a _relative_ scale. To make any sense there needs to be
No, it is not.
Oh, really? It's not a relative scale anymore? Ouch, what a mess. Now
No you dumb arrogant prick. I told you what _0_ dB is and how it is not relative _to the sound pressure levels_ produced by _whatever's behind the line-out_ but to chip amplification. That's the bit you snipped. Go reread it and shut the fuck up.
Rene.
On Tuesday 15 April 2008 01:57:45 Lennart Poettering wrote:
Dude, hush, hush, fix Wikipedia! It still says: "The decibel (dB) is a logarithmic unit of measurement that expresses the magnitude of a physical quantity _relative_ _to_ a specified or implied _reference_ _level_".
The reference level is well defined (depending on the consumer/pro audio context) and so is dBFS, dBu(RMS) and dBV(RMS). I don't see any problem with that except that some people don't seem to know about this or don't care. Especially crappy sound card manufacturers.
Oh boy, and we didn't even start bringing in head room into the debate..
Flo
On 15-04-08 06:09, Florian Faber wrote:
The reference level is well defined (depending on the consumer/pro audio context) and so is dBFS, dBu(RMS) and dBV(RMS). I don't see any problem with that except that some people don't seem to know about this or don't care. Especially crappy sound card manufacturers.
Oh boy, and we didn't even start bringing in head room into the debate..
But if it's something you can explain in a few sentences -- could you?
Rene.
On Sat, Apr 12, 2008 at 08:26:49PM +0100, James Courtier-Dutton wrote:
Florian Faber wrote:
On Saturday 12 April 2008 20:14:44 James Courtier-Dutton wrote:
That sounds reasonable for now. Professional sound card users will maybe just have to remember to mute the master control before connecting their speakers.
This is very, very dangerous - not only can it harm the equipment, it can also harm the user. 0dBFS equals >121dB at a distance 2m away from my head, and I have a *small* setup.
To be honest, I think I would then insert a switch in the RME driver that will enable the outputs only after the RME mixer application has been started.
Flo
Thats not very helpful really. What value should we set it to then?
Minimum gain. On the aforementioned RME mixer, setting all the channels to anything other than that would make it unusable. Pro cards with high channel counts are very different from consumer cards, and their users have totally different requirements. Is it really a problem to accomodate both classes of card/user?
Another alternative could be to leave everything at 0dB except the master.
With 64 channels, that is likely to cause massive clipping even if damage is prevented by keeping the master down. The usual use case here would be to just turn up the required channels. Having to turn all the rest down manually would seriously disrupt work flow. No studio client would be happy about this.
For the master we could select say minimum dB + 12. So, if the Master ranged from -70 to 0 dB, we would set Master to -70 + 12 = -58dB.
Would that suit everyone better.
That would be reasonable for consumer cards. Pro sound cards should never initialise themselves to anything other than minimum gain.
John
John Rigg wrote:
On Sat, Apr 12, 2008 at 08:26:49PM +0100, James Courtier-Dutton wrote:
Florian Faber wrote:
On Saturday 12 April 2008 20:14:44 James Courtier-Dutton wrote:
That sounds reasonable for now. Professional sound card users will maybe just have to remember to mute the master control before connecting their speakers.
This is very, very dangerous - not only can it harm the equipment, it can also harm the user. 0dBFS equals >121dB at a distance 2m away from my head, and I have a *small* setup.
To be honest, I think I would then insert a switch in the RME driver that will enable the outputs only after the RME mixer application has been started.
Flo
Thats not very helpful really. What value should we set it to then?
Minimum gain. On the aforementioned RME mixer, setting all the channels to anything other than that would make it unusable. Pro cards with high channel counts are very different from consumer cards, and their users have totally different requirements. Is it really a problem to accomodate both classes of card/user?
Another alternative could be to leave everything at 0dB except the master.
With 64 channels, that is likely to cause massive clipping even if damage is prevented by keeping the master down. The usual use case here would be to just turn up the required channels. Having to turn all the rest down manually would seriously disrupt work flow. No studio client would be happy about this.
For the master we could select say minimum dB + 12. So, if the Master ranged from -70 to 0 dB, we would set Master to -70 + 12 = -58dB.
Would that suit everyone better.
That would be reasonable for consumer cards. Pro sound cards should never initialise themselves to anything other than minimum gain.
John
I think everyone is misunderstanding the issue here. All ALSA sound cards, without any intervention from user space, will boot up with ALL SOUND MUTED. Most distros then have an /etc/init.d startup script that restores sound card levels to the previous state before the previous power off. The problem is, what to do the first time the system is installed. I.e. No "previous state" exists. a) General users will normally want some level of sound by default the first time they boot into a newly installed system. b) Professional users want everything muted the first time.
My personal preference is ALL SOUND MUTED in ALL cases. I figure that if a user does not have sound, the first thing they will do is go to the volume control and turn it up! I do believe that a general user should only have to touch one "Master" volume control to do this "turn it up" step.
Most consumer distos do not agree with me and want the volume turned up already by default. The problem is deciding on a generally good level for these distros.
James
On 12-04-08 23:55, James Courtier-Dutton wrote:
Most consumer distos do not agree with me and want the volume turned up already by default. The problem is deciding on a generally good level for these distros.
I believe it can be concluded that there is no "generally good level". ALSA should ship /usr/share/alsa/cards/<card>.state files which at least lets a driver author decide on a sensible set of default mixer settings.
Rene.
On 13-04-08 00:09, Rene Herman wrote:
On 12-04-08 23:55, James Courtier-Dutton wrote:
Most consumer distos do not agree with me and want the volume turned up already by default. The problem is deciding on a generally good level for these distros.
I believe it can be concluded that there is no "generally good level". ALSA should ship /usr/share/alsa/cards/<card>.state files which at least lets a driver author decide on a sensible set of default mixer settings.
With a bit of alsa-lib help, distros can then call "amixer defaults" to get a card-specific set of defaults loaded. Would that be good thing?
Was looking, but I see the mixer API documentation is totally absent...
Rene.
On Sun, 13.04.08 00:09, Rene Herman (rene.herman@keyaccess.nl) wrote:
On 12-04-08 23:55, James Courtier-Dutton wrote:
Most consumer distos do not agree with me and want the volume turned up already by default. The problem is deciding on a generally good level for these distros.
I believe it can be concluded that there is no "generally good level". ALSA should ship /usr/share/alsa/cards/<card>.state files which at least lets a driver author decide on a sensible set of default mixer settings.
Yet another file that needs to be maintained.
Why not export this data like all the other data from the kernel? That way other apps (not just alsactl) could make use of this information.
Lennart
On 14-04-08 18:58, Lennart Poettering wrote:
On Sun, 13.04.08 00:09, Rene Herman (rene.herman@keyaccess.nl) wrote:
I believe it can be concluded that there is no "generally good level". ALSA should ship /usr/share/alsa/cards/<card>.state files which at least lets a driver author decide on a sensible set of default mixer settings.
Yet another file that needs to be maintained.
I don't believe this would be a huge problem, but yes, it's a downside.
Why not export this data like all the other data from the kernel? That way other apps (not just alsactl) could make use of this information.
While I'm not particularly up on the issue, I believe controls which may be implemented completely in userspace means you definitely need to go through alsa-lib to get _possibly_ sensible results.
Rene.
On Sat, Apr 12, 2008 at 10:55:35PM +0100, James Courtier-Dutton wrote:
I think everyone is misunderstanding the issue here. All ALSA sound cards, without any intervention from user space, will boot up with ALL SOUND MUTED. Most distros then have an /etc/init.d startup script that restores sound card levels to the previous state before the previous power off. The problem is, what to do the first time the system is installed. I.e. No "previous state" exists. a) General users will normally want some level of sound by default the first time they boot into a newly installed system. b) Professional users want everything muted the first time. My personal preference is ALL SOUND MUTED in ALL cases.
Mine too.
I figure that if a user does not have sound, the first thing they will do is go to the volume control and turn it up! I do believe that a general user should only have to touch one "Master" volume control to do this "turn it up" step.
Most consumer distos do not agree with me and want the volume turned up already by default. The problem is deciding on a generally good level for these distros.
Fair point. Actually there is an easy workaround for those of us who prefer everything muted every time: remove or disable the init.d script.
John
James Courtier-Dutton wrote:
My personal preference is ALL SOUND MUTED in ALL cases. I figure that if a user does not have sound, the first thing they will do is go to the volume control and turn it up!
This doesn't work in one specific case: when a blind user needs accessibility features in the form of synthesized speech.
On Sat, 12.04.08 22:55, James Courtier-Dutton (James@superbug.co.uk) wrote:
That would be reasonable for consumer cards. Pro sound cards should never initialise themselves to anything other than minimum gain.
John
I think everyone is misunderstanding the issue here. All ALSA sound cards, without any intervention from user space, will boot up with ALL SOUND MUTED. Most distros then have an /etc/init.d startup script that restores sound card levels to the previous state before the previous power off. The problem is, what to do the first time the system is installed. I.e. No "previous state" exists. a) General users will normally want some level of sound by default the first time they boot into a newly installed system. b) Professional users want everything muted the first time.
My personal preference is ALL SOUND MUTED in ALL cases. I figure that if a user does not have sound, the first thing they will do is go to the volume control and turn it up!
Thing is, that non-technical people usually have a very hard time to grok a mixer crowded with all kinds of controls where most of them actually don't have any impact on sound at all.
In PA I try to minimize the number of sliders: just one per output device. PA is clearly not for pro-audio people, so this is the absolute right thing to do. But for this I need to be able to rely on that all the mixer controls of the soundcard are initialized in a "sane" way, so that the single mixer control I have actually makes sense.
Most consumer distos do not agree with me and want the volume turned up already by default.
Yes. in an ideal world people wouldn't have to think about the volume control in there computers at all, since their speakers either come with a hw vol control anyway, are a hifi stereo with hw vol controls or are inside a laptop with hw volume controls.
Lennart
On Sat, 12.04.08 20:26, James Courtier-Dutton (James@superbug.co.uk) wrote:
Thats not very helpful really. What value should we set it to then? Another alternative could be to leave everything at 0dB except the master. For the master we could select say minimum dB + 12. So, if the Master ranged from -70 to 0 dB, we would set Master to -70 + 12 = -58dB.
Would that suit everyone better.
I am not so sure about this scheme. There are a couple of devices around where the minimal volume is still pretty high (like these Logitech USB speakers of mine). With them the default volume would then be very, very loud.
Lennart
Florian Faber:
To be honest, I think I would then insert a switch in the RME driver that will enable the outputs only after the RME mixer application has been started.
That is already the case, at least with the HDSP 9652 and the Multiface. No audio from RME gear until you run hdspmixer.
On Sat, Apr 12, 2008 at 07:14:44PM +0100, James Courtier-Dutton wrote:
That sounds reasonable for now. Professional sound card users will maybe just have to remember to mute the master control before connecting their speakers.
A better solution IMO would be to make the default behaviour of the pro/semi-pro sound cards default to minimum gain with everything muted, and do what you're suggesting with other cards.
If non-pro users want to use pro cards (which are fairly specialised after all), they can unmute things. The idea of, say, starting up the hdsp mixer for an RME HDSP MADI card and having all 64 channels come up at 0dB is pretty frightening. Anything which can start in such a potentially dangerous state is unusable in a professional context.
John
John Rigg wrote:
On Sat, Apr 12, 2008 at 07:14:44PM +0100, James Courtier-Dutton wrote:
That sounds reasonable for now. Professional sound card users will maybe just have to remember to mute the master control before connecting their speakers.
A better solution IMO would be to make the default behaviour of the pro/semi-pro sound cards default to minimum gain with everything muted, and do what you're suggesting with other cards.
If non-pro users want to use pro cards (which are fairly specialised after all), they can unmute things. The idea of, say, starting up the hdsp mixer for an RME HDSP MADI card and having all 64 channels come up at 0dB is pretty frightening. Anything which can start in such a potentially dangerous state is unusable in a professional context.
John
I haven't got any skin in this game as either way is fine for me. But to contribute I thought I would ask a couple of questions.
Is there a way to identify whether a card is pro or casual? Number of channels? DACs? Chipsets?
How is this handled on other OSs? Windows, Mac, Sun?
On Sat, Apr 12, 2008 at 02:54:19PM -0700, stan wrote:
Is there a way to identify whether a card is pro or casual? Number of channels? DACs? Chipsets?
Good question. RME cards would usually fall in the "pro" category. With others, eg. some of the ice1712 cards, the same chip is used in cards with 2 to 8 analogue in/outs, so it's harder to categorise them. On reflection, it's probably easier for those of us who need everything muted every time to just disable or remove the init.d script. That's what I've done on my system.
John
On Sat, Apr 12, 2008 at 7:00 PM, John Rigg aldev@sound-man.co.uk wrote:
On Sat, Apr 12, 2008 at 02:54:19PM -0700, stan wrote:
Is there a way to identify whether a card is pro or casual? Number of channels? DACs? Chipsets?
Good question. RME cards would usually fall in the "pro" category. With others, eg. some of the ice1712 cards, the same chip is used in cards with 2 to 8 analogue in/outs, so it's harder to categorise them. On reflection, it's probably easier for those of us who need everything muted every time to just disable or remove the init.d script. That's what I've done on my system.
Same with the emu10k1 driver, it supports the consumer SBLive/Audigy series as well as the pro/semi-pro EMU stuff.
Lee
Lee Revell wrote:
On Sat, Apr 12, 2008 at 7:00 PM, John Rigg aldev@sound-man.co.uk wrote:
On Sat, Apr 12, 2008 at 02:54:19PM -0700, stan wrote:
Is there a way to identify whether a card is pro or casual? Number of channels? DACs? Chipsets?
Good question. RME cards would usually fall in the "pro" category. With others, eg. some of the ice1712 cards, the same chip is used in cards with 2 to 8 analogue in/outs, so it's harder to categorise them. On reflection, it's probably easier for those of us who need everything muted every time to just disable or remove the init.d script. That's what I've done on my system.
Same with the emu10k1 driver, it supports the consumer SBLive/Audigy series as well as the pro/semi-pro EMU stuff.
Lee
Are the output levels from the line out/speaker out connectors really any different between pro and cheap sound card? For unbalanced outputs, the full scale should be the same for both types of sound card. I think the main difference is the power amp that is normally outside the computer. So, I would say that the loudness of the sound actually output to the speakers is not related to which sound card is being used. So, how can we set what the default volume will be when we have no idea which amp the user is using? It seems to me that whatever way you look at this, A default value of "MUTE" is really the only safe level for all sound card types.
James
On Sunday 13 April 2008 12:51:54 James Courtier-Dutton wrote:
Are the output levels from the line out/speaker out connectors really any different between pro and cheap sound card?
The electric levels do differ. But that's not the point. The point is that you usually have active speakers and 0dB means full throttle. You don't have anything to alter the volume between the sound card and the speakers.
To give you an impression: My main out is -40..-36dB for work. If I want to talk to another person in the same room, I have to dim to -46dB max. If I throw a party, it might go up to -20..-15dB. 0dB will just pop out the ear drums.
It seems to me that whatever way you look at this, A default value of "MUTE" is really the only safe level for all sound card types.
Yes.
Flo
Florian Faber wrote:
On Sunday 13 April 2008 12:51:54 James Courtier-Dutton wrote:
Are the output levels from the line out/speaker out connectors really any different between pro and cheap sound card?
The electric levels do differ. But that's not the point. The point is that you usually have active speakers and 0dB means full throttle. You don't have anything to alter the volume between the sound card and the speakers.
To give you an impression: My main out is -40..-36dB for work. If I want to talk to another person in the same room, I have to dim to -46dB max. If I throw a party, it might go up to -20..-15dB. 0dB will just pop out the ear drums.
All active speakers act as a combined amp and speaker. If you have a 50W active speaker, your -36dB for work might be right. But, if you have a 300W active speaker, your -36dB will probably be way too loud. This is essentially my point that the sound card cannot really decide which is a sensible level to output.
James
Rene Herman wrote:
On 13-04-08 12:51, James Courtier-Dutton wrote:
It seems to me that whatever way you look at this, A default value of "MUTE" is really the only safe level for all sound card types.
Always good to be ignored. How about that card specific "defaults" setup that I suggested?
Rene
I think this would theoretically work, but it requires creating and maintaining a database of all sound cards. And if a card is not in the database, there still has to be a default behavior. ;-)
Perhaps an entry could be added to the .asoundrc or asound.state file that sets this. Although the main time this is of import is the first time a sound card is used, so there would have to be a default entry :-). After that it retains its previous state and is not as important.
It looks like mute is a reasonable compromise, except for blind users.
On 13-04-08 17:17, stan wrote:
Rene Herman wrote:
On 13-04-08 12:51, James Courtier-Dutton wrote:
It seems to me that whatever way you look at this, A default value of "MUTE" is really the only safe level for all sound card types.
Always good to be ignored. How about that card specific "defaults" setup that I suggested?
I think this would theoretically work, but it requires creating and maintaining a database of all sound cards. And if a card is not in the database, there still has to be a default behavior. ;-)
That default would just be "do nothing" -- ie, keep things muted as now.
Perhaps an entry could be added to the .asoundrc or asound.state file that sets this. Although the main time this is of import is the first time a sound card is used, so there would have to be a default entry :-). After that it retains its previous state and is not as important.
It looks like mute is a reasonable compromise, except for blind users.
For all I and most other sensible (and non-blind) people care, it is, but as James said, distributions disagree. Generally, it's possible to provide a set of reasonable "non-mute default" on a per card basis but ALSA is the only one that can do so. I don't believe that creating a default control settings file upon submission of a new driver would be unreasonable. We already have /usr/share/alsa/cards/<card>.conf as well. Keeping it in sync over changes to the driver might be a slight problem.
But, like you yourself conclude, in the end just changing nothing is the other option and that's something distribution disagree with. Not I...
Rene.
On Sat, 12.04.08 19:14, James Courtier-Dutton (James@superbug.co.uk) wrote:
That sounds reasonable for now. Professional sound card users will maybe just have to remember to mute the master control before connecting their speakers.
I don't understand why your sound card is OK at -40dB but too loud at -41dB. It does not make any sense. There must be a bug there, because -41dB should be quieter than -40dB.
Sorry, this is not what I wanted to say. All I wanted to say is that -40dB and 41db are both fine. But higher values become rapidly very, very loud.
Lennart
On 12-04-08 15:35, Lennart Poettering wrote:
On Sat, 12.04.08 12:15, James Courtier-Dutton (James@superbug.co.uk) wrote:
My I thus assume that we can say that for all but the last element in the series 0db means avg input power equals avg output power, and for the last one 0db means max? That would fit on what you are saying but also match my usb speakers, not depending on the existance of a "Master".
If we add in ISA cards, it's not a very generic assumption at least. For example on my cs4236, "master" is -94,5 to +12 dB with 0dB at "87" in the integer scale.
It's a "Master Digital Gain" -- not sure what that "digital" implies as it very much seems to be positioend in the post output mixer analog path...
Rene.
On 12-04-08 21:32, Rene Herman wrote:
On 12-04-08 15:35, Lennart Poettering wrote:
On Sat, 12.04.08 12:15, James Courtier-Dutton (James@superbug.co.uk) wrote:
My I thus assume that we can say that for all but the last element in the series 0db means avg input power equals avg output power, and for the last one 0db means max? That would fit on what you are saying but also match my usb speakers, not depending on the existance of a "Master".
If we add in ISA cards, it's not a very generic assumption at least. For example on my cs4236, "master" is -94,5 to +12 dB with 0dB at "87" in the integer scale.
It's a "Master Digital Gain" -- not sure what that "digital" implies as it very much seems to be positioend in the post output mixer analog path...
Mmm, no, this control seems to be divided into two parts in hardware, with -60 dB to 0 digital attenuation pre DAC and -34.5 to +12 dB analog post DAC. Odd, but anyways... 0 is still the "correct" default.
Rene.
On Sat, Apr 12, 2008 at 11:16:11PM +0200, Rene Herman wrote:
Mmm, no, this control seems to be divided into two parts in hardware, with -60 dB to 0 digital attenuation pre DAC and -34.5 to +12 dB analog post DAC. Odd, but anyways... 0 is still the "correct" default.
That's pretty much standard for codec chips, especially those with multiple output paths or multiple data sources that can be fed into a given output.
On Sat, 12.04.08 21:32, Rene Herman (rene.herman@keyaccess.nl) wrote:
On 12-04-08 15:35, Lennart Poettering wrote:
On Sat, 12.04.08 12:15, James Courtier-Dutton (James@superbug.co.uk) wrote:
My I thus assume that we can say that for all but the last element in the series 0db means avg input power equals avg output power, and for the last one 0db means max? That would fit on what you are saying but also match my usb speakers, not depending on the existance of a "Master".
If we add in ISA cards, it's not a very generic assumption at least. For example on my cs4236, "master" is -94,5 to +12 dB with 0dB at "87" in the integer scale.
It's a "Master Digital Gain" -- not sure what that "digital" implies as it very much seems to be positioend in the post output mixer analog path...
Maybe the driver should add an internal offset to the dB scale, to guarantee that 0dB is max, instead of just copying the hw specs?
Lennart
On 14-04-08 19:00, Lennart Poettering wrote:
On Sat, 12.04.08 21:32, Rene Herman (rene.herman@keyaccess.nl) wrote:
If we add in ISA cards, it's not a very generic assumption at least. For example on my cs4236, "master" is -94,5 to +12 dB with 0dB at "87" in the integer scale.
It's a "Master Digital Gain" -- not sure what that "digital" implies as it very much seems to be positioend in the post output mixer analog path...
Maybe the driver should add an internal offset to the dB scale, to guarantee that 0dB is max, instead of just copying the hw specs?
No, really quite definitely not. 0 dB means no attenuation of amplification. How loud that actually ends up is very much dependent on what's _behind_ your line-out.
In this specific example, the cs4236 master is split in a digital part -60 dB to 0 and an anlog -34,5 to +12. I most certainly want "0 dB" to mean no analog amplification (nor (digital) attenuation, but the analog is what I want to know) is being done.
And "Reply-To" from my previous message should be "Mail-Followup-To". Please kill that.
Rene.
On Mon, 14.04.08 19:22, Rene Herman (rene.herman@keyaccess.nl) wrote:
On 14-04-08 19:00, Lennart Poettering wrote:
On Sat, 12.04.08 21:32, Rene Herman (rene.herman@keyaccess.nl) wrote:
If we add in ISA cards, it's not a very generic assumption at least. For example on my cs4236, "master" is -94,5 to +12 dB with 0dB at "87" in the integer scale.
It's a "Master Digital Gain" -- not sure what that "digital" implies as it very much seems to be positioend in the post output mixer analog path...
Maybe the driver should add an internal offset to the dB scale, to guarantee that 0dB is max, instead of just copying the hw specs?
No, really quite definitely not. 0 dB means no attenuation of amplification. How loud that actually ends up is very much dependent on what's _behind_ your line-out.
Yes, but what I am asking for is to define the dB values of the master control relative to the some ref level on this line-out. What happens after the line-out doesn't matter at all.
Lennart
Lennart Poettering wrote:
Yes, but what I am asking for is to define the dB values of the master control relative to the some ref level on this line-out. What happens after the line-out doesn't matter at all.
Lennart
The aim of the dB values in the ALSA mixer is this.
For Playback: Set all the mixer controls to 0dB. Send a sample digital signal from the CPU to the sound card. The measured analog signal on the line-out should be the same for ALL sound cards.
For Capture: Set all the mixer controls to 0dB. Send a sample analog signal to the line-in of the sound card. The captured digital signal at the CPU should be the same for ALL sound cards.
The reason for using 0dB is that it should mean no gain and no attenuation to the signal and so minimize distortions.
Now, we have tried to get this right by looking at datasheets of sound cards, but it might not be right for all sound cards yet. It is at least a task we may be able to actually achieve. When the datasheets are wrong, the only available method to get it right is actually to measure the analog signals. Can anyone provide a simple reliable test for this? E.g. Using this sample .wav file and a cheapo digital volt meter, this is the output you should get. I am not even sure that a simple digital volt meter can do the task as a volt meter is only expecting 50-60Hz, and not all sound cards work at all well at that frequency.
The problem comes with the speakers, that will have varying level of amplification/attenuation before them. This is outside of the control of ALSA as they are not part of the sound card. This is essentially why setting the default MASTER control to anything other than MUTED is really the best we can do.
The one exception to this is laptops, where, on an individual basis, we could potentially have a constant value indicating the affect that the internal speaker amp has on the sound card output to the internal speakers. For these, we could probably use ALSA to recommend to userland what a sensible default value for the master mixer control should be.
If anyone thinks that there is anything more than this that can be done by ALSA, I will be amazed.
James
On Mon, Apr 14, 2008 at 5:07 PM, James Courtier-Dutton James@superbug.co.uk wrote:
Lennart Poettering wrote:
Yes, but what I am asking for is to define the dB values of the master control relative to the some ref level on this line-out. What happens after the line-out doesn't matter at all.
Lennart: while I definitely agree on what you try to achieve, I strongly disagree the way it's being solved.
Initial volume setup is an *installation* issue, not a *boot or daemon startup* issue. When you buy a notebook with linux pre-installed, it's the manufacturer who must make sure the notebook has the appropiate volume levels, factory default. When you install Fedora, it's the fedora install program who must make sure the appropiate volume levels. Both ways, when the user starts its new shiny linux, it just works.
Once the system is installed it has to remember its previous settings, which I think has been done on most distros (mine in /etc/init.d/alsa-utils).
That's all, end of story! If you put code that tries to guess what the appropiate volume should be for any case, it will become an infinite problem of what is right and what is wrong, not counting the annoying user experience this will bring. You can't guess what is right for every people, so a sane mute (in case of no other source of information) is clearly the only good choice.
So please, please: don't try to guess this in your daemon, it will make more harm than actually helping users. The manufacturer or installer *are the right places* to solve the issue. They both know the hardware or can ask the user to check if it's right for them.
Now, we have tried to get this right by looking at datasheets of sound cards, but it might not be right for all sound cards yet. It is at least a task we may be able to actually achieve. When the datasheets are wrong, the only available method to get it right is actually to measure the analog signals. Can anyone provide a simple reliable test for this? E.g. Using this sample .wav file and a cheapo digital volt meter, this is the output you should get. I am not even sure that a simple digital volt meter can do the task as a volt meter is only expecting 50-60Hz, and not all sound cards work at all well at that frequency.
Well, this kind of problem must be solved too. I think contacting the hardware manufacturers or asking users. But NOT guessing...
On Mon, 14.04.08 18:08, Aldrin Martoq (amartoq@dcc.uchile.cl) wrote:
Yes, but what I am asking for is to define the dB values of the master control relative to the some ref level on this line-out. What happens after the line-out doesn't matter at all.
Lennart: while I definitely agree on what you try to achieve, I strongly disagree the way it's being solved.
Uh? Nothing is solved. We have this discussion on this ML because it needs to be solved.
Initial volume setup is an *installation* issue, not a *boot or daemon startup* issue. When you buy a notebook with linux pre-installed, it's the manufacturer who must make sure the notebook has the appropiate volume levels, factory default. When you install Fedora, it's the fedora install program who must make sure the appropiate volume levels. Both ways, when the user starts its new shiny linux, it just works.
It's not installation issue. It's a "seeing for the first time" issue. For hotplug devices this might be much later than on installation.
In one of the first emails of this thread I already explained that I'd like to see a new command for alsactl called "reset" or suchlike which implements the logic to initialize the dB scales properly. We'd then call this program from the udev rules if "alsactl restore" fails because the device was unknown before and has no configuration file yet.
Right now we have this really awful program in Fedora called "salsa" and "alsaunmute" which implements this logic, but is really really bad in doing so, because it just initializes everything to 70% for unknown devices. Also, while it is able to restore the volume settings, it is not capable to save them on hot-unplug. Which makes the whole thing pretty pointless.
But anyway, isn't this exactly what you are looking for? I am not sure what you are asking for more than this?
However, having "alsctl reset" is nice. But it is still not sufficient for the actual problems I need to solve in PA. See below.
That's all, end of story! If you put code that tries to guess what the appropiate volume should be for any case, it will become an infinite problem of what is right and what is wrong, not counting the annoying user experience this will bring. You can't guess what is right for every people, so a sane mute (in case of no other source of information) is clearly the only good choice.
The problem is a bit more complex. Think of multiple sessions and stuff. If ConsoleKit informs PA about a session switch we need to be able to provide every user hs own set of mixer settings.
Dude, it's pretty easy to define a common refernce of the dB values. In fact, James (who afaik did the dB scale work initially) already agreed to this and even suggested measuring the voltage on the output jack.
Lennart
On Mon, Apr 14, 2008 at 7:43 PM, Lennart Poettering mznyfn@0pointer.de wrote:
Dude, it's pretty easy to define a common refernce of the dB values. In fact, James (who afaik did the dB scale work initially) already agreed to this and even suggested measuring the voltage on the output jack.
With onboard HDA intel devices we'd have to do this on every single piece of hardware we support - every make and model of laptop and mobo from every vendor. Does Red Hat have the resources to make that happen?
Lee
On Mon, Apr 14, 2008 at 7:43 PM, Lennart Poettering mznyfn@0pointer.de wrote:
On Mon, 14.04.08 18:08, Aldrin Martoq (amartoq@dcc.uchile.cl) wrote:
Lennart: while I definitely agree on what you try to achieve, I strongly disagree the way it's being solved.
Uh? Nothing is solved. We have this discussion on this ML because it needs to be solved.
Yup, I know it's *being* solved.
Initial volume setup is an *installation* issue, not a *boot or daemon startup* issue. When you buy a notebook with linux pre-installed, it's the manufacturer who must make sure the notebook has the appropiate volume levels, factory default. When you install Fedora, it's the fedora install program who must make sure the appropiate volume levels. Both ways, when the user starts its new shiny linux, it just works.
It's not installation issue. It's a "seeing for the first time" issue. For hotplug devices this might be much later than on installation.
Hotplug devices should start muted (read below).
In one of the first emails of this thread I already explained that I'd like to see a new command for alsactl called "reset" or suchlike which implements the logic to initialize the dB scales properly. We'd then call this program from the udev rules if "alsactl restore" fails because the device was unknown before and has no configuration file yet. Right now we have this really awful program in Fedora called "salsa" and "alsaunmute" which implements this logic, but is really really bad in doing so, because it just initializes everything to 70% for unknown devices. Also, while it is able to restore the volume settings, it is not capable to save them on hot-unplug. Which makes the whole thing pretty pointless. But anyway, isn't this exactly what you are looking for? I am not sure what you are asking for more than this?
No, I am not asking for a solution. Mi distro (ubuntu 7.10) remembers the state of my (hotplug pc-card) soundblaster audigy2 notebook, so actually this is not a problem for me.You may check how the "alsa-utils" package handles hotplug through udev.
What I am suggesting is that the way to handle initial volume is wrong, it must not be done in PA or other daemon: 1. Initial volume must be configured at install time. Maybe the manufacturer or the install procedure of your distro. 2. After that, the computer must remember the last change. 3. If I plug a new card, it must start muted unless i want to change that. 4. If I plug the card again, it should remember my last settings.
This is (mostly) how it works here, and it works fine.
_From your first email, you state that "I started to hack something similar to this as part of PulseAudio: if PA finds that the PCM slider is not really useful for volume control (no attenuation to at least -60dB, too few steps, no seperate controls for all channels, ...) it falls back to software volume control, however tries to initialize the the slider to 0dB first."
So, I think this is plainly wrong. You could improve this by other means (maybe the user interface could be clever), but setting an unwanted level out of the blue it's going to be a serious problem to many many users. Please don't touch the levels if I don't want that.
However, having "alsctl reset" is nice. But it is still not sufficient for the actual problems I need to solve in PA. See below.
That's all, end of story! If you put code that tries to guess what the appropiate volume should be for any case, it will become an infinite problem of what is right and what is wrong, not counting the annoying user experience this will bring. You can't guess what is right for every people, so a sane mute (in case of no other source of information) is clearly the only good choice.
The problem is a bit more complex. Think of multiple sessions and stuff. If ConsoleKit informs PA about a session switch we need to be able to provide every user hs own set of mixer settings. Dude, it's pretty easy to define a common refernce of the dB values. In fact, James (who afaik did the dB scale work initially) already agreed to this and even suggested measuring the voltage on the output jack.
And it's pretty easy to screw it up. -40db (even in the same scale) WILL be different for every people: I usually plug my soundblaster to a power amp of 300W. So, if I swith to another user, you are going to change the volume up to -40db because YOU think that's what I want????
It's OK to calibrate all cards to behave the same, I agree with that. It's NOT OK that your software treats you as a dumb and do things you didn't ask....
On Monday 14 April 2008 23:07:22 James Courtier-Dutton wrote:
The aim of the dB values in the ALSA mixer is this.
For Playback: Set all the mixer controls to 0dB. Send a sample digital signal from the CPU to the sound card. The measured analog signal on the line-out should be the same for ALL sound cards.
Consumer levels are -10dBV while pro audio levels are +4dBu. And you have to be more specific what to measure.
How about this: You do what you want with the consumer boards, and leave the pro guys alone. Pro drivers are not 'broken' if they don't implement such a 'feature', they are pro drivers.
Flo
On Tue, Apr 15, 2008 at 05:52:13AM +0200, Florian Faber wrote:
On Monday 14 April 2008 23:07:22 James Courtier-Dutton wrote:
The aim of the dB values in the ALSA mixer is this.
For Playback: Set all the mixer controls to 0dB. Send a sample digital signal from the CPU to the sound card. The measured analog signal on the line-out should be the same for ALL sound cards.
Consumer levels are -10dBV while pro audio levels are +4dBu. And you have to be more specific what to measure.
Exactly.
How about this: You do what you want with the consumer boards, and leave the pro guys alone. Pro drivers are not 'broken' if they don't implement such a 'feature', they are pro drivers.
vote++
John
On Monday 14 April 2008 23:07:22 James Courtier-Dutton wrote:
The aim of the dB values in the ALSA mixer is this.
For Playback: Set all the mixer controls to 0dB. Send a sample digital signal from the CPU to the sound card. The measured analog signal on the line-out should be the same for ALL sound cards.
The dB setting in a mixer refers to gain, not level. Expecting the same absolute level from pro and consumer sound cards at the same gain setting is a little ridiculous. If I set a control at 0dB I want just that: 0dB gain.
John
On 15-04-08 15:12, John Rigg wrote:
The dB setting in a mixer refers to gain, not level. Expecting the same absolute level from pro and consumer sound cards at the same gain setting is a little ridiculous. If I set a control at 0dB I want just that: 0dB gain.
Quite right.
There is still the issue that we probably don't so much want a distribution to have to decide if it's speaking to a pro or consumer card and that there are differences between (cheap consumer only I gather?) cards as well, which might be classified hardware bugs but which exist nonetheless.
Attempt to summarize:
1. ALSA mutes everything by default which as discussed is the only possibly sane thing to do especially in a pro environment (although I myself think that headphone using consumers and expensive gear using pros have a very similar need here: to avoid heart attacks).
2. Distributions have been set up to save and restore the levels over driver uses but since they obviously can't expect those poor, poor consumer users to be able to find a volume slider upon not hearing sound come out they want to unmute/init first time even -- which seems a somewhat flimsy motivation for having this discussion, but oh well.
3. Other than muted, 0 dB is the other potentially sane default value with it being defined as the no gain point. At least one (USB) driver has been identified as not producing 0 dB gain at the 0 dB ALSA slider setting; it gets the scale information from the hardware and the hardware is evidently buggy. Fixing this in the driver through model specific quirks would be the most sensible here as then the "0 dB" actually could start to mean what it should mean again.
4. Personally, I'd actually like to have a complete set of "unmuted default" controls on a per card basis. ALSA could distribute state files for those cards that like to be inited to anything other than all mute/minimal. Bit of a maintenance chore, and the usefulness depends on how much level variation there actually is generally. Are we in essence only talking about Lennart's buggy USB crap or is this more involved?
Rene.
On 15-04-08 16:33, Rene Herman wrote:
mute/minimal. Bit of a maintenance chore, and the usefulness depends on how much level variation there actually is generally. Are we in essence only talking about Lennart's buggy USB crap or is this more involved?
On that note, I just acquired an Audigy 2 (SB0240) that I'm testing with and now that I'm paying attention to it due to this thread -- its 0 dB setting is very significantly louder (with everything behind the line-out constant ofcourse) than the 0 dB setting on my TerraTec DMX.
James, I believe you are the emu10k1 person? Data:
TerraTec DMX = ESS Canyon3D (ES1970MS-3D) + Sigmatel STAC9704T
Creative Audigy 2 (SB0240) = Creative CA0102-ICT + Sigmatel STAC9721T (+ Crystal CS4382-KQ which seems to provide digital attenuation as well)
At 0 dB master the Audigy 2 is much louder than the DMX is and audibly distorts. Judging by hearing, keeping the master at -16 dB (60 in the integer scale) gets things about the same. Was that scale provided by datasheet or just guessed? Especially the distortion would seem to indicate that something is actually doing analogue amplification at the 0 dB ALSA setting...
Rene.
On 16-04-08 16:29, Rene Herman wrote:
On 15-04-08 16:33, Rene Herman wrote:
mute/minimal. Bit of a maintenance chore, and the usefulness depends on how much level variation there actually is generally. Are we in essence only talking about Lennart's buggy USB crap or is this more involved?
On that note, I just acquired an Audigy 2 (SB0240) that I'm testing with and now that I'm paying attention to it due to this thread -- its 0 dB setting is very significantly louder (with everything behind the line-out constant ofcourse) than the 0 dB setting on my TerraTec DMX.
James, I believe you are the emu10k1 person? Data:
TerraTec DMX = ESS Canyon3D (ES1970MS-3D) + Sigmatel STAC9704T
Creative Audigy 2 (SB0240) = Creative CA0102-ICT + Sigmatel STAC9721T (+ Crystal CS4382-KQ which seems to provide digital attenuation as well)
At 0 dB master the Audigy 2 is much louder than the DMX is and audibly distorts. Judging by hearing, keeping the master at -16 dB (60 in the integer scale) gets things about the same. Was that scale provided by datasheet or just guessed? Especially the distortion would seem to indicate that something is actually doing analogue amplification at the 0 dB ALSA setting...
Expanding, with the 'Line' control at 0 dB (74 integer) and 'Analog Mix' at 0 dB (100 integer) everything does sound right with both 'Master Capture' and 'Master' at full, and too faint with 'Master' at -16 dB. I guess this indicates that it's something at the DSP side only? (sort of loosing my way in this bewildering array of controls so if I need to be guided to possibly say sensible things -- please do)
Rene.
On 16-04-08 17:19, Rene Herman wrote:
For now last time that I reply to myself (promise):
On 16-04-08 16:29, Rene Herman wrote:
On 15-04-08 16:33, Rene Herman wrote:
On that note, I just acquired an Audigy 2 (SB0240) that I'm testing with and now that I'm paying attention to it due to this thread -- its 0 dB setting is very significantly louder (with everything behind the line-out constant ofcourse) than the 0 dB setting on my TerraTec DMX.
James, I believe you are the emu10k1 person? Data:
TerraTec DMX = ESS Canyon3D (ES1970MS-3D) + Sigmatel STAC9704T
Creative Audigy 2 (SB0240) = Creative CA0102-ICT + Sigmatel STAC9721T (+ Crystal CS4382-KQ which seems to provide digital attenuation as well)
At 0 dB master the Audigy 2 is much louder than the DMX is and audibly distorts. Judging by hearing, keeping the master at -16 dB (60 in the integer scale) gets things about the same. Was that scale provided by datasheet or just guessed? Especially the distortion would seem to indicate that something is actually doing analogue amplification at the 0 dB ALSA setting...
Expanding, with the 'Line' control at 0 dB (74 integer) and 'Analog Mix' at 0 dB (100 integer) everything does sound right with both 'Master Capture' and 'Master' at full, and too faint with 'Master' at -16 dB. I guess this indicates that it's something at the DSP side only? (sort of loosing my way in this bewildering array of controls so if I need to be guided to possibly say sensible things -- please do)
When I do actually capture, -16 dB master is again the correct setting when playing back (with everything else still set to 0 dB as described above). It's then equally load as when directly monitored during recording. I expect then the Master dB scale needs to be adjusted down? If yes, I'll try to make very, very sure that -16 dB now is the correct new 0 dB.
Rene.
Rene Herman wrote:
On 16-04-08 17:19, Rene Herman wrote:
For now last time that I reply to myself (promise):
On 16-04-08 16:29, Rene Herman wrote:
On 15-04-08 16:33, Rene Herman wrote:
On that note, I just acquired an Audigy 2 (SB0240) that I'm testing with and now that I'm paying attention to it due to this thread -- its 0 dB setting is very significantly louder (with everything behind the line-out constant ofcourse) than the 0 dB setting on my TerraTec DMX.
James, I believe you are the emu10k1 person? Data:
TerraTec DMX = ESS Canyon3D (ES1970MS-3D) + Sigmatel STAC9704T
Creative Audigy 2 (SB0240) = Creative CA0102-ICT + Sigmatel STAC9721T (+ Crystal CS4382-KQ which seems to provide digital attenuation as well)
At 0 dB master the Audigy 2 is much louder than the DMX is and audibly distorts. Judging by hearing, keeping the master at -16 dB (60 in the integer scale) gets things about the same. Was that scale provided by datasheet or just guessed? Especially the distortion would seem to indicate that something is actually doing analogue amplification at the 0 dB ALSA setting...
Expanding, with the 'Line' control at 0 dB (74 integer) and 'Analog Mix' at 0 dB (100 integer) everything does sound right with both 'Master Capture' and 'Master' at full, and too faint with 'Master' at -16 dB. I guess this indicates that it's something at the DSP side only? (sort of loosing my way in this bewildering array of controls so if I need to be guided to possibly say sensible things -- please do)
When I do actually capture, -16 dB master is again the correct setting when playing back (with everything else still set to 0 dB as described above). It's then equally load as when directly monitored during recording. I expect then the Master dB scale needs to be adjusted down? If yes, I'll try to make very, very sure that -16 dB now is the correct new 0 dB.
Rene.
Can we narrow this down a bit please. Run speaker-test -c2 -twav Do the test to each sound card with alsamixer set to 0dB for most controls accept the master, and leave the master at a sensible setting for your setup so that you can hear sound at a sensible level With the same dB values on the Andigy 2 and DMX, do you get the same loudness of sound output to the speakers?
I would like to find out if the problem is in the playback path, or the capture path.
James
On 17-04-08 22:39, James Courtier-Dutton wrote:
[ John: I never drop CCs unrequested as I really dislike it when people do that in a conversation I myself am reading but please say so if you don't care to be in this thread ]
Rene Herman wrote:
On 16-04-08 17:19, Rene Herman wrote:
For now last time that I reply to myself (promise):
On 16-04-08 16:29, Rene Herman wrote:
On 15-04-08 16:33, Rene Herman wrote:
On that note, I just acquired an Audigy 2 (SB0240) that I'm testing with and now that I'm paying attention to it due to this thread -- its 0 dB setting is very significantly louder (with everything behind the line-out constant ofcourse) than the 0 dB setting on my TerraTec DMX.
James, I believe you are the emu10k1 person? Data:
TerraTec DMX = ESS Canyon3D (ES1970MS-3D) + Sigmatel STAC9704T
Creative Audigy 2 (SB0240) = Creative CA0102-ICT + Sigmatel STAC9721T (+ Crystal CS4382-KQ which seems to provide digital attenuation as well)
At 0 dB master the Audigy 2 is much louder than the DMX is and audibly distorts. Judging by hearing, keeping the master at -16 dB (60 in the integer scale) gets things about the same. Was that scale provided by datasheet or just guessed? Especially the distortion would seem to indicate that something is actually doing analogue amplification at the 0 dB ALSA setting...
Expanding, with the 'Line' control at 0 dB (74 integer) and 'Analog Mix' at 0 dB (100 integer) everything does sound right with both 'Master Capture' and 'Master' at full, and too faint with 'Master' at -16 dB. I guess this indicates that it's something at the DSP side only? (sort of loosing my way in this bewildering array of controls so if I need to be guided to possibly say sensible things -- please do)
When I do actually capture, -16 dB master is again the correct setting when playing back (with everything else still set to 0 dB as described above). It's then equally load as when directly monitored during recording. I expect then the Master dB scale needs to be adjusted down? If yes, I'll try to make very, very sure that -16 dB now is the correct new 0 dB.
Can we narrow this down a bit please. Run speaker-test -c2 -twav Do the test to each sound card with alsamixer set to 0dB for most controls accept the master, and leave the master at a sensible setting for your setup so that you can hear sound at a sensible level With the same dB values on the Andigy 2 and DMX, do you get the same loudness of sound output to the speakers?
Very much not. Sorry, it seems the report (unsnipped above) got a little confusing due to the followups but with everything at 0 dB on both DMX and Audigy 2, the Audigy 2 is much louder and distorts.
DMX has 'PCM' -34.5 --> +12 dB and 'Master' -46.5 --> 0 dB. I always keep both at 0 dB for a good, comfortable level (adjusted further externally).
Audigy 2 'Front' and 'Wave' are both at 0 dB (max) (everything default in fact) and with 'Master' at 0 dB, it's much louder then the DMX. Setting 'Master' to -16 dB (60) gets things the same.
I would like to find out if the problem is in the playback path, or the capture path.
Playback I'd say and I personally consider DMX right here, due to the distortion from the Audigy.
Only introduced capture into the story above as "additional evidence" where I could do a a comparison using only the Audigy itself and not the DMX: with everything at 0 dB in the capture direction, a captured file needs to be played back at -16 dB 'Master' to be equally loud to what I hear _during_ capturing as well ("hear" from 'Analog Mix' at 0 dB). So I get the feeling it's a simple matter of transposing 0 dB on the Master scale for the Audigy (ie, new 0 dB is old -16 dB).
I should have another emu10k1 driven card here somewhere. Is it useful if I try to dig it up and see if the story's the same on it?
Rene.
On 17-04-08 23:30, Rene Herman wrote:
James, I believe you are the emu10k1 person? Data:
TerraTec DMX = ESS Canyon3D (ES1970MS-3D) + Sigmatel STAC9704T
Creative Audigy 2 (SB0240) = Creative CA0102-ICT + Sigmatel STAC9721T (+ Crystal CS4382-KQ which seems to provide digital attenuation as well)
At 0 dB master the Audigy 2 is much louder than the DMX is and audibly distorts. Judging by hearing, keeping the master at -16 dB (60 in the integer scale) gets things about the same. Was that scale provided by datasheet or just guessed? Especially the distortion would seem to indicate that something is actually doing analogue amplification at the 0 dB ALSA setting...
Expanding, with the 'Line' control at 0 dB (74 integer) and 'Analog Mix' at 0 dB (100 integer) everything does sound right with both 'Master Capture' and 'Master' at full, and too faint with 'Master' at -16 dB. I guess this indicates that it's something at the DSP side only? (sort of loosing my way in this bewildering array of controls so if I need to be guided to possibly say sensible things -- please do)
When I do actually capture, -16 dB master is again the correct setting when playing back (with everything else still set to 0 dB as described above). It's then equally load as when directly monitored during recording. I expect then the Master dB scale needs to be adjusted down? If yes, I'll try to make very, very sure that -16 dB now is the correct new 0 dB.
Can we narrow this down a bit please. Run speaker-test -c2 -twav Do the test to each sound card with alsamixer set to 0dB for most controls accept the master, and leave the master at a sensible setting for your setup so that you can hear sound at a sensible level With the same dB values on the Andigy 2 and DMX, do you get the same loudness of sound output to the speakers?
Very much not. Sorry, it seems the report (unsnipped above) got a little confusing due to the followups but with everything at 0 dB on both DMX and Audigy 2, the Audigy 2 is much louder and distorts.
DMX has 'PCM' -34.5 --> +12 dB and 'Master' -46.5 --> 0 dB. I always keep both at 0 dB for a good, comfortable level (adjusted further externally).
Audigy 2 'Front' and 'Wave' are both at 0 dB (max) (everything default in fact) and with 'Master' at 0 dB, it's much louder then the DMX. Setting 'Master' to -16 dB (60) gets things the same.
I would like to find out if the problem is in the playback path, or the capture path.
Playback I'd say and I personally consider DMX right here, due to the distortion from the Audigy.
Only introduced capture into the story above as "additional evidence" where I could do a a comparison using only the Audigy itself and not the DMX: with everything at 0 dB in the capture direction, a captured file needs to be played back at -16 dB 'Master' to be equally loud to what I hear _during_ capturing as well ("hear" from 'Analog Mix' at 0 dB). So I get the feeling it's a simple matter of transposing 0 dB on the Master scale for the Audigy (ie, new 0 dB is old -16 dB).
I should have another emu10k1 driven card here somewhere. Is it useful if I try to dig it up and see if the story's the same on it?
Was this a useful report?
Rene.
John Rigg wrote:
On Monday 14 April 2008 23:07:22 James Courtier-Dutton wrote:
The aim of the dB values in the ALSA mixer is this.
For Playback: Set all the mixer controls to 0dB. Send a sample digital signal from the CPU to the sound card. The measured analog signal on the line-out should be the same for ALL sound cards.
The dB setting in a mixer refers to gain, not level. Expecting the same absolute level from pro and consumer sound cards at the same gain setting is a little ridiculous. If I set a control at 0dB I want just that: 0dB gain.
John
But surely it is a bit more than that. If I work with Pro gear and I capture some sound via line-in. I then send the digital sound file produced to another person who also has pro gear. When they output that digital sound file to their line-out, it should be identical, level wise, to the captured line-in was so long as both people have the same dB gain levels set. In this case, we would need some way to convert Volts from the line-in to specific digital samples in the sound file. I have not been able to find out what this conversion should be. E.g. a 16bit signed digital sample with value +5000 equals X Volts output from line-out. What is that X value?
James
On Tue, Apr 15, 2008 at 03:43:30PM +0100, James Courtier-Dutton wrote:
John Rigg wrote:
On Monday 14 April 2008 23:07:22 James Courtier-Dutton wrote:
The aim of the dB values in the ALSA mixer is this.
For Playback: Set all the mixer controls to 0dB. Send a sample digital signal from the CPU to the sound card. The measured analog signal on the line-out should be the same for ALL sound cards.
The dB setting in a mixer refers to gain, not level. Expecting the same absolute level from pro and consumer sound cards at the same gain setting is a little ridiculous. If I set a control at 0dB I want just that: 0dB gain.
John
But surely it is a bit more than that. If I work with Pro gear and I capture some sound via line-in. I then send the digital sound file produced to another person who also has pro gear. When they output that digital sound file to their line-out, it should be identical, level wise, to the captured line-in was so long as both people have the same dB gain levels set. In this case, we would need some way to convert Volts from the line-in to specific digital samples in the sound file. I have not been able to find out what this conversion should be. E.g. a 16bit signed digital sample with value +5000 equals X Volts output from line-out. What is that X value?
In pro gear, levels are referenced to digital full scale in the A-D and D-A converters. The actual analogue signal voltage level that corresponds to this varies between interfaces. In most pro converters, full scale corresponds to about +20dBu (about 11 volts peak) but there is some variation (+/- 2 or 3dB) between manufacturers. I'd expect the line in and line out levels on a consumer sound card to be much lower than this, so obviously the same standard can not be applied to both.
John
Florian Faber:
How about this: You do what you want with the consumer boards, and leave the pro guys alone. Pro drivers are not 'broken' if they don't implement such a 'feature', they are pro drivers.
Would you take a minute and reconsider this old distinction between "consumer" and "professional"?
In the end it's not the card, it's not the freaking driver. It's the person, of course.
If I would have to make a living from handling expensive audio gear responsibly I'd reach for the right hardware fader *before* I ran anything that could come up rolling and screaming.
Wolfgang
On 15-04-08 17:42, Wolfgang Woehl wrote:
Would you take a minute and reconsider this old distinction between "consumer" and "professional"?
In the end it's not the card, it's not the freaking driver. It's the person, of course.
If I would have to make a living from handling expensive audio gear responsibly I'd reach for the right hardware fader *before* I ran anything that could come up rolling and screaming.
Yes, but the day your wife leaves you, you forget once due to being pre-ocuppied and now you're fired as well. Damn, going downhil fast.
I personally don't see much of a difference between pro and consumer either, but the other way around: _generally_ non muted (that is, without the user having told us that is what she wants through saved settings) is simply irresponsible.
Rene.
On Tue, Apr 15, 2008 at 05:42:47PM +0200, Wolfgang Woehl wrote:
Florian Faber:
How about this: You do what you want with the consumer boards, and leave the pro guys alone. Pro drivers are not 'broken' if they don't implement such a 'feature', they are pro drivers.
Would you take a minute and reconsider this old distinction between "consumer" and "professional"?
In the end it's not the card, it's not the freaking driver. It's the person, of course.
If I would have to make a living from handling expensive audio gear responsibly I'd reach for the right hardware fader *before* I ran anything that could come up rolling and screaming.
I will often fire up a software mixer in the middle of a busy remote recording session (where I don't have the luxury of a mixing desk for monitoring) to send a headphone mix to a musician. It's a lot quicker to use a mixer that starts muted by default than to run back and forth between headphone amp racks and the computer setting levels. Is it irresponsible of me to prefer the convenience of just having to set the levels in the software app? There seems to be some hostility towards the idea that people who rely on this stuff to make their living might have some requirements that are different from those of the average computer user.
I don't have a problem with the average desktop user wanting their sound cards to be easy to use. I just have a problem with the idea that the tools I rely on to do my job might be broken by a "one size fits all" approach to all audio interfaces.
John
John Rigg:
I don't have a problem with the average desktop user wanting their sound cards to be easy to use. I just have a problem with the idea that the tools I rely on to do my job might be broken by a "one size fits all" approach to all audio interfaces.
Yes, there is no "one size" that will fit all. As there ain't "two sizes" that would fit two distinct parties ("consumers" and "professionals"). The distinction is pretty useless.
ALSA does the right thing to init with everything muted. So the next best place to do anything useful is distro installation and hotplug events. Distros should really improve their mechanisms to ask and remember what the user wants.
Wolfgang
On Tue, Apr 15, 2008 at 07:14:23PM +0200, Wolfgang Woehl wrote:
ALSA does the right thing to init with everything muted. So the next best place to do anything useful is distro installation and hotplug events. Distros should really improve their mechanisms to ask and remember what the user wants.
Agreed.
John
On Mon, 14.04.08 22:07, James Courtier-Dutton (James@superbug.co.uk) wrote:
Lennart Poettering wrote:
Yes, but what I am asking for is to define the dB values of the master control relative to the some ref level on this line-out. What happens after the line-out doesn't matter at all.
Lennart
The aim of the dB values in the ALSA mixer is this.
For Playback: Set all the mixer controls to 0dB. Send a sample digital signal from the CPU to the sound card. The measured analog signal on the line-out should be the same for ALL sound cards.
For Capture: Set all the mixer controls to 0dB. Send a sample analog signal to the line-in of the sound card. The captured digital signal at the CPU should be the same for ALL sound cards.
The reason for using 0dB is that it should mean no gain and no attenuation to the signal and so minimize distortions.
Hmm, my interpretation of the whole discussion is that while this might be what you had in mind when designing the interface this is not how drivers implemented it because hardware doesn't provide this information in most cases.
The dB values exported by ALSA right now seem to be relative to zero gain -- at least for some devices and mixer tracks. For the remaining cases it is relative to maximum gain. There's currently no way to figure out from the ALSA API which case it is for a local setup.
It would of course be great if each ALSA mixer control would also export the voltage (dBu) to which 0dB refers. However this information is probably only available in the specs of very little hardware (and if at all only on pro hw which doesn't really matter for what I try to do), and would require some non-trivial amount of testing with metering hardware and stuff for the others. Also, for devices like USB speakers voltages don't make any sense anyway since audio leaves those speakers only acoustically. Hence, relying on dBu info exported by ALSA is not really an option for me. It would be incomplete, unreliable and a thing of the future if at all.
So, what does this mean for the task I initially wanted to get done, i.e. to find some way to initialize mixers properly so that they are not fully unmuted? Nothing good. It probably makes sense to initialize mixer tracks that are not the "last" one in the chain to 0dB, but initializing the last one (i.e Master) unconditionally to 0dB seems to be a bad idea. However, under the assumption the mixer slider does not directly control a 1000W amplifier it is probably OK to initialize it to something like -47dB or lower. That should be good enough so that people hear at least something on many setups and then take the fact that it might be too low in volume as a suggestion to turn the volume up. It's better than total silence, and way better than the tool that Fedora currently ships which unconditionally initializes the volume of all previously-unseen hardware to 75% of the integer scale, for whatever that may be.
And again, what I am trying to do is not relevant at all for pro audio people. My focus is desktop audio. So please, complains that setting the default values of the mixers to anything that is not -inf dB might trash your pro audio equipment are not applicable right now.
Any complaints? Or can we end this dicussion with this summary of my plans?
If my interpretation of the status quo of what dB values are relative to is correct, may I suggest adding this to the ALSA docs, to make this clear for the next poor sould who wants to make sense of this?
Thanks,
Lennart
Lennart Poettering wrote:
On Mon, 14.04.08 22:07, James Courtier-Dutton (James@superbug.co.uk) wrote:
[snip]
So, what does this mean for the task I initially wanted to get done, i.e. to find some way to initialize mixers properly so that they are not fully unmuted? Nothing good.
Why not open a dialog when encountering a device for which there is no existing asound.state or equivalent pulseaudio file? Something like "This sound device has not been used on this machine before. Therefore the volume is muted. Hit enter to go to alsamixer to adjust the volume to the level you want". Then bring up alsamixer for the device, and when it exits write an asound.state. And a pulseaudio version so if you see the device again, you don't have to ask. Or instead of alsamixer, you could just bring up the window manager volume adjustment app, or your own volume adjustment app. No guessing, no problem.
Thanks,
Lennart
stan wrote:
Why not open a dialog when encountering a device for which there is no existing asound.state or equivalent pulseaudio file?
Please think again about blind users. They have no way to know its contents, except by the computer reading it through the sound card.
At Sun, 20 Apr 2008 03:01:17 +0200, Lennart Poettering wrote:
On Mon, 14.04.08 22:07, James Courtier-Dutton (James@superbug.co.uk) wrote:
Lennart Poettering wrote:
Yes, but what I am asking for is to define the dB values of the master control relative to the some ref level on this line-out. What happens after the line-out doesn't matter at all.
Lennart
The aim of the dB values in the ALSA mixer is this.
For Playback: Set all the mixer controls to 0dB. Send a sample digital signal from the CPU to the sound card. The measured analog signal on the line-out should be the same for ALL sound cards.
For Capture: Set all the mixer controls to 0dB. Send a sample analog signal to the line-in of the sound card. The captured digital signal at the CPU should be the same for ALL sound cards.
The reason for using 0dB is that it should mean no gain and no attenuation to the signal and so minimize distortions.
Hmm, my interpretation of the whole discussion is that while this might be what you had in mind when designing the interface this is not how drivers implemented it because hardware doesn't provide this information in most cases.
The dB values exported by ALSA right now seem to be relative to zero gain -- at least for some devices and mixer tracks. For the remaining cases it is relative to maximum gain. There's currently no way to figure out from the ALSA API which case it is for a local setup.
It would of course be great if each ALSA mixer control would also export the voltage (dBu) to which 0dB refers. However this information is probably only available in the specs of very little hardware (and if at all only on pro hw which doesn't really matter for what I try to do), and would require some non-trivial amount of testing with metering hardware and stuff for the others. Also, for devices like USB speakers voltages don't make any sense anyway since audio leaves those speakers only acoustically. Hence, relying on dBu info exported by ALSA is not really an option for me. It would be incomplete, unreliable and a thing of the future if at all.
So, what does this mean for the task I initially wanted to get done, i.e. to find some way to initialize mixers properly so that they are not fully unmuted? Nothing good. It probably makes sense to initialize mixer tracks that are not the "last" one in the chain to 0dB, but initializing the last one (i.e Master) unconditionally to 0dB seems to be a bad idea. However, under the assumption the mixer slider does not directly control a 1000W amplifier it is probably OK to initialize it to something like -47dB or lower. That should be good enough so that people hear at least something on many setups and then take the fact that it might be too low in volume as a suggestion to turn the volume up. It's better than total silence, and way better than the tool that Fedora currently ships which unconditionally initializes the volume of all previously-unseen hardware to 75% of the integer scale, for whatever that may be.
And again, what I am trying to do is not relevant at all for pro audio people. My focus is desktop audio. So please, complains that setting the default values of the mixers to anything that is not -inf dB might trash your pro audio equipment are not applicable right now.
Any complaints? Or can we end this dicussion with this summary of my plans?
Yeah, I'm indeed very fond of automatic volume setup for desktop users, too. I don't know whether it's a role of PA. Rather I feel we'd need to add a feature to alsactl, such as, % alsactl init then it'll either initialize or restore the previous setup.
So, anyway, what we really need is to gather the data for each available device to initialize to the "sane" state...
If my interpretation of the status quo of what dB values are relative to is correct, may I suggest adding this to the ALSA docs, to make this clear for the next poor sould who wants to make sense of this?
Agreed.
Takashi
On 21-04-08 15:43, Takashi Iwai wrote:
Yeah, I'm indeed very fond of automatic volume setup for desktop users, too. I don't know whether it's a role of PA. Rather I feel we'd need to add a feature to alsactl, such as, % alsactl init then it'll either initialize or restore the previous setup.
So, anyway, what we really need is to gather the data for each available device to initialize to the "sane" state...
People were worried about the maintainability of this (proposed as shipped /usr/share/cards/<card>.state files) but I feel this shouldn't be too bad indeed. I'd suggest "alsactl defaults" to just load those "unmuted card defaults" and leave looking for previously saved settings to an init script same as now. Distributions then have full freedom.
Is the "id" parameter to modules (and multiple cards with the later ones having an id postfix) a problem for finding the right state file to load? That is, is it a problem for the current <card>.conf files in there? Not sure how that works...
Rene.
On Mon, 21 Apr 2008, Takashi Iwai wrote:
Yeah, I'm indeed very fond of automatic volume setup for desktop users, too. I don't know whether it's a role of PA. Rather I feel we'd need to add a feature to alsactl, such as, % alsactl init then it'll either initialize or restore the previous setup.
So, anyway, what we really need is to gather the data for each available device to initialize to the "sane" state...
I agree that initialization should be implemented in alsactl, too. I think that only necessary values (Master, PCM, Front, Wave, enable recording from Mic) should be kept in database and all other "advanced" controls should be untouched. Initial values should be hearable minimum.
I'll try to propose and implement an interface.
Jaroslav
----- Jaroslav Kysela perex@perex.cz Linux Kernel Sound Maintainer ALSA Project, Red Hat, Inc.
At Mon, 21 Apr 2008 18:01:24 +0200 (CEST), Jaroslav Kysela wrote:
On Mon, 21 Apr 2008, Takashi Iwai wrote:
Yeah, I'm indeed very fond of automatic volume setup for desktop users, too. I don't know whether it's a role of PA. Rather I feel we'd need to add a feature to alsactl, such as, % alsactl init then it'll either initialize or restore the previous setup.
So, anyway, what we really need is to gather the data for each available device to initialize to the "sane" state...
I agree that initialization should be implemented in alsactl, too. I think that only necessary values (Master, PCM, Front, Wave, enable recording from Mic) should be kept in database and all other "advanced" controls should be untouched. Initial values should be hearable minimum.
BTW, there is another thing to care - the capture. In most cases, people don't understand why they can't record from the microphone on their laptops out of the box.
Takashi
On Mon, 21 Apr 2008, Takashi Iwai wrote:
At Mon, 21 Apr 2008 18:01:24 +0200 (CEST), Jaroslav Kysela wrote:
On Mon, 21 Apr 2008, Takashi Iwai wrote:
Yeah, I'm indeed very fond of automatic volume setup for desktop users, too. I don't know whether it's a role of PA. Rather I feel we'd need to add a feature to alsactl, such as, % alsactl init then it'll either initialize or restore the previous setup.
So, anyway, what we really need is to gather the data for each available device to initialize to the "sane" state...
I agree that initialization should be implemented in alsactl, too. I think that only necessary values (Master, PCM, Front, Wave, enable recording from Mic) should be kept in database and all other "advanced" controls should be untouched. Initial values should be hearable minimum.
BTW, there is another thing to care - the capture. In most cases, people don't understand why they can't record from the microphone on their laptops out of the box.
Yep, I wrote "enable recording from Mic" :-)
Jaroslav
----- Jaroslav Kysela perex@perex.cz Linux Kernel Sound Maintainer ALSA Project, Red Hat, Inc.
At Mon, 21 Apr 2008 18:09:25 +0200 (CEST), Jaroslav Kysela wrote:
On Mon, 21 Apr 2008, Takashi Iwai wrote:
At Mon, 21 Apr 2008 18:01:24 +0200 (CEST), Jaroslav Kysela wrote:
On Mon, 21 Apr 2008, Takashi Iwai wrote:
Yeah, I'm indeed very fond of automatic volume setup for desktop users, too. I don't know whether it's a role of PA. Rather I feel we'd need to add a feature to alsactl, such as, % alsactl init then it'll either initialize or restore the previous setup.
So, anyway, what we really need is to gather the data for each available device to initialize to the "sane" state...
I agree that initialization should be implemented in alsactl, too. I think that only necessary values (Master, PCM, Front, Wave, enable recording from Mic) should be kept in database and all other "advanced" controls should be untouched. Initial values should be hearable minimum.
BTW, there is another thing to care - the capture. In most cases, people don't understand why they can't record from the microphone on their laptops out of the box.
Yep, I wrote "enable recording from Mic" :-)
Oh yeah, sorry, I reacted too quickly without reading enough.
Takashi
At Fri, 11 Apr 2008 22:46:11 +0200, Lennart Poettering wrote:
Now the thing is, this mostly works fine, however on one of my devices, a pair of external Logitech USB speakers (ID 046d:0a04 Logitech, Inc. V20 portable speakers), the dB scale seems to be totally bogus. According to ALSA volume ranges from -41 dB to +3dB. However, Every setting > -41 dB makes audio awfully loud. Really, really fucking loud that is. Disco loud. As loud that the speakers start jump around centimeters due to the massive vibrations. Setting the volume to 0dB with those speakers really makes you fear you are trashing them.
This is typically a problem of your usb hardware. The USB descriptor gives the dB level information and the usb-audio driver simply passes the given data as dB scale information. But, the hardware actually doesn't behave as it states. Unfortunately a frequent problem with cheap USB audio devices.
So, it's definitely no universal ALSA problem. Please don't mix up.
Takashi
On Tue, 15.04.08 12:17, Takashi Iwai (tiwai@suse.de) wrote:
Now the thing is, this mostly works fine, however on one of my devices, a pair of external Logitech USB speakers (ID 046d:0a04 Logitech, Inc. V20 portable speakers), the dB scale seems to be totally bogus. According to ALSA volume ranges from -41 dB to +3dB. However, Every setting > -41 dB makes audio awfully loud. Really, really fucking loud that is. Disco loud. As loud that the speakers start jump around centimeters due to the massive vibrations. Setting the volume to 0dB with those speakers really makes you fear you are trashing them.
This is typically a problem of your usb hardware. The USB descriptor gives the dB level information and the usb-audio driver simply passes the given data as dB scale information. But, the hardware actually doesn't behave as it states. Unfortunately a frequent problem with cheap USB audio devices.
So, it's definitely no universal ALSA problem. Please don't mix up.
My understanding is that the dB values of this USB device are relative to its maximum gain, and as such consistent in itself. Does the USB spec define the reference level for the dB values?
If not there's probably nothing wrong with the USB device. However, then I guess I am doomed with my task to find good defaults in a generic way for mixer controls.
Lennart
At Sun, 20 Apr 2008 02:00:51 +0200, Lennart Poettering wrote:
On Tue, 15.04.08 12:17, Takashi Iwai (tiwai@suse.de) wrote:
Now the thing is, this mostly works fine, however on one of my devices, a pair of external Logitech USB speakers (ID 046d:0a04 Logitech, Inc. V20 portable speakers), the dB scale seems to be totally bogus. According to ALSA volume ranges from -41 dB to +3dB. However, Every setting > -41 dB makes audio awfully loud. Really, really fucking loud that is. Disco loud. As loud that the speakers start jump around centimeters due to the massive vibrations. Setting the volume to 0dB with those speakers really makes you fear you are trashing them.
This is typically a problem of your usb hardware. The USB descriptor gives the dB level information and the usb-audio driver simply passes the given data as dB scale information. But, the hardware actually doesn't behave as it states. Unfortunately a frequent problem with cheap USB audio devices.
So, it's definitely no universal ALSA problem. Please don't mix up.
My understanding is that the dB values of this USB device are relative to its maximum gain, and as such consistent in itself. Does the USB spec define the reference level for the dB values?
Not clearly. IIRC, it's against the line level...
If not there's probably nothing wrong with the USB device. However, then I guess I am doomed with my task to find good defaults in a generic way for mixer controls.
I'm afraid so, too.
Takashi
On 21-04-08 15:32, Takashi Iwai wrote:
At Sun, 20 Apr 2008 02:00:51 +0200, Lennart Poettering wrote:
My understanding is that the dB values of this USB device are relative to its maximum gain, and as such consistent in itself. Does the USB spec define the reference level for the dB values?
Not clearly. IIRC, it's against the line level...
The 1.0 spec calls 0 dB line level indeed and (at least in the context of the dynamic range compressor, section 3.5.6.6) suggests that it's "usually 15-20 dB below the maximum level".
Rene.
participants (13)
-
Aldrin Martoq
-
Alexander E. Patrakov
-
Florian Faber
-
James Courtier-Dutton
-
Jaroslav Kysela
-
John Rigg
-
Lee Revell
-
Lennart Poettering
-
Mark Brown
-
Rene Herman
-
stan
-
Takashi Iwai
-
Wolfgang Woehl