1

Problems mixing to mono

Hello,

I'm trying to mix both channels into one. But nothing is working..

 

aplay -l

**** List of PLAYBACK Hardware Devices ****
card 0: ALSA [bcm2835 ALSA], device 0: bcm2835 ALSA [bcm2835 ALSA]
  Subdevices: 8/8
  Subdevice #0: subdevice #0
  Subdevice #1: subdevice #1
  Subdevice #2: subdevice #2
  Subdevice #3: subdevice #3
  Subdevice #4: subdevice #4
  Subdevice #5: subdevice #5
  Subdevice #6: subdevice #6
  Subdevice #7: subdevice #7
card 0: ALSA [bcm2835 ALSA], device 1: bcm2835 ALSA [bcm2835 IEC958/HDMI]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: sndrpihifiberry [snd_rpi_hifiberry_amp], device 0: HifiBerry AMP HiFi tas5713-hifi-0 []
  Subdevices: 1/1
  Subdevice #0: subdevice #0

 

with /etc/asound.conf

pcm.!default {
    type hw
    card 1
}
ctl.!default {
    type hw
    card 1
}

i can play wave files:

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

 

 

Now with Mono-Mixing:

pcm.!default {
type plug
slave.pcm "hw:1,0"
slave.channels 2
ttable.0.0 0.5 # L(0) to L(0) at 0.5 volume
ttable.1.0 0.5 # R(1) to L(0) at 0.5 volume
ttable.0.1 0.5 # L(0) to R(1) at 0.5 Volume
ttable.1.1 0.5 # R(1) to R(1) at 0.5 Volume

}

ctl.!default {
type hw
card 1
}

 

A can't play the sound file:


Playing WAVE 'LRMonoPhase4.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Stereo
aplay: set_params:1297: 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: 125000
PERIOD_SIZE: 6000
PERIOD_BYTES: 24000
PERIODS: 4
BUFFER_TIME: 500000
BUFFER_SIZE: 24000
BUFFER_BYTES: 96000
TICK_TIME: 0

 

I also tried

pcm.!default makemono

pcm.makemono {
type route
slave.pcm "hw:1"
ttable {
0.0 1 # in-channel 0, out-channel 1, 100% volume
1.0 1 # in-channel 1, out-channel 1, 100% volume
}
}

ctl.!default {
                type hw
                card 1
}

 

 

but then I get:


aplay LRMonoPhase4.wav
Playing WAVE 'LRMonoPhase4.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Stereo
aplay: set_params:1204: Broken configuration for this PCM: no configurations available

(when i set hw source to 0 it is working, but on the wrong soundcard)

 

I'd by thankful for any help.

3 comments

Please sign in to leave a comment.