You are not logged in.

#1 2019-03-02 15:48:39

Alm
Member
Registered: 2010-09-15
Posts: 64

[SOLVED] Cannot play/pause MPD with bluetooth headphones

Hello,

I'm using bluetooth headphones to listen to music that's playing with MPD.
When I press prev/next on the headphones, MPD is reacting properly, skipping to the prev/next song.
However when I press the play/pause button on the headphones, nothing happens.

I've also noticed that play/pause is actually working on other applications like SMplayer (but prev/next doesn't work there!).

How can I solve that?

Last edited by Alm (2019-04-08 13:40:54)


See, you're unpacking.

Offline

#2 2019-04-03 15:17:37

Alm
Member
Registered: 2010-09-15
Posts: 64

Re: [SOLVED] Cannot play/pause MPD with bluetooth headphones

Hi all, any ideas? smile


See, you're unpacking.

Offline

#3 2019-04-03 15:29:47

Slithery
Administrator
From: Norfolk, UK
Registered: 2013-12-01
Posts: 5,776

Re: [SOLVED] Cannot play/pause MPD with bluetooth headphones


No, it didn't "fix" anything. It just shifted the brokeness one space to the right. - jasonwryan
Closing -- for deletion; Banning -- for muppetry. - jasonwryan

aur - dotfiles

Offline

#4 2019-04-03 15:31:32

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,662

Re: [SOLVED] Cannot play/pause MPD with bluetooth headphones

MPD does not react to mpris events (or for that matter key events) by default, which client are you using? Have you checked configuration of said client?

Last edited by V1del (2019-04-03 16:25:26)

Online

#5 2019-04-04 09:02:00

Alm
Member
Registered: 2010-09-15
Posts: 64

Re: [SOLVED] Cannot play/pause MPD with bluetooth headphones

V1del wrote:

MPD does not react to mpris events (or for that matter key events) by default, which client are you using? Have you checked configuration of said client?

I'm using ncmpcpp; but actually the prev/next actions are working without any client being open hmm

Oops, really sorry - won't do it again!


See, you're unpacking.

Offline

#6 2019-04-04 14:58:16

V1del
Forum Moderator
Registered: 2012-10-16
Posts: 21,662

Re: [SOLVED] Cannot play/pause MPD with bluetooth headphones

That's impossible, from what I'm seeing mpd does not have any support whatsoever to react to any keyboard events by itself. Did you set up some global hotkeys? Which buttons do register when you press them in xev?

Last edited by V1del (2019-04-04 14:58:34)

Online

#7 2019-04-05 11:17:22

Alm
Member
Registered: 2010-09-15
Posts: 64

Re: [SOLVED] Cannot play/pause MPD with bluetooth headphones

V1del wrote:

That's impossible, from what I'm seeing mpd does not have any support whatsoever to react to any keyboard events by itself. Did you set up some global hotkeys? Which buttons do register when you press them in xev?

I have the following hotkeys set up through dwm:

	{ 0,                            XF86XK_AudioPlay, spawn,   SHCMD("mpc toggle") },
	{ 0,                            XF86XK_AudioStop, spawn,   SHCMD("mpc stop") },
	{ 0,                            XF86XK_AudioPrev, spawn,   SHCMD("mpc prev") },
	{ 0,                            XF86XK_AudioNext, spawn,   SHCMD("mpc next") },

This is all that is printed out by xev when I press "next" then "prev" on my headset:

MappingNotify event, serial 32, synthetic NO, window 0x0,
    request MappingKeyboard, first_keycode 8, count 248

FocusOut event, serial 32, synthetic NO, window 0x4200001,
    mode NotifyGrab, detail NotifyAncestor

FocusIn event, serial 33, synthetic NO, window 0x4200001,
    mode NotifyUngrab, detail NotifyAncestor

KeymapNotify event, serial 33, synthetic NO, window 0x0,
    keys:  0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   
           0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   

FocusOut event, serial 33, synthetic NO, window 0x4200001,
    mode NotifyGrab, detail NotifyAncestor

FocusIn event, serial 33, synthetic NO, window 0x4200001,
    mode NotifyUngrab, detail NotifyAncestor

KeymapNotify event, serial 33, synthetic NO, window 0x0,
    keys:  2   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   
           0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   

And this is what's printed out when I press "next" then "prev" on my keyboard:

MappingNotify event, serial 32, synthetic NO, window 0x0,
    request MappingKeyboard, first_keycode 8, count 248

FocusOut event, serial 32, synthetic NO, window 0x4200001,
    mode NotifyGrab, detail NotifyAncestor

FocusOut event, serial 32, synthetic NO, window 0x4200001,
    mode NotifyUngrab, detail NotifyPointer

FocusIn event, serial 32, synthetic NO, window 0x4200001,
    mode NotifyUngrab, detail NotifyAncestor

KeymapNotify event, serial 32, synthetic NO, window 0x0,
    keys:  58  0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   
           0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   

FocusOut event, serial 33, synthetic NO, window 0x4200001,
    mode NotifyGrab, detail NotifyAncestor

FocusOut event, serial 33, synthetic NO, window 0x4200001,
    mode NotifyUngrab, detail NotifyPointer

FocusIn event, serial 33, synthetic NO, window 0x4200001,
    mode NotifyUngrab, detail NotifyAncestor

KeymapNotify event, serial 33, synthetic NO, window 0x0,
    keys:  1   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   
           0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   0   

See, you're unpacking.

Offline

#8 2019-04-05 11:24:42

progandy
Member
Registered: 2012-05-17
Posts: 5,190

Re: [SOLVED] Cannot play/pause MPD with bluetooth headphones

I've also noticed that play/pause is actually working on other applications like SMplayer (but prev/next doesn't work there!).

You globally bound prev/next to mpc in dwm, so no other player will see the key presses. You probably did not bind the correct key for play/pause, look in xev for the key name.


| alias CUTF='LANG=en_XX.UTF-8@POSIX ' |

Offline

#9 2019-04-08 13:40:11

Alm
Member
Registered: 2010-09-15
Posts: 64

Re: [SOLVED] Cannot play/pause MPD with bluetooth headphones

progandy wrote:

I've also noticed that play/pause is actually working on other applications like SMplayer (but prev/next doesn't work there!).

You globally bound prev/next to mpc in dwm, so no other player will see the key presses. You probably did not bind the correct key for play/pause, look in xev for the key name.

Thanks, it all seems to make sense now.
I guess I'll remove global bindings and find a way to pass the keys to mpd when there's no active window to receive them.


See, you're unpacking.

Offline

#10 2019-04-08 18:50:44

Rasi
Member
From: Germany
Registered: 2007-08-14
Posts: 1,914
Website

Re: [SOLVED] Cannot play/pause MPD with bluetooth headphones

just install mpdris and let it run in the background. This will act as a mpris2 daemon for mpd.


He hoped and prayed that there wasn't an afterlife. Then he realized there was a contradiction involved here and merely hoped that there wasn't an afterlife.

Douglas Adams

Offline

Board footer

Powered by FluxBB