Bug 57239

Summary: pulseaudio 2.99.2 make new device from same device if is this device reconnected - show device more times in mixer
Product: PulseAudio Reporter: alium <info>
Component: coreAssignee: Tanu Kaskinen <tanuk>
Status: RESOLVED FIXED QA Contact: pulseaudio-bugs
Severity: blocker    
Priority: high CC: lennart
Version: unspecified   
Hardware: Other   
OS: Linux (All)   
Whiteboard:
i915 platform: i915 features:
Bug Depends on:    
Bug Blocks: 50956    
Attachments: 3x reconnected device = 3x make pulse new device in mixer
veromix mixer and duplicite same device
pactl list log
bluez audio config file
default.pa

Description alium 2012-11-18 00:33:02 UTC
Created attachment 70206 [details]
3x reconnected device = 3x make pulse new device in mixer

After disconnection the BT headphones and re-connection same device, pulseadio 2.99.2 make new device in mixer. Can't rebember the befor connected device.

Please see screenshot. I have 4x connect and disconnect my BT headphones.

In the log is 3x reconected device.

bluez 4.101, sbc 1.0, alsa 1.0.26, kernel 3.6.6
Comment 1 alium 2012-11-18 00:35:27 UTC
Created attachment 70207 [details]
veromix mixer and duplicite same device
Comment 2 alium 2012-11-18 00:39:27 UTC
Created attachment 70208 [details]
pactl list log
Comment 3 Tanu Kaskinen 2012-11-18 21:01:45 UTC
Thanks for the report, I can reproduce this. The old instance of module-bluetooth-device doesn't get unloaded at disconnection like it should. I will try to track this down and get this fixed. Looks like release blocker material to me.
Comment 4 Tanu Kaskinen 2012-11-18 21:56:32 UTC
Patch sent to the mailing list: http://thread.gmane.org/gmane.comp.audio.pulseaudio.general/15005
Comment 5 alium 2012-11-18 22:53:22 UTC
I tested the patch and for me works ok (i have duplications no more), but i have one limitation:

If i connect BT headphones, works all ok (connected and play), but after reconnect the BT headphones is for new connected device set as the default profile "Disabled" (headphones are re-connected, but no sound). How to set up on the new device automatically profile "A2DP"?
Comment 6 alium 2012-11-18 23:23:05 UTC
After restart the computer, i can not switch the profile to A2DP. The profil set automatically to "Disabled". (Have i wrong config's files?) Version 2.1 works without problems

Log:

...
D: [pulseaudio] protocol-dbus.c: Interface org.PulseAudio.Core1.Stream added for object /org/pulseaudio/core1/record_stream4
D: [pulseaudio] protocol-dbus.c: Interface org.PulseAudio.Core1.Device removed from object /org/pulseaudio/core1/sink1
D: [pulseaudio] protocol-dbus.c: Interface org.PulseAudio.Core1.Sink removed from object /org/pulseaudio/core1/sink1
D: [pulseaudio] protocol-dbus.c: Interface org.PulseAudio.Core1.DevicePort removed from object /org/pulseaudio/core1/sink1/port0
D: [pulseaudio] module-rescue-streams.c: No sink inputs to move away.
D: [pulseaudio] protocol-dbus.c: Interface org.PulseAudio.Core1.Device removed from object /org/pulseaudio/core1/source2
D: [pulseaudio] protocol-dbus.c: Interface org.PulseAudio.Core1.Source removed from object /org/pulseaudio/core1/source2
D: [pulseaudio] module-rescue-streams.c: No evacuation source found.
D: [pulseaudio] module-suspend-on-idle.c: Sink bluez_sink.00_1E_7C_00_2A_55 becomes idle, timeout in 5 seconds.
D: [pulseaudio] core-subscribe.c: Dropped redundant event due to remove event.
D: [pulseaudio] protocol-dbus.c: Interface org.PulseAudio.Core1.Device removed from object /org/pulseaudio/core1/source3
D: [pulseaudio] protocol-dbus.c: Interface org.PulseAudio.Core1.Source removed from object /org/pulseaudio/core1/source3
D: [pulseaudio] protocol-dbus.c: Interface org.PulseAudio.Core1.DevicePort removed from object /org/pulseaudio/core1/source3/port0
D: [pulseaudio] module-rescue-streams.c: No evacuation source found.
D: [pulseaudio] module-suspend-on-idle.c: Source bluez_source.00_1E_7C_00_2A_55 becomes idle, timeout in 5 seconds.
D: [pulseaudio] module-suspend-on-idle.c: Source bluez_source.00_1E_7C_00_2A_55 becomes idle, timeout in 5 seconds.
D: [pulseaudio] core-subscribe.c: Dropped redundant event due to remove event.
D: [bluetooth] module-bluetooth-device.c: IO thread shutdown requested, stopping cleanly
D: [bluetooth] module-bluetooth-device.c: Releasing transport /org/bluez/266/hci0/dev_00_1E_7C_00_2A_55/fd6
D: [alsa-sink] protocol-native.c: Underrun on '"Hukvaldy Live 2007" od "Jaromír Nohavica"', 0 bytes in queue.
I: [bluetooth] bluetooth-util.c: Transport /org/bluez/266/hci0/dev_00_1E_7C_00_2A_55/fd6 released
D: [bluetooth] module-bluetooth-device.c: Audio stream torn down
D: [bluetooth] module-bluetooth-device.c: IO thread shutting down
I: [pulseaudio] sink.c: Freeing sink 1 "bluez_sink.00_1E_7C_00_2A_55"
W: [pulseaudio] module-bluetooth-device.c: Profile has no transport
I: [pulseaudio] card.c: Changed profile of card 1 "bluez_card.00_1E_7C_00_2A_55" to off
D: [pulseaudio] protocol-dbus.c: Interface org.PulseAudio.Core1.Stream removed from object /org/pulseaudio/core1/record_stream2
I: [pulseaudio] source-output.c: Freeing output 2 "Rozpoznání vrcholů"
I: [pulseaudio] source.c: Freeing source 2 "bluez_sink.00_1E_7C_00_2A_55.monitor"
D: [pulseaudio] flist.c: pulsecore/hashmap.c: entries flist is full (don't worry)
D: [pulseaudio] flist.c: pulsecore/hashmap.c: entries flist is full (don't worry)
D: [pulseaudio] flist.c: pulsecore/hashmap.c: entries flist is full (don't worry)
D: [pulseaudio] flist.c: pulsecore/hashmap.c: entries flist is full (don't worry)
D: [pulseaudio] protocol-dbus.c: Interface org.PulseAudio.Core1.Stream removed from object /org/pulseaudio/core1/record_stream3
D: [pulseaudio] flist.c: pulsecore/hashmap.c: entries flist is full (don't worry)
D: [pulseaudio] flist.c: pulsecore/hashmap.c: entries flist is full (don't worry)
D: [pulseaudio] flist.c: pulsecore/hashmap.c: entries flist is full (don't worry)
D: [pulseaudio] flist.c: pulsecore/hashmap.c: entries flist is full (don't worry)
D: [pulseaudio] flist.c: pulsecore/hashmap.c: entries flist is full (don't worry)
D: [pulseaudio] flist.c: pulsecore/hashmap.c: entries flist is full (don't worry)
D: [pulseaudio] flist.c: pulsecore/hashmap.c: entries flist is full (don't worry)
I: [pulseaudio] source-output.c: Freeing output 3 "Rozpoznání vrcholů"
I: [pulseaudio] source.c: Freeing source 3 "bluez_source.00_1E_7C_00_2A_55"
D: [pulseaudio] bluetooth-util.c: dbus: interface=org.bluez.Headset, path=/org/bluez/266/hci0/dev_00_1E_7C_00_2A_55, member=PropertyChanged
D: [pulseaudio] bluetooth-util.c: dbus: property 'State' changed to value 'connected'
D: [pulseaudio] module-bluetooth-device.c: dbus: interface=org.bluez.Headset, path=/org/bluez/266/hci0/dev_00_1E_7C_00_2A_55, member=PropertyChanged
D: [pulseaudio] module-bluetooth-device.c: dbus: org.bluez.Headset property 'State' changed to value 'connected'
D: [pulseaudio] device-port.c: Setting port hsp-output to status unknown
D: [pulseaudio] device-port.c: Setting port hsp-input to status unknown
D: [pulseaudio] core-subscribe.c: Dropped redundant event due to change event.
D: [pulseaudio] bluetooth-util.c: dbus: interface=org.bluez.Headset, path=/org/bluez/266/hci0/dev_00_1E_7C_00_2A_55, member=PropertyChanged
D: [pulseaudio] module-bluetooth-device.c: dbus: interface=org.bluez.Headset, path=/org/bluez/266/hci0/dev_00_1E_7C_00_2A_55, member=PropertyChanged
D: [alsa-sink] protocol-native.c: Requesting rewind due to rewrite.
D: [alsa-sink] alsa-sink.c: Requested to rewind 29332 bytes.
D: [alsa-sink] alsa-sink.c: Limited to 2536 bytes.
D: [alsa-sink] alsa-sink.c: before: 634
D: [alsa-sink] alsa-sink.c: after: 634
D: [alsa-sink] alsa-sink.c: Rewound 2536 bytes.
D: [alsa-sink] sink.c: Processing rewind...
D: [alsa-sink] sink.c: latency = 1341
D: [alsa-sink] sink-input.c: Have to rewind 2536 bytes on render memblockq.
D: [alsa-sink] sink-input.c: Have to rewind 2536 bytes on implementor.
D: [alsa-sink] source.c: Processing rewind...
D: [alsa-sink] protocol-native.c: Requesting rewind due to rewrite.
D: [alsa-sink] alsa-sink.c: Requested to rewind 20884 bytes.
D: [alsa-sink] alsa-sink.c: Limited to 3240 bytes.
D: [alsa-sink] alsa-sink.c: before: 810
D: [alsa-sink] alsa-sink.c: after: 810
D: [alsa-sink] alsa-sink.c: Rewound 3240 bytes.
D: [alsa-sink] sink.c: Processing rewind...
D: [alsa-sink] sink.c: latency = 1415
D: [alsa-sink] sink-input.c: Have to rewind 3240 bytes on render memblockq.
D: [alsa-sink] sink-input.c: Have to rewind 3240 bytes on implementor.
D: [alsa-sink] source.c: Processing rewind...
Comment 7 Tanu Kaskinen 2012-11-19 12:50:04 UTC
(In reply to comment #5)
> I tested the patch and for me works ok (i have duplications no more), but i
> have one limitation:
> 
> If i connect BT headphones, works all ok (connected and play), but after
> reconnect the BT headphones is for new connected device set as the default
> profile "Disabled" (headphones are re-connected, but no sound). How to set
> up on the new device automatically profile "A2DP"?

If you change the profile to a2dp, it should be remembered. I can reproduce this problem if pavucontrol is running while disconnecting the headset. For some reason pavucontrol sets the card profile to "off" when the device is disconnected even if the user doesn't touch pavucontrol at all. That's a bug in pavucontrol, I'll investigate that.

Do you have this problem if pavucontrol isn't running? Or veromix, as you seem to be using it?

(In reply to comment #6)
> After restart the computer, i can not switch the profile to A2DP. The profil
> set automatically to "Disabled". (Have i wrong config's files?) Version 2.1
> works without problems

Are you saying that you can't switch the profile to a2dp at all?
Comment 8 alium 2012-11-19 13:27:52 UTC
(In reply to comment #7)
> (In reply to comment #5)
> > I tested the patch and for me works ok (i have duplications no more), but i
> > have one limitation:
> > 
> > If i connect BT headphones, works all ok (connected and play), but after
> > reconnect the BT headphones is for new connected device set as the default
> > profile "Disabled" (headphones are re-connected, but no sound). How to set
> > up on the new device automatically profile "A2DP"?
> 
> If you change the profile to a2dp, it should be remembered. I can reproduce
> this problem if pavucontrol is running while disconnecting the headset. For
> some reason pavucontrol sets the card profile to "off" when the device is
> disconnected even if the user doesn't touch pavucontrol at all. That's a bug
> in pavucontrol, I'll investigate that.
> 
> Do you have this problem if pavucontrol isn't running? Or veromix, as you
> seem to be using it?

Yes, momentaly i have problems select the profile A2DP. 

When choosing A2DP profile switches back to "Disabled". Veromix has the same problems. 

If I only connect the headphones, then they automatically switch to the HSP profile and profile HSP works, if i play the music.

If I connect headphones (and the music is before already playing), then switch to the profile HSP, but going no sound to the headphones (silence).

The A2DP profile but do not switch. when I switch manually the profil to A2DP, device does not show more in the mixer, as it would not be connected.

See my config's files, but i thing is bug od pulseaudio.
> 
> (In reply to comment #6)
> > After restart the computer, i can not switch the profile to A2DP. The profil
> > set automatically to "Disabled". (Have i wrong config's files?) Version 2.1
> > works without problems
> 
> Are you saying that you can't switch the profile to a2dp at all?

Yes.
Comment 9 alium 2012-11-19 13:28:26 UTC
(In reply to comment #7)
> (In reply to comment #5)
> > I tested the patch and for me works ok (i have duplications no more), but i
> > have one limitation:
> > 
> > If i connect BT headphones, works all ok (connected and play), but after
> > reconnect the BT headphones is for new connected device set as the default
> > profile "Disabled" (headphones are re-connected, but no sound). How to set
> > up on the new device automatically profile "A2DP"?
> 
> If you change the profile to a2dp, it should be remembered. I can reproduce
> this problem if pavucontrol is running while disconnecting the headset. For
> some reason pavucontrol sets the card profile to "off" when the device is
> disconnected even if the user doesn't touch pavucontrol at all. That's a bug
> in pavucontrol, I'll investigate that.
> 
> Do you have this problem if pavucontrol isn't running? Or veromix, as you
> seem to be using it?

Yes, momentaly i have problems select the profile A2DP. 

When choosing A2DP profile switches back to "Disabled". Veromix has the same problems. 

If I only connect the headphones, then they automatically switch to the HSP profile and profile HSP works, if i play the music.

If I connect headphones (and the music is before already playing), then switch to the profile HSP, but going no sound to the headphones (silence).

The A2DP profile but do not switch. when I switch manually the profil to A2DP, device does not show more in the mixer, as it would not be connected.

See my config's files, but i thing is bug of pulseaudio.
> 
> (In reply to comment #6)
> > After restart the computer, i can not switch the profile to A2DP. The profil
> > set automatically to "Disabled". (Have i wrong config's files?) Version 2.1
> > works without problems
> 
> Are you saying that you can't switch the profile to a2dp at all?

Yes.
Comment 10 alium 2012-11-19 13:29:47 UTC
Created attachment 70251 [details]
bluez audio config file
Comment 11 alium 2012-11-19 13:30:37 UTC
Created attachment 70252 [details]
default.pa
Comment 12 Tanu Kaskinen 2012-11-19 13:32:56 UTC
I sent a fix for the pavucontrol bug to the mailing list: http://thread.gmane.org/gmane.comp.audio.pulseaudio.general/15015
Comment 13 alium 2012-11-19 13:41:21 UTC
(In reply to comment #12)
> I sent a fix for the pavucontrol bug to the mailing list:
> http://thread.gmane.org/gmane.comp.audio.pulseaudio.general/15015

Tested, but no effect for my problems.
Comment 14 alium 2012-11-19 14:10:25 UTC
I found the problem, i thing.

The problem with not switches profile make the adding  Enable=Socket to the /etc/bluetooth/audio.conf.


I installed again pulseaudio 2.99.2 - profile switch OK.
Delete ./config/pulse, install patched pulseaudio 2.99.2 - profile switched OK.


Without Enable=Socket works profile switching without problems.
Comment 15 alium 2012-11-19 14:21:59 UTC
So, i am little confused.

The HSP profil yet works OK, I can switch to the profile A2DP (= not switched back to "Disabled"), but it reall the profile A2DP is not switched -> stay profile HSP. 

Veromix pavucontrol and have the same problem.



$ pulseaudio 
E: [pulseaudio] bluetooth-util.c: org.bluez.HandsfreeGateway.GetProperties() failed: org.freedesktop.DBus.Error.UnknownMethod: Method "GetProperties" with signature "" on interface "org.bluez.HandsfreeGateway" doesn't exist
E: [pulseaudio] bluetooth-util.c: org.bluez.HandsfreeGateway.GetProperties() failed: org.freedesktop.DBus.Error.UnknownMethod: Method "GetProperties" with signature "" on interface "org.bluez.HandsfreeGateway" doesn't exist
W: [pulseaudio] module-bluetooth-device.c: A2DP Sink is not connected, refused to switch profile
W: [pulseaudio] module-bluetooth-device.c: A2DP Sink is not connected, refused to switch profile
W: [pulseaudio] module-bluetooth-device.c: A2DP Sink is not connected, refused to switch profile
W: [pulseaudio] module-bluetooth-device.c: A2DP Sink is not connected, refused to switch profile
Comment 16 alium 2012-11-19 14:37:25 UTC
(In reply to comment #15)
> So, i am little confused.
> 
> The HSP profil yet works OK, I can switch to the profile A2DP (= not
> switched back to "Disabled"), but it reall the profile A2DP is not switched
> -> stay profile HSP. 
> 
> Veromix pavucontrol and have the same problem.
> 
> 
> 
> $ pulseaudio 
> E: [pulseaudio] bluetooth-util.c: org.bluez.HandsfreeGateway.GetProperties()
> failed: org.freedesktop.DBus.Error.UnknownMethod: Method "GetProperties"
> with signature "" on interface "org.bluez.HandsfreeGateway" doesn't exist
> E: [pulseaudio] bluetooth-util.c: org.bluez.HandsfreeGateway.GetProperties()
> failed: org.freedesktop.DBus.Error.UnknownMethod: Method "GetProperties"
> with signature "" on interface "org.bluez.HandsfreeGateway" doesn't exist
> W: [pulseaudio] module-bluetooth-device.c: A2DP Sink is not connected,
> refused to switch profile
> W: [pulseaudio] module-bluetooth-device.c: A2DP Sink is not connected,
> refused to switch profile
> W: [pulseaudio] module-bluetooth-device.c: A2DP Sink is not connected,
> refused to switch profile
> W: [pulseaudio] module-bluetooth-device.c: A2DP Sink is not connected,
> refused to switch profile

I fixed this with install SBC library 1.0 and uncommented lines in the /etc/bluetooth/audio.conf:
[A2DP]
SBCSources=1


[transition to the new version, this time harder than I thought :-)]

For me works yet all :-)
Comment 17 Tanu Kaskinen 2012-11-22 22:36:46 UTC
I couldn't fully follow whether you still have some complaints, but if I interpret the last message correctly, everything is fine now?

The "duplicate devices" bug is now officially fixed: http://cgit.freedesktop.org/pulseaudio/pulseaudio/commit/?id=41055145d7563c20fd58ed4b0a9b349c2363bb02
Comment 18 alium 2012-11-22 22:40:43 UTC
(In reply to comment #17)
> I couldn't fully follow whether you still have some complaints, but if I
> interpret the last message correctly, everything is fine now?
> 
> The "duplicate devices" bug is now officially fixed:
> http://cgit.freedesktop.org/pulseaudio/pulseaudio/commit/
> ?id=41055145d7563c20fd58ed4b0a9b349c2363bb02

Yes, everything is fine. Thank you!

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.