4

I'm trying to configure my Raspberry Pi (model B) to work as an AirPlay to Bluetooth bridge of sorts. I'm using Shairport-Sync to receive the AirPlay audio successfully, and can get it to output via Alsa to either the built-in minijack or a USB sound card, and I've got Bluetooth mostly-working, but I'm struggling to connect the dots.

I've configured ~/.asoundrc so I can connect to my Bluetooth speaker successfully, and can play audio via mplayer using the command mplayer -ao alsa:device=bluetooth audiofile.mp3, but I can't get any output via aplay.

In trying to get aplay to work too, I've discovered that my Bluetooth audio device appears when I enter the command aplay -L, but it doesn't when I do aplay -l.

So what's the difference? Why does it show in one but not the other?

I think if I can understand this, I might be able to play audio via aplay on the command line, and if I can do that, I should be able to get Shairport-sync to output to my Bluetooth speakers too!

Can anyone share some knowledge with me?

Thanks!

Trickartt
  • 41
  • 1
  • 3

2 Answers2

2

As per the manual page (which should be installed, read man aplay):

-l, --list-devices
    List all soundcards and digital audio devices
-L, --list-pcms
    List all PCMs defined

PCM is the standard way that uncompressed digital audio is encoded for playback. It may colloquially refer to a source/sink of such a signal ("PCM interface" might be clearer), which usually requires a hardware clock to work, hence they cannot be created arbitrarily. Some sound cards and devices may have multiple PCMs available.

Conversely, you may have a PCM available to the system which isn't really local. There's still a clock involved with the timing, but in this case it would be the clock for the transmitter/receiver, which isn't actually a "digital audio device".

This explanation is conjectural on my part, but fits the facts.

goldilocks
  • 60,325
  • 17
  • 117
  • 234
2

aplay -l lists all hardware devices, i.e., devices handled by an ALSA kernel driver. These devices, identified by card number x and device number y, can be accessed directly with a device name hw:x,y. Software plugins that are layered on top of hardware device also accept these numbers, e.g., plughw:x,y or dmix:x.

aplay -L lists the ALSA device names of all hardware and software devices (that are configured to be listed).

To use device name xxx with aplay, run aplay -D xxx.

CL.
  • 571
  • 5
  • 9