Viewing posts tagged sound
But I want a software mixer. Pulseaudio to the rescue! Apart from the fact that the documentation of remap-sink leaves a bit to desire, this is fairly easy. First, our ~/.asoundrc reduces to
I cannot find any other tool that encodes AC3 to IEC958 than vlc and mplayer. Both are not suitable for the task for different reasons. One idea would be to modify the alsaplay (aplay) ALSA example application to do the encoding. But while researching the topic I asked myself: why couldn't just ALSA do it by itself? It's just wrapping AC3 into a bit stream, and the mplayer code for it looks fairly simple. Let's see how ALSA plugins are working anyway... So I downloaded the alsa-plugins source code and... WAIT, WHAT IS THAT?! There is a directory "a52". It contains exactly the module I was looking for. It does not encode an AC3 stream to an IEC958 transport stream, it creates the whole transport-encoded AC3 data from PCM data and writes it to the SPDIF device of the sound card. That's even more I asked for!
The upmix pipe is nice, but quite complex and limited to applications which have piped output. Maybe we can get the latency down and probably can get sox out of the mix... ALSA can remix channels with the "route" plugin, and it can output to a pipe. Let's put the following in the ~/.asoundrc:
How to construct a 2.1 signal from a stereo signal? We are going to encode it as AC3 ("Dolby Digital"), with the original stereo channels left and right mapped to front left and right, center and rear channels being muted, and bass getting the sum of half of the level of left and right channel. Strictly speaking, we should run the the bass signal through a low pass, but it is not necessary for my speaker system, as the active bass box has a built in low pass with an adjustable cutoff frequency.
I recently upgraded my set of speakers after my old Braun boxes finally reached their end of life. The "surrounds" of the speakers were degraded too far after almost 30 years. Given that the speaker system was from Braun's budget series of speakers (still relatively expensive at the time) it does not make sense to refurbish it. So I replaced the front speakers with a set of Nubert nuJubilee 35 (comparable to nuLine 32) speakers. If you are a fan of the 70th classic music sound like me: give Nubert speaker systems a try. At least the nuLine series is quite close to the sound of medium to large Brauns, though slightly more modern (i.e., more bass.)