[SOLVED] spotify connect: no sound(!), but otherwise looks OK; MPD works OK

Max2Play Home Forums Max2Play on Raspberry PI [SOLVED] spotify connect: no sound(!), but otherwise looks OK; MPD works OK

Viewing 8 posts - 1 through 8 (of 8 total)
  • 7. Oktober 2018 at 23:17 #38415

    After having been away from M2P for a while, I decided to try it again.

    After an evening of trying out, searching the forum, rebooting, trying, rebooting, it’s time to post here.

    Tried MPD first, on a random radio station. Result: sound!
    Activated my license, installed the spotify connect plugin. Result: all looks OK regarding spotify, except there’s no sound.

    Some more details:

    Version 2.47
    Raspberry PI B+
    License Activated
    HifiBerryDAC+ (B+/PI2/3)

    MPD not started by default; nothing else running that would block Spotify output (but if there’s a way to check & know for sure, please let me know).

    When starting MPD, I get sound when the following settings are present:
    Use USB-DAC: not checked
    Sound device: default – default,
    Also works when set to: sysdefault – snd_rpi_hifiberry_dacplus (CARD: sndrpihifiberry)
    Audioformat: 192000:24:2
    Mixer Device: hw:1
    Mixer Control: Digital

    DEBUG info of MPD (still contains lots of Failures, even though it works?!?):

    #### MPD Version ####
    Version: 0.19.21-1

    #### AUDIO-DEVICES (aplay -L) ####
    null
    Discard all samples (playback) or generate zero samples (capture)
    default
    equal
    plugequal
    Equalizer for plughw:0,0
    sysdefault:CARD=ALSA
    bcm2835 ALSA, bcm2835 ALSA
    Default Audio Device
    dmix:CARD=ALSA,DEV=0
    bcm2835 ALSA, bcm2835 ALSA
    Direct sample mixing device
    dmix:CARD=ALSA,DEV=1
    bcm2835 ALSA, bcm2835 IEC958/HDMI
    Direct sample mixing device
    dsnoop:CARD=ALSA,DEV=0
    bcm2835 ALSA, bcm2835 ALSA
    Direct sample snooping device
    dsnoop:CARD=ALSA,DEV=1
    bcm2835 ALSA, bcm2835 IEC958/HDMI
    Direct sample snooping device
    hw:CARD=ALSA,DEV=0
    bcm2835 ALSA, bcm2835 ALSA
    Direct hardware device without any conversions
    hw:CARD=ALSA,DEV=1
    bcm2835 ALSA, bcm2835 IEC958/HDMI
    Direct hardware device without any conversions
    plughw:CARD=ALSA,DEV=0
    bcm2835 ALSA, bcm2835 ALSA
    Hardware device with all software conversions
    plughw:CARD=ALSA,DEV=1
    bcm2835 ALSA, bcm2835 IEC958/HDMI
    Hardware device with all software conversions
    sysdefault:CARD=sndrpihifiberry
    snd_rpi_hifiberry_dacplus,
    Default Audio Device
    dmix:CARD=sndrpihifiberry,DEV=0
    snd_rpi_hifiberry_dacplus,
    Direct sample mixing device
    dsnoop:CARD=sndrpihifiberry,DEV=0
    snd_rpi_hifiberry_dacplus,
    Direct sample snooping device
    hw:CARD=sndrpihifiberry,DEV=0
    snd_rpi_hifiberry_dacplus,
    Direct hardware device without any conversions
    plughw:CARD=sndrpihifiberry,DEV=0
    snd_rpi_hifiberry_dacplus,
    Hardware device with all software conversions

    #### MPD-LOGFILE LAST 50 ENTRIES ####
    Oct 07 21:24 : output: Failed to open mixer for ‚Max2Play ALSA Device‘
    Oct 07 21:24 : player: played „http://current.stream.publicradio.org/kcmp.mp3“
    Oct 07 21:24 : output: Failed to open mixer for ‚Max2Play ALSA Device‘
    Oct 07 21:24 : player: played „http://current.stream.publicradio.org/kcmp.mp3“
    Oct 07 21:25 : player: played „http://current.stream.publicradio.org/kcmp.mp3“
    Oct 07 21:37 : client: [0] closed
    Oct 07 21:37 : client: [0] opened from 127.0.0.1:60054
    Oct 07 21:37 : avahi: Service ‚Music Player‘ successfully established.
    Oct 07 21:37 : alsa_mixer: Failed to read mixer for ‚Max2Play ALSA Device‘: no such mixer control: Digital
    Oct 07 21:37 : client: [0] closed
    Oct 07 22:27 : client: [0] opened from 127.0.0.1:60004
    Oct 07 22:27 : alsa_mixer: Failed to read mixer for ‚Max2Play ALSA Device‘: no such mixer control: Digital
    Oct 07 22:27 : avahi: Service ‚Music Player‘ successfully established.
    ALSA lib conf.c:4974:(snd_config_expand) Unknown parameters CARD=sndrpihifiberry
    ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM default:CARD=sndrpihifiberry
    Oct 07 22:28 : alsa_output: Failed to open „Max2Play ALSA Device“ [alsa]: Failed to open ALSA device „default:CARD=sndrpihifiberry“: Invalid argument
    Oct 07 22:28 : output: Failed to open audio output
    Oct 07 22:28 : player: problems opening audio device while playing „http://stream.popfm.dk:80/pop128“
    ALSA lib conf.c:4974:(snd_config_expand) Unknown parameters CARD=sndrpihifiberry
    ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM default:CARD=sndrpihifiberry
    Oct 07 22:28 : alsa_output: Failed to open „Max2Play ALSA Device“ [alsa]: Failed to open ALSA device „default:CARD=sndrpihifiberry“: Invalid argument
    Oct 07 22:28 : output: Failed to open audio output
    ALSA lib conf.c:4974:(snd_config_expand) Unknown parameters CARD=sndrpihifiberry
    ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM default:CARD=sndrpihifiberry
    Oct 07 22:28 : alsa_output: Failed to open „Max2Play ALSA Device“ [alsa]: Failed to open ALSA device „default:CARD=sndrpihifiberry“: Invalid argument
    Oct 07 22:28 : output: Failed to open audio output
    ALSA lib conf.c:4974:(snd_config_expand) Unknown parameters CARD=sndrpihifiberry
    ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM default:CARD=sndrpihifiberry
    Oct 07 22:28 : alsa_output: Failed to open „Max2Play ALSA Device“ [alsa]: Failed to open ALSA device „default:CARD=sndrpihifiberry“: Invalid argument
    Oct 07 22:28 : output: Failed to open audio output
    ALSA lib conf.c:4974:(snd_config_expand) Unknown parameters CARD=sndrpihifiberry
    ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM default:CARD=sndrpihifiberry
    Oct 07 22:29 : alsa_output: Failed to open „Max2Play ALSA Device“ [alsa]: Failed to open ALSA device „default:CARD=sndrpihifiberry“: Invalid argument
    Oct 07 22:29 : output: Failed to open audio output
    ALSA lib conf.c:4974:(snd_config_expand) Unknown parameters CARD=sndrpihifiberry
    ALSA lib pcm.c:2495:(snd_pcm_open_noupdate) Unknown PCM default:CARD=sndrpihifiberry
    Oct 07 22:29 : alsa_output: Failed to open „Max2Play ALSA Device“ [alsa]: Failed to open ALSA device „default:CARD=sndrpihifiberry“: Invalid argument
    Oct 07 22:29 : output: Failed to open audio output
    Oct 07 22:30 : client: [0] closed
    Oct 07 22:30 : player: played „http://stream.popfm.dk:80/pop128“
    Oct 07 22:31 : client: [0] opened from 127.0.0.1:60022
    Oct 07 22:31 : avahi: Service ‚Music Player‘ successfully established.
    Oct 07 22:31 : alsa_mixer: Failed to read mixer for ‚Max2Play ALSA Device‘: no such mixer control: Digital
    Oct 07 22:32 : output: Failed to open mixer for ‚Max2Play ALSA Device‘
    Oct 07 22:32 : player: played „http://stream.popfm.dk:80/pop128“
    Oct 07 22:33 : output: Failed to open mixer for ‚Max2Play ALSA Device‘
    Oct 07 22:33 : player: played „http://stream.popfm.dk:80/pop128“
    Oct 07 22:34 : client: [0] closed
    Oct 07 22:58 : client: [0] opened from 127.0.0.1:34042
    Oct 07 22:58 : avahi: Service ‚Music Player‘ successfully established.

    Then, I stop MPD and move on to spotify connect…
    Using spotify on my phone, I can connect to max2play, I can start music, but I don’t hear anything on the max2play.

    Settings on spotify connect:
    Output Device: hw:sndrpihifiberry
    (Other possible choice ALSA, but also that does not give any sound)
    Mixer Control: empty
    (if I fill in Digital, restart of spotify is not successful; DEBUG logging doesn’t show why).
    Command Line Options: empty
    Spotify/Squeezelite automatic Audio-Switch: empty or IP. Although I don’t have squeezelite running, I’ve tried both empty and with the IP address of my m2p raspberry. No difference, still no sound.

    DEBUG output of spotify connect:

    #### Librespot Output ####
    INFO:librespot: librespot 431be9e (2018-05-18). Built on 2018-05-30. Build ID: YlMJ8i49
    INFO:librespot_core::session: Connecting to AP „gew1-accesspoint-b-v8h5.ap.spotify.com:4070“
    INFO:librespot_core::session: Authenticated as „……“ !
    INFO:librespot_core::session: Country: „..“
    INFO:librespot_playback::audio_backend::alsa: Using alsa sink
    INFO:librespot_playback::player: Loading track „Ritual #1“ with Spotify URI „spotify:track:4ISKJMXY0THrHAnZE4dgCV“
    INFO:librespot_playback::player: Track „Ritual #1“ loaded
    INFO:librespot::player_event_handler: Running [„/opt/spotifyconnect/onevent_switch.sh“] with environment variables {„TRACK_ID“: „9b36947fe0c547aca8de6b2ba3757145“, „PLAYER_EVENT“: „stop“}
    Use Interface wlan0 with 7c:dd:90:a4:ee:74

    INFO:librespot::player_event_handler: Running [„/opt/spotifyconnect/onevent_switch.sh“] with environment variables {„PLAYER_EVENT“: „start“, „TRACK_ID“: „9b36947fe0c547aca8de6b2ba3757145“}
    INFO:librespot::player_event_handler: Running [„/opt/spotifyconnect/onevent_switch.sh“] with environment variables {„TRACK_ID“: „9b36947fe0c547aca8de6b2ba3757145“, „PLAYER_EVENT“: „stop“}
    Use Interface wlan0 with 7c:dd:90:a4:ee:74

    Use Interface wlan0 with 7c:dd:90:a4:ee:74

    INFO:librespot::player_event_handler: Running [„/opt/spotifyconnect/onevent_switch.sh“] with environment variables {„PLAYER_EVENT“: „stop“, „TRACK_ID“: „9b36947fe0c547aca8de6b2ba3757145“}
    Use Interface wlan0 with 7c:dd:90:a4:ee:74

    #### Librespot Command Line Options ####
    error: Required option ’name‘ missing
    Usage: /opt/spotifyconnect/librespot [options]

    Options:
    -c, –cache CACHE Path to a directory where files will be cached.
    –disable-audio-cache
    Disable caching of the audio data.
    -n, –name NAME Device name
    –device-type DEVICE_TYPE
    Displayed device type
    -b, –bitrate BITRATE
    Bitrate (96, 160 or 320). Defaults to 160
    –onevent PROGRAM
    Run PROGRAM when playback is about to begin.
    -v, –verbose Enable verbose output
    -u, –username USERNAME
    Username to sign in with
    -p, –password PASSWORD
    Password
    –proxy PROXY HTTP proxy to use when connecting
    –disable-discovery
    Disable discovery mode
    –backend BACKEND
    Audio backend to use. Use ‚?‘ to list options
    –device DEVICE Audio device to use. Use ‚?‘ to list options if using
    portaudio
    –mixer MIXER Mixer to use
    –initial-volume VOLUME
    Initial volume in %, once connected (must be from 0 to
    100)
    –zeroconf-port ZEROCONF_PORT
    The port the internal server advertised over zeroconf
    uses.
    –enable-volume-normalisation
    Play all tracks at the same volume
    –normalisation-pregain PREGAIN
    Pregain (dB) applied by volume normalisation
    –linear-volume
    increase volume linear instead of logarithmic.

    Again, nothing strange, nothing useful, as far as I can see.
    But alas, no sound…

    Some more output/settings:

    pi@max2play:~ $ aplay -l
    **** List of PLAYBACK Hardware Devices ****
    card 0: ALSA [bcm2835 ALSA], device 0: bcm2835 ALSA [bcm2835 ALSA]
    Subdevices: 7/7
    Subdevice #0: subdevice #0
    Subdevice #1: subdevice #1
    Subdevice #2: subdevice #2
    Subdevice #3: subdevice #3
    Subdevice #4: subdevice #4
    Subdevice #5: subdevice #5
    Subdevice #6: subdevice #6
    card 0: ALSA [bcm2835 ALSA], device 1: bcm2835 ALSA [bcm2835 IEC958/HDMI]
    Subdevices: 1/1
    Subdevice #0: subdevice #0
    card 1: sndrpihifiberry [snd_rpi_hifiberry_dacplus], device 0: HiFiBerry DAC+ HiFi pcm512x-hifi-0 []
    Subdevices: 1/1
    Subdevice #0: subdevice #0

    And

    pi@max2play:~ $ cat /etc/asound.conf
    pcm.!default {
    type hw card 1
    }
    ctl.!default {
    type hw
    card 0
    }
    pcm.equal {
    type plug;
    slave.pcm plugequal;
    }
    ctl.equal {
    type equal;
    module „Eq10“;
    }

    pcm.plugequal {
    type equal;
    module „Eq10“;
    slave {
    pcm „plughw:0,0“;
    }
    hint {show on;description „Equalizer for plughw:0,0“}
    }

    First section was not present initially, tried without and later with these extra lines at top:

    pcm.!default {
    type hw card 1
    }

    What could be the problem here? And what other logging or settings do you want me to share to get to the bottom of this?

    8. Oktober 2018 at 12:44 #38432

    Hi kraker,

    Please check the Raspberry Settings and see build-in audio is deactivated. If so, add „hw:0“ to the command line options and save, reboot and try again.

    8. Oktober 2018 at 13:02 #38434

    Hello Heiner,

    Thanks for the response. Unfortunately, still no sound after trying that.

    /opt/spotifyconnect/librespot –name max2play –disable-discovery –cache /tmp –bitrate 320 –username *** –password *** –device hw:sndrpihifiberry hw:0 –onevent /opt/spotifyconnect/onevent_switch.sh

    This results in two hw: devices in the command line, by the way, which may not be what you had in mind?

    Any other thoughts on this?

    8. Oktober 2018 at 13:43 #38439

    Somehow, the automatic player switch seems to be triggered. Do you have a value in this field on Spotify Connect?

    Also, please check all audio players and remove autostarts where they are active.

    8. Oktober 2018 at 14:06 #38440

    Okay, removed the automatic player switch, rechecked that no other audio player is running.
    I was about to say: still no sound, when I noticed, far away in the distance, some sound. Turned up the volume, and yes, spotify IS playing (and may have been playing from the beginning), only the volume is absurdly low.

    So now the question becomes, why is that, and how can that be fixed? Again, if I try MPD, volume 12 on my receiver is already louder than I would normally play it. For Spotify, I can crank it up to about 50 to get to that same level.

    8. Oktober 2018 at 14:11 #38443

    Copy and paste the mixer device selection from mpd to your Spotify Connect, save and reboot.

    Please copy the debug from Spotify Connect again if the problem persists.

    8. Oktober 2018 at 14:27 #38446

    Found it, while looking at the DEBUG output, I noticed the –initial-volume option for librespot.
    Added --initial-volume 100 to the Command Line Options, didn’t turn back the volume on the receiver and was blown off my chair 😉

    Yes, it works now. Even after reboot, even after removing hw:1 from the command line options. All that was needed was the --initial-volume option. Case closed 🙂

    Update: fwiw, –initial-volume 90 brings it more in line with the DAB volume, but that’s fine-tuning.

    • This reply was modified 6 years, 1 month ago by kraker.
    8. Oktober 2018 at 15:11 #38458

    Hi kraker,

    Thanks for the quick follow-up! 🙂

Viewing 8 posts - 1 through 8 (of 8 total)

You must be logged in to reply to this topic.

Register here