Skip to content

add MPD control interface

George Vaindirlis requested to merge MPD.2 into master

MPD Server in VLC

GSoC 2021
Mentor: Thomas Guillem
Organization: VideoLAN

How this project works

The Music Player Daemon (MPD) protocol allows clients to control a music server. In this project, a server-side implementation was added to VLC, as an interface control module.
That way, a client will be able to easily browse the music library of VLC and control its playback by only getting the necessary metadata from the server module.
In this module, the server polls the clients and whenever there is an event related to a client, it calls a handler function and:

  • if the event is POLLIN, the handler reads the MPD command from the client and executes the appropriate function for the command. The function will then setup the output buffer (response to the client) and generate a POLLOUT event
  • if the event is POLLOUT, it sends the message that was generated by the MPD command functions to the client

M.A.L.P. is the only client that has been tested with this module and most of the commands that it uses are supported by the module as of late August 2021.
Other clients may not be fully functional in case they utilize different commands.

Work timeline

Before the first evaluation

The project started with the creation of a basic TCP server that was later improved to support multiple clients through poll(). This helped me learn a lot about networking, both general knowledge and C functions related to socket programming.
I also studied the VLC source code and then added the server to VLC as an interface control module, where also I learned about another important concept, threads.
Finally, support for some first MPD commands was added. These were for mostly basic controls, such as play/pause, next/previous etc.

After the first evaluation

The module was connected to the VLC Media Library, thus support for sending the library contents and manipulating the play queue was added.
That way, the user could view the list of albums, artists or tracks and add to the play queue a track, an album or even all the albums of a particular artist.
There is also the ability to modify the play queue (jump to a track, remove tracks or whole albums etc.)

Future work

After GSoC, I plan to add support for other commands that other clients use, as well as improve some commands that right now do not support certain options such as filtering or grouping. In addition, any future commands that will be added to future protocols may also get implemented.

What I gained from this Summer of Code

As mentioned before, I learned about some important concepts such as sockets and threads. I also:

  • contributed to open source for the first time!
  • learned how to quickly build and adapt a new small module to a big existing project
  • improved my git skills
  • improved my coding style
  • bonded with the open source community

The last one is particularly important. With open source code and documentation, I was able to easily understand how to use many modules written by different people. But whenever I had questions and sent emails, everyone at VLC was happy to help.

Acknowledgements

I would like to thank the team at VideoLAN for the support that they have given me and especially my mentor Thomas Guillem, who has guided me throughout the development of the module.

Edited by George Vaindirlis

Merge request reports