Giter Site home page Giter Site logo

Comments (13)

JonasStankevicius avatar JonasStankevicius commented on July 17, 2024 1

Hi, I have a fresh install of Raspberry Pi OS (2020-06-03) and latest BT-Speaker install.
After running bt_speaker.service I get this message:

pi@raspberrypi:/opt/bt-speaker $ ./bt_speaker.service
./bt_speaker.service: line 1: [Unit]: command not found
./bt_speaker.service: line 4: [Service]: command not foun
./bt_speaker.service: line 11: [Install]: command not found

Am I running the service wrong or it is not working properly?
Running bt_spearker.py does not work either.

pi@raspberrypi:/opt/bt-speaker $ ./bt_speaker.py
Unable to find mixer control PCM,0 [hw:0]
aplay: read_header:2834: read error

I am running Raspberry Pi 3 B+

from bt-speaker.

bonapart avatar bonapart commented on July 17, 2024 1

in case of any errors try start application without systemctl(to see whats wrong)

systemctl stop bt_speaker
/opt/bt-speaker/bt_speaker.py

from bt-speaker.

bonapart avatar bonapart commented on July 17, 2024

try change in /opt/bt_speaker/config.ini line
mixer = PCM to something else (use alsamixer or amixer for example)
on armbian\orangepipc i set mixer=Line Out and it works fine(case sensitive)

from bt-speaker.

alexonpeace avatar alexonpeace commented on July 17, 2024

So I've just updated my Pi via the apt repos on buster and the bluez packages + the kernel and firmware have all been updated.

Seems to have broken this project. Goes into a restart loop with the service status as:

● bt_speaker.service - "Simple bluetooth speaker for the Raspberry Pi"
   Loaded: loaded (/opt/bt-speaker/bt_speaker.service; enabled; vendor preset: enabled)
   Active: failed (Result: start-limit-hit) since Wed 2020-06-03 15:38:35 IST; 1min 45s ago
  Process: 905 ExecStart=/opt/bt-speaker/bt_speaker.py (code=exited, status=0/SUCCESS)
 Main PID: 905 (code=exited, status=0/SUCCESS)

Jun 03 15:38:35 raspberrypi systemd[1]: bt_speaker.service: Service RestartSec=100ms expired, scheduling restart.
Jun 03 15:38:35 raspberrypi systemd[1]: bt_speaker.service: Scheduled restart job, restart counter is at 5.
Jun 03 15:38:35 raspberrypi systemd[1]: Stopped "Simple bluetooth speaker for the Raspberry Pi".
Jun 03 15:38:35 raspberrypi systemd[1]: bt_speaker.service: Start request repeated too quickly.
Jun 03 15:38:35 raspberrypi systemd[1]: bt_speaker.service: Failed with result 'start-limit-hit'.
Jun 03 15:38:35 raspberrypi systemd[1]: Failed to start "Simple bluetooth speaker for the Raspberry Pi".

i have the exact same problem with raspbian

from bt-speaker.

alexonpeace avatar alexonpeace commented on July 17, 2024

in case of any errors try start application without systemctl(to see whats wrong)

systemctl stop bt_speaker
/opt/bt-speaker/bt_speaker.py

tried it
got the error what Jonas got
tried your solution again
yet it still reads out that error

Unable to find mixer control PCM,0 [hw:0] aplay: read_header:2834: read error

also the config.ini was named config.ini.default but whatever
tried after renaming to config.ini still the same
and this is my config file

[bt_speaker]

play_command = aplay -f cd -
connect_command = /etc/bt_speaker/hooks/connect
disconnect_command = /etc/bt_speaker/hooks/disconnect
startup_command = /etc/bt_speaker/hooks/startup
track_command = /etc/bt_speaker/hooks/track

[bluez]
device_path = /org/bluez/hci0
discoverable = yes
pin_code = 0000

[alsa]
enabled = yes
mixer = alsamixer
id = 0
cardindex = 0

from bt-speaker.

bonapart avatar bonapart commented on July 17, 2024

run
amixer|grep control
for example mine output is

Simple mixer control 'Master',0
Simple mixer control 'Headphone',0
Simple mixer control 'Speaker',0
Simple mixer control 'PCM',0
Simple mixer control 'Mic',0
Simple mixer control 'Mic Boost',0
Simple mixer control 'Capture',0
Simple mixer control 'Auto-Mute Mode',0
Simple mixer control 'Internal Mic',0
Simple mixer control 'Internal Mic Boost',0
Simple mixer control 'Loopback Mixing',0

so in [alsa] section i can write that mixer=Master, or mixer=PCM, or mixer=Speaker

file location is '/etc/bt_speaker/config.ini'
default file you edit location is '/opt/bt_speaker/config.ini.default'

from bt-speaker.

alexonpeace avatar alexonpeace commented on July 17, 2024

I tried amixer|grep control and got

Simple mixer control 'Headphone',0

so i edited the file in /etc/bt_speaker/config.ini and tried but got a different error

root@raspberry:/opt/bt-speaker# sudo /opt/bt-speaker/bt_speaker.py
Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
aplay: read_header:2834: read error

or this

pi@raspberry:~ $ /opt/bt-speaker/bt_speaker.py
Failed to activate service 'org.bluez': timed out (service_start_timeout=25000ms)
aplay: read_header:2834: read error

from bt-speaker.

alexonpeace avatar alexonpeace commented on July 17, 2024

NVM bro got it working after 2 hours of research and later found my Bluetooth service was broken and had to fix that its working now
Thanks for your replys

from bt-speaker.

patrickjquinn avatar patrickjquinn commented on July 17, 2024

Unable to find mixer control PCM,0 [hw:0] I've tried a combo of different devices and the default alsa device is configured correctly (it works fine with other Alsa dependant services).

from bt-speaker.

schlimmchen avatar schlimmchen commented on July 17, 2024

Unable to find mixer control PCM,0 [hw:0] I've tried a combo of different devices and the default alsa device is configured correctly (it works fine with other Alsa dependant services).

You were asking about Raspberry Pi 4. I had to do two things: Make sure that no HDMI is connected, as I found no way of enabling the analog audio output otherwise. There is some automatic switching ongoing by I don't know what.

When no HDMI is in use, amixer tells me that the mixer name is Headphone, so put that into /etc/bt_speaker/config.ini:

[alsa]
mixer = Headphone

from bt-speaker.

lukasjapan avatar lukasjapan commented on July 17, 2024

Finally got around to have a look at this.
Can confirm this as broken.

from bt-speaker.

lukasjapan avatar lukasjapan commented on July 17, 2024

Fixed by #87

It is now possible to set no mixer value to make bt-speaker use the first mixer available.

from bt-speaker.

lukasjapan avatar lukasjapan commented on July 17, 2024

Thanks to everybody for feedback. It really helped to pinpoint the issue quickly and come up with a solution.

from bt-speaker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.