Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
how to vocal message from package building script?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo
View previous topic :: View next topic  
Author Message
CaptainBlood
Advocate
Advocate


Joined: 24 Jan 2010
Posts: 3994

PostPosted: Tue Oct 04, 2022 5:35 pm    Post subject: how to vocal message from package building script? Reply with quote

I"d like my portage update scripts [root] to send vocal messages to espeak-ng.
That fails when done from GUI terminal root session...
epeak-ng works fine from GUI terminal user session, e.g:
Code:
espeak -v mb/mb-en1 -s 100 -d pipewire "Hello world"
Any idea how to achieve this?

Thks 4 ur attention, interest & support.
_________________
USE="-* ..." in /etc/portage/make.conf here, i.e. a countermeasure to portage implicit braces, belt & diaper paradigm
LT: "I've been doing a passable imitation of the Fontana di Trevi, except my medium is mucus. Sooo much mucus. "
Back to top
View user's profile Send private message
dbtx
Tux's lil' helper
Tux's lil' helper


Joined: 20 Jan 2020
Posts: 117

PostPosted: Thu Oct 13, 2022 1:58 pm    Post subject: Reply with quote

You could have root run it as you:
Code:
# su - -c "espeak --options \"${message}\"" username
that should work fine if '-d pipewire' is an ALSA name.

edit: I tried going directly to ALSA with '-d hw:Loopback', still using alsa_in to feed into JACK, and I even copied my .asoundrc to /root. For some reason it opened a device and pretended to play but was silent unless I had used su to become the normal user. I thought ALSA would be good for permissions/environment "laundering" but it didn't work (yet). Anyway, su works.

edit++: as an aside, apparently the pipewire device is defined systemwide, and PW also installs an ALSA plugin. So it's probably not in ~/.asoundrc and it wouldn't have mattered anyway, or it wouldn't have worked anyway, or whatever. That only explains to me why root was able to run 'espeak -d pipewire' without throwing an error, even if that device wasn't in /root/.asoundrc . It doesn't change anything.
_________________
quasi-religious systemic wrongism pessimizes indiscriminately
Back to top
View user's profile Send private message
CaptainBlood
Advocate
Advocate


Joined: 24 Jan 2010
Posts: 3994

PostPosted: Thu Oct 13, 2022 10:48 pm    Post subject: Reply with quote

Thks 4 replying...
Code:
su - -c "espeak -v mb/mb-en1 -s 100 -d pipewire \"Hello world\"" user
start
DISPLAY
error: Host is down
is returned here...
Pipewire is launched when opening user session.
Side note, jack2 remains here too, as pipewire seems far from replacing it properly here...

Feeling lost here. :(

Thks 4 ur attention, interest & support.
_________________
USE="-* ..." in /etc/portage/make.conf here, i.e. a countermeasure to portage implicit braces, belt & diaper paradigm
LT: "I've been doing a passable imitation of the Fontana di Trevi, except my medium is mucus. Sooo much mucus. "
Back to top
View user's profile Send private message
dbtx
Tux's lil' helper
Tux's lil' helper


Joined: 20 Jan 2020
Posts: 117

PostPosted: Fri Oct 14, 2022 12:43 pm    Post subject: Reply with quote

I'm sorry, it seems you need some environment variables, and the '-' option to su clears some of them. That's my fault. At least PIPEWIRE_ALSA, PIPEWIRE_REMOTE, and PIPEWIRE_NODE are accessed when that plugin opens.

If "set | grep PIPEWIRE" in your root terminal gives you the same things as in a user terminal, then I think you can just remove that lone '-' and ideally it would find the things it needs. From that output, I wonder if that includes DISPLAY, but some web searching didn't make that clear yet. On my system, DISPLAY is left in the environment whether I "su" or "su -" to root. Surely, it also depends on whether you sudo -i, or su, or runas, etc. to get a root shell in the first place.

If not, you may have to set / export them, in a script or on that command line. Again, I don't know which ones are required. And then, if any are known to change from one desktop session to the next, that can get nasty.
_________________
quasi-religious systemic wrongism pessimizes indiscriminately
Back to top
View user's profile Send private message
CaptainBlood
Advocate
Advocate


Joined: 24 Jan 2010
Posts: 3994

PostPosted: Fri Oct 14, 2022 1:18 pm    Post subject: Reply with quote

Removing - causes DISPLAY echo removal.
Code:
set | grep PIPEWIRE
is empty for root & user.
Could you plz share your values?
[EDIT]: Can't google why & how to set these variables... Any tip?

Thks 4 ur attention, interest & support.
_________________
USE="-* ..." in /etc/portage/make.conf here, i.e. a countermeasure to portage implicit braces, belt & diaper paradigm
LT: "I've been doing a passable imitation of the Fontana di Trevi, except my medium is mucus. Sooo much mucus. "
Back to top
View user's profile Send private message
dbtx
Tux's lil' helper
Tux's lil' helper


Joined: 20 Jan 2020
Posts: 117

PostPosted: Sat Oct 15, 2022 1:19 pm    Post subject: Reply with quote

CaptainBlood wrote:
Removing - causes DISPLAY echo removal.

I wonder what it could have meant when it appeared. ;)
Quote:
Code:
set | grep PIPEWIRE
is empty for root & user.

Oh, boy. That means I'm just wrong about lots of things today. Another one was the reason I couldn't use Loopback directly as root: only because root didn't already have a copy of my .asoundrc at the time. So the automatic format/rate conversion in the pcm.!default section, with pcm.aloopDuplex and then hw:Loopback as slaves, was missing. It works now.
Quote:
Could you plz share your values?

I have never used pipewire. I only hoped it would be as straightforward for you as getting ALSA plugin bits sorted out. Those variables I mentioned only came from searching the plugin source for "getenv", and I hoped that something would be relevant. Their wiki doesn't even seem to have an ALSA section. Arch wiki's entire ALSA clients section consists of, "Install pipewire-alsa (and remove pulseaudio-alsa if it was installed) to route all application using the ALSA API through PipeWire." Maybe it really is supposed to be that simple.

What are your USE flags for media-libs/pcaudiolib?
_________________
quasi-religious systemic wrongism pessimizes indiscriminately
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Other Things Gentoo All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum