[alsa-devel] Channel conversion automatic or not?

Radivoje Jovanovic radivojejovanovic at gmail.com
Tue Dec 28 22:35:29 CET 2010


Hi,
In my driver I have specified that the hardware supports only two channels.
However, if I try playing mono input files on this system I get:
Playing WAVE 'test.wav' : Unsigned 8 bit, Rate 22050 Hz, Mono
aplay: set_params:1041: Unable to install hw params:
ACCESS:  RW_INTERLEAVED
FORMAT:  U8
SUBFORMAT:  STD
SAMPLE_BITS: 8
FRAME_BITS: 8
CHANNELS: 1
RATE: 22050
PERIOD_TIME: (371519 371520)
PERIOD_SIZE: 8192
PERIOD_BYTES: 8192
PERIODS: 4
BUFFER_TIME: (1486077 1486078)
BUFFER_SIZE: 32768
BUFFER_BYTES: 32768
TICK_TIME: 0

If I try playing the same file through the virtual device that I specified
in asoundrc file like this:

pcm.mydev {
    type plug
    slave {
        pcm default
        channels 2
    }
}

and I do aplay -Dmydev test.wav
File plays no problem.
I guess the question is shouldn't ALSA convert this data automatically or
the only way to get this to work is through plugin as I did?
Cheers
Ogi


More information about the Alsa-devel mailing list