sound output plugin for pandora-configbutton

Discussion in 'General Discussions' started by Ziz, Feb 6, 2017.

  1. Ziz

    Ziz Advanced Member

    Joined:
    Sep 10, 2006
    Messages:
    1,584
    Hello,

    as stated here and here, I started to make a sound output plugin for kicksAss very fine pas.sh script, with which you can easily switch between the internal pandora audio and an arbitrary amount of bluetooth devices (e.g. head sets).
    I am not done yet, but for people who already have installed pas.sh or which are not afraid of adding bluetooth devices themself as described here, this might already be very useful.

    So, what is working:
    • My plugin can find installed sound output files and you can select them. All values are directly readed out of the directory of the pas.sh script.
    • [​IMG]
    • [​IMG]
    • However you can of course also change the position of the script:
    • [​IMG]
    • If pas.sh cannot be found at the given location, it will be extracted directly from the plugin file. I was so free too add the most recent version to my plugin. The environment variable PAS_PATH inside the script is changed to the wanted location, too. However you can always alter, improve or update the script once created (if needed):
    • [​IMG]
    In the next days I will implement some nice dialog to add a new device. You saw the button on the first screenshot, but it is not working right now. ;) You shall be able to just add a bt device by MAC adress (maybe I will even add a function to choose from connected bluetooth devices...) or to edit the asoundrc_* file for you own needs. Furthermore I will add a list of all available asoundrc_* devices in the preferences menu of the plugin to easily edit or remove them. Stay tuned and have fun with the recent version:
    Download link
    Just copy the file soundoutput.so to /usr/share/configbutton, e.g. in the bash with
    $ sudo cp soundoutput.so /usr/share/configbutton
    I am not sure, whether configbutton will directly notice the plugin, but at least after a restart of the pandora the plugin should appear. Don't forget to activate it in the options menu of configbutton (right-click on the icon).

    Regards,
    Ziz

    Edit: In the last screenshot, it has to be "pas.sh" of course. I will change this in the next version. ;)
     
    Tags:
  2. ingoreis

    ingoreis Advanced Member

    Joined:
    Mar 7, 2012
    Messages:
    3,038
    Location:
    49.491276,8.423518
    This is a realy good Idea.
    We can get more and more and Cheaper Bluetooth Speakers.

    When your Project work fine ..maybe Notaz add that to the Zaxxon itself? :)
     
    directive0 likes this.
  3. KickAss

    KickAss Very Active Member

    Joined:
    Mar 9, 2011
    Messages:
    566
    Location:
    Germany
    this is what i love so much about this community: collaboration.
    very well done, alexander!
    i'm happy i dun need to come up with some shitty GUI now :p
     
    directive0 likes this.
  4. Eight Bit

    Eight Bit Advanced Member

    Joined:
    Nov 16, 2008
    Messages:
    1,533
    Location:
    Amsterdam, Netherlands
    Sweet, I need to go set this up!
    Thanks!
     
  5. comradekingu

    comradekingu Glowing ember

    Joined:
    Apr 15, 2011
    Messages:
    4,925
    If the folder does not contain "pas.sh", version 0.4 will be installed and placed in it.

    Improvement overall and no "will installed" nor "automaticly"
    It also makes the subesequent infomessage redudant. It is better to steal attention when something goes wrong.

    In the event that the distinction between it being found or not is imporant, a second message could say "no pas.sh found, install version 0.4 to %1$sfolder."
    and the first could be.
    "Select the folder you want pas.sh in, or where it is to be found already."

    Edit: other fixes:

    Disabled pulgins → Disabled
    Enabled plugins → Enabled
    (It says Plugin settings in the window title already)


    Sound Output → Sound output
    bluetooth → Bluetooth
    TV-Out → TV-out
    head sets → headsets

    Show large icons → Large icons
    (on the assumption that regular icons are shown beforehand/by default)
     
    Last edited: Feb 7, 2017
  6. Ziz

    Ziz Advanced Member

    Joined:
    Sep 10, 2006
    Messages:
    1,584
    Well, most of your change requests are of configbutton and should maybe placed here. ;)

    But I will improve the hints of my plugin. Btw. I am nearly done with the new version. So probably tomorrow I will upload a new version with the possibility to add and edit new configs. ;)
    --- Double Post Merged, Feb 8, 2017, Original Post Date: Feb 8, 2017 ---
    Okay, here is the new version, tell me, what you think. When I got some opinions and tests from you, I will create a pull request for slaeshjag, that the plugin can be shipped with the next firmware release. ;)

    You can now add a new device directly with entering the MAC and a name of the bluetooth devic by hand or with this handy list, which should have all your paired or bluetooth devices. :D
    [​IMG]

    In the settings dialog all devices are shown and you can edit or delete them.
    [​IMG]

    However it warns you before reming a device. ;)
    [​IMG]

    The editing happens directly on the raw asoundrc_ file, which is handy if you want to tweak it in more detail.
    [​IMG]

    I also thought about the possbility to edit a device in the simple mode with name and MAC, too, but tbh: I doubt anybody would ever edit such a setting after creation (MAC addresses do not change...), so I decided to keep it simple and small. :)

    Download and installation stays the same:
    Download link
    Just copy the file soundoutput.so to /usr/share/configbutton, e.g. in the bash with
    $ sudo cp soundoutput.so /usr/share/configbutton
    If you like the plugin (give me feedback!), I will maybe also create a pnd for the installation for people not so familiar with the terminal. ;)

    Regards,
    Ziz
     
    Farox, Linux-SWAT and levi like this.
  7. Ziz

    Ziz Advanced Member

    Joined:
    Sep 10, 2006
    Messages:
    1,584
    After some feedback from canseco, fixing a critical bug and adding some minor new features, you can download the most recent version.
    It does now create all needed configurations for you (including making backups) and also asks for root rights if needed;
    [​IMG]
    Furthermore you can now directly use a newly added device:
    [​IMG]

    Download link stays the same. ;)
     
    Eight Bit and canseco like this.
  8. Eight Bit

    Eight Bit Advanced Member

    Joined:
    Nov 16, 2008
    Messages:
    1,533
    Location:
    Amsterdam, Netherlands
    The plugin itself works like a charm, I just installed it and everything shows up like it's supposed to.
    As I'm at work right now I can't check the actual Bluetooth audio streaming but I will tonight, and I have no doubt that it will work.
    As my living room BT speakers have no volume control, I guess the regular alsa mixer softvol will work? I wouldn't want to damage my kids ears when trying it :)

    This really makes life for BT users like myself a lot easier, thanks a lot Ziz!
    Big ups to you!
     
  9. KickAss

    KickAss Very Active Member

    Joined:
    Mar 9, 2011
    Messages:
    566
    Location:
    Germany
    the provided device templates come with a softvol control. so yeah, you can easily adjust the volume with alsamixer.
    enjoy :)
     
  10. Ziz

    Ziz Advanced Member

    Joined:
    Sep 10, 2006
    Messages:
    1,584
    Well, I have, so some feedbacks would be nice. :-D

    What KickAss said. :)

    Glad you like it, but keep in mind that KickAss did the basic Alsa work, which I have no idea of. I am just good in copy and pasting some GUI code. ;)
     
  11. Eight Bit

    Eight Bit Advanced Member

    Joined:
    Nov 16, 2008
    Messages:
    1,533
    Location:
    Amsterdam, Netherlands
    I had time to test last night and it works perfectly. I played some SID tunes, mp3's and played some games. With the Wi-Fi switched off, the bluetooth audio stream works perfectly.
    I did notice that the output can not be changed on the fly, the sound playing application needs to be restarted to change to the new audio output.
    Softvol works fine, great!
    I was wondering whether it would be possible to change Alsa's volume control slider with hot keys though so I wouldn't have to switch to desktop to change the volume.

    So yeah, thanks again for this, I would recommend it for everyone using bt audio. Set-up is a breeze.
    Also, use a Wi-Fi dongle if you need interwebs too.
     
    Last edited: Feb 13, 2017
  12. Ziz

    Ziz Advanced Member

    Joined:
    Sep 10, 2006
    Messages:
    1,584
    Yeah, do you think, I should mention this somewhere?

    This is possible. Via Menu -> Setting -> Desktop -> Keyboard and then the "Application Shortcuts" tab you can add your own connection between button combinations and applications.
    However the application you need for this is "amixer", which is not included in the Angström alsa-utils package. So I extracted the version from debian squeeze, you can download it here: http://ziz.gp2x.de/stuff/amixer
    you can install it with sudo opkg install alsa-utils-amixer. Put this file somewhere (I put it directly in my home folder) and make it executable with chmod +x ./amixer.
    Now you can add new short cuts e.g. for the run /home/your_user/amixer set Master 2+ , which increase the volume by ~1,5% The scale goes form 0 to 255 and it increase always double the value you give, so "2+" increases by 4. No idea, why. Deal with it. :cool:
    I used Primary Shift U and Primary Shit I (both shoulder buttons + U or I) to adjust the volume. This makes sense as these are also the buttons for the brightness setting. :D

    You are welcome. ;)

    Edit: Fixed installation of amixer.
     
    Last edited: Feb 13, 2017
    Eight Bit likes this.
  13. Eight Bit

    Eight Bit Advanced Member

    Joined:
    Nov 16, 2008
    Messages:
    1,533
    Location:
    Amsterdam, Netherlands
    You made me giggle :D
    I set it up exactly like you now. Awesome! Maybe amixer can be added to the firmware too? Or maybe add all in a single pnd
     
  14. Ziz

    Ziz Advanced Member

    Joined:
    Sep 10, 2006
    Messages:
    1,584
    I will make a pull request the next days for @slaeshjag. Then the plugin is in the official pandora-configbutton repository.
    Afterwards I will tell notaz about it and maybe, that amixer would be very handy to have. But I don't know, whether he wants to build amixer himself. Copy and pasting a binary from debian is not the way to go for a firmware inclusion. XD
    --- Double Post Merged, Feb 13, 2017, Original Post Date: Feb 13, 2017 ---
    I just spoke with notaz. amixer is included in the firmware, you need to install it with
    sudo opkg install alsa-utils-amixer
    It is just splitted form alsa-utils! :D
     
    Holliefant and Eight Bit like this.
  15. Holliefant

    Holliefant Member

    Joined:
    Dec 9, 2008
    Messages:
    221
    Its a shame that gmu won´t work with bluetooth...
     
  16. Ziz

    Ziz Advanced Member

    Joined:
    Sep 10, 2006
    Messages:
    1,584
    Why? Is it using OSS?
     
  17. Holliefant

    Holliefant Member

    Joined:
    Dec 9, 2008
    Messages:
    221
    No somehow there is a problem with the buffer or something.. hmm I forgot what it was. I´ll search for it and post it here :D

    ALSA lib audio/pcm_bluetooth.c:1607: (audioservice_expect) BT_OPEN failed

    Something with SDL and bluetooth was it. Seemed like there is no solution.
     
    Last edited: Feb 17, 2017
  18. Ziz

    Ziz Advanced Member

    Joined:
    Sep 10, 2006
    Messages:
    1,584
    Hm, you are right. No SDL application has sound. :(
    --- Double Post Merged, Feb 17, 2017, Original Post Date: Feb 17, 2017 ---
    Maybe the dmix plugin of alsa can help here as translator between SDL and the bluetooth plugin. But unfortunately I have no idea about this, so I need to read a lot of documentation first. A first little test failed. ^^'
     
  19. KickAss

    KickAss Very Active Member

    Joined:
    Mar 9, 2011
    Messages:
    566
    Location:
    Germany
    i tried to investigate earlier. all my attempts failed. i also tried dmix, to no avail.

    my pandora is back and i might have another look at this.
     
    Ziz likes this.
  20. Ziz

    Ziz Advanced Member

    Joined:
    Sep 10, 2006
    Messages:
    1,584
    Great! You know I started using your script because I did not only fail at enabling bluetooth output, but also fucked up my whole alsa settings while doing so. :D
     

Share This Page

Loading...