[pulseaudio-discuss] Custom codec with three channels
tanuk at iki.fi
Mon Jan 20 03:29:10 UTC 2020
On Wed, 2020-01-15 at 18:48 +0100, Matej Kupljen wrote:
> Hi all,
> I have an custom embedded board with the i.MX6 SoC which has WM9712
> AC97 codec connected to it. This codec supports 3 channels and has 3
> DACs. Two 16 bit DACs for Left and Right channel and one 12 bit DAC
> which can be configured to use one of the AC97 slots.
> I have modified the codec driver and the SSI driver for the i.MX6 so I
> can use all three channels.
> I have selected to use AC97 slot 3 and 4 for Front Left and Front
> Right channel and AC97 Slot 5 for this third channel.
> If I use speaker-test utility with:
> # speaker-test -t wav -c 3
> I can hear the sound on all three channels as Front Left, Front Right
> and Rear Left.
> Now, I'd like to use pulseaudio server. However, I cannot get a sound
> on the third (Rear Left) channel. If I run speaker-test I get the
> sound on Front Left and Front right, but not on the third one.
> If I run speaker-test with -D hw:0,0 parameter so it directly uses
> ALSA driver, I can hear the sound on all three channels.
> I tried adding this configuration options to /etc/pulse/daemon.conf:
> default-sample-format = s16le
> default-sample-rate = 48000
> default-sample-channels = 3
> default-channel-map = front-left,front-right,rear-left
> Also tried loading alsa module with
> module-alsa-sink device=hw:0,0 channel_map=front-left,front-right,rear-left
> But, I cannot get the sound on the third channel.
> Any suggestions how to configure pulseaudio server for this custom set-up?
> Is this even possible with my custom set-up?
> Any suggestions/hints would be appreciated.
Alsa doesn't allow applications to specify what channel map they use,
so the channel map is always the default. For three channels there's no
standard channel map, so I checked what channel map speaker-test gets
assigned. It gets front-left,front-right,aux0. The aux0 channel won't
be played anywhere. You could set your sink channel map to front-
left,front-right,aux0 and you'd probably get audio from speaker-test,
but you won't get audio from applications that use some other channel
map (although no normal application will play three channel audio
anyway, so it's unclear to me how you're planning to use the third
For testing the third channel, you can try this command:
paplay --channel-map=rear-left /usr/share/sounds/alsa/Front_Center.wav
Front_Center.wav is a mono file, and the --channel-map argument allows
you to tell paplay to play that mono file to a particular channel.
More information about the pulseaudio-discuss