You are not logged in.

#1 2012-01-17 02:31:30

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,140

[Solved mysteriously - user idiocy?] Sound for VLC

Can anybody point me to documentation covering the configuration of sound for VLC? I have got sound working OK generally - system sounds, iPlayer radio in Firefox (though firefox sounds for e.g. noscript are a different issue), amarok can play mp3s, I can play .wav files using various command line utilities etc. But nothing I do persuades VLC to give me sound. VLC plays the file - the time passes etc. and there are no complaints - but there is no actual sound.

I'm asking for documentation because I don't have a clue where to start with this and I don't want to just post a "it doesn't work - help!" request but I also don't want to post the output of every possibly relevant command and the contents of every config file which might affect things.

I'm thinking there must be something specific to VLC which I'm not aware of. I've worked through most of the basic sound configuration stuff on the wiki, I think (alsa mainly but also pulse audio). I've tried looking at VLC's wiki page which doesn't mention anything odd about its sound requirements. I did try following the links to external documentation from there but I didn't find any leads to work on. The assumption seems to be that if sound doesn't work in VLC, it will be due to a general problem with e.g. alsa configuration. So another possibility is that VLC is much more picky about alsa config than other applications?

Last edited by cfr (2012-01-19 03:52:55)


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#2 2012-01-17 03:04:58

Roken
Member
From: South Wales, UK
Registered: 2012-01-16
Posts: 1,253

Re: [Solved mysteriously - user idiocy?] Sound for VLC

I've had a similar "problem" -though it's not so much as a problem than it is a configuration thing. I had pulse briefly (it got installed with something else) but I rapidly removed it and dropped back to alsa,

In my case I have several sound devices, some of which are unused completely (HDMI on my gfx card for example), so I first blacklisted those driver in alsa-base.blacklist. It's a good idea to have a ~/.asoundrc to set up a default card, though not necessary for vlc. Once you blacklist unneeded drivers, fire up vlc and open preferences, select alsa output in the Audio prefs and choose your card from the dropdown. Save and restart your media, which should give you audio.


Ryzen 5900X 12 core/24 thread - RTX 3090 FE 24 Gb, Asus Prime B450 Plus, 32Gb Corsair DDR4, Cooler Master N300 chassis, 5 HD (1 NvME PCI, 4SSD) + 1 x optical.
Linux user #545703

Offline

#3 2012-01-17 23:18:08

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,140

Re: [Solved mysteriously - user idiocy?] Sound for VLC

Thanks for replying. I went back to the wiki page on alsa to figure out how to set a default card/blacklist modules etc. but I'm finding it a bit difficult to follow.  Specifically, I was reading https://wiki.archlinux.org/index.php/Ad … sound_card. I started by looking at the first method. Information gathering, I think the relevant line for the card model from lspci is:

00:1b.0 Audio device: Intel Corporation 6 Series/C200 Series Chipset Family High Definition Audio Controller (rev 04)

And to get the list of alsa driver module names, it suggests:

$ cat /proc/asound/modules 
 0 snd_hda_intel
29 thinkpad_acpi

I am not sure how to translate this into the relevant line for /etc/modprobe.d/alsa.conf, though. The example in the wiki is:

options snd slots=snd-intel8x0

but I'm not sure how that relates to the contents of /proc/asound/modules. I take it that the final 0 ensures this gets the default slot - that's the point, as I understand it. But is 8 part of the module name or something added? And why 8? I wondered if I should add:

options snd slots=snd_hda_intelx0

but something tells me that's not right.

Also, I can tell from lsmod that I have a bunch of other snd modules loaded.

So I thought maybe userspace would work out better. I already have an /etc/asound.conf which is part of pulseaudio-alsa. I'm not certain what this is saying. I'm not sure of the syntax and can't find a relevant manual page. (No doubt I'm searching for the wrong terms.)

# Use PulseAudio by default
pcm.!default {
  type pulse
}

ctl.!default {
  type pulse
}

# Explicit PulseAudio device
pcm.pulse {
  type pulse
}

ctl.pulse {
  type pulse
}

# vim:set ft=alsaconf:

What do the exclamation marks mean in this context? The comment suggests pulse is default for pcm and ctl but then I don't understand the exclamation points.

I checked /usr/share/alsa/alsa.conf in the hope that it might be better commented but it isn't really making anything clearer for me right now.

I'm not even sure if I should have pulseaudio installed. I know I need libpulse and I suspect that I thought I might need pulseaudio-alsa to get things to work nicely together.

I wish I understood this better. It doesn't help that everything seems to be written in acronyms and I have no idea what they mean. (I'm assuming that e.g. PCH, PCM are acronyms and maybe EC. I am pretty sure EC is related to ACPI which I know is to do with power management. I definitely need a list of abbreviations! BIOS, (U)EFI, AHCI, EHCI... I know what some of these are for but not what they mean:).)

If in alsamixer I use F6 to get the choice of sound cards, I seem to have three options (other than entering a name):
- default
- card0
- card29.
I'd expect looking at "default" to look the same as looking at one of the other two options but it looks like neither. It shows one channel (?) "Master". Selecting card0 (which is the intel soundcard I want to be using, I think), I get four channels but one of them is empty "Master", "PCM", "S/PDIF" (another acronym and empty), "Beep". Selecting card29 gets me one tiny channel "Console" with the "00" but no bars above it.

Incidentally, the correct device always seems to get slot 0 so far as I can tell without any interference on my part. Would VLC be using something different?

Is this because pulse is default and that appears as another option to alsa? I saw in /etc/asound.conf that it mentioned a dedicated pulseaudio device.

My machine doesn't have a separate gfx card but it can do hdmi out and I see modules loaded for that.

But I would think if this stuff were wrong, sound would fail globally and not just in some contexts while working in others?

I managed to kill sound completely investigating this but a reboot seems to have restored sounds in KDE etc.


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#4 2012-01-17 23:30:31

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,140

Re: [Solved mysteriously - user idiocy?] Sound for VLC

Actually, I currently seem not to have sound at the command line and assume this is due to pulse somehow. speaker-test -c 2 fails although it used to work. (Now I don't hear anything; then I heard crackling etc.)

But amarok plays mp3s fine and kde plays system sounds fine.


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#5 2012-01-18 00:29:49

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,140

Re: [Solved mysteriously - user idiocy?] Sound for VLC

Looking for error messages, I found these:

Jan 17 22:20:39 localhost pulseaudio[2201]: [pulseaudio] module-alsa-card.c: Failed to find a working profile.
Jan 17 22:20:39 localhost pulseaudio[2201]: [pulseaudio] module.c: Failed to load module "module-alsa-card" (argument: "device_id="29" name="platform-thinkpad_acpi" card_name="alsa_card.platform-thinkpad_acpi" namereg_fail=false tsched=yes ignore_dB=no deferred_volume=yes card_properties="module-udev-detect.discovered=1""): initialization failed.
Jan 17 22:20:40 localhost pulseaudio[2229]: [pulseaudio] pid.c: Daemon already running.
Jan 17 22:21:26 localhost pulseaudio[4102]: [pulseaudio] pid.c: Daemon already running.
Jan 17 22:21:26 localhost pulseaudio[4105]: [pulseaudio] pid.c: Daemon already running.

I'm not sure if this is expected or not. pulseaudio seems to find the correct sound card (0) OK since sound works in KDE applications. So maybe this is normal - it fails to initialise non-sound card (29) and moves on. Or is it trying that one instead of the right one?

Working through the pulse audio wiki page, I can't get mplayer, vlc etc. to work. I do have pulseaudio-alsa installed, as well as the suggested lib32 packages for support in flash etc.

I'd like some advice about whether to uninstall pulseaudio (the stuff not needed libpulse). I think I only installed it to try to make things work together and I'm not sure it doesn't just confuse things further?!


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#6 2012-01-18 18:58:01

David Batson
Member
Registered: 2011-10-13
Posts: 640

Re: [Solved mysteriously - user idiocy?] Sound for VLC

I have the following installed and sound works fine for VLC here.

[root@myhost ~]# pacman -Ss gstreamer | grep installed
extra/gstreamer0.10 0.10.35-1 [installed]
extra/gstreamer0.10-bad 0.10.22-3 (gstreamer0.10-plugins) [installed]
extra/gstreamer0.10-bad-plugins 0.10.22-3 (gstreamer0.10-plugins) [installed]
extra/gstreamer0.10-base 0.10.35-1 [installed]
extra/gstreamer0.10-base-plugins 0.10.35-1 (gstreamer0.10-plugins) [installed]
extra/gstreamer0.10-ffmpeg 0.10.12-1 (gstreamer0.10-plugins) [installed]
extra/gstreamer0.10-good 0.10.30-1 [installed]
extra/gstreamer0.10-good-plugins 0.10.30-1 (gstreamer0.10-plugins) [installed]
extra/gstreamer0.10-ugly 0.10.18-4 [installed]
extra/gstreamer0.10-ugly-plugins 0.10.18-4 (gstreamer0.10-plugins) [installed]
[root@myhost ~]# pacman -Ss alsa | grep installed
extra/alsa-lib 1.0.24.1-1 [installed]
extra/alsa-plugins 1.0.24-3 [installed]
extra/pulseaudio-alsa 1-2 (pulseaudio-gnome) [installed]
[root@myhost ~]# pacman -Ss pulseaudio | grep installed
extra/libcanberra-pulse 0.28-2 [installed]
extra/paprefs 0.9.10-2 [installed]
extra/pavucontrol 1.0-1 [installed]
extra/pulseaudio 1.1-2 [installed]
extra/pulseaudio-alsa 1-2 (pulseaudio-gnome) [installed]

Offline

#7 2012-01-18 21:39:19

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,140

Re: [Solved mysteriously - user idiocy?] Sound for VLC

Thanks. I've figured out why sound is working in some apps but not others, I think. I think that KDE is not using the default device. So basically anything which using the KDE audio stuff works because KDE's phonon is outputting to a non-default device which works. Anything else is failing because it uses the default device which is setup incorrectly. What I'm not sure about is how to set it up correctly. Should I be setting it for alsa or for pulse or both? Isn't the /etc/asound.conf meant to have alsa use pulseaudio for output? Is that like using a device so that setting it somewhere for pulseaudio should also get it right for alsa? Or...? I'm a bit confused about how it all fits.

Here is my output for the commands you used:

extra/gstreamer0.10 0.10.35-1 [installed]
extra/gstreamer0.10-bad 0.10.22-3 (gstreamer0.10-plugins) [installed]
extra/gstreamer0.10-base 0.10.35-1 [installed]
extra/gstreamer0.10-base-plugins 0.10.35-1 (gstreamer0.10-plugins) [installed]
extra/gstreamer0.10-good 0.10.30-1 [installed]
extra/gstreamer0.10-python 0.10.21-1 [installed]
extra/gstreamer0.10-ugly 0.10.18-4 [installed]
extra/gstreamer0.10-ugly-plugins 0.10.18-4 (gstreamer0.10-plugins) [installed]
extra/phonon-gstreamer 4.5.1-1 [installed]
extra/alsa-lib 1.0.24.1-1 [installed]
extra/alsa-plugins 1.0.24-3 [installed]
extra/alsa-utils 1.0.24.2-3 [installed]
extra/pulseaudio-alsa 1-2 (pulseaudio-gnome) [installed]
multilib/lib32-alsa-lib 1.0.24.1-1 [installed]
multilib/lib32-alsa-plugins 1.0.24-1 [installed]
extra/libcanberra-pulse 0.28-2 [installed]
extra/pulseaudio 1.1-2 [installed]
extra/pulseaudio-alsa 1-2 (pulseaudio-gnome) [installed]
multilib/lib32-libcanberra-pulse 0.28-1 [installed]
multilib/lib32-libpulse 1.1-1 [installed]

Obviously these lists aren't quite the same so maybe something necessary is missing on my system.... Will try some experimenting...

Last edited by cfr (2012-01-18 21:45:17)


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#8 2012-01-18 23:55:29

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,140

Re: [Solved mysteriously - user idiocy?] Sound for VLC

I've tried configuring everything relevant I can see on the pulse wiki page. I've been trying to get mplayer to work since it is a little easier at the command line:

$ mplayer /usr/share/sounds/KDE-Sys-Question.ogg 
MPlayer SVN-r34426-4.6.2 (C) 2000-2011 MPlayer Team
181 audio & 384 video codecs
mplayer: could not connect to socket
mplayer: No such file or directory
Failed to open LIRC support. You will not be able to use your remote control.

Playing /usr/share/sounds/KDE-Sys-Question.ogg.
libavformat file format detected.
[lavf] stream 0: audio (vorbis), -aid 0
Load subtitles in /usr/share/sounds/
==========================================================================
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
AUDIO: 48000 Hz, 2 ch, s16le, 192.0 kbit/12.50% (ratio: 24000->192000)
Selected audio codec: [ffvorbis] afm: ffmpeg (FFmpeg Vorbis)
==========================================================================
AO: [pulse] 48000Hz 2ch s16le (2 bytes per sample)
Video: no video
Starting playback...
A:   1.8 (01.7) of 2.1 (02.0)  0.3% 


Exiting... (End of file)
$ mplayer /usr/share/sounds/pop.wav              
MPlayer SVN-r34426-4.6.2 (C) 2000-2011 MPlayer Team
181 audio & 384 video codecs
mplayer: could not connect to socket
mplayer: No such file or directory
Failed to open LIRC support. You will not be able to use your remote control.

Playing /usr/share/sounds/pop.wav.
Audio only file format detected.
Load subtitles in /usr/share/sounds/
==========================================================================
Opening audio decoder: [pcm] Uncompressed PCM audio decoder
AUDIO: 44100 Hz, 1 ch, s16le, 705.6 kbit/100.00% (ratio: 88200->88200)
Selected audio codec: [pcm] afm: pcm (Uncompressed PCM)
==========================================================================
AO: [pulse] 44100Hz 1ch s16le (2 bytes per sample)
Video: no video
Starting playback...
A:   0.0 (00.0) of 0.0 (00.0) ??,?% 


Exiting... (End of file)

I'm assuming the errors at the top are just about the lack of control for a remote control which is fine since I don't have one. It seems to continue fine and thinks it is finding everything. And it is using pulse, it seems. The file plays and finishes. But there is no sound.

How can I specify the specific device and not just the driver for mplayer? I saw this is possible in the man page but I'm not sure quite how to find out what options I have to try on my machine.

There is definitely something wrong with my pulse setup generally because KDE can't use the default card...

Is there any advantage to pulse? I only installed it because I thought it might help and actually things are worse now than before since sound works in fewer applications. Though there is also no guarantee I can undo the changes I've made trying to get it to work, of course. But I'd be tempted to try just uninstalling it and going back to alsa/libpulse...


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#9 2012-01-19 01:22:47

David Batson
Member
Registered: 2011-10-13
Posts: 640

Re: [Solved mysteriously - user idiocy?] Sound for VLC

This guide is a little old, but it was pretty good in it's day.  See if it helps you out.

http://forums.fedoraforum.org/showthread.php?t=225660

Offline

#10 2012-01-19 02:51:12

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,140

Re: [Solved mysteriously - user idiocy?] Sound for VLC

Thanks. I'm not sure how well I can apply that to what I'm seeing, to be honest. Apart from changes to pulseaudio (I checked lots of the suggested edits against the default config and they are now default, it seems), there are also the changes from e.g. hal to udev (but I'm not getting the described audio corruption - where it works, it works fine) and to KDE.

I'm beginning to wonder why sound even works in KDE.

When I look in alsamixer -c 0, I can't get the green "00" for pcm at all. There's nothing there to switch. Earlier, I couldn't even get the channel.

I'm thinking I should uninstall pulseaudio and try straight alsa again. pulse just seems to complicate things even more and I don't even know what the benefits are meant to be!


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

#11 2012-01-19 03:50:24

cfr
Member
From: Cymru
Registered: 2011-11-27
Posts: 7,140

Re: [Solved mysteriously - user idiocy?] Sound for VLC

OK. So I uninstalled pulseaudio and related stuff which didn't seem to be needed by anything else and now KDE can use the "default" device rather than needing something different, aplay and mplayer play /usr/share/sounds/pop.wav with actual sound and even the microphone works (though I'm not clear KDE sees it this way). For some reason uninstalling pulseaudio creates an _additional_ sound device as far as KDE is concerned. I have no idea why. alsamixer still has no "00" for pcm but speaker-test works anyway.

So now I am back to the problem I started with: how can I get sound to work in VLC? (And other non-KDE GUI applications, possibly.)

I realise I've screwed up the settings for VLC since I set it for pulse. I undid the pulse config for mplayer, libao already. So I found what I could under my home directory and home hoping that removing that will set VLC back to a default state. (Basically removed .config/vlc and .local/share/vlc.)

Er... and oddly it now works. Which is great though I wish I knew *why* - I didn't *do* anything!

As for pulseaudio, I guess either it is not ready for me or (more likely) I am not ready for it. Maybe when I've learnt more, some of it will make a bit more sense. (Or maybe not... smile )

Anyway, thanks for the help. At least it works, even if I've no idea why!


CLI Paste | How To Ask Questions

Arch Linux | x86_64 | GPT | EFI boot | refind | stub loader | systemd | LVM2 on LUKS
Lenovo x270 | Intel(R) Core(TM) i5-7200U CPU @ 2.50GHz | Intel Wireless 8265/8275 | US keyboard w/ Euro | 512G NVMe INTEL SSDPEKKF512G7L

Offline

Board footer

Powered by FluxBB