Linux audio being resistant...

Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.
I'm normally a windows user, but last night installed linux Mint on an old laptop to test some of the audio software people have been recommending. Sadly, my trials haven't been going well.. I can't even reliably make it use the USB DAC instead of the laptop's speakers. After about two hours of changing settings in different orders I somehow had it working, so it can do, but after a re-boot it was back once more to the laptop speakers. <swear!>

Having tried to look at the linux sound system it appears to be quite involved, even messy. ALSA needs various fudges and struggles to load/name sound cards in the same order each time, various control applications seem to fight each other (or do nothing), and looking for help on the net is confused by the different distros and their differing (yet all very very scary looking) config files. It also seems possible that in the absence of special drivers (Linux versions of which don't exist for my DAC) the software may not be able to control playback volume of a generic USB audio output. And I haven't even started looking at anything complicated, like preventing re-sampling between app, alsa and dac. [/rant]

....Admittedly theres a good chance I'm both inept and too fixed in the windows mindset, but is linux audio really this complicated or am I missing something obvious?

Thanks,
Kev
 
Hmm, Mint 17 on my notebook:

1) hooking usb soundcard, right click on the speaker icon in the tray - Properties - Output devices - choosing the "USB Audio Analog"

2) Keeping the usb devices plugged-in, poweroff. Upon booting, the usb audio is kept selected.

3) Poweroff, unpluggin the usb card, booting. Upon hooking the usb card, the usb audio does not get selected automatically, I have to repeat 1). That is correct, IMO.

What could be more straighforward?

Another thing is if you want to configure your specific playback software to use alsa directly and use only the usb device, independent of your GUI audio setup. Then it is a matter of entering the usb soundcard name into the alsa device configuration of the player app.
 
I'm normally a windows user, but last night installed linux Mint on an old laptop to test some of the audio software people have been recommending. Sadly, my trials haven't been going well.. I can't even reliably make it use the USB DAC instead of the laptop's speakers. After about two hours of changing settings in different orders I somehow had it working, so it can do, but after a re-boot it was back once more to the laptop speakers. <swear!>
I'm not a hardcore linux user and, until about 6 months ago, I have been using Windows. I have used linux systems in the (distant) past when GUIs didn't even exist for them... now things are a lot easier under Linux. Yay.

I don't have any experience with MINT. I have been using Ubuntu 15.04. If you try that, I could help walk you though it in detail. It have some features that might be intuitive for someone like yourself coming from Windows...

RE your DAC - open a terminal window and type 'aplay -l' (that's a lower case L) and 'aplay -lL' (both lower and upper case L used). These will give you some useful low level information about the ALSA card and device that are recognized by the OS. Both of these can provide useful info for getting the sound to the right output(s).

I recommend that you install and try the VLC player. This is because it can be set to direct output to the same device each time using its own config file. No need to use OS config for this purpose. Just queue up a track and then use the menu item 'Audio > Audio Device' to select where the audio output should be directed. If you want to make that setting permanent, you use the menu item 'Tools > Preferences' to open the config settings interface. First look for (at bottom) "Show Settings" and select "All". In the list, click on 'Output Modules' under 'Audio. Select 'ALSA' as the audio output module. Then expand (click on the little plus sign or triangle) next to 'Output Modules' and click on 'ALSA'. In that page choose the ALSA device (it should be listed by name, e.g. "USB DAC Front Speakers"). Finally, click the SAVE button at the bottom and restart VLC to enable the changes. This will now be the output device for VLC each time you open it. Easy peasey.

Having tried to look at the linux sound system it appears to be quite involved, even messy. ALSA needs various fudges and struggles to load/name sound cards in the same order each time, various control applications seem to fight each other (or do nothing), and looking for help on the net is confused by the different distros and their differing (yet all very very scary looking) config files. It also seems possible that in the absence of special drivers (Linux versions of which don't exist for my DAC) the software may not be able to control playback volume of a generic USB audio output. And I haven't even started looking at anything complicated, like preventing re-sampling between app, alsa and dac. [/rant]

....Admittedly theres a good chance I'm both inept and too fixed in the windows mindset, but is linux audio really this complicated or am I missing something obvious?

Thanks,
Kev
You shouldn't need to edit the OS config files at this point. I would not try to mess around with ALSA itself before you get more comfortable with things. Don't do that unless you know what you are doing or have a very good example to follow.

To control playback volume, there is a command called 'alsamixer' that you can run in a terminal. This opens a crude graphic-ish control interface for the ALSA devices. There are a couple of useful commands to know when inside alsamixer. F6 opens a little menu that lets you choose which soundcard you are looking at. The OS will have a 'default' one typically, and your USB soundcard is another one. It's likely that you need to press f6 and choose the USB card from the menu. Then you will get (likely) several mixer controls. These control volume and sometimes set things for the card. Use the arrow keys to move between controls. Make sure that they are set to 100% or 0dB (sometimes gain above 0dB is also possible). Press the escape key to exit alsamixer. I use this program to make sure my outputs are not muted, and to see what ALSA sees for my output device (e.g. the DAC). Changes you make should be permanent, e.g. survive a reboot unchanged.

I haven't found that ALSA needed any fudges to load cards in the same order but I am no expert. You can always post the output from aplay -l to show us what is happening.

Let us know what you find, and try some of my suggestions above, at least as a starting point. Leave the worries about sample rate conversions for later and focus on getting up and running for now. Keep your chin up!
 
phofman - That would be very easy, yes. Pretty much what I'd have expected really. Unfortunately for some reason that I can't discover, my usb sound device isn't listed as an option in the output devices of the volume control, or any of the players I've so far tried.

I'd have thought the dac may be incompatible, although it uses standard USB audio protocols and did actually work for a while. Also, typing $ aplay -l at a terminal shows it very clearly as a sound card, as does AlsaMixer and GNOME ALSA Mixer - though without any control over the volume. Its like the system knows its there, but other parts of the system don't.

Unfortunately in trying to fix this I seem to have broken pulseaudio now, another link in the audio path that the alsa volume control apparently needs. I'm not very familiar with all this command line and config file stuff so have probably done something stupid. But if thats the only way to do it I'll have another attempt; I hadn't realised player applications would have their own alsa device configs so its worth a go if I can find it.. In some cases I even struggle to find the software itself after installation if it doesn't put something in the start menu.

Umm, I've used linux on and off in the past with no great problems, but only for very basic/simple things. It appears I really am very, very useless when I have to go much beyond the GUI.

Thanks for the suggestion,
Kev
 
Charlie, thanks very much indeed for that, I'll be able to work my way through it. Theres been one Doh! moment already - I'd previously tried VLC going into the advanced audio options and trying all the audio output modules, but I never noticed the audio device menu you mentioned. My DAC is there (in buckets!) and it all works instantly!!! It even controls the volume. Thanks!

I wonder why all the main GUI system volume controls and mixers I've so far tried all refuse to list it. I like VLC but it wouldn't be my first choice of audio player. Hmm, so it shows things 'can' work then, I just need to somehow get the general system to hang together.

My reply above overlapped with yours, as you can see I'd already looked at a few things like the aplay -l and alsamixer - though perhaps incompetently. I'll try to investigate further and maybe take some screen shots or copy the output.

Cheers
Kev
 
Last edited:
If your sound setup is broken by your changes, I would strongly recommend to reinstall. The Mint installation takes just a few minutes.

I have never heard of a soundcard visible in aplay -l not appearing in pulseaudio. But I have not seen many things yet.

What is your DAC model? Are you sure it really has a built-in volume control? Sometimes the USB audio implementation of these controls is buggy and alsa routines upon accessing the controls throw errors. Such condition could perhaps cause pulseaudio not accept/list the sound card. It would likely be seen in dmesg for the driver and pulseaudio logs.
 
Yeah, its quite a lot slower on this old machine but a reinstall isn't too bad - definitely more certain than me trying to fix it manually. I did try reinstalling pulseaudio and thought I was getting somewhere as it now offered a root hub which I guess is USB related - except it only has analogue or s/pdiff flavours so maybe not.

The DAC is a cambridge audio dacmagic plus. I guess quite old (I got it second-hand some years ago) but nothing on the windows PC ever had trouble controlling its volume, and it has a manual volume knob controlling the digital side of things, but I guess that doesn't mean it would work on a linux system. Though VLC on linux can do so, which is encouraging. When I've reinstalled I'll try to check out the logs.

On the plus side, VLC has been running OK for nearly an hour now; if other players can be directed to specific output hardware then it may be the solution. I'll have to see if mpd or its clients can do that too. I'm not convinced the sound quality is all that it should be, there seems to be some distortion, but thats an issue for later.

Thanks again,
Kev
 
Very interesting, thanks. As a re-install is needed anyway, maybe trying the audiophile distro would be worthwhile. I was hoping to use something a bit more generic, but poking around at the config files last night there seem to be all sorts of blacklists, patches and interlacing of duties going on that I'm finding it hard to follow - so under the circumstances perhaps a distro that has already tackled some of my issues could be the way to go.

Mint has been a big step forward in other ways though. I was trying lightweight distros initially, due to the the slightly old laptop, but in general the bigger, more comprehensive flavours are easier for a noob to install and set up and they don't actually run that badly. The inclusion of necessary drivers etc is also a big help, even if they aren't always open.

I've tried linux several times over the years and its always been abortive due to compatibility issues with key hardware that I don't have the skill to sort out. I didn't expect such problems with this simple role, but at least it seems like some kind of configuration problem rather than a fundamental incompatibility with the DAC so fingers crossed.

Cheers
Kev
 
Last edited:
I gave the link in order to show that they discuss your DAC and make it work, not to suggest changing your distro. You would not gain anything with regard to your DAC, all distros use stock alsa drivers. For me Mint Mate has been the desktop distro of choice.

You have been unfortunate to hit a pretty rare problem that alsa sees your card and pulseaudio does not. Is it actually still the case?
 
I have certainly not shared your experiences or opinions of the Linux sound system.
I regularly manipulate 2 or 3 sound devices. The system does not have major or even any differences between distributions and none of them are "messy".
Just persevere with the learning curve. I find any version of "Windows" limiting and completely frustrating,
Frank
 
I gave the link in order to show that they discuss your DAC and make it work, not to suggest changing your distro. You would not gain anything with regard to your DAC, all distros use stock alsa drivers. For me Mint Mate has been the desktop distro of choice.

You have been unfortunate to hit a pretty rare problem that alsa sees your card and pulseaudio does not. Is it actually still the case?
Yeah, no worries - i understood the purpose of your link. It just got me thinking about possible benefits of gong for a distro thats already packaged and tweaked with audio use in mind. However I notice the current version is 64-bit only and my old laptop is 32 so I'm going to persevere with Mint. It also looks like the audiophile distro is optimised for low latency, which I don't need and is likely to cause problems in sound quality if/when my modest hardware struggles to maintain the latency.

I spent another few hours playing with (re-installed) Mint and got a bit further. I had the DAC connected during install this time, and the option for 'root hub' appeared in the volume control's output devices, like it did when I re-installed pulseaudio on a previous attempt. This device only has profiles for analogue or S/PDIFF output, no USB, but for reasons I'm not sure of this appears to work with my USB DAC. It makes no difference if I set it to the analogue profile or the S/PDIF one, so I'm a tad suspicious and at a loss to understand how the audio is being routed, let alone how well, but its progress.

The distortion I had yesterday appeared to be because the volume was set over 100% by default - I've corrected that and it has helped, although somewhere in the system things are being attenuated too much as the SPL is much quieter than when played from windows or mac, irrespective of what player I use - I can't see any volume controls on players or the system that are set low though. There are also many pops and tiny gaps/skips in playback as if the system is struggling to keep up. Possibly that could be solved by using software with a buffer, so I'll look into that next.

So its now working to a degree, which is excellent. But I'm completely mystified by how, so I don't understand what things could be happening in the audio path - such as the volume issue and potentially less obvious ones like re-sampling and so on.

Cheers
Kev
 
It's Mint 17.2 and the mate version?

Cinnamon needs more system resources so not as vintage friendly as the Mate edition. There's also Ubuntu mate which might be worth a blast, remembering that you can preview from a live cd before install, just to check what's detected etc. (Not sure if Jack is installed too, maybe just a software interface that).

But the avenues people have already stated in other posts are the better options, also the Main Page - Linux Mint forum, there's a hardware support section and the users are often very sympathetic.

I've used mint since release 8 and always found it works very well but I've never pushed it in terms of audio. I also appreciate that telling you this doesn't help outright but hopefully it's reassurance that something will fix it. Then again some devices especially older ones dont play too well and a little workaround is needed, exactly what you're doing now.

There are more configurable hardcore versions available (like Arch Linux etc) but it's a lot to take on.

Hang in there, best
Nathan
 
Last edited:
I have certainly not shared your experiences or opinions of the Linux sound system.
I regularly manipulate 2 or 3 sound devices. The system does not have major or even any differences between distributions and none of them are "messy".
Just persevere with the learning curve. I find any version of "Windows" limiting and completely frustrating,
Frank
Thanks Frank. Yeah I'm sure much of this is due to my inexperience with linux, combined with my hardware not automatically playing as nicely with it as it could. The manufacturers of my DAC say it works with linux but I notice they stop short of officially saying its supported (unlike windows and mac), perhaps this is why.

Perhaps the messiness is only in my perception too; I'm used to a more sequential/layered approach as the audio makes its way from file to the outside world, whereas linux seems to do a lot more passing back and forth, apparently even across layers. I guess it probably makes things more flexible if you understand it in detail, but harder to get to that point. It seems I have a lot of reading ahead if I want to understand enough of what is actually happening to have ownership of the process.

Cheers
Kev
 
It's Mint 17.2 and the mate version?

Cinnamon needs more system resources so not as vintage friendly as the Mate edition. There's also Ubuntu mate which might be worth a blast, remembering that you can preview from a live cd before install, just to check what's detected etc.

But the avenues people have already stated in other posts are the better options, also the Main Page - Linux Mint forum, there's a hardware support section and the users are often very sympathetic.

I've used mint since release 8 and always found it works very well but I've never pushed it in terms of audio. I also appreciate that telling you this doesn't help outright but hopefully it's reassurance that something will fix it. Then again some devices especially older ones dont play too well and a little workaround is needed, exactly what you're doing now.

There are more configurable hardcore versions available (like Arch Linux etc) but it's a lot to take on.

Hang in there, best
Nathan

Thanks Nathan. Yeah, I'm fairly happy with Mint, at east of the distros I tried. I intitially made the mistake of trying lightweight ones due to my hardware, but actually as a noob the more complete distros are much easier to deal with. I tried Lubuntu but that was a dead loss, it claims to work on old hardware but in reality needs PAE enabled CPUs so I may as well used ubuntu, but Mint seems even better wrt laptop drivers and the XFCE flavour runs fine on the old CPU so thats good. I can't get it to work nicely with the power handling (it won't re-awake from screen or system sleeping) but probably I can find a way to disable it.

so the message in general is clearly to persevere :)

Cheers
Kev
 
It just got me thinking about possible benefits of gong for a distro thats already packaged and tweaked with audio use in mind.

I am VERY sceptical about general-purpose distros "tweaked" for audio. IMO the major tweak is the catchy name.


It also looks like the audiophile distro is optimised for low latency, which I don't need and is likely to cause problems in sound quality if/when my modest hardware struggles to maintain the latency.

Very true. Low latency for simple audio playback (not music creation) is a myth. That is why I do not like these distributions - they aim at clueless audiophiles with positive attitude to buzzwords.

I had the DAC connected during install this time, and the option for 'root hub' appeared in the volume control's output devices

That's weird, why should a USB root hub appear as a sound device. Please post output of lsusb here.

This device only has profiles for analogue or S/PDIFF output, no USB

Soundcards have generally only analogue, spdif, or hdmi outputs. They have no USB outputs.

but for reasons I'm not sure of this appears to work with my USB DAC
IMO it is your dac, just the name is incorrectly parsed (root hub)

Does your USB device have SPDIF output? I doubt that. IMO that profile is there just in case it has SPDIF output. I do not know why it is there at all. I would not worry about that.

although somewhere in the system things are being attenuated too much as the SPL is much quieter than when played from windows or mac, irrespective of what player I use - I can't see any volume controls on players or the system that are set low though
.

Sometimes proprietary windows/mac drivers include various boosts and devices sound different (louder) then. Perhaps you overlooked some volume control (master, application-specific, ...)?

There are also many pops and tiny gaps/skips in playback as if the system is struggling to keep up
.

That should not happen. But I have rather bad experience with old notebooks sharing graphics card IRQs with the USB controller, I could never make them output audio without occasional stutter. But these guys were over 10 yrs old.

Possibly that could be solved by using software with a buffer

Pulseaudio generally handles the buffers automatically. I would suggest to pick a player you like and configure it to output directly to your USB soundcard, without pulseaudio. Often these players allow you to configure the buffer/period values, I would make them as large as possible.
 
Thanks for all the thoughts - most helpful. If the root hub was in fact the USB DAC that would explain a lot! The analogue or SPDIF out profiles are still a slight mystery, as there is neither - from the laptop's POV its just a usb port output to the usb in on the DAC; perhaps it refers to a different part of the audio path.

Possibly I'm expecting too much from my old hardware and from the drivers, running linux. I can't find any other volume controls anywhere so probably (as you say) the level is what it is with the linux drivers. The old laptop does run XP and it has no problems then so it isn't inherently incapable, but I guess XP is old enough to be an unfair comparison with the very latest modern Linux OSs, especially if the drivers etc aren't very optimum. Unfortunately I broke things again last night, poking around with the power saving options which also don't seem to like the laptop. I'm going away for a few days now, but next week I'll reinstall and post the lsusb.

Still, should be good enough for testing audio software at least, which was the main purpose of this. And its been useful to find some of the differences from windows and mac. TBH I haven't (so far) found Linux better as such, its much improved over older versions but still seems to have more trouble wrt hardware/drivers, but I suspect its strength will be in the range of software available so if I find something I particularly like I'd be willing to persevere.

Thanks for all the help,
Kev
 
Last edited:
The analogue or SPDIF out profiles are still a slight mystery, as there is neither - from the laptop's POV its just a usb port output to the usb in on the DAC;

They are profiles from the POV of the soundcard, not your laptop. Cards have either analog or SPDIF or HDMI outputs.


The modern linux USB audio drivers are ok for correctly implemented sound cards. Unfortunately some cards are buggy and the drivers do not like that. They are full of quirks for non-standard USB audio implementations kernel/git/tiwai/sound.git - Sound sub-system tree kernel/git/tiwai/sound.git - Sound sub-system tree

I am sure it can all be resolved. Just some diagnostics is needed.
 
Ah, thanks - I expected the linux profile to reflect the output from the computer, not the external card/DAC. It makes mores sense now.

I just had a weekend away with a group of friends, so cheekily took the DAC along to test. It worked perfectly first time on all their apple and windows machines of varying models and ages so I'm ruling out it being faulty or unusually fussy. Sadly no-one had linux, but (as you say) I'm sure it can be resolved with a bit of effort. Maybe future versions of linux will become more compatible, too.

I'm going to ignore this issue for a while though, and concentrate on testing various linux audio software. Its now working well enough for that and would only be worth the effort of fully resolving if I prefer some applications over the windows ones.

Thanks once again for the help,
Kev
 
Last edited:
Hi.
My two cents.

1. Audio Linuxes and related peoples soundexperience is all but a myth.
There can be quite a difference caused by different tuning measures..
phofman tends to fight other experiences.
That's why guys preparing Volumio, Moode, Rune, AP-Linux, Voyage are all nuts.
Because he's always been right - bits are bits!

2. I don't really like Linux Mint. Used to have it running for a while.
I feel much better of using a standard Ubuntu system.
Support/Community IMO is much better.
If you like the mint color - just change the background and the theme. ;)

3. I've seen several audio (USB) devices, which needed quirks build into a driver
e.g. NAD M51. It was shown as device, but didn't play. Yep - these
things happen. I patched the kernel driver and it worked.


4. Hint: Pulseaudio resamples by default. It's a challenge to stay bitperfect with
most Desktop-Linuxes.
Beside that the default resampler of pulseaudio sucks. You need to change that
too.
The problem If you try to remove pulseaudio you'll break the system.
That's another reason to have a closer look at the audio Linuxes.

5. As desktop player try Audacious. The interface is kind of dated.
Still it IMO can give you quite good sound.
IMO better then most other desktop audio apps.


Enjoy.
 
Status
This old topic is closed. If you want to reopen this topic, contact a moderator using the "Report Post" button.