element14 Community
element14 Community
    Register Log In
  • Site
  • Search
  • Log In Register
  • About Us
  • Community Hub
    Community Hub
    • What's New on element14
    • Feedback and Support
    • Benefits of Membership
    • Personal Blogs
    • Members Area
    • Achievement Levels
  • Learn
    Learn
    • Ask an Expert
    • eBooks
    • element14 presents
    • Learning Center
    • Tech Spotlight
    • STEM Academy
    • Webinars, Training and Events
    • Learning Groups
  • Technologies
    Technologies
    • 3D Printing
    • FPGA
    • Industrial Automation
    • Internet of Things
    • Power & Energy
    • Sensors
    • Technology Groups
  • Challenges & Projects
    Challenges & Projects
    • Design Challenges
    • element14 presents Projects
    • Project14
    • Arduino Projects
    • Raspberry Pi Projects
    • Project Groups
  • Products
    Products
    • Arduino
    • Avnet Boards Community
    • Dev Tools
    • Manufacturers
    • Multicomp Pro
    • Product Groups
    • Raspberry Pi
    • RoadTests & Reviews
  • Store
    Store
    • Visit Your Store
    • Choose another store...
      • Europe
      •  Austria (German)
      •  Belgium (Dutch, French)
      •  Bulgaria (Bulgarian)
      •  Czech Republic (Czech)
      •  Denmark (Danish)
      •  Estonia (Estonian)
      •  Finland (Finnish)
      •  France (French)
      •  Germany (German)
      •  Hungary (Hungarian)
      •  Ireland
      •  Israel
      •  Italy (Italian)
      •  Latvia (Latvian)
      •  
      •  Lithuania (Lithuanian)
      •  Netherlands (Dutch)
      •  Norway (Norwegian)
      •  Poland (Polish)
      •  Portugal (Portuguese)
      •  Romania (Romanian)
      •  Russia (Russian)
      •  Slovakia (Slovak)
      •  Slovenia (Slovenian)
      •  Spain (Spanish)
      •  Sweden (Swedish)
      •  Switzerland(German, French)
      •  Turkey (Turkish)
      •  United Kingdom
      • Asia Pacific
      •  Australia
      •  China
      •  Hong Kong
      •  India
      •  Korea (Korean)
      •  Malaysia
      •  New Zealand
      •  Philippines
      •  Singapore
      •  Taiwan
      •  Thailand (Thai)
      • Americas
      •  Brazil (Portuguese)
      •  Canada
      •  Mexico (Spanish)
      •  United States
      Can't find the country/region you're looking for? Visit our export site or find a local distributor.
  • Translate
  • Profile
  • Settings
Raspberry Pi
  • Products
  • More
Raspberry Pi
Raspberry Pi Forum Route all Pi audio to bluetooth speaker
  • Blog
  • Forum
  • Documents
  • Quiz
  • Events
  • Polls
  • Files
  • Members
  • Mentions
  • Sub-Groups
  • Tags
  • More
  • Cancel
  • New
Join Raspberry Pi to participate - click to join for free!
Featured Articles
Announcing Pi
Technical Specifications
Raspberry Pi FAQs
Win a Pi
Raspberry Pi Wishlist
Actions
  • Share
  • More
  • Cancel
Forum Thread Details
  • State Verified Answer
  • Replies 4 replies
  • Subscribers 662 subscribers
  • Views 3454 views
  • Users 0 members are here
Related

Route all Pi audio to bluetooth speaker

colporteur
colporteur over 5 years ago

Can someone share their experience on how to route all audio available from the Raspbian GUI to a bluetooth speaker?

 

After establishing a bluetooth connection to a speaker, I can use the audio menu to select the bluetooth device and play audio through the speaker from the default media application (i.e VLC media player). I discovered audio from the browser (i.e. youtube video) still plays out the HDMI port.

 

My internet search criteria doesn't generate the necessary results. I'm looking for returns that reflect the Buster version of Raspbian with all audio routed to a bluetooth speak. The configs would make the bluetooth speaker the default audio output for a Raspbian full install.

 

If anyone has an links or commentary that has given them success I would appreciate the input.

 

Sean

  • Sign in to reply
  • Cancel
  • clem57
    0 clem57 over 5 years ago

    I do not have the answer, but I can point you in a direction that will help. In this link, you will find how to realign the default sound. It may be adapted to your situation.

    Clem

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Reject Answer
    • Cancel
  • clem57
    0 clem57 over 5 years ago in reply to clem57

    I think your answer is to send the sound to pulse instead of ALSA. Then the destination is much simpler. Look at https://opensource.com/article/17/1/linux-plays-sound . For a Windows perceptive this article maybe better https://www.learndigitalaudio.com/how-linux-audio-works-vs-windows-audio-2017

    Hope this helps you.

    Clem

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • colporteur
    0 colporteur over 5 years ago in reply to clem57

    The link provided insight into turning of the onboard audio card. The information in the link was stale dated but the configuration changes looked familiar.

     

    The following change:

     

    disable audio support /boot/config.txt 
    # Enable audio (loads snd_bcm2835)
    #dtparam=audio=on <--- inserted the octothorpe and perform a reboot.

     

    Before making this change you will notice a /proc/asound directory. After the change and reboot the directory is not created (i.e. no sound card).

     

    I then configured the bluetooth device (i.e. speaker) using bluetoothctl

     

    I was then going to make the following entry

    /home/pi/.asoundrc <---yes there is a period in front of the filename.

     

    pcm.!default {

    type plug

    slave.pcm {

    type bluealsa

    device "C2:E4:94:97:66:A8"

    profile "a2dp"

    }

    }

    ctl.!default {

    type bluealsa

    }

     

    but discovered on a reboot after configuring bluetooth the contents were automatically created. The contents for this file I discovered in a post https://www.raspberrypi.org/forums/viewtopic.php?t=231281   on the raspberrypi forum.

     

    I did notice if this file had a syntax errors (i.e. device "bluealsa:HCI=hci0,DEV=C2:E4:94:97:66:A8") applications errored out and the file contained some hardware entries. Not sure how this developed.

     

    With this configuration in place I have all audio from the browser (i.e. youtube video) doesn't go out the HDMI but the rather the bluetooth speaker. Exactly what I was looking for. I suspect not having audio hardware on bootup removed any confusion to what the ALSA was required to do. Since no other audio support exists other than bluetooth it configured without a hitch.

     

    I appreciate the links to resources. It definitely provided the impetus to uncover the solution. A fresh pair of eyes made the difference.

     

    Sean

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
  • clem57
    0 clem57 over 5 years ago in reply to colporteur

    In Linux, a dot before the name implies normal ls command will not show the file. It is like the hidden attribute in Windows.

    Glad you found it works now,

    Clem

    • Cancel
    • Vote Up 0 Vote Down
    • Sign in to reply
    • Verify Answer
    • Cancel
element14 Community

element14 is the first online community specifically for engineers. Connect with your peers and get expert answers to your questions.

  • Members
  • Learn
  • Technologies
  • Challenges & Projects
  • Products
  • Store
  • About Us
  • Feedback & Support
  • FAQs
  • Terms of Use
  • Privacy Policy
  • Legal and Copyright Notices
  • Sitemap
  • Cookies

An Avnet Company © 2025 Premier Farnell Limited. All Rights Reserved.

Premier Farnell Ltd, registered in England and Wales (no 00876412), registered office: Farnell House, Forge Lane, Leeds LS12 2NE.

ICP 备案号 10220084.

Follow element14

  • X
  • Facebook
  • linkedin
  • YouTube