Failed to set card profile to 'a2dp_sink' , help












6















I'm using my bluetooth headphones with ubuntu desktop, which has bluetooth dongle. Right now I can connect headphones every time (wasn't so at the start, needed to repair them about every time I wanted to connect).
So now it connects, but doesn't output any sound. Sometimes restarting pulse audio helps, sometimes it doesn't, I'm very tired of it and I would like to dig to the root of a problem.



pacmd set-card-profile $(pacmd list-cards | grep -Pzo '(?<=index: )(d+n)(?=.*bluez_card)') a2dp_sink;



This gives me Failed to set card profile to 'a2dp_sink'. Help me to dig further.



#! /usr/bin/env zsh
pacmd set-card-profile $(pacmd list-cards | grep -Pzo '(?<=index: )(d+n)(?=.*bluez_card)') off;
echo -e 'disconnect 04:52:C7:0D:9E:13n quit'|bluetoothctl
sleep 5
echo -e 'connect 04:52:C7:0D:9E:13n quit'|bluetoothctl
sleep 5
pacmd set-card-profile $(pacmd list-cards | grep -Pzo '(?<=index: )(d+n)(?=.*bluez_card)') a2dp_sink;


This isn't helping.










share|improve this question



























    6















    I'm using my bluetooth headphones with ubuntu desktop, which has bluetooth dongle. Right now I can connect headphones every time (wasn't so at the start, needed to repair them about every time I wanted to connect).
    So now it connects, but doesn't output any sound. Sometimes restarting pulse audio helps, sometimes it doesn't, I'm very tired of it and I would like to dig to the root of a problem.



    pacmd set-card-profile $(pacmd list-cards | grep -Pzo '(?<=index: )(d+n)(?=.*bluez_card)') a2dp_sink;



    This gives me Failed to set card profile to 'a2dp_sink'. Help me to dig further.



    #! /usr/bin/env zsh
    pacmd set-card-profile $(pacmd list-cards | grep -Pzo '(?<=index: )(d+n)(?=.*bluez_card)') off;
    echo -e 'disconnect 04:52:C7:0D:9E:13n quit'|bluetoothctl
    sleep 5
    echo -e 'connect 04:52:C7:0D:9E:13n quit'|bluetoothctl
    sleep 5
    pacmd set-card-profile $(pacmd list-cards | grep -Pzo '(?<=index: )(d+n)(?=.*bluez_card)') a2dp_sink;


    This isn't helping.










    share|improve this question

























      6












      6








      6


      4






      I'm using my bluetooth headphones with ubuntu desktop, which has bluetooth dongle. Right now I can connect headphones every time (wasn't so at the start, needed to repair them about every time I wanted to connect).
      So now it connects, but doesn't output any sound. Sometimes restarting pulse audio helps, sometimes it doesn't, I'm very tired of it and I would like to dig to the root of a problem.



      pacmd set-card-profile $(pacmd list-cards | grep -Pzo '(?<=index: )(d+n)(?=.*bluez_card)') a2dp_sink;



      This gives me Failed to set card profile to 'a2dp_sink'. Help me to dig further.



      #! /usr/bin/env zsh
      pacmd set-card-profile $(pacmd list-cards | grep -Pzo '(?<=index: )(d+n)(?=.*bluez_card)') off;
      echo -e 'disconnect 04:52:C7:0D:9E:13n quit'|bluetoothctl
      sleep 5
      echo -e 'connect 04:52:C7:0D:9E:13n quit'|bluetoothctl
      sleep 5
      pacmd set-card-profile $(pacmd list-cards | grep -Pzo '(?<=index: )(d+n)(?=.*bluez_card)') a2dp_sink;


      This isn't helping.










      share|improve this question














      I'm using my bluetooth headphones with ubuntu desktop, which has bluetooth dongle. Right now I can connect headphones every time (wasn't so at the start, needed to repair them about every time I wanted to connect).
      So now it connects, but doesn't output any sound. Sometimes restarting pulse audio helps, sometimes it doesn't, I'm very tired of it and I would like to dig to the root of a problem.



      pacmd set-card-profile $(pacmd list-cards | grep -Pzo '(?<=index: )(d+n)(?=.*bluez_card)') a2dp_sink;



      This gives me Failed to set card profile to 'a2dp_sink'. Help me to dig further.



      #! /usr/bin/env zsh
      pacmd set-card-profile $(pacmd list-cards | grep -Pzo '(?<=index: )(d+n)(?=.*bluez_card)') off;
      echo -e 'disconnect 04:52:C7:0D:9E:13n quit'|bluetoothctl
      sleep 5
      echo -e 'connect 04:52:C7:0D:9E:13n quit'|bluetoothctl
      sleep 5
      pacmd set-card-profile $(pacmd list-cards | grep -Pzo '(?<=index: )(d+n)(?=.*bluez_card)') a2dp_sink;


      This isn't helping.







      sound bluetooth pulseaudio alsa headphones






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Feb 2 '17 at 19:31









      user1685095user1685095

      180212




      180212






















          3 Answers
          3






          active

          oldest

          votes


















          7














          I have seen this error and it is due to a bug with either pulseaudio or bluez. You may likely find that setting the audio profile to off, then disconnect from the headphones, reconnect to the headphones and then you may have no issues using A2DP. It appears that your script may do that but you may find pylover's a2dp.py python script will work for you


          wget https://gist.githubusercontent.com/pylover/d68be364adac5f946887b85e6ed6e7ae/raw/d698974910bbb7d016ec0ad08c1bf41b4b524364/a2dp.py
          alias headphones="a2dp.py 04:52:C7:0D:9E:13"


          Then when you want to use your headphones, just type headphones






          share|improve this answer



















          • 1





            It's not working for me

            – lamino
            Jun 13 '17 at 4:44






          • 1





            This py script worked like a charm for me..

            – merge delete
            Apr 27 '18 at 20:12



















          1














          I've tried setting the profile to off, disconnecting and reconnecting the bluetooth device, but still could not switch to a2dp_sink. I finally found a working solution here on the Debian wiki



          If you're using Gnome, Gnome Display Manager (GDM) 'captures' the A2DP sink on session start, which is why it's not available for the device to use. If you try to change the profile using the sound settings GUI, you'll notice that you can select A2DP Sink from the dropdown, but it simply switches back upon closing the dialogue. If you hit test speakers you'll notice it still only shows Mono.



          The article has details but to summarise:



          Create and add these lines to /var/lib/gdm3/.config/pulse/client.conf:



          autospawn = no
          daemon-binary = /bin/true


          Change the file's owner and group:



          sudo chown gdm:gdm /var/lib/gdm3/.config/pulse/client.conf


          Then disable pulseaudio startup:



          rm /var/lib/gdm3/.config/systemd/user/sockets.target.wants/pulseaudio.socket


          add this to /etc/pulse/default.pa:



          load-module module-switch-on-connect


          Then restart.






          share|improve this answer

































            0














            The way I fixed it is by doing away with gdm entirely, since it's so jealous of my A2DP sink and it doesn't look like anyone is fixing it. I consider it broken.



            sudo apt-get -y install slick-greeter


            And then select "lightdm". Good riddance.






            share|improve this answer























              Your Answer








              StackExchange.ready(function() {
              var channelOptions = {
              tags: "".split(" "),
              id: "89"
              };
              initTagRenderer("".split(" "), "".split(" "), channelOptions);

              StackExchange.using("externalEditor", function() {
              // Have to fire editor after snippets, if snippets enabled
              if (StackExchange.settings.snippets.snippetsEnabled) {
              StackExchange.using("snippets", function() {
              createEditor();
              });
              }
              else {
              createEditor();
              }
              });

              function createEditor() {
              StackExchange.prepareEditor({
              heartbeatType: 'answer',
              autoActivateHeartbeat: false,
              convertImagesToLinks: true,
              noModals: true,
              showLowRepImageUploadWarning: true,
              reputationToPostImages: 10,
              bindNavPrevention: true,
              postfix: "",
              imageUploader: {
              brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
              contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
              allowUrls: true
              },
              onDemand: true,
              discardSelector: ".discard-answer"
              ,immediatelyShowMarkdownHelp:true
              });


              }
              });














              draft saved

              draft discarded


















              StackExchange.ready(
              function () {
              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f879176%2ffailed-to-set-card-profile-to-a2dp-sink-help%23new-answer', 'question_page');
              }
              );

              Post as a guest















              Required, but never shown

























              3 Answers
              3






              active

              oldest

              votes








              3 Answers
              3






              active

              oldest

              votes









              active

              oldest

              votes






              active

              oldest

              votes









              7














              I have seen this error and it is due to a bug with either pulseaudio or bluez. You may likely find that setting the audio profile to off, then disconnect from the headphones, reconnect to the headphones and then you may have no issues using A2DP. It appears that your script may do that but you may find pylover's a2dp.py python script will work for you


              wget https://gist.githubusercontent.com/pylover/d68be364adac5f946887b85e6ed6e7ae/raw/d698974910bbb7d016ec0ad08c1bf41b4b524364/a2dp.py
              alias headphones="a2dp.py 04:52:C7:0D:9E:13"


              Then when you want to use your headphones, just type headphones






              share|improve this answer



















              • 1





                It's not working for me

                – lamino
                Jun 13 '17 at 4:44






              • 1





                This py script worked like a charm for me..

                – merge delete
                Apr 27 '18 at 20:12
















              7














              I have seen this error and it is due to a bug with either pulseaudio or bluez. You may likely find that setting the audio profile to off, then disconnect from the headphones, reconnect to the headphones and then you may have no issues using A2DP. It appears that your script may do that but you may find pylover's a2dp.py python script will work for you


              wget https://gist.githubusercontent.com/pylover/d68be364adac5f946887b85e6ed6e7ae/raw/d698974910bbb7d016ec0ad08c1bf41b4b524364/a2dp.py
              alias headphones="a2dp.py 04:52:C7:0D:9E:13"


              Then when you want to use your headphones, just type headphones






              share|improve this answer



















              • 1





                It's not working for me

                – lamino
                Jun 13 '17 at 4:44






              • 1





                This py script worked like a charm for me..

                – merge delete
                Apr 27 '18 at 20:12














              7












              7








              7







              I have seen this error and it is due to a bug with either pulseaudio or bluez. You may likely find that setting the audio profile to off, then disconnect from the headphones, reconnect to the headphones and then you may have no issues using A2DP. It appears that your script may do that but you may find pylover's a2dp.py python script will work for you


              wget https://gist.githubusercontent.com/pylover/d68be364adac5f946887b85e6ed6e7ae/raw/d698974910bbb7d016ec0ad08c1bf41b4b524364/a2dp.py
              alias headphones="a2dp.py 04:52:C7:0D:9E:13"


              Then when you want to use your headphones, just type headphones






              share|improve this answer













              I have seen this error and it is due to a bug with either pulseaudio or bluez. You may likely find that setting the audio profile to off, then disconnect from the headphones, reconnect to the headphones and then you may have no issues using A2DP. It appears that your script may do that but you may find pylover's a2dp.py python script will work for you


              wget https://gist.githubusercontent.com/pylover/d68be364adac5f946887b85e6ed6e7ae/raw/d698974910bbb7d016ec0ad08c1bf41b4b524364/a2dp.py
              alias headphones="a2dp.py 04:52:C7:0D:9E:13"


              Then when you want to use your headphones, just type headphones







              share|improve this answer












              share|improve this answer



              share|improve this answer










              answered Feb 2 '17 at 21:57









              Jeremy31Jeremy31

              8,37921365




              8,37921365








              • 1





                It's not working for me

                – lamino
                Jun 13 '17 at 4:44






              • 1





                This py script worked like a charm for me..

                – merge delete
                Apr 27 '18 at 20:12














              • 1





                It's not working for me

                – lamino
                Jun 13 '17 at 4:44






              • 1





                This py script worked like a charm for me..

                – merge delete
                Apr 27 '18 at 20:12








              1




              1





              It's not working for me

              – lamino
              Jun 13 '17 at 4:44





              It's not working for me

              – lamino
              Jun 13 '17 at 4:44




              1




              1





              This py script worked like a charm for me..

              – merge delete
              Apr 27 '18 at 20:12





              This py script worked like a charm for me..

              – merge delete
              Apr 27 '18 at 20:12













              1














              I've tried setting the profile to off, disconnecting and reconnecting the bluetooth device, but still could not switch to a2dp_sink. I finally found a working solution here on the Debian wiki



              If you're using Gnome, Gnome Display Manager (GDM) 'captures' the A2DP sink on session start, which is why it's not available for the device to use. If you try to change the profile using the sound settings GUI, you'll notice that you can select A2DP Sink from the dropdown, but it simply switches back upon closing the dialogue. If you hit test speakers you'll notice it still only shows Mono.



              The article has details but to summarise:



              Create and add these lines to /var/lib/gdm3/.config/pulse/client.conf:



              autospawn = no
              daemon-binary = /bin/true


              Change the file's owner and group:



              sudo chown gdm:gdm /var/lib/gdm3/.config/pulse/client.conf


              Then disable pulseaudio startup:



              rm /var/lib/gdm3/.config/systemd/user/sockets.target.wants/pulseaudio.socket


              add this to /etc/pulse/default.pa:



              load-module module-switch-on-connect


              Then restart.






              share|improve this answer






























                1














                I've tried setting the profile to off, disconnecting and reconnecting the bluetooth device, but still could not switch to a2dp_sink. I finally found a working solution here on the Debian wiki



                If you're using Gnome, Gnome Display Manager (GDM) 'captures' the A2DP sink on session start, which is why it's not available for the device to use. If you try to change the profile using the sound settings GUI, you'll notice that you can select A2DP Sink from the dropdown, but it simply switches back upon closing the dialogue. If you hit test speakers you'll notice it still only shows Mono.



                The article has details but to summarise:



                Create and add these lines to /var/lib/gdm3/.config/pulse/client.conf:



                autospawn = no
                daemon-binary = /bin/true


                Change the file's owner and group:



                sudo chown gdm:gdm /var/lib/gdm3/.config/pulse/client.conf


                Then disable pulseaudio startup:



                rm /var/lib/gdm3/.config/systemd/user/sockets.target.wants/pulseaudio.socket


                add this to /etc/pulse/default.pa:



                load-module module-switch-on-connect


                Then restart.






                share|improve this answer




























                  1












                  1








                  1







                  I've tried setting the profile to off, disconnecting and reconnecting the bluetooth device, but still could not switch to a2dp_sink. I finally found a working solution here on the Debian wiki



                  If you're using Gnome, Gnome Display Manager (GDM) 'captures' the A2DP sink on session start, which is why it's not available for the device to use. If you try to change the profile using the sound settings GUI, you'll notice that you can select A2DP Sink from the dropdown, but it simply switches back upon closing the dialogue. If you hit test speakers you'll notice it still only shows Mono.



                  The article has details but to summarise:



                  Create and add these lines to /var/lib/gdm3/.config/pulse/client.conf:



                  autospawn = no
                  daemon-binary = /bin/true


                  Change the file's owner and group:



                  sudo chown gdm:gdm /var/lib/gdm3/.config/pulse/client.conf


                  Then disable pulseaudio startup:



                  rm /var/lib/gdm3/.config/systemd/user/sockets.target.wants/pulseaudio.socket


                  add this to /etc/pulse/default.pa:



                  load-module module-switch-on-connect


                  Then restart.






                  share|improve this answer















                  I've tried setting the profile to off, disconnecting and reconnecting the bluetooth device, but still could not switch to a2dp_sink. I finally found a working solution here on the Debian wiki



                  If you're using Gnome, Gnome Display Manager (GDM) 'captures' the A2DP sink on session start, which is why it's not available for the device to use. If you try to change the profile using the sound settings GUI, you'll notice that you can select A2DP Sink from the dropdown, but it simply switches back upon closing the dialogue. If you hit test speakers you'll notice it still only shows Mono.



                  The article has details but to summarise:



                  Create and add these lines to /var/lib/gdm3/.config/pulse/client.conf:



                  autospawn = no
                  daemon-binary = /bin/true


                  Change the file's owner and group:



                  sudo chown gdm:gdm /var/lib/gdm3/.config/pulse/client.conf


                  Then disable pulseaudio startup:



                  rm /var/lib/gdm3/.config/systemd/user/sockets.target.wants/pulseaudio.socket


                  add this to /etc/pulse/default.pa:



                  load-module module-switch-on-connect


                  Then restart.







                  share|improve this answer














                  share|improve this answer



                  share|improve this answer








                  edited May 16 '18 at 14:32

























                  answered May 9 '18 at 15:05









                  SlugFriscoSlugFrisco

                  315




                  315























                      0














                      The way I fixed it is by doing away with gdm entirely, since it's so jealous of my A2DP sink and it doesn't look like anyone is fixing it. I consider it broken.



                      sudo apt-get -y install slick-greeter


                      And then select "lightdm". Good riddance.






                      share|improve this answer




























                        0














                        The way I fixed it is by doing away with gdm entirely, since it's so jealous of my A2DP sink and it doesn't look like anyone is fixing it. I consider it broken.



                        sudo apt-get -y install slick-greeter


                        And then select "lightdm". Good riddance.






                        share|improve this answer


























                          0












                          0








                          0







                          The way I fixed it is by doing away with gdm entirely, since it's so jealous of my A2DP sink and it doesn't look like anyone is fixing it. I consider it broken.



                          sudo apt-get -y install slick-greeter


                          And then select "lightdm". Good riddance.






                          share|improve this answer













                          The way I fixed it is by doing away with gdm entirely, since it's so jealous of my A2DP sink and it doesn't look like anyone is fixing it. I consider it broken.



                          sudo apt-get -y install slick-greeter


                          And then select "lightdm". Good riddance.







                          share|improve this answer












                          share|improve this answer



                          share|improve this answer










                          answered Dec 22 '18 at 11:54









                          DaveDave

                          1




                          1






























                              draft saved

                              draft discarded




















































                              Thanks for contributing an answer to Ask Ubuntu!


                              • Please be sure to answer the question. Provide details and share your research!

                              But avoid



                              • Asking for help, clarification, or responding to other answers.

                              • Making statements based on opinion; back them up with references or personal experience.


                              To learn more, see our tips on writing great answers.




                              draft saved


                              draft discarded














                              StackExchange.ready(
                              function () {
                              StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2faskubuntu.com%2fquestions%2f879176%2ffailed-to-set-card-profile-to-a2dp-sink-help%23new-answer', 'question_page');
                              }
                              );

                              Post as a guest















                              Required, but never shown





















































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown

































                              Required, but never shown














                              Required, but never shown












                              Required, but never shown







                              Required, but never shown







                              Popular posts from this blog

                              Quarter-circle Tiles

                              build a pushdown automaton that recognizes the reverse language of a given pushdown automaton?

                              Mont Emei