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

Transport not available during connection phase, but amixer shows device #6

Closed
ghost opened this issue Nov 5, 2016 · 4 comments
Closed

Comments

@ghost
Copy link

ghost commented Nov 5, 2016

Hi,

I seem to have some trouble getting my bluetooth headset fully connected. It shows an error "Transport not available" when I want to play a media file and also shows this error during the initial connection to the device. However, unlike issue #5 I am able to get the device shown in the output of `amixer -D bluealsa:

Simple mixer control 'PLT_Legend - HSP',0
  Capabilities: pvolume pvolume-joined cvolume cvolume-joined pswitch pswitch-joined cswitch cswitch-joined
  Playback channels: Mono
  Capture channels: Mono
  Limits: Playback 0 - 127 Capture 0 - 127
  Mono: Playback 82 [65%] [on] Capture 82 [65%] [on]

Beforehand I already got an error in the connection phase in the output of bluetooth (Transport not available).

I execute commands in this order:

  1. bluealsa as root
  2. bluetoothctl as root: power on and connect E4:22:A5:08:7B:FF (headset then tells me, it connected to PC)

When the command connect E4:22:A5:08:7B:FF executes, I get the error Transport not available: /org/bluez/hci0/dev_E4_22_A5_08_7B_FF/fd9 in the output of bluealsa (where the fd9 is a number increasing with each trial).

bluealsa: ctl.c:353: Starting controller loop
bluealsa: bluez.c:677: Registering endpoint: 0000110A-0000-1000-8000-00805F9B34FB: /MediaEndpoint/A2DP_MPEG24_Source
bluealsa: bluez.c:677: Registering endpoint: 0000110A-0000-1000-8000-00805F9B34FB: /MediaEndpoint/A2DPSource
bluealsa: bluez.c:677: Registering endpoint: 0000110B-0000-1000-8000-00805F9B34FB: /MediaEndpoint/A2DP_MPEG24_Sink
bluealsa: bluez.c:677: Registering endpoint: 0000110B-0000-1000-8000-00805F9B34FB: /MediaEndpoint/A2DPSink
bluealsa: bluez.c:893: Registering profile: 00001108-0000-1000-8000-00805F9B34FB: /Profile/HSPHeadset
bluealsa: bluez.c:893: Registering profile: 00001112-0000-1000-8000-00805F9B34FB: /Profile/HSPAudioGateway
bluealsa: main.c:202: Starting main dispatching loop
bluealsa: bluez.c:846: Profile method call: org.bluez.Profile1.NewConnection()
bluealsa: bluez.c:778: HSP Audio Gateway configured for device E4:22:A5:08:7B:FF
bluealsa: transport.c:399: State transition: 0 -> 2
bluealsa: io.c:960: Starting IO loop: HSP Audio Gateway
bluealsa: transport.c:91: Created new IO thread: HSP Audio Gateway
bluealsa: io.c:994: AT command: +VGS=08
bluealsa: io.c:994: AT command: +VGM=15
bluealsa: Transport not available: /org/bluez/hci0/dev_E4_22_A5_08_7B_FF/fd9
bluealsa: Transport not available: /org/bluez/hci0/dev_E4_22_A5_08_7B_FF/fd9

That's also the error I then get, when I want to play a media file either by passing the device information via command line or using it from the asound.conf (like amixer does):

[root@pc folder]# aplay -D bluealsa:HCI=hci0,DEV=E4:22:A5:08:7B:FF,PROFILE=a2dp applause.wav 
bluealsa-pcm.c:101: Getting transport for E4:22:A5:08:7B:FF profile 1
ALSA lib bluealsa-pcm.c:619:(_snd_pcm_bluealsa_open) Couldn't get BlueALSA transport: No such device
aplay: main:786: audio open error: No such device
[root@pc folder]# aplay -D bluealsa applause.wav 
bluealsa-pcm.c:101: Getting transport for E4:22:A5:08:7B:FF profile 1
ALSA lib bluealsa-pcm.c:619:(_snd_pcm_bluealsa_open) Couldn't get BlueALSA transport: No such device
aplay: main:786: audio open error: No such device

I am executing all commands as root, to make sure it's not permission issues.

I also tried executing both aplay ... commands from above with a user who is part of group audio, but this leads to the same error.

I might also have to say that I have a PulseAudio running, but for a new project I needed bluetooth device input in ALSA. Might the PulseAudio "steal" the device from bluealsa? Don't know if bluez can only handle one handler at a time or so.

pactl also lists the device:

Card #13
	Name: bluez_card.E4_22_A5_08_7B_FF
	Driver: module-bluez5-device.c
	Owner Module: 35
	Properties:
		device.description = "PLT Legend"
		device.string = "E4:22:A5:08:7B:FF"
		device.api = "bluez"
		device.class = "sound"
		device.bus = "bluetooth"
		device.form_factor = "headset"
		bluez.path = "/org/bluez/hci0/dev_E4_22_A5_08_7B_FF"
		bluez.class = "0x240404"
		bluez.alias = "PLT_Legend"
		device.icon_name = "audio-headset-bluetooth"
		device.intended_roles = "phone"
	Profiles:
		headset_head_unit: Headset Head Unit (HSP/HFP) (sinks: 1, sources: 1, priority: 20, available: yes)
		a2dp_sink: High Fidelity Playback (A2DP Sink) (sinks: 1, sources: 0, priority: 10, available: yes)
		off: Off (sinks: 0, sources: 0, priority: 0, available: yes)
	Active Profile: headset_head_unit
	Ports:
		headset-output: Headset (priority: 0, latency offset: 0 usec)
			Part of profile(s): headset_head_unit, a2dp_sink
		headset-input: Headset (priority: 0, latency offset: 0 usec)
			Part of profile(s): headset_head_unit

How can we further investigate this? Am I missing some libraries for HSP? Transport not available sounds like it could be such an issue.

@ghost
Copy link
Author

ghost commented Nov 5, 2016

Solution: Yes, pulseaudio and bluealsa cannot both try to access the bluetooth device at the same time (whatever that means in lower level, probably registering handlers to it on bluez). I removed the pulseaudio bluetooth connection (in my case on arch linux pulseaudio-bluetooth, restarted, and now it works.

@ghost ghost closed this as completed Nov 5, 2016
@arkq
Copy link
Owner

arkq commented Nov 5, 2016

Hi,

This issue is definitely related to #5, but you've provided full logs, which is really helpful. It seems, that the A2DP profile is not connected (at least bluealsa think it is not connected). The crucial log (from my explanation in #5) is this:

Endpoint method call: org.bluez.MediaEndpoint1.SelectConfiguration()

And it seems, that you are right, it might be the conflict with PulseAudio (or any other application, which has registered A2DP profile). To be honest, I never though about that. I will try to figure something out (if it is possible).

Many thanks for reporting it!

EDIT:
And for the HSP thing - in the current master snapshot there is only a stub for HSP/HFP. Currently I'm trying to make this work, however to accomplish that I have to make HUGE refactoring :) I will push lots of changes in a few next days.

@ghost ghost mentioned this issue Nov 5, 2016
@george-ai
Copy link

Hi

Quick question. Is HSP included now?

@arkq
Copy link
Owner

arkq commented Sep 14, 2017

Yes, it is in the master branch. However, I've tested HSP audio-gateway only.

This issue was closed.
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

2 participants