[PR #883] [MERGED] Improve --device ? functionality for the alsa backend #1131

Closed
opened 2026-02-27 20:01:17 +03:00 by kerem · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/librespot-org/librespot/pull/883
Author: @JasonLG1979
Created: 11/19/2021
Status: Merged
Merged: 11/25/2021
Merged by: @roderickvd

Base: devHead: improve_device_list_outputs


📝 Commits (1)

  • c006a23 Improve --device ? functionality for the alsa backend

📊 Changes

2 files changed (+65 additions, -28 deletions)

View changed files

📝 CHANGELOG.md (+1 -0)
📝 playback/src/audio_backend/alsa.rs (+64 -28)

📄 Description

This makes --device ? only show compatible devices (ones that support 2 ch 44.1 Interleaved) and it shows what librespot format(s) they support.

This should be more useful to users as the info maps directly to librespot's --device and --format options.

The output looks like this:


Compatible alsa device(s):

----------------------------------------------

Device:

hw:CARD=Generic,DEV=3

Description:

HD-Audio Generic, HDMI 0
Direct hardware device without any conversions

Supported Format(s):

S32 S16

----------------------------------------------

Device:

hw:CARD=Generic,DEV=7

Description:

HD-Audio Generic, HDMI 1
Direct hardware device without any conversions

Supported Format(s):

S32 S16

----------------------------------------------

Device:

hw:CARD=Generic,DEV=8

Description:

HD-Audio Generic, HDMI 2
Direct hardware device without any conversions

Supported Format(s):

S32 S16

----------------------------------------------

Device:

plughw:CARD=Generic,DEV=3

Description:

HD-Audio Generic, HDMI 0
Hardware device with all software conversions

Supported Format(s):

F64 F32 S32 S24 S16 S24_3

----------------------------------------------

Device:

plughw:CARD=Generic,DEV=7

Description:

HD-Audio Generic, HDMI 1
Hardware device with all software conversions

Supported Format(s):

F64 F32 S32 S24 S16 S24_3

----------------------------------------------

Device:

plughw:CARD=Generic,DEV=8

Description:

HD-Audio Generic, HDMI 2
Hardware device with all software conversions

Supported Format(s):

F64 F32 S32 S24 S16 S24_3

----------------------------------------------

Device:

hdmi:CARD=Generic,DEV=0

Description:

HD-Audio Generic, HDMI 0
HDMI Audio Output

Supported Format(s):

S32 S16

----------------------------------------------

Device:

hdmi:CARD=Generic,DEV=1

Description:

HD-Audio Generic, HDMI 1
HDMI Audio Output

Supported Format(s):

S32 S16

----------------------------------------------

Device:

hdmi:CARD=Generic,DEV=2

Description:

HD-Audio Generic, HDMI 2
HDMI Audio Output

Supported Format(s):

S32 S16

----------------------------------------------

Device:

hw:CARD=DAC,DEV=0

Description:

JDS Labs Element DAC, USB Audio
Direct hardware device without any conversions

Supported Format(s):

S16 S24_3

----------------------------------------------

Device:

hw:CARD=DAC,DEV=1

Description:

JDS Labs Element DAC, USB Audio #1
Direct hardware device without any conversions

Supported Format(s):

S16

----------------------------------------------

Device:

plughw:CARD=DAC,DEV=0

Description:

JDS Labs Element DAC, USB Audio
Hardware device with all software conversions

Supported Format(s):

F64 F32 S32 S24 S16 S24_3

----------------------------------------------

Device:

plughw:CARD=DAC,DEV=1

Description:

JDS Labs Element DAC, USB Audio #1
Hardware device with all software conversions

Supported Format(s):

F64 F32 S32 S24 S16 S24_3

----------------------------------------------

Device:

sysdefault:CARD=DAC

Description:

JDS Labs Element DAC, USB Audio
Default Audio Device

Supported Format(s):

F64 F32 S32 S24 S16 S24_3

----------------------------------------------

Device:

front:CARD=DAC,DEV=0

Description:

JDS Labs Element DAC, USB Audio
Front output / input

Supported Format(s):

S16 S24_3

----------------------------------------------

Device:

surround40:CARD=DAC,DEV=0

Description:

JDS Labs Element DAC, USB Audio
4.0 Surround output to Front and Rear speakers

Supported Format(s):

S16 S24_3

----------------------------------------------

Device:

iec958:CARD=DAC,DEV=0

Description:

JDS Labs Element DAC, USB Audio
IEC958 (S/PDIF) Digital Audio Output

Supported Format(s):

S16 S24_3

----------------------------------------------


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/librespot-org/librespot/pull/883 **Author:** [@JasonLG1979](https://github.com/JasonLG1979) **Created:** 11/19/2021 **Status:** ✅ Merged **Merged:** 11/25/2021 **Merged by:** [@roderickvd](https://github.com/roderickvd) **Base:** `dev` ← **Head:** `improve_device_list_outputs` --- ### 📝 Commits (1) - [`c006a23`](https://github.com/librespot-org/librespot/commit/c006a2364452a83584afc7b50e9714c4c71d24c7) Improve `--device ?` functionality for the alsa backend ### 📊 Changes **2 files changed** (+65 additions, -28 deletions) <details> <summary>View changed files</summary> 📝 `CHANGELOG.md` (+1 -0) 📝 `playback/src/audio_backend/alsa.rs` (+64 -28) </details> ### 📄 Description This makes `--device ?` only show compatible devices (ones that support 2 ch 44.1 Interleaved) and it shows what `librespot` format(s) they support. This should be more useful to users as the info maps directly to `librespot`'s `--device` and `--format` options. The output looks like this: ``` Compatible alsa device(s): ---------------------------------------------- Device: hw:CARD=Generic,DEV=3 Description: HD-Audio Generic, HDMI 0 Direct hardware device without any conversions Supported Format(s): S32 S16 ---------------------------------------------- Device: hw:CARD=Generic,DEV=7 Description: HD-Audio Generic, HDMI 1 Direct hardware device without any conversions Supported Format(s): S32 S16 ---------------------------------------------- Device: hw:CARD=Generic,DEV=8 Description: HD-Audio Generic, HDMI 2 Direct hardware device without any conversions Supported Format(s): S32 S16 ---------------------------------------------- Device: plughw:CARD=Generic,DEV=3 Description: HD-Audio Generic, HDMI 0 Hardware device with all software conversions Supported Format(s): F64 F32 S32 S24 S16 S24_3 ---------------------------------------------- Device: plughw:CARD=Generic,DEV=7 Description: HD-Audio Generic, HDMI 1 Hardware device with all software conversions Supported Format(s): F64 F32 S32 S24 S16 S24_3 ---------------------------------------------- Device: plughw:CARD=Generic,DEV=8 Description: HD-Audio Generic, HDMI 2 Hardware device with all software conversions Supported Format(s): F64 F32 S32 S24 S16 S24_3 ---------------------------------------------- Device: hdmi:CARD=Generic,DEV=0 Description: HD-Audio Generic, HDMI 0 HDMI Audio Output Supported Format(s): S32 S16 ---------------------------------------------- Device: hdmi:CARD=Generic,DEV=1 Description: HD-Audio Generic, HDMI 1 HDMI Audio Output Supported Format(s): S32 S16 ---------------------------------------------- Device: hdmi:CARD=Generic,DEV=2 Description: HD-Audio Generic, HDMI 2 HDMI Audio Output Supported Format(s): S32 S16 ---------------------------------------------- Device: hw:CARD=DAC,DEV=0 Description: JDS Labs Element DAC, USB Audio Direct hardware device without any conversions Supported Format(s): S16 S24_3 ---------------------------------------------- Device: hw:CARD=DAC,DEV=1 Description: JDS Labs Element DAC, USB Audio #1 Direct hardware device without any conversions Supported Format(s): S16 ---------------------------------------------- Device: plughw:CARD=DAC,DEV=0 Description: JDS Labs Element DAC, USB Audio Hardware device with all software conversions Supported Format(s): F64 F32 S32 S24 S16 S24_3 ---------------------------------------------- Device: plughw:CARD=DAC,DEV=1 Description: JDS Labs Element DAC, USB Audio #1 Hardware device with all software conversions Supported Format(s): F64 F32 S32 S24 S16 S24_3 ---------------------------------------------- Device: sysdefault:CARD=DAC Description: JDS Labs Element DAC, USB Audio Default Audio Device Supported Format(s): F64 F32 S32 S24 S16 S24_3 ---------------------------------------------- Device: front:CARD=DAC,DEV=0 Description: JDS Labs Element DAC, USB Audio Front output / input Supported Format(s): S16 S24_3 ---------------------------------------------- Device: surround40:CARD=DAC,DEV=0 Description: JDS Labs Element DAC, USB Audio 4.0 Surround output to Front and Rear speakers Supported Format(s): S16 S24_3 ---------------------------------------------- Device: iec958:CARD=DAC,DEV=0 Description: JDS Labs Element DAC, USB Audio IEC958 (S/PDIF) Digital Audio Output Supported Format(s): S16 S24_3 ---------------------------------------------- ``` --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
kerem 2026-02-27 20:01:17 +03:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/librespot#1131
No description provided.