Dear all,

I've have been using ALSA for a year now and I have been working with
several plugins.
Now, I need to set up a device with asymmetric playback and record with
dmix and dsnoop plugins.
But, the recording device is at its time a multi plugin with four channels
coming from two different devices of the same audio card.
The problem is that It cannot make two applications to record audio
simultaneously from the 4 channels.


* If I run:
arecord   -D pal_robotics_default -f cd -r 48000 -c 4 > tmp.wav &
arecord   -D pal_robotics_default -f cd -r 48000 -c 4 > tmp2.wav

The second call to arecord produces the following error:
> ALSA lib pcm_dsnoop.c:660:(snd_pcm_dsnoop_open) unable to open slave
> arecord: main:682: audio open error: Invalid argument

What I do is to have this sequencie of plugins:

hw_card0_dev0 -> dsnoop (2ch) |
                              |  -> multi (4ch)  |
hw_card0_dev2 -> dsnoop (2ch) |                  |
                                                 | -> asym -> plug ->
default
                                                 |
hw_card0_dev0 -> dmix                            |


I am concern about using two dsnopp plugins over the same card. Does anyone
know if this is a problem?

Regards.

--
Jordi Adell


PS: The asound.conf that I am using is the following one:

defaults.pcm.rate_converter = "speexrate"

pcm.rawjack {
    type jack
    playback_ports {
        0 system:playback_1
        1 system:playback_2
    }
    capture_ports {
        0 system:capture_1
        1 system:capture_2
    }
    hint {
description "JACK Bridge";
   }
}

pcm.jack {
    type plug
    slave { pcm "rawjack" }
    hint {
        description "JACK Audio Connection Kit - ALSA plugin"
    }
}

pcm.pal_dev0_48{
type dsnoop
slave{
pcm {
 type hw
card "PAL_INTEL"
device 0
 nonblock true
         }
format S16_LE
rate 48000
 channels 2
  }
        ipc_key 24800
}

pcm.pal_dev2_48{
type dsnoop
 slave{
pcm {
type hw
card "PAL_INTEL"
 device 2
nonblock true
         }
 format S16_LE
rate 48000
channels 2
  }
        ipc_key 24802
}

pcm.pal_play_44 {
type hw
card "PAL_INTEL"
 device 0
format S16_LE
rate 44100
channels 2i
 nonblock true
}

pcm.pal_play_48 {
        type hw
        card "PAL_INTEL"
        device 0
        format S16_LE
        rate 48000
        channels 2
nonblock true
}



pcm.pal_robotics_96{
        type hw
        card "PAL_INTEL"
        device 0
        format S16_LE
        rate 96000
        nonblock true
    channels 2
}

pcm.pal_robotics_mix {
        type dmix
        ipc_key 24800
ipc_perm 0660
 ipc_key_add_uid false
        slave {
pcm pal_play_48
period_time 0
 period_size 1024
buffer_size 4096
}
        bindings
        {
                0 0
                1 1
        }
}


pcm.pal_robotics_asym{
  type asym
  capture.pcm pal_4ch
  playback.pcm pal_robotics_mix
}

pcm.pal_robotics_asym_2ch{
                  type asym
                  capture.pcm pal_dev0_48
                  playback.pcm pal_robotics_mix
}



pcm.pal_robotics_default{
 type plug
  slave.pcm pal_robotics_asym
}

pcm.pal_robotics_2ch {
type plug
 slave.pcm pal_robotics_asym_2ch
}

pcm.pal_robotics_file{
type file
 slave{
pcm pal_robotics_mix
}
 format "raw"
file "/tmp/pal_record.raw"
}

pcm.hw_headset {
    type hw
    card "PAL_HEADSET"
    device 0
    format S16_LE
    rate 48000;
}

pcm.pal_headset {
    type plug
    slave {
      pcm hw_headset
    }
}



pcm.broadcast {
type plug
 slave.pcm "both"
}



pcm.pal_4ch {
        type multi
slaves.a.pcm pal_dev0_48;
 slaves.b.pcm pal_dev2_48;
slaves.a.channels 2;
slaves.b.channels 2;
 bindings.0.slave a;
bindings.0.channel 0;
bindings.1.slave a;
 bindings.1.channel 1;
bindings.2.slave b;
bindings.2.channel 0;
 bindings.3.slave b;
bindings.3.channel 1,
}



pcm.both {
 type route;
  slave.pcm {
      type multi;
      slaves.a.pcm "pal_robotics_asym_2ch";
      slaves.b.pcm "jack";
      slaves.a.channels 2;
      slaves.b.channels 2;
      bindings.0.slave a;
      bindings.0.channel 0;
      bindings.1.slave a;
      bindings.1.channel 1;

      bindings.2.slave b;
      bindings.2.channel 0;
      bindings.3.slave b;
      bindings.3.channel 1;
  }

  ttable.0.0 1;
  ttable.1.1 1;

  ttable.0.2 1; # front left
  ttable.1.3 1; # front right
}







Jordi Adell
Speech Processing Engineer
 <jordi.ad...@pal-robotics.com>

jordi.ad...@pal-robotics.com
www.pal-robotics.com

[image: cid:image003.png@01CAC1D4.21F0FEF0]

PAL Robotics, S.L.
c/ Pujades 77-79, 4º4ª
08005 Barcelona
Spain
Tel      +34 93 414 53 47
Fax     +34 93 209 11 09
Skype:  jordiadell.pal-robotics

Facebook <http://www.facebook.com/palrobotics1> -
Twitter<http://twitter.com/#%21/palrobotics>- PAL
Robotics YouTube Channel <http://www.youtube.com/user/PALRobotics>

P Antes de imprimir este e-mail piense bien si es necesario hacerlo: El
medioambiente es cosa de todos.

AVISO DE CONFIDENCIALIDAD: Este mensaje y sus documentos adjuntos, pueden
contener información privilegiada y/o confidencial que está dirigida
exclusivamente a su destinatario.  Si usted recibe este mensaje y no es el
destinatario indicado, o el empleado encargado de su entrega a dicha
persona, por favor, notifíquelo inmediatamente y remita el mensaje original
a la dirección de correo electrónico indicada. Cualquier copia, uso o
distribución no autorizados de esta comunicación queda estrictamente
prohibida.
CONFIDENTIALITY NOTICE: This e-mail and the accompanying document(s) may
contain confidential information which is privileged and intended only for
the individual or entity to whom they are addressed.  If you are not the
intended recipient, you are hereby notified that any disclosure, copying,
distribution or use of this e-mail and/or accompanying document(s) is
strictly prohibited.  If you have received this e-mail in error, please
immediately notify the sender at the above e-mail address.

<<image001.png>>

------------------------------------------------------------------------------
See everything from the browser to the database with AppDynamics
Get end-to-end visibility with application monitoring from AppDynamics
Isolate bottlenecks and diagnose root cause in seconds.
Start your free trial of AppDynamics Pro today!
http://pubads.g.doubleclick.net/gampad/clk?id=48808831&iu=/4140/ostg.clktrk
_______________________________________________
Alsa-user mailing list
Alsa-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/alsa-user

Reply via email to