[solved] Sound card and driver

Forum Forums General Hardware [solved] Sound card and driver

  • This topic has 33 replies, 8 voices, and was last updated May 17-9:53 pm by Brian Masinick.
Viewing 15 posts - 16 through 30 (of 33 total)
  • Author
    Posts
  • #59486
    Member
    Robin
      Helpful
      Up
      0
      ::

      @JSM : I can confirm this problem you’ve described. It is quite hard get the the alsa sliders to a correct setting. The line between “to low” sound and running into harmonic distortion and “clipping” is extremely small in antiX on my machine. At least I wasn’t used to this before on the very same hardware. There must be a reason, and a missing logharithmic scale could be very well the core of the problem, since acoustic sound is measured logarithmically by default, which has physical reasons.
      @ModdIt : this could very well be hardware and or driver specific, and being a consequence of some hardware manufacturers having dropped support for some products, resulting in non-proprietary drivers not working as desired. I haven’t checked for this, but for me the alsa sliders do work very poor, and you need a good pint of experience to move them very very very carefully to an acceptable basic setting. So it is rather a question how do the sliders respond to each mm of movement. It was for a good reason, old hardware volume controls in discrete electronics were always built by logarithmic potentiometers. And I believe to notice the alsa sliders do behave like linear regulators only. But as said before, I haven’t had time to perform any further testing, after once having managed to get a nearly acceptable setting.

      Audio:     Device-1: Intel 82801FB/FBM/FR/FW/FRW High Definition Audio driver: snd_hda_intel 
                 Device-2: Philips s SAA7131/SAA7133/SAA7135 Video Broadcast Decoder driver: saa7134 
                 Sound Server: ALSA v: k4.19.184-antix.1-686-smp-pae

      Windows is like a submarine. Open a window and serious problems will start.

      #59489
      Anonymous
        Helpful
        Up
        0
        ::

        preinstalled in antiX Full edition is a tool named ‘volumeicon’
        (package name ‘volumeicon-alsa-legacy’)

        Right-clicking the volumicon tray icon } Preferences, we find

        .

        #59490
        Member
        banned
          Helpful
          Up
          0
          ::

          @Moddlt

          It’s not about physical details, just the GUI. Check out the mixer and see what they do! Assuming the information is correct! Set the master to 100. At the top of the master you can see the item: Master [dB gain: 0.00]. This is the max volume of the pre-amp. Type down arrow on the keyboard, you land on Master 96! What are 99, 98, 97 for? For the cat or what? And above you can see Item: Master [dB gain: -1.00]. What does it mean? A reduction of 1 dB? That would be crazy, because -3dB means a 20% reduction in loudness! Go to 88 of the master. Now you have the item above: Master [dB gain: -3.00]. Is this 20% reduction in loudness. This is what the user expects from Master 80! You cannot reduce the volume with a constant value, because dB is logarithmic. You would first have to choose a very small reduction and then the deeper you go, the bigger it is.

          But the user wants something else. He wants Master 43 to be 43% of the maximum loudness. That’s what he wants. This has absolutely nothing to do with the sound card or the environment, only with the conversion of the user information in the Master to the dB reduction. For example Master 50 must be -10dB (half of loudness), but it is -16dB. And it’s not linear, so you have to calculate the reduction for each of the 100 steps. But I’m afraid that the alsa people simply don’t get this for years!

          http://www.sengpielaudio.com/calculator-loudness.htm
          http://www.sengpielaudio.com/calculator-levelchange.htm

          But no user wants to have a logarithmic scale on his volume control, because people think in linear scales! And it’s very easy to make this interface between the GUI and the sound card. You either need a table with the dB reductions in 100 steps, or the mathematical formula to calculate the reduction directly.

          Maybe someone can pass this on to the alsa people? Maybe a friend of the alsa people? 🙂

          #59495
          Member
          ModdIt
            Helpful
            Up
            0
            ::

            Maybe someone can pass this on to the alsa people? Maybe a friend of the alsa people?

            As you obviously have an simple universal answer to room, sound system hearing accoustic problem which has only been fully understood by
            you. Go tell them yourself. And put all sound experts who use have developed and use alsa in studio, concert, home audio/theater and other
            settings to shame. A mixer is only a tiny part of the story…

            Project is at home @ https://github.com/alsa-project/alsa-utils

            #59510
            Member
            Robin
              Helpful
              Up
              0
              ::

              preinstalled in antiX Full edition is a tool named ‘volumeicon’

              Yes, I’m aware of this and using it. But I have never seen the logarithmic/linear selector your screenshot shows. I’ll append a screenshhot what I get presented: This is on antiX 19.3 recently updated.

              $ apt-cache policy volumeicon-alsa-legacy
              volumeicon-alsa-legacy:
                Installiert:           0.4.6-2.4
                Installationskandidat: 0.4.6-2.4
                Versionstabelle:
               *** 0.4.6-2.4 500
                      500 https://mirror.eu.oneandone.net/linux/distributions/mx/packages/antix/buster buster/main i386 Packages
                      100 /var/lib/dpkg/status

              And then, this is fine when only having to use the master volume. But this was possible not before some difficult correction work was done to some other channels before. (difficult because of the very small border line between “way to low” and “digital clipping”) The defaults are predefined that weak for my hardware you can’t merely hear nothing, even with master control of volumeicon pushed up to 100%. So there is no way to avoid to use alsamixer directly.

              But I’ just have checked: the scale in alsamixer is obviously in some way non-linear.

              when pressing the up-down arrows you will see the following changes happen to the values displayed below the sliders:

              0;1;2;  4;5;6;7;8;  10;11;  13;14;  16;  18;19;  21;22;23;24;25;  27;28;  30;31;  33;34;  36;  38;  40;  42;  44; 46; 48; 50;
              52;    55; 57;   60;  62;  65;  68;  71;  74;  78;  81;  84;  88;  92;  96;  100

              looks crazy at first glance…
              but each button press adds or removes exactly 1 dB always, as shown above the sliders, irrespective to the inconsistent numbers displayed below the sliders.

              My general experience was: once you have managed to find a combination of basic settings for all the rather poorly labled sliders and switches in alsamixer, you can forget about all that stuff and use volumeicon from system tray in most cases.

              Windows is like a submarine. Open a window and serious problems will start.

              #59518
              Moderator
              christophe
                Helpful
                Up
                0
                ::

                My general experience was: once you have managed to find a combination of basic settings for all the rather poorly labled sliders and switches in alsamixer, you can forget about all that stuff and use volumeicon from system tray in most cases.

                Right, Robin, that’s how I’ve always found it to work, as well. Just takes some tweaking; some computers need more, some less (& some none).

                confirmed antiX frugaler, since 2019

                #59528
                Member
                banned
                  Helpful
                  Up
                  0
                  ::

                  @skidoo and @Robin

                  I have a different icon and the settings look like the one of Robin.

                  How can I activate and use this “volumeicon-alsa-legacy”?

                  I can’t find it in my menu. In Synaptic, yes.

                  Maybe it will solve the problem.

                  I also noticed today that the volume control on the icon is set to Master, but does not display the same values as the Master in the Mixer! If it is at 50, then the master in the mixer is at 23. It seems like the chaos of the scales is perfect 🙁

                  • This reply was modified 1 year, 11 months ago by banned.
                  #59530
                  Member
                  Xecure
                    Helpful
                    Up
                    0
                    ::

                    sudo apt install volumeicon-alsa

                    antiX Live system enthusiast.
                    General Live Boot Parameters for antiX.

                    #59551
                    Member
                    banned
                      Helpful
                      Up
                      0
                      ::

                      @Xecure

                      Ok, Synaptic said it was already installed … but I ran it anyway and now I have the same thing as skidoo. If you switch to “linear scale”, the volume control corresponds with the master and shows the same values. The graphical representation has also changed a bit. What has not changed is the way alsa controls the volume, so that it reduces 1dB per step. But maybe one day the alsa people will understand what loudness is. There is a difference between sending volume information in dB to software and sending it to an output device that serves human ears (loudspeakers, headphones). In order to correspond to the human ear, one has to decrease the dB values ​​according to the loudness scale and not according to one of the others. Again the two links from above:

                      http://www.sengpielaudio.com/calculator-loudness.htm
                      http://www.sengpielaudio.com/calculator-levelchange.htm

                      I took 3 photos where you can see it. Loudness is intended for the human ear. To halve the loudness, you have to use -10dB. It means that alsa has to calculate the dB value for a loudspeaker or headphones based on the loudness, not the voltage or power. But what alsa-mixer does is very strange. With every step he just subtracts 1. This is completely pointless and does not correspond to any of the 3 normal methods! If I set the master to 88, the item above is: Master [dB gain: -3.00]. This means that the loudness is now 81.6% compared to the maximum. Sound pressure is 70.7%. Sound intensity is 50%. As you can see, all values that do not correspond to 88!

                      What matters to the user is only the loudness, because that is what he hears. Master 50 results in Item: Master [dB gain: -16.00]. But according to the loudness calculation, it should be -10dB so that the user really feels half the volume.

                      As you can see, it’s not about sound cards or other technology, but just about the correct type of conversion and the correct interpretation of the user input. Surely the user wants to hear half the volume with Master 50 and because he is a human, this has to correspond to a reduction of -10dB (loudness).

                      I wanted to test pulse audio to see whether this frontend might correct alsa’s error. But somehow I can’t get the connection to alsa. A window opens and says to wait … and I’m still waiting 🙂 Photo 4

                      #59560
                      Anonymous
                        Helpful
                        Up
                        0
                        ::

                        Surely the [typical] user wants to hear half the volume with Master 50

                        Maybe I am just an atypical user, maybe hardware differences account for some of the descrepancies in our observations // recommendations // wants?

                        I hope you will excuse me for failing to understand why the exclamation points (and such) here are something other than “a tempest in a teacup”. For me, the volumeicon slider provides fine-grained control at low volume levels (important if I’m occasionally using headphones). Probably, at the outset when setting up the fresh system, I adjusted the defaults to suit the speakers+subwoofer, to avoid overdriving them… but I’ve honestly never given any consideration to “what means 50%”.

                        #59566
                        Member
                        Robin
                          Helpful
                          Up
                          0
                          ::

                          The main problem is: What you are searching is not that easy to do, the correlation between technical dB value and perceived loudness is quite complex. I’ve once learned this stuff many years ago, so let me try to explain what I can remember and point out what exactly the problem is. Please excuse me if I fail to be clear in English language, since I do know most of the technical termini in German language only and have to look up in dictionary most of them for translation, so I’m not sure whether I will manage to express my intention correctly.

                          What we hear is “loudness”, a psychoacoustical expression, measured in unit “phon”, which describes, which sound pressure level in dB is needed at a frequency of 1 kHz to produce the same sensation of loudness as the accoustic event we look at. In simple words: there is no direct calculable correlation between dB and sensed loudness.

                          From the attached table #1 you may get an idea what the correlation looks like. As you can see, there is for each frequency another correlation between sound pressure level in dB and loudness level.

                          High end audio equipment (at least some decades ago) provided sophisticated discrete circuitry for correlating the impact of volume control differently to different frequency bands, so the listner has always the same impression of acoustic colour when turning the volume control at his amplifier.

                          I doubt whether modern PC audio supports these features. People have got used to much less leveled accoustic quality standards as a consequence of audio compression formats like mp3 and streaming audio. The loss is comparable to what you probably know from image compression of pictures, but it is much easier to see the differences but to hear them. Only well trained ears will notice there is something missing.

                          Well, back to the original problem. There is a solution for this: ISO 532 B describes standards of measuring and you could use the unit “Sone” to describe the loudness. But this is neither a SI unit nor could it get calculated from a dB value. A not very reliable but practically always used workaround for the problem is to apply the weighted sound pressure level dB(A) instead. This is simplified a defined filter formula whose characteristic is meant as an approximation to human sense of hearing.

                          But since in acoustic engineering other filters as dB(B)…(G) are also in use, it is not a good idea to bind alsa directly to one of these weighting curves. Maybe you can understand now why sound experts and studio technicians are fine with alsa.

                          But you are right, there could be a layer above bare alsa which could make all this a little more handy for ambitious and fastidious everyday “high-fidelity” user, exactly the way “volumeicon” does for one single channel.

                          Just as skidoo said before: Most people wouldn’t even notice the difference, and are fine when the volume control is usable in a way they can get from it what they need, not concerning whether the lever is set to exactly 50% for half sensed loudness or not. But I have to admit: Something like this would be a nice bonus… On the other hand there must be posed the question whether this is worth of waisting additional computing power, only for calculating approximations for the frequency corrected sensed loudness, passing the result to the volume control.

                          Windows is like a submarine. Open a window and serious problems will start.

                          #59568
                          Member
                          banned
                            Helpful
                            Up
                            0
                            ::

                            @Robin

                            Mit Deutsch hätte ich kein Problem…but let us stay in the laguage from the forum 🙂

                            I understand your explanation quite well. Of course, loudness is not an exact measurement because it depends on the hearing of each individual. But there is an average and whoever does not correspond to the average can correct the pre-amp.

                            As I already wrote above, the volume control does not need to be exact, an approximation is sufficient. But the assumption that a person does NOT understand a linerae scale from 0-100 as a percentage is simply wrong. I’m sure almost everyone understands the volume control as a percentage of the maximum level.

                            And if a loudness scale already exists, then it should be used. Simply going down in 1dB steps just doesn’t make sense. Or why not in 0.9dB or 0.67dB or 1.078dB steps? So an application of loudness would certainly be correct and not a problem either.

                            I managed to get Pulseaudio running, but unfortunately Pulseaudio is using the calculation from alsa. I was hoping that, as a superordinate layer, it might take over the calculation for alsa and pass the result on to alsa. But unfortunately no. So I deactivated Pulseaudio again.

                            The additional setting of “linear scale” in the settings from volumeicon-alsa helps a little. At least I have this impression 🙂

                            Would be interesting to know how OSS magaged the volume. Do you know it? Quite a hassle to install and test :-). And do you know if there is another alternative for the sound in Linux? OSS and alsa are the only two I’ve found so far.

                            habe eine schöne Woche 🙂

                            #59571
                            Member
                            banned
                              Helpful
                              Up
                              0
                              ::

                              Well, to end the post without a software solution, but at least with a mathematical solution with pseudo software 🙂

                              How a volume control with a linear scale from 0-100 works, based on loudness reduction (dB gain in Mixer):

                              IF Master = 0 then mute volume
                              ELSE
                              dB-reduction = 10 x log2 (master / 100)
                              ENDIF

                              Examples:

                              Master = 50
                              dB-reduction = 10 x log2 (0.5) = 10 x -1 = -10

                              Master = 82
                              dB-reduction = 10 x log2 (0.82) = 10 x -0.286 = -2.86

                              On the following page there is a calculator for “Sound level change and loudness ratio” in the first line of the two tables:

                              http://www.sengpielaudio.com/calculator-levelchange.htm

                              And here is a log2 calculator:

                              https://miniwebtool.com/log-base-2-calculator/

                              Now an alsa programmer would only have to take the matter in hand and write a C ++ code and put it in the correct file 🙂 . The last time I wrote a code was 30 years ago … with Ada. Sorry!

                              I hope that the alsa people will recognize the problem and solve it soon. Thank you very much!

                              To the forum administration: Maybe you can put a [solved] in the title? And send the link to the alsa peolpe? Thanks 🙂

                              • This reply was modified 1 year, 11 months ago by banned.
                              #59574
                              Member
                              banned
                                Helpful
                                Up
                                0
                                ::

                                Well, to end the post without a software solution, but at least with a mathematical solution with pseudo software 🙂

                                How a volume control with a linear scale from 0-100 works, based on loudness reduction (dB gain in Mixer):

                                IF Master = 0 then mute volume
                                ELSE
                                dB-reduction = 10 x log2 (master / 100)
                                ENDIF

                                Examples:

                                Master = 50
                                dB-reduction = 10 x log2 (0.5) = 10 x -1 = -10

                                Master = 82
                                dB-reduction = 10 x log2 (0.82) = 10 x -0.286 = -2.86

                                On the following page there is a calculator for “Sound level change and loudness ratio” in the first line of the two tables:

                                http://www.sengpielaudio.com/calculator-levelchange.htm

                                And here is a log2 calculator:

                                https://miniwebtool.com/log-base-2-calculator/

                                Now an alsa programmer would only have to take the matter in hand and write a C ++ code and put it in the correct file 🙂

                                The last time I wrote a code was 30 years ago … with Ada. Sorry!

                                I hope that the alsa people will recognize the problem and solve it soon. Thank you very much!

                                To the forum administration: Maybe you can put a [solved] in the title? And send the information to the alsa people? Thanks 🙂

                                • This reply was modified 1 year, 11 months ago by banned.
                                #59600
                                Member
                                Robin
                                  Helpful
                                  Up
                                  0
                                  ::

                                  Firstly: Why do you think a stepping of 1 dB isn’t sufficient? This is the value normally trained average people can only just differentiate. Highly trained audio professionals can hear differences of 0,5 dB and below. And the dB scale is, as you probably know logarithmic itself, so when using steps of 1 dB this is perfectly fine for reflecting the actual conditions, representing the wide range of human sense of hearing. There should not be any need of performing additional logarithmic calculation when feeding the integer steps to the mixer control.

                                  But what puzzles me a bit is the complete lack of information which dB unit alsamixer refers to, since this makes all the difference. I presumed they mean (as in digital audio signal processing most common) the dB FS value, which let you get the sense of negative dB values. But looking closer at the scales and values presented (which I actually never happened to do before, I simply made settings fit by carefully listening to the result) I come to the conclusion this can’t be true. If it was dB FS meant, all positive values would mean clipping, which means in digital systems (other than analog systems, which produce an increasing distortion only) a real cut off of wave form, which results always in “cruel” sound. (Yes I’m aware this effect is artistically used on purpose e.g. by e-guitarists). So what do alsa people try actually to express by setting 0dB to a relatively low level, marked by “25” below the sliders?
                                  The alsa project itself seems not a great help to get some information on that: alsa-project mixer documentation What do they describe there? Actually: nothing…

                                  I’m obviously neither the single nor the first person not finding something useful documented: alsa-devel on mixer specs question this one is 16 years old, so one would expect there are some more pieces of information present meanwhile, but at least me wasn’t able to dig it in the depth of internet.
                                  They simply ask people to look into code to get an answer… Well let’s give it a try, even if I’m not a programmer and do not understand everything found in there: This part is quite clear:

                                  from example code referring to alsa mixer api

                                  {- $exampleVolume
                                  This example demonstrates the method of accessing the volume of a Control.
                                  The example function reads the volume and increases it by the value supplied.
                                  
                                  >   changeVolumeBy :: CLong -> IO ()
                                  >   changeVolumeBy i =
                                  >       withMixer "default" $ \mixer ->
                                  >         do Just control <- getControlByName mixer "Master"
                                  >            let Just playbackVolume = playback $ volume control
                                  >            (min, max) <- getRange playbackVolume
                                  >            Just vol <- getChannel FrontLeft $ value $ playbackVolume
                                  >            when ((i > 0 && vol < max) || (i < 0 && vol > min))
                                  >              $ setChannel FrontLeft (value $ playbackVolume) $ vol + i

                                  Obviously they (most expectable in digital processing) simply use “steps” of 1 between a “max” and “min” value to describe the actual volume level. To what kind of scale these steps are referring is not clear to me.
                                  So let’s venture a guess:
                                  On the choice are:

                                  dB FS   (full scale)   <--- most probably
                                  dB SPL   (sound pressure level)
                                  dB V     (voltage)
                                  dB u     (unloaded)

                                  Every single of these could be meant, but since there are negative values involved they probably refer to the first one, “dB FS”. This is the most common scale used in digital audio processing.

                                  from:
                                  alsa project on: HowTo access a mixer control
                                  I couldn’t find any documentation anywhere about this. After lots of trial and error I got just enough from the amixer source code to work out what I needed.

                                  Well, after researching this I tend to see it like you, there is actually some need of (and also room for) some improvement, even if studied sound engineers and audio professionals probably are fine with it as it is. Also people not expecting to get more out of their equipment than “push the lever and it reacts in some (not clearly defined) way, resulting in some kind of higher or lower volume”. But computers would be able to handle this much more precisely without additional computing power, if all this only was well documented and understood by programmers of above layers and tools like GUI sliders. I’m afraid, they simply do program to what they find, resulting in simply adding/subtracting 1 to an undefined volume scale unit between a given min and max value. OK, from (steam-age) analog audio I am used to see way more precise approaches. But these times are gone obviously, at least in non-professional field. Let me add: professional digital mixing hardware makes use of floating point arithmetics instead…
                                  But: There must be some kind of “translation” from the hardware specific dB V values to dB FS. And this is probably the joint, where (missing?) hardware driver information enters the game, and which might be the reason for different responses of volume sliders of different equipment. In a perfect world without trade secrets you could expect this to be working on any kind of hardware, but (well, the rest of it is the typical never ending linux story of being closed out by most manufacturers, even if they outplay each other in lip service to open source.)
                                  Under the given cirumstances it might turn out to be impossible to write it any better than it is.

                                  Let me append: I am not an audio engineer or professional in this sector, and not a programmer also. I only happened to have learned basics in audio accoustics many years ago. So please don’t expect to find each of my statements to be provable.
                                  Moreover I don’t have any contact to the alsa team, so the above was all I could do here. If you want to try to gather more information, the best you could do would probably to follow Moddit’s advice and ask alsa team directly. Please, let us know here, if you can manage to get some more knowledge about this, at least me is highly interested to learn more.

                                  Windows is like a submarine. Open a window and serious problems will start.

                                Viewing 15 posts - 16 through 30 (of 33 total)
                                • You must be logged in to reply to this topic.