i-rinat / apulse

PulseAudio emulation for ALSA
MIT License
609 stars 35 forks source link

[apulse] [error] do_connect_pcm, snd_pcm_open, Device or resource busy #35

Closed DanielFragaBR closed 8 years ago

DanielFragaBR commented 8 years ago

Apulse with Skype works perfectly until I put the computer to sleep (S3). When it wakes up, Skype returns:

[apulse] [error] do_connect_pcm, snd_pcm_open, Device or resource busy
[apulse] [error] do_connect_pcm, snd_pcm_open, Device or resource busy

My ~/.asoundrc is very simple:

pcm.!default {
         type asym
         playback.pcm {
                 type plug
                 slave.pcm "dmix:2,0"
         }
         capture.pcm {
                 type plug
                 slave.pcm "dsnoop:0,0"
         }
}

And I start Skype with the following line:

APULSE_PLAYBACK_DEVICE=plughw:2,0 APULSE_CAPTURE_DEVICE=plughw:0,0 /usr/local/bin/apulse /usr/local/skype/skype

So, any hints?

Ps: when this happens, I have to reboot again to make Skype work again.

i-rinat commented 8 years ago

Are there any processes that use sound card? Try to run lsof /dev/snd/*.

Could you try to play sound through some other software? mplayer, for example.

DanielFragaBR commented 8 years ago

i-rinat thanks for answering. I can play audio with all the other software: mplayer, mpv, Firefox etc. I'll wait for it to happen again. And there're a lot of software using the sound card:

COMMAND    PID  USER   FD   TYPE DEVICE SIZE/OFF     NODE NAME
inotifywa  650 fraga    1w  FIFO    0,8      0t0      490 pipe
charges-i  651 fraga    0r  FIFO    0,8      0t0      490 pipe
dbus-laun  716 fraga    8r  FIFO    0,8      0t0     3724 pipe
kdeinit4   725 fraga    0r  FIFO    0,8      0t0      569 pipe
kdeinit4   725 fraga    3r  FIFO    0,8      0t0     3735 pipe
kdeinit4   725 fraga    4w  FIFO    0,8      0t0     3730 pipe
kdeinit4   725 fraga    6w  FIFO    0,8      0t0     3735 pipe
klauncher  726 fraga    0r  FIFO    0,8      0t0      569 pipe
klauncher  726 fraga    4r  FIFO    0,8      0t0     3739 pipe
klauncher  726 fraga    5w  FIFO    0,8      0t0     3739 pipe
klauncher  726 fraga    8r  FIFO    0,8      0t0     3744 pipe
klauncher  726 fraga   10w  FIFO    0,8      0t0     3744 pipe
kded4      728 fraga    0r  FIFO    0,8      0t0      569 pipe
kded4      728 fraga    4r  FIFO    0,8      0t0     2559 pipe
kded4      728 fraga    6w  FIFO    0,8      0t0     2559 pipe
kded4      728 fraga   11u   CHR  116,0      0t0 12321369 /dev/snd/controlC0
kded4      728 fraga   12u   CHR 116,32      0t0 12321364 /dev/snd/controlC1
kded4      728 fraga   13u   CHR 116,64      0t0 12321355 /dev/snd/controlC2
kglobalac  738 fraga    0r  FIFO    0,8      0t0      569 pipe
kglobalac  738 fraga    4r  FIFO    0,8      0t0      591 pipe
kglobalac  738 fraga    6w  FIFO    0,8      0t0      591 pipe
knotify4   741 fraga    0r  FIFO    0,8      0t0      569 pipe
knotify4   741 fraga    4r  FIFO    0,8      0t0     1474 pipe
knotify4   741 fraga    6w  FIFO    0,8      0t0     1474 pipe
kactivity  745 fraga    0r  FIFO    0,8      0t0      569 pipe
kactivity  745 fraga    4r  FIFO    0,8      0t0     1482 pipe
kactivity  745 fraga    6w  FIFO    0,8      0t0     1482 pipe
ksmserver  753 fraga    0r  FIFO    0,8      0t0      569 pipe
ksmserver  753 fraga    5r  FIFO    0,8      0t0     2594 pipe
ksmserver  753 fraga    6w  FIFO    0,8      0t0     2594 pipe
ksmserver  753 fraga   11w  FIFO    0,8      0t0      713 pipe
ksmserver  753 fraga   18r  FIFO    0,8      0t0      717 pipe
ksmserver  753 fraga   19w  FIFO    0,8      0t0      717 pipe
kwin       789 fraga    0r  FIFO    0,8      0t0      713 pipe
kwin       789 fraga    5r  FIFO    0,8      0t0     3818 pipe
kwin       789 fraga    6w  FIFO    0,8      0t0     3818 pipe
kwin       789 fraga    7r  FIFO    0,8      0t0     3819 pipe
kwin       789 fraga    8w  FIFO    0,8      0t0     3819 pipe
kwin       789 fraga   28r  FIFO    0,8      0t0     1556 pipe
kwin       789 fraga   29w  FIFO    0,8      0t0     1556 pipe
plasma-de  796 fraga    0r  FIFO    0,8      0t0      569 pipe
plasma-de  796 fraga    4r  FIFO    0,8      0t0     3835 pipe
plasma-de  796 fraga    6w  FIFO    0,8      0t0     3835 pipe
kuiserver  815 fraga    4r  FIFO    0,8      0t0     3865 pipe
kuiserver  815 fraga    6w  FIFO    0,8      0t0     3865 pipe
mission-c  817 fraga    9r  FIFO    0,8      0t0     1631 pipe
mission-c  817 fraga   10w  FIFO    0,8      0t0     1631 pipe
mission-c  817 fraga   15r  FIFO    0,8      0t0      819 pipe
mission-c  817 fraga   16w  FIFO    0,8      0t0      819 pipe
akonadi_c  820 fraga    0r  FIFO    0,8      0t0      569 pipe
akonadi_c  820 fraga    4r  FIFO    0,8      0t0     3871 pipe
akonadi_c  820 fraga    5w  FIFO    0,8      0t0     3871 pipe
akonadi_c  820 fraga    8w  FIFO    0,8      0t0     1615 pipe
akonadi_c  820 fraga   10w  FIFO    0,8      0t0     4108 pipe
akonadi_c  820 fraga   12w  FIFO    0,8      0t0     4113 pipe
akonadi_c  820 fraga   15r  FIFO    0,8      0t0     1619 pipe
akonadi_c  820 fraga   16w  FIFO    0,8      0t0     1619 pipe
akonadi_c  820 fraga   17w  FIFO    0,8      0t0     4118 pipe
akonadi_c  820 fraga   19r  FIFO    0,8      0t0     4112 pipe
akonadi_c  820 fraga   20w  FIFO    0,8      0t0     4112 pipe
akonadi_c  820 fraga   22w  FIFO    0,8      0t0     4123 pipe
akonadi_c  820 fraga   24r  FIFO    0,8      0t0     4117 pipe
akonadi_c  820 fraga   25w  FIFO    0,8      0t0     4117 pipe
akonadi_c  820 fraga   27w  FIFO    0,8      0t0     4131 pipe
akonadi_c  820 fraga   29r  FIFO    0,8      0t0     4122 pipe
akonadi_c  820 fraga   30w  FIFO    0,8      0t0     4122 pipe
akonadi_c  820 fraga   32w  FIFO    0,8      0t0     4136 pipe
akonadi_c  820 fraga   34r  FIFO    0,8      0t0     4127 pipe
akonadi_c  820 fraga   35w  FIFO    0,8      0t0     4127 pipe
akonadi_c  820 fraga   37w  FIFO    0,8      0t0     4160 pipe
akonadi_c  820 fraga   39r  FIFO    0,8      0t0     4135 pipe
akonadi_c  820 fraga   40w  FIFO    0,8      0t0     4135 pipe
akonadi_c  820 fraga   42w  FIFO    0,8      0t0     4165 pipe
akonadi_c  820 fraga   44r  FIFO    0,8      0t0     4140 pipe
akonadi_c  820 fraga   45w  FIFO    0,8      0t0     4140 pipe
akonadi_c  820 fraga   47w  FIFO    0,8      0t0     4170 pipe
akonadi_c  820 fraga   49r  FIFO    0,8      0t0     4164 pipe
akonadi_c  820 fraga   50w  FIFO    0,8      0t0     4164 pipe
akonadi_c  820 fraga   52w  FIFO    0,8      0t0     4175 pipe
akonadi_c  820 fraga   54r  FIFO    0,8      0t0     4169 pipe
akonadi_c  820 fraga   55w  FIFO    0,8      0t0     4169 pipe
akonadi_c  820 fraga   57w  FIFO    0,8      0t0     4180 pipe
akonadi_c  820 fraga   59r  FIFO    0,8      0t0     4174 pipe
akonadi_c  820 fraga   60w  FIFO    0,8      0t0     4174 pipe
akonadi_c  820 fraga   62w  FIFO    0,8      0t0     2812 pipe
akonadi_c  820 fraga   64r  FIFO    0,8      0t0     4179 pipe
akonadi_c  820 fraga   65w  FIFO    0,8      0t0     4179 pipe
akonadi_c  820 fraga   67w  FIFO    0,8      0t0     4185 pipe
akonadi_c  820 fraga   69r  FIFO    0,8      0t0     4184 pipe
akonadi_c  820 fraga   70w  FIFO    0,8      0t0     4184 pipe
akonadi_c  820 fraga   72w  FIFO    0,8      0t0     4036 pipe
akonadi_c  820 fraga   74r  FIFO    0,8      0t0     2816 pipe
akonadi_c  820 fraga   75w  FIFO    0,8      0t0     2816 pipe
akonadi_c  820 fraga   77w  FIFO    0,8      0t0     4053 pipe
akonadi_c  820 fraga   79r  FIFO    0,8      0t0     4189 pipe
akonadi_c  820 fraga   80w  FIFO    0,8      0t0     4189 pipe
akonadi_c  820 fraga   82w  FIFO    0,8      0t0     4058 pipe
akonadi_c  820 fraga   84r  FIFO    0,8      0t0     4040 pipe
akonadi_c  820 fraga   85w  FIFO    0,8      0t0     4040 pipe
akonadi_c  820 fraga   87w  FIFO    0,8      0t0     4063 pipe
akonadi_c  820 fraga   89r  FIFO    0,8      0t0     4057 pipe
akonadi_c  820 fraga   90w  FIFO    0,8      0t0     4057 pipe
akonadi_c  820 fraga   92w  FIFO    0,8      0t0     4068 pipe
akonadi_c  820 fraga   94r  FIFO    0,8      0t0     4062 pipe
akonadi_c  820 fraga   95w  FIFO    0,8      0t0     4062 pipe
akonadi_c  820 fraga   97w  FIFO    0,8      0t0     5164 pipe
akonadi_c  820 fraga   99r  FIFO    0,8      0t0     4067 pipe
akonadi_c  820 fraga  100w  FIFO    0,8      0t0     4067 pipe
akonadi_c  820 fraga  102w  FIFO    0,8      0t0     5200 pipe
akonadi_c  820 fraga  104r  FIFO    0,8      0t0     4072 pipe
akonadi_c  820 fraga  105w  FIFO    0,8      0t0     4072 pipe
akonadi_c  820 fraga  109r  FIFO    0,8      0t0     5168 pipe
akonadi_c  820 fraga  110w  FIFO    0,8      0t0     5168 pipe
akonadi_c  820 fraga  114r  FIFO    0,8      0t0     5204 pipe
akonadi_c  820 fraga  115w  FIFO    0,8      0t0     5204 pipe
akonadise  822 fraga    0r  FIFO    0,8      0t0     1615 pipe
akonadise  822 fraga    4r  FIFO    0,8      0t0     2663 pipe
akonadise  822 fraga    5w  FIFO    0,8      0t0     2663 pipe
akonadise  822 fraga    8w  FIFO    0,8      0t0     1641 pipe
akonadise  822 fraga   15r  FIFO    0,8      0t0     1645 pipe
akonadise  822 fraga   16w  FIFO    0,8      0t0     1645 pipe
gconfd-2   826 fraga    6r  FIFO    0,8      0t0     2666 pipe
gconfd-2   826 fraga    7w  FIFO    0,8      0t0     2666 pipe
mysqld     829 fraga    0r  FIFO    0,8      0t0     1641 pipe
kxkb       855 fraga    0r  FIFO    0,8      0t0      569 pipe
kxkb       855 fraga    4r  FIFO    0,8      0t0     2682 pipe
kxkb       855 fraga    6w  FIFO    0,8      0t0     2682 pipe
kwrited    856 fraga    0r  FIFO    0,8      0t0      569 pipe
kwrited    856 fraga    4r  FIFO    0,8      0t0     3905 pipe
kwrited    856 fraga    5w  FIFO    0,8      0t0     3905 pipe
krunner    863 fraga    0r  FIFO    0,8      0t0      569 pipe
krunner    863 fraga    4r  FIFO    0,8      0t0     3912 pipe
krunner    863 fraga    6w  FIFO    0,8      0t0     3912 pipe
kalarm     875 fraga    0r  FIFO    0,8      0t0      569 pipe
kalarm     875 fraga    4r  FIFO    0,8      0t0     2704 pipe
kalarm     875 fraga    6w  FIFO    0,8      0t0     2704 pipe
knutclien  877 fraga    0r  FIFO    0,8      0t0      569 pipe
knutclien  877 fraga    4r  FIFO    0,8      0t0     1707 pipe
knutclien  877 fraga    6w  FIFO    0,8      0t0     1707 pipe
choqok     883 fraga    0r  FIFO    0,8      0t0      569 pipe
choqok     883 fraga    4r  FIFO    0,8      0t0      896 pipe
choqok     883 fraga    6w  FIFO    0,8      0t0      896 pipe
kmix       889 fraga    0r  FIFO    0,8      0t0      569 pipe
kmix       889 fraga    4r  FIFO    0,8      0t0     1716 pipe
kmix       889 fraga    6w  FIFO    0,8      0t0     1716 pipe
kmix       889 fraga   10u   CHR  116,0      0t0 12321369 /dev/snd/controlC0
kmix       889 fraga   15u   CHR 116,32      0t0 12321364 /dev/snd/controlC1
kmix       889 fraga   16u   CHR 116,64      0t0 12321355 /dev/snd/controlC2
kmymoney   890 fraga    0r  FIFO    0,8      0t0      569 pipe
kmymoney   890 fraga    4r  FIFO    0,8      0t0      970 pipe
kmymoney   890 fraga    5w  FIFO    0,8      0t0      970 pipe
bitcoin-q  913 fraga    0r  FIFO    0,8      0t0      569 pipe
bitcoin-q  913 fraga    4r  FIFO    0,8      0t0     2777 pipe
bitcoin-q  913 fraga    5w  FIFO    0,8      0t0     2777 pipe
korgac     922 fraga    0r  FIFO    0,8      0t0      569 pipe
korgac     922 fraga    4r  FIFO    0,8      0t0     1776 pipe
korgac     922 fraga    6w  FIFO    0,8      0t0     1776 pipe
wicd-clie  923 fraga    0r  FIFO    0,8      0t0      569 pipe
kwalletd   930 fraga    0r  FIFO    0,8      0t0      569 pipe
kwalletd   930 fraga    4r  FIFO    0,8      0t0     4101 pipe
kwalletd   930 fraga    6w  FIFO    0,8      0t0     4101 pipe
akonadi_a  944 fraga    0r  FIFO    0,8      0t0     4108 pipe
akonadi_a  944 fraga    4r  FIFO    0,8      0t0     4023 pipe
akonadi_a  944 fraga    5w  FIFO    0,8      0t0     4023 pipe
akonadi_a  945 fraga    0r  FIFO    0,8      0t0     4113 pipe
akonadi_a  945 fraga    4r  FIFO    0,8      0t0     5121 pipe
akonadi_a  945 fraga    5w  FIFO    0,8      0t0     5121 pipe
akonadi_a  946 fraga    0r  FIFO    0,8      0t0     4118 pipe
akonadi_a  946 fraga    4r  FIFO    0,8      0t0     2942 pipe
akonadi_a  946 fraga    5w  FIFO    0,8      0t0     2942 pipe
akonadi_b  947 fraga    0r  FIFO    0,8      0t0     4123 pipe
akonadi_b  947 fraga    4r  FIFO    0,8      0t0     4028 pipe
akonadi_b  947 fraga    5w  FIFO    0,8      0t0     4028 pipe
claws-mai  948 fraga    0r  FIFO    0,8      0t0      569 pipe
claws-mai  948 fraga   11r  FIFO    0,8      0t0     5316 pipe
claws-mai  948 fraga   12w  FIFO    0,8      0t0     5316 pipe
claws-mai  948 fraga   13r  FIFO    0,8      0t0     5317 pipe
claws-mai  948 fraga   14w  FIFO    0,8      0t0     5317 pipe
claws-mai  948 fraga   18r  FIFO    0,8      0t0    19003 pipe
claws-mai  948 fraga   19w  FIFO    0,8      0t0    19003 pipe
akonadi_b  949 fraga    0r  FIFO    0,8      0t0     4131 pipe
akonadi_b  949 fraga    4r  FIFO    0,8      0t0     5127 pipe
akonadi_b  949 fraga    5w  FIFO    0,8      0t0     5127 pipe
akonadi_f  950 fraga    0r  FIFO    0,8      0t0     4136 pipe
akonadi_f  950 fraga    4r  FIFO    0,8      0t0     4221 pipe
akonadi_f  950 fraga    5w  FIFO    0,8      0t0     4221 pipe
firefox    951 fraga    0r  FIFO    0,8      0t0      569 pipe
firefox    951 fraga   11r  FIFO    0,8      0t0     6210 pipe
firefox    951 fraga   12w  FIFO    0,8      0t0     6210 pipe
firefox    951 fraga   15r  FIFO    0,8      0t0     5263 pipe
firefox    951 fraga   16w  FIFO    0,8      0t0     5263 pipe
firefox    951 fraga   17r  FIFO    0,8      0t0     6227 pipe
firefox    951 fraga   18w  FIFO    0,8      0t0     6227 pipe
firefox    951 fraga   20r  FIFO    0,8      0t0     6228 pipe
firefox    951 fraga   21w  FIFO    0,8      0t0     6228 pipe
firefox    951 fraga   25r  FIFO    0,8      0t0     6256 pipe
firefox    951 fraga   26w  FIFO    0,8      0t0     6256 pipe
firefox    951 fraga   73r  FIFO    0,8      0t0     7196 pipe
firefox    951 fraga   93u   CHR 116,64      0t0 12321355 /dev/snd/controlC2
firefox    951 fraga   94u   CHR 116,64      0t0 12321355 /dev/snd/controlC2
firefox    951 fraga  119w  FIFO    0,8      0t0     7196 pipe
akonadi_a  956 fraga    0r  FIFO    0,8      0t0     4160 pipe
akonadi_a  956 fraga    4r  FIFO    0,8      0t0     4034 pipe
akonadi_a  956 fraga    5w  FIFO    0,8      0t0     4034 pipe
akonadi_a  957 fraga    0r  FIFO    0,8      0t0     4165 pipe
akonadi_a  957 fraga    4r  FIFO    0,8      0t0     2821 pipe
akonadi_a  957 fraga    5w  FIFO    0,8      0t0     2821 pipe
akonadi_a  958 fraga    0r  FIFO    0,8      0t0     4170 pipe
akonadi_a  958 fraga    4r  FIFO    0,8      0t0     5140 pipe
akonadi_a  958 fraga    5w  FIFO    0,8      0t0     5140 pipe
akonadi_a  959 fraga    0r  FIFO    0,8      0t0     4175 pipe
akonadi_a  959 fraga    4r  FIFO    0,8      0t0     4192 pipe
akonadi_a  959 fraga    5w  FIFO    0,8      0t0     4192 pipe
akonadi_a  960 fraga    0r  FIFO    0,8      0t0     4180 pipe
akonadi_a  960 fraga    4r  FIFO    0,8      0t0     2827 pipe
akonadi_a  960 fraga    5w  FIFO    0,8      0t0     2827 pipe
akonadi_a  961 fraga    0r  FIFO    0,8      0t0     2812 pipe
akonadi_a  961 fraga    4r  FIFO    0,8      0t0     4196 pipe
akonadi_a  961 fraga    5w  FIFO    0,8      0t0     4196 pipe
akonadi_a  962 fraga    0r  FIFO    0,8      0t0     4185 pipe
akonadi_a  962 fraga    4r  FIFO    0,8      0t0     4043 pipe
akonadi_a  962 fraga    5w  FIFO    0,8      0t0     4043 pipe
akonadi_m  963 fraga    0r  FIFO    0,8      0t0     4036 pipe
akonadi_m  963 fraga    4r  FIFO    0,8      0t0     4236 pipe
akonadi_m  963 fraga    5w  FIFO    0,8      0t0     4236 pipe
akonadi_m  984 fraga    0r  FIFO    0,8      0t0     4053 pipe
akonadi_m  984 fraga    4r  FIFO    0,8      0t0     5227 pipe
akonadi_m  984 fraga    5w  FIFO    0,8      0t0     5227 pipe
akonadi_m  986 fraga    0r  FIFO    0,8      0t0     4058 pipe
akonadi_m  986 fraga    4r  FIFO    0,8      0t0     5158 pipe
akonadi_m  986 fraga    5w  FIFO    0,8      0t0     5158 pipe
akonadi_n  987 fraga    0r  FIFO    0,8      0t0     4063 pipe
akonadi_n  987 fraga    4r  FIFO    0,8      0t0     4243 pipe
akonadi_n  987 fraga    5w  FIFO    0,8      0t0     4243 pipe
akonadi_n  988 fraga    0r  FIFO    0,8      0t0     4068 pipe
akonadi_n  988 fraga    4r  FIFO    0,8      0t0     4275 pipe
akonadi_n  988 fraga    5w  FIFO    0,8      0t0     4275 pipe
akonadi_s  989 fraga    0r  FIFO    0,8      0t0     5164 pipe
akonadi_s  989 fraga    4r  FIFO    0,8      0t0     4288 pipe
akonadi_s  989 fraga    5w  FIFO    0,8      0t0     4288 pipe
akonadi_a 1020 fraga    0r  FIFO    0,8      0t0     5200 pipe
akonadi_a 1020 fraga    4r  FIFO    0,8      0t0     2912 pipe
akonadi_a 1020 fraga    5w  FIFO    0,8      0t0     2912 pipe
kio_http_ 1095 fraga    0r  FIFO    0,8      0t0      569 pipe
kio_http_ 1095 fraga    4r  FIFO    0,8      0t0     3036 pipe
kio_http_ 1095 fraga    5w  FIFO    0,8      0t0     3036 pipe
at-spi-bu 1127 fraga    4r  FIFO    0,8      0t0     6352 pipe
at-spi-bu 1127 fraga    5w  FIFO    0,8      0t0     6352 pipe
skype     3633 fraga    0r  FIFO    0,8      0t0      569 pipe
skype     3633 fraga    3r  FIFO    0,8      0t0    11954 pipe
skype     3633 fraga    4w  FIFO    0,8      0t0    11954 pipe
skype     3633 fraga    5r  FIFO    0,8      0t0    11956 pipe
skype     3633 fraga    6w  FIFO    0,8      0t0    11956 pipe
skype     3633 fraga   15r  FIFO    0,8      0t0    12719 pipe
skype     3633 fraga   16w  FIFO    0,8      0t0    12719 pipe
skype     3633 fraga   27r  FIFO    0,8      0t0    12721 pipe
skype     3633 fraga   28w  FIFO    0,8      0t0    12721 pipe
skype     3633 fraga   29r  FIFO    0,8      0t0    12722 pipe
skype     3633 fraga   30w  FIFO    0,8      0t0    12722 pipe
skype     3633 fraga   95r  FIFO    0,8      0t0    14463 pipe
skype     3633 fraga   98w  FIFO    0,8      0t0    14463 pipe
kio_http  6370 fraga    0r  FIFO    0,8      0t0      569 pipe
kio_http  6370 fraga    4r  FIFO    0,8      0t0    20743 pipe
kio_http  6370 fraga    5w  FIFO    0,8      0t0    20743 pipe
kio_http  6371 fraga    0r  FIFO    0,8      0t0      569 pipe
kio_http  6371 fraga    4r  FIFO    0,8      0t0    19941 pipe
kio_http  6371 fraga    5w  FIFO    0,8      0t0    19941 pipe
kio_http  6372 fraga    0r  FIFO    0,8      0t0      569 pipe
kio_http  6372 fraga    4r  FIFO    0,8      0t0    25500 pipe
kio_http  6372 fraga    5w  FIFO    0,8      0t0    25500 pipe
lsof      6377 fraga    1w  FIFO    0,8      0t0    21822 pipe
lsof      6377 fraga    4w  FIFO    0,8      0t0    20766 pipe
lsof      6377 fraga    5r  FIFO    0,8      0t0    20767 pipe
(...)

I'm suspecting of the snd-pcm-oss module (which isn't even used anymore) so I removed it and I'm testing if it's fine now (I'll reply here if it's solved ;).

Thanks.

DanielFragaBR commented 8 years ago

What's strange is that when I use Skype, the other software complain. MPlayer for example:

[AO_ALSA] alsa-lib: pcm_hw.c:1590:(snd_pcm_hw_open) open '/dev/snd/pcmC2D0p' failed (-16): Device or resource busy
[AO_ALSA] alsa-lib: pcm_dmix.c:1029:(snd_pcm_dmix_open) unable to open slave
[AO_ALSA] Playback open error: Device or resource busy
Failed to initialize audio driver 'alsa'
Could not open/initialize audio device -> no sound.

So it seems Skype is blocking the sound card, even if I'm using dmix. Strange, no?

i-rinat commented 8 years ago

I would say, something is locking sound card exclusively. That shouldn't happen if all applications output sound through dmix. But happens somehow.

i-rinat commented 8 years ago

So, to reiterate. Bug appears when you are using Skype with apulse, but doesn't appear when you are playing sound with mplayer?

DanielFragaBR commented 8 years ago

Yes, this is correct. I can play a video on Youtube through Firefox and Flash and at the same time play sounds with MPlayer.

Only when I use Skype with Apulse on a conversation the sound card is locked and no other application can use the sound card.

i-rinat commented 8 years ago

Have you tried to use default device with apulse? In other words, without using APULSE_PLAYBACK_DEVICE and/or APULSE_CAPTURE_DEVICE.

From what I know about .asoundrc file, that configuration should be enough.

DanielFragaBR commented 8 years ago

Yes, I tried, but it returns these errors:

ALSA lib confmisc.c:674:(snd_determine_driver) could not open control for card 0
ALSA lib conf.c:3328:(snd_config_hooks_call) function snd_config_hook_load_for_all_cards returned error: Invalid argument
ALSA lib conf.c:4694:(snd_config_expand) Unknown parameters 0,0
ALSA lib pcm.c:2239:(snd_pcm_open_noupdate) Unknown PCM dsnoop:0,0
[apulse] [error] do_connect_pcm, snd_pcm_open, Invalid argument
[apulse] [error] do_connect_pcm, snd_pcm_open, Invalid argument

Any hints?

i-rinat commented 8 years ago

Unknown PCM dsnoop:0,0

From my tests, numbers are working for dmix, but doesn't work for dsnoop. Could you try the following .asoundrc?

pcm.dsnooped {
        type dsnoop
        ipc_key 1027
        slave.pcm "hw:0,0"
}

pcm.!default {
         type asym
         playback.pcm {
                 type plug
                 slave.pcm "dmix:2,0"
         }
         capture.pcm {
                 type plug
                 slave.pcm "dsnooped"
         }
}
DanielFragaBR commented 8 years ago

Ok, I tried the .asoundrc you provided and I got new error messages:

ALSA lib timer_hw.c:342:(_snd_timer_hw_open) Unexpected field hint
ALSA lib timer_hw.c:342:(_snd_timer_hw_open) Unexpected field hint
ALSA lib pcm_direct.c:1136:(snd1_pcm_direct_initialize_poll_fd) unable to open timer 'hw:CLASS=3,SCLASS=0,CARD=0,DEV=0,SUBDEV=1'
ALSA lib pcm_dsnoop.c:687:(snd_pcm_dsnoop_open) unable to initialize poll_fd
[apulse] [error] do_connect_pcm, snd_pcm_open, Invalid argument
[apulse] [error] do_connect_pcm, snd_pcm_open, Invalid argument
i-rinat commented 8 years ago

Googling gives a hint — check if you have /dev/snd/timer file.

DanielFragaBR commented 8 years ago

It seems ok:

ls /dev/snd/timer -l
crw-rw-rw- 1 root audio 116, 33 Feb 16 19:34 /dev/snd/timer
i-rinat commented 8 years ago

Well, I'm out of ideas. If only to change "hw:0,0" to "hw:0". Maybe it doesn't like subdevice 0.

DanielFragaBR commented 8 years ago

I tried, but it doesn't seem to make any difference. Anyway, I'll keep trying (or using with APULSE_PLAYBACK_DEVICE=plughw:2,0 APULSE_CAPTURE_DEVICE=plughw:0,0 since it at least works temporarily).

Thanks!

i-rinat commented 8 years ago

plughw

Just for your information, plughw devices are not using dmix or dsnoop. So if one application uses plughw:0,0, no other app will have access to the audiocard. The difference between hw and plughw is that plughw have automatic sample rate conversion.

DanielFragaBR commented 8 years ago

Hmm ok, so that's it. So is there a way to use APULSE_PLAYBACK_DEVICE and APULSE_CAPTURE_DEVICE to force it to use dmix/dsnoop?

i-rinat commented 8 years ago

I would try

APULSE_PLAYBACK_DEVICE=dmix:2,0 APULSE_CAPTURE_DEVICE=plug:dsnoop apulse skype
DanielFragaBR commented 8 years ago

Good news. The solution was simple:

http://www.linuxquestions.org/questions/slackware-14/steam-client-32bit-games-lacking-sound-due-to-current-updates-4175559128/

There was some issue between 32 bit ALSA libraries and the 'hint" sections, so I just removed it from /usr/share/alsa/alsa.conf:

"I just fixed sound in csgo by editing /usr/share/alsa/alsa.conf and commenting out the timer hint sections at lines 584 and 630-633."

Now it's perfect! I'm closing this,since it isn't a bug of apulse.

i-rinat commented 8 years ago

Glad to hear it!

One of the cryptic issues that's actually fixed. That's rare, unfortunately.