Comments (11)
Hi,
had the same problem and stumbled over this while searching ... got it working by adding --onstart 'sudo amixer cset numid=3 1' --onstop 'sudo amixer cset numid=3 0'
to OPTIONS
.
See the Raspberry Pi documention, you also maybe have to add raspotify ALL = (root) NOPASSWD: /usr/bin/amixer
to your /etc/sudoers
.
from raspotify.
I was having the same issue and just wanted to post the (fairly) simple fix I found for it. It's a little messy but it still works anyway.
Anyway, I'm running OSMC, which as it's not Raspbian means I can't use the Raspi config method or anything with the amixer. Instead what I found to do was edit the actual /boot/config.txt file using a simple sudo nano and added hdmi_ignore_edid_audio=1
I don't fully understand why it works but I think the command stops any sound to the display and so the service instead defaults to the analogue output. I presume this command would also mean anything else you had running that wasn't OSMC/kodi would also default to analogue audio. OSMC still works fine with audio coming out over HDMI and/or analogue so no issues there
from raspotify.
@WolfgangHusen you could try using this thread to awnser your question:
https://www.raspberrypi.org/forums/viewtopic.php?f=26&t=11086
This is the awnser given:
In that case you can force it from a command line prompt...
Code: Select all
sudo amixer cset numid=3 <n>
where n is 0=auto, 1=headphones, 2=hdmi.
Change to 1 to force sound through the 3.5mm headphone jack :D
Since I'm not sure this command is persistent after reboot, just follow the following steps to make the change persistent after boot.
To keep this change, just add this line to the crontab file:
if you are using a rpi with desktop, open a terminal, if not just issue the commands in the command line interface.
- change to root user
sudo su
password is prompted, just enter your sudo password (user password) - open the crontab file
crontab -e
- add the line (using the nano file editor)
add this line at the bottom of the file:
@reboot amixer cset numid=3 <1>
this runs the command after every boot - if using nano file editor, issue 'ctrl-x', then 'y', then just press enter.
reboot and see if it worked.
from raspotify.
I can try to help. Could you paste the contents of your /etc/default/raspotify
please!
from raspotify.
GNU nano 2.2.6 File: /etc/default/raspotify
/etc/default/raspotify -- Arguments for librespot
Device name on Spotify Connect
DEVICE_NAME="Raspberry"
Bitrate, one of 96 (low quality), 160 (default quality), or 320 (high quality)
BITRATE="320"
Additional command line arguments for librespot can be set below.
See librespot -h
for more info.
To make your device visible on Spotify Connect across the Internet add your
username and password which can be set via "Set device password", on your
account settings, use --username
and --password
.
To choose a different output device (ie a USB audio dongle or HDMI audio out),
use --device
with something like --device hw:0,1
. Your mileage may vary.
OPTIONS="--username XXXXXX --password XXXXXXX --device hw:0"
This is it. I couldn't get the code to show up as a "whole codeblock". I got rid of the commentmarks since they turned everything in huge letters.
from raspotify.
Thank you so much for this fix. OSMC first-timer, also raspotify virgin. You made my day :-)
from raspotify.
the same problem here, is this the solution?:
OPTIONS="--onstart 'sudo amixer cset numid=3 1' --onstop 'sudo amixer cset numid=3 0'"
or should be:
OPTIONS="--device hw:0 --onstart 'sudo amixer cset numid=3 1' --onstop 'sudo amixer cset numid=3 0'"
because I still have only hdmi sound
from raspotify.
Help folks,
same issues on all my raspis: sound via HDMI works, but not on Jack.
Here my option file (nothing special - at the bottom you see some things I tried according the recommendations above):
/etc/default/raspotify -- Arguments for librespot
Device name on Spotify Connect
DEVICE_NAME="JajaSpot"
Bitrate, one of 96 (low quality), 160 (default quality), or 320 (high quality)
#BITRATE="160"
Additional command line arguments for librespot can be set below.
See librespot -h
for more info.
To make your device visible on Spotify Connect across the Internet add your
username and password which can be set via "Set device password", on your
account settings, use --username
and --password
.
To choose a different output device (ie a USB audio dongle or HDMI audio out),
use --device
with something like --device hw:0,1
. Your mileage may vary.
#OPTIONS="--username <...> --password "
Uncomment to use a cache for downloaded audio files. It's best to leave this
as-is since permissions are properly set on directory `/var/cache/raspotify'.
#CACHE_ARGS="--cache /var/cache/raspotify"
#--onstart 'sudo amixer cset numid=3 1'
#--onstop 'sudo amixer cset numid=3 0'
#OPTIONS="--onstart 'sudo amixer cset numid=3 1' --onstop 'sudo amixer cset numid=3 0' --device 'hw:0,0'"
#OPTIONS="--onstart 'sudo amixer cset numid=3 1' --onstop 'sudo amixer cset numid=3 0'"
OPTIONS:"--device 'hw:0,0'"
STATUS here (seems to be fine):
pi@jajaraspi:~ $ sudo systemctl status raspotify -l
● raspotify.service - Raspotify
Loaded: loaded (/lib/systemd/system/raspotify.service; enabled)
Active: active (running) since Sa 2017-12-02 14:46:46 CET; 4s ago
Process: 24901 ExecStartPre=/bin/chown raspotify:raspotify /var/cache/raspotify (code=exited, status=0/SUCCESS)
Process: 24898 ExecStartPre=/bin/mkdir -p 0755 /var/cache/raspotify (code=exited, status=0/SUCCESS)
Main PID: 24904 (librespot)
CGroup: /system.slice/raspotify.service
└─24904 /usr/bin/librespot --name JajaSpot --backend alsa --bitrate 160 --disable-audio-cache
Dez 02 14:46:46 jajaraspi systemd[1]: Started Raspotify.
Dez 02 14:46:46 jajaraspi librespot[24904]: INFO:librespot: librespot 8971d3a (2017-10-05). Built on 2017-10-05. Build ID: POyxPQVg
Dez 02 14:46:47 jajaraspi librespot[24904]: WARN:mdns::fsm: error sending packet Error { repr: Os { code: 99, message: "Cannot assign requested address" } }
And on the Spotify Browser app I can select the raspi and it runs, but no sound.
from raspotify.
thanks @jb2210, with your feedback and the other comments I could make it work.
from raspotify.
I was having the same issue and just wanted to post the (fairly) simple fix I found for it. It's a little messy but it still works anyway.
Anyway, I'm running OSMC, which as it's not Raspbian means I can't use the Raspi config method or anything with the amixer. Instead what I found to do was edit the actual /boot/config.txt file using a simple sudo nano and added
hdmi_ignore_edid_audio=1
I don't fully understand why it works but I think the command stops any sound to the display and so the service instead defaults to the analogue output. I presume this command would also mean anything else you had running that wasn't OSMC/kodi would also default to analogue audio. OSMC still works fine with audio coming out over HDMI and/or analogue so no issues there
This is what worked for me same setup osmc with raspberrypi2
from raspotify.
What worked for me was the suggestion of F2210:
run on the command line
sudo amixer cset numid=3 1
the audio is sent to the jack output
I am running Volumio on a Raspberry 3B
after reboot it remains sending the audio to jack :-)
from raspotify.
Related Issues (20)
- Multi Channels HOT 4
- Setting up dns-sd failed: Address already in use (os error 98) HOT 8
- No 44.1khz sampling rate or S32 format on librespot -d ? HOT 3
- Gatefold - A Display For Raspotify HOT 25
- Raspotify, Music History HOT 3
- My phone disconnects from raspberry stream HOT 6
- Bluetooth Pulseaudio raspotify.service up to date? HOT 1
- Everything seems fine but no sound (unable to create IPC semaphore) HOT 6
- Recommended Specs HOT 5
- Infinite loop printing stacktrace after librespot crash HOT 2
- Sleep timer HOT 3
- Can't reinstall Raspotify (see inside for error message) HOT 2
- Raspotify restart right after I connect HOT 6
- Scanning for multiple endpoints HOT 2
- What is the purpose of the librespot fork HOT 2
- raspotify HOT 2
- On Event script not able to write to file HOT 1
- service weirdness?
- Raspotify won't show up in device list, even through it is running HOT 3
- Raspotify only shows in device list via API after Spotify App selects it
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from raspotify.