Cannot use listed audio device

Open
#251 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
68/100
Issue type
Bug
Clarity
Mostly clear
Activity status
Quiet
Tech stack
python

Research direction

Start with sendspin/audio_devices.py, especially detect_supported_audio_formats() and _check_format(), then review the device selection used by sendspin/daemon/daemon.py. Reproduce the failure with sendspin daemon --audio-device 'default:CARD=S4' and compare it with the listed device names. Done means the named ALSA device is accepted and the daemon connects without the ValueError.

Written by the indexing model from the issue text.

Description

I'm trying to use the Sendspin daemon with one of the ALSA audio devices on my system.
The audio device I want to use is default:CARD=S4.
It is listed by sendspin audio-devices list:

[michiel@sqz-badkamer ~]$ sendspin audio-devices list
Available audio output devices:

  [0] Sound Blaster Play! 4: USB Audio (hw:0,0)
       Channels: 2, Sample rate: 44100.0 Hz
  [1] sysdefault
       Channels: 128, Sample rate: 48000.0 Hz
  [2] front
       Channels: 2, Sample rate: 44100.0 Hz
  [3] surround40
       Channels: 2, Sample rate: 44100.0 Hz
  [4] iec958
       Channels: 2, Sample rate: 44100.0 Hz
  [5] spdif
       Channels: 2, Sample rate: 44100.0 Hz
  [6] default (default)
       Channels: 128, Sample rate: 48000.0 Hz
  [7] dmix
       Channels: 2, Sample rate: 48000.0 Hz

To select an audio device:
  sendspin --audio-device 0
  sendspin daemon --audio-device 0

ALSA devices (use by name with --audio-device):

  null
       Discard all samples (playback) or generate zero samples (capture)
  default
       Default Audio Device
  sysdefault
       Default Audio Device
  default:CARD=S4
       Sound Blaster Play! 4, USB Audio
  sysdefault:CARD=S4
       Sound Blaster Play! 4, USB Audio
  front:CARD=S4,DEV=0
       Sound Blaster Play! 4, USB Audio
  surround21:CARD=S4,DEV=0
       Sound Blaster Play! 4, USB Audio
  surround40:CARD=S4,DEV=0
       Sound Blaster Play! 4, USB Audio
  surround41:CARD=S4,DEV=0
       Sound Blaster Play! 4, USB Audio
  surround50:CARD=S4,DEV=0
       Sound Blaster Play! 4, USB Audio
  surround51:CARD=S4,DEV=0
       Sound Blaster Play! 4, USB Audio
  surround71:CARD=S4,DEV=0
       Sound Blaster Play! 4, USB Audio
  iec958:CARD=S4,DEV=0
       Sound Blaster Play! 4, USB Audio

Recommended for desktop usage:

  default      System default

However, when I start sendspin, it seems the device is not seen:

[michiel@sqz-badkamer ~]$ sendspin daemon --audio-device 'default:CARD=S4' --name Badkamer
INFO:sendspin.audio_devices:Using audio device default:CARD=S4: default:CARD=S4
WARNING:sendspin.cli:No volume control available for device 'default:CARD=S4' (no ALSA mixer controls and PulseAudio/PipeWire not reachable), falling back to software volume control
INFO:sendspin.audio:C volume extension unavailable; falling back to numpy (slower)
INFO:sendspin.daemon.daemon:Starting Sendspin daemon: sendspin-cli-sqz-badkamer
INFO:sendspin.daemon.daemon:Listening for server connections on port 8928 (mDNS: _sendspin._tcp.local.)
INFO:aiosendspin.client.listener:ClientListener started on port 8928, path /sendspin
INFO:aiosendspin.client.listener:mDNS advertising client 'sendspin-cli-sqz-badkamer' on port 8928 with path /sendspin
INFO:sendspin.daemon.daemon:Server connected
ERROR:aiosendspin.client.listener:Unhandled exception in on_connection callback for 192.168.11.11
Traceback (most recent call last):
  File "/usr/local/share/uv/tools/sendspin/lib/python3.14/site-packages/aiosendspin/client/listener.py", line 146, in _handle_websocket
    await self._on_connection(ws)
  File "/usr/local/share/uv/tools/sendspin/lib/python3.14/site-packages/sendspin/daemon/daemon.py", line 294, in _handle_server_connection
    client = self._create_client()
  File "/usr/local/share/uv/tools/sendspin/lib/python3.14/site-packages/sendspin/daemon/daemon.py", line 92, in _create_client
    supported_formats = detect_supported_audio_formats(self._args.audio_device)
  File "/usr/local/share/uv/tools/sendspin/lib/python3.14/site-packages/sendspin/audio_devices.py", line 121, in detect_supported_audio_formats
    supported_rates = [r for r in sample_rates if _check_format(device, r, 2, "int16")]
                                                  ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/share/uv/tools/sendspin/lib/python3.14/site-packages/sendspin/audio_devices.py", line 86, in _check_format
    sounddevice.check_output_settings(
    ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^
        device=device.device_id,
        ^^^^^^^^^^^^^^^^^^^^^^^^
    ...<2 lines>...
        dtype=dtype,
        ^^^^^^^^^^^^
    )
    ^
  File "/usr/local/share/uv/tools/sendspin/lib/python3.14/site-packages/sounddevice.py", line 704, in check_output_settings
    parameters, dtype, samplesize, samplerate = _get_stream_parameters(
                                                ~~~~~~~~~~~~~~~~~~~~~~^
        'output', device=device, channels=channels, dtype=dtype, latency=None,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
        extra_settings=extra_settings, samplerate=samplerate)
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/share/uv/tools/sendspin/lib/python3.14/site-packages/sounddevice.py", line 2734, in _get_stream_parameters
    device = _get_device_id(device, kind, raise_on_error=True)
  File "/usr/local/share/uv/tools/sendspin/lib/python3.14/site-packages/sounddevice.py", line 2900, in _get_device_id
    raise ValueError(
        'No ' + kind + ' device matching ' + repr(id_or_query_string))
ValueError: No output device matching 'default:CARD=S4'

Output from amixer:

[michiel@sqz-badkamer ~]$ amixer
Simple mixer control 'PCM',0
  Capabilities: pvolume pswitch pswitch-joined
  Playback channels: Front Left - Front Right
  Limits: Playback 0 - 175
  Mono:
  Front Left: Playback 175 [100%] [0.00dB] [on]
  Front Right: Playback 175 [100%] [0.00dB] [on]
Simple mixer control 'Mic',0
  Capabilities: cvolume cswitch cswitch-joined
  Capture channels: Front Left - Front Right
  Limits: Capture 0 - 74
  Front Left: Capture 74 [100%] [10.00dB] [on]
  Front Right: Capture 74 [100%] [10.00dB] [on]
[michiel@sqz-badkamer ~]$ sendspin --version
sendspin 7.3.0
Dominant language
Python
Stars
190
Forks
36
Avg merge
11d 19h
Merged PRs (30d)
2

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Sendspin/sendspin-python-cli

All issues in Sendspin/sendspin-python-cli

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.