Hardware mixing in ALSA

According to the ALSA soundcard matrix my soundcard (Echo MiaMIDI) supports hardware mixing, although I seem to be unable to get this working. I've tried different asound.conf files as well as using none at all. However, while playing one sound at a time works, playing multiple sounds always seem to result in a "output device busy" or similar. I thought maybe setting the output device manually to something like hw:0,1 or hw:1,0 (instead of hw:0,0) would work, but then I just get "unable to open device".
Now I really don't know what to try anymore. Can anyone help me?
Thanks

I think I've been able to locate my problem. It seems hardware mixing was kind of working all along, however, the system is unable to find a free subdevice when a stereo sound is played. I can play multiple mono streams at the same time using aplay without a hitch. I'm also able to start playback in amarok or mplayer, but when I play a stream in stereo (whether it be in aplay or amarok etc) I'm unable to play another. My guess right now is that there is some kind of problem identifying free subdevices. When I have nothing playing aplay -l returns
$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: Mia [Mia], device 0: PCM [Mia]
Subdevices: 8/8
Subdevice #0: subdevice #0
Subdevice #1: subdevice #1
Subdevice #2: subdevice #2
Subdevice #3: subdevice #3
Subdevice #4: subdevice #4
Subdevice #5: subdevice #5
Subdevice #6: subdevice #6
Subdevice #7: subdevice #7
but when I have something playing (whether it be mono or stereo) I get
$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: Mia [Mia], device 0: PCM [Mia]
Subdevices: 7/8
Subdevice #0: subdevice #0
Subdevice #1: subdevice #1
Subdevice #2: subdevice #2
Subdevice #3: subdevice #3
Subdevice #4: subdevice #4
Subdevice #5: subdevice #5
Subdevice #6: subdevice #6
Subdevice #7: subdevice #7
Seeing how my card has 8 virtual channels, I feel that when I have a mono stream playing it should use the first free subdevice and block it, which seems to work fine. With stereo streams two free subdevices should be used and flagged as busy, but it seems only the first is flagged as in use and my guess is that this is what causes my regular "output device busy" problem. Does anyone have any ideas on how to resolve or work around it?
Thanks
Last edited by Emphrygian (2007-08-29 21:48:30)

Similar Messages

  • Windows 7 (x64) + ALchemy + Some Games.... No Hardware Mixing and/or No EAX

    ENV:
    Windows 7 Ultimate (x64)
    X-Fi Platinum Fatalty Champion Series
    ALchemy .3
    OpenAL (Summer 2009)
    Daniel_K's "XFI_AuzenWDM__0.exe" (it got 5. + THX working!)
    PROB:
    A number of DirectSound games (F.E.A.R. series, Hitman series, etc) are failing to allow Hardware Mixing/Rendering and/or EAX to be enabled in game.
    STEPS:
    ALchemy detects the games as currently installed however enabling ALchemy for the games in the ALchemy interface does not solve the problem (though ALchemy does put the DLL and INI files into the game directories).
    Running the games in compatibility mode (2K,XP,Vista) doesn't fix the problem either.
    I've read here and there and elsewhere of other people having these problems as well and yet no definiteve solution has been found... Is anything being done to resolve this problem? Can anything be done to resolve this problem?
    k you and much respect to you. still remember the drama with Creative in early 2008, nice to see your driver mods/pkgs & forum posts aren't being removed/deleted anymore, lol.... but why the hell are you having to make drivers packages to begin with (rhetorical question)... **bleep** they should be paying you, or, you should send them an invoice...

    Hi,
    First, please be ensured that you have installed the latest drivers and all the updates.
    Then check whether this issue will not in
    Safe Mode. If it didn’t occurred, I suggest you narrow down the cause in
    Clean Boot mode.
    In addition, try to create a new profile to see how it works.
    Hope this helps.
    Vincent Wang
    TechNet Community Support

  • Audigy 2 zs Hardware mixing problem

    Hi, i'm using xp64 with 2gb ram, and after upgrade to 4gb my audigy 2zs (accord to everest and dxdiag) stops suppord hardware mixing and reporting 0 buffers instead of 64 and no eax support,? so is it driver/soundcard or other hardware problem?

    'I'm not an engineer, but my life experience tells me that it's a driver issue. Do you use alternati've drivers? They are known to work like this. Creative drivers should work fine with your hardware. Have you tried the latest update by Creative from April 200?

  • [SOLVED] Software mixing on ALSA+USB sound card

    I have cheap chinesse USB soud card. lsusb says its "Tenx Technology, Inc. TP6911 Audio Headset"
    After arch installation sound was working about 2-3 reboots. Then i googled and deleted pulseaudio, and sound randomly working or not after reboots.
    After a lot of research i got /etc/asound.conf like that:
    pcm.!default {
    type hw
    card AUDIO
    ctl.!default {
    type hw
    card AUDIO
    "AUDIO" its name of card. Checked that. And now i had sound in 80% reboots.
    After research i founded that i cant play 2 sounds at same time. (And youtube writes "error occured" for 90% videos).
    Tested aplay (it never works):
    >aplay /usr/share/sounds/alsa/Front_Center.wav
    Playing WAVE '/usr/share/sounds/alsa/Front_Center.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Mono
    aplay: set_params:1239: Channels count non available
    Then played sound in other program and in same time launched aplay:
    >aplay /usr/share/sounds/alsa/Front_Center.wav
    aplay: main:722: audio open error: Device or resource busy
    So that mean i need software mixing.
    Googled, and installed "alsa-oss" and did some random stuff with config
    pcm.!default {
    type hw
    card AUDIO
    slave.pcm "dmix"
    ctl.!default {
    type hw
    card AUDIO
    slave.pcm "dmix"
    and now youtube working. I hear it. But now aplay says:
    >aplay /usr/share/skype/sounds/CallBusy.wav
    ALSA lib pcm_hw.c:1743:(_snd_pcm_hw_open) Unknown field slave
    aplay: main:722: audio open error: Invalid argument
    He dont like "slave" thing in config, but it helps. I tested 3 times, added "slave" and rebooted and youtube works. Without "slave" it not working.
    And i still cant hear 2 sounds at same time. In google ALSA says like software mixing must work without config, if not then do bugreport.
    Im in arch less then 7 days, before i had experience with ubuntu server only, so configuring ALSA is hard for me.
    Can somebody help me configure software mixing?
    Thank you.
    Last edited by pico (2013-07-07 10:36:33)

    Okay. I surfed your URLs and ended in http://alsa.opensrc.org/Dmix
    Example /etc/asound.conf from 3 and 5 works great! Thank you!
    If somebody will google Tenx Technology, Inc. TP6911 Audio Headset
    Use /etc/asound.conf (you need create it)
    pcm.dsp0 {
    type plug
    slave.pcm "hw:0"
    ctl.mixer0 {
    type hw
    card 0
    or
    pcm.dsp0 {
    type plug
    slave.pcm "dmix"
    hint {
    show on
    description "My dmix dsp0"
    ctl.mixer0 {
    type hw
    card 0
    both works for me.
    =======
    Aaaaand after 2 reboots everything is broken. Both configs not helping. aoss and alsaplayer don't make any sound.
    5 reboots later sound again works.
    =======
    Okay, i know why i need reboot.
    If you have same problem - do aplay -l, if your card not first - nothing will work. You need reboot until your card is first. I tryed to do my card always first, but then mixer dont work. And for make it work on every reboot looks like you need read 18 huge books about universe creation.
    Last edited by pico (2013-07-09 09:53:25)

  • Connecting a hardware mixer to work with Logic

    Hi,
    I'm really keen on the idea of using an analogue mixer to work in conjunction with Logic. But is it even possible to connect Logic and a Mackie 1642 vlz3 via an iMac?
    Nick

    Yes, it is if you already have a multi-channel interface.
    If you don't, maybe consider Mackie's Onyx series mixers which, with the firewire option, gives you an analog mixer and an interface all in one.

  • Older WAAS hardware mixed with newer WAAS hardware

        We are looking into possibly expanding our WAAS implementation to add a couple more nodes. My environmnet currently comprises a 274 as my manager, a couple 574s connecting our data centers and a handfull of WAAS express on routers. My current appliances are running 4.4.1 software and the WAAS Express is under 15.1(4) IOS. I noticed that the new 5.0 software does not support any of my cuurrent hardware so figure they are pretty much stuck where they are software wise. My question is if I purchase a couple new 594s for new locations will everything continure to play nice until I can get the CM and 574s replaced? My other thought is a technology upgrade on existing infrastructure and push out this stuff to the two new locations.
    Brent                   

    Both,
    WAAS 5.0, 5.1, 5.2 and 5.3.x will support WAVE 274 and 574 as per the release notes.
    Support for these "old" appliances will cease with 5.4.x.
    For the WAAS Express see here (will probably require an IOS upgrade) :
    http://www.cisco.com/en/US/docs/app_ntwk_services/waas/waas/v533/ws533xrn.html#wp150827
    Best regards
    Finn Poulsen

  • Hardware Mixer....

    I just purchased an Alesis Multimix 16 USB 2.0 and am having some trouble setting it up for use with Logic 9. Firstly the mixer is picked up by USB in Logic but I cannot seem to set it as a control surface- when I go to AUDIO MIDI SETUP the device is listed on the audio panel but not the midi- which is where a lot of troubleshooters seem to suggest it should be.
    help would be majorly appreciated!
    Thanks

    Hi,
    I am sorry that you are experiencing that problem. I have never used Alesis but found some helpful info online about its installation.
    Here it is:
    http://www.mac-forums.com/forums/music-audio-podcasting/93351-logic-express-help -needed.html
    Hope this information helps,
    Vicente

  • [SOLVED] Bad Sound Quality, Audacity, playback , via browser

    Playback on the following page is fine:
    https://soundcloud.com/playmerecords/ja … vy-jayne-2
    Original File, downloaded via official channe :
    https://www.dropbox.com/sh/u9683vhoqqn2 … mix%29.mp3
    My sample from Audacity
    https://www.dropbox.com/sh/u9683vhoqqn2 … 20-%20.mp3
    Images of configs and programs:
    https://dl.dropboxusercontent.com/u/3044885/issue1.png
    https://dl.dropboxusercontent.com/u/3044885/issue2.png
    https://dl.dropboxusercontent.com/u/3044885/issue3.png
    https://dl.dropboxusercontent.com/u/3044885/issue4.png
    https://dl.dropboxusercontent.com/u/3044885/issue5.png
    System Info:
    Linux ArchBoxMTD 3.10.7-1-ARCH
    AlsaMixeer v1.0.27.2
    Pulseaudio 4.0
    Audacity 2.0.3 (official package from Arch)
    But, when I record with Audacity, playback (before exporting), is shoddy.  I noticed my dB levels lower than normal when monitoring my audio/recording in Audacity.  Before I remember I had to even LOWER the default dB level of recording in pavucontrol/sound center.  I've done this many times on Arch, and I have had no new hardware.  I have tried changing the output/input device on the main screen in Audacity several times to no effect.  I never had to before.  Now, on Arch I have always had to set the inital dB recording level via sound prefs, not via Audacity as the "Input Volume" slider on Audacity was always grayed out, but never an issue before.
    If you need additional information, please let me know. 
    Thank you
    _professor
    Last edited by degmic71 (2013-08-22 15:58:09)

    ooo wrote:
    first of all, if your pulseaudio setup is working for you there's no reason to break it really..
    historically, the reason for using sound servers like pulseaudio over alsa, is that some sound cards don't support hardware mixing with alsa, which means you coudn't play audio from eg. audacious and youtube at the same time. Nowadays alsa has software mixing support (via dmix plugin if I'm not mistaken) so Its not usually an issue any more.
    I have very limited experience with pulseaudio, and can't be sure of the differences. Generally I believe alsa can do most of the stuff pulseaudio can, but if you've ever looked at configuring alsa, you might know it could be a real pita especially in more advanced setups. From my limited experience with pulseaudio, I think it could be easier to set up on some cases and often just works out of the box. I could also have some audio over network capabilities that alsa might lack, but that again is just my assumption.
    also I'm pretty sure pulseaudio is required for some desktop environments like gnome.
    just use whatever method works for you
    I remember having that EXACT issue back in ~04-06.  That was the most annoying thing, and the reason why I started to use pulse back then.  Oh I know the pitfalls of alsa, which is why I understand pulse co-existing on Arch's cinnamon package setup.  Cool, well thanks for the advice!

  • Sound card has no Mix device. Can alsa simmulate one?

    Hey,
    As the subject says, my sound card
    00:1b.0 Audio device: Intel Corporation 6 Series/C200 Series Chipset Family High Definition Audio Controller (rev 05)
    doesn't have a "Mix" device from which to record "what-you-hear" sound. I've read into the subject, and keep seeing Pulse mentioned. However, I'd like to avoid switching to Pulse, if at all possible. Is alsa capable of creating a "virtual mix device" or some such contraption?

    After spending a whole bunch of time, I was able to create a hardware loopback using ALSA that allows recording all of "what-you-hear".
    Like most modern motherboards, mine also had a "HDA Intel" audio controller, but that's only half the hardware. You should also have a "codec" chip that the HDA Intel chip controls.
    My codec chip is a  Realtek ALC662. So it all started by using some google-fu to download the PDF datasheet for this chip. Looking at the block diagram in that document showed that there were indeed "virtual wires" that connected the audio outputs (play) back to the audio inputs (capture).
    Downloading, compiling, and firing up the "hda-analyzer" program showed that those "virtual wires" simply were not turned on. So I used that same program to "connect" the wires, unmute some of the newly connected nodes, then messed with alsamixer until it all worked.
    The "hda-analyzer" program has a great feature that can create a Python script of the changes you've made. This is super because your changes will disappear on a reboot (unless you jump through even more hoops).
    I found that sometimes if I left the hardware loopback device connected for a somewhat long period of time, a minor "hummmm..." could be heard from my speakers when no music was playing. So I'm totally guessing this is the reason why the ALSA developers don't have this loopback "wired" by default. So I simply created one Python script that turns on the loopback, and then another that turns it off.
    Anyway, it works great, and if you're lucky (your codec chip has virtual "loopback" wires), and you roll up your sleeves and get really, really "dirty" in the ALSA and audio hardware mud, you just may be able to do the same thing on your system.
    Last edited by pigiron (2012-04-17 23:26:45)

  • [Gnome 3] Uses for System Sound Alsa instead of Pulse Audio?!

    If I open "Sound Settings" click on the reiter "Applications" then I see which programs are currently playing sound.
    Because I have installed the freedesktop sound theme I hear some sound if I raise or lower the volume.
    But why does it listen that the gnome-shell uses the alsa-plugin instead of pulse audio directly?!
    Best Regards

    Hmm... well I'm using Gentoo, and I have alsa flag turned on in my instalation of sun-jdk. So I don't know, but as I say, playing buffered sound with SourceDataLine and hardware mixer (not Java Sound Audio Engine) causes the same artifacts at the end of the sound as mplayer using oss. Might as well not be related at all, but then maybe you (or anyone else) can tell me if you can observe the same kind of behaviour while playing sound with java on your machine? I have cheap Realtek High Definition sound card, but it doesn't change the fact that in Windows, the sound plays correctly.
    But thanks for reply :)
    PS. by OSS in this context I mean oss emulation in ALSA.

  • [Solved] ALSA with multiple applications

    I know this issue has been dealt with many times before, but I can't figure out how to conform those fixes to my use case.
    I rebuilt my computer today (old motherboard died). Sound worked fine out of box on the old onboard -- I didn't even have an /etc/asound.conf or ~/.asoundrc -- but on this motherboard I'm encountering the problem with ALSA only allowing one process to output sound.
    lspci -vvv output:
    00:14.2 Audio device: Advanced Micro Devices, Inc. [AMD] FCH Azalia Controller (rev 01)
    Subsystem: Biostar Microtech Int'l Corp Device 8228
    Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- Stepping- SERR- FastB2B- DisINTx-
    Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=slow >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
    Latency: 32, Cache Line Size: 64 bytes
    Interrupt: pin A routed to IRQ 16
    Region 0: Memory at fef40000 (64-bit, non-prefetchable) [size=16K]
    Capabilities: [50] Power Management version 2
    Flags: PMEClk- DSI- D1- D2- AuxCurrent=55mA PME(D0+,D1-,D2-,D3hot+,D3cold+)
    Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
    Kernel driver in use: snd_hda_intel
    Kernel modules: snd_hda_intel
    I have a 5.1 setup on device 1 that works perfectly fine with whatever audio stream has managed to grab the device. I have looked at breb's asoundrc and changed "card 0" to "card 1" but noticed no change at all, and I don't know enough about the structure of the rc to know if there is anything else to change (although I did also replace all "hw:0" with "hw:1" to no avail). In order to get audio working at all I found a post instructing to put the following in my /etc/asound.conf:
    pcm.!default {
    type hw
    card 1
    ctl.!default {
    type hw
    card 1
    I went back to the Arch Wiki and reread the notice: "For ALSA 1.0.9rc2 and higher on analog sound outputs you do not need to setup dmix. Dmix is enabled as default for soundcards which do not support hardware mixing." This is probably what made my last install run without hitches, I am guessing. It then says that if you are still having issues with mixing, to manually add dmix to your asoundrc. So I did that, and my .asoundrc simply looks like:
    pcm.dsp {
    type plug
    slave.pcm "dmix"
    I don't know what to do at this point. The only thought I have is that maybe the dmix only mixes to card 0 (which is my disabled HDMI output) and not card 1 (which is my analog out).
    aplay -l output (like I said, I have HDMI output disabled in BIOS. After I post this I can reboot to re-enable it just in case it makes a difference, but by all means if it does then there has to be some sort of issue there with how either dmix works or with how this sound card deals with its mixing or something).
    **** List of PLAYBACK Hardware Devices ****
    card 1: Generic [HD-Audio Generic], device 0: ALC892 Analog [ALC892 Analog]
    Subdevices: 0/1
    Subdevice #0: subdevice #0
    card 1: Generic [HD-Audio Generic], device 1: ALC892 Digital [ALC892 Digital]
    Subdevices: 1/1
    Subdevice #0: subdevice #0
    Also, for instance, when I have mpd running, and try to open a video in VLC, I get this error:
    Audio output failed:
    The audio device "sysdefault:CARD=Generic" could not be used:
    Device or resource busy.
    and in mpv (I don't know how much of this is relevant. Probably only the bit after "Selected audio codec..." but here's the whole thing:
    The round option must be an integer: 16/9
    Error parsing option round (option parameter could not be parsed)
    Option vf: Error while parsing expand parameter round (16/9)
    Error parsing option vf (option parameter could not be parsed)
    /etc/mpv/mpv.conf:24: setting option vf='expand=::::1:16/9:16' failed.
    Option af-add: pan has only 2 params, so you can't give more than 2 unnamed params.
    Error parsing option af-add (parameter is outside values allowed for option)
    /etc/mpv/mpv.conf:58: setting option af-add='pan=6:1:0:.4:0:.6:2:0:1:0:.4:.6:2' failed.
    Option af-add: pan has only 2 params, so you can't give more than 2 unnamed params.
    Error parsing option af-add (parameter is outside values allowed for option)
    /etc/mpv/mpv.conf:63: setting option af-add='pan=2:0.7:0:0:0.7:0.5:0:0:0.5:0.6:0.6:0:0' failed.
    Playing: /media/Videos/Other/Samsung_Galaxy_Note_3_4K_Video_sample-XgalnuBlSNE.mp4
    Detected file format: QuickTime / MOV (libavformat)
    Clip info:
    major_brand: mp42
    minor_version: 0
    compatible_brands: isommp42
    creation_time: 2013-09-30 13:12:57
    [stream] Video (+) --vid=1 (*) (h264)
    [stream] Audio (+) --aid=1 --alang=und (*) (aac)
    Selected video codec: H.264 / AVC / MPEG-4 AVC / MPEG-4 part 10 [lavc:h264]
    Selected audio codec: AAC (Advanced Audio Coding) [lavc:aac]
    [ao/alsa] Playback open error: Device or resource busy
    [ao] Failed to initialize audio driver 'alsa'
    [ao/oss] Can't open audio device /dev/dsp: No such file or directory
    [ao] Failed to initialize audio driver 'oss'
    Could not open/initialize audio device -> no sound.
    Audio: no audio
    Audio: no audio
    VO: [xv] 3840x2160 => 3840x2160 420p
    V: 00:00:05 / 00:00:38 (12%)
    Last edited by Zopiac (2014-01-28 16:57:49)

    Apparently I knew less than I thought I did about the HDMI out and device numbers. Here's the aplay -l output after re-enabling HDMI out:
    **** List of PLAYBACK Hardware Devices ****
    card 1: HDMI [HDA ATI HDMI], device 3: HDMI 0 [HDMI 0]
    Subdevices: 1/1
    Subdevice #0: subdevice #0
    card 2: Generic [HD-Audio Generic], device 0: ALC892 Analog [ALC892 Analog]
    Subdevices: 1/1
    Subdevice #0: subdevice #0
    card 2: Generic [HD-Audio Generic], device 1: ALC892 Digital [ALC892 Digital]
    Subdevices: 1/1
    Subdevice #0: subdevice #0
    I am currently getting nothing out of my speakers (lsof /dev/snd/* shows no processes using the soundcard even though mpd is "playing" (also ncmpcpp shows "Vol: n/a")). Even after I switched my /etc/asound.conf to "card 2" I get nothing. I am wondering if I needed what I already have in there after all. Maybe I added that and then rebooted, switching off the HDMI out as I did so. I'll check...
    Edit: Nope. As I understand it, in order to have sound at all I need to have HDMI out disabled in BIOS and asound.conf set with the two clauses with "card 1", and I then encounter the singe process ALSA problem.
    Last edited by Zopiac (2014-01-28 02:40:17)

  • No PCM mixer with Creative CA0106

    I recently got a new computer from a friend. I use Arch as usual and everything is brilliant except for the lack of sound. For some reason, I get no PCM mixer and thus no sound. Drivers appears to load, devices appear but still there is no sound. My friend used to run Arch, and he did not have any troubles at all.
    The sound card I have is a Creative Labs CA0106 Soundblaster built in to the motherboard (which is a MSI K8N Diamond MB). No other sound devices are present. I have installed alsa, alsa-oss and alsa-utils. I have not modified the kernel, and I currently run 2.6.32-ARCH.
    In alsamixer, I get a Master mixer and several S/PDIF mixers. Since I don't have any coaxial equipment, I think they are of no help to me. From what I can see, there are devices beginning with pcm in /dev/snd (see link below). Also, the only unmutable channel is unmuted.
    If I run mocp, it shows its internal mixer for PCM, but it's not working. When I run mplayer and try to change the volume, it says "[Mixer] No hardware mixing, inserting volume filter.  2%  2.3% 2 0 49%". Maybe it's worth noting "AO: [oss] 48000Hz 2ch s16le (2 bytes per sample)" there as well.
    I have tried googling and searching these forums for these issues, but nobody seems to have the same problems that I do
    Also, my speakers are working fine with other computers, so they are not an issue.
    lspci, lsmod, /dev/snd, id and pacman -Sq alsa:
    http://pastebin.org/83529
    everything.log: (wgetpaste failed, so I uploaded it to my local server)
    http://daethorian.ninjaloot.se/files/da … ything.log
    Screenshot of alsamixer and mocp: (and me asking IRC)
    http://daethorian.ninjaloot.se/files/da … 130531.png
    Anyone have any idea of what is going wrong? Any suggested solutions might help.
    Thanks in advance.

    Can't help you with your problem, all I can do is to chime in to say I'm in the same boat. I've also tried 'arecorder' to see if I can grab the ALSA output, all to no avail. I have an ALC888 chip. I'm running openbox with ALSA, trying to capture the analog output. Any ideas out there?

  • How to automatically share/mix the audio device?

    I'm using Arch with LXDE on a Core i5. The sound card is an Intel 6 series / C200 controller (just a DMA engine, really.)  Most programs these days seem to use ALSA. This includes some simple programs I write, as well as utilities like "espeak."
    If a program I've written happens to be playing some sound, while I try to use another program (say, "espeak") that also uses ALSA, only the first program works, and the second program errors out. This has all the convenience of using a Sound Blaster under Windows 3.1! :-)
    Surely, there exists some configuration option or package or kernel module I can install to make the system mix any and all programs that use ALSA to play sounds? What am I missing?

    I used to love hardware mixing sound cards ten years ago, but as CPUs get faster, it's gotten to the point where it doesn't matter, and certain things (like echo cancellation supported at the OS level) really require the OS to be in control.
    Regarding re-initializing the device: I don't see why it would take a full second. DMA is fast, codecs are fast. I've written probably ten different sound card drivers in my life, and none has been even close to a second in setup time. However, I'd be perfectly happy if the only cause for going bit perfect is needing to output AC3 to the SPDIF output. For everything else, run the card at 48 (or whatever is preferred) and however many speakers are connected, and convert all the incoming audio. If the card can't detect speakers connected vs not, default to stereo, and let the user configure it if it's wrong. This will make things Just Work (tm)!
    To be clear, a reasonable default behavior might be:
    0) The lowest-numbered sound card is default, if not user-configured differently.
    1) If the default card can detect speakers plugged in, configure itself for that set of speakers. If not, configure itself for stereo, if not user-configured differently.
    2) Set the default playback frequency to 48 kHz if supported, else the highest frequency that's supported, if not user-configured differently.
    3) When applications open the device, just say "yes" to whatever is requested, and do software re-sampling/mixing to the default format, if not user-configured differently.
    4) If applications ask for formats, propose the default playback frequency at the default playback number of channels at floating-point sample format.
    5) Use a 7-tap polyphase filter for resampling if not configured differently; this gives a great quality/performance trade-off using SIMD implementations. (15 years ago, we used a 4-tap Hermite interpolator, which had higher distortion and lower runtime cost on Pentium II, but time has moved on :-)
    6) If a USB audio device or other hotplug device (such as bluetooth) is plugged in, switch to that device, if not user-configured differently. Note that with software mixing, nothing needs to change for applications that are already playing.
    Pulseaudio? That would work, if it actually emulated the device driver interface that most applications actually use to play back sound. And it doesn't *have* to be a user-level process; doing mixing/converting in kernel space is perfectly fine assuming we have decent real-time support now. We don't even need to have interrupts disabled while doing it. Double buffers of 512 samples would be plenty for most cases and still have sufficiently low latency to not annoy game players or movie watchers.
    Alternatively, the problem is that Linux applications still use the ALSA audio API rather than PulseAudio. But, given that that's the case, there are totally possible solutions that would make life a lot better on average, and no worse in the corner cases.
    This is not rocket science -- it's technology that should have existed 15 years ago, and the fact that the Linux community at large hasn't bothered to solve it is a symptom of an attitude that's a barrier to meaningful desktop Linux adoption in the mainstream. And I'm saying this with love :-)
    Is there a shim /dev/audio driver which can re-mix/re-route audio to a real hardware device, based on that device's capabilities? Or would the right dmix setting for alsa actually be able to accomplish this? (I imagine such a dmix wouldn't be able to adapt to things like detecting plugged in speakers/headphones, though)
    Last edited by jwatte (2013-03-28 00:45:36)

  • No Sound on Speakers w/ ALSA [Solved]

    Hello Everyone,
    So I have Arch x86_64 on my Gateway 6860FX and sound on my headphones works perfectly but I can't get any sound on the built in speakers.
    Here's the output of my lsmod|grep '^snd'
    snd_usb_audio         100672  0
    snd_usb_lib            19968  1 snd_usb_audio
    snd_rawmidi            25248  1 snd_usb_lib
    snd_seq_dummy           5380  0
    snd_seq_oss            33792  0
    snd_seq_midi_event      9344  1 snd_seq_oss
    snd_seq                58912  5 snd_seq_dummy,snd_seq_oss,snd_seq_midi_event
    snd_seq_device          9620  4 snd_rawmidi,snd_seq_dummy,snd_seq_oss,snd_seq
    snd_hda_codec_idt      70144  1
    snd_hda_intel          31112  5
    snd_hda_codec          70272  2 snd_hda_codec_idt,snd_hda_intel
    snd_hwdep              10760  2 snd_usb_audio,snd_hda_codec
    snd_pcm_oss            45600  0
    snd_pcm                83080  5 snd_usb_audio,snd_hda_intel,snd_hda_codec,snd_pcm_oss
    snd_timer              24848  3 snd_seq,snd_pcm
    snd_page_alloc         11920  2 snd_hda_intel,snd_pcm
    snd_mixer_oss          18816  1 snd_pcm_oss
    snd                    68296  23 snd_usb_audio,snd_usb_lib,snd_rawmidi,snd_seq_dummy,snd_seq_oss,snd_seq,snd_seq_device,snd_hda_codec_idt,snd_hda_intel,snd_hda_codec,snd_hwdep,snd_pcm_oss,snd_pcm,snd_timer,snd_mixer_oss
    And a ls -l /dev/snd
    crw-rw---- 1 root audio 116,  0 2009-02-16 00:52 controlC0
    crw-rw---- 1 root audio 116,  5 2009-02-16 00:52 hwC0D1
    crw-rw---- 1 root audio 116,  6 2009-02-16 00:52 hwC0D2
    crw-rw---- 1 root audio 116, 24 2009-02-16 00:52 pcmC0D0c
    crw-rw---- 1 root audio 116, 16 2009-02-16 00:54 pcmC0D0p
    crw-rw---- 1 root audio 116, 17 2009-02-16 00:52 pcmC0D1p
    crw-rw---- 1 root audio 116,  1 2009-02-16 00:52 seq
    crw-rw---- 1 root audio 116, 33 2009-02-16 00:52 timer
    I have tried the following fixes so far but they don't seem to work:
    Recompiling ALSA from source
    No Sound with Onboard Intel Sound Card - http://wiki.archlinux.org/index.php/ALSA
    Last edited by treefiddy (2009-05-06 20:04:07)

    OMFG you are awesome, who would've even tried that!!!!
    Thank you!
    this information is literally nowhere else in the entire interwebs!!
    I was going insane, I also have a Gateway P-6860FX running THE best linux distro out there, Archlinux of course!
    I had it partially working with:
    options snd_hda_intel model=notebook
    which I got from http://help.ubuntu.com/community/SoundTroubleshooting
    but my speakers never worked until I found your post, so I was using a craptastic USB soundcard I found in my garage.
    While I'm at it lemme post my ".asoundrc" which took me about a week of research to construct.
      I had to do it this way because if I played ANY sound through any program while firefox was open on a page containing flash, all of the sound system was completely lost and mute until I restarted Firefox and/or the X session. Meaning no amarok while on the net if I planned on seeing any flash videos during my entire surfing session.
    This configuration should work with ANY sound card that lacks a hardware mixer and uses dmix with the following effects:
    1. OSS, AOSS and ALSA sound apps/games can share audio output without distortion
    2. A new virtual soundcard called "My Soundcard with extra Volume Control" will show up under kde4 that feeds into the software mixer
    3. A new volume control will show up in all your alsamixer apps that allows you to control the volume of all ALSA apps, OSS apps, while still mixed are only affected by the master volume.
    ~/.asoundrc
    #/etc/asound.conf start:
    #pcm.!default pcm.softvolPhonon
    pcm.!default {
    type plug
    slave.pcm "softvolPhonon"
    #list card for phonon
    pcm.softvolPhonon {
    type softvol
    slave.pcm "dmixer"
    control {
    name "Phonon"
    card 0
    min_dB -51.0
    max_dB 0.0
    resolution 100
    hint {
    show on
    description "My Soundcard with extra Volume Control"
    #endofphonon
    pcm.dsp0 {
    type plug
    slave.pcm "softvolPhonon"
    pcm.dmixer {
    type dmix
    ipc_key 1024
    slave {
    pcm "hw:0,0"
    period_time 0
    period_size 1024
    buffer_size 8192
    rate 48000 #many new cards are 48000 only
    bindings {
    0 0
    1 1
    ctl.dmixer {
    type hw
    card 0
    device 0
    #end.
    if you have more than one sound card and want to use the second, just change "hw:0,0" part to "hw:1,0" and "card 0" to "card 1", this has the affect of changing the default sound card systemwide, without having to mess with each program's settings.

  • Soundmixer - easy sound mixing.

    bored for five minutes and had an idea - package up all my sound configs, cause they might work for others. these configs provide sound mixing out of the box betwen alsa, oss and esd, using dmix. And it can't possibly get any easier than installing something with pacman.
    Just makepkg, pacman -U, and relog. You may need to restart any daemons that use sound to ensure they get the aoss profile change.
    http://aur.archlinux.org/packages.php?d … =1&ID=7262
    gives me working sound mixing in alsa and oss applications out of the box on my two computers.
    tested using savage + alsa apps, and realplayer and alsa apps. I'm sure this same config has worked in the past with ET, which implies it should work with most games. Also includes esd support, so if an application is problematic with alsa or oss, it ought to work perfectly on esd which pipes it through to alsa.
    aquila deus has been saying that dmix drops sound quality. With the default config, I did have some problems, was a bit choppy, though that was fixed with a slight increase in the buffer. I havnt noticed any delay due to the slightly larger buffer either, and no noticable quality problems. But different hardware and such, I can't guarantee results, and frankly, have no idea how well this will work for others - ALSA can be funny sometimes.
    so lemme know how this goes for you.
    James

    aquila_deus wrote:
    iphitus wrote:
    aquila_deus wrote:But the quality is still reduced (see their docs), whether you can hear or not
    and for most users, that's completely irrelevant. as long as its an inaudible drop -- it doesnt matter. if you're an audiophile, then you have different needs - dont push them on the majority, and if you do, you can make a package that sets everything up as simply as this does.
    You could try it with onboard cards with headphones
    There is a quite simple solution: ALSA should do mixing inside the kernel, rather than using extern lib which needs a lot of hacks to work (and certainly harder to code, how did they come up with the crazy idea in first place??), and does *normal* resampling and mixing just like jackd.
    heh, I dont see any hacks to work in this setup. all alsa apps work sweet, and there's a workaround for older OSS apps which have yet to be converted.
    alsa's not going away mate, its just growing stronger, so your complaints are falling on deaf ears. oss apps will be less and less, and in turn, oss2jack will be the one using crazy hacks.
    and uh, alsa does do the mixing in the kernel, and jackd certainly doesnt. so... not sure where you got that from.
    James

Maybe you are looking for