SpotifyConnect - Fresh install playback broken

Hi all,

I’m receiving an invalid card number error on a completely fresh install on my Tinkerboard. This is preventing my Spotify Connect plugin from working correctly. I already checked with the authors of the plugin and they indicated it’s a Volumio issue (as evidenced by the Invalid Card Number error). My setup is very simple, it’s just line-out, no USB anything connected, no special hardware, nothing. I’ve had this issue since April, which is why the log is from April. I’ve tried updating Volumio to any new versions since, including trying fresh installs again but nothing has worked.

logs.volumio.org/volumio/9ZcEFm5.html

Apr 15 21:47:02 volumio volumio[1391]: Invalid card number.
Apr 15 21:47:02 volumio volumio[1391]: Invalid card number.
Apr 15 21:47:04 volumio volumio[1391]: Invalid card number.

Is there any possible way to fix this? Since I did a complete reinstall I can’t imagine how I could fix this myself.

Would really appreciate help with this issue :frowning:

I don’t seem to see anything in your logs concerning issues with Spotify Connect. Are you sure everything else works fine (with volspotconnect2 uninstalled)?

Sorry for the delay, Ash.

I just checked and playback works normally using the Web Radio (I don’t have any music at all installed locally) while the plugin is uninstalled. I reinstalled the plugin today and here is the log output you requested after running the command below. Definitely looks like something is going wrong as the service is restarting itself after entering a failed state.

sudo journalctl -u volspotconnect2.service

pastebin.com/hWGcUyh4

Here is the accompanying system log:

logs.volumio.org/volumio/QXyQRje.html

From my PC side, I hit “Volumio” in Spotify and it just hangs on Connecting.

Any thoughts?

Sep 21 15:51:16 volumio volumio[1229]: Invalid card number. Sep 21 15:51:17 volumio kernel: rk3x-i2c ff140000.i2c: timeout, ipd: 0x00, state: 1 Sep 21 15:51:17 volumio volumio[1229]: Invalid card number. Sep 21 15:51:17 volumio volumio[992]: info: CoreCommandRouter::volumioGetQueue Sep 21 15:51:17 volumio volumio[992]: info: CoreStateMachine::getQueue Sep 21 15:51:17 volumio volumio[992]: info: CorePlayQueue::getQueue Sep 21 15:51:17 volumio volumio[992]: info: No input data Sep 21 15:51:17 volumio volumio[992]: info: No input data Sep 21 15:51:17 volumio volumio[992]: info: No input data Sep 21 15:51:17 volumio volumio[992]: info: No input data Sep 21 15:51:17 volumio volumio[992]: info: No input data Sep 21 15:51:17 volumio volumio[992]: info: No input data Sep 21 15:51:17 volumio volumio[992]: info: No input data Sep 21 15:51:17 volumio volumio[992]: info: No input data Sep 21 15:51:17 volumio volumio[992]: info: No input data Sep 21 15:51:18 volumio kernel: rk3x-i2c ff140000.i2c: timeout, ipd: 0x00, state: 1 Sep 21 15:51:18 volumio volumio[1229]: Invalid card number. Sep 21 15:51:19 volumio kernel: rk3x-i2c ff140000.i2c: timeout, ipd: 0x00, state: 1 Sep 21 15:51:19 volumio volumio[1229]: Invalid card number. Sep 21 15:51:20 volumio kernel: rk3x-i2c ff140000.i2c: timeout, ipd: 0x00, state: 1 Sep 21 15:51:20 volumio volumio[1229]: Invalid card number. Sep 21 15:51:21 volumio kernel: rk3x-i2c ff140000.i2c: timeout, ipd: 0x00, state: 1 Sep 21 15:51:21 volumio volumio[1229]: Invalid card number. Sep 21 15:51:22 volumio kernel: rk3x-i2c ff140000.i2c: timeout, ipd: 0x00, state: 1 Sep 21 15:51:22 volumio volumio[1229]: Invalid card number. Sep 21 15:51:23 volumio kernel: rk3x-i2c ff140000.i2c: timeout, ipd: 0x00, state: 1 Sep 21 15:51:23 volumio volumio[1229]: Invalid card number. Sep 21 15:51:24 volumio kernel: rk3x-i2c ff140000.i2c: timeout, ipd: 0x00, state: 1 Sep 21 15:51:24 volumio volumio[1229]: Invalid card number. Sep 21 15:51:25 volumio kernel: rk3x-i2c ff140000.i2c: timeout, ipd: 0x00, state: 1 Sep 21 15:51:25 volumio volumio[1229]: Invalid card number. Sep 21 15:51:26 volumio kernel: rk3x-i2c ff140000.i2c: timeout, ipd: 0x00, state: 1 Sep 21 15:51:26 volumio volumio[1229]: Invalid card number. Sep 21 15:51:27 volumio kernel: rk3x-i2c ff140000.i2c: timeout, ipd: 0x00, state: 1 Sep 21 15:51:27 volumio volumio[1229]: Invalid card number. Sep 21 15:51:28 volumio kernel: rk3x-i2c ff140000.i2c: timeout, ipd: 0x00, state: 1 Sep 21 15:51:28 volumio volumio[1229]: Invalid card number. Sep 21 15:51:29 volumio kernel: rk3x-i2c ff140000.i2c: timeout, ipd: 0x00, state: 1 Sep 21 15:51:29 volumio volumio[1229]: Invalid card number. Sep 21 15:51:30 volumio kernel: rk3x-i2c ff140000.i2c: timeout, ipd: 0x00, state: 1 Sep 21 15:51:30 volumio volumio[1229]: Invalid card number. Sep 21 15:51:31 volumio kernel: rk3x-i2c ff140000.i2c: timeout, ipd: 0x00, state: 1 Sep 21 15:51:31 volumio volumio[1229]: Invalid card number. Sep 21 15:51:32 volumio kernel: rk3x-i2c ff140000.i2c: timeout, ipd: 0x00, state: 1 Sep 21 15:51:32 volumio volumio[1229]: Invalid card number. Sep 21 15:51:33 volumio kernel: rk3x-i2c ff140000.i2c: timeout, ipd: 0x00, state: 1 Sep 21 15:51:33 volumio volumio[1229]: Invalid card number. Sep 21 15:51:33 volumio volumio[1386]: [Vollibrespot] : Connecting to AP "guc3-accesspoint-a-wz6l.ap.spotify.com:4070" Sep 21 15:51:34 volumio volumio[1386]: [Vollibrespot] : Authenticated as "jcw122" ! Sep 21 15:51:34 volumio volumio[1386]: [Vollibrespot] : Setting up new mixer: card:hw:1,2 mixer:Headphone,1 index:0 Sep 21 15:51:34 volumio volumio[1386]: ALSA lib conf.c:4858:(parse_args) Unknown parameter 1 Sep 21 15:51:34 volumio volumio[1386]: ALSA lib conf.c:4991:(snd_config_expand) Parse arguments error: No such file or directory Sep 21 15:51:34 volumio volumio[1386]: ALSA lib control.c:1373:(snd_ctl_open_noupdate) Invalid CTL hw:1,2 Sep 21 15:51:34 volumio volumio[1386]: thread 'main' panicked at 'Error setting up mixer!: Error("snd_mixer_attach", Sys(ENOENT))', src/libcore/result.rs:997:5

Seems to be be that Volumio is having trouble correctly identify your output device. What is your setup?

I’m on an Asus Tinkerboard (original) only using aux out. Nothing else gets connected to the device besides power and aux out.

Ash, I executed startconnect.sh (./startconnect.sh) and it gave me this:

cat startconnect.sh #this file is generated by the plugin. You should not edit it unless you know what you do. It will be overwritten by the plugin each time a change in config is detected cd /data/plugins/music_service/volspotconnect2 ./vollibrespot -b 320 -c /tmp \ --disable-audio-cache \ --name 'Volumio' --initial-volume 100\ --device plughw:1,2 \ --mixer alsa \ --mixer-name 'Headphone,1' --mixer-card 'hw:1,2' \

I modified it to this for the last 3 lines, but I’m still not having any luck. Does the problem seem to be in aplay?

                  --device plughw:1   \
                  --mixer alsa \
                  --mixer-name 'Headphone' --mixer-card 'hw:1'  \

When I ran aplay -l I got this:

**** List of PLAYBACK Hardware Devices **** card 0: rockchipminiarm [rockchip,miniarm-codec], device 0: ff890000.i2s-i2s-hifi i2s-hifi-0 [] Subdevices: 1/1 Subdevice #0: subdevice #0 card 1: OnBoard [USB Audio OnBoard], device 0: USB Audio [USB Audio] Subdevices: 1/1 Subdevice #0: subdevice #0 card 1: OnBoard [USB Audio OnBoard], device 1: USB Audio [USB Audio #1] Subdevices: 1/1 Subdevice #0: subdevice #0 card 1: OnBoard [USB Audio OnBoard], device 2: USB Audio [USB Audio #2] Subdevices: 1/1 Subdevice #0: subdevice #0

Results for:
cat /data/configuration/audio_interface/alsa_controller/config.json

{
  "volumestart": {
    "type": "string",
    "value": "20"
  },
  "volumemax": {
    "type": "string",
    "value": "100"
  },
  "volumecurvemode": {
    "type": "string",
    "value": "logarithmic"
  },
  "outputdevice": {
    "type": "string",
    "value": "1,2"
  },
  "mixer_type": {
    "type": "string",
    "value": "Hardware"
  },
  "mixer": {
    "type": "string",
    "value": "Headphone"
  },
  "volumesteps": {
    "type": "string",
    "value": "10"
  },
  "outputdevicename": {
    "type": "string",
    "value": "Audio Jack Out"
  }
}

Seems like there is something amiss with the mixer names that Volumio is reporting. Here it mentions Headphone, but when querying the confuguration it, it seems to return Headpone,1?

So, some more digging.

# Volume change script 
cat /tmp/getvolume

# Current alsa config
cat /etc/asound.conf

# Check if we have a valid mixer
amixer -M get -c 1 "Headphone,1"

You might have to play around with these combinations,

                  --device plughw:1,2   \
                  --mixer alsa \
                  --mixer-name 'Headphone' --mixer-card 'hw:1,2'  \
# or
                  --mixer-name 'Headphone' --mixer-card 'hw:1'  \
# or 
                  --mixer-name 'Headphone' --mixer-card 'hw:1'  --mixer-index 1 \

Or you could also avoid the guesswork and check the audio_output section of mpd. It should contain familiar names…

cat /etc/mpd.conf

Mixer was valid for Headphone and Headphone,1 (although on a hardware level that doesn’t make any sense).

RESULTS: cat /etc/asound.conf

cat: /etc/asound.conf: No such file or directory

umm…that doesn’t seem right?

RESULTS: cat /etc/mpd.conf

[code]# Volumio MPD Configuration File

Files and directories

music_directory “/var/lib/mpd/music”
playlist_directory “/var/lib/mpd/playlists”
db_file “/var/lib/mpd/tag_cache”
log_file “/var/log/mpd.log”
#pid_file “/var/run/mpd/pid”
#state_file “/var/lib/mpd/state”
#sticker_file “/var/lib/mpd/sticker.sql”
###############################################################################

General music daemon options

user “mpd”
group “audio”
bind_to_address “any”
#port “6600”
#log_level “default”
gapless_mp3_playback “no”
#save_absolute_paths_in_playlists “no”
#metadata_to_use “artist,album,title,track,name,genre,date,composer,perfo rmer,disc”
auto_update “yes”
#auto_update_depth “3”
###############################################################################

Symbolic link behavior

follow_outside_symlinks “yes”
follow_inside_symlinks “yes”
###############################################################################

Input

input {
plugin “curl”

proxy “proxy.isp.com:8080

proxy_user “user”

proxy_password “password”

}
###############################################################################

Decoder

###############################################################################

Audio Output

resampler {
plugin “soxr”
quality “high”
threads “1”
}

audio_output {
type “alsa”
name “alsa”
device “hw:1,2”
dop “yes”

}

audio_output {
type “fifo”
enabled “no”
name “multiroom”
path “/tmp/snapfifo”
format “44100:16:2”
}

#replaygain “album”
#replaygain_preamp “0”
volume_normalization “no”
###############################################################################

MPD Internal Buffering

audio_buffer_size “2048”
buffer_before_play “10%”
###############################################################################

Resource Limitations

#connection_timeout “60”
max_connections “20”
max_playlist_length “81920”
max_command_list_size “81920”
max_output_buffer_size “81920”
###############################################################################

Character Encoding

filesystem_charset “UTF-8”
id3v1_encoding “UTF-8”
###############################################################################
[/code]

I tried all three of those startconnect.sh configurations you listed, and none of those worked. Still just sits on “Connecting…” in Spotify.

Any thoughts? Happy to donate if you have a donate page for this help.

Sorry, I visit here rarely, github would be a better place.

But, for your issue, it looks like there something quite funky with the mixer setup.
Can you check how Volumio accesses it?

# Volume change script
cat /tmp/getvolume

If all else fails, I will pull out my Tinkerboard and give it a whirl something this week/end…

This should fix your issue. The card/mixer is not reported differently in this case by Volumio audio_interface api.
I would rather this be solved directly in Volumio, rather than patching the SpotifyConnect interface.

./vollibrespot -b 320 -c /tmp  \
                  --disable-audio-cache \
                  --name 'Volumio' --initial-volume 10\
                  --device plughw:1,2  --enable-volume-normalisation  \
                  --mixer alsa \
                  --mixer-name 'Headphone' --mixer-card 'hw:1' --mixer-index 1\