Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
mpd configuration to share soundcard under ALSA?
View unanswered posts
View posts from last 24 hours

 
Reply to topic    Gentoo Forums Forum Index Multimedia
View previous topic :: View next topic  
Author Message
Skotlex
Guru
Guru


Joined: 13 Mar 2004
Posts: 313

PostPosted: Tue Jun 17, 2025 3:23 am    Post subject: mpd configuration to share soundcard under ALSA? Reply with quote

The Gentoo documentation for ALSA explains how to allow sound from multiple simultanous apps.
The Gentoo documentation for MPD doesn't.

I have the issue that nothing else can play sounds while MPD is playing. When MPD is stopped, I can have simultanous distinct sound courses (eg: mpv + http streaming).

My relevant section in the mpd.conf file is (got the information from here):
Code:

audio_output {
   type     "alsa"
   name     "Speakers"
   options  "dev=dmixer"
   device   "plug:dmixer"
   mixer_type      "software"
}

And, asound.conf:
Code:

pcm.dmixer {
   type dmix
   ipc_key 96
   ipc_key_add_uid true
   slave {
      pcm "hw:1,0"
      #To check supported sampling rates:
      # arecord --dump-hw-params
      rate 96000
   }
}

pcm.!default {
   type plug
   slave.pcm "dmixer"
}

defaults.ctl.card 1


Thanks in advance for any hints.
Back to top
View user's profile Send private message
nicop
Tux's lil' helper
Tux's lil' helper


Joined: 10 Apr 2014
Posts: 126

PostPosted: Wed Jun 18, 2025 6:03 am    Post subject: Reply with quote

If your login-user is different from your mpd-user, you need to allow sharing between users.

Could you test with that ?:

Quote:
pcm.dmixer {
type dmix
ipc_key 96
ipc_key_add_uid false
ipc_perm 0660
slave {
pcm "hw:1,0"
#To check supported sampling rates:
# arecord --dump-hw-params
rate 96000
}
}
Back to top
View user's profile Send private message
szatox
Advocate
Advocate


Joined: 27 Aug 2013
Posts: 3682

PostPosted: Wed Jun 25, 2025 3:29 pm    Post subject: Reply with quote

In case of pure ALSA mpd should "Just work"™ as long as mpd runs with audio group talks to dmix rather than the underlying hardware directly.

In fact, your ALSA configuration should already be routing all clients through dmix by default. One thing that tends to go wrong is that modern computers usually have several audio devices and alsa might want to use a wrong hardware for playback (resulting in no sound at all).

If setting group and dmix doesn't work for you, you'll need to provide more details about your setup and how it fails.
_________________
Make Computing Fun Again
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Multimedia All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum