4

I have an application that sends voice packets of PCM data from one node to another. The program also plays a wav file at the startup. The wav file is heard but none of my audio. I added the following to my asound.conf file:

pcm.playmix {
  type softvol
  slave {
    pcm "hw:0,0"
  }
  control.name "SpeakerVolume"
  control.card 0
}

pcm.writeFile {
  type file
    slave {
        pcm playmix # Now write to the actual sound card
    }
    file "/tmp/output.raw"
    format "raw"
}

pcm.dsp0 {
  type plug
  slave.pcm "writeFile"
}

We I look at the output.raw file using Audacity both the startup wav file is present as well as the PCM audio that has come from the LAN. However I don't hear any audio on the receiving computer's speaker that is the LAN traffic. I am currently stuck as to what to do next. Does the output.raw file get saved whilst the data is being transferred to the kernel to play on the device? If I use aplay, then whatever wav file I select is played. The only audio I am missing is the PCM from the other end of my LAN.

Any suggestions would be most appreciated.

1
  • I tried a later version of the alsa-libs, v1.2.1, and no I can't even get aplay to generate a sound even though my output.raw file has the intended PCM data in it. My kernel is 4.18.20.
    – Tony
    Feb 3, 2020 at 8:08

1 Answer 1

4

It turns out that the people who created the hardware for the EMB-2610's amplified speaker port only wired in the left channel. My prerecorded wav files were stereo so that is why I am hearing something. I created the following ALSA configuration to join both of the channels together.

    pcm.mixed {
    type dmix
    ipc_key 9752933 #must be unique for all dsnoop plugins
    ipc_key_add_uid yes
    slave.pcm "hw:1"  # or whatever
}

pcm.channel1 {
    type route
    slave {
        pcm mixed
        channels 2
    }
    ttable [ [ 1 0 ] ]
}

pcm.channel2 {
    type route
    slave {
        pcm mixed
        channels 2
    }
    ttable [ [ 0 1 ] ]
}

pcm.channel1_softvol {
    type softvol
    slave.pcm channel1
    control.name "Channel 1 Capture Volume"
}
pcm.channel2_softvol {
    type softvol
    slave.pcm channel2
    control.name "Channel 2 Capture Volume"
}

pcm.mixed_with_volumes {
    type multi
    slaves {
        a { pcm channel1_softvol channels 1 }
        b { pcm channel2_softvol channels 1 }
    }
    bindings [
        { slave a channel 0 }
        { slave b channel 0 }
    ]
}

pcm.dsp0 {
    type plug
    slave.pcm mixed_with_volumes
    ttable [ [ 1.0 1.0 ] ]
}

I found this using a google search and somebody was trying to connect to inputs to one stream. The ipc_key only has to be an unique number.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .