Linux audio being resistant... - diyAudio
Go Back   Home > Forums > Source & Line > PC Based

PC Based Computer music servers, crossovers, and equalization

Please consider donating to help us continue to serve you.

Ads on/off / Custom Title / More PMs / More album space / Advanced printing & mass image saving
Reply
 
Thread Tools Search this Thread
Old 25th August 2015, 05:53 PM   #1
Kev06 is offline Kev06  England
diyAudio Member
 
Join Date: Oct 2006
Location: Derby, UK
Default Linux audio being resistant...

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
  Reply With Quote
Old 25th August 2015, 07:20 PM   #2
phofman is offline phofman  Czech Republic
diyAudio Member
 
Join Date: Apr 2005
Location: Pilsen
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.
  Reply With Quote
Old 25th August 2015, 08:17 PM   #3
diyAudio Member
 
Join Date: Mar 2007
Location: California
Quote:
Originally Posted by Kev06 View Post
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.

Quote:
Originally Posted by Kev06 View Post
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!
__________________
"Hardware eventually fails. Software eventually works" - Michael Hartung
ACD LADSPA plugins - implements IIR digital crossover filters under Linux (e.g. on a Raspberry Pi, miniPC, etc.)
  Reply With Quote
Old 25th August 2015, 08:22 PM   #4
Kev06 is offline Kev06  England
diyAudio Member
 
Join Date: Oct 2006
Location: Derby, UK
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
  Reply With Quote
Old 25th August 2015, 08:39 PM   #5
Kev06 is offline Kev06  England
diyAudio Member
 
Join Date: Oct 2006
Location: Derby, UK
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 by Kev06; 25th August 2015 at 08:42 PM.
  Reply With Quote
Old 25th August 2015, 09:02 PM   #6
phofman is offline phofman  Czech Republic
diyAudio Member
 
Join Date: Apr 2005
Location: Pilsen
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.
  Reply With Quote
Old 25th August 2015, 09:41 PM   #7
Kev06 is offline Kev06  England
diyAudio Member
 
Join Date: Oct 2006
Location: Derby, UK
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
  Reply With Quote
Old 25th August 2015, 10:27 PM   #8
phofman is offline phofman  Czech Republic
diyAudio Member
 
Join Date: Apr 2005
Location: Pilsen
What is your mint version?

Pretty old report:

https://bugs.launchpad.net/ubuntu/+s...io/+bug/677880

On the other hand:

Supported DACs | AudioPhile Linux

That volume knob - often it is just a USB HID interface sending VolumeUp/Down keycodes. Desktop environments are usually pre-configured to catch these and adjust volume accordingly.
  Reply With Quote
Old 26th August 2015, 09:22 AM   #9
Kev06 is offline Kev06  England
diyAudio Member
 
Join Date: Oct 2006
Location: Derby, UK
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 by Kev06; 26th August 2015 at 09:25 AM.
  Reply With Quote
Old 26th August 2015, 08:40 PM   #10
phofman is offline phofman  Czech Republic
diyAudio Member
 
Join Date: Apr 2005
Location: Pilsen
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?
  Reply With Quote

Reply


Hide this!Advertise here!
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Linux audio is the way go, No its not console PC Based 199 2nd April 2014 08:18 PM


New To Site? Need Help?

All times are GMT. The time now is 09:50 PM.


vBulletin Optimisation provided by vB Optimise (Pro) - vBulletin Mods & Addons Copyright © 2015 DragonByte Technologies Ltd.
Copyright 1999-2015 diyAudio

Content Relevant URLs by vBSEO 3.3.2