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
  • 35,476
  • 25
  • 95
  • 181
Oxwivi
  • 17,589
  • 53
  • 136
  • 197
  • Is this a particular app or every app that doesn't work with sound? Firefox+Youtube is usually a good sanity check. Just to verify, this is in Unity8? How did you create the container? (this is similar to another recent question https://askubuntu.com/questions/851521/no-sound-launching-x-legacy-app-on-libertine). – Larry Price Nov 30 '16 at 15:34
  • @LarryPrice, it applies to *all* containers, not specific app. – Oxwivi Nov 30 '16 at 15:42
  • @LarryPrice, those same apps work in the Libertine running on Machine B. – Oxwivi Nov 30 '16 at 15:44
  • Have you tried this with new containers, or only existing containers? Maybe a little more information about Machine A would help. Are you using open-source or proprietary video drivers on Machine A? – Larry Price Nov 30 '16 at 15:49
  • @LarryPrice, completely stock. Other than `libertine` and `libertine-scope` and their dependencies, I've installed nothing. The only config edits I've done are enabling hibernate and reverting `gtk3` scrollbar behavior. – Oxwivi Nov 30 '16 at 16:13
  • And yes, I've tried with different containers. From the get go I've planned to separate containers between proprietary, open and game software. – Oxwivi Nov 30 '16 at 16:17
  • 1
    In machine A could you install something that allows choice of audio out like audacious. Then in aud's settings choose alsa. Does sound then work? – doug Dec 01 '16 at 23:55
  • @doug, before I try it, I want to clarify that sounds work on apps running on host works, but not in apps running in Libertine containers. Also, can that be done using `alsamixer`? – Oxwivi Dec 02 '16 at 10:39
  • While the bounty would be nice to have, this sounds like a bug that needs to be reported, and not something that can be answered (or which would remain relevant once said bug is fixed) on Ask Ubuntu. – dobey Dec 02 '16 at 14:19
  • @dobey, the same system ran it fine before (aside from Libertine), and same config works on another machine. I'm of the opinion of trying to find the cause before deciding it's a bug. – Oxwivi Dec 02 '16 at 14:32
  • No reason to file a bug unless it's from a 17.04 install, 16.10 is not that relevant anymore. ( & a bug for 16.10 would require status in 17.04 anyway). As I remember in 16.10 libertine could not use pulseaudio, apps in a libertine container needed to use alsa. (- Though I never used 16.10 at or near release to see if that changed. – doug Dec 02 '16 at 22:57
  • @doug, but it does work on Machine B. – Oxwivi Dec 03 '16 at 12:52
  • Please [edit] your post and add the content of `~/.asoundrc` on Machine A and Machine B. I believe @doug is correct and a correctly configured alsa is necessary. – Elder Geek Dec 06 '16 at 22:51
  • Is pulse-audio installed in both Machine A and Machine B? There has been some mention of [issues with communication between pulse-audio and ALSA](http://www.hecticgeek.com/2012/01/how-to-remove-pulseaudio-use-alsa-ubuntu-linux/) Granted this is an old post but it might be worth exploring as uninstalling,rebooting, testing and re-installing pulse-audio isn't exactly an onerous task. – Elder Geek Dec 10 '16 at 15:50
  • @ElderGeek, do you mean `pulseaudio`? There's no `pulse-audio`. And I've reinstalled stock Ubuntu before, so I don't think reinstalling the package would help. Sound used to work with the unprivileged containers I manually set up before switching to Libertine after trying it on Machine B. – Oxwivi Dec 10 '16 at 18:55
  • Yes that's what I mean. Pardon the hyphen. I wasn't suggesting re-installing pulse audio. Please re-read the comment. And ideally provide an answer to the question. Otherwise I'm done. – Elder Geek Dec 10 '16 at 22:25

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
  • 35,476
  • 25
  • 95
  • 181
  • I updated my question with more details after doing these. – Oxwivi Dec 08 '16 at 01:09
  • Updated answer. – Elder Geek Dec 08 '16 at 01:29
  • Thank you, but that is not my main concern. Getting sound to work on browser apps is a greater priority as I mentioned in the question, and `.asoundrc` doesn't seem to enable it for those apps (possibly because they use PulseAudio?). – Oxwivi Dec 08 '16 at 08:04
  • Actually when you you posted tha bounty on this question it looked like [this](http://askubuntu.com/revisions/855051/3) and clearly stated that "Libertine container sound does not work on one machine, works on another" You have my apologies for answering the question you actually asked rather than providing the answer you wanted. (Unfortunately I have yet to figure out how to read minds) If you have a new question regarding getting sound to work in a specific browser app I suggest that you [ask a new question](http://askubuntu.com/questions/ask) – Elder Geek Dec 08 '16 at 20:09
  • I'll roll this question back to where it was when I answered it. You might also review http://askubuntu.com/help/how-to-ask (especially the last paragraph) – Elder Geek Dec 08 '16 at 20:11
  • What do you mean? For example Google Chrome plays sound perfectly well on machine B within Libertine, but completely silent on machine A's Libertine container. Is that different from my original question because I didn't name specific apps? Because not only Chrome, Firefox, and any other sound playing app does not work from within A's Libertine, but they all work on B's. So far, your answer partially fixed the situation by letting command line apps work. – Oxwivi Dec 09 '16 at 15:30
  • I'm sorry if the fact your answer is an incomplete solution offended you. – Oxwivi Dec 09 '16 at 15:31
  • @Oxwivi I'm not offended by your perception on that score in the least. What's unacceptable is a complete and total rewrite of the question which in effect creates a new question entirely. Please see http://meta.askubuntu.com/questions/16366/best-practices-when-an-op-edits-the-answered-question-creating-an-entirely-new-1 – Elder Geek Dec 10 '16 at 15:33
  • Like I asked, how's it different? Container still can't play with or without your solution, but it works on another machine. – Oxwivi Dec 10 '16 at 18:52
  • Actually, you had indicated that sound was working from he command line test but you were having trouble with 6 channels at which point I edited my answer to cover that. Perhaps if you were to review the edit histories it would provide some clarity for you. Deleting previous comments doesn't change the facts. – Elder Geek Dec 10 '16 at 22:21
  • If you haven't carefully read, I mentioned sound not working from browsers before the channel issue. And the channel issue was a side note, which is why I began with "curiously". I also suggest you peruse the edit hsitory. – Oxwivi Dec 11 '16 at 12:25
  • Okay, I didn't change anything, but it's working with Chrome now. Firefox is still silent. – Oxwivi Dec 11 '16 at 12:42
  • I'm glad you got it sorted. If it's working in Chrome it sounds like you have an issue with Firefox. I recommend that you open a new question focused on that issue rather than this one which has clearly been solved. I've already reviewed the the edit history carefully. At teh risk of repeating myself, Is pulse-audio installed in both Machine A and Machine B? – Elder Geek Dec 12 '16 at 16:38
  • `pulseaudio` is installed on the host, as with any standard Ubuntu install. It's not installed on any of the containers. – Oxwivi Dec 12 '16 at 18:31