ctl_elems hooks with dmix plugin

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all / Takashi,

 

I saw Takashi has a patch for this question: https://www.mail-archive.com/alsa-user@xxxxxxxxxxxxxxxxxxxxx/msg25548.html

But I still have this issue when I use â??hooksâ?? and â??dmixâ?? plugin in my asound.conf. I am using alsa-lib and utils 1.1.9.

Aplay â??v xxx.wav from one console and aplay â??v yyy.wav from another console. Can Takashi or any other one help? Thanks!

 

 

My asound.conf is:

 

pcm.dmix_44 {

        type dmix

        slave.pcm "spk_stereo"

        ipc_key 321456  # any unique value

        ipc_key_add_uid true

        slave {

                pcm "hw:0"

                format S32_LE

                rate 44100

        }

}

 

pcm.spk_stereo {

                  type hw          

                  card "MapleLeaf" 

                  device 0         

                  format S32_LE

}

 

pcm.playback {

                type hooks

                slave.pcm "dmix_44"

                hooks.0 {

                           type ctl_elems

                           hook_args [

                              {

                                name "HPL Output Mixer L_DAC Switch"

                                preserve true

                                lock true

                                value true

                              }

                              {

                                name "HPR Output Mixer R_DAC Switch"

                                preserve true

                                lock true

                                value true

                              }

                              {

                                name "HP DAC Playback Switch"

                                preserve true

                                lock true

                                value [ 1 1 ]

                              }

                              {

                                name "HP Driver Gain Volume"

                                preserve true

                                lock true

                                value [ 6 6 ] #[6 6]=0dB, [3 3]=-3dB

                              }

                              {

                                name "REF Power-up Cfg"

                                preserve true

                                lock true

                                value 1 #40ms

                              }

                           ]

                 }

 

}

 

pcm.hooks {

  type asym

  playback.pcm "playback"

  capture.pcm  "capture"

 

}

 

pcm.!default {

  type plug

  slave.pcm "hooks"

}

 

 

First aplay play out music. Second failed as:

# aplay LRMonoPhase4.wav

Playing WAVE 'LRMonoPhase4.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Stereo

ALSA lib setup.c:96:(snd_sctl_install) Cannot lock ctl elem

aplay: set_params:1403: Unable to install hw params:

ACCESS:  RW_INTERLEAVED

FORMAT:  S16_LE

SUBFORMAT:  STD

SAMPLE_BITS: 16

FRAME_BITS: 32

CHANNELS: 2

RATE: 48000

PERIOD_TIME: (23129 23130)

PERIOD_SIZE: [1110 1110]

PERIOD_BYTES: (4440 4444)

PERIODS: (2 3)

BUFFER_TIME: 69375

BUFFER_SIZE: 3330

BUFFER_BYTES: 13320

TICK_TIME: 0

 

1st aplay shows:

# aplay -v Hotel_California.wav

Playing WAVE 'Hotel_California.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo

Plug PCM: Linear conversion PCM (S32_LE)

Its setup is:

  stream       : PLAYBACK

  access       : RW_INTERLEAVED

  format       : S16_LE

  subformat    : STD

  channels     : 2

  rate         : 44100

  exact rate   : 44100 (44100/1)

  msbits       : 16

  buffer_size  : 3060

  period_size  : 1020

  period_time  : 23129

  tstamp_mode  : NONE

  tstamp_type  : MONOTONIC

  period_step  : 1

  avail_min    : 1020

  period_event : 0

  start_threshold  : 3060

  stop_threshold   : 3060

  silence_threshold: 0

  silence_size : 0

  boundary     : 1604321280

Slave: Hooks PCM

Its setup is:

  stream       : PLAYBACK

  access       : MMAP_INTERLEAVED

  format       : S32_LE

  subformat    : STD

  channels     : 2

  rate         : 44100

  exact rate   : 44100 (44100/1)

  msbits       : 32

  buffer_size  : 3060

  period_size  : 1020

  period_time  : 23129

  tstamp_mode  : NONE

  tstamp_type  : MONOTONIC

  period_step  : 1

  avail_min    : 1020

  period_event : 0

  start_threshold  : 3060

  stop_threshold   : 3060

  silence_threshold: 0

  silence_size : 0

  boundary     : 1604321280

Slave: Direct Stream Mixing PCM

Its setup is:

  stream       : PLAYBACK

  access       : MMAP_INTERLEAVED

  format       : S32_LE

  subformat    : STD

  channels     : 2

  rate         : 44100

  exact rate   : 44100 (44100/1)

  msbits       : 32

  buffer_size  : 3060

  period_size  : 1020

  period_time  : 23129

  tstamp_mode  : NONE

  tstamp_type  : MONOTONIC

  period_step  : 1

  avail_min    : 1020

  period_event : 0

  start_threshold  : 3060

  stop_threshold   : 3060

  silence_threshold: 0

  silence_size : 0

  boundary     : 1604321280

Hardware PCM card 0 'MapleLeaf' device 0 subdevice 0

Its setup is:

  stream       : PLAYBACK

  access       : MMAP_INTERLEAVED

  format       : S32_LE

  subformat    : STD

  channels     : 2

  rate         : 44100

  exact rate   : 44100 (44100/1)

  msbits       : 32kasho

  buffer_size  : 3060

  period_size  : 1020

  period_time  : 23129

  tstamp_mode  : ENABLE

  tstamp_type  : MONOTONIC

  period_step  : 1

  avail_min    : 1020

  period_event : 0

  start_threshold  : 1

  stop_threshold   : 1604321280

  silence_threshold: 0

  silence_size : 1604321280

  boundary     : 1604321280

  appl_ptr     : 0

  hw_ptr       : 13260

 

 

Regards!

Kevin

 

 

 

_______________________________________________
Alsa-user mailing list
Alsa-user@xxxxxxxxxxxxxxxxxxxxx
https://lists.sourceforge.net/lists/listinfo/alsa-user

[Index of Archives]     [ALSA Devel]     [Linux Audio Users]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]

  Powered by Linux