6

I have two machines under my purview, A and B. B is a very old machine, I've installed apps in Libertine on it, and sounds work perfectly well. On the other hand, on machine A, sound does not work for Libertine containers at all. How do I diagnose this?

Interestingly, on machine A, I created my own unprivileged LXC containers before 16.10 where sound did work, and continued to work after the upgrade; but it does not work on Libertine which uses the same LXC on a fresh 16.10 install.

NOTE

  • both machines are completely stock Ubuntu, only libertine and libertine-scope are installed
  • only conf files for hibernate and gtk3 are edited
  • sound tests from Sound Settings work, only container sounds don't

EDIT

I've tried running speaker-test in the container. It runs produces correct sound on host, but on the container, this error shows:

$ libertine-launch container-name speaker-test -t wav -c 6

speaker-test 1.1.2

Playback device is default
Stream parameters are 48000Hz, S16_LE, 6 channels
WAV file(s)
ALSA lib pcm_dmix.c:1041:(snd_pcm_dmix_open) unable to open slave
Playback open error: -2,No such file or directory
Elder Geek
  • 36,752
Oxwivi
  • 18,499

1 Answers1

4

A bit of research indicates that many newer systems (Machine A) often feature HDMI which is set as default. Your older system (Machine B) likely only has analog audio so that is default for that one.

Issue the command aplay -l to get a list of audio devices you should get output similar to this:

$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: HDMI [HDA ATI HDMI], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: Generic [HD-Audio Generic], device 0: ALC887-VD Analog [ALC887-VD Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: Generic [HD-Audio Generic], device 1: ALC887-VD Digital [ALC887-VD Digital]
  Subdevices: 1/1
  Subdevice #0: subdevice #0

This output should help you determine which card you want to be the default for output.

Look and see which audio out you need (card 0 device 0 is the alsa default which may not be what you need; In my case I need to specify card 1)

Create a file in your home directory with the command gedit ~/.asoundrc (Feel free to substitute your favorite text editor for gedit)

Add the following lines:

pcm.!default {

    type hw
    card *X*
}

ctl.!default {
    type hw           
    card *X*
}

substitute the card number we discovered earlier for *X*

Save the file and try again.

Further possibly applicable information is available here

EDIT: I'm glad that you were able to get 2 audio channels working under Libertine. In regards to your expanded question. You could check the output of amixer scontrols and insure that the output you've chosen supports 6 audio channels and if so use the alsamixer to insure that none of them are muted and that you are in 6 channel mode and not in 2 channel mode as shown below.

alsamixer2channel

To change channel modes in alsamixer use the arrow keys to highlight Channel as shown above and then arrow up or down to select the desired mode.

Sources:

man aplay

https://www.alsa-project.org/main/index.php/Asoundrc#The_.asoundrc_file_format

Elder Geek
  • 36,752