Re: [Alsa-user] Changing device while stream is running
> 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] Changing device while stream is running
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
> 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
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] Changing device while stream is running
> 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
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
Re: [Alsa-user] Changing device while stream is running
> 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
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
[Alsa-user] Changing device while stream is running
Hi everyone, I've been trying to (unsuccessfully) solve this issue for about two days now so I feel I've done mandatory rtfm and I do need some help. 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. 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. What I've done so far to narrow my problem, was trying to learn how 'hooks' plugin works (by reading alsa.conf and few posts in mailing list archive), and try to figure out how ctl interface works, thinking I might add a custom ctl control, that might then control the pcm.default to -somehow- switch between two different slave plugins. I can vaguely recall seeing something similar happening with hooks plugin, but I might be wrong. Any information, or guidance towards more information would be highly appreciated - thanks in advance. If it helps, this is my current asoundrc: pcm.!default { @func getenv vars [ ALSA_DEFAULT_PCM ] default "dmix" } ctl.!default { type hw card 1 } # Mixes everything to device hw:1,0 pcm.!dmix { type dmix ipc_key 1024 slave { pcm "hw:1,0" period_time 0 period_size 1024 buffer_size 4096 rate 48000 } bindings { 0 0 1 1 } } -- 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