You are not logged in.

#1 2017-03-07 18:02:55

anthon
Member
Registered: 2013-05-13
Posts: 34

[Solved] PulseAudio, Firefox, VLC...

Until today I was only using ALSA for sound, and it just worked. Today, Firefox 52 hit the repo so now I have to use PulseAudio to get sound in firefox. Fair enough, I installed PulseAudio.
My problems are the following:
- Without pulseaudio-alsa, I can't have sound in firefox and in vlc (or amarok for example) at the same time. Using vlc and amarok at the same time works though.
- With pulseaudio-alsa, changing the volume or muting it in vlc is very laggy (2 or 3 seconds). Super annoying. In the vlc forums on a post bringing up a similar problem, a vlc dev says "use pulseaudio and it won't lag. if you use alsa it will lag." But I'm experiencing the opposite.

Anyone else has those issues? Or any idea how to fix them?

Last edited by anthon (2017-03-08 02:27:55)

Offline

#2 2017-03-07 18:13:26

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

Re: [Solved] PulseAudio, Firefox, VLC...

Have you set up your VLC audio output plugin to play back via pulseaudio? What's the output of

pacmd list-sink-inputs

while playing something in VLC

Online

#3 2017-03-07 19:00:14

anthon
Member
Registered: 2013-05-13
Posts: 34

Re: [Solved] PulseAudio, Firefox, VLC...

V1del wrote:

Have you set up your VLC audio output plugin to play back via pulseaudio?

I can't choose pulseaudio in the output module list, but if I choose Automatic or ALSA, I can choose pulseaudio in the device list. The problems remain anyway.

V1del wrote:

What's the output of

pacmd list-sink-inputs

while playing something in VLC

Without pulseaudio-alsa:

0 sink input(s) available.

With pulseaudio-alsa:

1 sink input(s) available.
    index: 4
        driver: <protocol-native.c>
        flags: 
        state: RUNNING
        sink: 0 <alsa_output.pci-0000_00_1b.0.analog-stereo>
        volume: front-left: 65536 / 100% / 0,00 dB,   front-right: 65536 / 100% / 0,00 dB
                balance 0,00
        muted: no
        current latency: 1987,96 ms
        requested latency: 40,00 ms
        sample spec: float32le 2ch 44100Hz
        channel map: front-left,front-right
                     Stéréo
        resample method: copy
        module: 9
        client: 5 <ALSA plug-in [vlc]>
        properties:
                media.name = "ALSA Playback"
                application.name = "ALSA plug-in [vlc]"
                native-protocol.peer = "UNIX socket client"
                native-protocol.version = "32"
                application.process.id = "2255"
                application.process.user = "anthony"
                application.process.host = "inspiron7537"
                application.process.binary = "vlc"
                application.language = "fr_FR.utf8"
                window.x11.display = ":0"
                application.process.machine_id = "89773dbd92ae4b62ac2f051bd3a0ee69"
                application.process.session_id = "c2"
                application.icon_name = "vlc"
                module-stream-restore.id = "sink-input-by-application-name:ALSA plug-in [vlc]"

To be clear, I'm pretty sure problem n°1 is supposed to be fixed by installing pulseaudio-alsa, which works. But then problem n°2 appears, and as I said, it's super annoying.

Offline

#4 2017-03-07 19:42:04

progandy
Member
Registered: 2012-05-17
Posts: 5,184

Re: [Solved] PulseAudio, Firefox, VLC...

If you run vlc with pulseaudio-alsa, then you don't use pulseaudio directly.

Last edited by progandy (2017-03-07 19:42:47)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Online

#5 2017-03-07 20:12:46

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

Re: [Solved] PulseAudio, Firefox, VLC...

Do you have a non repo vlc package? VLC does support direct playback via pulseaudio you should be able to use that in the output modules. You currently are using VLC via ALSA which shouldn't be necessary, quit VLC then run

sudo /usr/lib/vlc/vlc-cache-gen -f /usr/lib/vlc/plugins

then try to use it and check if you can switch to the pulse output module then.

Online

#6 2017-03-07 21:18:04

anthon
Member
Registered: 2013-05-13
Posts: 34

Re: [Solved] PulseAudio, Firefox, VLC...

I did have vlc-nightly from the AUR, but rolling back to vlc from the normal repo didn't make pulseaudio appear in the ouput modules. Regenerating the cache didn't help neither. To be clear, when you talk about output modules, you're talking about the combo list in the preferences, and not the device list available in the main window menu, right?

Also now problem n°2 happens even without pulseaudio-alsa. Not sure what changed, I tinkered a bit with ouput modules/ouput devices but put everything back as it was.
Also now  without pulseaudio-alsa, I can play firefox sounds and vlc at the same time (edit: sometimes... I'm going crazy) , but not phonon applications. At all it seems. alsa says the device is busy. So alsa is used. wtf. this was due to a hard reboot that left asound.state in a dirty state

Last edited by anthon (2017-03-08 01:01:39)

Offline

#7 2017-03-08 01:01:33

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

Re: [Solved] PulseAudio, Firefox, VLC...

Yeah I'm talking about that combo list in preferences. For comparisons sake my pacmd list-sink-inputs looks like this:

index: 2
        driver: <protocol-native.c>
        flags: START_CORKED FIX_RATE 
        state: RUNNING
        sink: 0 <alsa_output.usb-1e7d_KAVE_XTD_Headset-00.analog-surround-51>
        volume: front-left: 36700 /  56% / -15.11 dB,   front-right: 36700 /  56% / -15.11 dB
                balance 0.00
        muted: no
        current latency: 409.04 ms
        requested latency: 40.00 ms
        sample spec: float32le 2ch 48000Hz
        channel map: front-left,front-right
                     Stereo
        resample method: copy
        module: 10
        client: 16 <VLC media player>
        properties:
                media.role = "video"
                media.name = "audio stream"
                application.name = "VLC media player"
                native-protocol.peer = "UNIX socket client"
                native-protocol.version = "32"
                application.id = "org.VideoLAN.VLC"
                application.version = "2.2.4"
                application.icon_name = "vlc"
                application.language = "de_CH.UTF-8"
                application.process.id = "1919"
                application.process.user = "videl"
                application.process.host = "arch-videl"
                application.process.binary = "vlc"
                window.x11.display = ":0"
                application.process.machine_id = "ef708790c5d340338fecf6c8033cfd8e"
                application.process.session_id = "c2"
                module-stream-restore.id = "sink-input-by-media-role:video"

the relevant part here is the latency, which is way lower with direct pulse output and in addition to that, volume changes within VLC do not adjust an arbitrary custom VLC software mixer which then gets transferred to the pulseaudio-alsa layer which then tries to adjust the sink, but the volume changes affect the VLC stream directly, letting pulse take care of properly and without lag adjust that output stream.

We now have to find out why your VLC decides not to give you the pulseaudio module as an option. If you are now on the repo package what does

pacman -Qkk vlc

give you? Are the files

pacman -Ql vlc | grep pulse
vlc /usr/lib/vlc/plugins/access/libpulsesrc_plugin.so
vlc /usr/lib/vlc/plugins/audio_output/libpulse_plugin.so
vlc /usr/lib/vlc/plugins/services_discovery/libpulselist_plugin.so

present and reasonably sized (the -Qkk should tell you if that wasn't the case)?

Online

#8 2017-03-08 01:26:06

anthon
Member
Registered: 2013-05-13
Posts: 34

Re: [Solved] PulseAudio, Firefox, VLC...

# pacman -Qkk vlc
warning: vlc: /usr/lib/vlc/plugins/plugins.dat (Modification time mismatch)
warning: vlc: /usr/lib/vlc/plugins/plugins.dat (Size mismatch)
vlc: 1006 total files, 1 altered file
# pacman -Ql vlc | grep pulse
vlc /usr/lib/vlc/plugins/access/libpulsesrc_plugin.so
vlc /usr/lib/vlc/plugins/audio_output/libpulse_plugin.so
vlc /usr/lib/vlc/plugins/services_discovery/libpulselist_plugin.so

That last part seems correct but yeah apparently there's a problem above
Edit: or not? since plugins.dat is generated post install

Last edited by anthon (2017-03-08 01:35:02)

Offline

#9 2017-03-08 01:45:09

progandy
Member
Registered: 2012-05-17
Posts: 5,184

Re: [Solved] PulseAudio, Firefox, VLC...

I just ran ldd over the libpulse_plugin.so, and I got an interesting result. It links to a number of libraries which are in optional packages for vlc. Do you have all of them installed?
Edit: Seems to be false alarm. Everything should be installed somewhere deep in the dependency tree of pulseaudio.
Somehow I did not think that pulseaudio drags so many audio codecs along, but that is what happens.

% ldd libpulse_plugin.so | sed -n 's/^.*=> \(.*\) (.*$/\1/p' | pacman -Qqo - | sort -u 
dbus
flac
glibc
libasyncns
libcap
libgcrypt
libgpg-error
libogg
libpulse
libsndfile
libsystemd
libvorbis
libxau
libxcb
libxdmcp
lz4
xz

Last edited by progandy (2017-03-08 02:00:24)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Online

#10 2017-03-08 01:47:09

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

Re: [Solved] PulseAudio, Firefox, VLC...

That all looks correct. One thing that might be, is pulseaudio already running prior to launching VLC? Might be something along that line, if you play something in firefox, then start VLC and check back in the preferences do you have the pulseaudio option now? Is there any output from running in terminal? Have you already tried resetting your config by moving/removing ~/.config/vlc ?

Edit: Didn't see Progandy's reply, this might be an interesting bit indeed

Last edited by V1del (2017-03-08 11:47:33)

Online

#11 2017-03-08 02:01:16

anthon
Member
Registered: 2013-05-13
Posts: 34

Re: [Solved] PulseAudio, Firefox, VLC...

I wanted to run progandy's command, but it turns out /usr/lib/vlc/plugins/audio_output/libpulse_plugin.so doesn't exist! I didn't realise pacman -Ql would return files not present on my system. Which package is this file from?

Offline

#12 2017-03-08 02:08:06

anthon
Member
Registered: 2013-05-13
Posts: 34

Re: [Solved] PulseAudio, Firefox, VLC...

So this file is present in the vlc package that pacman downloads, but somehow it doesn't install it...??? The other files seem to be there

Offline

#13 2017-03-08 02:15:19

progandy
Member
Registered: 2012-05-17
Posts: 5,184

Re: [Solved] PulseAudio, Firefox, VLC...

libpulse_plugin.so is part of the vlc package. pacman -Qkk should throw an error if it is missing.
Can you try to remove your vlc configuration (~/.config/vlc) and reinstall the vlc package? A backup of the config might be useful if you have made larger changes.

You could also try to manually extract the file from the cached package in /var/cache/pacman/pkg.

Last edited by progandy (2017-03-08 02:16:59)


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Online

#14 2017-03-08 02:27:37

anthon
Member
Registered: 2013-05-13
Posts: 34

Re: [Solved] PulseAudio, Firefox, VLC...

deleting the config didn't help, but extracting the file manually did the trick and now no more lag!
Thanks guys.
I'm gonna mark this as solved, but now I have to figure out why this specific file is not extracted by pacman. Complete mystery to me. I'll report back if I find something.

Offline

#15 2017-03-08 08:35:23

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

Re: [Solved] PulseAudio, Firefox, VLC...

Well there are the NoExtract directives and maybe you specifically added it there to not be extracted? That would explain this.

Random-Off-Topic of the day @Progandy: Pulse drags these audio codecs along because it can record into them with parec utilities, so you don't have to record a full WAV and manually convert them later.

Last edited by V1del (2017-03-08 11:47:43)

Online

#16 2017-03-08 10:37:57

anthon
Member
Registered: 2013-05-13
Posts: 34

Re: [Solved] PulseAudio, Firefox, VLC...

You're right! I had the file in NoExtract. I don't remember which problem this was supposed to fix, but oh well... Thanks again.

Offline

Board footer

Powered by FluxBB