-
Notifications
You must be signed in to change notification settings - Fork 194
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Soundcard is paired and connected but not found otherwise. #310
Comments
Are there any error messages from the bluealsa daemon?
what version of bluealsa are you running (I assume it is from some distribution repository?)
For bluealsa-aplay, you need to start bluealsa with at least |
update: the libasound error message
means that alsa cannot find a definition for a pcm called "bluealsa" in its configuration. This is usually caused by the bluealsa conf file (20-bluealsa.conf) being in the wrong directory, or perhaps being corrupted. The correct directory depends on what version of alsa you are using and what options it was built with by the distribution. |
Looks like I had to manually copy that file yes, but now bluez can't connect to device at all, just pair.
|
You connected OK before, but not now, so something else has changed (the alsa config file plays no part in bluez connection).
|
The service is still running. |
Hmm - the bluetooth service typically logs a message when a connection attempt fails or is rejected. In addition to the journalctl command above for bluealsa, did you also try for bluetooth?
|
|
That connect error might mean that the remote bluetooth device is rejecting the connection request. If so, then maybe its already connected to some other system, or maybe it has lost its pairing info with the bluealsa system. If the latter, then deleting it in bluetoothctl then pairing again should fix it. |
Okay, I unpaired the device and paired it again and connected to it, and added the 20-bluealsa.conf to a directory where it can used.
Works fine, but otherwise the soundcard isn't detected with
|
Excellent news !
That is correct and as expected. /proc/asound/ is created by the linux kernel and holds information about all the hardware sound cards plugged into the system. The kernel sees your bluetooth adapter as a network device, not a sound card. The bluealsa pcm and ctl objects are "software-defined" artifacts that exist only in user space. They are created by alsa when an alsa application reads the file alsa can list the bluealsa ctl objects, for example with:
but there is no equivalent alsa utility that will list the pcm objects. [ @arkq : just a thought - maybe bluealsa-aplay could be extended with to list connected bluealsa pcms as You can list them using bluealsa's D-Bus interface, for example:
Going back to the original issue with the alsa config file, I would expect the bluealsa version you are using
to put 20-bluealsa.conf in the correct directory with If you built bluealsa yourself from source, can you say what configure options you used and how you installed the build result onto your system? If configure got this wrong then you may have uncovered a bug. |
@borine excelent idea, I'll add that. Also I will add note to readme that software PCM is not visible in kernel, because this question pops out from time to time :) |
Sorry for the late reply, haven't been able to use my linux machine for a while. So the device appears in when running:
It's unmuted and I am still not getting any sound, with for example firefox. Kmix doesn't detect the card at all. |
As far as I know, firefox supports only pulseaudio sound on linux - I think you cannot use it with any alsa device; you have to go through pulse audio. |
Well that is correct, just had to use apulse. But how do I set up an audio mixing sollution? This is pretty much beyond what I know about alsa, right now I how specify for every application to use pcm device. |
In your ~/.asoundrc you can define the default pcm (and ctl) to be an alias for your bluetooth device, so that alsa applications will just use it: for example
Then
will play to the bluealsa device. The downside there is that it is not easy to switch between bluetooth and on-board sound card.
Well, I suppose the simple, and unhelpful, answer is to use pulseaudio - that's what most linux desktop distributions do. If you are determined to connect all your applications directly to alsa, then alsa's own solution is the "dmix" plugin, normally wrapped by the "plug" plugin. Setting all that up is really out of scope for this list though. The downside is that alsa's dmix can only mix streams into a hardware (ie kernel driver) device - so we are back to the discussion above about bluealsa not being a hardware sound card - for that reason you cannot use dmix with it. So right now there is no alsa stream mixing solution available for bluealsa, or any other software pcm. There is a possible, "clunky" workaround to use dmix indirectly, and I am investigating that at the moment. It will be several more weeks yet before I know whether I can produce a working solution. The trick is to use alsa's "Loopback" driver (snd-aloop), to create a virtual card that is provided by a kernel driver so can be accessed via dmix: then use the alsaloop application to pass the mixed audio stream from the virtual card to a bluealsa device. I said it was "clunky" !! 😄 If you have a look at #48 you will see a suggested "patch" (actually more of a "hack" as it breaks so many other things) that enables bluealsa to work with alsaloop and therefore indirectly with dmix. I am currently looking into why alsaloop does not behave well with bluealsa in the hope of producing a more robust solution. Even if I can get it to work reliably, this whole setup is painfully complicated; and so if your interest is just to be able to use bluetooth headphones within a linux desktop environment, then maybe pulseaudio is not such a bad solution? Bluealsa is a very excellent bluetooth audio service; but that's all it does; the old Unix application mantra of "do one thing and do it well". For a desktop you also need stream routing to permit use of different output devices and stream mixing to permit use of multiple applications. Those things require external applications, and unfortunately I don't know of any that have been written yet for use with bluealsa. Pulseaudio has a different mantra: "Try to do everything and don't worry about the compromises that creates". Only you can decide which is best for your particular use case. |
Oh well, I can live without dmix anyway untill I get the bluetooth speakers replaced. I just thought that since kmix couldn't detect the card meant something was very wrong. |
well, yes. bluealsa is not a card. Seek advice on a kmix / kde site - perhaps kmix can be configured to see software PCMs as well as cards. I don't know kmix, but some other applications will list software pcms provided they are explicitly named in .asoundrc. for example:
for some other applications you need a more complete definition, eg:
with the second one, now
|
I searched a bit around and now I compile Firefox with jack support. I hope they enable that in the normal builds. |
I'm closing this as I think there is not much more that can be said. Bluealsa is not a soundcard, so applications that look only for soundcards will not find it. That is the applications fault. Bluealsa does not currently implement PCM stream mixing, and ALSA's dmix plugin works only with soundcards. |
Hello
I can't get this to work. AFAIK I paired and connected correctly:
None of those is the soundcard of course.
bluealsa-aplay 7C:96:D2:30:DD:E7
Gives no sound or any output in the shell.
Any help would be appreciated.
The text was updated successfully, but these errors were encountered: