Announcement

Collapse
No announcement yet.

Multichannel capture with ALSA?

Collapse
X
  • Filter
  • Time
  • Show
Clear All
new posts

  • Multichannel capture with ALSA?

    Does dmix only manage software multichannel mixing or can it do capture too?

    Heres the issue, I need to capture my mic on one device exclusively for skype and then capture the "analog mix" of everything on the other for a recording app such as Audacity. Am I better off just using two sound cards or is this possible via software, jack or anything.

    Please, anyone with experience help!

  • #2
    So long the applications in question are ALSA-aware it should be possible indeed with dmix, and in mos cases you shouldn't do anything. However, since Skype is OSS based, it highjacks the capture channel and dmix doesn't bode well with OSS apps or the aoss OSS compatibility layer. Now, if your sound card supports several capture channels in hardware, you can do that without much of an issue, for example, using the analog capture for one and the digital for the other. It all boils down to what soundcard do you have. Cheap onboard solutions usually lack much functionality in this regard, and the great majority even lack hardware playback hardware mixing, let alone analog/digital captures (some cards do feature analog and digital captures, though). The way I see it, in your case, you are better off using two cards, simply because you depend on one application jamming the capture channel, Skype.

    Comment


    • #3
      While I have never used Skype, Thetargos is correct on issues that arise from mixing the two APIs (ALSA and OSS).

      If you want to capture both sides of the Skype conversation, then there are a few options. If you want to capture both of those separately, that is a bit more complex

      So basically yes, as Thetargos suggests it would be easier if you had two sound devices, and technically it can be done with dmix + dsnoop properly setup.

      You can setup software mixing yourself using this guide:
      http://alsa.opensrc.org/index.php/Ha...oftware_mixing

      That should work for sharing both playback and capture between apps on one audio device. If the ALSA driver you use allows one application to lock your driver and prevent software mixing, then it's an ALSA bug and needs to be reported.

      If there are OSS drivers available for your device, then you could try that too (if it's that imperative).

      Unfortunately, there are not many ALSA drivers that support hardware mixing in their driver:
      http://bugtrack.alsa-project.org/mai...trix:Tag-HWMIX

      You could buy a cheapo USB audio device, if it comes down to it.

      Comment


      • #4
        Hi,

        I have a Sound Blaster Audigy Value Soundcard, using the CA0106 Alsa driver. Unfortunatly it does not have a master volume control in the mixer panel, is there a way to enable it or emulate it?

        Comment


        • #5
          Divan, could you please post the output of

          Code:
          cat /proc/asound/pcm
          please?

          I thought the CA0106 was used for Audigy LS and Live! 24-bit (i.e, no TURE Audigy or Live! products)

          Comment


          • #6
            Code:
             
             0 [CA0106         ]: CA0106 - CA0106
                                  Audigy SE [SB0570] at 0xa800 irq 20
             1 [default        ]: USB-Audio - PnP Audio Device        
                                  PnP Audio Device         at usb-0000:00:02.0-7, full speed
            Distro: openSuSE 10.2

            What driver should it use?

            Comment


            • #7
              The driver is snd-ca0106, I'm a little disoriented by your output, you using USB headphones or is the "card" USB? I had never seen the content of /proc/asound/pcm like that, I'm more used to my:

              Code:
              01-01: VIA 8237 : VIA 8237 : playback 1 : capture 1
              01-00: VIA 8237 : VIA 8237 : playback 4 : capture 1
              00-03: emu10k1 : Multichannel Playback : playback 1
              00-02: emu10k1 efx : Multichannel Capture/PT Playback : playback 8 : capture 1
              00-01: emu10k1 mic : Mic Capture : capture 1
              00-00: emu10k1 : ADC Capture/Standard PCM Playback : playback 32 : capture 1

              Comment


              • #8
                Sorry that was /proc/asound/cards. My motherboard audio is usb based.

                /proc/asound/pcm >
                Code:
                00-03: ca0106 : CA0106 : playback 1 : capture 1
                00-02: ca0106 : CA0106 : playback 1 : capture 1
                00-01: ca0106 : CA0106 : playback 1 : capture 1
                00-00: ca0106 : CA0106 : playback 1 : capture 1
                01-00: USB Audio : USB Audio : playback 1 : capture 1

                Comment


                • #9
                  I believe that is a /proc/asound/cards divan posted [EDIT: I must be a slow poster, you beat me there lol]

                  The Audigy 'Value' series does not use an emu10k1 either IIRC, Thetargos.

                  It sounds like the audio mixer program divan is using is grabbing onto the USB audio device. Either that or there's something missing from the ALSA modules config.

                  divan, could you post your /proc/asound/devices and please tell us what program you are using to access controls (audio mixer app).

                  Thanks.
                  Last edited by edged; 10-23-2007, 06:15 AM.

                  Comment


                  • #10
                    /proc/asound/devices:
                    Code:
                      2:        : timer
                      3: [ 0- 0]: raw midi
                      4: [ 0- 3]: digital audio playback
                      5: [ 0- 3]: digital audio capture
                      6: [ 0- 2]: digital audio playback
                      7: [ 0- 2]: digital audio capture
                      8: [ 0- 1]: digital audio playback
                      9: [ 0- 1]: digital audio capture
                     10: [ 0- 0]: digital audio playback
                     11: [ 0- 0]: digital audio capture
                     12: [ 0]   : control
                     13: [ 1- 0]: digital audio playback
                     14: [ 1- 0]: digital audio capture
                     15: [ 1]   : control
                     16:        : sequencer
                    I am using alsamixer and the gnome mixer control. Both have no PCM or Main Volume control. To change volume I have to lower all the Analog channels manualy (analog front, analog rear etc.)

                    Comment


                    • #11
                      Ok, I've looked around and found a few things: 1) you're not the only person with this problem, and 2) according to the source code (in recent kernel anyway), it should expose the "Master Playback Volume" control.

                      EDIT:[If you're not using the latest version of ALSA you could try updating. You could try looking in /proc/asound/card0/ossmixer to see if there is a volume master, which may indicate something wrong with your configuration?]

                      So you can file a bug report with alsa-project.org's bugtracker, or alternatively if you want to ask very, very nicely you could email the developer? Some people don't like to receive emails, others will gladly help...

                      Sorry I have nothing better to report.
                      Last edited by edged; 10-23-2007, 07:17 AM.

                      Comment


                      • #12
                        So should I update the kernel as well or only the ALSA packages? I have 2.6.23 but it just starts and shows a black screen. Using 2.6.22-ck1 currently.

                        Is there then a way to emulate a main volume control or just link the analog front control to a new main control?

                        Thanks for all your help

                        Comment


                        • #13
                          What version of ALSA does it say you have when you look in /proc/asound/version? The latest is 1.0.15 final, which has a few fixes for the driver, but it may not be worth it (difficult for me to tell). If you are going to try, it's far easier to keep your kernel and just use the libs+ drivers + utils off the ALSA website.

                          It may be possible to do what you want, but could you tell me, have you tried alsamixer with the -V option - and does that reveal anymore elements? BTW, are you sure the Front Analog volume control doesn't affect all of the output channels (it's been reported to)? Or are you using digital out, in which case I may know what it is...

                          Comment


                          • #14
                            I have ALSA 1.0.14. Will try 1.0.15.

                            [EDIT: Tried 1.0.15 and it made no difference]

                            I have tried 'alsamixer -V all' and it just gives me extra capture controls. I only have a analog 2.1 speaker set, so I won't know if it effects all.
                            Last edited by divan; 10-23-2007, 08:32 AM.

                            Comment


                            • #15
                              Sorry for the long time in replying.

                              Copy this to a file name ".asoundrc" and place it in your home directory:
                              Code:
                              # Personal: ~/.asoundrc
                              # Global: /etc/asound.conf
                              
                              pcm.snd_card {
                                  type hw
                                  card 0
                                  device 0
                                  # mmap_emulation true  # If mmap() err
                              }
                              
                              pcm.dmixed {
                                  type dmix 
                                  ipc_key 1024 
                                  #ipc_key_add_uid false   # No user restriction
                                  #ipc_perm 0666           # IPC permissions for multi-user
                                  slave {
                                     pcm "snd_card"
                                     #rate 48000	  # If chipmunks
                                     #buffer_size 4096  # If pops
                                     #period_size 512	  # If crackles
                                  }
                              }
                              
                              pcm.dsnooped {
                                  type dsnoop 
                                  ipc_key 2048 
                                  slave {
                                      pcm "snd_card" 
                                      #rate 48000	  # If chipmunks
                              	#period_size 128  # If crackles
                                  }
                              }
                              
                              pcm.softvol {
                                  type softvol
                                  slave.pcm "dmixed"
                                  control {
                                      name "Software"  # Can rename this
                                      card 0
                                  }
                              }
                              
                              pcm.duplex {
                                  type asym 
                                  playback.pcm "plug:softvol" 
                                  capture.pcm "plug:dsnooped"
                              }
                              
                              pcm.!default {
                                  type plug
                                  slave.pcm "duplex"
                              }
                              
                              pcm.dsp0 {
                                  type plug
                                  slave.pcm "duplex"
                              }
                              You will need to access your audio device one time, before the new "Software" control will appear in you mixer. If you have no "Master" volume control (you said you didn't), then you can rename it that - and voila.

                              There are some commented items, but they should be self explanatory enough. I used mainly documentation on the ALSA website, and yes it can be difficult to wrap your head around

                              Anyway, let me know if that doesn't work (I'd be surprised, but I suppose it's not impossible).
                              Last edited by edged; 10-23-2007, 11:37 AM.

                              Comment

                              Working...
                              X