Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enumerate ALSA devices #5611

Open
kilobyte opened this issue Jan 23, 2017 · 7 comments
Open

enumerate ALSA devices #5611

kilobyte opened this issue Jan 23, 2017 · 7 comments

Comments

@kilobyte
Copy link

As discussed in #5344, the ability to specify an ALSA output device (such as "hw=2,0") has been removed, as confusing to users. Unfortunately, this breaks Clementine for people with non-trivial audio setups who can't use PulseAudio because of bugs in the latter.

So, let's make ALSA as user-friendly as PulseAudio. It turns out all those devices can be enumerated, and thus listed the same way Clementine presents PulseAudio ones.

There are two ways to do so:

  • using an utility or library to do so
  • parsing the tree at /proc/asound

For the latter, files that are of interest to us are:
/proc/asound/cards
/proc/asound/card*/pcmp/info (possibly sub/info instead)

By reading those, we can get a mapping of hw=X,Y,Z values to "card: X", "device: Y", "subdevice: Z", and show the human-friendly field "name: " to the user. PulseAudio prefixes that with the card's name (available from /proc/asound/cards) as sadly some cards provide bogus device names like "HDMI 0", I think that's a good idea for ALSA too.

Would you want me to investigate the issue more?

@Ferroin
Copy link

Ferroin commented Jan 23, 2017

People involved in #5352 are probably also interested in this.

@Sal1950
Copy link

Sal1950 commented Jan 24, 2017

I'm not sure what your saying here, sounds like you want Clementine to automatically recognize the output device and then what??? I guest that would be nice but?
All we really need is a return of the configuration tools we had all along and the ability to output a bit perfect data stream to my DAC. The ability to bypass the bully Pulse and it's insistence on resampling/downgrading my High Resolution files to either 44 or 48 and messing with things in other ways is unacceptable for any serious listener.
The tools as they existed in 1.2.3 and earlier were dog simple for any Linux user to configure and not anything that was a stumbling block for most. There are simple directions all over the web for those needing assistance, Such as,
http://www.metalguitarist.org/forum/computers-electronics-gaming-and-it/56142-bit-perfect-playback-ubuntu-audiophiles.html
or
http://www.head-fi.org/t/561961/bit-perfect-audio-from-linux/120#post_9337998
TIA

@Ferroin
Copy link

Ferroin commented Jan 24, 2017

I don't think you exactly understand. Go look at how Pulseaudio devices are listed now. The intent is to have the same functionality for ALSA. Instead of just having the ability to output to the 'default' ALSA device, we want the ability to pick where the output goes without having to even look at Pulse.

I liked the old configuration system better myself, but the developers have pretty much said that they're never going to accept anything that goes back to that, so we have to work within what exists currently.

As far as the complaints about Pulse in general, check my comment from August 26, 2016 in #5344, it covers what options you need to change to get Pulse to quit resampling in the brain-dead manner.

@Sal1950
Copy link

Sal1950 commented Jan 24, 2017

@Ferroin
Yes I don't really understand what this proposal will do exactly. But as long as it allows a bit perfect stream from Clementine to ALSA bypassing Pulse I'm all for it. Would help if I could but lack the skills. For the present I have built a modified version of PCLinuxOS that has Clementine 1.2.3 and it's supporting libs pinned and Pulse completely removed.
I find it baffling why the Clementine devs are so opposed to reinstating a few simple tools that are at the heart of almost every current modern Win/Mac music server,, witness HQPlayer, JRiver, Audivarna, Amarra, Roon, etc. ???
TIA

@Ferroin
Copy link

Ferroin commented Jan 24, 2017

OK, so to clarify further. The change in output selection in Clementine not only nuked the ability to get bit perfect-streaming, it also completely removed the ability to control output routing when using anything but Pulseaudio. This issue is specifically about getting that output routing support back for ALSA. Doing so may or may not make it possible again to get bit-perfect audio output (I don't know enough about the internals of GStreamer and how Clementine uses it to say for certain), but this functionality was used by a lot more people than just those who wanted bit-perfect output.

To put it another way, the idea is similar to the ability to output to arbitrary ALSA sinks like the old configuration option let you do, except that Clementine will enumerate them for you and list the actual names, instead of you having to go through /proc yourself and figure out what card identifier to put in the text field.

@Sal1950
Copy link

Sal1950 commented Jan 24, 2017

@Ferroin Thanks again for the response
I do know that the later builds of Clementine removing the Alsa tools were closely related to it's build against gstreamer in it's update from the 0.10 to 1.0 . I have 27 0.10 gstreamer packages pinned to support my 1.2.3 Clementine build.

@Sal1950
Copy link

Sal1950 commented Mar 31, 2017

Was there any progress with this idea? When the day comes that I am not able to keep my current linux os build updated with the hacks I've made that kept Clem 1.2.3 running it's over. Outside of some very crude, near cli options, Linux no longer will have support for bit perfect streaming. Leaving us who care with the option of Windoz or Mac with HQPlayer, JRiver, Audivarna, Amarra, Roon, etc players. :(

kilobyte added a commit to kilobyte/Clementine that referenced this issue Jul 10, 2017
It works by scraping /proc/asound/cards rather than by proper ioctls,
doesn't check device suitability (like, an USB microphone would show up
as a card despite having no pcm output), and so on.  But we can improve
it later.

For consistency with the PulseAudio finder, only top-level devices are
shown.  We'd probably want subdevices as well (clementine-player#5352), but unless we query
plug sensors, the list would be too spammy for now.

Fixes clementine-player#5611.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants