Peterborough Linux User Group (Canada) Forum

Linux & Android => Support => Topic started by: fox on November 26, 2017, 05:43:40 PM

Title: Sound problems in my Late 2015 iMac
Post by: fox on November 26, 2017, 05:43:40 PM
This has become the most vexing problem I have faced since converting to Linux. Those of you following my threads about the problems I've had on this Late 2015 5K iMac have already heard about my problems getting distros to boot. These have been solved now, and I have two distros installed (Mint 18.2, Ubuntu 16.04) that have been booting pretty quickly and working pretty well. Until earlier in the week when I discovered the sound problems I haven't been able to solve. They're the same on Mint and Ubuntu: sound in Firefox works well. So does Skype, but I have no sound in Chromium or in any music or video app (rhythmbox, clementine, VLC, player). I don't think this was always the case, and it may be as a result of something I recently installed but if so, I don't know what. Here is the audio output from inxi when running from Linux Mint:

Audio:  Card-1 Advanced Micro Devices [AMD/ATI] Tonga HDMI Audio [Radeon R9 285/380]
           driver: snd_hda_intel bus-ID: 01:00.1
           Card-2 Intel Sunrise Point-H HD Audio
           driver: snd_hda_intel bus-ID: 00:1f.3
           Sound: Advanced Linux Sound Architecture v: k4.8.0-53-generic

Like with the video card problem, I have an onboard and attached audio card. I don't think that's the problem though, first because I do get sound output and second because I can disable the AMD card and it makes no difference. Intuitively, I think that the problem relates to some kind of interference between pulseaudio and alsa, if only that I remember this being a problem that a lot of folks have had in the past. I have tried various online solutions of reloading on or the other, reinstalling one or both, playing with sound settings in sound settings app on gnome or in pulseaudio sound settings. Every once in awhile I actually get it to work, but it doesn't stay working once the music app is closed and reopened, or after a reboot, and whatever trick I have tried doesn't work if I repeat it. I even thought of removing pulseaudio altogether, but removing it threatens to remove a lot of other stuff including the desktop.

I have searched for a solution and tried various possibilities, all to no avail so far. This could be the one problem that either has me going back to the Mac OS on this otherwise great iMac, or has me selling it. If you have a suggestion, I'm all ears!
Title: Re: Sound problems in my Late 2015 iMac
Post by: Jason on November 26, 2017, 06:55:28 PM
You probably already checked this but in the volume setting on the menubar or tray, under Sound Settings, you may have a tab for Applications. Try this when you have sound working on one application and not another. Make sure they're both running, I mean. It could be that the sound for particular applications is defaulting to low enough you can't hear it. I only know the steps for doing this in LM Cinnamon but other versions of LM should have similar settings.
Title: Re: Sound problems in my Late 2015 iMac
Post by: fox on November 26, 2017, 07:27:32 PM
Thanks, Jason. I did check that and the sound volume on the "oscilloscope" was high enough.
Title: Re: Sound problems in my Late 2015 iMac
Post by: ssfc72 on November 26, 2017, 07:33:55 PM
Mike, Maybe a small usb sound dongle, would get around this issue. Maybe one of the PLUG members would have one, if you don't.

Bill
Title: Re: Sound problems in my Late 2015 iMac
Post by: fox on November 26, 2017, 10:18:19 PM
What's a sound dongle, Bill? Whatever it is, I would gladly try it. I did try plugging in a pair of usb speakers thinking it might be a port issue, but they didn't make any difference at all.
Title: Re: Sound problems in my Late 2015 iMac
Post by: ssfc72 on November 27, 2017, 02:23:41 AM
A usb sound dongle is a small usb sound card, with audio out and mic in, ports.  It is about the same size as a usb flash drive.
Title: Re: Sound problems in my Late 2015 iMac
Post by: fox on November 27, 2017, 06:47:18 AM
Thanks for that, Bill; I didn't know these existed. I assume you plug speakers into them. Not the greatest solution since the speakers in my iMac are much superior to any cheap ones I own, but I would do this if it works. Staples and Best Buy sell cheap models, but they have to be ordered and I don't know whether it would even work. So over to the Club - anyone have a usb sound card I could try out?
Title: Re: Sound problems in my Late 2015 iMac
Post by: ssfc72 on November 27, 2017, 07:55:45 AM
OK Mike, if no Peterborough PLUG member has a usb sound card dongle, to loan you, then I have one you can try.
I bought it for a project I am going to build, but the dongle doesn't even have a case, just a bare circuit board. Got 2, from ebay for about $3.50 each.

https://www.ebay.ca/itm/CM108-USB-Drive-Free-USB-Sound-Card-Laptop-Computer-External-Sound-Card-Module/272374780193?ssPageName=STRK%3AMEBIDX%3AIT&_trksid=p2060353.m2749.l2649

I just tried it on my Mint 18 notebook computer and it works fine, plug and play operation. :-)
Title: Re: Sound problems in my Late 2015 iMac
Post by: Jason on November 27, 2017, 10:54:37 AM
I had purchased one for an old PC that my wife is using now. The sound had mysteriously disappeared and then came back. You're welcome to try it. And then you can order one for yourself if it does work. This is the one I have:

https://www.amazon.ca/Sabrent-External-Adapter-Windows-AU-MMSA/dp/B00IRVQ0F8/ref=sr_1_2?ie=UTF8&qid=1511797772&sr=8-2&keywords=sabrent+sound

I'd sell it to you, but I'd like to keep it around for a backup. I also got it for half the price that it costs on Amazon now.
Title: Re: Sound problems in my Late 2015 iMac
Post by: fox on November 27, 2017, 08:37:10 PM
Thanks, Bill and Jason; much appreciated. I sure don't mind buying one if it works to solve this problem. Better than giving up on this otherwise great computer (or giving up on using Linux on it). Jason, I saw the Sabrent model you have can be ordered from Staples or Best Buy, so getting one isn't the problem. I just want to know it works.

If one or both of you is coming to PLUG MUG on Thursday and you bring it then, I'll give it back at Monday's meeting. If not and you bring it to the meeting, I'll bring it back at Thursday's PLUG MUG. Thanks!!!
Title: Re: Sound problems in my Late 2015 iMac
Post by: Jason on November 28, 2017, 12:52:35 AM
I'll be there Thursday.
Title: Re: Sound problems in my Late 2015 iMac
Post by: fox on November 29, 2017, 12:43:57 PM
I am convinced that the problem is somehow linked to pulseaudio, but I have yet to find a viable solution. Based on this (https://askubuntu.com/questions/489609/how-can-i-cleanly-remove-pulseaudio-in-ubuntu-14-04) article, I tried killing pulseaudio in Mint, and got sound back in rhythmbox. But later after some Firefox and Chromium, the sound no longer worked in rhythmbox. There is something key I am missing, but I think I'm on the right track. I'll be interested to see if the sound dongle makes any difference. I did try earphones this morning, and they didn't bring back the sound.

On Mint 18.3, I noticed that I could get sound in rhythmbox, and change songs and still get sound. I then started Firebox, quit it and went back to rhythmbox. At that point, no sound. Coincidence or is this the pattern I've been looking for? Even if it is, what do I do with that information because I'm always going to be using my browser.
Title: Re: Sound problems in my Late 2015 iMac
Post by: Jason on November 29, 2017, 07:37:27 PM
I don't know if it's any help but I happened to find this:

http://www.troubleshooters.com/linux/sound/sound_troubleshooting.htm
Title: Re: Sound problems in my Late 2015 iMac
Post by: fox on November 29, 2017, 09:59:23 PM
Thanks, Jason. I hadn't come across this article and it does help to put things into perspective. I'm going to try the unmute command, but I'm pretty sure from using other tools that this isn't the problem. I think I'm down near the bottom, possibly with alsa-pulseaudio conflicts. But I now suspect that the new Firefox might be part of the problem or even THE problem. I discovered this possibility at the end of the day and didn't have time to test out my theory. If I am correct, then the solution might be to either go to an earlier version of FF, stop using it altogether or find a way to alter its configuration settings to eliminate whatever is causing the conflict.
Title: Re: Sound problems in my Late 2015 iMac
Post by: Jason on November 30, 2017, 01:44:29 AM
For some reason, I had you as a Chrome user. It's weird to think that Firefox is causing an issue but I don't think a lot of people run Linux on Macs so you might be in new territory here. You could Firefox ESR (Extended Support Release). It's basically the enterprise version. You can think of it as the LTS version of Firefox. I don't know if there is a repo for it.

You could also try disabling Flash and any other media plugs in Firefox to narrow down the problem. Same with Chromium. Also, try turning off hardware acceleration.
Title: Re: Sound problems in my Late 2015 iMac
Post by: fox on November 30, 2017, 07:06:17 AM
The Firefox ESR lists it as a corporate edition and directs individuals to their regular FF page. Is ESR just an older version of FF with long-term support? I'm asking because now that I think about it, my sound problems started around the time FF was upgraded to the current version. If it's the cause, that's unfortunate because I really like the new version.

Now that I think about it, OMG Ubuntu posted an article about the new version of Firefox requiring pulseaudio (http://www.omgubuntu.co.uk/2017/03/firefox-52-no-sound-pulseaudio-alsa-linux); they apparently refuse to give it the option to run on alsa. But the article does mention that the ESR version still allows alsa. But even if Firefox turns out to be my problem and I install the ESR, I don't see how I can force it to run on alsa. You can't uninstall pulseaudio in either Ubuntu or Mint, so your only option is to disable it. So if I find that Firefox is the culprit, I'll just have to switch browsers on the problematic 2015 iMac. Ironically, my older 2011 iMac has none of these problems, and appears to be using the same drivers as the newer one. These iMacs are the first computers I've had that use AMD cards since switching to Linux. With iMacs, you have to buy a 2012 or 2013 to get Nvidia cards. But older ones were able to use different Linux drivers for AMD/Radeon cards; probably the reason why my 2011 doesn't have the problems I've faced with the 2015.
Title: Re: Sound problems in my Late 2015 iMac
Post by: Jason on November 30, 2017, 01:30:33 PM
Yeah, I said Firefox ESR was the enterprise version which is the same as saying corporate version - just in the IT industry, they usually say enteprise. It's an older version yes, but they keep updating it with security updates and bug fixes. Every year around March, they introduce a new ESR version that is synced with the latest version of Firefox. See the lifecycle lower on this page:

https://www.mozilla.org/en-US/firefox/organizations/faq/

Eventually, you could face the same issue but it might give the Firefox team time to fix whatever bug is causing this. In any case, this would be safer than using an older version of Firefox that probably has unpatched known vulnerabilities.

QuoteBut even if Firefox turns out to be my problem and I install the ESR, I don't see how I can force it to run on alsa.

I would assume that the ESR version runs on alsa by design. I imagine if you have alsa installed, it will use it.

In any case, if you like the new Firefox, you may like Chrome. You could try installing that and see what you think. It does have the angle tabs though, not the boxy ones you seem to like. Note that Chromium and Chrome aren't the same browsers though they are very similar.
Title: Re: Sound problems in my Late 2015 iMac
Post by: fox on November 30, 2017, 05:44:49 PM
Well, at this point I don't have strong evidence that Firefox is what's causing the problem. Whatever the problem is, it's weird, and at this point unpredictable. I tried a sequence of actions that involved opeing the sound app and making sure I had sound, running a youtube video on Firefox, killing pulseaudio, and then starting up rhythmbox. Sometimes it worked and I could play music, other times not. Once I had play, I had to keep music playing because as soon as I stopped, it would lose sound when I started up again. This was even if I kept the app running. So something must be going on in the background that I'm not seeing. It's clearly some kind of software conflict, but it must be hardware-related as well because it doesn't happen on my 2011 iMac.
Title: Re: Sound problems in my Late 2015 iMac
Post by: Jason on November 30, 2017, 05:52:19 PM
Try running the apps from the terminal instead of clicking on the icon. You mean see error messages. Maybe even look for logs related to sound or hardware.
Title: Re: Sound problems in my Late 2015 iMac
Post by: fox on December 01, 2017, 08:59:51 AM
Best Linux news I've had in weeks - sound runs in all apps when I hook up speakers to the sound dongle I borrowed from Jason!!!!  And I don't have to play with any settings to get it to work; it just does! This includes Chromium as well as rhythmbox and Firefox. I confirmed that the sound now works in Mint 18.3, Mint 18.2 and Ubuntu 16.04.

This now makes me think back to a post I read a long time ago, where someone wrote that they had trouble getting sound from their internal speakers because the software assumed there were 4 speakers and activated the two that were nonexistent. I'll look into this later when I have time.
Title: Re: Sound problems in my Late 2015 iMac
Post by: Jason on December 01, 2017, 02:20:59 PM
Cool! But you only have two speakers, right? And you couldn't it to work with headphones consistently with headphones either if I recall correctly.
Title: Re: Sound problems in my Late 2015 iMac
Post by: fox on December 01, 2017, 04:09:21 PM
Yes, you're right; the iMac has only two internal speakers. I only thought of this explanation because I read that something like this happened because of so-called front and rear internal speakers in another post. It very well may not be the explanation, and now that I have a solution, I'm not willing to spend too much more intensive time researching the problem. What I am going to try is to copy the pulse drivers in ~/.config/pulse from my home iMac (the 2011 that doesn't have this problem) and paste them into this one and see if that works. If it doesn't, then I'll be running my 2015 iMac on external speakers until a better solution "appears". I don't really care that the sound quality of my cheap external speakers is lower than that of the internal iMac speakers. I only use them for background music while I'm working. The important thing is I don't have to run the MacOS on this computer to listen to music!
Title: Re: Sound problems in my Late 2015 iMac
Post by: fox on December 04, 2017, 02:42:23 PM
I tried one other thing. I dumped all of the config files in .config/pulse. Then I opened the Sound panel and made sure that the internal speakers were selected and that the test sound worked. Then I turned on rhythmbox. Now I could play my music, stop, play another tune. I could even close rhythmbox and open it again and play a sound. BUT, as soon as I opened Firefox and played a youtube video, I got no further sound from rhythmbox. I don't want to have to go through all this every time I want to play music, so I'm now going to order a sound card like Jason's, and keep my external speakers hooked up. Not the perfect solution, but not so bad either.
Title: Re: Sound problems in my Late 2015 iMac
Post by: Jason on December 04, 2017, 03:56:41 PM
Sometimes the easiest solution isn't the most elegant but it's easier than continually banging your head against a wall!
Title: Re: Sound problems in my Late 2015 iMac
Post by: fox on December 04, 2017, 06:29:13 PM
Although I have now ordered the sound card, I have one more idea to try and it goes back to an older idea. Since rhythmbox seemed to work OK until I started Firefox (that is, after I purged the pulseaudio config files and rebooted), this has me thinking again that Firefox could be the culprit. So maybe if I went back to the older version of FF available as ESR, then perhaps the audio player sound problem would disappear. At least worth a try. Even if it works, I would then have to decide whether I want to forgo the new features of FF 57 to get sound out of my internal speakers, when I now have a solution that gives me sound with the current version of FF. But inquiring minds want to know what's going on here!!!!
Title: Re: Sound problems in my Late 2015 iMac
Post by: Jason on December 05, 2017, 12:58:23 AM
Sure, and eventually the ESR does catch up with the newest version of Firefox, if for but a short while, I think in March? With any luck, by then they will have fixed this issue.
Title: Re: Sound problems in my Late 2015 iMac
Post by: Jason on December 05, 2017, 01:32:30 AM
You might have already tried this (sorry, too lazy to check again), but I notice in the LM 18.3 Cinnamon release notes  (https://www.linuxmint.com/rel_sylvia_cinnamon.php)it says under "Sound and microphone issues":

QuoteIf you're facing issues with your microphone or your sound output, please install "pavucontrol".

This will add "PulseAudio Volume Control" to your menu. This application has more configuration options than the default volume control.
Title: Re: Sound problems in my Late 2015 iMac
Post by: fox on December 05, 2017, 06:55:32 AM
Thanks, Jason but yes, I have already installed pavucontrol and tried to use it to solve my sound problems. When I installed it, I had been hoping that it would reveal "hidden" internal speakers that my iMac doesn't have. That was not the case, and I'm now thinking that my problem has nothing to do with routing sound output to speakers that don't exist.
Title: Re: Sound problems in my Late 2015 iMac
Post by: fox on December 05, 2017, 09:58:43 AM
Well, Firefox-esr doesn't fix the problem, so my only solution is the sound card. But that's ok.
Title: Re: Sound problems in my Late 2015 iMac
Post by: Jason on December 05, 2017, 10:12:47 PM
Interesting so it's not *just* the new Firefox that's the problem.