making an asoundrc that converts channels to stereo

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

 



hi,

I know this feels like an FAQ, I've consulted multiple places from

http://alsa.opensrc.org/Asoundrc
http://www.alsa-project.org/alsa-doc/alsa-lib/pcm_plugins.html
http://nairobi-embedded.org/alsa_route_and_volume_plugin.html

to no avail. I am working with an I2S based hat for the raspberry pi.
Due to the protocol the chip always plays/record stereo. Now I'd like to
configure alsa in a way to just simply duplicate channels when playing a
mono file.

My current asoundrc is below. The main issue is that I still can't play
mono files.

Playing WAVE '/tmp/tmpel6bu774.wav' : Signed 16 bit Little Endian, Rate
22050 Hz, Mono
aplay: set_params:1297: Unable to install hw params:
ACCESS:  RW_INTERLEAVED
FORMAT:  S16_LE
SUBFORMAT:  STD
SAMPLE_BITS: 16
FRAME_BITS: 16
CHANNELS: 1
RATE: 22050
...

It still tries to configure the hw as mono, but the hw can't do that.
Next issue is how would I configure separate ttables depening on the
number of input channels. Especially on

http://www.alsa-project.org/alsa-doc/alsa-lib/pcm_plugins.html

the docs are super lacking (eg. what does cchannel stands for?)

Stefan

// .asoundrc

defaults.pcm.card 0
defaults.ctl.card 0

pcm.!default {
  type plug
  slave {
    pcm "hw:0"
    channels 2
  }
  ttable {
    # mono
    0.0 1
    0.1 1
    # stereo
    #0.0 1
    #1.1 1
  }
}

ctl.!default {
  type plug
  channels 1
  slave {
    pcm "hw:0"
  }
  ttable {
    0.0 1
    1.0 0
  }
}



------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today. http://sdm.link/xeonphi
_______________________________________________
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