Automatically starting skype with pulse latency set to 60ms

There is a bug in pavucontrol/ with skype, that causes a terrible noise when starting skype.

It is solved by killing skype and starting it with

>> PULSE_LATENCY_MSEC=60 skype

This is great.

Now I don’t want to kill/restart skype manually on each boot.

I read that I could add this line to skype.desktop:

Exec=env PULSE_LATENCY_MSEC=60 skype %U

I did this, but still same problem.

Also, I seem to have two skype.desktop files (one in /home/dorien/bin/skype-4.2.0.11/ and one in the 4.2.0.13). I have changed the line in both, but no effect.

Does Opensuse (13.1) not read this when starting? Or is there another way to control the startup option?

Thanks!

No. The desktops (this has nothing to do with openSUSE per se) do not read .desktop files in ~/bin.
Menu entries are either stored in /usr/share/applications/ or ~/.local/share/applications/.

If the latter one contains an .desktop file with the same name as the former one, then the latter one is preferred.
So you should copy /usr/share/applications/skype.desktop to ~/.local/share/applications/ and edit the copy.

OTOH, if you want to have this change system-wide, you should edit the one in /usr/share/applications/. But that change will be lost whenever you re-install the package.

Or in the case of KDE, just use the menu-editor to change the Command for Skype. (right-click on the K-menu and choose “Edit menu entries”)

If it is auto-started on login, you might also have a look in /usr/share/autostart/ and/or ~/.config/autostart/. Those directories are for .desktop files that should be automatically started on login.

Ok, I did apparantly also change it in /usr/share/applications/ once before.

The file did not appear in any of the other locations you specified, but I just copied it there to be sure.

I am hoping that after an update this bug is fixed and I don’t need to correct this anymore :slight_smile:

I will let you know what happens if I reboot later on!

Thanks for the help.

You copied it to where?

You should not copy it to all places I mentioned, especially not to /usr/share/autostart/ and ~/.config/autostart/.

And copying it to ~/.local/share/applications/ only makes sense if you don’t want to edit /usr/share/applications/skype.desktop directly (which requires root permissions).
As you did change /usr/share/applications/skype.desktop you maybe should remove the copy in ~/.local/share/applications/ again, as that might just lead to confusion later on.

It’s still not working.

I removed the copy in ~/local/share/applications/ as you suggested. I didn’t want to make a mess. Just tried all these places to see if it would go better. Alas…

Changing it in the menu editor won’t help it from automatically starting normal right?

Is there anything else I could check?

Thank you.

Depends on how you are starting it automatically.
I suppose you rely on the session management for that, i.e. that open applications are automatically started on the next login.

Then this should have effect.
Try to quit skype and start it again though.

If it is started by a .desktop file in ~/.config/autostart/, you have to change that one of course.

On 2014-06-12 21:16, Dorax wrote:

> Is there anything else I could check?

Is your session status saved automatically when you log out? Then those
apps that are running when you exit are restarted again when you login -
regardless of being in the autostart folders or not. And, AFAIK, destop
files are ignored in that case (and any settings the application itself
does not save).

The bug has been there for many months, so it is not going to be solved
soon. AFAIK, the bug is on skype proprietary software.


Cheers / Saludos,

Carlos E. R.
(from 13.1 x86_64 “Bottle” at Telcontar)

True.
I thought it would be started exactly the same way though, but I just tried with a different application (I do not have skype installed) and this is not the case, at least not for environment variables.

Well, I guess the only way to “fix” this then would be to create a script named “skype” in /usr/local/bin/ (or ~/bin/) with the following content:

#!/bin/sh
PULSE_LATENCY_MSEC=60 skype $@

And make it executable with “chmod +x”.

Or, as Skype - openSUSE Wiki advises:

Wrapper script


Alternatively use these commands to create a quick and dirty wrapper, then launch Skype from the menu as usual:

sudo mv /usr/bin/skype /usr/bin/skype.bin
su -c “echo ‘PULSE_LATENCY_MSEC=60 LD_PRELOAD=/usr/lib/libv4l/v4l1compat.so /usr/bin/skype.bin $@’ > /usr/bin/skype”
sudo chmod +x /usr/bin/skype

Another workaround would be to just disable PulseAudio in YaST->Hardware->Sound->Other->PulseAudio Configuration.

The bug has been there for many months, so it is not going to be solved
soon. AFAIK, the bug is on skype proprietary software.

Yes.
Although I thought they know about this bug and are working on fixing it. (at least I read that somewhere months ago…)

On 2014-06-13 13:56, wolfi323 wrote:

> I thought it would be started exactly the same way though, but I just
> tried with a different application (I do not have skype installed) and
> this is not the case, at least not for environment variables.

And many things. For instance, xterms do not restore to the same font
size, which is one thing I need. Or they don’t always go to the same
workspace.

Applications belonging to the same desktop as the one running, restore
better. I mean, kde apps in kde, gnome apps in gnome, etc.

>
> Well, I guess the only way to “fix” this then would be to create a
> script named “skype” in /usr/local/bin/ (or ~/bin/) with the following
> content:

I’m not sure. Depends on what the desktop remembers, the calling script
or the actual application that is running.

Mmm… that’s interesting. Firefox is started by a script… so it is a
common situation.

> Another workaround would be to just disable PulseAudio in
> YaST->Hardware->Sound->Other->PulseAudio Configuration.

Not an option for many.

>> The bug has been there for many months, so it is not going to be solved
>> soon. AFAIK, the bug is on skype proprietary software.
>>
> Yes.
> Although I thought they know about this bug and are working on fixing
> it. (at least I read that somewhere months ago…)

It should be very simply to run internally the change that the
environment var does. But my guess is they will not, they’ll wait for
the next version, and do more changes.

In the opensource camp it would be typical to release another minor
version for just a trivial change, and another one the next day. It is
the “release often” thing as described in “the cathedral and the
bazaar”. In the proprietary camp, a release every other day looks bad.


Cheers / Saludos,

Carlos E. R.
(from 13.1 x86_64 “Bottle” at Telcontar)

Skype got updated recently to 4.3 and one of the main new features/changes listed is :

  • PulseAudio 3.0 and 4.0 support

So maybe trying to change the latency is no longer required.

http://blogs.skype.com/2014/06/18/skype-4-3-for-linux/

I was thinking of creating a script, which has

PULSE_LATENCY_MSEC=60 skype $@

like you suggest.

However, skype starts up automatically, and the option to disable that is not present. So I would also need a line to kill skype first or remove it from start.

But let me try updating to the latest version right now first!

No. Just reboot or logout/login to restart it with those options after you created that script.
As the script replaces the skype executable, the script would be called instead of skype directly, so the change would just be picked up.

But if the update works, that would be even better of course.

A bit off-topic:
The announcement says:

This version dropped support for direct Alsa support; please install PulseAudio 4.0 or greater for the best calling experience.

Great! :sarcastic:
Another reason for me to not use Skype at all.
I don’t have PulseAudio installed, and I don’t want to install and activate it either.

On 2014-06-19 13:26, Dorax wrote:

> So I would also need a line to kill skype first

Easy.

killall skype

But first, try “skype --help” to see if there is a quit option.


Cheers / Saludos,

Carlos E. R.
(from 13.1 x86_64 “Bottle” at Telcontar)

On 2014-06-19 13:46, wolfi323 wrote:
> Another reason for me to not use Skype at all.

It is often not a choice.


Cheers / Saludos,

Carlos E. R.
(from 13.1 x86_64 “Bottle” at Telcontar)

Yes, of course.

I was only talking about me, see your quote.

Skype 4.3 has been released which addresses these issues.

Can report all works well.