Cole1717
Posts: 29
Joined: Mon Mar 16, 2015 10:44 pm

How to make default soundcard for root.

Sun Apr 17, 2016 11:43 pm

I am using a raspberry pi 2 with Raspbian Jessie. I am creating a spectrum analyzer in c++ using a Adafruit RGB Matrix. I set the default soundcard to use an external usb soundcard which works as expected. I started writing code that uses the matrix. The problem is that the matrix is initialized with:

Code: Select all

GPIO io;
if (!io.Init())
    return 1;
This requires that the code be run with sudo. When I do that, it outputs the sound via the internal sound card which I don't want. Is there a way to make my usb soundcard the default for both the main user and for root? Or, is it possible to make this not require root to run?

Thanks for any input!

Return to “Graphics, sound and multimedia”