Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
alsamixer - XDG_RUNTIME_DIR (/run/user/1000)
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Multimedia
View previous topic :: View next topic  
Author Message
Joseph_sys
Advocate
Advocate


Joined: 08 Jun 2004
Posts: 2712
Location: Edmonton, AB

PostPosted: Sat Dec 16, 2023 8:31 pm    Post subject: alsamixer - XDG_RUNTIME_DIR (/run/user/1000) Reply with quote

After recent upgrade I have no sound.

Running as root:
Code:
alsamixer
XDG_RUNTIME_DIR (/run/user/1000) is not owned by us (uid 0), but by uid 1000! (This could e.g. happen if you try to connect to a non-root PulseAudio as a root user, over the native protocol. Don't do that.)

Does dir: /run/user/1000
should be own by "root:root" or user on the system?

When I run:
chown root:root /run/user/1000

Code:
alsamixer
ALSA lib /var/tmp/portage/media-plugins/alsa-plugins-1.2.7.1-r1/work/alsa-plugins-1.2.7.1/pulse/pulse.c:242:(pulse_connect) PulseAudio: Unable to connect: Access denied

cannot open mixer: Connection refused
Back to top
View user's profile Send private message
alamahant
Advocate
Advocate


Joined: 23 Mar 2019
Posts: 3918

PostPosted: Sat Dec 16, 2023 9:04 pm    Post subject: Reply with quote

/run/user/1000
should be owned by $USER:$USER.
Try running alsamixer as your ordinary user.
_________________
:)
Back to top
View user's profile Send private message
Joseph_sys
Advocate
Advocate


Joined: 08 Jun 2004
Posts: 2712
Location: Edmonton, AB

PostPosted: Sat Dec 16, 2023 9:29 pm    Post subject: Reply with quote

alamahant wrote:
/run/user/1000
should be owned by $USER:$USER.
Try running alsamixer as your ordinary user.


I can run alsamixer as user and it doesn't produce any errors but running "alsamixer" "F6" does not preserve setting for default sound card "default: 1"
"alsactl store" - does not preserve it either.

Code:
alsactl init;amixer set Master 100% unmute;alsactl store
Found hardware: "HDA-Intel" "Nvidia GPU 80 HDMI/DP" "HDA:10de0080,38426157,00100100" "0x3842" "0x6157"
Hardware is initialized using a generic method
Found hardware: "HDA-Intel" "Realtek ALC1220" "HDA:10ec1168,10438733,00100101" "0x1043" "0x8733"
Hardware is initialized using a generic method
amixer: Unable to find simple control 'Master',0


I can not seem to store/preserve the settings to: "default: 1"
Back to top
View user's profile Send private message
alamahant
Advocate
Advocate


Joined: 23 Mar 2019
Posts: 3918

PostPosted: Sat Dec 16, 2023 9:35 pm    Post subject: Reply with quote

Plz use
Code:

/etc/asound.conf
or
 ~/.asoundrc

with
Code:

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

_________________
:)
Back to top
View user's profile Send private message
grknight
Retired Dev
Retired Dev


Joined: 20 Feb 2015
Posts: 1921

PostPosted: Sat Dec 16, 2023 9:37 pm    Post subject: Reply with quote

I fix this HDMI preferred issue by placing the following into /etc/modprobe.d/snd-hda.conf and having snd-hda-intel and its codecs be modules:
Code:
options snd-hda-intel index=1,0

If it is not a module, then the kernel command-line can be changed to add snd-hda-intel.index=1,0

This will make the real sound device preferred over the video card HDMI audio
Back to top
View user's profile Send private message
Joseph_sys
Advocate
Advocate


Joined: 08 Jun 2004
Posts: 2712
Location: Edmonton, AB

PostPosted: Sat Dec 16, 2023 9:47 pm    Post subject: Reply with quote

alamahant wrote:
Plz use
Code:

/etc/asound.conf
or
 ~/.asoundrc

with
Code:

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


Hm...
Code:
ls -al /etc/asound.conf
ls: cannot access '/etc/asound.conf': No such file or directory
Back to top
View user's profile Send private message
Joseph_sys
Advocate
Advocate


Joined: 08 Jun 2004
Posts: 2712
Location: Edmonton, AB

PostPosted: Sat Dec 16, 2023 9:52 pm    Post subject: Reply with quote

grknight wrote:
I fix this HDMI preferred issue by placing the following into /etc/modprobe.d/snd-hda.conf and having snd-hda-intel and its codecs be modules:
Code:
options snd-hda-intel index=1,0

If it is not a module, then the kernel command-line can be changed to add snd-hda-intel.index=1,0

This will make the real sound device preferred over the video card HDMI audio


No, I don't have file: /etc/modprobe.d/snd-hda.conf
Most likely it is build into kernel.

Where do you put: "snd-hda-intel.index=1,0"
Back to top
View user's profile Send private message
grknight
Retired Dev
Retired Dev


Joined: 20 Feb 2015
Posts: 1921

PostPosted: Sat Dec 16, 2023 9:54 pm    Post subject: Reply with quote

Joseph_sys wrote:
No, I don't have file: /etc/modprobe.d/snd-hda.conf

Like most configuration files, it won't exist until you create it. Not having a file is not a problem for the module or modprobe.

Joseph_sys wrote:
Where do you put: "snd-hda-intel.index=1,0"

If you choose this route, then it goes in your loader (e.g. grub.conf via /etc/default/grub)
Back to top
View user's profile Send private message
Joseph_sys
Advocate
Advocate


Joined: 08 Jun 2004
Posts: 2712
Location: Edmonton, AB

PostPosted: Sat Dec 16, 2023 10:05 pm    Post subject: Reply with quote

grknight wrote:
Joseph_sys wrote:
No, I don't have file: /etc/modprobe.d/snd-hda.conf

Like most configuration files, it won't exist until you create it. Not having a file is not a problem for the module or modprobe.

Joseph_sys wrote:
Where do you put: "snd-hda-intel.index=1,0"

If you choose this route, then it goes in your loader (e.g. grub.conf via /etc/default/grub)


NO, I'm not putting anything in "grub.conf" I don't want to end-up with unbootable system.
The sound worked before upgraded, and I don't remember putting/creating file: /etc/modprobe.d/snd-hda.conf

besides if I create this file do I reboot the system relogin???
Something got screwed up during upgrade!
Back to top
View user's profile Send private message
Joseph_sys
Advocate
Advocate


Joined: 08 Jun 2004
Posts: 2712
Location: Edmonton, AB

PostPosted: Sat Dec 16, 2023 10:12 pm    Post subject: Reply with quote

Trying to follow: https://wiki.gentoo.org/wiki/ALSA

I have "media-sound/alsa-utils" installed but I these files are missing:
    /etc/asound.conf - Global (system wide) configuration file.
    ~/.asoundrc - Local (per user) configuration file.


Shouldn't "alsa-utils" create them?
Back to top
View user's profile Send private message
Joseph_sys
Advocate
Advocate


Joined: 08 Jun 2004
Posts: 2712
Location: Edmonton, AB

PostPosted: Sat Dec 16, 2023 11:18 pm    Post subject: Reply with quote

cat /var/log/messeges gives me the output:
Code:
[pulseaudio] protocol-native.c: Denied access to client with invalid authentication data.
pulseaudio[28829]: [autospawn] lock-autospawn.c: Cannot access autospawn lock.
pulseaudio[30032]: [autospawn] lock-autospawn.c: Cannot access autospawn lock.
pulseaudio[4497]: [pulseaudio] x11wrap.c: X11 I/O error handler called
pulseaudio[4497]: [pulseaudio] x11wrap.c: X11 I/O error exit handler called, preparing to tear down X11 modules
Back to top
View user's profile Send private message
sMueggli
Guru
Guru


Joined: 03 Sep 2022
Posts: 496

PostPosted: Sun Dec 17, 2023 9:40 am    Post subject: Reply with quote

Why does the user "root" have a environment variable XDG_RUNTIME_DIR set to /run/user/1000?
Back to top
View user's profile Send private message
Hu
Administrator
Administrator


Joined: 06 Mar 2007
Posts: 22657

PostPosted: Sun Dec 17, 2023 4:20 pm    Post subject: Reply with quote

The most common explanation is that user id 1000 logged in, received that variable as a correct value, then used an improper /bin/su, allowing that variable to leak into the root shell. Joseph_sys: how did you start this root shell? The correct answers (non-exhaustive) are:
  • By direct login on a console using root's username and password
  • By using /bin/su -l from a shell running as you
  • By using sudo -i from a shell running as you
A common incorrect answer is "by using /bin/su from a user shell".
Back to top
View user's profile Send private message
Joseph_sys
Advocate
Advocate


Joined: 08 Jun 2004
Posts: 2712
Location: Edmonton, AB

PostPosted: Sun Dec 17, 2023 7:02 pm    Post subject: Reply with quote

Hu wrote:
The most common explanation is that user id 1000 logged in, received that variable as a correct value, then used an improper /bin/su, allowing that variable to leak into the root shell. Joseph_sys: how did you start this root shell? The correct answers (non-exhaustive) are:
  • By direct login on a console using root's username and password
  • By using /bin/su -l from a shell running as you
  • By using sudo -i from a shell running as you
A common incorrect answer is "by using /bin/su from a user shell".


I used "su" without "-"; using "su -" doesn't produce the error. Besides my sound miraculously returned aster reboot.
Don't know how, must have enable some setting via alsamixer

Shouldn't there be "/etc/asound.conf" file generated?
I have media-sound/alsa-utils installed but there is no: "alsaconf" command.
How those files are generated:
    /etc/asound.conf - Global (system wide) configuration file.
    ~/.asoundrc - Local (per user) configuration file.


I haven't done setting for a while, nor would I pay attention to such details but I think it was done by running "alsaconf" supplied by "alsa-utils"
Back to top
View user's profile Send private message
flexibeast
Guru
Guru


Joined: 04 Apr 2022
Posts: 450
Location: Naarm/Melbourne, Australia

PostPosted: Mon Dec 18, 2023 12:56 am    Post subject: Reply with quote

Neither /etc/asound.conf and ~/.asoundrc are generated, either by the upstream alsa-utils sources, or via the related ebuild; they don't have to exist (e.g. the alsa-info.sh script checks whether or not they actually exist), and so need to be created by the system adminstrator and user, respectively.
Back to top
View user's profile Send private message
garrison
Apprentice
Apprentice


Joined: 18 Mar 2003
Posts: 265

PostPosted: Mon Dec 18, 2023 7:38 am    Post subject: Reply with quote

Joseph_sys wrote:

I used "su" without "-"; using "su -" doesn't produce the error. Besides my sound miraculously returned aster reboot.
Don't know how, must have enable some setting via alsamixer

Currently your sounds go via puluseaudio plugin for alsa. In this case you probably do not want to test alsa sounds using root user, because by default you only have access from the user running pulseaudio daemon.
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Multimedia 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