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)

Similar Messages

  • TS3999 How do I share calendars on various devices on the same iCloud account?

    How do I share calendars on various devices on the same iCloud account?

    You don't need to share, as long as correctly set up they will sync by default.
    Here is set up process depending of device type.
    Apple - iCloud - Learn how to set up iCloud on all your devices.

  • ERROR The Audio Device supported by this application is not detected. the application will ex

    Sound is fine but I get error message every time I try to start any of the creative applications that come in mediasource like the graphic eq, speaker settings, surround mixer, EAX and THX consoles; the error: The Audio Device supported by this application is not detected. The application will exit.
    I have read the forum notes on this error message and seems other have had this same issue, but I don't see any solutions...if anyone knows anything about solving this little mystery, please reply - need to get into that console to fully utilize this sound card.

    AFTER AUTOUPDATE this problem began. I removed the audigy package and reinstalled everything from the factory CD and still get this message. This happens every time I update the audigy drivers and thx. I am tired of doing recoveries to get audigy to work. Too bad I keep forgetting that the updates cause this problem. Audigy Platinum 2 works fine wothout the update. I will never update again!
    How can I resolve this problem short of a full recovery?

  • How can I find out the audio sampling rate of BetacamSP tape?

    Hi guys
    I'm trying to digitize BetacamSP tape. But I'm afraid if I might choose wrong setting...
    This tape is from very long time ago so we don't know which audio sampling rate we recorded with..
    How can I find out the audio sampling rate of this BetacamSP tape?
    Thanks:)

    The sampling rate is set by the Sony DVMCDA2 you are using, when the conversion is made from the analog input to the digital (DV) output. You should be outputting standard DV which is 16bit 48khz audio.
    Assuming you are in the US, your Easy Setup for FCP should be DV-NTSC, and then open the Log and Capture Pane and set the Capture Settings Device Control to Non-Controlable Device and you should be good to go.
    You will have to roll the deck manually and start and end your capture manually.
    You can download a user manual for the DVMCDA2 by clicking here.
    MtD

  • How do I share / unlink  the right and left channel, so I can work with them individually ?

    I use "Adobe Sound Booster CS5"
    I have a stereo soundtrack, which I only want to remove noise in only one channel (right).
    How do I share / unlink the right and left channel, so I can work with them individually ?

    When Soundbooth was first developed, it had a few extra things than what were not available in Audition. However, Audition remained the more high end sound editing tool. Soundbooth was locked to a multiple channel editing approach. In Audition, single editing is easy - you simply click the L or R at the right end of the sound channel to lock it and then you can edit the other channel only.
    Soundbooth has been discontinued and Audition now has taken its place from CS6 to the Creative Cloud.
    The above is some background info. To your current situation, you can use a workaround like:
    * Export your audio file to separate channels by File > Export > Channels to mono files.
    You will get 2 files with _L and _R suffix.
    You can then edit them separately. You can go from Mono to Stereo by the following step.
    Or
    * Choose - Edit > Insert > Channels  into New Multitrack file.
    That will separate the Left and Right Channels and add them to a new multitrack file.
    You can then click the Edit link at the top right of the channel to edit it.
    You can then save that file as a new audio file.
    Dean

  • How should i share file with other devices such as nokia,blackberry and etc using bluetooth

    I want to share  files between other deivce such as nokia but couldnt, could u help me tell how can i share files with other devices???

    @AKRBTN: Thanks for the reply and info.
    That is a solution, but it really isn't viable.
    It is sad that apple refuses to support this.
    A simple example: Sitting somewhere with no signal and you want to share a file (photo) with your colleague or friend, who happens to be right next to you.
    Or even if there is signal and you don't want to be paying fees or data charges.
    Or you may be in a rehearsal studio and need to share that very important file and have no time to go outside and get signal and try to send the file, which then everyone else has to go outside and catch the signal and pay fees.
    Anyway, I see that this is a dead end with apple, so I guess I will be back to carrying 2 phones around again.
    Peace,
    SB

  • My MBP is not recognising the audio device and won't complete a time machine backup, what might it be?

    I have a MBP thats about 18months old. First indicator was the audio device intermittantly being recognised ( the speaker icon on the status bar goes grey, nothing with sound works, then it comes good again). Thought little of it, till I noticed the backlighting of my keyboard also failed at the same time as the Speaker icon was grey.
    Then lately, it wont do a complete time machine back up, either via airport or usb.
    Its starting to sound like i have a "serious" issue, any one with clues where to start?

    reset your PRAM http://support.apple.com/kb/ht1379
    let us know how it goes.

  • "The Audio device supported by this application..

    I Have a X-Fi Extreme Gamer PC Using Win Vista. When I click on "Creative Audio Control Panel" to open it to change modes
    it now says this.. "The Audio device supported by this application is not detected. The Application will exit."
    Everything has been redone to try and solve this. Drivers have been redone, and even took the card out and put back in.
    Device Manager shows SB X-fi workingCard works fine cause I booted up into WinXP and it all works fine.
    Can anyone help?

    This has been fixed by downloading and installing SB X-Fi Series Support Pack .0 (0/3/2009) a few threads under this one. In case anyone else has this problem thats how its fixed at the moment.
    Here is of the sites?
    http://www.megaupload.com/?d=Q3PTPG60Message Edited by Tokarga on 0-22-2009 0:26 AM

  • How can I extract only the audio as an aiff file?

    Using a Sony DSC-N2 Cybershot Camera I recorded video that was saved as “MOV01606.MPG”. The video plays back with sound in Quicktime Pro and iTunes but how can I extract only the audio as an aiff file?

    Use MPEG Streamclip (free) to convert your .mpg files to QuickTime formats.
    QuickTime can't extract audio from muxed file formats.

  • How do I share in the music and apps that my children have purchased, but maintain my own identity?

    How do I share in the music and apps that my children have purchased, but maintain my own identity?

    You don't. Everythng downloaded with one Apple ID can not be transfered to another Apple ID. So you would need to buy it a second time. This is one of the Pit Falls of the whole Download only model.
    That is why I refuse to buy things like music or movies that are tied to a specific User Name, ID.

  • HT5232 does ipad mini have a usb port? if not then how can i share my documents with devices other than apple?

    does ipad mini have a usb port? if not then how can i share my documents with devices other than apple?

    Wireless Flash Drive (tap to enlarge image)

  • I made a video of our summer vacation on imovie. It's over an hour long. When I try to share it, the audio syncs incorrectly at about the 15 minute mark and is off for the rest of the movie. Is there a way to fix this? I think I have imovie 09.

    I made a video of our summer vacation on imovie. It's over an hour long. When I try to share it, the audio syncs incorrectly at about the 15 minute mark and is off for the rest of the movie. Is there a way to fix this? I think I have imovie 09 with all the availbable updates.

    If you think getting your web pages to appear OK in all the major browsers is tricky then dealing with email clients is way worse. There are so many of them.
    If you want to bulk email yourself, there are apps for it and their templates will work in most cases...
    http://www.iwebformusicians.com/Website-Email-Marketing/EBlast.html
    This one will create the form, database and send out the emails...
    http://www.iwebformusicians.com/Website-Email-Marketing/MailShoot.html
    The alternative is to use a marketing service if your business can justify the cost. Their templates are tested in all the common email clients...
    http://www.iwebformusicians.com/Website-Email-Marketing/Email-Marketing-Service. html
    "I may receive some form of compensation, financial or otherwise, from my recommendation or link."

  • My IPad has been stolen and I was trying to track it on 'find my ipad' but the thief kept it offline. I just saw him change my user id. Any recommendations on how I can keep tracking the stolen device?

    My IPad has been stolen and I was trying to track it on 'find my ipad' but the thief kept it offline. I just saw him change my user id. Any recommendations on how I can keep tracking the stolen device?

    Yes, I filed police report, but there is nothing they can do until I get back to them on the tracking. It's been offline. I'm sure the whoever took it can find a way around breaking in the ipad..i really was hoping to get my pictures and videos of my kids back

  • Sound is missing after start-up, disable/re-enable of the audio device required

    Hi,
    I have a MSI K8N Diamond with onboard Creative Live 24! sound.
    Since last weeks I have a strange problem with the sound; when I start-up the PC after some hours of inactivity, I have no sound at all. I tried to see what's happening or to find a workaround and I discovered that I can get the sound back by disabling the audio device from the control panel, restarting the PC and then re-enabling the device.
    To explain the phrase "I have no sound" I can say the following: when I go to the control panel and open "Sounds and Audio devices", everything seems OK. But when I try to test for example the sound that will be used for the "Asterisk" (or whatever else), the small back triangle next to the sound name turns to a black square (normal) AND REMAINS BLACK SQUARE FOR EVER... (while normally it should turn again into a triangle within some seconds).
    I re-installed XP and all the updates from Microsoft, but the problem is still there. I checked the "event viewer" but there is nothing relevant. I also tested both the original drivers from my CD and the newer ones from the MSI site.
    Do you think this could be a hardware problem? An IRQ conflict probably? (I've seen that Creative uses the same IRQ with Sil3132). Any other ideas?
    Thank you,
    Petros

    So you reckon it to be a hardware issue... 
    OK, I'll open the case in the afternoon and have a good look inside. It's true that recently I did some work (added memory, changed a HD) so probably it deserves some time to see again if everything is in tact inside. 

  • How do I use 2 Core Audio devices at the same time in Logic w/out switching

    Hello, I use the Aardvark Direct Mix usb3 as my audio interface for mic and guitar. I just upgraded to Logic Pro 7 today and was hoping someone could tell me how I could use the Built-in Audio Core Audio driver along with the Direct Mix USB Core Audio Driver at the same time without having to switch Core Audio Driver's and than rebooting Logic. It is very frustrating doing that as well as not being able to hear my Logic audio during playback/record mode when I am trying to record via the USB3. WHat can I do? Thanks! If ther are both core audio, why can I not just use both of them at the same time? Why must a switch back and forth? Thanks!
    [email protected]

    THanks everyone! awsome article! Thanks for posting it, nh!
    The weird thing is, once I go up to the Menu and select Open Aggregate Device Editor in the AUDIO/MIDI setup utility and try to add a new Aggregate Device setup (step # 6 from the link), the only audio device available is the "Built-in Audio". What's weird is when I have the main Audio MIDI Setup utility open, every single drop-down menu/tab has the "Direct Mix USB 3 1.0.9.1" device right beneath the "Built-in Audio" option. To me that says that the core audio device is indeed recognized by my computer (obviously since I can record with it using Logic). Can anyone help me with this one? Any suggestions?
    Not that it should matter but, the hardware audio interface that I am using is made by the no-longer-existant company once known as Aardvark. I actually had to purchase a third party Core Audio driver just to have it recognized by OS X.
    This is the website where I purchased my audio driver :
    http://www.usb-audio.com/
    A little more on how this device and it's core audio driver function within Logic . . . (Hopefully this might clarify something I may be screwing up) . . .
    I launch Logic with its default Built-in Audio which allows playback of audio from the app. I than go up to Audio Hardware and Drivers and than drop the flip down Driver menu down to the second option, "Direct Mix USB 3 1.0.9.1." Logic than prompts me that I should try to (re)launch Logic Pro to load the appropriate CoreAudio.. I do that. Now I am ready to record guitar through the Direct Mix USB3, I just can't hear anything (unless I use head phones as an output from the Direct Mix).
    Anyway, you all probably already knew what I meant so explaining that was pointless. But my question is, if the Driver is obviously recognized by my comp in both the Audio MIDI Setup and in Logic, than why won't the Direct Mix device show up as a possibility for setting up an aggregate device? Any suggestions? Thanks!
    Power Mac G5 Dual 2.7Ghz 4.5gigs of RAM   Mac OS X (10.4.7)  
    Power Mac G5 Dual 2.7Ghz 2.5gigs of RAM   Mac OS X (10.4)  

Maybe you are looking for

  • My Firefox keeps freezing when i watch videos, telling me "firefox has stopped working"

    It also says something about firefox pluggins not working. It doesn't crash, just 'stops working' and I have to close it with the task manager. It has only happened when I am watching a video so far. 10 minutes after posting this it 'stopped working'

  • Does it mean.....IDOC - XI - File

    Hi Experts, I am very new to XI.. for IDOC to File If IDOC resides at R/3 side then you don't require sender communication channel and sender agreement. Because it resides at Integration Engine. What does it mean? My doubt is here if, File to IDOC th

  • Gallery Paging Issues

    We created a gallery using Adobe's Spry library, but the page between the images isn't working correctly. We've made similiar galleries in the past with paging, but with thumbnails and they worked well. I'm pretty sure we made a mistake with our cust

  • Oracle BPM directory database

    Hi, IHAC that has a custom application to manage their users and roles. They are using Oracle BPM and they want to keep creating, managing and authenticating user with that application, that is not a LDAP. How can I syncronize the creation/updating/d

  • After effects cs5.5 install problems

    I am experiencing 'error(-1)' when installing a trial version of after effects cs5.5, any help? The install does not start, it says it is calculating the time and then says I experienced errors and displays the above error message. I am running on a