MagicMirror Forum

    • Register
    • Login
    • Search
    • Recent
    • Tags
    • Unsolved
    • Solved
    • MagicMirror² Repository
    • Documentation
    • Donate
    • Discord

    ALSA sound mix problem (Youtube)

    Development
    1
    2
    737
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • ?
      A Former User last edited by A Former User

      I’m not an expert of system admin or *nix machine. So I need a help.

      Maybe it’s not a MM-specific question. Anyway,

      WHAT I WANT… :

      • playing several videos(Youtube) simultaneously in Electron / Chromium of Raspbian (Stretch)
      • I just embedded 2 youtube videos together, then tried to play both by manual.
      • When I play a video alone, it worked well.
      • But when I play 2 videos at the same time, one is not played. And system spits out this error.
      ALSA lib pcm.c:8481:(snd_pcm_set_params) Unable to set hw params for PLAYBACK: Device or resource busy
      

      Is there anyone who experienced this? Or anyone who knows how to solve this? I think it could be related with some Mixer, but I have no idea about ALSA at all.

      UPDATE
      In my research, ALSA dmix is not working properly in Raspbian Stretch (or Jessie)
      pulseaudio could be used for easy mixing, but not be included and not guaranteed to be worked in Raspbian.
      Hmmmm…

      1 Reply Last reply Reply Quote 2
      • ?
        A Former User last edited by

        UPDATE
        Weird thing.
        in RPI (model 3 B+ / Raspbian Stretch), in getDom() I rendered belows;

        < iframe width="560" height="315" src="https://www.youtube.com/embed/8CdcCD5V-d8" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen>< /iframe>
        

        This works. but

        < audio src="test.mp3" >
        < iframe width="560" height="315" src="https://www.youtube.com/embed/8CdcCD5V-d8" frameborder="0" allow="autoplay; encrypted-media" allowfullscreen>< /iframe>
        
        

        This doesn’t work often. but I don’t know why and when.

        When audio tag exists before youtube, 100% failed. When after, sometime worked, sometime didn’t. I suspect Electron(Chromium) on RPI cannot handle multi-sound output.

        I’m rebuilding my MMM-AssistantMk2 more stable, lighter and independent from some annoying dependencies, but I’m stuck on this. I’m even considering to drop youtube features from module if I cannot solve this problem. (But who cares… 😑 )

        1 Reply Last reply Reply Quote 0
        • 1 / 1
        • First post
          Last post
        Enjoying MagicMirror? Please consider a donation!
        MagicMirror created by Michael Teeuw.
        Forum managed by Paul-Vincent Roll and Rodrigo Ramírez Norambuena.
        This forum is using NodeBB as its core | Contributors
        Contact | Privacy Policy