Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Interfere in pulseaudio volume between mpv and libmpv #1578

Closed
bylee20 opened this issue Feb 9, 2015 · 11 comments
Closed

Interfere in pulseaudio volume between mpv and libmpv #1578

bylee20 opened this issue Feb 9, 2015 · 11 comments

Comments

@bylee20
Copy link
Contributor

bylee20 commented Feb 9, 2015

PulseAudio supports per-application volume and it kept by PulseAudio.

When I changed volume in mpv, the changed volume also applied in libmpv client.
I've tried to set audio-client-name but it only changes the string in volume control and didn't solve the problem.

Is there any solution for this?

@ghost
Copy link

ghost commented Feb 9, 2015

The audio-client-name option should handle this. Not sure why it wouldn't work?

@bylee20
Copy link
Contributor Author

bylee20 commented Feb 9, 2015

No idea. When launched client only, the volume control displays the name what I set to audio-client-name but if mpv is running, libmpv client does not even appear in volume control. Defintely they share same control.

@ghost
Copy link

ghost commented Feb 12, 2015

I think this happens when the audio-device-list property is queried. It creates a connection without the proper client name set. It should disconnect immediately, though, and I see no reason why it would override the stream name. (Or maybe this is a different bug.)

@ghost ghost closed this as completed in c152c59 Feb 12, 2015
@bylee20
Copy link
Contributor Author

bylee20 commented Feb 12, 2015

Partially fixed. Now I can see both controls in mixer window and I can control them independently when they're running at the same time.

However, for instacne, If I execute client after excuted mpv --mute <video>, then the initial volume of client is muted.

Now I doubt pulseaudio because they're synced even if I can see separated controls.

@ghost
Copy link

ghost commented Feb 12, 2015

Looks like PulseAudio loves to force application devs to add shitty singletons.

@ghost
Copy link

ghost commented Feb 12, 2015

Or maybe I'm misunderstanding... needs more investigation.

@ghost
Copy link

ghost commented Feb 12, 2015

(Yeah, I was misunderstanding.)

I tested it, I can't see that they conflict in any way. What might cause confusion is that the stream title contains "mpv" by default. You can override it by setting the title option.

@bylee20
Copy link
Contributor Author

bylee20 commented Feb 13, 2015

You can't reproduce this?

Setting title doesn't work. In fact, I've set title to ""(empty string) always.

@ghost
Copy link

ghost commented Feb 13, 2015

You can't reproduce this?

No.

Setting title doesn't work. In fact, I've set title to ""(empty string) always.

Then maybe dump and check the values ao_pulse.c passes to the pulseaudio APIs.

@bylee20
Copy link
Contributor Author

bylee20 commented Feb 16, 2015

Finally I found the source. It's the line set PA_PROP_MEDIA_ROLE:

(void)pa_proplist_sets(proplist, PA_PROP_MEDIA_ROLE, "video");

If I comment out that line, no more interference exists.

I don't know the exact purpose of each role because the document says nothing, it seems that the PA_PROP_MEDIA_ROLE is designed for making it possible to interfere between streams using PulseAudio at the very first time.
For instance, if a 'phone' role stream is started from any application, all other streams are muted including external applications.

I found that VLC also sets "video" role and I can see that VLC and mpv also interferes each other.

With some test, "video" and "music" also interferes but "game" does not interfere.
Also, no specific role(which is set "none" by internal PulseAudio) does not cause interference.

ghost pushed a commit that referenced this issue Feb 16, 2015
This is a small oversight. The client name (as set on command line
options or, more importantly, the client API) was not set when listing
devices e.g. via the "audio-device-list" property.

Might or might not fix #1578.

Also adjust the log level for an unrelated message.

(cherry picked from commit c152c59)
@ghost
Copy link

ghost commented Feb 16, 2015

The "video" role caused some trouble with other things too.

But it's entirely a pulseaudio issue.

olifre pushed a commit to olifre/mpv that referenced this issue Feb 28, 2015
This is a small oversight. The client name (as set on command line
options or, more importantly, the client API) was not set when listing
devices e.g. via the "audio-device-list" property.

Might or might not fix mpv-player#1578.

Also adjust the log level for an unrelated message.
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant