Showing posts with label audio. Show all posts
Showing posts with label audio. Show all posts

Sunday, November 12, 2023

Setting Up Soft Synths in Linux---Even Windows Ones!

I've been wanting to have a keyboard at my office, so I can practice a bit when I have a free moment. Eventually, I want to get a digital piano, or something similar, but at the moment I don't have the room for that. So I've bought an Arturia KeyLab 88 Mk II for the time being. It's just a MIDI controller, so does not make any sound by itself. The plan is to use software synthesizers on my computer for the sound.

Monday, January 9, 2023

The Loudness War

Many years ago, record companies realized that most people prefer music when it sounds louder. (See wikipedia and this article.) This isn't just a matter of turning it up. Rather, what people respond to is the average loudness, and you can increase that by compressing the music: making the quiet parts louder, basically. 

Sunday, December 11, 2022

Configuring Raspbian OS for the Pi2AES Hats

 The card is said to use the same drivers as the HiFiBerry Digi+ Pro. So following this page, we need to:

  1. Remove the line
    dtparam=audio=on
    from /boot/config.txt if it exists (which it probably does).
  2. If your system uses the vc4-fkms-v3d overlay, make sure, audio is also disabled on this:
    dtoverlay=vc4fkms-v3d,audio=off
    I had something similar, so set that to off.
  3. Assign the right card to squeezelite. Use squeezelite -l to get a listing. You probably want hw:CARD=sndrpihifiberry,DEV=0. So open /etc/defaults/squeezelite, and add that as the card.

That's it!

Sunday, November 13, 2022

How To Set Up a Raspberry Pi as a Squeezebox Client

  1. Download and install Raspbian OS onto a Micro SD card, and boot the system as normal
  2. Install squeezelite: sudo apt-get install squeezelite
  3. The squeezelite configuration file is at /etc/default/squeezelite. There are two things that need to be set:
    1. The name of this device, at it will appear in SqueezeCenter. This is the SL_NAME variable.
    2. The output device to use. This will depend upon whether you want to use USB or have some third-party board (e.g., the HiFiBerry DigiPro). To list available devices, do: squeezeplay -l. One you have identified the output device, specify it via the SL_SOUNDCARD variable.
  4. Make sure squeezelite is set to start on boot.
  5. Reboot the system, and everything ought to work just fine now.

One other thing you may want to do is enable ssh access. You will briefly need a monitor and keyboard to do this the easy way. After we've enable ssh, we can run the thing 'headless'.

From a terminal, just run raspi-config and follow the various prompts, etc.

If you don't want to look the Pi up to a monitor, etc, then see this page for how to enable ssh without one. Basically, all you have to do is put an empty file ssh into the /boot directory, via touch /boot/ssh. You can do that when flashing the OS onto the card, if you think ahead.

Friday, September 1, 2017

DLNA Output for Linux

Many of my favorite bands stream their concerts these days, sometimes live, sometimes afterwards. It's fine to listen on the computer sometimes, but other times I'd like to listen to the show over something a bit better-sounding, like my stereo. I figured there had to be a way to do this, and it turns out that, indeed, there is. The Logitech Transporter I use as a digital source will function as a DLNA renderer (i.e., you can send it a DLNA audio signal). And I know that Linux plays nice with DLNA, since I often stream video to my TV that way (using minidlna, aka, ReadyMedia). So the only question is: How can I convince Linux to send audio from the computer to the Transporter? (Note that something like this will work with any DLNA renderer.)

Assuming you are using Pulse Audio, this sort of thing turns out not to be very hard. (See here for another set of instructions.) First, you will need to install pulseaudio-dlna, which is a little program that sets up any DLNA renderers it finds on your network as PulseAudio output devices. (For Fedora, there is a copr repo, which you can read about here.) There are a ton of options to set the audio format and bitrate and so forth, so check the manpage, as usual.

That can be it, if you wish. Once pulseaudio-dlna is running, you can just start up whatever you want to 'cast' and use the PulseAudio Volume Control (pavucontrol) to set the output device for that stream.

One note: To get this to work on my laptop, I have had to disable the firewall. I guess it would probably be enough to enable traffic on 8080, which is the port that pulseaudio-dlna runs on by default, but I've not bothered finding out. I only do this when home, and I'm not worried about the firewall then.

There's another useful trick I found, which is especially nice when you're trying to sort out problems, namely: You can bind two devices together with PulseAudio, so you get sound through both of them. In my case, what I wanted to do was have the audio output both from the computer and from the DLNA renderer. The command to do this will be something like:
pacmd load-module module-combine-sink sink_name=combined1 slaves=alsa_output.pci-0000_00_1b.0.analog-stereo,familyroomtransporter_dlna
Here, the sink_name is what this new device will be known as in PulseAudio. The 'slaves' are the devices to which that is, in effect, an alias. To figure out what names you need to use here, just do:
pacmd list-sinks | grep name:
where the grep part will limit the output just to the relevant names. Of course you can omit it to see more information.

Friday, November 30, 2012

Extracting WAVs from VOB Files

The Station to Station box set contains a DVD with hi-resolution digital rips of the album, including one in 96/24. Since I play all of my digital stuff through a Logitech Transporter, I needed to rip those files to the media server. Here's how I did it.

First, I used mplayer to rip the VOB files from the DVD. These files have trivial video in them, so that has to be removed. The command to do that is:

ffmpeg -i <infile.vob> -acodec pcm_s24le <outfile.wav>

The audio codec here is the usual one for 24-bit audio, as you can see if look at a wav generated from a flac file. E.g.:

# ffmpeg -i 01-statesboro_blues.wav
...
Input #0, wav, from '01-statesboro_blues.wav':
Duration: 00:04:19.94, bitrate: 4608 kb/s
Stream #0.0: Audio: pcm_s24le, 96000 Hz, 2 channels, s32, 4608 kb/s
At least one output file must be specified


Note that this is independent of the sampling rate, so it works for 48/24 files, as well.

So now I had a bunch of 96/24 wavs, which I could convert to flac in the usual way.