pali / hsphfpd-prototype

Prototype of Bluetooth HSP/HFP daemon
135 stars 16 forks source link

There is no application with audio agent and agent codec comapatile with air codec CVSD #7

Closed guydoron closed 4 years ago

guydoron commented 4 years ago

Hello,

I couldnt connect with profile HSF/HPF to my Xiome device. In A2DT it works great. On Phone call I get this error on the console: There is no application with audio agent and agent codec comapatile with air codec CVSD

pali commented 4 years ago

Please provide full output from hsphpfd.pl daemon

guydoron commented 4 years ago

Thank you pali :

Creating listening SCO socket Supported codecs combination on SCO socket by kernel: Air codec CVSD with agent codec PCM_s16le_8kHz Air codec mSBC with agent codec mSBC Registered profile hfp_hf Registered profile hsp_hs Registered profile hsp_ag added: profile_manager=/org/bluez Supported air codecs for adapter /org/bluez/hci0: ulaw alaw CVSD AuriStream_2bit_8kHz AuriStream_2bit_16kHz AuriStream_4bit_8kHz AuriStream_4bit_16kHz mSBC Supported agent codecs for adapter /org/bluez/hci0: ulaw alaw CVSD AuriStream_2bit_8kHz AuriStream_2bit_16kHz AuriStream_4bit_8kHz AuriStream_4bit_16kHz mSBC PCM_s16le_8kHz PCM_u16le_8kHz PCM_s8le_8kHz PCM_u8le_8kHz mSBC Supported codecs combination for adapter /org/bluez/hci0 by kernel: Air codec CVSD with agent codecs: PCM_s16le_8kHz Air codec mSBC with agent codecs: mSBC added: adapter=/org/bluez/hci0 address=0C:7A:15:89:72:A3 added: device=/org/bluez/hci0/dev_F4_60_E2_9A_B5_93 adapter=/org/bluez/hci0 endpoint=/org/hsphfpd/hci0/dev_F4_60_E2_9A_B5_93/hsp_hs local_address=0C:7A:15:89:72:A3 remote_address=F4:60:E2:9A:B5:93 profile=hsp_hs added: device=/org/bluez/hci0/dev_F4_60_E2_9A_B5_93 adapter=/org/bluez/hci0 endpoint=/org/hsphfpd/hci0/dev_F4_60_E2_9A_B5_93/hsp_ag local_address=0C:7A:15:89:72:A3 remote_address=F4:60:E2:9A:B5:93 profile=hsp_ag added: device=/org/bluez/hci0/dev_F4_60_E2_9A_B5_93 adapter=/org/bluez/hci0 endpoint=/org/hsphfpd/hci0/dev_F4_60_E2_9A_B5_93/hfp_ag local_address=0C:7A:15:89:72:A3 remote_address=F4:60:E2:9A:B5:93 profile=hfp_ag Registering application :1.162 /org/hsphfpd/application Registering application's :1.162 /org/hsphfpd/application audio agent /org/hsphfpd/application/audio/pcm_agent for codec PCM_s16le_8kHz New connection: endpoint=/org/hsphfpd/hci0/dev_F4_60_E2_9A_B5_93/hsp_ag profile=hsp_ag device=/org/bluez/hci0/dev_F4_60_E2_9A_B5_93 fd=6 version= features=0 Opening connection for endpoint /org/hsphfpd/hci0/dev_F4_60_E2_9A_B5_93/hsp_ag Socket write: endpoint=/org/hsphfpd/hci0/dev_F4_60_E2_9A_B5_93/hsp_ag Line: AT+VGS=8 Socket ready read: endpoint=/org/hsphfpd/hci0/dev_F4_60_E2_9A_B5_93/hsp_ag Line: OK Received OK Socket write: endpoint=/org/hsphfpd/hci0/dev_F4_60_E2_9A_B5_93/hsp_ag Line: AT+VGM=8 Socket ready read: endpoint=/org/hsphfpd/hci0/dev_F4_60_E2_9A_B5_93/hsp_ag Line: OK Received OK Socket write: endpoint=/org/hsphfpd/hci0/dev_F4_60_E2_9A_B5_93/hsp_ag Line: AT+CSRSF=0,1,0,1,1,7,3 Socket ready read: endpoint=/org/hsphfpd/hci0/dev_F4_60_E2_9A_B5_93/hsp_ag Line: ERROR Received ERROR Accepting new audio transport Local address is 0C:7A:15:89:72:A3 and remote address is F4:60:E2:9A:B5:93 Choosing agent codec PCM_s16le_8kHz Connecting SCO socket for audio transport SCO socket for audio transport is now connected Audio transport /org/hsphfpd/hci0/dev_F4_60_E2_9A_B5_93/audio_fd1 created Passing audio transport /org/hsphfpd/hci0/dev_F4_60_E2_9A_B5_93/audio_fd1 to application's :1.162 /org/hsphfpd/application agent /org/hsphfpd/application/audio/pcm_agent with codec PCM_s16le_8kHz Audio connection for transport /org/hsphfpd/hci0/dev_F4_60_E2_9A_B5_93/audio_fd1 is established Socket exception on audio transport /org/hsphfpd/hci0/dev_F4_60_E2_9A_B5_93/audio_fd1 Disconnecting audio transport /org/hsphfpd/hci0/dev_F4_60_E2_9A_B5_93/audio_fd1 Destroying SCO socket Connection to 192.168.1.22 closed by remote host. Connection to 192.168.1.22 closed.

pali commented 4 years ago

It looks like that audio agent closed connection or your remote device closed audio channel. Which audio agent are you using?

pali commented 4 years ago

Also I do not see in that your output that There is no application with audio agent and agent codec compatible with air codec CVSD message.

guydoron commented 4 years ago

Yes it was once and now not but still i cannot choose Headset on sound settings. Iam using your /audio_client.pl

Logs _audioclient New connection: caller=:1.384 path=/org/hsphfpd/hci0/dev_F4_60_E2_9A_B5_93/audio_fd1 fd=5 mtu=96 air_codec=CVSD Reading data from SCO socket 5 failed: Connection reset by peer Closing connection: path=/org/hsphfpd/hci0/dev_F4_60_E2_9A_B5_93/audio_fd1 write() failed: Broken pipe

hsphfpd.pl Creating listening SCO socket Supported codecs combination on SCO socket by kernel: Air codec CVSD with agent codec PCM_s16le_8kHz Air codec mSBC with agent codec mSBC Registered profile hfp_hf Registered profile hsp_hs Registered profile hsp_ag added: profile_manager=/org/bluez Supported air codecs for adapter /org/bluez/hci0: ulaw alaw CVSD AuriStream_2bit_8kHz AuriStream_2bit_16kHz AuriStream_4bit_8kHz AuriStream_4bit_16kHz mSBC Supported agent codecs for adapter /org/bluez/hci0: ulaw alaw CVSD AuriStream_2bit_8kHz AuriStream_2bit_16kHz AuriStream_4bit_8kHz AuriStream_4bit_16kHz mSBC PCM_s16le_8kHz PCM_u16le_8kHz PCM_s8le_8kHz PCM_u8le_8kHz mSBC Supported codecs combination for adapter /org/bluez/hci0 by kernel: Air codec CVSD with agent codecs: PCM_s16le_8kHz Air codec mSBC with agent codecs: mSBC added: adapter=/org/bluez/hci0 address=0C:7A:15:89:72:A3 added: device=/org/bluez/hci0/dev_F4_60_E2_9A_B5_93 adapter=/org/bluez/hci0 endpoint=/org/hsphfpd/hci0/dev_F4_60_E2_9A_B5_93/hsp_hs local_address=0C:7A:15:89:72:A3 remote_address=F4:60:E2:9A:B5:93 profile=hsp_hs added: device=/org/bluez/hci0/dev_F4_60_E2_9A_B5_93 adapter=/org/bluez/hci0 endpoint=/org/hsphfpd/hci0/dev_F4_60_E2_9A_B5_93/hsp_ag local_address=0C:7A:15:89:72:A3 remote_address=F4:60:E2:9A:B5:93 profile=hsp_ag added: device=/org/bluez/hci0/dev_F4_60_E2_9A_B5_93 adapter=/org/bluez/hci0 endpoint=/org/hsphfpd/hci0/dev_F4_60_E2_9A_B5_93/hfp_ag local_address=0C:7A:15:89:72:A3 remote_address=F4:60:E2:9A:B5:93 profile=hfp_ag Registering application :1.386 /org/hsphfpd/application Registering application's :1.386 /org/hsphfpd/application audio agent /org/hsphfpd/application/audio/pcm_agent for codec PCM_s16le_8kHz New connection: endpoint=/org/hsphfpd/hci0/dev_F4_60_E2_9A_B5_93/hsp_ag profile=hsp_ag device=/org/bluez/hci0/dev_F4_60_E2_9A_B5_93 fd=6 version= features=0 Opening connection for endpoint /org/hsphfpd/hci0/dev_F4_60_E2_9A_B5_93/hsp_ag Socket write: endpoint=/org/hsphfpd/hci0/dev_F4_60_E2_9A_B5_93/hsp_ag Line: AT+VGS=8 Socket ready read: endpoint=/org/hsphfpd/hci0/dev_F4_60_E2_9A_B5_93/hsp_ag Line: OK Received OK Socket write: endpoint=/org/hsphfpd/hci0/dev_F4_60_E2_9A_B5_93/hsp_ag Line: AT+VGM=8 Socket ready read: endpoint=/org/hsphfpd/hci0/dev_F4_60_E2_9A_B5_93/hsp_ag Line: OK Received OK Socket write: endpoint=/org/hsphfpd/hci0/dev_F4_60_E2_9A_B5_93/hsp_ag Line: AT+CSRSF=0,1,0,1,1,7,3 Socket ready read: endpoint=/org/hsphfpd/hci0/dev_F4_60_E2_9A_B5_93/hsp_ag Line: ERROR Received ERROR Accepting new audio transport Local address is 0C:7A:15:89:72:A3 and remote address is F4:60:E2:9A:B5:93 Choosing agent codec PCM_s16le_8kHz Connecting SCO socket for audio transport SCO socket for audio transport is now connected Audio transport /org/hsphfpd/hci0/dev_F4_60_E2_9A_B5_93/audio_fd1 created Passing audio transport /org/hsphfpd/hci0/dev_F4_60_E2_9A_B5_93/audio_fd1 to application's :1.386 /org/hsphfpd/application agent /org/hsphfpd/application/audio/pcm_agent with codec PCM_s16le_8kHz Audio connection for transport /org/hsphfpd/hci0/dev_F4_60_E2_9A_B5_93/audio_fd1 is established Socket exception on audio transport /org/hsphfpd/hci0/dev_F4_60_E2_9A_B5_93/audio_fd1 Disconnecting audio transport /org/hsphfpd/hci0/dev_F4_60_E2_9A_B5_93/audio_fd1 Destroying SCO socket

pali commented 4 years ago

i cannot choose Headset on sound settings

In which sound settings?

Iam using your /audio_client.pl

Example audio_client.pl in this repository does not provide any sound settings.

guydoron commented 4 years ago

| In which sound settings?

PulseAudio or GNOME sound settings.

| Example audio_client.pl in this repository does not provide any sound settings.

So i do not need to activate this script at all ?

pali commented 4 years ago

| In which sound settings?

PulseAudio or GNOME sound settings.

PulseAudio nor GNOME sound settings does not support hsphfpd.

| Example audio_client.pl in this repository does not provide any sound settings.

So i do not need to activate this script at all ?

There is patch for PulseAudio which adds support for hsphfpd, see README for more details.

guydoron commented 4 years ago

Yes i saw, I do not know how to apply the patch. So i only did this :

If you are not using pulseaudio with above hsphfpd patches it is needed to unload pulseaudio bluetooth modules:

pactl unload-module module-bluez5-device pactl unload-module module-bluez5-discover pactl unload-module module-bluetooth-discover

After that it is possible to start hsphfpd prototype daemon implementation:

sudo ./hsphfpd.pl

pali commented 4 years ago

Yes i saw, I do not know how to apply the patch.

In this case, you need to contact your distribution to apply needed pulseaudio patch.

Second option, disabling bluetooth support in pulseaudio and still using pulseaudio, was just hack for me to develop whole hsphfpd daemon and test. audio_client.pl is just example "demo" application for developers to see how API looks like and verification for me that API works. I can help other developers with it who wants to use hsphfpd in their audio server applications.

In your logs:

Logs _audioclient New connection: caller=:1.384 path=/org/hsphfpd/hci0/dev_F4_60_E2_9A_B5_93/audio_fd1 fd=5 mtu=96 air_codec=CVSD Reading data from SCO socket 5 failed: Connection reset by peer

This means that remote device closed SCO audio connection.

Closing connection: path=/org/hsphfpd/hci0/dev_F4_60_E2_9A_B5_93/audio_fd1 write() failed: Broken pipe

guydoron commented 4 years ago

Got it. I do not have any distribution company, but I am a developer so I guess if you can direct to how to apply ill do it on my own :) Thank you.

pali commented 4 years ago

Link from README points to merge request in pulseaudio project. Just compile and run pulseaudio from that merge request. I updated merge request description to point to the comment with details how to compile it.

guydoron commented 4 years ago

Thank you Pali, I have cloned your merged PulseAudio version. when trying to make it doesn't have a configuration file.
make: *** No targets specified and no makefile found. Stop.

pali commented 4 years ago

Have you read pulseaudio README file? In order to run pulseaudio...

guydoron commented 4 years ago

I did :

In order to run pulseaudio from the build dir OPTIMIZE should be disabled (look at src/pulsecore/core-util.h::pa_run_from_build_tree()), this can be done by passing "CFLAGS=-O0" to the configure script: ./autogen.sh

     **I have put CFLAGS=-O0 in this file**

  CFLAGS="-ggdb3 -O0" LDFLAGS="-ggdb3" ./configure

      **not sure what i need to do with this. Tried to run it no success** 
  make

      **returned me make: *** No targets specified and no makefile found. Stop.**

  ./src/pulseaudio -n -F src/default.pa -p $(pwd)/src/

     **What should i do here ?**
pali commented 4 years ago

CFLAGS="-ggdb3 -O0" LDFLAGS="-ggdb3" ./configure not sure what i need to do with this. Tried to run it no success

So, if it failed, you cannot obviously continue. You need to fix this step.

guydoron commented 4 years ago

Sure. What should i do? when just run it on command line : -bash: ./configure: No such file or directory

pali commented 4 years ago

Well, this is now out of scope of hsphfpd project. Problems with compiling pulseaudio you should discuss with pulseaudio developers.

guydoron commented 4 years ago

if it's only standard PulseAudio compiling and building then I would use their documentation unless there are special things for your merged code.

guydoron commented 4 years ago

OK manage to merge and activate ./autogen.sh CFLAGS="-ggdb3 -O0" LDFLAGS="-ggdb3" ./configure worked with 2 errors output at the end : ./configure: line 9868: syntax error near unexpected token 2.4' ./configure: line 9868:LT_PREREQ(2.4)'

make still returned No targets specified and no makefile found. Stop.

Can you give me any clue?

pali commented 4 years ago

Well, problems with compiling pulseaudio you need to discuss with pulseaudio developers.

guydoron commented 4 years ago

Thank You Pali, Manage to make build no errors. is this line is from you? ./src/pulseaudio -n -F src/default.pa -p $(pwd)/src/ it returns: N: [pulseaudio] daemon-conf.c: Detected that we are run from the build tree, fixing search path. E: [pulseaudio] pid.c: Daemon already running. E: [pulseaudio] main.c: pa_pid_file_create() failed.

guydoron commented 4 years ago

OK, manage to make that work. running the agent now all profiles are gone from settings GNOME and also PulseAudio added: profile_manager=/org/bluez Supported air codecs for adapter /org/bluez/hci0: ulaw alaw CVSD AuriStream_2bit_8kHz AuriStream_2bit_16kHz AuriStream_4bit_8kHz AuriStream_4bit_16kHz mSBC Supported agent codecs for adapter /org/bluez/hci0: ulaw alaw CVSD AuriStream_2bit_8kHz AuriStream_2bit_16kHz AuriStream_4bit_8kHz AuriStream_4bit_16kHz mSBC PCM_s16le_8kHz PCM_u16le_8kHz PCM_s8le_8kHz PCM_u8le_8kHz mSBC Supported codecs combination for adapter /org/bluez/hci0 by kernel: Air codec CVSD with agent codecs: PCM_s16le_8kHz Air codec mSBC with agent codecs: mSBC added: adapter=/org/bluez/hci0 address=0C:7A:15:89:72:A3 added: device=/org/bluez/hci0/dev_94_2D_DC_1D_84_F5 adapter=/org/bluez/hci0 endpoint=/org/hsphfpd/hci0/dev_94_2D_DC_1D_84_F5/hsp_hs local_address=0C:7A:15:89:72:A3 remote_address=94:2D:DC:1D:84:F5 profile=hsp_hs added: device=/org/bluez/hci0/dev_94_2D_DC_1D_84_F5 adapter=/org/bluez/hci0 endpoint=/org/hsphfpd/hci0/dev_94_2D_DC_1D_84_F5/hsp_ag local_address=0C:7A:15:89:72:A3 remote_address=94:2D:DC:1D:84:F5 profile=hsp_ag added: device=/org/bluez/hci0/dev_94_2D_DC_1D_84_F5 adapter=/org/bluez/hci0 endpoint=/org/hsphfpd/hci0/dev_94_2D_DC_1D_84_F5/hfp_ag local_address=0C:7A:15:89:72:A3 remote_address=94:2D:DC:1D:84:F5 profile=hfp_ag New connection: endpoint=/org/hsphfpd/hci0/dev_94_2D_DC_1D_84_F5/hsp_ag profile=hsp_ag device=/org/bluez/hci0/dev_94_2D_DC_1D_84_F5 fd=6 version= features=0 Opening connection for endpoint /org/hsphfpd/hci0/dev_94_2D_DC_1D_84_F5/hsp_ag Socket write: endpoint=/org/hsphfpd/hci0/dev_94_2D_DC_1D_84_F5/hsp_ag Line: AT+VGS=8 Socket ready read: endpoint=/org/hsphfpd/hci0/dev_94_2D_DC_1D_84_F5/hsp_ag Line: OK Received OK Socket write: endpoint=/org/hsphfpd/hci0/dev_94_2D_DC_1D_84_F5/hsp_ag Line: AT+VGM=8 Socket ready read: endpoint=/org/hsphfpd/hci0/dev_94_2D_DC_1D_84_F5/hsp_ag Line: OK Received OK Socket write: endpoint=/org/hsphfpd/hci0/dev_94_2D_DC_1D_84_F5/hsp_ag Line: AT+CSRSF=0,1,0,1,1,7,3 Socket ready read: endpoint=/org/hsphfpd/hci0/dev_94_2D_DC_1D_84_F5/hsp_ag Line: ERROR Received ERROR

guydoron commented 4 years ago

Creating uinput device for endpoint /org/hsphfpd/hci0/dev_94_2D_DC_1D_84_F5/hsp_hs: Galaxy A10s (HSP) Cannot call ioctl UI_SET_UNIQ on uinput device: Invalid argument

pali commented 4 years ago

You can ignore UI_SET_UNIQ error message.

pali commented 4 years ago

So what is the issue? Message from original report There is no application with audio agent and agent codec compatible with air codec CVSD is not present in log anymore.

pali commented 4 years ago

Closing for now as original report is not present in last log anymore. If you have additional information, please write it into comment.