Skip to content
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

bluealsa: Couldn't initialize controller thread: Bad file descriptor #149

Closed
Tutmanichtun opened this issue Oct 11, 2018 · 8 comments
Closed

Comments

@Tutmanichtun
Copy link

Hi,
i got the above message when i try to start bluealsa on my RaspberryPi 3.
The Error message is the same than in issue 126, but the described solution didn't work for me. Still getting the same message.
Because i want to use the Raspberry as a Bluetooth speaker, i wrote
BLUEALSA_CONF="-p a2dp-sink"
into that file.
I followed this guide, and it worked until a few weeks ago, i don't know what happened in the meantime. :/
Regards,
Tutmanichtun

@Queequag
Copy link

It happened to me when bluealsa segfaulted (which I'm still trying to reproduce in gdb). It left the socket in /var/run/bluealsa directory.

A workaround is to check if this directory exists and if it does – remove it and try starting bluealsa again.

@Tutmanichtun
Copy link
Author

Hi,
thanks for your response. I tried deleting that folder, but it didn't work: still getting the same message. :(

@Queequag
Copy link

Try running bluealsa with:

sudo strace -o /tmp/bluealsa.log -f bluealsa

It will produce a log of syscalls in /tmp/bluealsa.log. Attach it somewhere, maybe it will tell what happened.

@alejandro-n-rivera
Copy link

I was also getting this error, I was able to resolve it by running sudo rm /var/run/bluealsa/* to remove old run files, followed by sudo bluealsa -p a2dp-sink to start bluetooth receiving as an audio device. I think an important distinction here is that I didn't remove the /var/run/bluealsa/ directory, just the contents of it, and also ran both using sudo. Hopefully that helps.

@Tutmanichtun
Copy link
Author

Here is the generated Logfile:
bluealsa.log
@alejandro-n-rivera : your command works, so that i can connect my phone to the pi, which is recognized as an audio device until the command is running. But i am still noch able to hear anything. :/

@alejandro-n-rivera
Copy link

@Tutmanichtun While that command is running, in a separate terminal tab (ctrl+shift+T) run
bluealsa-aplay -vv 00:00:00:00:00:00. If that works, the comment I made at the bottom of
this thread might be useful.

@Tutmanichtun
Copy link
Author

The script works fine, thanks. :)
Just a very small minor issue: if i log into the pi via SSH, the script is being executed again and therefore no music is been played. Instead, the pi raises an error message: bluealsa: Transport not available: /org/bluez/hci0/dev_CC_FD_17_E6_9E_FC/fd0.

Thanks for your support. :)

@Queequag
Copy link

Looking at the code there doesn't seem to be any difference between removing the directory and its contents (see bluealsa_ctl_thread_init function in src/ctl.c).

From the log file it looks like you didn't remove /var/run/bluealsa and it still contained hci0 socket created during previous bluealsa run.

29722 mkdir("/var/run/bluealsa", 0755) = -1 EEXIST (File exists) – it means that the directory /var/run/bluealsa exists (it's not fatal, bluealsa tries to create it and if it fails with this error, it assumes it's created and continues)

29722 bind(3, {sa_family=AF_UNIX, sun_path="/var/run/bluealsa/hci0"}, 110) = -1 EADDRINUSE (Address already in use) – it means that the hci0 socket file exists

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants