Skip to content

yui0/aplay-

Folders and files

NameName
Last commit message
Last commit date

Latest commit

author
Yuichiro Nakada
Mar 16, 2025
93ed387 Β· Mar 16, 2025
Nov 4, 2023
Mar 1, 2022
Apr 11, 2023
Mar 16, 2025
Jan 4, 2025
Sep 29, 2020
Mar 16, 2025
Mar 16, 2025
Mar 16, 2025
Mar 16, 2025
Mar 16, 2025
Mar 16, 2025
Mar 2, 2022
Nov 6, 2023
Nov 4, 2023
May 8, 2018
Apr 2, 2017
Nov 4, 2023
Mar 7, 2020
Aug 1, 2021
Mar 1, 2022
May 8, 2018

Repository files navigation

🎢 aplay+: A Simple and High-Quality Audio Player

GitHub Repo stars GitHub code size in bytes Lines of code GitHub release (latest by date) MIT License

🎧 Enjoy BitPerfect audio playback with simplicity and precision!

Logo

πŸ’Ώ Supported File Formats

aplay+ supports a variety of popular audio formats:

  • 🌟 FLAC: High-quality lossless compression
  • 🌊 WAV: Uncompressed audio with crystal-clear quality
  • 🎢 MP3: The most commonly used compressed format
  • 🎡 Ogg Vorbis: Great compression with excellent sound
  • πŸ“± AAC (mp4/m4a): Widely used in iPhones and YouTube

πŸ”§ How to build

Build Online

Build Locally

  1. Install required libraries:
# dnf install alsa-lib-devel
$ make
  1. Clone the repository and build:
git clone https://github.com/yui0/aplay-.git
cd aplay-
make

🌸 How to use

Basic Commands

$ ./aplay+ -h
Usage: ./aplay+ [options] dir

Options:
-h                 Print this help message
-d <device name>   Specify ALSA device [e.g., default hw:0,0 plughw:0,0...]
-f                 Use 32-bit floating-point playback
-r                 Recursively search directories
-x                 Enable random playback
-s <regexp>        Search files with a regex
-t <ext type>      Specify file type (e.g., flac, mp3, wma...)
-p                 Optimize for Linux platforms

Examples

  • πŸ”€ Random playback:
    $ ./aplay+ -rx .
  • 🎀 Search for a specific artist:
    $ ./aplay+ -rx -d hw:7,0 /Music/ -s ZARD
  • 🎹 Exclude instrumentals from playback:
    $ ./aplay+ -rfx -d hw:7,0 /Music/ -s '^(?!.*nstrumental).*$'

🌟 Linux Optimization Settings

πŸš€ Optimize Disk I/O

Add the following to your sysctl.conf:

vm.dirty_ratio = 40
vm.dirty_background_ratio = 10
vm.dirty_expire_centisecs = 3000
vm.dirty_writeback_centisecs = 500
#dev.hpet.max-user-freq = 3072
vm.overcommit_memory = 1

Apply changes:

sysctl -p

βš™οΈ Adjust Scheduler Settings

Optimize SSDs and HDDs with the following script:

#!/bin/sh
#cat /sys/block/sd*/queue/scheduler
for FILE in /sys/block/sd*/queue/scheduler
do
	[ -f $FILE ] || continue
	echo -n none > $FILE
done

πŸ’¨ Set CPU Performance Mode

Use this script to switch CPU governor to "performance":

#!/bin/sh
#cat /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
for CPUFREQ in /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
do
	[ -f $CPUFREQ ] || continue
	echo -n performance > $CPUFREQ
done

I/O scheduler

# scheduler for non rotational, SSD
ACTION=="add|change", KERNEL=="sd[a-z]|mmcblk[0-9]*", ATTR{queue/rotational}=="0", ATTR{queue/scheduler}="none"
# scheduler for rotational, HDD
ACTION=="add|change", KERNEL=="sd[a-z]", ATTR{queue/rotational}=="1", ATTR{queue/scheduler}="bfq"

fstrim -v /

Timer

#cat /sys/devices/system/clocksource/clocksource0/current_clocksource
echo tsc > /sys/devices/system/clocksource/clocksource0/current_clocksource

ulimit -a

πŸ“– References

🎡 Experience perfect audio playback with aplay+! Start your music journey today!