Skip to content

Configured mpd for perfect audio playback--it seems to play sound from only one application at a time.

I followed the wiki to configure perfect audio playback for mpd. I'm 99% sure that's the culprit of my problem: sound only plays from one application at a time.

For example, when both ncmpcpp and mpv are running, if ncmpcpp ran first and plays music, then opening a video on mpv will not output any sound for the video. It will only output sound if I pause ncmpcpp, close the instance of mpv without sound, then start mpv again. The opposite is true (i.e. if ncmpcpp is paused and I start a video with mpv, it plays the sound of the video and attempting to play ncmpcpp will not play the audio unless I close the video and toggle pause/unpause ncmpcpp).

This is a problem because I listen to music in the background and I can't play a short video clip with sound without pausing ncmpcpp and then refreshing the youtube page so that there's sound again (toggling mute on the Youtube video will not restore the sound--I have to refresh the page).

How can I fix this? Any help is much appreciated.

4 points4 comments
Open on Reddit
About this post
Posted
Archived
Score
4 · 100% up
Kind
Text
ID
694sil

Author

83
posts
84
comments
2
media
View profile

4 comments

In order to have bit perfect playback, your player needs to take exclusive control of the ALSA hardware device (to set the sample rate, etc.) That's what the configuration you linked to is doing. That means only one application can be playing to that device at a time (most of the time). You'll need to decide whether convenience or bit-perfect playback are more important for you.

4 points

Can't they capture Alsa output with pulse-Alsa plugin? Will that unperfectify bit perfect playback?

Also i would like to congratulate myself on knowing the answer to OP's issue. I came to answer it initially. This is what arch Linux is doing to me

1 points

Any given sound device can only output one sample rate at a time. Most music is sampled in 44.1 KHz and most video clips are sampled in 48KHz. So doing both at once would require resampling, rendering it no longer bit perfect.

You could theoretically have bit perfect output from two sources if the sample rates agreed, but my experience has been that that's not how ALSA works when you address a hardware device directly. If you use hardware direct output, you have an exclusive lock on the device IME. Pulse always resamples, which is why it works as a system mixer.

2 points

Keyboard shortcuts

Move and act

jork
Next / previous post or comment
Enteroro
Open the post
f
Open the media viewer
s
Save
h
Hide (the toast has Undo)
Tab
Right after an action: the toast's Undo
x
Collapse the comment
v
Next layout: cards, compact, grid

Go to

/
Search
gthenh
Home
gthena
All
gthens
Subreddits
gthenl
Library
?
This list
Esc
Close a menu or this list

In the viewer

←or→
Previous / next file
↑or↓
Previous / next post
korj
Previous / next post
Space
Play / pause
m
Mute
z
Zoom
s
Save
o
Open the post (on its own page: back to it)
Esc
Close

Keys do nothing while you type in a box.