You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[SOLVED] Need help disabling software audio mixer (DMIX) #439
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.
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).
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).
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).
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")
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.
Activity
popcornmix commentedon Nov 19, 2013
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).
vanfanel commentedon Nov 19, 2013
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).
popcornmix commentedon Nov 20, 2013
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).
vanfanel commentedon Nov 20, 2013
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")
popcornmix commentedon Nov 20, 2013
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.
vanfanel commentedon Nov 20, 2013
Thanks for your concise and clear responses, popcornmix! Now I think I understand all I wanted about this :)
ceph: fix buffer free while holding i_ceph_lock in __ceph_build_xattr…
ceph: fix buffer free while holding i_ceph_lock in __ceph_build_xattr…
ceph: fix buffer free while holding i_ceph_lock in __ceph_build_xattr…