Audio and music on Unix - Desktop Customization & Workflow

Users browsing this thread: 1 Guest(s)
venam
Administrators
Hello fellow nixers,
In this thread we'll discuss the general topic of audio, music, and audio
manipulation on Unix.

We'll try to assess its state and share experiences and problems.


NB: This was supposed to be a podcast topic but the podcast has been dead for the
past 4-5 weeks.


#Configuring the audio

Configuring the audio on Unix can be difficult depending on what OS and driver
you are using.

On Linux Alsa and the legacy OSS (open sound system) are available).
Both are kernel driven sound card drivers and thus are loaded by your init
system or deamon manager.

Consequently, everything that can affect the init system might create a problem
with the driver.

Alsa can be configured via the asound.conf or asoundrc files where you can specify specific
sound card configurations.

Testing and manipulating the audio for alsa is done with:

```
Code:
alsamixer #volume
alsaequal-mgr #Save and restore named alsaequal states
speaker-test -c 2 #test the speakers
aplay -l #list devices
and all the alsa* utilities
```


The advantages of using OSS:

You'll have a per-application volume control, some legacy cards have better
support, it is cross platform (runs on BSDs and Solaris),
has a smaller and easier to use API.

The advantages of using ALSA:

You'll have better support for USB, bluetooth, HD audio devices, and all other
funky hardware you can find.


Personal note:

Sound output from HDMI caused me troubles in the past the solution was a messy
script.
For more information consult this link.


Configuring the sound on BSD variants differs from distro to distro.

I won't enter the subject but for example NetBSD has the `audioctl` commands
to set audio configurations and FreeBSD the `sysctl` to set the kernel state.


#Pulseaudio

Pulseaudio is a sound proxy application that gives and interface to the lower
layer to other applications.
[Image: 1000px-Pulseaudio-diagram.svg.png]

It can detect the devices and automatically configure them (or we hope so).

You can control all the lower layers from pulseaudio.
It offers a sound equalizer loaded with:

Code:
$ pactl load-module module-equalizer-sink
$ pactl load-module module-dbus-protocol
$ pactl - cli

It has many frontends.


#Codecs

Quote:A codec is a device or computer program capable of encoding and/or decoding a digital data stream or signal.

Media players need to know how to decode the audio to play it. Audio files have
multiple formats and codec libraries are there to give those programs a way to
understand them.

Some said that one of the reasons they won't use a Linux Libre kernel was that
it wouldn't support all codecs. It is partially true, libre kernels offers free
versions of most codecs.

I'm using a Libre kernel and didn't run into any issues related to
codecs so far.


#PC BEEP


If you're a Unix users you're obviously knowledgeable about beeps.

A PC beep is a sound, usually used as warning when the ram isn't in place for
example, that comes straight from the motherboard and not the speaker (although
it depends on the computer manufacturer and the components).

The beep can be muted from multiple places, the audio driver (alsa, oss, and others),
from the console (TTY), in the X11 environment, in the kernel, and at boot time.

On Linux it's loaded via the pcspkr module
Code:
rmmod pcspkr


A cross platform way, but only in X is `xset -b`.

There are programs used to play with the frequency of the beep such as
the program `beep`.

You can find scripts to play music using the motherboard speaker.

If you are even more of a beep amateur you've certainly heard of chiptunes.

`sidplay2` is a program that emulates the commodore 64 to play music.

Quote:Sidplay is SID-chip emulator for playing Commodore 64 music.


#Music Player - Music tagging


There are ton of music players.
You have the choice between curses interface and gui.
Choice between those that have a daemon interfaces and others that play the music directly.

mplayer, mpd, xmms2, cmus, cplay, deadbeef, amarok, clementine, are common names.

-

Music files have metadata about authors, album, etc..

Unix has different tools to edit those information, they go by the name of tageditors:
  • tagtool
  • easytag
  • mp3info
  • exfalso - audio tag editor for GTK+
  • kid3 - KDE MP3 ID3 tag editor
  • puddletag - simple, powerful audio tag editor


And if you want to add a party ambiance you can use music visualizers, which are
programs that us a fast fourier transform to create
amazing shapes and forms that move around with the music.

If it's not built in your music player you can use ProjectM or VSXu.


#Music/Sound Editing - Converting


After my research I was surprised that there was so many programs available for
sound editing on Unix.

I haven't tried them all but I've read good reviews about some.

A list of interesting ones:
  • ardour - digital audio workstation (graphical gtk2 interface)
  • ardour3 - digital audio workstation (graphical gtk2 interface)
  • audacity - fast, cross-platform audio editor
  • sweep - Audio editor and live playback tool
  • mhwaveedit - Simple and fast GTK2 sound editor
  • nama - Ecasound-based multitrack recorder/mixer
  • pitivi - non-linear audio/video editor using GStreamer
  • rosegarden - music editor and MIDI/audio sequencer
  • rosegarden-dbg - Debugging symbols for Rosegarden
  • swami - MIDI instrument editor application
  • swami-dbg - MIDI instrument editor - debugging symbols
  • wav2cdr - Converts wav files into CD-ROM audio file format
  • cecilia - Sound synthesis and audio signal processing environment
  • kwave - sound editor for KDE
  • milkytracker - music creation tool inspired by Fast Tracker 2
  • muse - Qt4-based audio/MIDI sequencer
  • pitivi - non-linear audio/video editor using GStreamer
  • rosegarden - music editor and MIDI/audio sequencer
  • snd-gtk-pulse - Sound file editor (GTK+ user interface - PulseAudio)
  • traverso - Multitrack audio recorder and editor
  • xsynth-dssi - classic-analog (VCOs-VCF-VCA) style software synthesizer

Or you could go real hardcore like this dude and
create music by writing C programs to generate the sound.

For spectrum analysis I'd use sonic visualisers.


#TTS - Voice recognition(STT)

Text to speech and voice recognition is an area that is poor in the Unix community.

However, it's not only the Unix community that is lacking support for those.
All the softwares that have a "natural feel" are proprietary and costly. They are sold to mobile operators.

I've tried my share of them and will only retain one thing: festival is the best
text to speech available on Unix even though it's hard to setup and you have to
search for voice files on the web.

As far as voice recognition goes I've also tried a few but none of them worked
correctly and they were all insanely complex to setup. Sphinx is hell to understand.


I hope this covers a general topic on audio and music on Unix.


Now it's time for you to share your stories and experiences.


Messages In This Thread
Audio and music on Unix - by venam - 23-10-2015, 01:40 PM
RE: Audio and music on Unix - by chc4 - 23-10-2015, 02:46 PM
RE: Audio and music on Unix - by Wildefyr - 23-10-2015, 03:26 PM
RE: Audio and music on Unix - by Houseoftea - 23-10-2015, 03:31 PM
RE: Audio and music on Unix - by ninjacharlie - 23-10-2015, 07:24 PM
RE: Audio and music on Unix - by darthlukan - 24-10-2015, 07:02 AM
RE: Audio and music on Unix - by pranomostro - 24-10-2015, 11:31 AM
RE: Audio and music on Unix - by z3bra - 24-10-2015, 07:25 PM
RE: Audio and music on Unix - by apk - 25-10-2015, 03:41 PM
RE: Audio and music on Unix - by kirby - 27-10-2015, 09:34 PM
RE: Audio and music on Unix - by Wildefyr - 28-10-2015, 09:01 PM
RE: Audio and music on Unix - by z3bra - 29-10-2015, 07:29 AM
RE: Audio and music on Unix - by darthlukan - 29-10-2015, 08:13 AM
RE: Audio and music on Unix - by Wildefyr - 29-10-2015, 03:05 PM
RE: Audio and music on Unix - by z3bra - 29-10-2015, 04:35 PM
RE: Audio and music on Unix - by Wildefyr - 29-10-2015, 11:03 PM
RE: Audio and music on Unix - by venam - 06-11-2015, 04:42 AM
RE: Audio and music on Unix - by z3bra - 06-11-2015, 06:25 AM
RE: Audio and music on Unix - by venam - 11-11-2015, 04:54 AM
RE: Audio and music on Unix - by ChefIronBelly - 13-11-2015, 12:11 PM
RE: Audio and music on Unix - by venam - 03-04-2016, 06:11 AM
RE: Audio and music on Unix - by ninjacharlie - 03-04-2016, 04:19 PM
RE: Audio and music on Unix - by arcetera - 03-04-2016, 07:20 PM
RE: Audio and music on Unix - by tudurom - 04-04-2016, 10:16 AM
RE: Audio and music on Unix - by ninjacharlie - 04-04-2016, 11:03 AM
RE: Audio and music on Unix - by arcetera - 04-04-2016, 11:50 AM
RE: Audio and music on Unix - by tudurom - 04-04-2016, 01:13 PM
RE: Audio and music on Unix - by neeasade - 04-04-2016, 01:55 PM
RE: Audio and music on Unix - by pfr - 23-02-2022, 12:49 AM
RE: Audio and music on Unix - by venam - 23-02-2022, 02:45 AM
RE: Audio and music on Unix - by pfr - 23-02-2022, 05:06 AM
RE: Audio and music on Unix - by seninha - 23-02-2022, 11:15 AM
RE: Audio and music on Unix - by pfr - 23-02-2022, 07:28 PM
RE: Audio and music on Unix - by pfr - 02-03-2022, 09:07 AM