Switch sound to HDMI in Lubuntu without installing additional packages

213

Try to put the following entry into /etc/asound.conf or your ~/.asoundrc:

pcm.!default = pcm.hdmi
Share:
213
Rahul Verma
Author by

Rahul Verma

Updated on September 18, 2022

Comments

  • Rahul Verma
    Rahul Verma over 1 year

    I am trying to build a music player and while researching the behavior of other apps I have realized that some apps store the now playing list and the song id, so that same state is available when the app is started afresh.

    1.) So how to implement this? Which technique will be faster?

    Saving song id is simpler by using shared preferences but what about whole list of songs and other data associated with them ( like duration , title...). How to store them.

    2.) Also some song that was stored gets deleted, so how to manager that?

    I have already tried searching and came up with this but to no avail:

    How to save "now playing" list of Music Player App in Android?

    • JLT
      JLT about 8 years
      This question is too broad. There could be a lot of possible ways to do this.
    • Rahul Verma
      Rahul Verma about 8 years
      Can you list the possible ways? I have two qs. you can at least answer one of them if you know? Thanks. And I don't know why the -1 because as I have mentioned that I have searched for ways and also attached the link.
    • Rahul Verma
      Rahul Verma about 8 years
      @JLT can you answer the qs please or atleast mention the links. I have been stuck on this qs for a while now.
    • Rahul Verma
      Rahul Verma almost 8 years
      Hey guys help. got no solution till now.
  • sashoalm
    sashoalm over 10 years
    Thanks, this worked, but I need to logout/login for the changes to take place, is there a command to reload the .asoundrc file? Preferably without requiring root.
  • CL.
    CL. over 10 years
    The .asoundrc file is read by the ALSA library whenever a program opens some ALSA device the first time.
  • Rahul Verma
    Rahul Verma about 8 years
    I have array list of song class objects which holds song's id, title and everything. How to integrate it with that?