How to concurrently play music to audio port and stream?

Need help with MPD?
Post Reply
three_jeeps
Posts: 6
Joined: February 8th, 2019, 4:52 am

How to concurrently play music to audio port and stream?

Post by three_jeeps » February 8th, 2019, 5:09 am

How can I configure mpd to play music through the audio port, and stream to a client on thenet?
Can these two capabilities happen concurrently?
What needs to be in place to enable streaming? e.g. which client? etc.

I currently have mpd configure to play music through the speaker port on the PC. It (mostly) works.
I can guess that I can run two instances of mpd but not sure what happens if both instances need to access the same track at the same time?
Thanks for any help
J

max
Forum team
Posts: 863
Joined: January 15th, 2013, 3:43 pm

Re: How to concurrently play music to audio port and stream?

Post by max » February 8th, 2019, 5:29 am

You can configure two audio outputs.

three_jeeps
Posts: 6
Joined: February 8th, 2019, 4:52 am

Re: How to concurrently play music to audio port and stream?

Post by three_jeeps » February 8th, 2019, 5:46 am

Yea, OK so I add two audio outputs to the config file. What is the use scenario? I launch mpd, connect to it with my client, play a track from the play list and....does the output go to BOTH outputs simultaneously? (if so, how do I know where it is streaming to??
Can mpd support two or more client sessions? (It is not configured to use sockets).or do I need to create two different config files and launch one instantiation with config file A and the other with config file B?
Yea, I guess I could read through the code to figure this out but isn't it written down somewhere????
thanks
J

max
Forum team
Posts: 863
Joined: January 15th, 2013, 3:43 pm

Re: How to concurrently play music to audio port and stream?

Post by max » February 8th, 2019, 7:24 am

MPD will play the same music on all outputs. MPD can have any number of clients, but they all control one shared state. If you want to play two different things at a time, launch MPD twice (on different control ports).

three_jeeps
Posts: 6
Joined: February 8th, 2019, 4:52 am

Re: How to concurrently play music to audio port and stream?

Post by three_jeeps » February 8th, 2019, 7:09 pm

Thank you...that clears up one aspect.

I currently have MPD running as a system service.
How do I run two system services of MPD? An associated question: do I keep the same config file that has the two audio outputs specified? Using my client (e.g. ncmpcpp) how do I make a distinction what instantion of MPD I want to connect to?
I do appreciate the time you take to answer my questions.
J

max
Forum team
Posts: 863
Joined: January 15th, 2013, 3:43 pm

Re: How to concurrently play music to audio port and stream?

Post by max » February 10th, 2019, 11:44 am

If you use systemd, you can copy mpd.service to mpd2.service and add the path of your second configuration file as parameter to ExecStart. In the second configuration, specify a different port (e.g. 6601 instead of 6600).
Then in your client, you can run "ncmpc -p6601" to connect to the second MPD.

Post Reply