Re: [DNG] Firefox, sudo and apulse (was Re: Steam, Mumble, Valheim, Alsa and shared audio)

2021-09-05 Thread hal
On September 4, 2021 4:40:34 AM CDT, g4sra via Dng  wrote:
:: On Tuesday, August 31st, 2021 at 7:41 PM, hal  wrote
:: > On 8/31/21 11:02, g4sra via Dng wrote:
:: > 
:: > > > ctl.!default {
:: > > > type hw
:: > > > card 0
:: > > > }
:: > > > 
:: 
:: > > > Check to make sure you do not have a ~/.asoundrc overriding 
/etc/asound.conf
:: > Good thought, and have checked this. Especially relevant with the 
multi-user situation. I will check on the other enlightening ALSA suggestions 
you have made.
:: > 
:: > > get user_one's cookie:
:: > > user_one# xauth -n list localhost/unix:0
:: > > localhost/unix:0 MIT-MAGIC-COOKIE-1 83c12a394ac0c5afe1fee0a973b9e49g
:: > > then give the cookie to user_two:
:: > > user_two# xauth add localhost/unix:0 MIT-MAGIC-COOKIE-1 
83c12a394ac0c5afe1fee0a973b9e49g
:: > > now 'user_two' can access the GUI (you may need to set DISPLAY):
:: > > user_two# DISPLAY=:0 /usr/bin/apulse /home/apps/firefox/firefox 
-ProfileManager
:: > Thank you for this! I have always used 'xhost +' and drop TCP 6000 (eth0) 
on the host firewall (on my "single-user" workstation anyway). I've tried to 
find more secure ways to share the X cookie but for one reason or another, they 
never worked out. I will try this!
:: 
:: Hi Hal,
:: 
:: I replied off-list, it just occurred to me it may have gone into your spam 
box.

g4sra,
yes I did see your reply thank you for that. I am not good at managing my time 
and have been swamped the last few days. you noticed some very good things then 
maybe have been misconfigured on my system for quite some time. I will look 
into these and post back on the list. thank you again!
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] Firefox, sudo and apulse (was Re: Steam, Mumble, Valheim, Alsa and shared audio)

2021-09-04 Thread g4sra via Dng
On Tuesday, August 31st, 2021 at 7:41 PM, hal  wrote
> On 8/31/21 11:02, g4sra via Dng wrote:
> 
> > > ctl.!default {
> > > type hw
> > > card 0
> > > }
> > > 

> > > Check to make sure you do not have a ~/.asoundrc overriding 
> > > /etc/asound.conf
> Good thought, and have checked this. Especially relevant with the multi-user 
> situation. I will check on the other enlightening ALSA suggestions you have 
> made.
> 
> > get user_one's cookie:
> > user_one# xauth -n list localhost/unix:0
> > localhost/unix:0 MIT-MAGIC-COOKIE-1 83c12a394ac0c5afe1fee0a973b9e49g
> > then give the cookie to user_two:
> > user_two# xauth add localhost/unix:0 MIT-MAGIC-COOKIE-1 
> > 83c12a394ac0c5afe1fee0a973b9e49g
> > now 'user_two' can access the GUI (you may need to set DISPLAY):
> > user_two# DISPLAY=:0 /usr/bin/apulse /home/apps/firefox/firefox 
> > -ProfileManager
> Thank you for this! I have always used 'xhost +' and drop TCP 6000 (eth0) on 
> the host firewall (on my "single-user" workstation anyway). I've tried to 
> find more secure ways to share the X cookie but for one reason or another, 
> they never worked out. I will try this!

Hi Hal,

I replied off-list, it just occurred to me it may have gone into your spam box.


publickey - g4sra@protonmail.com - 0x42E94623.asc
Description: application/pgp-keys


signature.asc
Description: OpenPGP digital signature
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] Firefox, sudo and apulse (was Re: Steam, Mumble, Valheim, Alsa and shared audio)

2021-09-03 Thread hal



On 8/31/21 11:02, g4sra via Dng wrote:



In case you are unaware
To simplify the GUI side, use 'xauth'

get user_one's cookie:
user_one# xauth -n list localhost/unix:0
localhost/unix:0  MIT-MAGIC-COOKIE-1  83c12a394ac0c5afe1fee0a973b9e49g

then give the cookie to user_two:
user_two# xauth add localhost/unix:0  MIT-MAGIC-COOKIE-1  
83c12a394ac0c5afe1fee0a973b9e49g

now 'user_two' can access the GUI (you may need to set DISPLAY):
user_two# DISPLAY=:0 /usr/bin/apulse /home/apps/firefox/firefox -ProfileManager

I do this so frequently for 'root' that I have a two-line bash script I called 
'xsudo.sh'

#!/usr/bin/env bash
sudo bash -c "xauth add $(xauth -n list localhost/unix:0) && exec $@ &"



Ok I tried this today but I think I have something wrong. Are you running all 
these as root (I see # in your prompt)? Here is what I tried:

user1 $xauth -n list localhost/unix:0
user1 $xauth -n list
beowulf/unix:0  MIT-MAGIC-COOKIE-1  4e9c9fca69b03a0b270ce53237df2fca

user1 $sudo -u webuser /bin/bash --login
No protocol specified
Cannot open display ":0.0"
No protocol specified
Cannot open display ":0.0"

webuser $xauth add beowulf/unix:0 MIT-MAGIC-COOKIE-1  
4e9c9fca69b03a0b270ce53237df2fca
xauth:  timeout in locking authority file /home/user1/.Xauthority
webuser $

___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] Firefox, sudo and apulse (was Re: Steam, Mumble, Valheim, Alsa and shared audio)

2021-08-31 Thread g4sra via Dng
On Tuesday, August 31st, 2021 at 7:41 PM, hal  wrote:
> On 8/31/21 11:02, g4sra via Dng wrote
> 
> 

> > > ctl.!default {
> > > 

> > > type hw
> > > 

> > > card 0
> > > 

> > > }
> > > 

> > > Check to make sure you do not have a ~/.asoundrc overriding 
> > > /etc/asound.conf
> 

> Good thought, and have checked this. Especially relevant with the multi-user 
> situation. I will check on the other enlightening ALSA suggestions you have 
> made.
> 

> 
> 

> > get user_one's cookie:
> > user_one# xauth -n list localhost/unix:0
> > localhost/unix:0 MIT-MAGIC-COOKIE-1 83c12a394ac0c5afe1fee0a973b9e49g
> > 

> > then give the cookie to user_two:
> > user_two# xauth add localhost/unix:0 MIT-MAGIC-COOKIE-1 
> > 83c12a394ac0c5afe1fee0a973b9e49g
> > 

> > now 'user_two' can access the GUI (you may need to set DISPLAY):
> > user_two# DISPLAY=:0 /usr/bin/apulse /home/apps/firefox/firefox 
> > -ProfileManager
> 

> Thank you for this! I have always used 'xhost +' and drop TCP 6000 (eth0) on 
> the host firewall (on my "single-user" workstation anyway). I've tried to 
> find more secure ways to share the X cookie but for one reason or another, 
> they never worked out. I will try this!

To work remotely you use the FQDN appended with the DISPLAY number (as opposed 
to localhost/unix:0) to get the TCP connection cookie.
user_one# xauth -n list host.example.com:0
10.0.0.1 MIT-MAGIC-COOKIE-1 92b21b394ac0c5afe1fee0a973b9e49g

This will only work if Xorg is listening for non-local TCP connections though, 
which is NOT the default.
I almost always use XForward'ing over ssh.






publickey - g4sra@protonmail.com - 0x42E94623.asc
Description: application/pgp-keys


signature.asc
Description: OpenPGP digital signature
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] Firefox, sudo and apulse (was Re: Steam, Mumble, Valheim, Alsa and shared audio)

2021-08-31 Thread hal



On 8/31/21 11:02, g4sra via Dng wrote:



ctl.!default {
type hw
card 0
}

Check to make sure you do not have a ~/.asoundrc overriding /etc/asound.conf


Good thought, and have checked this. Especially relevant with the multi-user 
situation. I will check on the other enlightening ALSA suggestions you have 
made.




get user_one's cookie:
user_one# xauth -n list localhost/unix:0
localhost/unix:0  MIT-MAGIC-COOKIE-1  83c12a394ac0c5afe1fee0a973b9e49g

then give the cookie to user_two:
user_two# xauth add localhost/unix:0  MIT-MAGIC-COOKIE-1  
83c12a394ac0c5afe1fee0a973b9e49g

now 'user_two' can access the GUI (you may need to set DISPLAY):
user_two# DISPLAY=:0 /usr/bin/apulse /home/apps/firefox/firefox -ProfileManager



Thank you for this! I have always used 'xhost +' and drop TCP 6000 (eth0) on the host 
firewall (on my "single-user" workstation anyway). I've tried to find more 
secure ways to share the X cookie but for one reason or another, they never worked out. I 
will try this!
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] Firefox, sudo and apulse (was Re: Steam, Mumble, Valheim, Alsa and shared audio)

2021-08-31 Thread g4sra via Dng
On Tuesday, August 31st, 2021 at 4:21 PM, hal  wrote:
> On 8/28/21 13:24, g4sra via Dng wrote:
> > Install 'apulse' which are a sort of pulseaudio compatability libraries.
> apulse hasn't been working for me with Firefox for at least a year now. I 
> don't know if I messed it up or if it was some software change, but it just 
> stopped working once. Firefox doesn't seem to have FOSS in the focus so much 
> anymore so always thought maybe they did something (again).
> I just tried ff now running as my LXDE logged in user[1] and using sudo[2]. 
> Both generated some apulse complaints I have to look into. my "default" dev 
> is the onboard sound chip which might be in use with another application I 
> have open.
> Maybe I need to make "default" one of my dmix devices and not the "raw 
> device", or I need to specify a playback rate in /etc/asound.conf like I've 
> seen in some ALSA examples? hmm..
You are correct in that you definitely do not want a "raw device" as your 
default.

> ::: apulse errors :::
> [apulse] [error] do_connect_pcm: can't get initial hw parameters for playback 
> device "default". Error code 1 (Operation not permitted)
Permissions error, likely 'User' related.

> [apulse] [error] do_connect_pcm: failed to open ALSA device. Apulse does no 
> resampling or format conversion, leaving that task to ALSA plugins. Ensure 
> that selected device is capable of playing a particular sample format at a 
> particular rate. They have to be supported by either hardware directly, or by 
> "plug" and "dmix" ALSA plugins which will perform required conversions on CPU.
The selected device is not capable of handling the data format, so you need to 
change your "default" device configuration.

> ::: cards/devices :::
> $ cat /proc/asound/cards
> 0 [PCH ]: HDA-Intel - HDA Intel PCH
> HDA Intel PCH at 0xfbff8000 irq 37
> 

> ::: snipped /etc/asound.conf :::
> $ cat /etc/asound.conf
> 

> ...
> pcm.!default {
> type plug
> slave.pcm "duplex"
> }
> 

> ctl.!default {
> type hw
> card 0
> }
Check to make sure you do not have a ~/.asoundrc overriding /etc/asound.conf

> > This may (and I do mean 'may') be your Desktop not releasing the audio 
> > devices, google that for your specific desktop to find out how to make it 
> > release them when you launch steam.

> [1] $ /usr/bin/apulse /home/apps/firefox/firefox -ProfileManager 

> [2] $ sudo -u webuser /usr/bin/apulse /home/apps/firefox/firefox 
> -ProfileManager
Switching 'User's in a GUI without re-logging is not always straightforward, 
session management can get in the way and conflict with the GUI.

In case you are unaware
To simplify the GUI side, use 'xauth'

get user_one's cookie:
user_one# xauth -n list localhost/unix:0
localhost/unix:0  MIT-MAGIC-COOKIE-1  83c12a394ac0c5afe1fee0a973b9e49g

then give the cookie to user_two:
user_two# xauth add localhost/unix:0  MIT-MAGIC-COOKIE-1  
83c12a394ac0c5afe1fee0a973b9e49g

now 'user_two' can access the GUI (you may need to set DISPLAY):
user_two# DISPLAY=:0 /usr/bin/apulse /home/apps/firefox/firefox -ProfileManager

I do this so frequently for 'root' that I have a two-line bash script I called 
'xsudo.sh'

#!/usr/bin/env bash
sudo bash -c "xauth add $(xauth -n list localhost/unix:0) && exec $@ &"




publickey - g4sra@protonmail.com - 0x42E94623.asc
Description: application/pgp-keys


signature.asc
Description: OpenPGP digital signature
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] Firefox, sudo and apulse (was Re: Steam, Mumble, Valheim, Alsa and shared audio)

2021-08-31 Thread hal



On 8/31/21 10:46, Dr. Nikolaus Klepp wrote:



apulse works here like a charm. But my /etc/asound.conf is different (I use 
soundcard 2 aka index 1 as default):

defaults.pcm.card  1
defaults.ctl.card  1
defaults.timer.card  1


Ahh, ok. So something with my config. Thank you for the input!
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


Re: [DNG] Firefox, sudo and apulse (was Re: Steam, Mumble, Valheim, Alsa and shared audio)

2021-08-31 Thread Dr. Nikolaus Klepp
Anno domini 2021 Tue, 31 Aug 10:21:31 -0500
 hal scripsit:
> On 8/28/21 13:24, g4sra via Dng wrote:
> > Install 'apulse' which are a sort of pulseaudio compatability libraries.
> 
> apulse hasn't been working for me with Firefox for at least a year now. I 
> don't know if I messed it up or if it was some software change, but it just 
> stopped working once. Firefox doesn't seem to have FOSS in the focus so much 
> anymore so always thought maybe they did something (again).
> 
> I just tried ff now running as my LXDE logged in user[1] and using sudo[2]. 
> Both generated some apulse complaints I have to look into. my "default" dev 
> is the onboard sound chip which might be in use with another application I 
> have open.
> 
> Maybe I need to make "default" one of my dmix devices and not the "raw 
> device", or I need to specify a playback rate in /etc/asound.conf like I've 
> seen in some ALSA examples? hmm..
> 
> ::: apulse errors :::
> [apulse] [error] do_connect_pcm: can't get initial hw parameters for playback 
> device "default". Error code 1 (Operation not permitted)
> 
> [apulse] [error] do_connect_pcm: failed to open ALSA device. Apulse does no 
> resampling or format conversion, leaving that task to ALSA plugins. Ensure 
> that selected device is capable of playing a particular sample format at a 
> particular rate. They have to be supported by either hardware directly, or by 
> "plug" and "dmix" ALSA plugins which will perform required conversions on CPU.
> 
> 
> ::: cards/devices :::
> $ cat /proc/asound/cards
>   0 [PCH]: HDA-Intel - HDA Intel PCH
>HDA Intel PCH at 0xfbff8000 irq 37
> 
> 
> ::: snipped /etc/asound.conf :::
> $ cat /etc/asound.conf
> ...
> pcm.!default {
>  type plug
>  slave.pcm "duplex"
> }
> ctl.!default {
>  type hw
>  card 0
> }

apulse works here like a charm. But my /etc/asound.conf is different (I use 
soundcard 2 aka index 1 as default):

defaults.pcm.card  1
defaults.ctl.card  1
defaults.timer.card  1


Nik



> 
> 
> 
> > This may (and I do mean 'may') be your Desktop not releasing the audio 
> > devices, google that for your specific desktop to find out how to make it 
> > release them when you launch steam.
> > 
> 
> 
> [1] $ /usr/bin/apulse /home/apps/firefox/firefox -ProfileManager
> [2] $ sudo -u webuser /usr/bin/apulse /home/apps/firefox/firefox 
> -ProfileManager
> ___
> Dng mailing list
> Dng@lists.dyne.org
> https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng
> 



-- 
Please do not email me anything that you are not comfortable also sharing with 
the NSA, CIA ...
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng


[DNG] Firefox, sudo and apulse (was Re: Steam, Mumble, Valheim, Alsa and shared audio)

2021-08-31 Thread hal

On 8/28/21 13:24, g4sra via Dng wrote:

Install 'apulse' which are a sort of pulseaudio compatability libraries.


apulse hasn't been working for me with Firefox for at least a year now. I don't 
know if I messed it up or if it was some software change, but it just stopped 
working once. Firefox doesn't seem to have FOSS in the focus so much anymore so 
always thought maybe they did something (again).

I just tried ff now running as my LXDE logged in user[1] and using sudo[2]. Both 
generated some apulse complaints I have to look into. my "default" dev is the 
onboard sound chip which might be in use with another application I have open.

Maybe I need to make "default" one of my dmix devices and not the "raw device", 
or I need to specify a playback rate in /etc/asound.conf like I've seen in some ALSA examples? hmm..

::: apulse errors :::
[apulse] [error] do_connect_pcm: can't get initial hw parameters for playback device 
"default". Error code 1 (Operation not permitted)

[apulse] [error] do_connect_pcm: failed to open ALSA device. Apulse does no resampling or format 
conversion, leaving that task to ALSA plugins. Ensure that selected device is capable of playing a 
particular sample format at a particular rate. They have to be supported by either hardware 
directly, or by "plug" and "dmix" ALSA plugins which will perform required 
conversions on CPU.


::: cards/devices :::
$ cat /proc/asound/cards
 0 [PCH]: HDA-Intel - HDA Intel PCH
  HDA Intel PCH at 0xfbff8000 irq 37


::: snipped /etc/asound.conf :::
$ cat /etc/asound.conf
...
pcm.!default {
type plug
slave.pcm "duplex"
}
ctl.!default {
type hw
card 0
}




This may (and I do mean 'may') be your Desktop not releasing the audio devices, 
google that for your specific desktop to find out how to make it release them 
when you launch steam.




[1] $ /usr/bin/apulse /home/apps/firefox/firefox -ProfileManager
[2] $ sudo -u webuser /usr/bin/apulse /home/apps/firefox/firefox -ProfileManager
___
Dng mailing list
Dng@lists.dyne.org
https://mailinglists.dyne.org/cgi-bin/mailman/listinfo/dng