Announcement

Collapse
No announcement yet.

Intel On Rebuilding The X.Org Linux Desktop

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • #46
    Originally posted by KDesk View Post
    Yes, you are right, that's a problem, it is fixed. But to mix the sound, it has to be in one fixed frequency, so there is where we have to choose between the common audio CD 44.1KHz or DVD, games, etc.
    When there's only one stream, why not play it at native rate? Then either keep the HW at the sample rate of the first stream, or switch to your favourite fixed frequency when more than one client has the sound device open. Or when more than one client has the sound dev open & not paused. But switching sample rates probably unavoidably introduces audible glitches and latency (HW HW dependent), so you want to avoid doing it too frequently. Maybe keep resampling for a few seconds after dropping back to 1 stream, in case another second stream appears right away.


    Oh yeah, that's the other downside to dmix: It doesn't support pause, so when you single-step frame-by-frame in mplayer, the audio gets ahead of the video and the video goes in a big burst when you unpause. mplayer could be smarter about this, but it isn't, and only works well with -ao alsa when HW pause is supported.

    dmix could be a lot better with more special-casing for one stream. That would solve both of those complaints (for me, since I don't run any crappy desktop stuff that keeps a sound device open for your whole session. Nor any of the stupid audio players like rhythymbox that only has a pause button, not a stop button. let go of my audio device, you bastard...) That would make dmix a lot less sucky for something that's enabled in the default config.

    SURVEY QUESTION: Do you usually only have a single client for your dmix pcm when you're not actually listening to two things at once? e.g. just watching a movie or listening to some music. Try sudo lsof /dev/snd/* (yes, you need root, because e.g. pulseaudio will have permissions you don't, so you can't access its /proc/pid/fd) If you see more than one process on /dev/snd/pcmC0D0p, you have more than one thing playing on device 0 of card 0, paused or otherwise.

    Does anyone know how pulseaudio compares on any of this? I usually killall pulseaudio, but I haven't gotten around to weeding it out of the default X startup script, and it's part of Ubuntu's default install. I should probably just remove the package, since it's easy enough to reinstall if I want it. But I guess I keep meaning to check it out and see if it's better than dmix. So, is it?

    Comment


    • #47
      Actually, considering that recording took place in room next to one where Keith Packard had talk, quality is not all that bad.

      Comment


      • #48
        Originally posted by KDesk View Post
        To resample from 44.1KHz to 48KHz is bad for the quality and the cpu usage.
        Quality depends on the resampling algorithm. I have 7 choices here: Fast, low, medium, high, high+, production and "none" which probably lets the sound card handle it if it can do hardware mixing/resampling.

        Neither of them produce any significant CPU load (not even 1%; I'm on Intel Core 2 E6600.)

        Btw, most cards only support 48kHz, so even if you don't resample in software, the card itself will still do it and probably with an inferior algorithm then what ALSA or OSS4 offer, so in these cases it might be better to rather resample to 48kHz to avoid hardware resampling. Of course if you're sure your card doesn't resample, then your concern is valid.

        I haven't used OSS 4.x so I can't know if it is complicated to configure or not, but to install and configure OSS without having problems... to many problems... like with pulseaudio.
        Yeah, OSS4 will probably not solve everyone's problems. I just mentioned it because it happened to solve mine and I'm very happy with it, so YMMV. Probably for you ALSA is a better option.

        Comment


        • #49
          Originally posted by RealNC View Post
          Quality depends on the resampling algorithm. I have 7 choices here: Fast, low, medium, high, high+, production and "none" which probably lets the sound card handle it if it can do hardware mixing/resampling.

          Neither of them produce any significant CPU load (not even 1%; I'm on Intel Core 2 E6600.)
          That's pretty efficient. I thought good-quality resampling took more CPU than that, but maybe not with well-written asm... One of the dmix links someone posted had someone mentioning that ALSA's dmix took 30% of the CPU on his Atom netbook. So yeah, Atom is where this matters for more than audio quality.

          Btw, most cards only support 48kHz, so even if you don't resample in software, the card itself will still do it and probably with an inferior algorithm then what ALSA or OSS4 offer, so in these cases it might be better to rather resample to 48kHz to avoid hardware resampling. Of course if you're sure your card doesn't resample, then your concern is valid.
          Do you mean most add-in sound cards, like emu10k and descendents from Creative Labs? They support multiple streams in hardware, so don't software mixing either. I thought most AC97 and HDA onboard sound cards supported 44.1KHz. My DG965WH mobo uses a nice Sigmatel STAC9271D codec (http://www.idt.com/?genID=STAC9271&s...cPart_STAC9271, http://www.idt.com/products/getDoc.cfm?docID=18451989) for it's HDA, which supports 44.1, 48, 88.2, 96, 176.4, and 192kHz sample rates, at 16, 20, or 24 bit integers per sample (no hw float support). They claim a 105dB SNR for the DAC, and 95dB for the ADC. That's just for the audio chip, not the whole mobo, but I never hear any hiss when I crank up my speakers and play digital silence. Are other HDA codecs typically worse? I've never been a fan of Realtek's cheap-ass ethernet designs, which burden the CPU, but are their audio codecs actually ok?

          Anyway, isn't it mostly just add-in gamer-targetted cards that are 48kHz-only?

          Comment


          • #50
            Maybe. I've used some cards from Creative over the years ("Live" and "Audigy" models) and OSS always reports their "native" sample rates starting at 48kHz. The only case I've seen 44.1kHz in the list was with an Intel HDA on-board, no idea which chip exactly it used. But an older AC97 on-board codec I had (some RealTek chip I think) was also only able to use 48k and up. So I guess it's not only add-in cards that resample 44.1->48.

            Comment


            • #51
              Originally posted by RealNC View Post
              Maybe. I've used some cards from Creative over the years ("Live" and "Audigy" models) and OSS always reports their "native" sample rates starting at 48kHz. The only case I've seen 44.1kHz in the list was with an Intel HDA on-board, no idea which chip exactly it used.
              you can tell what codec chip you have by looking at alsamixer:
              Code:
              Card: HDA Intel
              Chip: SigmaTel STAC9271D
              View: [Playback] Capture  All
              ...
              grep Codec /proc/asound/card0/codec#2
              Codec: SigmaTel STAC9271D

              (that grep is slow because the kernel takes a long time to generate the file, probably querying hardware settings, not because it's so big that grep has to chew it for a while.)

              But an older AC97 on-board codec I had (some RealTek chip I think) was also only able to use 48k and up. So I guess it's not only add-in cards that resample 44.1->48.
              Hmm, ok. My old via K7 mobos with AC97 I think had 44.1 kHz capable DACs.

              I wonder if dmix can resample to 96kHz/24bit? That would probably avoid any audible distortion, at the expense of a lot more CPU.

              Comment

              Working...
              X