Pulse Audio Virtual Sinks Changing on Alsa Underrun
Clash Royale CLAN TAG#URR8PPP
up vote
0
down vote
favorite
I'm experiencing an issue that when ALSA gives an XRUN underrun, the pulseaudio virtual sinks for the output that i've set start changing. Description below:
I've created three virtual sinks using the following commands (from Virtual0 to Virtual2)
pacmd load-module module-null-sink sink_name=Virtual0
pacmd update-sink-proplist Virtual0 device.description=Virtual0
pacmd update-source-proplist Virtual0.monitor device.description=Virtual0
I'm then running some DSP commands which output into three aplay commands (aplay -v -r 48000 -f S16_LE). Then in pavucontrol I set each of those to a seperate virtual sink (Virtual0 - Virtual2), which I then use to pipe to another DSP program.
The problem is that whenever ALSA underruns due to high CPU usage, the source entry in pavucontrol will briefly dissappear, then come back a second or two later with the virtual sink changed to the last one that i've set in the pavucontrol GUI (usually Virtual2). So after a few underruns on each alsa instance all sources end up outputting to the Virtual2 sink.
I don't mind ALSA underruning every now and then (underruns only occur rarely when the CPU fully maxes out - this is a Raspberry Pi), but I just want the sources to restore to the same sink.
I think the problem is that each aplay source has the same name. So when one briefly disappears due to an underrun it goes to the last set sink for that name, which happens to be the last one set in the GUI.
Is there anything I can do to stop the source entry briefly dissappearing on an underrun? Or change the aplay source name to something unique?
Just a note: Interestingly, i've also tried outputting with mplayer, and this never glitches the source in pavucontrol, but unforuntately mplayer introduces an unacceptable latency on the audio (even with caching disabled), so it can't be used. aplay and play (from sox) both have the issue.
Before Underruns
After Underruns
raspberry-pi pulseaudio alsa
add a comment |Â
up vote
0
down vote
favorite
I'm experiencing an issue that when ALSA gives an XRUN underrun, the pulseaudio virtual sinks for the output that i've set start changing. Description below:
I've created three virtual sinks using the following commands (from Virtual0 to Virtual2)
pacmd load-module module-null-sink sink_name=Virtual0
pacmd update-sink-proplist Virtual0 device.description=Virtual0
pacmd update-source-proplist Virtual0.monitor device.description=Virtual0
I'm then running some DSP commands which output into three aplay commands (aplay -v -r 48000 -f S16_LE). Then in pavucontrol I set each of those to a seperate virtual sink (Virtual0 - Virtual2), which I then use to pipe to another DSP program.
The problem is that whenever ALSA underruns due to high CPU usage, the source entry in pavucontrol will briefly dissappear, then come back a second or two later with the virtual sink changed to the last one that i've set in the pavucontrol GUI (usually Virtual2). So after a few underruns on each alsa instance all sources end up outputting to the Virtual2 sink.
I don't mind ALSA underruning every now and then (underruns only occur rarely when the CPU fully maxes out - this is a Raspberry Pi), but I just want the sources to restore to the same sink.
I think the problem is that each aplay source has the same name. So when one briefly disappears due to an underrun it goes to the last set sink for that name, which happens to be the last one set in the GUI.
Is there anything I can do to stop the source entry briefly dissappearing on an underrun? Or change the aplay source name to something unique?
Just a note: Interestingly, i've also tried outputting with mplayer, and this never glitches the source in pavucontrol, but unforuntately mplayer introduces an unacceptable latency on the audio (even with caching disabled), so it can't be used. aplay and play (from sox) both have the issue.
Before Underruns
After Underruns
raspberry-pi pulseaudio alsa
add a comment |Â
up vote
0
down vote
favorite
up vote
0
down vote
favorite
I'm experiencing an issue that when ALSA gives an XRUN underrun, the pulseaudio virtual sinks for the output that i've set start changing. Description below:
I've created three virtual sinks using the following commands (from Virtual0 to Virtual2)
pacmd load-module module-null-sink sink_name=Virtual0
pacmd update-sink-proplist Virtual0 device.description=Virtual0
pacmd update-source-proplist Virtual0.monitor device.description=Virtual0
I'm then running some DSP commands which output into three aplay commands (aplay -v -r 48000 -f S16_LE). Then in pavucontrol I set each of those to a seperate virtual sink (Virtual0 - Virtual2), which I then use to pipe to another DSP program.
The problem is that whenever ALSA underruns due to high CPU usage, the source entry in pavucontrol will briefly dissappear, then come back a second or two later with the virtual sink changed to the last one that i've set in the pavucontrol GUI (usually Virtual2). So after a few underruns on each alsa instance all sources end up outputting to the Virtual2 sink.
I don't mind ALSA underruning every now and then (underruns only occur rarely when the CPU fully maxes out - this is a Raspberry Pi), but I just want the sources to restore to the same sink.
I think the problem is that each aplay source has the same name. So when one briefly disappears due to an underrun it goes to the last set sink for that name, which happens to be the last one set in the GUI.
Is there anything I can do to stop the source entry briefly dissappearing on an underrun? Or change the aplay source name to something unique?
Just a note: Interestingly, i've also tried outputting with mplayer, and this never glitches the source in pavucontrol, but unforuntately mplayer introduces an unacceptable latency on the audio (even with caching disabled), so it can't be used. aplay and play (from sox) both have the issue.
Before Underruns
After Underruns
raspberry-pi pulseaudio alsa
I'm experiencing an issue that when ALSA gives an XRUN underrun, the pulseaudio virtual sinks for the output that i've set start changing. Description below:
I've created three virtual sinks using the following commands (from Virtual0 to Virtual2)
pacmd load-module module-null-sink sink_name=Virtual0
pacmd update-sink-proplist Virtual0 device.description=Virtual0
pacmd update-source-proplist Virtual0.monitor device.description=Virtual0
I'm then running some DSP commands which output into three aplay commands (aplay -v -r 48000 -f S16_LE). Then in pavucontrol I set each of those to a seperate virtual sink (Virtual0 - Virtual2), which I then use to pipe to another DSP program.
The problem is that whenever ALSA underruns due to high CPU usage, the source entry in pavucontrol will briefly dissappear, then come back a second or two later with the virtual sink changed to the last one that i've set in the pavucontrol GUI (usually Virtual2). So after a few underruns on each alsa instance all sources end up outputting to the Virtual2 sink.
I don't mind ALSA underruning every now and then (underruns only occur rarely when the CPU fully maxes out - this is a Raspberry Pi), but I just want the sources to restore to the same sink.
I think the problem is that each aplay source has the same name. So when one briefly disappears due to an underrun it goes to the last set sink for that name, which happens to be the last one set in the GUI.
Is there anything I can do to stop the source entry briefly dissappearing on an underrun? Or change the aplay source name to something unique?
Just a note: Interestingly, i've also tried outputting with mplayer, and this never glitches the source in pavucontrol, but unforuntately mplayer introduces an unacceptable latency on the audio (even with caching disabled), so it can't be used. aplay and play (from sox) both have the issue.
Before Underruns
After Underruns
raspberry-pi pulseaudio alsa
edited Jun 13 at 23:41
asked Jun 13 at 23:33
Projectile Fish
1235
1235
add a comment |Â
add a comment |Â
1 Answer
1
active
oldest
votes
up vote
0
down vote
accepted
If anyone comes across a similar issue, I eventually found the solution. You need to create some virtual cards that have the device set in asound.conf, then output the audio to those cards.
sudo nano /etc/asound.conf
Paste into asound.conf.
pcm.VirtualCard0
type pulse
device Virtual0
ctl.VirtualCard0
type pulse
device Virtual0
pcm.VirtualCard1
type pulse
device Virtual1
ctl.VirtualCard1
type pulse
device Virtual1
pcm.VirtualCard2
type pulse
device Virtual2
ctl.VirtualCard2
type pulse
device Virtual2
Then run the output with
aplay -v -r 48000 -f S16_LE -DVirtualCard0
aplay -v -r 48000 -f S16_LE -DVirtualCard1
aplay -v -r 48000 -f S16_LE -DVirtualCard2
Now whenever the device 'dissappears' briefly from pulseaudio on an underrun, it will at least come back to the correct sink.
Make sure you create the Virtual sinks first like I described in the OP.
add a comment |Â
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
0
down vote
accepted
If anyone comes across a similar issue, I eventually found the solution. You need to create some virtual cards that have the device set in asound.conf, then output the audio to those cards.
sudo nano /etc/asound.conf
Paste into asound.conf.
pcm.VirtualCard0
type pulse
device Virtual0
ctl.VirtualCard0
type pulse
device Virtual0
pcm.VirtualCard1
type pulse
device Virtual1
ctl.VirtualCard1
type pulse
device Virtual1
pcm.VirtualCard2
type pulse
device Virtual2
ctl.VirtualCard2
type pulse
device Virtual2
Then run the output with
aplay -v -r 48000 -f S16_LE -DVirtualCard0
aplay -v -r 48000 -f S16_LE -DVirtualCard1
aplay -v -r 48000 -f S16_LE -DVirtualCard2
Now whenever the device 'dissappears' briefly from pulseaudio on an underrun, it will at least come back to the correct sink.
Make sure you create the Virtual sinks first like I described in the OP.
add a comment |Â
up vote
0
down vote
accepted
If anyone comes across a similar issue, I eventually found the solution. You need to create some virtual cards that have the device set in asound.conf, then output the audio to those cards.
sudo nano /etc/asound.conf
Paste into asound.conf.
pcm.VirtualCard0
type pulse
device Virtual0
ctl.VirtualCard0
type pulse
device Virtual0
pcm.VirtualCard1
type pulse
device Virtual1
ctl.VirtualCard1
type pulse
device Virtual1
pcm.VirtualCard2
type pulse
device Virtual2
ctl.VirtualCard2
type pulse
device Virtual2
Then run the output with
aplay -v -r 48000 -f S16_LE -DVirtualCard0
aplay -v -r 48000 -f S16_LE -DVirtualCard1
aplay -v -r 48000 -f S16_LE -DVirtualCard2
Now whenever the device 'dissappears' briefly from pulseaudio on an underrun, it will at least come back to the correct sink.
Make sure you create the Virtual sinks first like I described in the OP.
add a comment |Â
up vote
0
down vote
accepted
up vote
0
down vote
accepted
If anyone comes across a similar issue, I eventually found the solution. You need to create some virtual cards that have the device set in asound.conf, then output the audio to those cards.
sudo nano /etc/asound.conf
Paste into asound.conf.
pcm.VirtualCard0
type pulse
device Virtual0
ctl.VirtualCard0
type pulse
device Virtual0
pcm.VirtualCard1
type pulse
device Virtual1
ctl.VirtualCard1
type pulse
device Virtual1
pcm.VirtualCard2
type pulse
device Virtual2
ctl.VirtualCard2
type pulse
device Virtual2
Then run the output with
aplay -v -r 48000 -f S16_LE -DVirtualCard0
aplay -v -r 48000 -f S16_LE -DVirtualCard1
aplay -v -r 48000 -f S16_LE -DVirtualCard2
Now whenever the device 'dissappears' briefly from pulseaudio on an underrun, it will at least come back to the correct sink.
Make sure you create the Virtual sinks first like I described in the OP.
If anyone comes across a similar issue, I eventually found the solution. You need to create some virtual cards that have the device set in asound.conf, then output the audio to those cards.
sudo nano /etc/asound.conf
Paste into asound.conf.
pcm.VirtualCard0
type pulse
device Virtual0
ctl.VirtualCard0
type pulse
device Virtual0
pcm.VirtualCard1
type pulse
device Virtual1
ctl.VirtualCard1
type pulse
device Virtual1
pcm.VirtualCard2
type pulse
device Virtual2
ctl.VirtualCard2
type pulse
device Virtual2
Then run the output with
aplay -v -r 48000 -f S16_LE -DVirtualCard0
aplay -v -r 48000 -f S16_LE -DVirtualCard1
aplay -v -r 48000 -f S16_LE -DVirtualCard2
Now whenever the device 'dissappears' briefly from pulseaudio on an underrun, it will at least come back to the correct sink.
Make sure you create the Virtual sinks first like I described in the OP.
answered Jun 16 at 5:28
Projectile Fish
1235
1235
add a comment |Â
add a comment |Â
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f449690%2fpulse-audio-virtual-sinks-changing-on-alsa-underrun%23new-answer', 'question_page');
);
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password