What should I do to prevent this error and allow sound to a Java 11 application? I already have the pulsaudio and alsa interfaces connected.
Feb-09 10:43:13.916 [AvoidStandbyModeService-thread] ERROR b.c.a.AvoidStandbyModeService: java.lang.IllegalArgumentException: No line matching interface SourceDataLine supporting format PCM_SIGNED 44100.0 Hz, 16 bit, stereo, 4 bytes/frame, big-endian is supported.
java.lang.IllegalArgumentException: No line matching interface SourceDataLine supporting format PCM_SIGNED 44100.0 Hz, 16 bit, stereo, 4 bytes/frame, big-endian is supported.
at java.desktop/javax.sound.sampled.AudioSystem.getLine(AudioSystem.java:423)
at bisq.core.app.AvoidStandbyModeService.play(AvoidStandbyModeService.java:93)
at java.base/java.lang.Thread.run(Thread.java:844)
After looking into this more, I’m not sure the error is sound related. The error is showing up because the application is trying to monitor system resources and the “AvoidStandbyModeService” is failing in the application.
What would I do with an application which wants access like this?
= AppArmor =
Time: Feb 12 12:10:44
Log: apparmor="ALLOWED" operation="open" profile="snap.bisq-desktop.bisq-desktop" name="/sys/fs/cgroup/memory/user.slice/user-1000.slice/user@1000.service/memory.limit_in_bytes" pid=5109 comm="Bisq" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0
File: /sys/fs/cgroup/memory/user.slice/user-1000.slice/user@1000.service/memory.limit_in_bytes (read)
Suggestions:
* adjust program to not access '/sys/fs/cgroup/memory/user.slice/user-1000.slice/user@1000.service/memory.limit_in_bytes'
* adjust program to not access '/sys/fs/cgroup/memory/user.slice/user-[0-9]*.slice/user@[0-9]*.service/memory.limit_in_bytes'
= AppArmor =
Time: Feb 12 12:10:44
Log: apparmor="ALLOWED" operation="open" profile="snap.bisq-desktop.bisq-desktop" name="/sys/fs/cgroup/cpu,cpuacct/cpu.shares" pid=5109 comm="Bisq" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0
File: /sys/fs/cgroup/cpu,cpuacct/cpu.shares (read)
Suggestion:
* adjust program to not access '/sys/fs/cgroup/cpu,cpuacct/cpu.shares'
= AppArmor =
Time: Feb 12 12:10:44
Log: apparmor="ALLOWED" operation="open" profile="snap.bisq-desktop.bisq-desktop" name="/sys/fs/cgroup/cpu,cpuacct/cpu.cfs_quota_us" pid=5109 comm="Bisq" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0
File: /sys/fs/cgroup/cpu,cpuacct/cpu.cfs_quota_us (read)
Suggestion:
* adjust program to not access '/sys/fs/cgroup/cpu,cpuacct/cpu.cfs_quota_us'
= AppArmor =
Time: Feb 12 12:10:44
Log: apparmor="ALLOWED" operation="open" profile="snap.bisq-desktop.bisq-desktop" name="/sys/fs/cgroup/cpu,cpuacct/cpu.cfs_period_us" pid=5109 comm="Bisq" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0
File: /sys/fs/cgroup/cpu,cpuacct/cpu.cfs_period_us (read)
Suggestion:
* adjust program to not access '/sys/fs/cgroup/cpu,cpuacct/cpu.cfs_period_us'
= AppArmor =
Time: Feb 12 12:10:44
Log: apparmor="ALLOWED" operation="open" profile="snap.bisq-desktop.bisq-desktop" name="/sys/fs/cgroup/cpu,cpuacct/cpu.shares" pid=5109 comm="Bisq" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0
File: /sys/fs/cgroup/cpu,cpuacct/cpu.shares (read)
Suggestion:
* adjust program to not access '/sys/fs/cgroup/cpu,cpuacct/cpu.shares'
= AppArmor =
Time: Feb 12 12:10:44
Log: apparmor="ALLOWED" operation="open" profile="snap.bisq-desktop.bisq-desktop" name="/sys/fs/cgroup/cpu,cpuacct/cpu.cfs_quota_us" pid=5109 comm="Bisq" requested_mask="r" denied_mask="r" fsuid=1000 ouid=0
File: /sys/fs/cgroup/cpu,cpuacct/cpu.cfs_quota_us (read)
Suggestion:
* adjust program to not access '/sys/fs/cgroup/cpu,cpuacct/cpu.cfs_quota_us'
As of today, there are no interfaces that allow this access that would be suitable for this application. snappy-degug is giving you the advice you need. I suspect that if these accesses were allowed, then the application would get caught up with another access in the cgroup hierarchy. You can test this yourself by modifying /var/lib/snapd/apparmor/profiles/snap.bisq-desktop.bisq-desktop to have:
/sys/fs/cgroup/*/* r,
and then reloading the policy with: sudo apparmor_parser -r /var/lib/snapd/apparmor/profiles/snap.bisq-desktop.bisq-desktop. Feel free to iterate and add more accesses and post back your changes. If your application only needs read access, perhaps that access could be added to an existing or new interface.
FWIW, we have a snap that attempts to read it’s own cgroup cpu limits in order to automatically determine a reasonable thread pool to allocate for itself (it’s a database application). If there was an interface for just reading cgroups information we would add it to the snap. As it is now it’s harmless and handles the denial properly, but is quite noisy. Example denial we see:
It still didn’t remove the application error about No line matching interface SourceDataLine supporting format PCM_SIGNED 44100.0 Hz, 16 bit, stereo, 4 bytes/frame, big-endian is supported. though. I’m guessing I’m still missing something to do with sound. I’m probably going to look into the source code and see what triggers the error.
and various other cpu cgroup properties to something like system-observe?
I’ve seen a fair number of Java applications (i.e. cassandra comes to my mind immediately) try with read access on these, presumably for some kind of JVM optimization.