oss_audioloop(7)

πŸ“¦
version 4.2-build2020 Β· 3 versions
, in ubuntu noble

✨ NAME ✨

oss_audioloop β€” the loopback audio driver, and she's iconic πŸ’…


πŸŽ€ DESCRIPTION πŸŽ€

Okay so bestie, the loopback audio driver makes it possible to create special purpose virtual audio devices that are based on user land server processes. Yes, we're manifesting sound cards out of pure vibes.

Loopback devices are driven by a timer interrupt, and no real audio hardware is required. Zero hardware, all energy. πŸ”₯

🌸 INTRODUCTION 🌸

Audio loopback devices are like named pipes or pseudo terminals β€” same vibe, different snack. They're grouped in client and server device pairs, and the server side device must be open before the client side device can be opened. No cutting the line, babe. 🚫

Loopback devices are typically used to implement server based special purpose audio devices. This kind of server can, for example, transfer the audio data played by the client application to some remote system using some VoIP protocol. But here's the thing β€” the server application doesn't need to be any dedicated server. Practically any audio application can be used as the server. The range? Immaculate. πŸ‘‘

πŸ¦‹ SERVER SIDE DEVICE πŸ¦‹

The server side application sets up the native sampling rate and sample format (number of bits and channels). She decides, and everyone else adjusts.

The server side device can be opened for input (O_RDONLY) or output (O_WRONLY). Opening for simultaneous input and output (O_RDWR) is not permitted. Pick a lane, bestie. 🚫

The server application will automatically be paused at the moment it tries to read or write audio data for the first time. It will be kept in sleep until the client side application starts writing or reading data. This sleep period may last forever, and in some cases the first write/read call never returns. 😭 For this reason it's not recommended to use GUI based audio applications as the server. And note: this wait will occur even in the non-blocking (O_NONBLOCK) mode β€” this is an intentional feature and not a bug, fr fr. Don't come for her.

🧚 CLIENT SIDE DEVICE 🧚

The client side device is typically used by any ordinary audio application. There is nothing special in loopback devices. She's just a girl. πŸ’…

Since the loop is unidirectional, the client side will be forced to be write only if the server side device is open for recording, and vice versa.

The loop will use the sample rate and sample format (number of bits and channels) set by the server side application. If the client uses different settings then OSS will perform the required sampling rate and format conversions automatically. No manual labour required, we love a hands-off queen. ✨


πŸ’€ COMPATIBILITY ISSUES πŸ’€

Audio loopback devices differ from "normal" audio devices because an application is needed at the both ends of the loop. The loop device will return a "Connection reset by peer" error (ECONNRESET) error. Applications designed to be used as loopback based server applications can/should use this error (returned by read or write) as an end-of-stream indication. That's your cue to leave the group chat. 🫢


βš™οΈ OPTIONS βš™οΈ

  • audioloop_instances β€” specifies how many loopback client/server audio device pairs to be created.
    • Values: 1-16
    • Default: 1

πŸ™ˆ KNOWN PROBLEMS πŸ™ˆ

  • There is no mixer (volume control) related with loopback audio devices. This may prevent poorly designed audio applications (that expect/require a mixer) from working. There is no workaround available. πŸ’€
  • The server side application will wait until the client side application starts using it. This wait may last forever, which in turn may cause unrecoverable (network) problems with some applications. Not cute, but it's real.
  • Loopback devices may return "Connection reset by peer" error when the remote side of the loop disconnects the device. Some recording applications may fail to save the recorded data properly because of this. Use some other application (such as ossrecord) if this happens. Go off, ossrecord. πŸ”₯

πŸ“ FILES πŸ“

  • /etc/oss4/conf/oss_audioloop.conf β€” device configuration file.

πŸ‘‘ AUTHOR πŸ‘‘

4Front Technologies


And that's the whole page, bestie! This one comes to you from 4Front Technologies, living in the OSS Devices manual, dated 11 February 2015 β€” and yes, oss_audioloop(7) ate and left no crumbs. πŸŒˆβ­πŸŽ€

πŸ“¦ where this page comes from