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

How to route SCO over PCM? #308

Closed
adang322 opened this issue Mar 12, 2020 · 5 comments
Closed

How to route SCO over PCM? #308

adang322 opened this issue Mar 12, 2020 · 5 comments

Comments

@adang322
Copy link

Hi,
I would like to route the SCO over PCM but not HCI, but have no idea how to configure it in bluez-alsa.
Any ones know it?
Thank you!

@StuartIanNaylor
Copy link

StuartIanNaylor commented Mar 12, 2020

Dunno really as been trying to get HFP/HSP profles working that in #306.
Can you get hfp/hsp profiles working over HCI?
I just get

Mar 11 00:22:54 raspberrypi /usr/bin/bluealsa: ../../src/bluealsa-dbus.c:172: Called: org.bluealsa.Manager1.GetPCMs()
Mar 11 00:22:54 raspberrypi bluealsa[365]: /usr/bin/bluealsa: 279.401448574: D: ../../src/bluealsa-dbus.c:172: Called: org.bluealsa.Manager1.GetPCMs()
Mar 11 00:22:54 raspberrypi /usr/bin/bluealsa: ../../src/bluealsa-dbus.c:373: Called: org.bluealsa.PCM1.Open()
Mar 11 00:22:54 raspberrypi bluealsa[365]: /usr/bin/bluealsa: 279.414051407: D: ../../src/bluealsa-dbus.c:373: Called: org.bluealsa.PCM1.Open()
Mar 11 00:22:54 raspberrypi bluealsa[365]: /usr/bin/bluealsa: 279.415505463: E: Couldn't establish SCO link: Protocol not supported
M

Guess the old bluez details might tell you as not sure as there is also the old bluetooth-alsa that might give some ideas as it used to be a kernel module bt_sco but don't even know where its handled
https://www.kernel.org/doc/ols/2008/ols2008v1-pages-193-196.pdf
https://sourceforge.net/projects/bluetooth-alsa/

Anyway enough of my ignorance, but so want sco for HFP/HSP profiles

@adang322
Copy link
Author

adang322 commented Mar 13, 2020

Yes. i can get hfp/hsp profiles working over HCI. (bluez5.34 + bluez-alsa).

I would like to route SCO over PCM(TDM/I2S), but I don't know where to configure it in bluez-alsa.
I found that in bluez4.101, there is an option "SCORouting" for SCO can be set to PCM or HCI in audio.conf, but it seems that it was removed in new version.

@StuartIanNaylor
Copy link

StuartIanNaylor commented Mar 13, 2020

So its almost the oppisite of the pcm fix for the Pi
raspberrypi/linux#2229 (comment)
I know sudo hcitool cmd 0x3F 0x01C 0x01 0x02 0x00 0x01 0x01 swaps from pcm to hci for the broadcom BT.

I dunno but presuming the routing now is a hardware thing? As above.
Even on the pi I don't actually know which octet swaps between pcm and hci but presume one of them does.
http://dubsman.gitlab.io/posts/what-the-hell-does-hci-tool-do.html
Just seems totally dependent on hardware.
https://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/Bluetooth/#index10h3

Apols but at a guess its prob something you can do if you can get the hci cmd for your hardware.

I have a PI4 but using a USB dongle as think on raspberry even if you fix the routing it still has a MTU fault so you get pops and hissing as its fixed on the pi @ 64 but is usually setup as 48.

PS what distro/hardware you using?

@adang322
Copy link
Author

My hardware: dspg(soc) + Realtek(USB BT).

@adang322
Copy link
Author

I disabled below codes in function "io_thread_sco(..)" for testing.
/*if (release) { t->release(t); asrs.frames = 0; } else */

and then run "dbus-send --system --type=method_call --print-reply --dest=org.bluealsa /org/bluealsa/hci0/dev_XX_XX_XX_XX_XX_XX/sco org.bluealsa.PCM1.Open string:sink (or source)" to open SCO connect only. No need spk_pcm and mic_pcm. then play audio through PCM(TDM) interface, it will be ok.

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