Sendspin on Pi doesnt allow fixed usb hardware name, relies on USB number

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

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Bug
Clarity
Needs clarification
Activity status
Stale
Tech stack
linux, python, raspberry-pi

Research direction

Start by tracing how the sendspin daemon handles --audio-device and compare that with the device names shown by aplay -l. Reproduce the service configuration using /etc/asound.conf and the sendspin.service override, including a USB device reorder. Done means the named USB audio device remains usable after reordering and the service starts successfully.

Written by the indexing model from the issue text.

Description

I have a soundblade installed via usb to Pi P400, its currently usb device 3.

I have the following configuration in /etc/asound.conf as the soundblade only accepts 48khz:

pcm.upsampler {
    type plug
    slave.pcm "softvol"
    # The 'plug' plugin is the only one that understands the 'rate' field
    slave.rate 48000
}

pcm.softvol {
    type softvol
    slave {
        pcm "hw:3,0"
    }
    control {
        name "Master"
        card 3
    }
}

pcm.!default {
    type copy
    slave.pcm "upsampler"
}

In sudo systemctl edit sendspin.service

[Service]
User=sendspin
Group=audio

ExecStart=
ExecStart=/home/sendspin/.local/bin/sendspin daemon --audio-device=upsampler
Restart=on-failure
RestartSec=5

# No ExecStartPost - no timeout issues
ExecStopPost=/usr/bin/pkill -u sendspin sendspin

While this works, its not robust enough to survive a new USB device inserted, using the name of the device in aplay -l , causes an error and the service doesnt load.

Aplay -l ouput:

card 3: SOUNDBLADE [BLUEANT SOUNDBLADE], device 0: USB Audio [USB Audio]
  Subdevices: 0/1
  Subdevice #0: subdevice #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.