Re: [Alsa-user] Changing device while stream is running

2017-10-22 Thread John Z.
> I understand that, but it was pointed out that alsa could not do that "out of
> the box", and pulse audio could. And you have said that you wanted to use
> software that does stuff that others cannot.

Maybe I made a mistake in reading the order of the messages. Until the
last Mr. Clemens's message, I wasn't aware ALSA can't do this - I was
sure that it can and that I just need to learn how.

This caused my poor wording, where I said that I wanted to use software
that does stuff that other software can't - in reality, if Alsa wouldn't
be able to even route to two outputs at once (a solution suggested on
IRC), I'd probably just shrug and just stick with environmentals, the
way it works now.

> No. That is not your problem. That is your solution. You problem is that you
> want to be able to change outputs on the fly and seamlessly. Of course it
> "is possible" since pulseaudio uses alsa and manages to do this. But you
> would rather write extra software on your own to solve the problem
> than use a solution that is already there. That was my observation. Of course
> doing that is certainly your right, but it seems contradictory with what you
> claim you use software for.

That's a pretty correct observation, I myself wasn't actually aware that
I'm pushing for one specific type of solution until you just pointed it,
and I *was* initially trying to avoid specifying my issue as an XY
problem :-\

> Of course it is not, more power to them. However, it just seems perverse to me
> that when a solution exists, a solution which you state does what you want,
> that you then persist in trying to find a different solution which is not
> straightforward or requires additional work by you.
> Now if you have said that PA has caused you problems in the past and gets in
> the way of your accomplishing other things you do, that might be reason. But
> that does not appear to be the case. You seem to rule out PA by shear
> prejudice. When one of the main developers of ALSA asks what you have against
> PA, it suggests that you have galloped off into the wilderness rather than
> taking the straightforward route to a solution to your problem.

I see. I am not prejudiced against PA, I swear :-)
I try hard to keep a lean system, for no real reason but as my own
hobby. I understand what every process on my htop list does, where is it
configured, how, when does it boot and when does it go to sleep. If
you'd call this perverse, I'd agree with you :-)

Maybe I misunderstand how the whole audio stack works. I did use
PulseAudio about 5 years ago, as it tags along with any gnome/kde
package groups, but I remember reading somewhere on reddit that PA isn't
really a necessary part of linux audio.
It really didn't take me that long to learn how alsa.conf works and how
to configure the audio in my system the way I'd want it to work.

Anyway, please let me try to restate my problem and the context of it:
through these past 5 years, Alsa itself did 100% of what I wanted.  I've
recently added 5.1 processor to my man cave, and hooked it up to my main
machine (a laptop) with HDMI.
Its real easy to run mplayer with prepending an environmental, to make
the sound go to the HDMI - but not all processes I run are so
short-lived. My browser tends to have uptime as long as my machine
(15-20 days), and I thought it'd be great if I could just flick a switch
(ideally through a console, so I can hook that up with xmonad.hs to a
button) and have default sound device switch. I have basic understanding
of alsa's terminology and way of doing things (through plugin chains) so
I assumed this would be a way to do this.

I have a real hard time reasoning to myself that I should switch to a
secondary mixing system that ignores all of Alsa's features, just for
this last 1% of dynamic switching.
I'd really rather just shut down and restart my browser in this case.

Maybe that *is* perverse, I don't know...

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Alsa-user mailing list
Alsa-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/alsa-user


Re: [Alsa-user] Off-topic: Changing device while stream is running

2017-10-22 Thread John Z.
> IIRC "ac_add_options --enable-alsa" was dropped for Arch's Firefox 52.0,
> but IIRC then the repositories provided the builds with enable-alsa
> again, but IIRC with Firefox 54 upstream dropped alsa completely.

I wasn't really married to firefox to begin with, so dropping it wasn't
really an issue. I really enjoyed Qutebrowser, but it just wouldn't work
as fast or as stable as any other alternative so I gave it up.

Palemoon + Pentadactyl works really well for me, and its cheap on
resources to boot!

> [rocketmouse@archlinux ~]$ pacman -Q firefox apulse palemoon-bin icecat-bin 
> qupzilla google-chrome 
> firefox 56.0.1-1
> apulse 0.1.10-1
> palemoon-bin 27.5.1-1
> icecat-bin 52.3.0-3
> qupzilla 2.2.0-2
> google-chrome 62.0.3202.62-1

(:-O

I'm setting my limit to two, and keep w3m around just in case
haskell/xmonad gets broken on arch again.


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Alsa-user mailing list
Alsa-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/alsa-user


Re: [Alsa-user] Changing device while stream is running

2017-10-22 Thread Bill Unruh


On Sun, 22 Oct 2017, John Z. wrote:


I thought this whole thread was about stuff that PA could do and alsa on its
own could not.


Well, that'd be my mistake I guess. I should've been clearer and specify
in my opening post that I'd like to solve this using just alsa.
I assumed that this would be implied, given that I am asking for help on
alsa-users mailing list, but I was wrong.


I understand that, but it was pointed out that alsa could not do that "out of
the box", and pulse audio could. And you have said that you wanted to use
software that does stuff that others cannot.




So you would rather spend hours writing buggy code than use something that has
been debugged and accomplishes that is wanted?


One, PulseAudio solves *a* problem, not *my* problem. My problem is to
have this work through alsa, if possible (and it *is* possible, either
by writing plugin or using what a person on IRC suggested)


No. That is not your problem. That is your solution. You problem is that you
want to be able to change outputs on the fly and seamlessly. 
Of course it "is possible" since pulseaudio uses alsa and manages to do this. 
But you would rather write extra software on your own to solve the problem

than use a solution that is already there. That was my observation. Of course
doing that is certainly your right, but it seems contradictory with what you
claim you use software for.




Two, is it really that awkward that there are people out there willing
to spend their time tinkering out the customized solution, that works
how they want it to work - rather than just adopting common solutions?


Of course it is not, more power to them. However, it just seems perverse to me
that when a solution exists, a solution which you state does what you want,
that you then persist in trying to find a different solution which is not
straightforward or requires additional work by you.
Now if you have said that PA has caused you problems in the past and gets in
the way of your accomplishing other things you do, that might be reason. But
that does not appear to be the case. You seem to rule out PA by shear
prejudice. When one of the main developers of ALSA asks what you have against
PA, it suggests that you have galloped off into the wilderness rather than
taking the straightforward route to a solution to your problem.





--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Alsa-user mailing list
Alsa-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/alsa-user


Re: [Alsa-user] Changing device while stream is running

2017-10-22 Thread John Z.
> I thought this whole thread was about stuff that PA could do and alsa on its
> own could not.

Well, that'd be my mistake I guess. I should've been clearer and specify
in my opening post that I'd like to solve this using just alsa.
I assumed that this would be implied, given that I am asking for help on
alsa-users mailing list, but I was wrong.

> So you would rather spend hours writing buggy code than use something that has
> been debugged and accomplishes that is wanted?

One, PulseAudio solves *a* problem, not *my* problem. My problem is to
have this work through alsa, if possible (and it *is* possible, either
by writing plugin or using what a person on IRC suggested)

Two, is it really that awkward that there are people out there willing
to spend their time tinkering out the customized solution, that works
how they want it to work - rather than just adopting common solutions?


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Alsa-user mailing list
Alsa-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/alsa-user


Re: [Alsa-user] Changing device while stream is running

2017-10-22 Thread Bill Unruh


On Sun, 22 Oct 2017, John Z. wrote:


What is so bad about PA that an ALSA plugin would do better?


I wouldn't know, really, if there is anything bad to begin with?
Last two opinions that I read on the subject were that PA used to be bad
in the beginning but its great now, and that in general is not necessary
on the system at all since alsa can do everything. The latter was my
experience as well.


I thought this whole thread was about stuff that PA could do and alsa on its
own could not.


I know there's been a ton of divisive opinion pro and against PA, but I
never went too deep down that rabbit hole.
Personally, I like to keep my system as lean as possible and cherrypick
software (as much as I can) that runs on it. I prefer to accomplish
things by reconfiguring existing software, rather than introducing more
software to my system.


So you would rather spend hours writing buggy code than use something that has
been debugged and accomplishes that is wanted?



Latency, btw, is not an issue - when I do music production work, I run
jack anyway.


I don't mind writing some code; do you think it'd be feasible to write a
plugin to accomplish such functionality


Open both slave devices; copy around the samples appropriately.


I've gotten a suggestion on Freenode to send the stream to both devices
at the same time and use mixer master control to shut one or the other off.

   http://pastebin.com/B7iEKBwH

This will solve my issue without writing a plugin or introducing PA into
my system.



--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Alsa-user mailing list
Alsa-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/alsa-user


Re: [Alsa-user] Off-topic: Changing device while stream is running

2017-10-22 Thread Ralf Mardorf
On Sun, 22 Oct 2017 15:09:15 -0400, John Z. wrote:
>Well, truth to be told, it *is* possible to build firefox with alsa
>support by flicking on a config switch. Its just unfortunate my distro
>(arch) dropped the alsa support with newest updates due to conflicts
>with some other features they'd like to support.

IIRC "ac_add_options --enable-alsa" was dropped for Arch's Firefox 52.0,
but IIRC then the repositories provided the builds with enable-alsa
again, but IIRC with Firefox 54 upstream dropped alsa completely.

There's a thread from March that seems to confirm this...
https://lists.archlinux.org/pipermail/arch-general/2017-March/043314.html
...yes, this time I build Firefox.

Palemoon is installed on my machine, too.

Just a few of the installed browsers:

[rocketmouse@archlinux ~]$ pacman -Q firefox apulse palemoon-bin icecat-bin 
qupzilla google-chrome 
firefox 56.0.1-1
apulse 0.1.10-1
palemoon-bin 27.5.1-1
icecat-bin 52.3.0-3
qupzilla 2.2.0-2
google-chrome 62.0.3202.62-1

In the past my favourite was qupzilla, but it became unstable and since
I don't have flash installed and HTML doesn't stream videos very good,
I tend to use chrome for this. Very often, when videos are interrupted
without flash, they run without interruption, when using google-chrome.

Btw. apulse firefox works without issues.

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Alsa-user mailing list
Alsa-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/alsa-user


Re: [Alsa-user] Off-topic: Changing device while stream is running

2017-10-22 Thread John Z.
> >Aside this switching issue, and few stubborn applications (hello there,
> >firefox), I really fail to see the reason to use PA on top of alsa.
> 
> Off-topic:
> 
> For Firefox consider to use https://github.com/i-rinat/apulse .

Well, truth to be told, it *is* possible to build firefox with alsa
support by flicking on a config switch. Its just unfortunate my distro
(arch) dropped the alsa support with newest updates due to conflicts
with some other features they'd like to support.

I've switched over to Palemoon and I keep Chromium installed just for
Slack and Hangouts when necessary. Its good enough :-)

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Alsa-user mailing list
Alsa-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/alsa-user


Re: [Alsa-user] Changing device while stream is running

2017-10-22 Thread John Z.
> What is so bad about PA that an ALSA plugin would do better?

I wouldn't know, really, if there is anything bad to begin with?
Last two opinions that I read on the subject were that PA used to be bad
in the beginning but its great now, and that in general is not necessary
on the system at all since alsa can do everything. The latter was my
experience as well.
I know there's been a ton of divisive opinion pro and against PA, but I
never went too deep down that rabbit hole.
Personally, I like to keep my system as lean as possible and cherrypick
software (as much as I can) that runs on it. I prefer to accomplish
things by reconfiguring existing software, rather than introducing more
software to my system.

Latency, btw, is not an issue - when I do music production work, I run
jack anyway.

> > I don't mind writing some code; do you think it'd be feasible to write a
> > plugin to accomplish such functionality
> 
> Open both slave devices; copy around the samples appropriately.

I've gotten a suggestion on Freenode to send the stream to both devices
at the same time and use mixer master control to shut one or the other off.

http://pastebin.com/B7iEKBwH

This will solve my issue without writing a plugin or introducing PA into
my system.


--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Alsa-user mailing list
Alsa-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/alsa-user


Re: [Alsa-user] Changing device while stream is running

2017-10-22 Thread Clemens Ladisch via Alsa-user
John Z. wrote:
>> There is no plugin that can do this dynamically, except "pulse".
>
> That's a bit unfortunate, as I've put a lot of effort to learn enough
> about alsa so that I can be able to remove PA from my system.

What is so bad about PA that an ALSA plugin would do better?

> I don't mind writing some code; do you think it'd be feasible to write a
> plugin to accomplish such functionality

Open both slave devices; copy around the samples appropriately.


Regards,
Clemens

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Alsa-user mailing list
Alsa-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/alsa-user


[Alsa-user] Off-topic: Changing device while stream is running

2017-10-22 Thread Ralf Mardorf
On Sun, 22 Oct 2017 12:18:43 -0400, John Z. wrote:
>Aside this switching issue, and few stubborn applications (hello there,
>firefox), I really fail to see the reason to use PA on top of alsa.

Off-topic:

For Firefox consider to use https://github.com/i-rinat/apulse .

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Alsa-user mailing list
Alsa-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/alsa-user


Re: [Alsa-user] Changing device while stream is running

2017-10-22 Thread John Z.
> There is no plugin that can do this dynamically, except "pulse".

That's a bit unfortunate, as I've put a lot of effort to learn enough
about alsa so that I can be able to remove PA from my system.

I don't mind writing some code; do you think it'd be feasible to write a
plugin to accomplish such functionality, and would it be a silly
undertaking?
Aside this switching issue, and few stubborn applications (hello there,
firefox), I really fail to see the reason to use PA on top of alsa.

Cheers

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Alsa-user mailing list
Alsa-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/alsa-user


Re: [Alsa-user] Changing device while stream is running

2017-10-22 Thread Clemens Ladisch via Alsa-user
John Z. wrote:
> My general problem is: I'd like to be able to switch device that
> plays audio, while the audio stream is working - without player
> application knowing anything happened.

PulseAudio can do this.

> My current asoundrc can switch the card through environmental
> variable, and defaults to dmix (that then has hw:1,0 slave) if no
> variable is present.

There is no plugin that can do this dynamically, except "pulse".


Regards,
Clemens

--
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
___
Alsa-user mailing list
Alsa-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/alsa-user