Skip to content

[SOLVED] Need help disabling software audio mixer (DMIX) #439

Closed

Description

@vanfanel

Hello there,

I'd like to disable software audio mixer since I'm building a dedicated MIDI synthesizer using the Pi and I need as much raw CPU power as I can get without much overclocking, so rate conversion must be disabled. Only native rates are needed and used.

What I know so far:

-This is what my .asoundrc (or /etc/asound.conf) looks like right now:

pcm.!default {
   type hw
   card 0
}

ctl.!default {
        type hw
        card 0
}

if I understand it correctly, dmix shouldn't be activated because, in my .asoundrc, I am redefining the default plugin with "pcm.!default", and I'm setting it to the first hw, first physical card.
Same for the default control with "ctl.!default". DMIX should NOT be used anymore.

However, there's software mixing: I can do

aplay -D default clip.wav

in two different shells and they will play simultaneusly.
That should not be happening at all if dmix was disabled.
Any program using alsa that uses the "default" plugin shouldn't be using dmix now, and I know specifying it here is indeed unneeded.

Even worse, I can also do

aplay -D hw:0,0 clip.wav

in two different shells and still they play simultaneously. How can that be?? I'm bypassing any plugins by specifying the hw plug, first card, first device. What's going on?!

Mangling with the config files in /usr/share/alsa isn't a good idea since these are used to define default aliases for plugins and devices, and there's no need for that.

So, how can I effectively disable dmix (or whatever software mixing is being used) on Raspbian?
I've been reading and trying to understand http://www.alsa-project.org/main/index.php/Asoundrc to no avail.

Activity

  1. popcornmix commented on Nov 19, 2013

    @popcornmix
    Collaborator

    Are you using snd-bcm2835? (and so headphone or HDMI output?)
    That supports 8 substreams, so you can open multiple streams and the mixing is done effectively in hardware (on the GPU).

  2. vanfanel commented on Nov 19, 2013

    @vanfanel
    Author

    Yes, I'm using snd-bcm2835. I didn't know the Raspberry Pi onboard audio core had hardware mixing! Impressive..
    Does it also support 22KHz sample rates natively? I seem to be able to play these even with the mentioned .asoundrc configuration...

    If it does, how could I verify DMIX is disabled?

    I neved had a GNU/Linux system with hardware mixing hardware before, so using the aforementioned configuration always worked for me and I could easily tell when DMIX was disabled (ie, bypassed by redefining the default plugin as I have done).

  3. popcornmix commented on Nov 20, 2013

    @popcornmix
    Collaborator

    Yes, GPU supports resampling so I any sampling rates from 8kHz to 48kHz are supported natively.
    I believe from your asound.conf that DMIX will be disabled.

    If you really want to be sure, then you could rebuild kernel with 1 substream and only 48kHz supported and confirm that it breaks (but I'm pretty sure it will with that asound.conf).

  4. vanfanel commented on Nov 20, 2013

    @vanfanel
    Author

    Last question regarding this: is resampling and mixing done in hardware or is it a software kernel feature? What I really mean is: will I reduce CPU usage during a single, native-rate playback if I recompile the kernel and disable streams and different rates? (Supposing there's such thing as a "native sample rate")

  5. popcornmix commented on Nov 20, 2013

    @popcornmix
    Collaborator

    The resampling and mixing is being done on the GPU. There should be no observable CPU usage due to this on ARM.
    As far as the ARM is concerned there is no native sampling rate. The ALSA driver reports it supports a continuous range from 8kHz to 48kHz.

  6. vanfanel commented on Nov 20, 2013

    @vanfanel
    Author

    Thanks for your concise and clear responses, popcornmix! Now I think I understand all I wanted about this :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions