Bug 98160

Summary: Chinese characters in device description of bluetooth sink been stripped
Product: PulseAudio Reporter: LiuYan <lovetide>
Component: modulesAssignee: pulseaudio-bugs
Status: RESOLVED FIXED QA Contact: pulseaudio-bugs
Severity: normal    
Priority: medium CC: lennart
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: pacmd screenshot
pavucontrol screenshot
Tanu Kaskinen's patch works

Description LiuYan 2016-10-08 08:51:56 UTC
Created attachment 127135 [details]
pacmd screenshot

I setup a bluetooth speaker using pulseaudio + pulseaudio-module-bluetooth + bluez, and a physical bluetooth adapter on host computer, and I changed the bluetooth device alias to "蓝牙音箱 Bluetooth Speaker [DELL Optiplex 3300]".

Then I connected to this bluetooth device on client computer, but I can't see "蓝牙音箱" characters in pavucontrol or mate-volume-control or pacmd, like they are been stripped out.

        device.description = " Bluetooth Speaker [DELL Optiplex 3300]"

It would be nice to support multibytes characters in pulseaudio-module-bluetooth as the alsa module did:

        device.api = "alsa"
        device.description = "内部音频 模拟立体声"

See pacmd outputs on client computer:
$ pacmd
>>> list-sinks
  ...
  ...
  ...

  index: 1
    name: <bluez_sink.00_1A_7D_DA_71_0B>
    driver: <module-bluez5-device.c>
    flags: HARDWARE DECIBEL_VOLUME LATENCY
    state: IDLE
    suspend cause:
    priority: 9030
    volume: front-left: 30813 /  47% / -19.66 dB,   front-right: 30813 /  47% / -19.66 dB
            balance 0.00
    base volume: 65536 / 100% / 0.00 dB
    volume steps: 65537
    muted: no
    current latency: 27.86 ms
    max request: 2 KiB
    max rewind: 0 KiB
    monitor source: 2
    sample spec: s16le 2ch 44100Hz
    channel map: front-left,front-right
                 立体声
    used by: 0
    linked by: 1
    fixed latency: 39.51 ms
    card: 2 <bluez_card.00_1A_7D_DA_71_0B>
    module: 30
    properties:
        bluetooth.protocol = "a2dp_sink"
        device.description = " Bluetooth Speaker [DELL Optiplex 3300]"
        device.string = "00:1A:7D:DA:71:0B"
        device.api = "bluez"
        device.class = "sound"
        device.bus = "bluetooth"
        bluez.path = "/org/bluez/hci0/dev_00_1A_7D_DA_71_0B"
        bluez.class = "0x0c0108"
        bluez.alias = "蓝牙音箱 Bluetooth Speaker [DELL Optiplex 3300]"
        device.icon_name = "audio-card-bluetooth"
    ports:
        unknown-output: 蓝牙输出  (priority 0, latency offset 0 usec, available: yes)
            properties:
                   active port: <unknown-output>
Comment 1 LiuYan 2016-10-08 08:55:03 UTC
Created attachment 127136 [details]
pavucontrol screenshot
Comment 2 Tanu Kaskinen 2016-10-10 09:16:26 UTC
How did you change the device alias? I'd like to test this myself.
Comment 3 LiuYan 2016-10-10 09:32:44 UTC
(In reply to Tanu Kaskinen from comment #2)
> How did you change the device alias? I'd like to test this myself.

If you mean the bluetooth alias, it is done on the server side.

  # cat /var/lib/bluetooth/THE_MAC_ADDRESS_OF_YOUR_BLUETOOTH_DEVICE/settings
  [General]
  Discoverable=true
  DiscoverableTimeout=0
  Alias=蓝牙音箱 Bluetooth Speaker [DELL Optiplex 3300]

Run blueman-applet under root account also can change this alias.

After done, issue `systemctl restart bluetooth` to let new alias taken effect.

Then connect this bluetooth on the client computer. The rest test all happened on client computer. It's annoying especially all characters in bluetooth alias are all Chinese characters (perhaps happens on other multibytes characters too).

I didn't/can't change the 'device.description' string of pulseaudio sink. I expected it's identical to the 'bluez.alias' string, but it's not -- all Chinese characters had been stripped out.
Comment 4 Tanu Kaskinen 2016-10-11 14:30:09 UTC
In the end I was not able to configure the alias according to your instructions, because I don't have two computers as in your setup, and bluez 5 worked even worse than usual, but thanks anyway! I found out how to configure the alias with bluez 4, so I was able to test this.

I submitted a fix: https://patchwork.freedesktop.org/patch/114930/
Comment 5 LiuYan 2016-10-12 04:48:19 UTC
(In reply to Tanu Kaskinen from comment #4)
> In the end I was not able to configure the alias according to your
> instructions, because I don't have two computers as in your setup, and bluez
> 5 worked even worse than usual, but thanks anyway! I found out how to
> configure the alias with bluez 4, so I was able to test this.
> 
> I submitted a fix: https://patchwork.freedesktop.org/patch/114930/

I actually like bluez-5, the bluetoothctl utility is handy for me. I installed Fedora-rawhide and Debian-Unstable to replace the old CentOS-6 to use bluez-5.


Thanks for fixing, I'll wait for Fedora to update pulseaudio package to test it.
Comment 6 LiuYan 2016-10-16 15:21:32 UTC
Created attachment 127332 [details]
Tanu Kaskinen's patch works

I had to build pulseaudio myself to test the patch.

The device description of bluetooth sink now show Chinese characters properly (despite my build seems not right, because it does not show the alsa sink).

See the new screenshot.
Comment 7 Tanu Kaskinen 2017-04-02 18:16:30 UTC
The patch is now finally applied to master (it was stuck in the review queue for a long time).
Comment 8 LiuYan 2017-06-20 06:10:58 UTC
(In reply to Tanu Kaskinen from comment #7)
> The patch is now finally applied to master (it was stuck in the review queue
> for a long time).

Thanks!

Now I'm requesting Fedora to update pulseaudio.
https://bugzilla.redhat.com/show_bug.cgi?id=1463074

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.