[SOLVED] ALSA multiple audio source playback

I noticed that by default alsa doesn't allow for playing from two or more sources simultaneously. For instance playing a youtube video while already playing music from mpd will result in having only sound from mpd. How can I enable playback of multiple audio sources in alsa? Thanks
Last edited by hesse (2012-07-13 22:24:29)

I put this in /etc/asound.conf
pcm.dsp {
type plug
slave.pcm "dmix"
and left the settings in mpd.conf like this:
audio_output {
type "alsa"
name "ALSA Device"
The mixing now works with multiple audio sources! Thank you.

Similar Messages

  • HT202000 Is there a way to have multiple audio sources sent to multiple outputs (i.e. communications with skype sent to headset, music sent to speakers )

    Is there a way to have multiple audio sources sent to multiple outputs (i.e. communications with skype sent to headset, music sent to speakers ) I do this on my Windows but cannot find for mac.  I am transitioning from Windows brain to Mac brain and having a little difficulty
    OS Yosemite

    Is there a way to have multiple audio sources sent to multiple outputs (i.e. communications with skype sent to headset, music sent to speakers ) I do this on my Windows but cannot find for mac.  I am transitioning from Windows brain to Mac brain and having a little difficulty
    OS Yosemite

  • Multiple audio sources for quicktime movie recording

    I want to record a Quicktime movie using iSight as the video input, external audio (guitar) via a Focusrite Saffire LE (1874) audio interface and internal audio (a backing track) from either iTunes, Logic 9 or MainStage 2 (I don't care which), so I can record myself playing and then send the video to another guitarist via Dropbox or similar.  Is this possible and if so how do I set it up on my iMac?
    Thanks.

    QuickTime Player Pro, QuickTime X (Snow Leopard) and QuickTime 10.1 (Lion) all include a "New Movie Recording" feature. The camera can be the internal iSight or an externaly connected one and the audio can be internal or line in.
    But you can only have one video and one audio source.
    QuickTime Player Pro can be used to add additional "tracks" and the .mov container can have up to 99 of them. GarageBand can help you edit the track timing. It also includes other "instuments" and can play your video while you build additional tracks.
    I would record via iSight but not include any audio. Then use GarageBand to add the additional audio tracks.

  • [SOLVED] Single audio source (can't play multiple audio sources)

    Hi,
    I have  been having this problem in my arch laptop for a long time until I decided to put an end to it. I am using Gnome 3 and pulseaudio, and whenever an app "grabs" the audio, it won't release it, meaning no other apps can play sound. Even when one firefox tab grabs the audio (for instance, Gtalk notifications, youtube videos...) no other tabs can play it. I can avoid the problem if I reload the tab, or close the app.
    Is it a weird problem? Is it related to pulseaudio? I haven't found information related to this.
    Thank you.
    Last edited by Hiperi0n (2011-10-02 22:39:30)

    Thanks, problem solved at last
    I wrote in that other topic: https://bbs.archlinux.org/viewtopic.php … 81#p998281

  • Upon startup multiple audio sources begin playing. I can't find the tab to kill them!

    Having pages begin streaming audio upon startup AND not being able to find out where audio is coming from is frustrating almost beyond words ... it is hard for me to imagine this wasn't addressed with the first "tabbed" version. Sometimes I'm almost tempted to see if another brower has this handled. PLEASE FIX IT OR LET ME KNOW OF AN ADD-ON TO ADDRESS THIS. If the latter, I suggest you co-opt that feature into the next major release. AWOL sound is maddening. 3 youtubes + 5 podcasts + lastfm should NOT be playing at the same time BY DEFAULT just because the tabs were open on last shutdown. Further, I suggest *ANY* source of audio should easily found and jumped to to kill or mute.

    If pages have embedded audio, it is not always easy to stop it. I have a bookmarklet that allows me to stop embedded audio if I click it on the page in question. If you are having Firefox open with the tabs from the last session and several of those pages have embedded sound, either turn them all off one by one or do not save a session with embedded sound in the pages. The bookmarklet is this:
    javascript:(function(){function%20R(w){try{var%20d=w.document,j,i,t,T,N,b,r=1,C;for(j=0;t=["embed","iframe"][j];++j){T=d.getElementsByTagName(t);for(i=T.length-1;(i+1)&&(N=T[i]);--i)if(j!=3||!R((C=N.contentWindow)?C:N.contentDocument.defaultView)){b=d.createElement("div");b.style.width=N.width;%20b.style.height=N.height;b.innerHTML="<del>"+(j==3?"third-party%20"+t:t)+"</del>";N.parentNode.replaceChild(b,N);}}}catch(E){r=0}return%20r}R(self);var%20i,x;for(i=0;x=frames[i];++i)R(x)})()
    Add a new bookmark, copy that code to the location, and name it "No music or iframes".

  • [Solved] ALSA - Play Audio As Is With No Conversion

    Hello all,
    I have an issue with ALSA I hope you can help me sort out.
    For the sake of this post, I'll refer to everything as if played by mplayer2, since the output is much easier this way.
    Basically, I want to play everything "as-is", in regards to samplerate and format.
    That is, playing music at 16bit/44.1Khz as such, playing movie audio at 16bit/48Khz as such, playing HD audio at 24bit/96Khz as such and so on.
    Now, my first attempt was trying to access the HW directly using mplayer's --ao=alsa:device=hw=0.0 and not limiting the format.
    Both samples played at correct sample rate but were outputted at 16 bit, since the hardware supposedly do not support floating point, and the output reverted to default.
    Selected audio codec: FLAC (Free Lossless Audio Codec) [libavcodec]
    AUDIO: 44100 Hz, 2 ch, s16le, 0.0 kbit/0.00% (ratio: 0->176400)
    [AO_ALSA] Format floatle is not supported by hardware, trying default.
    AO: [alsa] 44100Hz 2ch s16le (2 bytes per sample)
    Selected audio codec: Uncompressed PCM [pcm]
    AUDIO: 96000 Hz, 2 ch, s24be, 4608.0 kbit/100.00% (ratio: 576000->576000)
    [AO_ALSA] Format floatle is not supported by hardware, trying default.
    AO: [alsa] 96000Hz 2ch s16le (2 bytes per sample)
    Note the Format floatle is not supported by hardware part.
    This seemed a bit weird as using alsa without accessing the hardware directly (going through vmix), the output is indeed floating point.
    That is, playing with --ao=alsa I get the following (obviously everything is sampled to the default 48Khz):
    Selected audio codec: FLAC (Free Lossless Audio Codec) [libavcodec]
    AUDIO: 44100 Hz, 2 ch, s16le, 0.0 kbit/0.00% (ratio: 0->176400)
    AO: [alsa] 48000Hz 2ch floatle (4 bytes per sample)
    Selected audio codec: Uncompressed PCM [pcm]
    AUDIO: 96000 Hz, 2 ch, s24be, 4608.0 kbit/100.00% (ratio: 576000->576000)
    AO: [alsa] 48000Hz 2ch floatle (4 bytes per sample)
    Note that the output format is floatle.
    So, I tried specifying --ao=alsa:device=hw=0.0 --format=floatle, only for it to fail as in the first case and reverting to default 16 bit and correct sample rate.
    Specifying the required format directly works for the flac sample (s16le, same as the default) but fails for the HD sample (s24be), as expected - I can remember from my Windows days not so long ago I had to output 24 bit audio padded as 32 bit for it to work.
    This lead me to my next attempt: --ao=alsa:device=hw=0.0 --format=s32le, which as far as I understand is 32 bit, but not floating point, which isn't exactly what I need.
    Anyway, both files played fine with this mode for the few seconds I tried (assuming the remaining bits were padded with zeros), but real-life files (such as movie soundtrack) produced noticeable audio distortions (cracks and pops of all kinds).
    So, I'm back to where I began.
    Seems like I need to specify the hardware (device=..._) to get correct sample rate, but then I can't get correct format, or let it go via dmix and then the sample rate is wrong.
    Now, having giving it a bit more thought, I realized dmix is outputting anything successfully as floating point, so I guess it pads whatever bits needed with zeros, which is just fine.
    Assuming the above is correct, is it possible to write something in my .asoundrc file so that input samplerate is preserved?
    I'm not very optimistic as it kind of against the whole idea of software mixing, but who knows..
    If there's any way of convincing ALSA that my card is perfectly fine when being fed with floating point directly (device=...), that's an option too.
    Bottom line, is there a way to make everything sent to card as-is?
    That was long... sorry
    Thanks, Adam.
    Last edited by adam777 (2012-10-03 07:45:17)

    adam777 wrote:
    Hello all,
    I have an issue with ALSA I hope you can help me sort out.
    For the sake of this post, I'll refer to everything as if played by mplayer2, since the output is much easier this way.
    Basically, I want to play everything "as-is", in regards to samplerate and format.
    That is, playing music at 16bit/44.1Khz as such, playing movie audio at 16bit/48Khz as such, playing HD audio at 24bit/96Khz as such and so on.
    Sounds reasonable...
    adam777 wrote:
    Now, my first attempt was trying to access the HW directly using mplayer's --ao=alsa:device=hw=0.0 and not limiting the format.
    Both samples played at correct sample rate but were outputted at 16 bit, since the hardware supposedly do not support floating point, and the output reverted to default.
    Note the Format floatle is not supported by hardware part.
    This seemed a bit weird as using alsa without accessing the hardware directly (going through vmix), the output is indeed floating point.
    So yes, your hardware doesn't support floating point. Don't compare the hw device to the more higher level interfaces (default,surround,plughw). The higher level interfaces provide additional sample formats which will be converted on the fly to the specific hw device capabilities.
    adam777 wrote:Bottom line, is there a way to make everything sent to card as-is?
    That would depend on the input format. Even some 24bit audio files may need some additional padding. If you want to know what your card supports, compile and run the following program: http://www.volkerschatz.com/noise/alsacap.c.
    For example, this the output on my machine:
    Card 0, ID `Intel', name `HDA Intel'
    Device 0, ID `ALC268 Analog', name `ALC268 Analog', 1 subdevices (1 available)
    2 channels, sampling rate 44100..192000 Hz
    Sample formats: S16_LE, S32_LE
    Subdevice 0, name `subdevice #0'
    Last edited by GogglesGuy (2012-10-02 03:09:43)

  • Multiple audio sources but only the main one appears.

    Okay so I am doing games commentary and have recorded videos that feature in-game sound and also my commentary from a mic. When I play the videos I can hear myself but m commentary doesn't appear when I have the clips ready for editing in Adobe Premiere Elements 11... Please help!

    mclaren
    Premiere Elements 11 on what computer operating system.
    When you import a file into Premiere Elements, it presents in the workspace as your video (Video Track 1) linked to audio which should be a composite
    of the file's audio (audio 1). The audio should enter as composite and exports as a composite.
    Does the camera generate 3 separate files, video only, in-game sound only, and mic sound only?
    There may be an easy solution involving an "extract audio stream" in Windows Explorer". The following video tutorial was
    done with a version of Premiere, but the Windows Explorer principle is what I want you to explore for your purposes.
    https://www.youtube.com/watch?v=XUDJD0hDlLI
    Please see if any of that extract audio stream principle can be applied to your situation.
    Looking forward to your results.
    ATR

  • Mixing Audio Sources

    Good Day;
    I'm trying to mix multiple audio sources being broadcast to a server. Once they are mixed I'm sending them back to each destination. Thus far I have had no luck getting this task to completed. If someone can point me in the write direction that would be great.
    Thanks
    Later.. and have a good one..
    Todd Stevenson

    No solution found yet
    Search this forum before asking.
    Some questions like that but no usefull answers.
    Although that I say again: you can mix it into file, but I failed to do the same with RTP.

  • Multiple audio playback devices

    I have just built a system using the K7N2-L mainboard and am having a problem with multiple audio playback devices.
    Actually I have TWO problems, which are probably unrelated.
    I have a 5.1 speaker system connected to the onboard audio and an external USB DAC for playback through a hi-fi system.  
    The first problem is that the USB audio device is only recognised if it's plugged in after the system is booted.  If it's already attached when I power up, it appears not to be properly installed.
    The second problem is that when I use the Sounds and Multimedia control panel to switch audio devices (Windows 2000 pro) playback continues through whichever device was used first.  In order to switch, I have to reboot the computer.
    Another system I built using an Epox nforce board does not have this second problem, although it does have the first.  With the Epox board, I can even play through both devices simultaneously.

    I gathered this from the handbrake side of things:
    You can also combine Pro Logic II and AC3 pass-through. This will give you a file that will play anywhere from QuickTime to VLC to the iPhone (using the AAC Pro Logic II track) and play in true surround sound on an AppleTV or in Perian. It is the best of both worlds, and it is only possible in the .mp4 and .mkv containers. Again, MP4 file names must, confusingly, end in .m4v for QuickTimeto read them. To use this hybrid format, in the Audio tab, set the first audio track to be the track you want, in AAC sound. Then set the second track to also use the same source track, and select AC3 pass-through."
    I think this is what will ultimately help me. I will let you know.
    the answer was righ under my nose.
    Thank you!

  • [Solved] No more than one audio source at a time.

    I used alsa, now I'm using pulseaudio. The exact problem and all errors persist regardless of that.
    If any program uses audio, even if it isn't at the moment doing that, I can't use other audio sources. For example, speaker-test says "Playback open error: -16,Device or resource busy" when another program that uses audio is running.
    When vbox is running, without immediately playing any sound, I also have this problem. But I avoided it lately by setting "Null audio driver" in vbox settings so that I can listen to music while working in windows. Even when speaker-test is running, mpd, youtube, skype, vbox, can't play any sound.
    Something maybe worth noting is that I recently had this problem resolved: https://bbs.archlinux.org/viewtopic.php?id=184314 . I don't know if I did some changes back then which are important for this problem.
    Thanks.
    Last edited by Ploppz (2014-08-23 17:48:07)

    Did you install pulseaudio-alsa package? You would need to disable ~/.asoundrc or any other configuration overwriting the redirection of alsa to pulseaudio. Does virtual box work with pulseaudio?
    Did you switch to pulseaudio, because of skype?

  • No sound when switching audio sources after 12.1.1.4 update. Requires iTunes restart every time.

    System Details:
    Windows 8.1 pro - 64 bit
    i5-3320M @2.6GHz
    12GB Ram
    Lenovo Thinkpad Edge E430
    Issue:
    Before the 12.1.1.4 iTunes update I could simply turn on my bluetooth speaker or headphones and both Windows and iTunes would automatically switch to that audio source, even mid-song. I could turn the speakers on and off multiple times and the sound would almost instantaneously switch between sources without fail. Now I have to restart iTunes to hear music after turning on my bluetooth speakers or headphones. Itunes simply stops playing music, although the pause button does not revert to the play symbol, but the track progress indicator stops moving. 
    Please help!
    Thanks.

    Make sure you have the latest version of QuickTime (7.6.6) installed - if this is missing or out of date there may be no audio output from iTunes (including, but not limited to, playback through Bluetooth devices) or playback may be of poor quality.
    Also check iTunes' Play Audio Using setting in Edit > Preferences > Playback (you will have to restart iTunes for any changes to take effect).  In most cases selecting Direct Sound addresses playback issues when Windows Audio Session is active (though some users have reported the reverse),
    If neither of these solves your problem try installing this alternate version: iTunes 12.1.1 for Windows (64-bit — for older video cards).  The "for older video cards" label is a little misleading, as this also fixes some playback issues, QuickTime and Outlook interoperability errors, and problems with other third-party applications.

  • Multiple Audio Lines

    hi all,
    Are there any open source projects out there that will show us ways to implement multiple audio lines and allow manipulation of each audio line seperately? e.g volume, pan etc??
    Is anyone working on a project that they would post??
    I have been working on a project which has 8 tracks, i have it playing the 8 tracks of audio but i am simply calling the same play function 8 times with a different file name each time. I use the play method described in the JavaAlmanac.
    If anyone has a project in development or otherwise, i would be very grateful if they would be able to post it here!! I'm sure it will be of benefit to them aswell as everyone else.
    cheers,
    RC

    hello again everyone,
    As no one made any replys to this topic, i will now show you what i have ended up doing to create my multiple track audio sequencer.
    Its not the best in terms of "smart code" but it works, and since i have a deadline for this project, i am happy to get it working no matter what way the code is structured.
    i simply used this file
    import java.awt.*;
    import javax.sound.sampled.*;
    import java.io.*;
    public class AudioTrack0Handler
         boolean mute = false;
         String fileName;
         int loop;
         Clip clip;
         public void play(String file, int loops )
                   fileName = file;
                   loop = loops;
                   try{
                   System.out.println("Play method called file..." + fileName);
                   AudioInputStream stream = AudioSystem.getAudioInputStream(new File("C:\\java\\code\\Audio\\" + fileName ));
                   //AudioInputStream stream = AudioSystem.getAudioInputStream(new File("1.wav"));
                   // At present, ALAW and ULAW encodings must be converted
                   // to PCM_SIGNED before it can be played
                   AudioFormat format = stream.getFormat();
                   if (format.getEncoding() != AudioFormat.Encoding.PCM_SIGNED) {
                        format = new AudioFormat(
                                  AudioFormat.Encoding.PCM_SIGNED,
                                  format.getSampleRate(),
                                  format.getSampleSizeInBits()*2,
                                  format.getChannels(),
                                  format.getFrameSize()*2,
                                  format.getFrameRate(),
                                  true);        // big endian
                        stream = AudioSystem.getAudioInputStream(format, stream);
                   // Create the clip
                   DataLine.Info info= new DataLine.Info(
                        Clip.class, stream.getFormat(), ((int)stream.getFrameLength()*format.getFrameSize()));
                   clip = (Clip) AudioSystem.getLine(info);
                   clip.open(stream);
                   // Start playing
                   clip.loop(loop);
                   //clip.stop();
                   } catch (IOException e) { e.printStackTrace();
                   } catch (LineUnavailableException e) {  e.printStackTrace();
                   } catch (UnsupportedAudioFileException e) { e.printStackTrace();}
         public void stopAudio()
              clip.stop();
              clip.flush();
         public void muteAudio()
              /*Control[] ctrl = clip.getControls();
              for (int i=0; i < ctrl.length; i++)
                   System.out.println(ctrl);
              FloatControl gainControl = (FloatControl)clip.getControl(FloatControl.Type.MASTER_GAIN);
              //double gain = .5D; // number between 0 and 1 (loudest)
              //float dB = (float)(Math.log(gain)/Math.log(10.0)*20.0);
              switch((int)gainControl.getValue())
                             case 0:
                             gainControl.setValue(-80);
                             break;
                             case -80:
                             gainControl.setValue(0);
                             break;
    and created it eight times for 8 audio tracks. i call each track seperately when i need to access the methods. With the stop method and mute method, it also allows me to stop all tracks or mute/unmute individual ones during playback.
    In parts This is a primitve way of doing it (i think) but it will remain here as a guide for anyone who finds it!
    cheers,
    RC

  • What is the simplest way to split an mp3 file into multiple audio CDs?

    I wonder if windows 7 has any tools to burn an mp3 file into multiple audio CDs.
    If it does not, are there any standard tools to do it?
    thank you,
    Ed

    see this to understand how you can loop through sheets
    http://www.codeproject.com/Tips/395541/How-to-load-data-from-multiple-Excel-sheets-to-any
    then all it needs is a data flow task with excel source and flat file destination which will point to your csv path
    Please Mark This As Answer if it helps to solve the issue Visakh ---------------------------- http://visakhm.blogspot.com/ https://www.facebook.com/VmBlogs

  • Solve my corrupted audio problem for $$ and eternal gratitude

    My video project has corrupted audio suddenly. I've read about other audio problems when exporting, but all I did was save the project while editing, no export. I have the prefs set to extract audio at pasteover, which I've done a lot of for this 2-camera wedding shoot. I also have the second audio track occasionally used for background music. All three tracks (video, audio 1, audio 2) on the timeline have corrupted audio for the entire length of the project. It sounds like a helicopter whirr was added, it's very choppy. Also, both cpus are maxxed out and the process monitor shows iMovie utilizing 180%+ consistently. When iMovie isn't running, it's in the single digits. As soon as I load iMovie the cpus max out. This hasn't happened the whole project, just recently. So what changed? I don't know. I've been doing the same thing the whole time, the pasteovers, the add titles, the add background track, saving the project every couple of minutes. Each time I've saved, it looks like it's listing off different files or clips, not just the changed clips. I've tried deleting the QT movie it created in the cache and let it recreate to see if that would help, but it didn't. Would deleting the files in the waveform cache help? I've got about 30 hours into this project already and would love to resurrect this audio if possible. Either that or it's Jim Beam and call it a day. I thought this was non-destructive editing, but apparently that's just the originals? That doesn't help much when the whole project audio goes in the toilet and I'm looking at redoing this whole project. Anyone who can fix this is getting a big ol' sloppy kiss on the mouth and an iTunes gift certificate.

    I've never personally seen the audio problems you describe, but there's some things I'd try before giving up. As you've probably read, it's not unusual to have playback problems in projects containing complex audio. The odds for it seem to increased in QuickTime 7.
    1. Try opening the "TimeLine Movie.mov" that's inside the Cache folder of the project in QuickTime Player. If the audio plays okay there, the audio data is intact and you're seeing a playback anomaly in iMovie. (QuickTime Player may choke too, but don't conclude anything from that.)
    To access the movie, Control-click on the project icon and choose "Show Package Contents".
    2. Try exporting ONLY the project audio to an AIFF file, then import THAT back into the project and replace the audio you have. That will "flatten" the audio and make it much easier to play. (To be safe, on a copy of the project.)
    Or if you have QuickTime Pro, you might try extracting all the audio from the Timeline movie.
    To export to an AIFF file, choose File > Export, click on QuickTime, set the popUp menu to "Expert Settings", press Share, then from the top popUp menu, choose "Sound to AIFF". Choose the level of quality you want from the bottom popUp menu, then Save.
    What may be going on here is that extracting audio has created MANY audio files in the project, some possibly very large. (Each time we extract audio from a clip that is part of a Media file shared with other clips, iMovie extracts ALL the audio from that Media file, not just the audio of the selected clip.) To see what audio files the project contains, look in the Media folder of the project.
    If you get this solved, please say how.
    Oh, and if you haven't updated to iMovie 7.1, you might try that. There were improvements in handling multiple audio tracks, I read somewhere.
    BTW, it's usually not a good idea to change things inside the project package. iMovie can get pretty confused. The Timeline movie is replaced each time we save, so that's not a big deal.
    Karl

  • How do I merge multiple audio clips to one?

    Hey Everyone,
    After syncing multiple clips in PE I import them into Premiere CS6 and they are all layered with their own audio tracks (though the video clips are synced with only one audio track). This causes inconsistent audio levels. How do I join all these clips which originally derived from one audio recorder to merge as one? If there is a step by step process please advise. Thanks in advance, you guys are beyond awesome.
    Mike Diaz

    If all audio is from a single audio source (with consistent levels0 ..the only reason you would be getting different audio levels on different audio tracks is if the Mixer has different settings....or the audio has been changed at clip level.
    Its usually desireable to have audio clips on different tracks.
    Can you not just drag the audio clips to a single audio track...if that's what you really need?
    Alternatively a mixdown...but that requires sorting the levels anyway.  ( Mixer on automation or at clip level.)

Maybe you are looking for

  • Satellite L300-20D is not starting up fully

    Please can someone help me out. I have a L300 20D toshiba and it has just stopped starting up fully. It goes to a black screen with the cursor arrow on or it just shows the launch windows (recommended repair) when i click this it does nothing. I have

  • Connecting laptop to net work printer

    How do I use a Usb flash drive to connect my laptop to my network printer?

  • Find FrowardTo Outlook Rules via Powershell

    Hello everyone! We have Exchange 2010 organization and about 10000 user's mailboxes. Some of users have outlook rules, that forward to external addresses. There is a list of allowed domains in txt file. Now i need find all rules that forward to exter

  • How to enable the filetransfer in Oracle Communicator 11g?

    Hi, I've already change the relevant values in the Program Files\Oracle\Oracle Communicator\defaults.xml as following:      <FileTransfer>           <Location>http://example.com:7001/filetransfer</Location>      </FileTransfer>      <FileTransferEnab

  • Query not working for all the material, may be space problem, need help.

    Hai all,   I have a query with  variable material and date range. we have 60,000 materials. I am doing the report for the month of feb, year 2007.     When I am executing up to 30,000 material the report is generated, anything beyond 30,000 materials