{"action":"created","issue":{"url":"https://api.github.com/repos/Arkq/bluez-alsa/issues/7","repository_url":"https://api.github.com/repos/Arkq/bluez-alsa","labels_url":"https://api.github.com/repos/Arkq/bluez-alsa/issues/7/labels{/name}","comments_url":"https://api.github.com/repos/Arkq/bluez-alsa/issues/7/comments","events_url":"https://api.github.com/repos/Arkq/bluez-alsa/issues/7/events","html_url":"https://github.com/Arkq/bluez-alsa/issues/7","id":187488931,"number":7,"title":"Record from bluetooth device","user":{"login":"aufziehvogel","id":3071022,"avatar_url":"https://avatars.githubusercontent.com/u/3071022?v=3","gravatar_id":"","url":"https://api.github.com/users/aufziehvogel","html_url":"https://github.com/aufziehvogel","followers_url":"https://api.github.com/users/aufziehvogel/followers","following_url":"https://api.github.com/users/aufziehvogel/following{/other_user}","gists_url":"https://api.github.com/users/aufziehvogel/gists{/gist_id}","starred_url":"https://api.github.com/users/aufziehvogel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aufziehvogel/subscriptions","organizations_url":"https://api.github.com/users/aufziehvogel/orgs","repos_url":"https://api.github.com/users/aufziehvogel/repos","events_url":"https://api.github.com/users/aufziehvogel/events{/privacy}","received_events_url":"https://api.github.com/users/aufziehvogel/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-11-05T10:24:51Z","updated_at":"2016-11-12T19:19:07Z","closed_at":null,"body":"Do you know if it's possible to use `arecord` together with `bluealsa`? I managed to fix the problem from #6 by disabling `pulseaudio-bluetooth` and can now play music through my bluetooth headset with `aplay`, but `arecord` still gives me the same error. Would I have to set different parameters for device input than for output?\r\n\r\nAgain I try to provide a full log.\r\n\r\nMy /etc/asound.conf contains:\r\n\r\n```\r\ndefaults.bluealsa.interface \"hci0\"\r\ndefaults.bluealsa.device \"E4:22:A5:08:7B:FF\"\r\ndefaults.bluealsa.profile \"a2dp\"\r\n```\r\n\r\nSo let's start from a freshly booted system (# indicates root, ~ indicates user):\r\n\r\n```\r\n# systemctl start bluetooth\r\n# bluealsa\r\n```\r\n\r\nOutput so far:\r\n\r\n```\r\nbluealsa: ctl.c:353: Starting controller loop\r\nbluealsa: bluez.c:677: Registering endpoint: 0000110A-0000-1000-8000-00805F9B34FB: /MediaEndpoint/A2DP_MPEG24_Source\r\nbluealsa: bluez.c:677: Registering endpoint: 0000110A-0000-1000-8000-00805F9B34FB: /MediaEndpoint/A2DPSource\r\nbluealsa: bluez.c:677: Registering endpoint: 0000110B-0000-1000-8000-00805F9B34FB: /MediaEndpoint/A2DP_MPEG24_Sink\r\nbluealsa: bluez.c:677: Registering endpoint: 0000110B-0000-1000-8000-00805F9B34FB: /MediaEndpoint/A2DPSink\r\nbluealsa: bluez.c:893: Registering profile: 00001108-0000-1000-8000-00805F9B34FB: /Profile/HSPHeadset\r\nbluealsa: bluez.c:893: Registering profile: 00001112-0000-1000-8000-00805F9B34FB: /Profile/HSPAudioGateway\r\nbluealsa: main.c:202: Starting main dispatching loop\r\n```\r\n\r\nGoing on:\r\n\r\n```\r\n# bluetoothctl\r\n> power on\r\n> connect E4:22:A5:08:7B:FF\r\n```\r\n\r\nNew output:\r\n\r\n```\r\nbluealsa: bluez.c:846: Profile method call: org.bluez.Profile1.NewConnection()\r\nbluealsa: bluez.c:778: HSP Audio Gateway configured for device E4:22:A5:08:7B:FF\r\nbluealsa: transport.c:399: State transition: 0 -> 2\r\nbluealsa: transport.c:91: Created new IO thread: HSP Audio Gateway\r\nbluealsa: io.c:960: Starting IO loop: HSP Audio Gateway\r\nbluealsa: io.c:994: AT command: +VGS=08\r\nbluealsa: io.c:994: AT command: +VGM=15\r\nbluealsa: bluez.c:482: Endpoint method call: org.bluez.MediaEndpoint1.SelectConfiguration()\r\nbluealsa: bluez.c:482: Endpoint method call: org.bluez.MediaEndpoint1.SetConfiguration()\r\nbluealsa: bluez.c:416: A2DP Source (SBC) configured for device E4:22:A5:08:7B:FF\r\nbluealsa: bluez.c:418: Configuration: channels: 2, sampling: 48000\r\nbluealsa: transport.c:399: State transition: 0 -> 0\r\n```\r\n\r\nHeadset tells me \"PC connected\".\r\n\r\nGoing on:\r\n\r\n```\r\n~ pactl list | grep Legend\r\n```\r\n\r\nno output, nice.\r\n\r\n```\r\naplay -D bluealsa applause.wav\r\n```\r\n\r\nGives the following output and plays the applause in my ear:\r\n\r\n```\r\nbluealsa-pcm.c:101: Getting transport for E4:22:A5:08:7B:FF profile 1\r\nbluealsa-pcm.c:502: Setting constraints\r\nPlaying WAVE 'applause.wav' : Signed 16 bit Little Endian, Rate 44100 Hz, Stereo\r\nWarning: rate is not accurate (requested = 44100Hz, got = 48000Hz)\r\n         please, try the plug plugin (-Dplug:bluealsa)\r\nbluealsa-pcm.c:337: Initializing HW\r\nbluealsa-pcm.c:137: Requesting PCM open for E4:22:A5:08:7B:FF\r\nbluealsa-pcm.c:154: Opening PCM FIFO (mode: WR): /var/run/bluealsa/hci0-E4:22:A5:08:7B:FF-1\r\nbluealsa-pcm.c:355: FIFO buffer size: 4096\r\nbluealsa-pcm.c:359: Selected HW buffer: 23 periods x 4096 bytes\r\nbluealsa-pcm.c:390: Prepared\r\nbluealsa-pcm.c:296: Starting\r\nbluealsa-pcm.c:238: Starting IO loop\r\n^CAborted by signal Interrupt...\r\naplay: pcm_write:2004: write error: Interrupted system call\r\nbluealsa-pcm.c:311: Stopping\r\nbluealsa-pcm.c:366: Freeing HW\r\nbluealsa-pcm.c:182: Closing PCM for E4:22:A5:08:7B:FF\r\nbluealsa-pcm.c:327: Closing plugin\r\n```\r\n\r\nAnd then:\r\n```\r\narecord -d 3 -D bluealsa test.wav\r\n```\r\n\r\nGives the output:\r\n\r\n```\r\nbluealsa-pcm.c:101: Getting transport for E4:22:A5:08:7B:FF profile 2\r\nALSA lib bluealsa-pcm.c:619:(_snd_pcm_bluealsa_open) Couldn't get BlueALSA transport: No such device\r\narecord: main:786: audio open error: No such device\r\n```\r\n\r\nOn the `bluealsa` output we now have the new output (for both aplay and arecord, I forgot to split them...):\r\n\r\n```\r\nbluealsa: ctl.c:411: New client accepted: 8\r\nbluealsa: ctl.c:414: +-+-\r\nbluealsa: ctl.c:414: +-+-\r\nbluealsa: ctl.c:226: PCM requested for E4:22:A5:08:7B:FF profile 1\r\nbluealsa: transport.c:481: New transport: 10 (MTU: R:672 W:672)\r\nbluealsa: ctl.c:414: +-+-\r\nbluealsa: bluez.c:990: Signal: PropertiesChanged: org.bluez.MediaTransport1\r\nbluealsa: transport.c:399: State transition: 1 -> 2\r\nbluealsa: transport.c:91: Created new IO thread: A2DP Source (SBC)\r\nbluealsa: io.c:71: Opening FIFO for reading: /var/run/bluealsa/hci0-E4:22:A5:08:7B:FF-1\r\nbluealsa: io.c:448: Starting IO loop: A2DP Source (SBC)\r\nbluealsa: transport.c:616: Cleaning PCM FIFO: /var/run/bluealsa/hci0-E4:22:A5:08:7B:FF-1\r\nbluealsa: transport.c:623: Closing PCM: 11\r\nbluealsa: transport.c:528: Releasing transport: A2DP Source (SBC)\r\nbluealsa: transport.c:556: Closing BT: 10\r\nbluealsa: io.c:61: Exiting IO thread\r\nbluealsa: ctl.c:414: +-+-\r\nbluealsa: bluez.c:990: Signal: PropertiesChanged: org.bluez.MediaTransport1\r\nbluealsa: transport.c:399: State transition: 0 -> 0\r\nbluealsa: ctl.c:385: Client closed connection: 8\r\nbluealsa: ctl.c:414: +-+-\r\nbluealsa: ctl.c:411: New client accepted: 8\r\nbluealsa: ctl.c:414: +-+-\r\nbluealsa: ctl.c:414: +-+-\r\nbluealsa: ctl.c:385: Client closed connection: 8\r\nbluealsa: ctl.c:414: +-+-\r\n```"},"comment":{"url":"https://api.github.com/repos/Arkq/bluez-alsa/issues/comments/260142323","html_url":"https://github.com/Arkq/bluez-alsa/issues/7#issuecomment-260142323","issue_url":"https://api.github.com/repos/Arkq/bluez-alsa/issues/7","id":260142323,"user":{"login":"aufziehvogel","id":3071022,"avatar_url":"https://avatars.githubusercontent.com/u/3071022?v=3","gravatar_id":"","url":"https://api.github.com/users/aufziehvogel","html_url":"https://github.com/aufziehvogel","followers_url":"https://api.github.com/users/aufziehvogel/followers","following_url":"https://api.github.com/users/aufziehvogel/following{/other_user}","gists_url":"https://api.github.com/users/aufziehvogel/gists{/gist_id}","starred_url":"https://api.github.com/users/aufziehvogel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aufziehvogel/subscriptions","organizations_url":"https://api.github.com/users/aufziehvogel/orgs","repos_url":"https://api.github.com/users/aufziehvogel/repos","events_url":"https://api.github.com/users/aufziehvogel/events{/privacy}","received_events_url":"https://api.github.com/users/aufziehvogel/received_events","type":"User","site_admin":false},"created_at":"2016-11-12T19:19:07Z","updated_at":"2016-11-12T19:19:07Z","body":"hm, maybe it is a problem with the bluez library and my headset, who knows... With PulseAudio I didn't even manage to play music to my headset. I have the feeling it uses a call protocol and I should answer the call from my headset, but that also did not work.\r\n\r\nI'm having the idea that when I want to record through `bluez-alsa` it might also be recognized as an incoming call somehow. Tried to hit the *answer* button, this only lead to `bluealsa: io.c:1064: AT command: +CKPD=200` in the `bluealsa` output.\r\n\r\nThe headset has three options to answer calls:\r\n1. click button\r\n2. take headset and put on ear (if not already worn)\r\n3. say \"answer\"\r\n\r\n1. and 2. both lead to the signal `bluealsa: io.c:1064: AT command: +CKPD=200`, saying \"answer\" did nothing (but who knows if I did it right, never tried this before). So I am pretty positive, that this has something to do with the phone call functionality.\r\n\r\nI'm just not sure if you can do it or if `bluez` guys would have to do it and did not do yet. As said, I tried to play some music with PulseAudio, which also lead to this incoming call beep in my headset. So I pushed the button and nothing happened..."}}
{"actor":{"display_login":"aufziehvogel"}}