You are not logged in.

#51 2015-10-21 00:47:34

damo
....moderator....
Registered: 2015-08-20
Posts: 6,404

Re: PulseAudio vs. Alsa

Horizon_Brave wrote:

...
Can someone give a brief rundown of the issues here? How / what are the players in this? What is the difference between pulseaudio, ALSA, volti etc.. Are these graphical tools for audio drivers? Which are the underlying Audio drivers themselves?

There are several posts in the forums about this stuff. Did you read them? For example...
Understanding audio in Linux
Getting Sound working in BL


Be Excellent to Each Other...
The Bunsenlabs Lithium Desktop » Here
FORUM RULES and posting guidelines «» Help page for forum post formatting
Artwork on DeviantArt  «» BunsenLabs on DeviantArt

Offline

#52 2015-10-21 00:50:52

twoion
ほやほや
Registered: 2015-08-10
Posts: 3,025

Re: PulseAudio vs. Alsa

hhh wrote:
tknomanzr wrote:

It may come down to deciding not to use volti.

This. We used Volti in the last ISO release because it is part of Debian stable and volumeicon-alsa in jessie has a visual bug when using xfce4-notifyd, but it has not been a success. #! used pnmixer and I see little reason not to go back to that...
https://forums.bunsenlabs.org/viewtopic.php?id=315

Hopefully your work on this will be applicable to sound in general and will not have been a waste of your time. smile

I would like to favour this return over messing with that volti thing. volti chose to do something nobody ought to do, that is instead of using proper APIs from pulse or alsa it's parsing some user-readable command line output (I'm relying on tknomanzr's analysis here).

Thing is, it doesn't support pulseaudio, or anything else besides ALSA for that matter. If that's not an issue, I'd use this program which is written in nice C against a clean API over the volti hack any time.

IMHO such a change could also warrant to implement a pulse/alsa config such as this. Since systemd is the default in Debian: Perhaps we could rely on applications requiring pulse (such as skype) triggering the start of the pulse daemon through systemd socket activation? That way, we would not have to run the pulse daemon as an auto-start daemon.


Per aspera ad astra.

Offline

#53 2015-10-21 01:05:54

Horizon_Brave
Operating System: Linux-Nettrix
Registered: 2015-10-18
Posts: 1,473

Re: PulseAudio vs. Alsa

damo wrote:
Horizon_Brave wrote:

...
Can someone give a brief rundown of the issues here? How / what are the players in this? What is the difference between pulseaudio, ALSA, volti etc.. Are these graphical tools for audio drivers? Which are the underlying Audio drivers themselves?

There are several posts in the forums about this stuff. Did you read them? For example...
Understanding audio in Linux
Getting Sound working in BL

Thanks so much! I'll add them to my reading list.


"I have not failed, I have found 10,000 ways that will not work" -Edison

Offline

#54 2015-10-21 02:05:23

tknomanzr
BL Die Hard
From: Around the Bend
Registered: 2015-09-29
Posts: 1,029

Re: PulseAudio vs. Alsa

twoion wrote:
hhh wrote:
tknomanzr wrote:

It may come down to deciding not to use volti.

This. We used Volti in the last ISO release because it is part of Debian stable and volumeicon-alsa in jessie has a visual bug when using xfce4-notifyd, but it has not been a success. #! used pnmixer and I see little reason not to go back to that...
https://forums.bunsenlabs.org/viewtopic.php?id=315

Hopefully your work on this will be applicable to sound in general and will not have been a waste of your time. smile

I would like to favour this return over messing with that volti thing. volti chose to do something nobody ought to do, that is instead of using proper APIs from pulse or alsa it's parsing some user-readable command line output (I'm relying on tknomanzr's analysis here).

Thing is, it doesn't support pulseaudio, or anything else besides ALSA for that matter. If that's not an issue, I'd use this program which is written in nice C against a clean API over the volti hack any time.

IMHO such a change could also warrant to implement a pulse/alsa config such as this. Since systemd is the default in Debian: Perhaps we could rely on applications requiring pulse (such as skype) triggering the start of the pulse daemon through systemd socket activation? That way, we would not have to run the pulse daemon as an auto-start daemon.

Here is the constructor for the AlsaControl class for Volti:

def __init__(self, card_index, control, main_instance):
        """ Constructor """
        try:
            self.main = main_instance
            self.card_index = card_index
            self.control = control
            self.channel = alsa.MIXER_CHANNEL_ALL
            self.mixerlist=[]
            self.open()
            self._check_version()
        except Exception, err:
            log.Warn("can't open %s control for card %s, trying to select first available mixer channel\n" % (
                self.control, self.get_card_name()))
            try:
                control = self.get_mixers(self.card_index)[0]
                self.main.control = control
                self.reopen(self.card_index, control)
                self._check_version()
            except Exception, err:
                log.Warn("can't open first available control for card %s\nerror: %s" % (
                    self.get_card_name(), str(err)))

And also a class method for AlsaControl that shows that Volti does indeed get a list of available cards:

def get_cards(self):
        """ Returns cards list """
        cards = []
        acards = alsa.cards()
        for index, card in enumerate(acards):
            try:
                self.get_mixers(index)[0]
            except IndexError:
                cards.append(None)
            else:
                cards.append(acards[index])
        return cards

In the constructor we can see both the warning and the assertion in the try/except loops. Volti's config will default to card_index = 0, which works if you actually have a valid sink on that card_index. However, it is not uncommon, especially for laptops for card_index = 0 to end up and HDMI port that is not being used.

Also, main.py's constructor shows Volti pulling this value out of preferences.py, which would be where Volti opens and reads its config file and gets the card_index from. As I go through the source, I can see numerous calls to the static variable card_index, which should instead be referring to an index of a list similar to what get_cards is creating. I got as far as creating this list in the constructor for AlsaControl and when an exception occurred upping the list_index by 1 and attempting to run the constructor again. Given enough time, I could probably thread my way through the numerous modules for Volti and get it working. My initial tests showed that I could in fact get Volti to fire up then all the gtk stuff would get me, so the UI would also need to be notified of the change.

In short, I could probably eventually get it to work, but if pnmixer will suit BL's needs it could be a purely intellectual exercise based on what I believe proper software design ought to look like. The ideal setup would create a list of Alsa cards and utilize that list throughout the program. I hope this post will be enough of the source to show you all what I am talking about.

Offline

#55 2015-10-21 15:01:28

twoion
ほやほや
Registered: 2015-08-10
Posts: 3,025

Re: PulseAudio vs. Alsa

^ I applaud your effort, but I think we'd prefer to ship an unaltered program instead of patching up a dead project…not my say though, I'd like to stay away from desktop questions…

Perhaps you'd like fork it, improve it, add pulse support or something, and call it frankenmixer smile


Per aspera ad astra.

Offline

#56 2015-10-21 15:53:48

tknomanzr
BL Die Hard
From: Around the Bend
Registered: 2015-09-29
Posts: 1,029

Re: PulseAudio vs. Alsa

LOL. Maybe one day. Even though it's written in python, it is fairly complex. I have some ideas and will work on them when I am able. I have no issue with you changing, as it does have a problematic implementation. I just wanted you to see the source so you could maybe get the gist of what I was saying.

However, your comment about starting pulseaudio via systemd got me to thinking that this entire system could potentially be written in systemd, or at least all the autostart stuff. If am ever going to learn systemd then I am going to have to actually use it to do stuff. I've been mucking about with systemd-nspawn today and have a very basic debian system built. Once I figure out how to get networking running in the container, I should be able to build up a system from console. My goal is to start the majority of stuff up via systemd unit files.

Offline

#57 2015-10-22 03:43:57

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 7,414
Website

Re: PulseAudio vs. Alsa

twoion wrote:
hhh wrote:

#! used pnmixer and I see little reason not to go back to that...
https://forums.bunsenlabs.org/viewtopic.php?id=315

I would like to favour this return over messing with that volti thing...

Thing is, it doesn't support pulseaudio, or anything else besides ALSA for that matter.

pnmixer was used in #! along with pulse. In what sense does it not support pulseaudio?


...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), idle Twitterings and GitStuff )

Introduction to the Bunsenlabs Lithium Desktop

Offline

#58 2015-10-22 04:58:55

tknomanzr
BL Die Hard
From: Around the Bend
Registered: 2015-09-29
Posts: 1,029

Re: PulseAudio vs. Alsa

I understood him to be referring to Volti.

Offline

#59 2015-10-22 05:21:36

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 7,414
Website

Re: PulseAudio vs. Alsa

We'll have to wait for twoion to clarify this, but I thought this looked as if "it" and "this program" were pnmixer...

twoion wrote:

Thing is, it doesn't support pulseaudio, or anything else besides ALSA for that matter. If that's not an issue, I'd use this program which is written in nice C against a clean API over the volti hack any time.


...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), idle Twitterings and GitStuff )

Introduction to the Bunsenlabs Lithium Desktop

Offline

#60 2015-10-29 02:48:43

tknomanzr
BL Die Hard
From: Around the Bend
Registered: 2015-09-29
Posts: 1,029

Re: PulseAudio vs. Alsa

I have been playing with the entire pulseaudio suite tonight. I installed the following packages from debian's repos:

pasystray
paman
paprefs
pavumeter
paucontrol

Below, I have posted a screenshot to show all of the apps open, their integration into pasystray and also how pasystray allows for selecting various servers (assuming one was setup to broadcast across the network), sinks, sources, and even audio streams. I have no way atm to test it against USB sound devices but it should detect them, assuming proper setup in the kernel. I am unsure if you all would consider it cruft, but it is a very comprehensive suite that should solve BL's sound problems, assuming you wanted to stick with a PA setup. Atm, its statistics show it consuming roughly 201 kb of memory for the sound stream to mocp in a terminal. I may consider this my goto as it seems like it will solve numerous potential issues. I will let you all know how it works out on my laptop, which is the one that generally needs intervention of some sort to get sound working.

2015_10_28_21_35_20_scrot.jpg

Last edited by tknomanzr (2015-10-29 02:49:00)

Offline

#61 2015-10-30 04:30:32

tknomanzr
BL Die Hard
From: Around the Bend
Registered: 2015-09-29
Posts: 1,029

Re: PulseAudio vs. Alsa

I wanted to post back with an update after some testing. Tonight, I setup pasystray on this laptop which always give me sound trouble and which I have had setup for testing sound. Pasystray was able to figure out the correct sound sink for it. One small thing, it tossed some debug messages out into the console, which you can see messing with mocp. I also hooked a tv up to the main desktop system via hdmi (Actually display out converted to hdmi via cable.) Testing showed I was able to select either the tv HDMI output or the default analog sound and direct sound per application to one or the other. The main drawback to it that I see is that it uses gnome's icon for sound by default. I saw no easy way to change it but I am sure I could fiddle with symlinks or something and get a different one running.
Below is a screen of the laptop showing pasystray and the proper sound sink selected on first run.

The volti walkthrough I posted has a help request and I am thinking I might ask the guy to try this out and see if it solves his usb sound issues.

2015_10_29_23_20_11_scrot.jpg

Last edited by tknomanzr (2015-10-30 14:45:49)

Offline

#62 2015-10-30 14:34:16

hhh
Meep!
Registered: 2015-09-17
Posts: 10,755
Website

Re: PulseAudio vs. Alsa

Bummer, 404 on that scrot.

Offline

#63 2015-10-30 14:50:10

tknomanzr
BL Die Hard
From: Around the Bend
Registered: 2015-09-29
Posts: 1,029

Re: PulseAudio vs. Alsa

I edited the post with the correct link to the scrot. I am not sure what went on there. Url ended up scrambled with debian wiki stuff somehow. Also, the errors messages I mention were simply because I was running pasystray from the terminal in the background, so it was sending its output to that terminal. Doesn't happen when autostarted.

Also what is not apparent from that scrot is I can send any application stream to any sink, so for instance, on my desktop I could start netflix from chrome and send its output to the HDMI tv output, then run mocp from terminal and let it use the analog output. This should also be doable from pavucontrol.

Also, I should note, I pulled in the entire suite for testing. However, several things are listed as suggests. If not installed, their respective menu entries in pasystray will be grayed out. You can see the Debian entry here: https://packages.debian.org/stable/sound/pasystray

Last edited by tknomanzr (2015-10-30 14:54:49)

Offline

#64 2015-10-30 15:12:03

hhh
Meep!
Registered: 2015-09-17
Posts: 10,755
Website

Re: PulseAudio vs. Alsa

OK, thanks.

One issue with pasystray we have is that I think it doesn't allow using mouse-scroll over the icon to adjust volume, and a lot of #! users want that feature.

I'll have to look into this more later, thanks a bunch for your work on this!

Offline

#65 2015-10-30 15:18:17

tknomanzr
BL Die Hard
From: Around the Bend
Registered: 2015-09-29
Posts: 1,029

Re: PulseAudio vs. Alsa

Actually, it does, for me at least. Now on a laptop, that's a different story but then it is probably just me still wanting my macbook gesture support, lol.

Offline

#66 2015-10-30 15:22:51

hhh
Meep!
Registered: 2015-09-17
Posts: 10,755
Website

Re: PulseAudio vs. Alsa

Good to know, thaks!

Offline

#67 2015-10-31 01:52:03

johnraff
nullglob
From: Nagoya, Japan
Registered: 2015-09-09
Posts: 7,414
Website

Re: PulseAudio vs. Alsa

hhh wrote:

One issue with pasystray we have is that I think it doesn't allow using mouse-scroll over the icon to adjust volume...

The issue was that mouse-scrolling was the only way to adjust volume. Trouble with icons too. (Doesn't that sound familiar? neutral )


...elevator in the Brain Hotel, broken down but just as well...
( a boring Japan blog (currently paused), idle Twitterings and GitStuff )

Introduction to the Bunsenlabs Lithium Desktop

Offline

Board footer

Powered by FluxBB