plietar / librespot

Open Source Spotify client library
MIT License
1.14k stars 185 forks source link

[help wanted] USB sound card rate problem #193

Closed eerozeteen closed 7 years ago

eerozeteen commented 7 years ago

Hi, Im trying to make librespot to work with my raspberry pi media center. Im using 2 sound cards in my RPi - first is digi+ for kodi output, and second is cheap usb audio for playing music. Unfortunately my usb card can ony use 48kHz audio:

osmc@osmc:~$ cat /proc/asound/card1/stream0 Elan USB Audio at usb-3f980000.usb-1.4, full speed : >USB Audio

Playback: Status: Stop Interface 1 Altset 1 Format: S16_LE Channels: 2 Endpoint: 1 OUT (ADAPTIVE) Rates: 48000

Capture: Status: Stop Interface 2 Altset 1 Format: S16_LE Channels: 2 Endpoint: 2 IN (SYNC) Rates: 48000`

And when i try to play music from spotify, i get:

[...]

DEBUG:librespot::player: command=Play ALSA lib pcm.c:7935:(snd_pcm_set_params) Rate doesn't match (requested 44100Hz, get 48000Hz) thread '' panicked at 'called Option::unwrap() on a None value', /checkout/src/libcore/option.rs:323 note: Run with RUST_BACKTRACE=1 for a backtrace. DEBUG:librespot::player: drop Player[1] [...]

Is it possible to make spotify/librespot to use 48kHz? Or make some magic to get 44,1kHz on my USB card? When i use my digi+ card as output, everything works. My basic asound.conf is:

pcm.!default { type hw card 1 }

ctl.!default { type hw
card 1 }

I was try to use somthing like that in asound.conf, but probably i cant understand how alsa work and how to configure it correct.

pcm.!default { type hw card 1 type rate slave { pcm "plughw:1,0" rate 44100 } }

ctl.!default { type hw
card 1 type rate slave { pcm "plughw:1,0" rate 44100 }

I know that it isnt librespot problem, but maybe someone have same problem and resolve it.

sashahilton00 commented 7 years ago

Hi,

As you have noted, this is not an issue with librespot, nor is it a feature request/enhancement or bug report. The place to request librespot related support is the Gitter chat linked in the Readme. Please ask the question there, and hopefully someone will be able to help you with your question. In the meantime, please close this issue.