GithubHelp home page GithubHelp logo

Comments (11)

mgeorgia avatar mgeorgia commented on August 21, 2024

Just as a follow up:
When I comment out dtparam=audio=on, my dac chip works fine locally playing a mp3 file. So I'm pretty confident that my hardware is working. However, I can't connect through bluetooth when this line is commented out. However, when I remove this line from being commented, I can connect just fine over bluetooth, but then no sound out of my dac. Is there some library that this line loads that breaks the bluetooth software when I comment it out? Is there a way for me to load it manually?

from bt-speaker.

lukasjapan avatar lukasjapan commented on August 21, 2024

Not verified but maybe the alsa python library crashes the whole thing.

Are there any clues in the (systemd) log?

According to https://github.com/raspberrypi/firmware/blob/master/boot/overlays/README dtparam=audio=on changes something in the alsa setup. If the aplay .. command works, I can just suspect the above library to break things as these are the only dependencies to alsa.

Maybe adjusting the mixer settings accordingly to your dac can fix things:

[alsa]
id = 0
cardindex = 0
mixer = PCM

It might also be good to verify if bluetooth in general is working. As with Wifi, the Pi might share a bus here, efficiently disabling bluetooth with that line. (But unlikely)

from bt-speaker.

mgeorgia avatar mgeorgia commented on August 21, 2024

Ok I'll try that out! In the meantime, I found that the aplay command worked for a local .wav file for my DAC both with and without that dtparam=audio=on commented. So I think something is going on with the bluetooth or with the mixing settings. So for now, I'll leave it uncommented, and then at the very least my phone is able to connect to the pi according to my phone's bluetooth menu. It's still possible that the connection might not be fully realized, or that something else weird is going on. I'm using a pi zero W, so this is actually onboard bluetooth. Not sure if that info is useful.

When I run cat /proc/asound/modules I get that sound sink number 1 is the main pi sound, and sound sink number 2 is my DAC. It's possible that when your code goes to match the bluetooth source to the sink that it's picking the main pi audio line as the sink rather than my DAC as the sink, which would result in no audio. I tried changing this order by creating a file called /etc/modprobe.d/alsa-base.conf to reorder them, but that didn't work and it also broke my ability to even play local files through the DAC through aplay. I tried this paragraph's worth of stuff from reading this github gist: https://gist.github.com/oleq/24e09112b07464acbda1

I'll check out what systemd is saying and try to for sure get my phone connected properly to verify that the bluetooth side of things is working.

from bt-speaker.

mgeorgia avatar mgeorgia commented on August 21, 2024

As a follow up, what's a good way to verify that bluetooth is working on the pi side? On my phone, as far as I can tell, the bluetooth appears to be working fine. I can connect to raspberrypi and when I go to play audio, my phone is trying to play the audio over bluetooth rather than out of the speakers.

What can I look at on the pi to verify that my phone is connecting properly and that it is receiving the audio? Will systemd show this? If I try to use the bluez5 interface directly, I can see when my phone connects. It will show my phone's MAC address and then say connected=yes or something of that sort.

from bt-speaker.

mgeorgia avatar mgeorgia commented on August 21, 2024

Ok yeah so there's a lot of stuff in the systemd log whenever I comment out dtparam=audio=on:
image

from bt-speaker.

mgeorgia avatar mgeorgia commented on August 21, 2024

So that just repeats on and on. This can be confirmed when I look on my bluetooth browser on my phone, the raspberrypi shows up for like a half a second and then disappears. This just repeats indefinitely. Any idea how to remedy this? I think I need the default audio disabled for the audio to come out my sound card. I tried changing alsa mixer settings but alsa's settings are poorly documented, change highly depending on what OS you have, and anything I do just breaks everything! Hopefully we can bypass the need for a mixer by getting this code to work with dtparam=audio=on commented out and then we will be all set!

from bt-speaker.

lukasjapan avatar lukasjapan commented on August 21, 2024

It looks like you have to both adjust the alsa mixer settings and play command.
in /etc/bt_speaker/config.ini.

Unable to find mixer control ...

means that bt-speaker attemps to change the volume value of a non existing mixer.
So you have to adjust

[alsa]
id = 0
cardindex = 0
mixer = PCM

according to your setup. (Find the right values for these 3 settings with help of your alsa config or output of the alsa tools)

aplay: playback:... read errors

indicates that the aplay command also does not work as expected. Probably you also need to add some parameters to play_command in the /etc/bt_speaker/config.ini. Right values are depending on your setup.

man aplay should be your friend here.

from bt-speaker.

mgeorgia avatar mgeorgia commented on August 21, 2024

Ok so the plot thickens. I did not have a file located in /etc/bt_speaker called config.ini. In fact, I do not even have that directory. So, I'm wondering if this has something to do with why this isn't working.
I tried manually creating /etc/bt_speaker and then re-installing the program to see if it would populate the folder with that file, but it didn't. Since that file is missing, I'm sure this won't work right?

I'm wondering if this is an OS related problem also. I'm running Debian Jessie, version 8.0, with kernel 4.9.35+. Is there a better operating system I could install instead that you know will work better? I'm all ears at this point.

from bt-speaker.

mgeorgia avatar mgeorgia commented on August 21, 2024

Since another commenter got this working with the latest version of stretch and some permission changes, I'm going to throw that onto my pi and see if that doesn't fix my issues with certain directories not getting created.
Thanks for all the help!

from bt-speaker.

mgeorgia avatar mgeorgia commented on August 21, 2024

That didn't work, but not because your software wasn't working on Stretch, but rather something about my sound card's software wasn't working.

I did manage to eventually get everything to work with a different piece of software thanks to someone's post in a bug report for that software:
BaReinhard/Super-Simple-Raspberry-Pi-Audio-Receiver-Install#36

When I follow that user's instructions, I was able to stream sound over bluetooth through my soundcard! So it is possible to do this. I'm just wondering what your software is/isn't changing that is making it break as opposed to the software I linked to.

from bt-speaker.

moretocome avatar moretocome commented on August 21, 2024

The firmware for DAC+ changed the name of the mixer control, so you need to set mixer = Digital in /etc/bt_speaker/config.ini.

But did anyone figure out how to get bt_speaker working without dtparam=audio=on?
I prefer to keep it that way to avoid manually setting all audio software to play through the DAC instead of the native sound output.

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.