Reply to topic

audio priority and easy output switching

contremaitre
Registered Member
Posts
34
Karma
0
Hi,

I have an internal sound card and an usb sound card.
The usb sound car is not always on.

Some times ago, in kde, I could have the sound output on my internal sound card when the usb speakers where off, and when I turned them on, it switched automatically to them.

Now I have to select them by hand in the phonon configuration section.

I also have another issue, when I launch a movie with phonon configured to output to the internal sound card, it switches back to the usb sound card because it says it has an higher priority, but the sound card is disconnected. And I don't know where to configure this priority thing.

To sum up :
- is there a faster way to change the sound output than system settings -> multimedia -> phonon -> changing the list order
- can this be automatic when the usb sound card is connected / disconnected
- can I remove the outpout priority auto-switching when i launch a software which plays audio.

I am using kde 4.9.2 with kubuntu.

Thank you for your help.
User avatar bcooksley
Administrator
Posts
18669
Karma
83
OS
Are you using Pulseaudio?
The priority order will determine what device is selected - but a device can only be selected if it is available to be selected.

On my system, I have a bluetooth headset which is higher in priority for all traffic - but the internal speaker will be used if it is not connected.
The priority order is configured at System Settings > Multimedia > Phonon - the order of the list is the priority order.


System Settings and Device Actions KCM maintainer
Image
contremaitre
Registered Member
Posts
34
Karma
0
I guess I am using pulseaudio. At least it is installed.

For testing, I selected the internal sound card with higher priority for all sounds (in system settings, phonon)
But when I launch a movie with Dragon player for instance, I have a system notification which says the USB sound card has been automaticaly selected because it "has higher preference or is specifically configured for this stream".

I don't understand why.
User avatar bcooksley
Administrator
Posts
18669
Karma
83
OS
As a guess - you could be reconfiguring one of the sound categories but not the others. Please make sure that they are all setup appropriately and that the settings are saved.


System Settings and Device Actions KCM maintainer
Image
contremaitre
Registered Member
Posts
34
Karma
0
No, I did apply to all categories
User avatar bcooksley
Administrator
Posts
18669
Karma
83
OS
Does this behaviour occur under a new user? (Just verifying that the hardware database is not corrupt).


System Settings and Device Actions KCM maintainer
Image
contremaitre
Registered Member
Posts
34
Karma
0
Yes, it's the same with another user.
Here is a screenshot when I try to play a sound, but it's in french :
screenshot
User avatar bcooksley
Administrator
Posts
18669
Karma
83
OS
That is quite unusual. Based on a guess of my experience with that notification, it seems to have switched to a *lower* priority audio device claiming it has a higher priority. Can you confirm that?

I also note that the "Audio Hardware Setup" tab is present on your system - so you are definitely using Pulseaudio.

At this point, I would suspect that you are potentially affecting by corruption in the Pulseaudio configuration. Please remove ~/.pulse/ and ~/.pulse-cookie outside KDE, while "pulseaudio" is not running in any form (a virtual terminal would be recommended).


System Settings and Device Actions KCM maintainer
Image
contremaitre
Registered Member
Posts
34
Karma
0
bcooksley wrote:That is quite unusual. Based on a guess of my experience with that notification, it seems to have switched to a *lower* priority audio device claiming it has a higher priority. Can you confirm that?


This is exactly what's happening. Very weird indeed.
I will try your solution when I have access to my computer. Thank you.
contremaitre
Registered Member
Posts
34
Karma
0
Ok,
So I removed ~/.pulse-cookie and ~/.pulse

And I still have the bug.
Actually, whatever I put in the first position, when I try to play a sound, it automaticaly switch to my second position output (from the phonon configuration, like in my screenshot) and I have a notification asking me if I want to "revert back to device 'the other one' "
Where the other one is the top pirority device.
User avatar bcooksley
Administrator
Posts
18669
Karma
83
OS
Okay, that is extremely unusual behaviour. I suspect we may have a Pulseaudio bug...

Just to make sure that this is not caused by Pulseaudio locking the first priority device for some reason, can you see KDE applications playing audio in "pavucontrol"? They should be mentioned by name, and perhaps with the name of the file they are playing.

If the name is simply "ALSA Playback..." then you need to ensure that the appropriate Pulseaudio plugin is installed for your Phonon backend. You can check which Phonon backend is in use in System Settings > Multimedia > Phonon. It should be either "GStreamer" or "VLC". The precise package name of the Pulseaudio plugin for GStreamer or VLC differs depending on the distribution unfortunately.

If you do not see anything, then your system is attempting and failing to use Pulseaudio. In that instance, also make sure that the appropriate Pulseaudio plugin is installed (same procedure as above).


System Settings and Device Actions KCM maintainer
Image
contremaitre
Registered Member
Posts
34
Karma
0
I do see KDE applications name and file name in pavucontrol.

But while testing this I noticed that AMAROK always want to play sound on my external sound card (if it is in first position, no problem, if it is in second position I will have the system notifiction telling me it selected the other one, like in my screen shot).
And Dragon player always want to play sound on my internal sound card, and does the opposite of amarok.

Flash video on internet will play on external sound card
The login sound will always switch to the internal sound card

etc...

If I launch a movie (dragon player) and a music (amarok) I will hear one on my speaker and one on my heaphones.
User avatar bcooksley
Administrator
Posts
18669
Karma
83
OS
This sounds like a categorisation issue. I suggest opening System Settings > Multimedia > Phonon and making sure you preferences have been applied to all the relevant categories.

The "switching to..." message may be correct in this instance, if the device is preferred for that category of playback.


System Settings and Device Actions KCM maintainer
Image
contremaitre
Registered Member
Posts
34
Karma
0
No, I apply to all categeries each time I am testing.
I just did it again, the same setting is applied to all categories, but one software wants to play on output A, and the other one switch to output B even if A has higher priority for ALL.
User avatar bcooksley
Administrator
Posts
18669
Karma
83
OS
Does the order you start playback in the applications have any impact upon the devices which get used?
I suspect your applications may be bypassing Pulseaudio somehow, or otherwise claiming the audio device exclusively somehow...


System Settings and Device Actions KCM maintainer
Image

 
Reply to topic

Bookmarks



Who is online

Registered users: apater, areid, Baidu [Spider], Bing [Bot], braystacey, edmael, einar, Exabot [Bot], garthecho, Google [Bot], google01103, ivan, jensreuterberg, joaob, jpwhiting, jstaniek, La Ninje, lazyit, Majestic-12 [Bot], mmistretta, MSN [Bot], pedrorodriguez, salvochea, scottpetrovic, scummos, SeaJey, SecretCode, slangkamp, slawekk, Sogou [Bot], SysGhost, TheraHedwig, tienhung, Tioz, VP1986, Yahoo [Bot], šumski