How to tell Flash which sound device to use?

openSUSE 13.1, KDE 4.11.5, Firefox 13.0.

The system has three sound devices. Using YaST, one device is chosen as the primary device and that is functioning.

mgi@beneden:/dev/snd/by-path> ls -l
total 0
lrwxrwxrwx 1 root root 12 Aug 18 08:32 pci-0000:00:12.0-usb-0:5:1.0 -> ../controlC0
lrwxrwxrwx 1 root root 12 Aug 18 08:32 pci-0000:00:14.2 -> ../controlC1
lrwxrwxrwx 1 root root 12 Aug 18 08:32 pci-0000:01:00.1 -> ../controlC2
mgi@beneden:/dev/snd/by-path>

KDE System settings is used to set that same device to be used for music and that also functions as expected.

Normaly, when a website offers music, Firefox has no problem playing this e.g. through Amarok and that will use the correct device. But when the website offers the music using Flash, Flash uses one of the other devices (checked this by connecting loudspeakers to it).

I have no idea how to configure Flash to use the correct device.

It’s been a while but doesn’t Flash use ALSA?

If so, wouldn’t defining the default audio device in /etc/asound-pulse.conf work? You’ll need alsa-plugins-pulse for that - maybe the 32-bit version too due to Flash being 32bit.

Thanks for the reaction.

This is what it is now:

beneden:/etc # cat asound-pulse.conf
# PulseAudio plugin configuration

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

ctl.!default {
    type pulse
    fallback "sysdefault"
}
beneden:/etc #

But I have realy no idea what it means. I never understood much about sound in Linux.

I must also stress that because we are happy that all other ways we play music on this system (either from web-sites or streaming sources or from local playing MP3s) do function and we do not want to loose that through tinkering (that is : doing things which I do not realy understand) with configuration files.

Do you have the alsa-plugins-pulse-32bit installed?

I’m pretty sure Oldcpu knows a ton more when he notices this thread :slight_smile:

Can you not do this assignment using ‘pavucontrol’ application ?

My only computer with two sound cards is my old ~13-year old PC which has a 32-bit athlon-1100 and is running LXDE (with openSUSE-13.1) so I’m not so certain if it is a relevant computer to test things on. Nominally pulse audio is only partially enabled with LXDE.

But with KDE on openSUSE-13.1 the first place I would look is to see if the configuration can be done with ‘pavucontrol’.

Yes.

maybe the 32-bit version too due to Flash being 32bit.

Flash is available in 64bit since quite some time (11.0 I think?).

I’m so out of date on what the flash is since I’ve been using Chromium+Pepper for ages now :slight_smile:

Hello.

As I have understood it, the Flash plugin should use the default sound-device, with no extra user friendly options to change this; but, you might have success with configuring a .asoundrc file to override this?
Could it be that the default system-wide sound-device is set as a different one than what is set as default in KDE?

The current Flashplayer won’t even run on that.
It requires SSE2 support even in the 32bit version, which Athlons (not even XPs) don’t have.
The last version that would work is 10.x.

A wealth of answers. I will try to cope.

  1. I have installed the 32-bit version of alsa-plugin-pulse and it’s dependencies. Do I understand now that tthat is of no use? Does not matter, but I guess it is difficult to deinstall, not als-plugin-pulse itself, but it’s dependancies (I did not write them downn). So I hope it will not be a problem when I leave it on the system.

  2. I installed pavocontrol and started it from the users desktop konsole. It opened a window. It shows data for the three devices, but I do not see any “priority” or a “default” there. The device we want to use in the second in the list there. Any idea what to do with it that can not be done through YaST (system wide) or the KDE settings (for this user)?

Re-reading and trying to understand what the answers mean to me:

I assume the flash that is instaled is 64-bit.
There seems to be a consensus that “flash uses ALSA”. Does this “using ALSA” mean anything in connection with my question, and when yes, what? Using some ALSA configuration tool?

As explained, the device that we want to use is the USB one (controlC0) which I set as default using YaST. So that seems as intended. No changing wanted. We hoped that flash would use that default device, but it doesn’t.

There is no .asoundrc file in the home directory of the user (I guess that is the place you mean it should be).

As explanied above, the device that is set as default with YaST is the same device that is moved to be first in the list with KDE Systemsettings > Multimedia for Music as well as Video.

Perhaps try to identify which device is set to be default and what device is used when playing flash files.

aplay -l would, I believe, give you the system-wide priority list for playback devices. I don’t know PA but wouldn’t the KDE system setting phonon list reveal any list of priority, even when using PA?

It will not be a problem, no.
But it will only be used/needed by 32bit applications using ALSA (like Skype f.e.).
If you don’t have any you can just uninstall it.

Regarding the dependencies that got installed along with it, all of them would be 32bit. So I would search for 32bit in YaST and uninstall everything that doesn’t give conflicts.
Unless you do use some 32bit applications of course. But if they are installed via RPMs they should require the necessary stuff anyway, so uninstalling that would give a conflict.

  1. I installed pavocontrol and started it from the users desktop konsole. It opened a window. It shows data for the three devices, but I do not see any “priority” or a “default” there. The device we want to use in the second in the list there. Any idea what to do with it that can not be done through YaST (system wide) or the KDE settings (for this user)?

AIUI, pulseaudio’s settings are completely user specific. pavucontrol should allow you to setup which device to use for which application.
But I don’t know more about it, because I don’t use PA myself (never have).

No.
alsa-plugins-pulse re-routes applications using ALSA to pulseaudio instead. So the standard pulseaudio settings should apply then.
If alsa-plugins-pulse would not be installed, those applications would use ALSA directly, and block pulseaudio from accessing the device (and vice versa). Pulseaudio takes full control over the audio devices, so when an application plays sound via PA, no ALSA application can do so. If an ALSA application runs and uses a device, pulseaudio will not work/be able to play sound.

That’s why alsa-plugins-pulse is vital.

I cannot help you with the original problem though, sorry. I never used two or more soundcards either, in addition to not using pulseaudio.

Sorry, didn’t read properly.

Yes, under home; .asoundrc has to be created and is used to override system-wide ALSA settings.
http://www.alsa-project.org/main/index.php/Asoundrc

Thanks, I will leave that clean-up for later.

I do not even have any idea if I use pulsaudio and/or alsa or not. And when I use them, what they are for. Sort of abstraction layer I assume. The picture showing what uses what in the path from a sound source until the sound card is still rather black for me (I remember and maybe oldcpu will remember, that I once asked what a mixer is and why it is there and what it does; it is still a riddle, I do not want to mix anything, I only want sound out of loudspeakers).

What I understand from all your valued contributions now is that flash uses ALSA. That when I have alsa-plugins-pulse installed (which I have now in 64- and 32-bit version), that alsa uses pulseaudio. I do not know if pulseaudio uses a next product in the pipeline, but to me it means that there are two configuration possibilities: ALSA and PulsAudio.

Until now I used two configuration tools:
YaST, which I guess (I am not sure) sees that the default device gets the number 0 in the range of device files. When my guessing here is OK, that is done as intended.
KDE, which alows you to define a sequence of devices for several application ranges like sound, video, system alerts, etc. All can have a different sequence. I have no idea if these KDE systemsettings are a GUI frontend to ALSA, PulseAudio, or something internal to KDE only.

And now I have installed pavucontrol. I have no idea what it should control. It does not seem to have a man page :frowning:

pactl list

Should show the device priority list used by PA
http://www.oz9aec.net/index.php/gstreamer/365-pulseaudio-device-names

I do not even have any idea if I use pulsaudio and/or alsa or not. And when I use them, what they are for. Sort of abstraction layer I assume. The picture showing what uses what in the path from a sound source until the sound card is still rather black for me (I remember and maybe oldcpu will remember, that I once asked what a mixer is and why it is there and what it does; it is still a riddle, I do not want to mix anything, I only want sound out of loudspeakers).

YaST > Hardware > Sound > Other > PulseAudio Configuration - is where you enable/disable PA

marian@beneden:~> aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: HiFiLink [HiFi-Link], device 0: USB Audio [USB Audio]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: Generic [HD-Audio Generic], device 0: 92HD89E2 Analog [92HD89E2 Analog]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: Generic [HD-Audio Generic], device 1: 92HD89E2 Digital [92HD89E2 Digital]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 2: HDMI [HDA ATI HDMI], device 3: HDMI 0 [HDMI 0]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
marian@beneden:~>

And card 0 is tthe correct device.

marian@beneden:~> cat .asoundrc
pcm.!default {
        type hw
        card 0
}

ctl.!default {
        type hw           
        card 0
}
marian@beneden:~>

didn’t help.