mikebrady / sps-alsa-explore

A tool to scan ALSA devices for use by Shairport Sync.
GNU General Public License v2.0
11 stars 0 forks source link

Information: Output of sps-alsa-explore on RPI3b/bullseye/HifiBerry DAC+ #1

Closed th0u closed 2 years ago

th0u commented 2 years ago

Just for your information, this is the output on my RPI

Linux traspberry 5.10.63-v7+ #1488 SMP Thu Nov 18 16:14:44 GMT 2021 armv7l GNU/Linux

# aplay -L
null
    Discard all samples (playback) or generate zero samples (capture)
default
hw:CARD=sndrpihifiberry,DEV=0
    snd_rpi_hifiberry_dacplus, HiFiBerry DAC+ HiFi pcm512x-hifi-0
    Direct hardware device without any conversions
plughw:CARD=sndrpihifiberry,DEV=0
    snd_rpi_hifiberry_dacplus, HiFiBerry DAC+ HiFi pcm512x-hifi-0
    Hardware device with all software conversions
sysdefault:CARD=sndrpihifiberry
    snd_rpi_hifiberry_dacplus, HiFiBerry DAC+ HiFi pcm512x-hifi-0
    Default Audio Device
dmix:CARD=sndrpihifiberry,DEV=0
    snd_rpi_hifiberry_dacplus, HiFiBerry DAC+ HiFi pcm512x-hifi-0
    Direct sample mixing device
#

excerpt of

#alsa-info 
!!Loaded ALSA modules
!!-------------------

snd_soc_hifiberry_dacplus

!!Sound Servers on this system
!!----------------------------

No sound servers found.

!!Soundcards recognised by ALSA
!!-----------------------------

 0 [sndrpihifiberry]: HifiberryDacp - snd_rpi_hifiberry_dacplus
                      snd_rpi_hifiberry_dacplus

...
# 

$ ./sps-alsa-explore -V
Version: 1.1-25-g6875b64
$  ./sps-alsa-explore -vvv
         0.000009322 "sps-alsa-explore.c:564" startup.
         0.002526498 "sps-alsa-explore.c:366" no soundcards found...
$
mikebrady commented 2 years ago

Thanks a lot for testing this tool out. My guess is that the user is not a member of the audio group, which is needed for access to the alsa subsystem.

You can check membership of the audio group using:

$ getent group audio

This is how things are on my Pi:

audio:x:29:pi,shairport-sync

If the username is not included, then a program run by that user will not have access to the alsa subsystem. A quick check, if possible, is to run the tool as root, which has access to everything. For example, using sudo:

$ sudo ./sps-alsa-explore

Perhaps I should modify the program to give a warning of some kind...

mikebrady commented 2 years ago

Actually, I just added a warning.

th0u commented 2 years ago

Ok, now I get results (also as user after adding the user to group audio):

$ sudo ./sps-alsa-explore
> Device:              "hw:sndrpihifiberry"
  Short Name:          "hw:0"
  This device seems suitable for use with Shairport Sync.
  Possible mixers:     "Analogue"
                       "Digital"
                       "Analogue Playback Boost"
  Suggested rate and format:
     Rate              Format
     44100             S32_LE
mikebrady commented 2 years ago

Thanks -- that's the kind of thing that I expected.

Unfortunately, there is no logical way I can think of to tell which of the possible mixers is the correct one to recommend.

If you add the argument -e you will get a little more information.

I've added a warning about the audio group, and I might add some code to check that kind of information out.

th0u commented 2 years ago

Thnx for the insights. Regarding the correct mixer, HifiBerry has a documentation on this https://www.hifiberry.com/docs/archive/mixer-controls-on-the-hifiberry-boards/ , which one to use w/o any further details.

mikebrady commented 2 years ago

Thanks for the link. There seems to be a misprint in it, as it refers to Digital as the correct mixer to use, but then gives the example of PCM 🤔.