Raspberry Pi online course

Play MP3 Audio on a Raspberry Pi with LXMusic

Learn how to install LXMusic on Raspberry Pi OS or older Raspbian, add MP3 files to a playlist, control playback, and troubleshoot sound output.

A Raspberry Pi can work as a simple audio playback device. It can play locally stored sound files, including MP3 files. MP3 is a widely used compressed digital audio format.

Before starting, connect and test an audio output. Depending on your Raspberry Pi and setup, sound may be sent through HDMI, an analogue audio jack where available, USB audio, headphones, powered speakers, or another configured audio device.

What Is LXMusic?

LXMusic is a lightweight graphical music player for playing local audio files and managing playlists. It was commonly available with older Raspbian desktop installations.

A playlist is an ordered collection of audio tracks queued for playback. LXMusic can open audio files, add them to a playlist, start and stop playback, move between tracks, and adjust volume.

The application name, menu labels, and package availability can vary between Raspberry Pi OS releases. Raspberry Pi OS is the current name for the operating system previously called Raspbian. Raspbian is the older name for Raspberry Pi's Debian-based operating system.

Check the Audio Hardware First

Connect headphones, speakers, an HDMI display with speakers, a USB audio adapter, or another supported output device. Powered speakers must be switched on, and headphones should be fully inserted.

Audio output is the hardware path that sends sound from the operating system to the selected device. The output used by the system must match the hardware you intend to hear. For example, selecting HDMI while headphones are connected to an analogue jack can make the player appear to work without producing sound from the headphones.

Install LXMusic from the Terminal

A terminal is a text-based interface for entering Linux commands. Open it from the Raspberry Pi desktop, usually by selecting the terminal icon or opening the desktop menu and choosing the terminal application.

APT is the Debian-based package-management tooling used to install software. Run the following command:

sudo apt-get install lxmusic

sudo is a command prefix that runs an administrative command with elevated privileges. When prompted, enter your administrator password. The password does not appear on screen while you type. APT may then show the packages it will install and ask for confirmation; type Y and press Enter if you want to continue.

Wait for the installation to finish and for the terminal prompt to return. Do not try to open LXMusic until APT has completed.

Refresh package information first

If APT cannot find the package, refresh the local package metadata and try again:

sudo apt-get update
sudo apt-get install lxmusic

The update command refreshes package information; it does not install LXMusic by itself. A network connection may be required.

Launch LXMusic

Open it from the desktop menu

  1. Open the Raspberry Pi desktop menu.
  2. Open the Sound & Video category, or the similarly named multimedia category.
  3. Select LXMusic or the installed music-player entry.

Menu names and locations can differ between desktop releases. If the entry is not visible, launch the program from a terminal:

lxmusic

If this command reports that it cannot be found, check whether installation completed successfully and review the package-availability troubleshooting section below.

Add MP3 Files to a Playlist

Files must already be accessible on the Raspberry Pi. They may be in the home folder, a Music or Downloads directory, a mounted USB drive, or another readable location.

  1. Open LXMusic.
  2. Use the add-files control, commonly displayed as a plus icon.
  3. Browse through the filesystem to the folder containing your audio files.
  4. Select one or more MP3 files in the file chooser.
  5. Confirm the selection to add the files to the playlist.

You can add a single track for a quick test or select several files to create a listening queue. Review the order shown in the playlist before starting playback.

Control Playback

Select a track in the playlist and use the play control. You can also change playback by selecting a different item in the playlist.

ControlPurposeTypical use
Add filesOpens a file chooserBrowse for and add one or more audio files
PlayStarts playbackPlay the selected track
PauseTemporarily suspends playbackPause without losing the current position
StopStops playbackEnd the current playback session
Previous trackMoves to the preceding itemReturn to the previous track in the queue
Next trackMoves to the following itemContinue with the next track
VolumeChanges the player's output levelRaise or lower the application volume

Example: Play One MP3

  1. Open LXMusic from the desktop's Sound & Video category.
  2. Click the add-files control.
  3. Browse to the folder containing the MP3, such as your home folder or Music directory.
  4. Select the file and confirm the addition.
  5. Highlight the track in the playlist if necessary.
  6. Press play.
  7. Adjust both the LXMusic volume and the system volume until the sound is audible.

Example: Create a Small Listening Queue

  1. Open the add-files dialog.
  2. Select several MP3 files at once.
  3. Confirm the selection.
  4. Review the playlist order.
  5. Select the first track and press play.
  6. Use next, previous, or direct track selection to change what plays.

Verify Sound Output

If the player shows that a track is playing but you cannot hear it, check the complete audio path:

  • Confirm that headphones or speakers are connected correctly.
  • Check that powered speakers are switched on and not muted.
  • Confirm that the selected system audio output matches the hardware in use.
  • Raise the LXMusic volume.
  • Raise the Raspberry Pi desktop or system mixer volume.
  • Test with a known-working MP3 file.
SymptomLikely causeCheck or corrective action
Player appears to run but no sound is heardDisconnected, unpowered, muted, or incorrectly selected outputCheck connections and power, confirm the active output, and raise both player and system volume
Sound is too quietApplication or system volume is lowIncrease the LXMusic volume and the desktop mixer volume; check the speaker's own volume control
Sound is routed to the wrong deviceAnother output is selectedChoose the output that matches HDMI, analogue, USB, headphones, or speakers being used
One file will not playThe file may be corrupt or use unsupported encodingTry another known-working MP3 and verify the problem file with another player or device
LXMusic cannot be found after installationInstallation did not complete or the package is unavailableReview the terminal output, refresh package lists, and check whether the package exists for the current release

Troubleshoot Installation and Files

APT says that the package cannot be located

Possible causes include outdated package lists, a Raspberry Pi OS release whose configured repositories do not provide LXMusic, or a change in the media-player packages available for that release.

  • Run sudo apt-get update and try the installation again.
  • Verify the Raspberry Pi OS release and its configured repositories.
  • Check the current package repository before depending on LXMusic.
  • If LXMusic is unavailable, use another graphical audio player provided by the current installation.

For general software update guidance, see Update Raspbian.

The file chooser cannot find an audio file

  • Browse to the actual directory, such as Music or Downloads.
  • Confirm that removable storage is connected and mounted.
  • Move or copy the file to a folder readable by the current user.
  • Check that the file was fully copied or downloaded.

Basic file operations are covered in File Management.

The file is listed but does not play

The file may be damaged, or its audio encoding may not be supported by the installed playback components. Try another MP3. If only one file fails, verify that it plays on another device or player. If necessary, convert the source to a supported audio format.

Legacy and Current Software Context

LXMusic and the Raspbian name are most closely associated with older Raspberry Pi desktop environments. The package may still be available on some systems, but package repositories and default applications change over time.

On a newer Raspberry Pi OS installation, check the configured repository before relying on the installation command. If LXMusic is not available, install or use another graphical media player supplied for that release. The essential workflow remains the same: select a local audio file, place it in a playlist, choose the correct output, and control playback.

Key Points

  • A Raspberry Pi can play locally stored MP3 files when a working audio output is connected.
  • LXMusic provides a simple graphical interface for playlists and playback.
  • Install it with APT when the package is available: sudo apt-get install lxmusic.
  • Add files with the plus or add-files control, then select a track and press play.
  • Check both application and system volume when troubleshooting sound.
  • On current Raspberry Pi OS releases, confirm package availability and use another player if LXMusic is not provided.