1

I am currently trying to setup a soundblaster card (CA106 chipset) to output to 4 channels.

I plugged 4 speakers to analog output (using the jack plugs).

When I am testing the pseakers using the speaker-test utility it works well, but whenever I am trying to play a 4 channel (built by myself) or any multichannels sound (retrieved from the web) with aplay utility I cannot get it to work.

Here is the information about my HW setup :

[root@server SurroundTestFiles]# aplay -L
default:CARD=CA0106
CA0106, CA0106
Default Audio Device
front:CARD=CA0106,DEV=0
CA0106, CA0106
Front speakers
rear:CARD=CA0106,DEV=0
CA0106, CA0106
Rear speakers
center_lfe:CARD=CA0106,DEV=0
CA0106, CA0106
Center and Subwoofer speakers
side:CARD=CA0106,DEV=0
CA0106, CA0106
Side speakers
surround40:CARD=CA0106,DEV=0
CA0106, CA0106
4.0 Surround output to Front and Rear speakers
surround41:CARD=CA0106,DEV=0
CA0106, CA0106
4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=CA0106,DEV=0
CA0106, CA0106
5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=CA0106,DEV=0
CA0106, CA0106
5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=CA0106,DEV=0
CA0106, CA0106
7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
iec958:CARD=CA0106,DEV=0
CA0106, CA0106
IEC958 (S/PDIF) Digital Audio Output
null
Discard all samples (playback) or generate zero samples (capture)
default:CARD=Intel
HDA Intel, AD198x Analog
Default Audio Device
front:CARD=Intel,DEV=0
HDA Intel, AD198x Analog
Front speakers
surround40:CARD=Intel,DEV=0
HDA Intel, AD198x Analog
4.0 Surround output to Front and Rear speakers
surround41:CARD=Intel,DEV=0
HDA Intel, AD198x Analog
4.1 Surround output to Front, Rear and Subwoofer speakers
surround50:CARD=Intel,DEV=0
HDA Intel, AD198x Analog
5.0 Surround output to Front, Center and Rear speakers
surround51:CARD=Intel,DEV=0
HDA Intel, AD198x Analog
5.1 Surround output to Front, Center, Rear and Subwoofer speakers
surround71:CARD=Intel,DEV=0
HDA Intel, AD198x Analog
7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
hdmi:CARD=Intel,DEV=0
HDA Intel
HDMI Audio Output

[root@server SurroundTestFiles]# alsacard
0

[root@server SurroundTestFiles]# cat /proc/asound/cards
0 [CA0106         ]: CA0106 - CA0106
                  Audigy SE [SB0570] at 0xcce0 irq 169
1 [Intel          ]: HDA-Intel - HDA Intel
                  HDA Intel at 0xf7ffc000 irq 82

Here is the command I use in both cases (and it corresponding output).

The speaker-test :

speaker-test -c 4 -D surround40:CA0106 -t wav

This spit the correct sound to the correct speakers (4 channel to 4 speakers)

Here is the aplay output when trying to play a 4 channels sounds using the same virtual device (surround40) :

[root@epr-servmcs-40 SurroundTestFiles]#  aplay -v -D surround40:CA0106 -c 4 test-4-channels.wav
Playing WAVE 'test-4-channels.wav' : Signed 24 bit Little Endian in 3bytes, Rate 44100 Hz, Channels 4
aplay: set_params:954: Sample format non available

If I try to use aplay without explicitly specifying the device it only plays the sound on 2 speakers, see the output for this test:

[root@epr-servmcs-40 SurroundTestFiles]#  aplay -v -c 4 test-4-channels.wav
Playing WAVE 'test-4-channels.wav' : Signed 24 bit Little Endian in 3bytes, Rate 44100 Hz, Channels 4
Plug PCM: Route conversion PCM (sformat=S24_3LE)                                                     
  Transformation table:                                                                              
    0 <- 0                                                                                           
    1 <- 1                                                                                           
Its setup is:                                                                                        
  stream       : PLAYBACK                                                                            
  access       : RW_INTERLEAVED                                                                      
  format       : S24_3LE                                                                             
  subformat    : STD                                                                                 
  channels     : 4                                                                                   
  rate         : 44100                                                                               
  exact rate   : 44100 (44100/1)                                                                     
  msbits       : 24                                                                                  
  buffer_size  : 7526                                                                                
  period_size  : 940                                                                                 
  period_time  : 21333                                                                               
  tstamp_mode  : NONE                                                                                
  period_step  : 1                                                                                   
  avail_min    : 940                                                                                 
  period_event : 0                                                                                   
  start_threshold  : 7526                                                                            
  stop_threshold   : 7526                                                                            
  silence_threshold: 0                                                                               
  silence_size : 0                                                                                   
  boundary     : 986447872                                                                           
Slave: Rate conversion PCM (48000, sformat=S32_LE)                                                   
Its setup is:                                                                                        
  stream       : PLAYBACK
  access       : MMAP_INTERLEAVED
  format       : S24_3LE
  subformat    : STD
  channels     : 2
  rate         : 44100
  exact rate   : 44100 (44100/1)
  msbits       : 24
  buffer_size  : 7526
  period_size  : 940
  period_time  : 21333
  tstamp_mode  : NONE
  period_step  : 1
  avail_min    : 940
  period_event : 0
  start_threshold  : 7526
  stop_threshold   : 7526
  silence_threshold: 0
  silence_size : 0
  boundary     : 986447872
Slave: Direct Stream Mixing PCM
Its setup is:
  stream       : PLAYBACK
  access       : MMAP_INTERLEAVED
  format       : S32_LE
  subformat    : STD
  channels     : 2
  rate         : 48000
  exact rate   : 48000 (48000/1)
  msbits       : 32
  buffer_size  : 8192
  period_size  : 1024
  period_time  : 21333
  tstamp_mode  : NONE
  period_step  : 1
  avail_min    : 1024
  period_event : 0
  start_threshold  : 8192
  stop_threshold   : 8192
  silence_threshold: 0
  silence_size : 0
  boundary     : 1073741824
Hardware PCM card 0 'CA0106' device 0 subdevice 0
Its setup is:
  stream       : PLAYBACK
  access       : MMAP_INTERLEAVED
  format       : S32_LE
  subformat    : STD
  channels     : 2
  rate         : 48000
  exact rate   : 48000 (48000/1)
  msbits       : 32
  buffer_size  : 8192
  period_size  : 1024
  period_time  : 21333
  tstamp_mode  : ENABLE
  period_step  : 1
  avail_min    : 1024
  period_event : 0
  start_threshold  : 1
  stop_threshold   : 1073741824
  silence_threshold: 0
  silence_size : 1073741824
  boundary     : 1073741824

My goal is to force (or allow) aplay to play multi channels sound (actually 4 channels sound only) correctly, by this I mean using the 4 speakers.

2
  • After following the instructions from CL., i was able to play the original file (using the plug statement), and after generating a new (32bit) file i finally was able to play it WITHOUT the plug statement. I am now looking for a way (if there is any) to make this device (surround40:CA0106) default.
    – Pier
    Oct 3, 2013 at 12:00
  • Thanks to CL., i finally got a working setup : By defining a new default device as shown below. Thank you CL.
    – Pier
    Oct 4, 2013 at 12:49

1 Answer 1

2

The .wav file uses a sample format that is not supported by your hardware.

Use the device name plug:surround40:CA0106 to enable automatic sample format conversion.

To make this the default device, use something like this in /etc/asound.conf or in your ~/.asoundrc:

pcm.!default {
    type asym
    playback.pcm {
        type plug
        slave.pcm "surround40:CA0106"
    }
    capture.pcm {
        type plug
        slave.pcm "hw:CA0106"
    }
}
4
  • CL., do you know how i should specify the device (plug:surround40:CA0106) in a config file (/etc/asound.conf ?) to make it default ? In order to allow the following command to work as required : aplay -v -c 4 test-4-channels.wav
    – Pier
    Oct 3, 2013 at 10:56
  • Again ! : Also, from what you said i (mis)understand the wave file was not correctly generated, so if i am able to generate one file that match the sample format required by alsa, would i be able to play it without explicitely specifying the plug device ? Thanks a lot for your time.
    – Pier
    Oct 3, 2013 at 11:04
  • S24_3LE is a perfectly correct, if unusual, sample format.
    – CL.
    Oct 3, 2013 at 14:07
  • Thanks again CL., i'll try the asound conf file asap (should be today).
    – Pier
    Oct 4, 2013 at 9:32

You must log in to answer this question.

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