Home of the Squeezebox™ & Transporter® network music players.
Page 1 of 2 12 LastLast
Results 1 to 10 of 18
  1. #1
    Junior Member
    Join Date
    Sep 2021
    Posts
    9

    Squeezelite with USB DAC plays max at 48k

    Hello.

    I need help troubleshooting squeezelite on a Raspberry Pi 4 with an Emotiva PT-100 USB DAC. It plays music up to 48k without resampling but anything over, like 96k, gets down-sampled to 48k. Below is a breakdown of what I've done to troubleshoot so far. I just can't seem to get it to work right.

    1. Tried using picoreplayer and selecting the USB DAC. Plays music but resamples over 48k
    2. Tried using Raspbian. Plays music but resamples over 48k.
    3. Tried using Ubuntu server. Plays music but resamples over 48k.
      - Pulseaudio is not installed.
      - Stopping squeezelite and running
      Code:
      for rate in 44100 48000 88200 96000; do speaker-test --rate $rate --period 1 --nloop 4; done
      - The DAC shows correct bit rates. So that tells me the DAC has no issue playing sound with those bit rates.
      - Here are my options for playback
      Code:
      ubuntu@ubuntu:~$ squeezelite -l
      Output devices:
        null                           - Discard all samples (playback) or generate zero samples (capture)
        sysdefault                     - Default Audio Device
        default
        hw:CARD=Headphones,DEV=0       - bcm2835 Headphones, bcm2835 Headphones - Direct hardware device without any conversions
        plughw:CARD=Headphones,DEV=0   - bcm2835 Headphones, bcm2835 Headphones - Hardware device with all software conversions
        sysdefault:CARD=Headphones     - bcm2835 Headphones, bcm2835 Headphones - Default Audio Device
        dmix:CARD=Headphones,DEV=0     - bcm2835 Headphones, bcm2835 Headphones - Direct sample mixing device
        hw:CARD=PT100,DEV=0            - Emotiva PT-100, USB Audio - Direct hardware device without any conversions
        hw:CARD=PT100,DEV=1            - Emotiva PT-100, USB Audio #1 - Direct hardware device without any conversions
        plughw:CARD=PT100,DEV=0        - Emotiva PT-100, USB Audio - Hardware device with all software conversions
        plughw:CARD=PT100,DEV=1        - Emotiva PT-100, USB Audio #1 - Hardware device with all software conversions
        sysdefault:CARD=PT100          - Emotiva PT-100, USB Audio - Default Audio Device
        front:CARD=PT100,DEV=0         - Emotiva PT-100, USB Audio - Front output / input
        surround21:CARD=PT100,DEV=0    - Emotiva PT-100, USB Audio - 2.1 Surround output to Front and Subwoofer speakers
        surround40:CARD=PT100,DEV=0    - Emotiva PT-100, USB Audio - 4.0 Surround output to Front and Rear speakers
        surround41:CARD=PT100,DEV=0    - Emotiva PT-100, USB Audio - 4.1 Surround output to Front, Rear and Subwoofer speakers
        surround50:CARD=PT100,DEV=0    - Emotiva PT-100, USB Audio - 5.0 Surround output to Front, Center and Rear speakers
        surround51:CARD=PT100,DEV=0    - Emotiva PT-100, USB Audio - 5.1 Surround output to Front, Center, Rear and Subwoofer speakers
        surround71:CARD=PT100,DEV=0    - Emotiva PT-100, USB Audio - 7.1 Surround output to Front, Center, Side, Rear and Woofer speakers
        iec958:CARD=PT100,DEV=0        - Emotiva PT-100, USB Audio - IEC958 (S/PDIF) Digital Audio Output
        iec958:CARD=PT100,DEV=1        - Emotiva PT-100, USB Audio #1 - IEC958 (S/PDIF) Digital Audio Output
        dmix:CARD=PT100,DEV=0          - Emotiva PT-100, USB Audio - Direct sample mixing device
        dmix:CARD=PT100,DEV=1          - Emotiva PT-100, USB Audio #1 - Direct sample mixing device
        dsnoop:CARD=PT100,DEV=0        - Emotiva PT-100, USB Audio - Direct sample snooping device
      - Here is my /etc/default/squeezelite configuration file
      Code:
      # Defaults for squeezelite initscript
      # sourced by /etc/init.d/squeezelite
      # installed at /etc/default/squeezelite by the maintainer scripts
      
      # The name for the squeezelite player:
      SL_NAME="$(hostname -s)"
      
      # ALSA output device:
      SL_SOUNDCARD="hw:CARD=PT100,DEV=1"
      
      # Squeezebox server (Logitech Media Server):
      # Uncomment the next line if you want to point squeezelite at the IP address of
      # your squeezebox server. This is usually unnecessary as the server is
      # automatically discovered.
      #SB_SERVER_IP="192.168.x.y"
      
      # Additional options to pass to squeezelite:
      # Please do not include -z to make squeezelite daemonise itself.
      SB_EXTRA_ARGS="-a 180"
      - Here is my /etc/asound.conf configuration file. I was looking into this possibly being an issue with DMIX but this didn't help.
      Code:
      pcm.default_device {
        type hw
        card "PT100"
        device 0
      }
      
      pcm.!default {
        type plug
        slave {
          pcm "default_device"
        }
      }
      
      ctl.!default {
        type hw
        card "PT100"
      }
      - I tried changing two properties in /usr/share/alsa/alsa.conf
      Code:
      defaults.ctl.card 0
      defaults.pcm.card 0
      to
      Code:
      defaults.ctl.card 1
      defaults.pcm.card 1
      - No luck

  2. #2
    Senior Member
    Join Date
    Oct 2005
    Location
    Ireland
    Posts
    21,020
    what is the output of alsa-capabilities for the devices which use for squeezlite output ?
    What data rates are shown ?

  3. #3
    Junior Member
    Join Date
    Sep 2021
    Posts
    9
    Here is the output of alsa-capabilities
    Code:
    ubuntu@ubuntu:~/mpd-configure$ ./alsa-capabilities
     1) Analog alsa audio output interface `hw:0,0'
     - device name       = Headphones
     - interface name    = bcm2835 Headphones
     - usb audio class   = (n/a)
     - character device  = /dev/snd/pcmC0D0p
     - encoding formats  = U8, S16_LE
     - monitor file      = /proc/asound/card0/pcm0p/sub0/hw_params
     - stream file       = (n/a)
    
     2) USB Audio Class Digital alsa audio output interface `hw:1,0'
     - device name       = PT100
     - interface name    = USB Audio
     - usb audio class   = (n/a)
     - character device  = /dev/snd/pcmC1D0p
     - encoding formats  = S16_LE, S24_3LE
     - monitor file      = /proc/asound/card1/pcm0p/sub0/hw_params
     - stream file       = /proc/asound/card1/stream0
    
     3) USB Audio Class Digital alsa audio output interface `hw:1,1'
     - device name       = PT100
     - interface name    = USB Audio
     - usb audio class   = (n/a)
     - character device  = /dev/snd/pcmC1D1p
     - encoding formats  = S16_LE
     - monitor file      = /proc/asound/card1/pcm1p/sub0/hw_params
     - stream file       = /proc/asound/card1/stream1
    Here is the output of asla-capabilities with the -s flag
    Code:
     1) Analog alsa audio output interface `hw:0,0'
     - device name       = Headphones
     - interface name    = bcm2835 Headphones
     - usb audio class   = (n/a)
     - character device  = /dev/snd/pcmC0D0p
     - samplerates (Hz)  = U8:44100,48000,88200,96000,176400,192000,352800,384000
                           S16_LE:44100,48000,88200,96000,176400,192000,352800,384000
     - monitor file      = /proc/asound/card0/pcm0p/sub0/hw_params
     - stream file       = (n/a)
    
     2) USB Audio Class Digital alsa audio output interface `hw:1,0'
     - device name       = PT100
     - interface name    = USB Audio
     - usb audio class   = (n/a)
     - character device  = /dev/snd/pcmC1D0p
     - samplerates (Hz)  = S16_LE:96000,88200,48000,44100,32000
                           S24_3LE:96000,88200,48000,44100,32000
     - monitor file      = /proc/asound/card1/pcm0p/sub0/hw_params
     - stream file       = /proc/asound/card1/stream0
    
     3) USB Audio Class Digital alsa audio output interface `hw:1,1'
     - device name       = PT100
     - interface name    = USB Audio
     - usb audio class   = (n/a)
     - character device  = /dev/snd/pcmC1D1p
     - samplerates (Hz)  = S16_LE:48000,44100
     - monitor file      = /proc/asound/card1/pcm1p/sub0/hw_params
     - stream file       = /proc/asound/card1/stream1

  4. #4
    Junior Member
    Join Date
    Sep 2021
    Posts
    9
    After reviewing the output bpa requested I changed /etc/default/squeezelite to:
    Code:
    # Defaults for squeezelite initscript
    # sourced by /etc/init.d/squeezelite
    # installed at /etc/default/squeezelite by the maintainer scripts
    
    # The name for the squeezelite player:
    SL_NAME="$(hostname -s)"
    
    # ALSA output device:
    SL_SOUNDCARD="plughw:CARD=PT100,DEV=0"
    
    # Squeezebox server (Logitech Media Server):
    # Uncomment the next line if you want to point squeezelite at the IP address of
    # your squeezebox server. This is usually unnecessary as the server is
    # automatically discovered.
    #SB_SERVER_IP="192.168.x.y"
    
    # Additional options to pass to squeezelite:
    # Please do not include -z to make squeezelite daemonise itself.
    SB_EXTRA_ARGS="-d all=debug -f /home/ubuntu/logfile.txt"
    So that squeezelite would use plughw:CARD=PT100,DEV=0 since that showed more capabilities than plughw:CARD=PT100,DEV=1. No sound works when using plughw:CARD=PT100,DEV=0 though and nothing appears on the DAC screen. Looking at the debug file I see:
    Code:
    [19:44:08.696429] stream_init:448 init stream
    [19:44:08.696601] stream_init:449 streambuf size: 2097152
    [19:44:08.707691] output_init_alsa:940 init output
    [19:44:08.707789] output_init_alsa:979 requested alsa_buffer: 40 alsa_period: 4 format: any mmap: 1
    [19:44:08.707846] output_init_common:353 outputbuf size: 3528000
    [19:44:08.708034] output_init_common:377 idle timeout: 0
    [19:44:08.712535] output_init_common:425 supported rates: 768000 705600 384000 352800 192000 176400 96000 88200 48000 44100 32000 24000 22500 16000 12000 11025 8000
    [19:44:09.061822] output_init_alsa:1006 memory locked
    [19:44:09.061944] output_init_alsa:1012 glibc detected using mallopt
    [19:44:09.062636] output_init_alsa:1032 set output sched fifo rt: 45
    [19:44:09.062647] output_thread:687 open output device: plughw:CARD=PT100,DEV=0
    [19:44:09.062680] decode_init:153 init decode
    [19:44:09.063853] alsa_open:351 opening device at: 44100
    [19:44:09.063910] register_dsd:908 using dsd to decode dsf,dff
    [19:44:09.063974] register_ff:797 using ffmpeg to decode alc
    [19:44:09.064002] register_ff:781 using ffmpeg to decode wma,wmap
    [19:44:09.064028] register_faad:663 using faad to decode aac
    [19:44:09.064054] register_vorbis:380 using vorbis to decode ogg
    [19:44:09.064079] register_flac:332 using flac to decode ogf,flc
    [19:44:09.064106] register_pcm:483 using pcm to decode aif,pcm
    [19:44:09.064139] register_mad:423 using mad to decode mp3
    [19:44:09.064164] decode_init:194 include codecs:  exclude codecs:
    [19:44:09.065199] discover_server:794 sending discovery
    [19:44:09.065636] alsa_open:422 opened device plughw:CARD=PT100,DEV=0 using format: S32_LE sample rate: 44100 mmap: 1
    [19:44:09.065963] alsa_open:513 buffer: 40 period: 4 -> buffer size: 1764 period size: 441
    [19:44:09.066153] discover_server:805 got response from: 192.168.x.y:3483
    [19:44:09.074723] ALSA snd_pcm_hw_hw_params:386 SNDRV_PCM_IOCTL_HW_PARAMS failed (-28)
    [19:44:09.074788] alsa_open:530 unable to set hw params: No space left on device
    So I'm still stuck but maybe the error "ALSA snd_pcm_hw_hw_params:386 SNDRV_PCM_IOCTL_HW_PARAMS failed (-28)" will resonate with someone here?

  5. #5
    Senior Member
    Join Date
    Oct 2005
    Location
    Ireland
    Posts
    21,020
    Quote Originally Posted by hafnpin View Post
    So I'm still stuck but maybe the error "ALSA snd_pcm_hw_hw_params:386 SNDRV_PCM_IOCTL_HW_PARAMS failed (-28)" will resonate with someone here?
    plughw - uses software to provide greater capabilities.
    The raw capabiltiies of your DAC as seen by ALSA is show by alsa-capabilities with a "hw:" notation.

    Is this audio device already in use by an application such as a browser ?
    sysdefault is the DAC you want to use. Ideally you should move sysdefault away from your dac.

    I'm not sure about permissions/groups etc in raspbian - has the user which is running squeezelite got permission to access the alsa device. Is there an audoi group the user shpoudl be a member of ?

    What version of raspbian ? IIRC Newer version has Pulseaudio installed by default ?

  6. #6
    Senior Member
    Join Date
    Jan 2011
    Location
    Staffordshire. UK
    Posts
    4,833
    @hafnpin

    I found this for your dac

    Digital Inputs:

    1 ľ digital coax (S/PDIF); 24/192k
    1 ľ digital optical (Toslink); 24/192k
    1 ľ digital USB (DAC input); 24/96k; no drivers required
    so usb is limited anyway

    I also found this

    https://www.linuxquestions.org/quest...0/#post3958054

    which would suggest you leave
    Code:
    SB_EXTRA_ARGS="-a 180"
    at a default setting, ie blank, or at least at -a 80 (I would try blank first)

    As bpa has remarked, which Raspberry pi OS and Squeezelite version are you using ?

    ronnie

  7. #7
    Junior Member
    Join Date
    Sep 2021
    Posts
    9
    @bpa

    This device isn't used by anything else. I verified that by running "sudo lsof /dev/snd/*" before starting squeezelite and nothing shows. Running that command after starting squeezelite I see squeezelite using audio. I tried using sysdefault and get a log message that says "output_init_common:394 unable to open output device: sysdefault".

    I'm running squeezelite as root and even added root to the audio group to no avail.

    I switched away from Raspbian to Ubuntu server since Pulseaudio isn't installed in Ubuntu server by default. The version is:
    Code:
    Linux ubuntu 5.13.0-1011-raspi #13-Ubuntu SMP PREEMPT Fri Nov 19 18:41:59 UTC 2021 armv7l armv7l armv7l GNU/Linux
    @ronnie

    I put "-a 180" back into my SB_EXTRA_ARGS. I'm running Squeezelite v1.9.8-1317. Installed it with "apt install squeezelite"

  8. #8
    Senior Member
    Join Date
    Jan 2011
    Location
    Staffordshire. UK
    Posts
    4,833
    @ hafnpin

    I played with Ubuntu for raspberry pi earlier in the year, are you running headless?

    It does not have a great deal of support. I thought PulseAudio is a default install in Ubuntu and in Raspberry Pi OS since Dec 2020

    I also never install Squeezelite (or LMS, for that matter) directly as root.

    I use ronnie as user and preface the commandline with sudo. I'm not sure, but I think there is a subtle difference (?)

    I also tend to leave SB_EXTRA_ARGS= mostly blank, for stuff like -C or sometimes to change the mmap -a :::1 or :::0

    I would try

    hw:CARD=PT100,DEV=0

    atb

    ronnie

  9. #9
    Senior Member
    Join Date
    Apr 2005
    Location
    UK/London
    Posts
    5,099
    Have you checked that this message is not important?
    Code:
    [19:44:09.074788] alsa_open:530 unable to set hw params: No space left on device
    Has the filesystem run out of free space?
    Paul Webster
    Author of "Now Playing" plugins covering Radio France (FIP etc), PlanetRadio (Bauer - Kiss, Absolute, Scala, JazzFM etc), KCRW, ABC Australia and CBC/Radio-Canada
    and, via the extra "Radio Now Playing" plugin lots more - see https://forums.slimdevices.com/showt...Playing-plugin

  10. #10
    Senior Member
    Join Date
    Oct 2005
    Location
    Ireland
    Posts
    21,020
    Quote Originally Posted by Paul Webster View Post
    Have you checked that this message is not important?
    Code:
    [19:44:09.074788] alsa_open:530 unable to set hw params: No space left on device
    Has the filesystem run out of free space?
    The preceding Errno -28 is the same error "out of space"

    Squeezelite 1.9.8-1317 is about 1 year old. You could update to newer version justin case there is some odd bug.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •