You are not logged in.

#1 2017-08-09 11:57:22

ybsar
Member
Registered: 2013-05-15
Posts: 10

[SOLVED] No sound but for a specific user (ALSA/PulseAudio)

Sound used to work for user which opened its session first (using PulseAudio). I messed it up trying to improve it, since then it only works for one specific user (no matter PulseAudio is running or not).

I tried to fix it by adding ipc_key_add_uid 0 and ipc_perm 0660 to /etc/asound.conf which now is:

# Use PulseAudio by default
pcm.!default {
  type pulse
  fallback "sysdefault"
  hint {
    show on
    description "Default ALSA Output (currently PulseAudio Sound Server)"
  }
}

# Allow any user
pcm.dmixer {
    type dmix
    ipc_key 1024
    ipc_key_add_uid 0
    ipc_perm 0660
    slave {
        pcm "hw:0"
        period_size 4096
        buffer_size 131072
        rate 50000
    }
    bindings {
        0 0
        1 1
    }
}

# Use PulseAudio by default
ctl.!default {
  type pulse
  fallback "sysdefault"
}
  • aplay -l returns

**** List of PLAYBACK Hardware Devices ****
card 0: PCH [HDA Intel PCH], device 0: VT1802 Analog [VT1802 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 2: VT1802 Alt Analog [VT1802 Alt Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 0: PCH [HDA Intel PCH], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
  • amixer -c 0 returns

Simple mixer control 'Master',0
  Capabilities: pvolume pvolume-joined pswitch pswitch-joined
  Playback channels: Mono
  Limits: Playback 0 - 42
  Mono: Playback 28 [67%] [-21.00dB] [on]
Simple mixer control 'Headphone',0
  Capabilities: pvolume pswitch
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 42
  Mono:
  Front Left: Playback 42 [100%] [0.00dB] [on]
  Front Right: Playback 42 [100%] [0.00dB] [on]
Simple mixer control 'Speaker',0
  Capabilities: pvolume pswitch
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 42
  Mono:
  Front Left: Playback 42 [100%] [0.00dB] [on]
  Front Right: Playback 42 [100%] [0.00dB] [on]
Simple mixer control 'PCM',0
  Capabilities: pvolume
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 255
  Mono:
  Front Left: Playback 255 [100%] [0.00dB]
  Front Right: Playback 255 [100%] [0.00dB]
Simple mixer control 'Mic',0
  Capabilities: pvolume pswitch
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 31
  Mono:
  Front Left: Playback 31 [100%] [12.00dB] [on]
  Front Right: Playback 31 [100%] [12.00dB] [on]
Simple mixer control 'Mic Boost',0
  Capabilities: volume
  Playback channels: Front Left - Front Right
  Capture channels: Front Left - Front Right
  Limits: 0 - 3
  Front Left: 0 [0%] [0.00dB]
  Front Right: 0 [0%] [0.00dB]
Simple mixer control 'IEC958',0
  Capabilities: pswitch pswitch-joined
  Playback channels: Mono
  Mono: Playback [on]
Simple mixer control 'Beep',0
  Capabilities: pvolume pvolume-joined pswitch pswitch-joined
  Playback channels: Mono
  Limits: Playback 0 - 18
  Mono: Playback 3 [17%] [-10.50dB] [on]
Simple mixer control 'Capture',0
  Capabilities: cvolume cswitch
  Capture channels: Front Left - Front Right
  Limits: Capture 0 - 31
  Front Left: Capture 31 [100%] [30.00dB] [on]
  Front Right: Capture 31 [100%] [30.00dB] [on]
Simple mixer control 'Auto-Mute Mode',0
  Capabilities: enum
  Items: 'Disabled' 'Enabled'
  Item0: 'Disabled'
Simple mixer control 'Digital',0
  Capabilities: cvolume
  Capture channels: Front Left - Front Right
  Limits: Capture 0 - 120
  Front Left: Capture 107 [89%] [23.50dB]
  Front Right: Capture 107 [89%] [23.50dB]
Simple mixer control 'Dynamic Power-Control',0
  Capabilities: enum
  Items: 'Disabled' 'Enabled'
  Item0: 'Disabled'
Simple mixer control 'Independent HP',0
  Capabilities: enum
  Items: 'Disabled' 'Enabled'
  Item0: 'Disabled'
Simple mixer control 'Internal Mic',0
  Capabilities: pvolume pswitch
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 31
  Mono:
  Front Left: Playback 31 [100%] [12.00dB] [on]
  Front Right: Playback 31 [100%] [12.00dB] [on]
Simple mixer control 'Internal Mic Boost',0
  Capabilities: volume
  Playback channels: Front Left - Front Right
  Capture channels: Front Left - Front Right
  Limits: 0 - 3
  Front Left: 2 [67%] [20.50dB]
  Front Right: 1 [33%] [10.25dB]
Simple mixer control 'Loopback Mixing',0
  Capabilities: enum
  Items: 'Disabled' 'Enabled'
  Item0: 'Disabled'
  • fuser /dev/snd/* returns nothing.

Running PulseAudio daemon did not help, removing ~/.config/pulse either.

Last edited by ybsar (2017-08-12 11:32:42)

Offline

#2 2017-08-09 12:33:14

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,427

Re: [SOLVED] No sound but for a specific user (ALSA/PulseAudio)

Please convert all your outputs to code tags, the first one is, the subsequent ones are quote tags for some reason.

In a pulseaudio environment and in a setup like this that dmix should not be relevant at all (if you really want to go through with this dmix config in any way you might be better off disabling/not using pulseaudio). Also the output of

sudo fuser -v /dev/snd/*

should be what's relevant, if you aren't executing that as root you aren't going to get the info you want. Does any form of

speaker-test -c2 -Ddmixer

give you sound on any of your users?

This reads like an XY Problem. What are you trying to accomplish? Why do you need multiple users to have access to your sound card simultaneously?

Edit: And a rate of 50000 doesn't make any sense in any form. Use 44100 as a default value. In a similar vein I don't know by what measure your buffers come from...

Last edited by V1del (2017-08-09 12:38:24)

Offline

#3 2017-08-09 15:23:29

ybsar
Member
Registered: 2013-05-15
Posts: 10

Re: [SOLVED] No sound but for a specific user (ALSA/PulseAudio)

Thank you, I fixed my post and dropped the entire pcm.dmixer section from /etc/asound.conf (basically reverting to default one).

Yes speaker-test -c2 -Ddmixer works for both users. I forgot to mention I successfully ran speaker-test -Dhw:0,0 -c2 too.

Edit: I do not "need multiple users to have access to your sound card simultaneously", just trying to restore initial behaviour.

Edit2: fuser returns nothing (even with sudo), If I run PulseAudio daemon, it returns:

                     USER        PID ACCESS COMMAND
/dev/snd/controlC0:  me          42  F....  pulseaudio

Last edited by ybsar (2017-08-09 15:30:35)

Offline

#4 2017-08-11 22:05:12

ybsar
Member
Registered: 2013-05-15
Posts: 10

Re: [SOLVED] No sound but for a specific user (ALSA/PulseAudio)

Let's try to present the issue again, from the beginning, more clearly:

  • Sound is working for one specific user, let call her, Alice.

  • Sound is not working for any other user (including Me), even when Alice did not log in earlier. This is the issue.

All users and snd devices belong to the audio group, package pulseaudio-alsa is installed and /etc/asound.conf settings are back to defaults.

Once PulseAudio user daemon started, Me running sudo fuser -v /dev/snd/* returns

                     USER        PID ACCESS COMMAND
/dev/snd/controlC0:  Me          42  F....  pulseaudio

For both Alice and Me, speaker-test -c2 does not produce any sound, whereas speaker-test -Dhw:0,0 -c2 does.

Offline

#5 2017-08-11 23:32:10

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,427

Re: [SOLVED] No sound but for a specific user (ALSA/PulseAudio)

Repost fuser during playback. I have a feeling that some config somewhere prevents pulse from properly accessing your audio devices. You mention explicitly starting pulse, you shouldn't need to do that usually. What are the outputs, during playback of 

aplay -L
#You might want to post the following from both, the working and not working user
systemctl --user status pulseaudio
pacmd list-sinks
pacmd list-sink-inputs

Offline

#6 2017-08-12 10:54:02

ybsar
Member
Registered: 2013-05-15
Posts: 10

Re: [SOLVED] No sound but for a specific user (ALSA/PulseAudio)

fuser output is still the same during playback (Me running mplayer):

                     USER        PID ACCESS COMMAND
/dev/snd/controlC0:  Me          705 F.... pulseaudio

Yes, I don't need to start PulseAudio explicitely, it was just for test purpose.

Here are commands output during playback (Me running mplayer).

  • Me $ aplay -L

    null
        Discard all samples (playback) or generate zero samples (capture)
    pulse
        PulseAudio Sound Server
    default
        Default ALSA Output (currently PulseAudio Sound Server)
    sysdefault:CARD=PCH
        HDA Intel PCH, VT1802 Analog
        Default Audio Device
    front:CARD=PCH,DEV=0
        HDA Intel PCH, VT1802 Analog
        Front speakers
    surround21:CARD=PCH,DEV=0
        HDA Intel PCH, VT1802 Analog
        2.1 Surround output to Front and Subwoofer speakers
    surround40:CARD=PCH,DEV=0
        HDA Intel PCH, VT1802 Analog
        4.0 Surround output to Front and Rear speakers
    surround41:CARD=PCH,DEV=0
        HDA Intel PCH, VT1802 Analog
        4.1 Surround output to Front, Rear and Subwoofer speakers
    surround50:CARD=PCH,DEV=0
        HDA Intel PCH, VT1802 Analog
        5.0 Surround output to Front, Center and Rear speakers
    surround51:CARD=PCH,DEV=0
        HDA Intel PCH, VT1802 Analog
        5.1 Surround output to Front, Center, Rear and Subwoofer speakers
    surround71:CARD=PCH,DEV=0
        HDA Intel PCH, VT1802 Analog
        7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
    hdmi:CARD=PCH,DEV=0
        HDA Intel PCH, HDMI 0
        HDMI Audio Output
  • Me $ systemctl --user status pulseaudio

    * pulseaudio.service - Sound Service
       Loaded: loaded (/usr/lib/systemd/user/pulseaudio.service; disabled; vendor preset: enabled)
       Active: active (running) since Sat 2017-08-12 12:07:07 CEST; 26min ago
     Main PID: 705 (pulseaudio)
       CGroup: /user.slice/user-1000.slice/user@1000.service/pulseaudio.service
               `-705 /usr/bin/pulseaudio --daemonize=no
    
    Aug 12 12:07:07 MyHost systemd[650]: Starting Sound Service...
    Aug 12 12:07:07 MyHost pulseaudio[705]: W: [pulseaudio] authkey.c: Failed to open cookie file '/home/Me/.config/pulse/cookie': No such file or directory
    Aug 12 12:07:07 MyHost pulseaudio[705]: W: [pulseaudio] authkey.c: Failed to load authentication key '/home/Me/.config/pulse/cookie': No such file or directory
    Aug 12 12:07:07 MyHost systemd[650]: Started Sound Service.
    Aug 12 12:07:07 MyHost pulseaudio[705]: E: [pulseaudio] bluez5-util.c: GetManagedObjects() failed: org.freedesktop.systemd1.NoSuchUnit: Unit dbus-org.bluez.service not found.
  • Me $ pacmd list-sinks

    1 sink(s) available.
      * index: 0
            name: <auto_null>
            driver: <module-null-sink.c>
            flags: DECIBEL_VOLUME LATENCY DYNAMIC_LATENCY
            state: RUNNING
            suspend cause: 
            priority: 1000
            volume: front-left: 65536 / 100% / 0,00 dB,   front-right: 65536 / 100% / 0,00 dB
                    balance 0,00
            base volume: 65536 / 100% / 0,00 dB
            volume steps: 65537
            muted: no
            current latency: 0,09 ms
            max request: 0 KiB
            max rewind: 0 KiB
            monitor source: 1
            sample spec: s16le 2ch 44100Hz
            channel map: front-left,front-right
                         Stéréo
            used by: 4
            linked by: 4
            configured latency: 0,50 ms; range is 0,50 .. 2000,00 ms
            module: 15
            properties:
                    device.description = "Dummy Output"
                    device.class = "abstract"
                    device.icon_name = "audio-card"
  • Me $ pacmd list-sink-inputs

    4 sink input(s) available.
        index: 0
            driver: <protocol-native.c>
            flags: 
            state: DRAINED
            sink: 0 <auto_null>
            volume: mono: 65536 / 100% / 0,00 dB
                    balance 0,00
            muted: no
            current latency: 0,00 ms
            requested latency: 0,50 ms
            sample spec: s16le 1ch 44100Hz
            channel map: mono
                         Mono
            resample method: copy
            module: 11
            client: 1 <speech-dispatcher>
            properties:
                    media.name = "playback"
                    application.name = "speech-dispatcher"
                    native-protocol.peer = "UNIX socket client"
                    native-protocol.version = "32"
                    application.process.id = "702"
                    application.process.user = "Me"
                    application.process.host = "MyHost"
                    application.process.binary = "sd_generic"
                    application.language = "C"
                    window.x11.display = ":0"
                    application.process.machine_id = "89f38b74726f40c3a04860b28e3ec5ea"
                    application.process.session_id = "c1"
                    module-stream-restore.id = "sink-input-by-application-name:speech-dispatcher"
        index: 1
            driver: <protocol-native.c>
            flags: 
            state: DRAINED
            sink: 0 <auto_null>
            volume: mono: 65536 / 100% / 0,00 dB
                    balance 0,00
            muted: no
            current latency: 0,00 ms
            requested latency: 0,50 ms
            sample spec: s16le 1ch 44100Hz
            channel map: mono
                         Mono
            resample method: copy
            module: 11
            client: 2 <speech-dispatcher>
            properties:
                    media.name = "playback"
                    application.name = "speech-dispatcher"
                    native-protocol.peer = "UNIX socket client"
                    native-protocol.version = "32"
                    application.process.id = "718"
                    application.process.user = "Me"
                    application.process.host = "MyHost"
                    application.process.binary = "sd_dummy"
                    application.language = "C"
                    window.x11.display = ":0"
                    application.process.machine_id = "89f38b74726f40c3a04860b28e3ec5ea"
                    application.process.session_id = "c1"
                    module-stream-restore.id = "sink-input-by-application-name:speech-dispatcher"
        index: 2
            driver: <protocol-native.c>
            flags: 
            state: DRAINED
            sink: 0 <auto_null>
            volume: mono: 65536 / 100% / 0,00 dB
                    balance 0,00
            muted: no
            current latency: 0,00 ms
            requested latency: 0,50 ms
            sample spec: s16le 1ch 44100Hz
            channel map: mono
                         Mono
            resample method: copy
            module: 11
            client: 3 <speech-dispatcher>
            properties:
                    media.name = "playback"
                    application.name = "speech-dispatcher"
                    native-protocol.peer = "UNIX socket client"
                    native-protocol.version = "32"
                    application.process.id = "721"
                    application.process.user = "Me"
                    application.process.host = "MyHost"
                    application.process.binary = "sd_espeak"
                    application.language = "C"
                    window.x11.display = ":0"
                    application.process.machine_id = "89f38b74726f40c3a04860b28e3ec5ea"
                    application.process.session_id = "c1"
                    module-stream-restore.id = "sink-input-by-application-name:speech-dispatcher"
        index: 12
            driver: <protocol-native.c>
            flags: 
            state: RUNNING
            sink: 0 <auto_null>
            volume: front-left: 65536 / 100% / 0,00 dB,   front-right: 65536 / 100% / 0,00 dB
                    balance 0,00
            muted: no
            current latency: 482,83 ms
            requested latency: 31,25 ms
            sample spec: s16le 2ch 44100Hz
            channel map: front-left,front-right
                         Stereo
            resample method: (null)
            module: 11
            client: 18 <ALSA plug-in [mplayer]>
            properties:
                    media.name = "ALSA Playback"
                    application.name = "ALSA plug-in [mplayer]"
                    native-protocol.peer = "UNIX socket client"
                    native-protocol.version = "32"
                    application.process.id = "1781"
                    application.process.user = "Me"
                    application.process.host = "MyHost"
                    application.process.binary = "mplayer"
                    application.language = "C"
                    window.x11.display = ":0"
                    application.process.machine_id = "89f38b74726f40c3a04860b28e3ec5ea"
                    application.process.session_id = "c1"
                    application.icon_name = "mplayer"
                    module-stream-restore.id = "sink-input-by-application-name:ALSA plug-in [mplayer]"

Note that Alice has not logged in and has no PulseAudio daemon running at that time, so commands for Alice just complain about no PulseAudio daemon running. Running mplayer from Alice shell doesn't require PulseAudio daemon either.

Offline

#7 2017-08-12 11:32:32

ybsar
Member
Registered: 2013-05-15
Posts: 10

Re: [SOLVED] No sound but for a specific user (ALSA/PulseAudio)

Thanks for the hints. I was convinced the issue was on ALSA. I solved it with PulseAudio:

pacmd set-card-profile alsa_card.pci-0000_00_1b.0 output:analog-stereo+input:analog-stereo

Edit: I grabbed card identifier from pacmd list-sinks command output ran by Alice with a running PulseAudio daemon.

Last edited by ybsar (2017-08-12 11:36:17)

Offline

Board footer

Powered by FluxBB