Home of the Squeezebox™ & Transporter® network music players.
Page 1 of 4 123 ... LastLast
Results 1 to 10 of 31
  1. #1
    Senior Member
    Join Date
    Apr 2019
    Location
    Wunstorf, Germany
    Posts
    325

    Correctly handle USB Speakers with piCorePlayer (6.0.0)?

    Hello!

    I have a piCorePlayer 6 installation with LMS and to use it also as a headless player I attached USB Harmon Kardon Soundsticks to it.
    To get good results for volume I had to use alsamixer:
    Name:  Bildschirmfoto 2020-06-04 um 17.06.26.png
Views: 281
Size:  36.8 KB

    I saved it using the website:
    Name:  Bildschirmfoto 2020-06-04 um 17.10.17.png
Views: 275
Size:  44.6 KB

    If I am not using alsamixer the music is nearly off at 50% volume setting, it is at normal hearing volume when I use 85% volume setting. At 100% is is a little bit louder. This is a very strange setting, so I used alsamixer to use the whole volume control and not only a part of it.

    Because I not always use the Soundsticks, I am switching them off. But after switching them back on the values for alsamixer are switched to this:
    Name:  Bildschirmfoto 2020-06-04 um 17.13.09.png
Views: 275
Size:  34.8 KB

    If I am doing a restart of squeezelite then, nothing changes. The value for alsamixer is not restored.
    Also if I am doing a reboot of the whole Pi nothing is restored.

    What do I have to do to get the alsamixer value back after switching on the speakers and after a reboot?

    This are the values I used on the squeezelite page:
    Audio output device settings: USB audio
    Output settings: hw:CARD=SoundSticks,DEV=0
    These are the possible values there:
    Name:  Bildschirmfoto 2020-06-04 um 17.21.02.png
Views: 273
Size:  28.1 KB

    ALSA setting: 80-4--1-

    What do I have to do to handle this correctly? What I am doing wrong?
    Pi4 4GB piCorePlayer with LMS and Squeezelite for USB; Pi3B+ (7" Display, Hifiberry DAC+ Pro) piCoreplayer with Squeezlite/Jivelite for Hifiberry and Bluetooth headphone; two Airport Express

  2. #2
    Senior Member
    Join Date
    Jan 2011
    Location
    Staffordshire. UK
    Posts
    3,424
    When you have adjusted the level via alsamixer

    Esc

    sudo alsactl store

    pcp br


    try and see

    ronnie

  3. #3
    Senior Member paul-'s Avatar
    Join Date
    Jan 2013
    Posts
    3,184
    It sounds like you are starting the system with the speakers powered off, or are disconnecting and then reconnecting them. The only solution is to build creative udev rules.
    piCorePlayer a small player for the Raspberry Pi in RAM.
    Homepage: https://www.picoreplayer.org

    Please donate if you like the piCorePlayer

  4. #4
    Senior Member
    Join Date
    Apr 2019
    Location
    Wunstorf, Germany
    Posts
    325
    Quote Originally Posted by paul- View Post
    It sounds like you are starting the system with the speakers powered off
    Sometimes that is the case, correct.

    Quote Originally Posted by paul- View Post
    are disconnecting and then reconnecting them.
    This is often the case.

    Quote Originally Posted by paul- View Post
    The only solution is to build creative udev rules.
    That sounds like deep digging inside the system.

    I found out, that it is enough to call (thanks for the idea "Man in a van"!):
    sudo alsactl restore

    after switching on the speakers. So I can write an automation in Home Assistant to not only switch on the speakers, but also to call this command via ssh. This should be working.
    Pi4 4GB piCorePlayer with LMS and Squeezelite for USB; Pi3B+ (7" Display, Hifiberry DAC+ Pro) piCoreplayer with Squeezlite/Jivelite for Hifiberry and Bluetooth headphone; two Airport Express

  5. #5
    Senior Member paul-'s Avatar
    Join Date
    Jan 2013
    Posts
    3,184
    yes, if you can run a ssh session/script from automation, then that works. The device has to be present to be able to restore the settings.
    piCorePlayer a small player for the Raspberry Pi in RAM.
    Homepage: https://www.picoreplayer.org

    Please donate if you like the piCorePlayer

  6. #6
    Senior Member
    Join Date
    Apr 2019
    Location
    Wunstorf, Germany
    Posts
    325
    Quote Originally Posted by paul- View Post
    The device has to be present to be able to restore the settings.
    Ah, that explains, why I can not start alsamixer without the speakers attached! Thank you!
    Pi4 4GB piCorePlayer with LMS and Squeezelite for USB; Pi3B+ (7" Display, Hifiberry DAC+ Pro) piCoreplayer with Squeezlite/Jivelite for Hifiberry and Bluetooth headphone; two Airport Express

  7. #7
    Senior Member
    Join Date
    Apr 2019
    Location
    Wunstorf, Germany
    Posts
    325
    Quote Originally Posted by paul- View Post
    yes, if you can run a ssh session/script from automation, then that works.
    Yes, I managed to get it to work!

    Is there any possibility to restart squeezelite from the shell? I didn't found a "pcp" command for this. I need this because squeezelite will not be started if the USB speakers are not connected at startup. And after they are connected I can start squeezelite per webpage, but that is not so easy to use in the automation.
    Pi4 4GB piCorePlayer with LMS and Squeezelite for USB; Pi3B+ (7" Display, Hifiberry DAC+ Pro) piCoreplayer with Squeezlite/Jivelite for Hifiberry and Bluetooth headphone; two Airport Express

  8. #8
    Senior Member paul-'s Avatar
    Join Date
    Jan 2013
    Posts
    3,184
    Just run the init.d script

    /usr/local/etc/init.d/squeezelite start (or stop....)
    piCorePlayer a small player for the Raspberry Pi in RAM.
    Homepage: https://www.picoreplayer.org

    Please donate if you like the piCorePlayer

  9. #9
    Senior Member
    Join Date
    Apr 2019
    Location
    Wunstorf, Germany
    Posts
    325
    Quote Originally Posted by paul- View Post
    Just run the init.d script
    Oh, that seems easy. Thank you!
    Will this also restore the alsamixer values or do I have to call it also?
    Pi4 4GB piCorePlayer with LMS and Squeezelite for USB; Pi3B+ (7" Display, Hifiberry DAC+ Pro) piCoreplayer with Squeezlite/Jivelite for Hifiberry and Bluetooth headphone; two Airport Express

  10. #10
    Senior Member paul-'s Avatar
    Join Date
    Jan 2013
    Posts
    3,184
    You will have to call that as well
    piCorePlayer a small player for the Raspberry Pi in RAM.
    Homepage: https://www.picoreplayer.org

    Please donate if you like the piCorePlayer

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •