<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>my tech blog &#187; Linux sound</title>
	<atom:link href="http://billauer.se/blog/category/linux-sound/feed/" rel="self" type="application/rss+xml" />
	<link>https://billauer.se/blog</link>
	<description>Anything I found worthy to write down.</description>
	<lastBuildDate>Thu, 12 Mar 2026 11:36:00 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.2</generator>
		<item>
		<title>Linux Mint + Cinnamon: Volume buttons stop to work suddenly</title>
		<link>https://billauer.se/blog/2023/05/cinnamon-volume-buttons-dbus/</link>
		<comments>https://billauer.se/blog/2023/05/cinnamon-volume-buttons-dbus/#comments</comments>
		<pubDate>Wed, 31 May 2023 09:58:16 +0000</pubDate>
		<dc:creator>eli</dc:creator>
				<category><![CDATA[cinnamon]]></category>
		<category><![CDATA[Linux sound]]></category>
		<category><![CDATA[systemd]]></category>

		<guid isPermaLink="false">https://billauer.se/blog/?p=6875</guid>
		<description><![CDATA[The nuisance After trying to fix another problem with Pulseaudio, and messing up a bit with its configuration files, the option to control the volume by virtue of keyboard buttons suddenly stopped to work. The cursor would blink briefly when pressing the button, but nothing else happened. I tried all the fairly normal things, including [...]]]></description>
			<content:encoded><![CDATA[<h3>The nuisance</h3>
<p>After trying to fix another problem with Pulseaudio, and messing up a bit with its configuration files, the option to control the volume by virtue of keyboard buttons suddenly stopped to work. The cursor would blink briefly when pressing the button, but nothing else happened.</p>
<p>I tried all the fairly normal things, including to restart the Pulseaudio daemon, to restart Cinnamon (with <a title="When mplayer plays a black window (or: Cinnamon leaking GPU memory)" href="https://billauer.se/blog/2019/04/cinnamon-gpu-memory-leak-restart/" target="_blank">Alt-F2 + &#8220;r&#8221;</a>), restart the session by changing the user (to the same user), disconnect and reconnect the (USB) keyboard, and a whole lot of other things.</p>
<p>It took me quite some time to fix this, so here&#8217;s what worked for me this time, along with some debug info.</p>
<p>The machine was a Linux Mint 19 with Cinnamon.</p>
<p>At an earlier stage, even the sound applet was gone from its desktop panel. To fix that, I right-clicked the panel, picked Troubleshoot &gt; Looking Glass, and picked the Extension tab. There&#8217;s an applet listed called &#8220;Sound&#8221;. So I right-clicked it, and chose &#8220;Reload Code&#8221;. That got the applet back to the panel, and it worked flawlessly. But then I was stuck with the volume button problem.</p>
<h3>The fix</h3>
<p>What I actually did:</p>
<ul>
<li>Kill the process named csd-keyboard (probably irrelevant)</li>
<li>Kill the process named csd-media-keys</li>
<li>Restart pulseaudio with &#8220;pulseaudio -k&#8221;</li>
</ul>
<p>This was the output of journalctl as a result of these:</p>
<pre>May 31 12:17:03 cinnamon-session[2115]: WARNING: t+1132491.55749s: Application 'cinnamon-settings-daemon-keyboard.desktop' killed by signal 15
May 31 12:17:17 cinnamon-session[2115]: WARNING: t+1132505.78238s: Application 'cinnamon-settings-daemon-media-keys.desktop' killed by signal 15
May 31 12:17:17 rtkit-daemon[2284]: Successfully made thread 4304 of process 4304 (n/a) owned by '1010' high priority at nice level -11.
May 31 12:17:17 rtkit-daemon[2284]: Supervising 8 threads of 4 processes of 1 users.
<span class="punch">May 31 12:17:17 pulseaudio[4304]: [pulseaudio] pid.c: Daemon already running.
</span>May 31 12:18:04 bluetoothd[12009]: Endpoint unregistered: sender=:1.120210 path=/MediaEndpoint/A2DPSource
May 31 12:18:04 bluetoothd[12009]: Endpoint unregistered: sender=:1.120210 path=/MediaEndpoint/A2DPSink
May 31 12:18:04 rtkit-daemon[2284]: Successfully made thread 4345 of process 4345 (n/a) owned by '1010' high priority at nice level -11.
May 31 12:18:04 rtkit-daemon[2284]: Supervising 4 threads of 4 processes of 1 users.
May 31 12:18:04 pulseaudio[4345]: [pulseaudio] sink.c: Default and alternate sample rates are the same.
May 31 12:18:04 rtkit-daemon[2284]: Supervising 3 threads of 3 processes of 1 users.
May 31 12:18:04 rtkit-daemon[2284]: Successfully made thread 4347 of process 4345 (n/a) owned by '1010' RT at priority 5.
May 31 12:18:04 rtkit-daemon[2284]: Supervising 4 threads of 3 processes of 1 users.
May 31 12:18:04 rtkit-daemon[2284]: Supervising 4 threads of 3 processes of 1 users.
May 31 12:18:04 rtkit-daemon[2284]: Successfully made thread 4348 of process 4345 (n/a) owned by '1010' RT at priority 5.
May 31 12:18:04 rtkit-daemon[2284]: Supervising 5 threads of 3 processes of 1 users.
May 31 12:18:04 rtkit-daemon[2284]: Supervising 5 threads of 3 processes of 1 users.
May 31 12:18:04 rtkit-daemon[2284]: Successfully made thread 4349 of process 4345 (n/a) owned by '1010' RT at priority 5.
May 31 12:18:04 rtkit-daemon[2284]: Supervising 6 threads of 3 processes of 1 users.
May 31 12:18:05 rtkit-daemon[2284]: Supervising 6 threads of 3 processes of 1 users.
May 31 12:18:05 rtkit-daemon[2284]: Successfully made thread 4350 of process 4345 (n/a) owned by '1010' RT at priority 5.
May 31 12:18:05 rtkit-daemon[2284]: Supervising 7 threads of 3 processes of 1 users.
May 31 12:18:05 bluetoothd[12009]: Endpoint registered: sender=:1.120482 path=/MediaEndpoint/A2DPSource
May 31 12:18:05 bluetoothd[12009]: Endpoint registered: sender=:1.120482 path=/MediaEndpoint/A2DPSink
May 31 12:18:05 pulseaudio[4345]: [pulseaudio] backend-ofono.c: Failed to register as a handsfree audio agent with ofono: org.freedesktop.DBus.Error.ServiceUnknown: The name org.ofono was not provided by any .service files
May 31 12:18:05 rtkit-daemon[2284]: Successfully made thread 4352 of process 4352 (n/a) owned by '1010' high priority at nice level -11.
May 31 12:18:05 rtkit-daemon[2284]: Supervising 8 threads of 4 processes of 1 users.
May 31 12:18:05 pulseaudio[4352]: [pulseaudio] pid.c: Daemon already running.
May 31 12:18:58 gnome-keyring-daemon[2204]: asked to register item /org/freedesktop/secrets/collection/login/9, but it's already registered</pre>
<p>I suppose that killing csd-media-keys was the part that really did the trick, because that caused a request to start Pulseaudio.</p>
<h3>Why it worked (presumably)</h3>
<p>The cinnamon-settings-daemon is the component responsible for passing the keyboard request to Pulseaudio. Apparently, messing up with Pulseaudio caused one of its components, csd-media-keys, to mess up as well. Killing it caused cinnamon-settings-daemon to restart it automatically. From fresh.</p>
<p>It&#8217;s fine to kill the csd-* processes. Nothing dramatic happens. The killed process is just restarted. But I haven&#8217;t tried to kill cinnamon-settings-daemon itself. I believe it will restart Cinnamon completely, something I wanted to avoid.</p>
<h3>Dbus activity</h3>
<p>I&#8217;ve already <a title="systemd / DBus debugging starter pack" href="https://billauer.se/blog/2019/05/dbus-dump-systemd-debugging/" target="_blank">written a post</a> mentioning how to monitor the Dbus. So here&#8217;s a different take on the same topic.</p>
<p>The difference is quite evident when running dbus-monitor (not as root) as follows in order to monitor the activity for the current session:</p>
<pre>$ dbus-monitor</pre>
<p>This is the output as a result of pressing a volume up button, when it works correctly (i.e. after fixing the problem):</p>
<pre>method call time=1685525392.173838 sender=:<span class="punch">1.6531</span> -&gt; destination=:<span class="punch">1.6616</span> serial=1431 path=/org/cinnamon/SettingsDaemon/KeybindingHandler; interface=org.cinnamon.SettingsDaemon.KeybindingHandler; member=HandleKeybinding
   uint32 2
method call time=1685525392.174967 sender=:1.6616 -&gt; destination=org.freedesktop.DBus serial=566 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=AddMatch
   string "type='signal',interface='ca.desrt.dconf.Writer',path='/ca/desrt/dconf/Writer/user',arg0path='/org/cinnamon/desktop/sound/'"
method return time=1685525392.175012 sender=org.freedesktop.DBus -&gt; destination=:1.6616 serial=382 reply_serial=566
method call time=1685525392.175026 sender=:1.6616 -&gt; destination=:1.6531 serial=567 path=/org/Cinnamon; interface=org.Cinnamon; member=ShowOSD
   array [
      dict entry(
         string "icon"
         variant             string "audio-volume-medium-symbolic"
      )
      dict entry(
         string "level"
         variant             int32 34
      )
   ]
method call time=1685525392.175170 sender=:1.6616 -&gt; destination=org.freedesktop.DBus serial=568 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=RemoveMatch
   string "type='signal',interface='ca.desrt.dconf.Writer',path='/ca/desrt/dconf/Writer/user',arg0path='/org/cinnamon/desktop/sound/'"
method return time=1685525392.175189 sender=org.freedesktop.DBus -&gt; destination=:1.6616 serial=383 reply_serial=568
method call time=1685525392.175198 sender=:1.6616 -&gt; destination=org.freedesktop.DBus serial=569 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=AddMatch
   string "type='signal',interface='ca.desrt.dconf.Writer',path='/ca/desrt/dconf/Writer/user',arg0path='/org/cinnamon/desktop/sound/'"
method return time=1685525392.175216 sender=org.freedesktop.DBus -&gt; destination=:1.6616 serial=384 reply_serial=569
method call time=1685525392.176330 sender=:<span class="punch">1.6618</span> -&gt; destination=org.freedesktop.DBus serial=26 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=RequestName
   string "org.freedesktop.ReserveDevice1.Audio2"
   uint32 5
signal time=1685525392.176383 sender=org.freedesktop.DBus -&gt; destination=(null destination) serial=50 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameOwnerChanged
   string "org.freedesktop.ReserveDevice1.Audio2"
   string ""
   string ":1.6618"
signal time=1685525392.176411 sender=org.freedesktop.DBus -&gt; destination=:1.6618 serial=51 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=NameAcquired
   string "org.freedesktop.ReserveDevice1.Audio2"
method return time=1685525392.176427 sender=org.freedesktop.DBus -&gt; destination=:1.6618 serial=52 reply_serial=26
   uint32 1
method return time=1685525392.184853 sender=:1.6616 -&gt; destination=:1.6531 serial=570 reply_serial=1431
method call time=1685525392.184915 sender=:1.6616 -&gt; destination=org.freedesktop.DBus serial=571 path=/org/freedesktop/DBus; interface=org.freedesktop.DBus; member=RemoveMatch
   string "type='signal',interface='ca.desrt.dconf.Writer',path='/ca/desrt/dconf/Writer/user',arg0path='/org/cinnamon/desktop/sound/'"
method return time=1685525392.184937 sender=org.freedesktop.DBus -&gt; destination=:1.6616 serial=385 reply_serial=571
method return time=1685525392.190757 sender=:1.6531 -&gt; destination=:1.6616 serial=1432 reply_serial=567</pre>
<p>Unfortunately, I didn&#8217;t save the output before the fix. But it was exactly two rows of output. As far as I recall, the first and last row from this dump were present when it didn&#8217;t work (i.e. the row involving KeybindingHandler&#8217;s request, and the return method that closed it).</p>
<p>The bus addresses can be listed with the following command:</p>
<pre>$ busctl <span style="color: #ff0000;"><strong>--user</strong></span></pre>
<p>In this specific session the output was:</p>
<pre>NAME                                                       PID PROCESS         USER             CONNECTION    UNIT                      SESSION    DESCRIPTION
:1.0                                                      2103 systemd         eli              :1.0          user@1010.service         -          -
:1.1014                                                  45251 pxgsettings     eli              :1.1014       session-c1.scope          c1         -
:1.1015                                                  45277 scp-dbus-servic eli              :1.1015       user@1010.service         -          -
:1.1016                                                  45277 scp-dbus-servic eli              :1.1016       user@1010.service         -          -
:1.12                                                     2213 csd-a11y-keyboa eli              :1.12         session-c1.scope          c1         -
:1.1234                                                  53331 nemo            eli              :1.1234       session-c1.scope          c1         -
:1.13                                                     2221 csd-a11y-settin eli              :1.13         session-c1.scope          c1         -
:1.131                                                   16564 klauncher       eli              :1.131        session-c1.scope          c1         -
:1.16                                                     2232 csd-cursor      eli              :1.16         session-c1.scope          c1         -
:1.17                                                     2225 csd-color       eli              :1.17         session-c1.scope          c1         -
:1.18                                                     2238 csd-clipboard   eli              :1.18         session-c1.scope          c1         -
:1.19                                                     2242 csd-orientation eli              :1.19         session-c1.scope          c1         -
:1.20                                                     2233 csd-wacom       eli              :1.20         session-c1.scope          c1         -
:1.21                                                     2245 csd-xsettings   eli              :1.21         session-c1.scope          c1         -
:1.22                                                     2248 csd-mouse       eli              :1.22         session-c1.scope          c1         -
:1.24                                                     2256 csd-print-notif eli              :1.24         session-c1.scope          c1         -
:1.26                                                     2258 csd-background  eli              :1.26         session-c1.scope          c1         -
:1.27                                                     2260 gvfsd           eli              :1.27         user@1010.service         -          -
:1.28                                                     2267 csd-housekeepin eli              :1.28         session-c1.scope          c1         -
:1.29                                                     2274 csd-screensaver eli              :1.29         session-c1.scope          c1         -
:1.30                                                     2270 csd-power       eli              :1.30         session-c1.scope          c1         -
:1.31                                                     2299 dconf-service   eli              :1.31         user@1010.service         -          -
:1.32                                                     2285 csd-automount   eli              :1.32         session-c1.scope          c1         -
:1.329                                                   22590 xreader         eli              :1.329        session-c1.scope          c1         -
:1.33                                                     2306 gvfsd-fuse      eli              :1.33         user@1010.service         -          -
:1.330                                                   22596 xreaderd        eli              :1.330        user@1010.service         -          -
:1.332                                                   22606 WebKitNetworkPr eli              :1.332        session-c1.scope          c1         -
:1.35                                                     2313 csd-printer     eli              :1.35         session-c1.scope          c1         -
:1.37                                                     2349 gvfs-udisks2-vo eli              :1.37         user@1010.service         -          -
:1.38                                                     2384 gvfs-gphoto2-vo eli              :1.38         user@1010.service         -          -
:1.39                                                     2277 csd-xrandr      eli              :1.39         session-c1.scope          c1         -
:1.40                                                     2410 gvfs-goa-volume eli              :1.40         user@1010.service         -          -
:1.41                                                     2414 goa-daemon      eli              :1.41         user@1010.service         -          -
:1.42                                                     2427 goa-identity-se eli              :1.42         user@1010.service         -          -
:1.43                                                     2432 gvfs-mtp-volume eli              :1.43         user@1010.service         -          -
:1.44                                                     2436 gvfs-afc-volume eli              :1.44         user@1010.service         -          -
:1.448                                                   31116 gvfsd-http      eli              :1.448        user@1010.service         -          -
:1.457                                                   31367 gvfsd-network   eli              :1.457        user@1010.service         -          -
:1.46                                                     2472 polkit-gnome-au eli              :1.46         session-c1.scope          c1         -
:1.463                                                   31401 gvfsd-dnssd     eli              :1.463        user@1010.service         -          -
:1.47                                                     2481 cinnamon-killer eli              :1.47         session-c1.scope          c1         -
:1.48                                                     2478 nemo-desktop    eli              :1.48         session-c1.scope          c1         -
:1.49                                                     2480 nm-applet       eli              :1.49         session-c1.scope          c1         -
:1.5                                                      2115 cinnamon-sessio eli              :1.5          session-c1.scope          c1         -
:1.50                                                     2474 blueberry-obex- eli              :1.50         session-c1.scope          c1         -
:1.51                                                     2474 blueberry-obex- eli              :1.51         session-c1.scope          c1         -
:1.52                                                     2499 obexd           eli              :1.52         user@1010.service         -          -
:1.54                                                     2506 gvfsd-trash     eli              :1.54         user@1010.service         -          -
:1.55                                                     2512 gvfsd-metadata  eli              :1.55         user@1010.service         -          -
:1.56                                                     2535 python2         eli              :1.56         session-c1.scope          c1         -
:1.5653                                                  62813 chrome          eli              :1.5653       session-c1.scope          c1         -
:1.5654                                                  62813 chrome          eli              :1.5654       session-c1.scope          c1         -
:1.5655                                                  62813 chrome          eli              :1.5655       session-c1.scope          c1         -
:1.5656                                                  62813 chrome          eli              :1.5656       session-c1.scope          c1         -
:1.5661                                                  62813 chrome          eli              :1.5661       session-c1.scope          c1         -
:1.57                                                     2534 cinnamon-screen eli              :1.57         session-c1.scope          c1         -
:1.58                                                     2574 gnome-terminal  eli              :1.58         session-c1.scope          c1         -
:1.5834                                                  52878 xreader         eli              :1.5834       session-c1.scope          c1         -
:1.5836                                                  52891 WebKitNetworkPr eli              :1.5836       session-c1.scope          c1         -
:1.5842                                                  54509 xreader         eli              :1.5842       session-c1.scope          c1         -
:1.5843                                                  54522 WebKitNetworkPr eli              :1.5843       session-c1.scope          c1         -
:1.59                                                     2574 gnome-terminal  eli              :1.59         session-c1.scope          c1         -
:1.6                                                      2115 cinnamon-sessio eli              :1.6          session-c1.scope          c1         -
:1.60                                                     2579 gconfd-2        eli              :1.60         user@1010.service         -          -
:1.61                                                     2574 gnome-terminal  eli              :1.61         session-c1.scope          c1         -
:1.6105                                                  47745 xreader         eli              :1.6105       session-c1.scope          c1         -
:1.6107                                                  47757 WebKitNetworkPr eli              :1.6107       session-c1.scope          c1         -
:1.6477                                                  31538 thunderbird-bin eli              :1.6477       session-c1.scope          c1         -
:1.6478                                                  31538 thunderbird-bin eli              :1.6478       session-c1.scope          c1         -
<span class="punch">:1.6531                                                   2451 cinnamon        eli              :1.6531       session-c1.scope          c1         -
</span>:1.6562                                                  69100 csd-sound       eli              :1.6562       session-c1.scope          c1         -
:1.6592                                                   1641 firefox-bin     eli              :1.6592       session-c1.scope          c1         -
:1.6593                                                   1641 firefox-bin     eli              :1.6593       session-c1.scope          c1         -
:1.6594                                                   1700 Web Content     eli              :1.6594       session-c1.scope          c1         -
:1.6595                                                   1760 WebExtensions   eli              :1.6595       session-c1.scope          c1         -
:1.6596                                                   1824 Web Content     eli              :1.6596       session-c1.scope          c1         -
:1.6597                                                   1876 Web Content     eli              :1.6597       session-c1.scope          c1         -
:1.6598                                                   1975 cinnamon-settin eli              :1.6598       session-c1.scope          c1         -
:1.6599                                                   1975 cinnamon-settin eli              :1.6599       session-c1.scope          c1         -
:1.6608                                                   2640 Web Content     eli              :1.6608       session-c1.scope          c1         -
:1.6609                                                   3399 Web Content     eli              :1.6609       session-c1.scope          c1         -
:1.6615                                                   4286 csd-keyboard    eli              :1.6615       session-c1.scope          c1         -
<span class="punch">:1.6616                                                   4296 csd-media-keys  eli              :1.6616       session-c1.scope          c1         -
</span>:1.6617                                                   4296 csd-media-keys  eli              :1.6617       session-c1.scope          c1         -
<span class="punch">:1.6618                                                   4345 pulseaudio      eli              :1.6618       session-c1.scope          c1         -
</span>:1.6621                                                   4692 xed             eli              :1.6621       session-c1.scope          c1         -
:1.6625                                                   5225 busctl          eli              :1.6625       session-c1.scope          c1         -
:1.67                                                     2860 applet.py       eli              :1.67         session-c1.scope          c1         -
:1.7                                                      2189 at-spi-bus-laun eli              :1.7          user@1010.service         -          -
:1.73                                                     3537 gnome-system-mo eli              :1.73         session-c1.scope          c1         -
:1.8                                                      2196 at-spi2-registr eli              :1.8          user@1010.service         -          -
:1.9                                                      2204 gnome-keyring-d eli              :1.9          session-c1.scope          c1         -
:1.92                                                     8884 xdg-desktop-por eli              :1.92         user@1010.service         -          -
:1.93                                                     8888 xdg-document-po eli              :1.93         user@1010.service         -          -
:1.94                                                     8891 xdg-permission- eli              :1.94         user@1010.service         -          -
:1.95                                                     8902 pxgsettings     eli              :1.95         user@1010.service         -          -
:1.96                                                     8906 xdg-desktop-por eli              :1.96         user@1010.service         -          -
ca.desrt.dconf                                            2299 dconf-service   eli              :1.31         user@1010.service         -          -
ca.desrt.dconf-editor                                        - -               -                (activatable) -                         -
org.Cinnamon                                              2451 cinnamon        eli              :1.6531       session-c1.scope          c1         -
org.Cinnamon.HotplugSniffer                                  - -               -                (activatable) -                         -
org.Cinnamon.LookingGlass                                 2451 cinnamon        eli              :1.6531       session-c1.scope          c1         -
org.Cinnamon.Melange                                         - -               -                (activatable) -                         -
org.Cinnamon.Slideshow                                       - -               -                (activatable) -                         -
org.Nemo                                                 53331 nemo            eli              :1.1234       session-c1.scope          c1         -
org.NemoDesktop                                           2478 nemo-desktop    eli              :1.48         session-c1.scope          c1         -
org.PulseAudio1                                           4345 pulseaudio      eli              :1.6618       session-c1.scope          c1         -
org.a11y.Bus                                              2189 at-spi-bus-laun eli              :1.7          user@1010.service         -          -
org.bluez.obex                                            2499 obexd           eli              :1.52         user@1010.service         -          -
org.cinnamon.ScreenSaver                                  2534 cinnamon-screen eli              :1.57         session-c1.scope          c1         -
org.cinnamon.SettingsDaemon.KeybindingHandler             4296 csd-media-keys  eli              :1.6616       session-c1.scope          c1         -</pre>
<p>So it&#8217;s quite clear that the players here were cinnamon&#8217;s main socket, csd-media-keys and pulseaudio.</p>
]]></content:encoded>
			<wfw:commentRss>https://billauer.se/blog/2023/05/cinnamon-volume-buttons-dbus/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>systemd user services and Pulseaudio on Lubuntu 16.04</title>
		<link>https://billauer.se/blog/2017/12/user-systemd-pulseaudio/</link>
		<comments>https://billauer.se/blog/2017/12/user-systemd-pulseaudio/#comments</comments>
		<pubDate>Fri, 01 Dec 2017 07:09:12 +0000</pubDate>
		<dc:creator>eli</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Linux sound]]></category>
		<category><![CDATA[systemd]]></category>

		<guid isPermaLink="false">https://billauer.se/blog/?p=5306</guid>
		<description><![CDATA[Introduction These are my notes as I made Pulseaudio work on an ARM v7-based Embedded Lubuntu 16.04, which doesn&#8217;t support Pulseaudio otherwise. The goal: On a mini-distribution based upon Lubuntu, for use of others, make Pulseaudio work even though the Lubuntu desktop won&#8217;t start it. In fact, it&#8217;s supposed to run even without any X [...]]]></description>
			<content:encoded><![CDATA[<h3>Introduction</h3>
<p>These are my notes as I made Pulseaudio work on an ARM v7-based Embedded Lubuntu 16.04, which doesn&#8217;t support Pulseaudio otherwise.</p>
<p>The goal: On a mini-distribution based upon Lubuntu, for use of others, make Pulseaudio work even though the Lubuntu desktop won&#8217;t start it. In fact, it&#8217;s supposed to run even without any X server running.</p>
<p>Being an embedded distribution, basically everything (except for certain daemons that drop their privileges) runs as root. Nothing one should try on a desktop computer, but it&#8217;s a very common practice on embedded mini-distros. Raspbian excluded.</p>
<h3>The problem</h3>
<p>There are basically two ways to run pulseaudio: Per-user (actually, per-session) and <a href="https://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/SystemWide/" target="_blank">in system mode</a>, which is <a href="https://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/WhatIsWrongWithSystemWide/" target="_blank">discouraged</a>, mostly for security reasons. Given that pulseaudio runs as root on a system where the user is root, I&#8217;m not so sure it would have made such a difference. This way or another, I went for user mode.</p>
<p>Which bring me to the actual problem: On a systemd-based OS, pulseaudio expects the XDG_RUNTIME_DIR environment variable to be set to /run/user/<em>UID </em>on its invocation, where <em>UID</em> is the number of the user which shall have access to Pulseaudio. Not only that, this directory must exist when pulseaudio is launched.</p>
<h3>Some systemd background</h3>
<p>The /run/user/ tmpfs-mounted directory is maintained by pam_systemd (see <a href="https://www.freedesktop.org/software/systemd/man/pam_systemd.html" target="_blank">man pam_systemd</a>, and possibly <a href="https://superuser.com/questions/1056926/is-var-run-user-uid-the-new-var-run-for-pid-files" target="_blank">this too</a>), which adds an entry with a UID when the respective user starts its first session (typically by logging in somehow), and removes this directory (and its content) when the last session for this user is finished.</p>
<p>Among other things pam_systemd does when a user creates its first session, is starting a new instance of the system service user@.service, which runs the  systemd user manager instance (typically the template service /lib/systemd/system/user@.service). Which in turn calls &#8220;/lib/systemd/systemd &#8211;user&#8221; with the user ID set to the relevant uid by virtue of a &#8220;User=&#8221; directive in the said service unit file. So this is how we end up with something like:</p>
<pre># systemctl status
<span style="color: #888888;"><em>[ ... ]</em></span>
          └─user.slice
             └─user-0.slice
               ├─user@0.service
               │ └─init.scope
               │   ├─2227 /lib/systemd/systemd --user
               │   └─2232 (sd-pam)
               ├─session-c1.scope
               │ ├─2160 /bin/login -f
               │ ├─2238 -bash
<span style="color: #888888;"><em>[ ... ]</em></span></pre>
<p>An important aspect of the systemd &#8211;user call is that <a href="https://wiki.archlinux.org/index.php/Systemd/User" target="_blank">User Services</a> are executed as required: The new user-systemd reads unit files (i.e. the *.wants directories) from ~/.config/systemd/user/, /etc/systemd/user/ and /usr/lib/systemd/user/.</p>
<p>This feature allows certain services to run as long as a specific user has at least one session open, running with this user&#8217;s UID. Quite helpful for the Pulseaudio service.</p>
<p>From a practical point of view, the difference from regular systemd services  is that the service files are put in the systemd/user directory rather than systemd/system. The calls to systemctl also need to indicate that we&#8217;re dealing with user services. The &#8211;user flag makes systemctl relate to user services that are enabled or disabled for each user separately, while the &#8211;global flag relates to user services that are enabled or disabled for all users. This is reflected in the following:</p>
<pre># systemctl --user enable tryuser
Created symlink from <span style="color: #ff0000;"><strong>/root/.config/systemd/</strong></span>user/default.target.wants/tryuser.service to /etc/systemd/user/tryuser.service.</pre>
<p>which is just for the user calling systemctl, versus</p>
<pre># systemctl --global enable tryuser
Created symlink <span style="color: #ff0000;"><strong>/etc/systemd/</strong></span>user/default.target.wants/tryuser.service, pointing to /etc/systemd/user/tryuser.service.</pre>
<p>which enables a user service for each user that has a session in the system. Note that in both cases, the original service unit file was in the same directory, /etc/systemd/user/.</p>
<p>Another little remark: Since the launch of a user service depends on a very specific event (at least one user having a session), the WantedBy directive is typically set ot default.target. No need to fuss.</p>
<p>And almost needless to say, there might be several user services running in parallel, one for each user having an active session. Note however that neither &#8220;sudo&#8221; or &#8220;su&#8221; generate a new session, as they merely start a process (with a shell) with another user (root).</p>
<h3>A pulseaudio service</h3>
<p>This solution isn&#8217;t perfect, but will probably work well for most people. That is, those who simply log in as themselves (or use auto-login).</p>
<p>Add this as/etc/systemd/user/my_pulseaudio.service:</p>
<pre>[Unit]
Description=User Pulseaudio service
After=dbus.service
Requires=dbus.service

[Service]
Environment="XDG_RUNTIME_DIR=/run/user/%U"
ExecStart=/usr/bin/pulseaudio
Type=simple

[Install]
WantedBy=default.target</pre>
<p>Note that the service depends and runs after dbus.service, since Pulseaudio attempts to connect to DBus, among others. Probably not very important, as DBus is likely to already run when a user session starts. Besides, in my specific case, the connection with DBus failed, and yet Pulseaudio worked fine. From /var/log/syslog:</p>
<pre>Nov 30 16:28:18 localhost pulseaudio[2093]: W: [pulseaudio] main.c: Unable to contact D-Bus: org.freedesktop.DBus.Error.NotSupported: Unable to autolaunch a dbu
s-daemon without a $DISPLAY for X11</pre>
<p>Also pay attention to the %U substitution into the numeric UID, while setting the environment.</p>
<p>To enable this service for all users,</p>
<pre> # systemctl --global enable my_pulseaudio
    Created symlink /etc/systemd/user/default.target.wants/my_pulseaudio.service, pointing to /etc/systemd/user/my_pulseaudio.service.</pre>
<h3>The multi-user problem</h3>
<p>In a way, it&#8217;s quite interesting that the standard method for using  Pulseaudio gives access to a single user. In particular, as  Pulseaudio was originally developed to allow simultaneous access of the  sound hardware by several pieces of software. Even so, it ended up tuned  to the single user scenario: One single user sitting in front the  computer. If there are processes belonging to other users, they are  bogus users, such as &#8220;apache&#8221; or &#8220;dovecot&#8221;, which are intended for  controlling privileges.</p>
<p>In recent distributions, it seems like pulseaudio is started by the X  server, with the user owning it (i.e. the one who has logged in,  typically through the GUI login interface). Once again, access to the  sound card is given to one single user, who is supposedly sitting in  front of a computer. This is the model Microsoft grew its operating  systems with.</p>
<p>There&#8217;s always the system mode alternative or <a href="https://billauer.se/blog/2014/01/pa-multiple-users/" target="_blank">allowing TCP connections</a>,  but these are not mainstream. In theory, there should have been some  privilege access mechanism for Pulseaudio, allowing an arbitrary group  of clients to connect as required. But since the by far most common  usage scenario of sound is part of a GUI experience for the user in front  of the machine, Pulseaudio was shaped accordingly.</p>
<p>The main problem of the solution above is that it doesn&#8217;t work in a multi-user scenario: The first user creating a session will have audio access. If another user creates a session, the attempt to launch pulseaudio will fail, leaving this user without sound.</p>
<p>To demonstrate how absurd it can get, suppose that user X connects to the system through ssh (and hence generates a session). This user will have pulseaudio running on its behalf, even though it can&#8217;t play any sound on the system. Then user Y logs in on the GUI console, but its pulseaudio service fails to launch, because there&#8217;s already one running. To make things even more absurd, if user X logs out, its pulseaudio service is killed, and a service for user Y doesn&#8217;t start, because what would kick it off?</p>
<p>It doesn&#8217;t help checking if the session that launched my_pulseaudio has a console (man loginctl for example), because user X might log in with ssh first (my_pulseaudio launched, but doesn&#8217;t activate a pulseaudio process) and then through the console (my_pulseaudio won&#8217;t be launched).</p>
<p>In reality, none of these problems are expected to happen often. We all end up logging into a computer with one specific user.</p>
<h3>A less preferred alternative: Waiting for /run/user/0</h3>
<p>As I tried to find a proper solution, I came up with the idea to launch the service when /run/user/o is created. It&#8217;s a working solution in my specific case, where only root is expected to log in.</p>
<p>The idea is simple. Make a path-based launch of the service when /run/user/0 is created.</p>
<p>/etc/systemd/system/my_pulseaudio.path is then:</p>
<pre>[Unit]
Description=Detection of session for user 0 before launching Pulseaudio

[Path]
PathExists=/run/user/0

[Install]
WantedBy=paths.target</pre>
<p>And the following is /etc/systemd/system/my_pulseaudio.service:</p>
<pre>[Unit]
Description=Pulseaudio for user 0
After=dbus.service
Requires=dbus.service

[Service]
Environment="XDG_RUNTIME_DIR=/run/user/0"
ExecStart=/usr/bin/pulseaudio
Type=simple</pre>
<p>and then enable the service with</p>
<pre># systemctl enable my_pulseaudio.path
Created symlink from /etc/systemd/system/paths.target.wants/my_pulseaudio.path to /etc/systemd/system/my_pulseaudio.path.</pre>
<p>This works effectively like the user service for pulseaudio suggested above, but only for user 0. It might be modified to watch for changes in /run/user, and launch a script which evaluates which actions to take (possibly killing one pulseaudio daemon in favor of another?). But it will still not solve the case where a user logs in with ssh first, and then through the console. So the perfect solution should probably hook on session starts and terminations. However that is done.</p>
]]></content:encoded>
			<wfw:commentRss>https://billauer.se/blog/2017/12/user-systemd-pulseaudio/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MuseScore notes on Fedora Core 12</title>
		<link>https://billauer.se/blog/2014/12/musescore-linux-fc12/</link>
		<comments>https://billauer.se/blog/2014/12/musescore-linux-fc12/#comments</comments>
		<pubDate>Fri, 26 Dec 2014 11:54:50 +0000</pubDate>
		<dc:creator>eli</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Linux sound]]></category>
		<category><![CDATA[Software]]></category>

		<guid isPermaLink="false">https://billauer.se/blog/?p=4530</guid>
		<description><![CDATA[Random notes playing with MuseScore 0.9.6 (pun not intended): Installation (after grabbing the RPM file from the web): # yum install --nogpgcheck MuseScore-0.9.6-1.fc12.x86_64.rpm Which installs the file with no signature. Somewhat dangerous in theory, as the RPM could in theory contain malicious code (as if a signature helps in this case). The command line for [...]]]></description>
			<content:encoded><![CDATA[<p>Random notes playing with MuseScore 0.9.6 (pun not intended):</p>
<p>Installation (after grabbing the RPM file from the web):</p>
<pre># yum install --nogpgcheck MuseScore-0.9.6-1.fc12.x86_64.rpm</pre>
<p>Which installs the file with no signature. Somewhat dangerous in theory, as the RPM could in theory contain malicious code (as if a signature helps in this case).</p>
<p>The command line for kicking it off is</p>
<pre>$ mscore &amp;</pre>
<h3>Crashes</h3>
<p>MuseScore may enter an infinite memory hogging loop, ending up with a system global OOM and a lot of disk activity. To keep this mishap&#8217;s impact small, allow it no more than 2 GB of virtual memory, for example. It will never need nearly as much as that, and once it gets into this &#8220;all memory is mine&#8221; loop, it gets a kick in the bottom, and that&#8217;s it. So before calling mscore, go</p>
<pre>$ ulimit -v 2048000</pre>
<p>and possibly check it with</p>
<pre>$ ulimit -a</pre>
<p>Note that this limits any program running from the same shell.</p>
<h3>Editing notes (to self, that is)</h3>
<ul>
<li>Selection: In no-note-writing mode, press Shift and mark an area. It&#8217;s also possible to mark a note, and shift-click the last note to select (including from the beginning to end).</li>
<li>Beaming: That&#8217;s the name of connecting eighth and sixteenth notes with those lines. Look for &#8220;beam properties&#8221; in the palette to get separate notes, as commonly written in notes for singing.</li>
<li>In the Display menu, select Play, Mixer and Synthesizer panels, to control sound and played tempo. Note that the mixer panel remains in place when closing and opening files, but it becomes dysfunctional at best after that. Just reopen the panel after reloading or such.</li>
</ul>
<h3>Hearing something</h3>
<p>To get some audio playing, given errors like this on startup</p>
<pre>Alsa_driver: the interface doesn't support mmap-based access.
init ALSA audio driver failed
init ALSA driver failed
init audio driver failed
sequencer init failed</pre>
<p>go to Edit &gt; Preferences, pick I/O, choose ALSA Audio only, and set the Device from &#8220;default&#8221; to &#8220;hw:0&#8243;.</p>
<p>But ehm, there&#8217;s a problem: Musescore requests exclusive access to the sound device, so if anything else happens to be producing sound when Musescore starts, it will fail to initialize its sound interface (and therefore not play anything during that session). And if it manages to grab the soundcard, all other programs attempting to play sound get stuck. This is true even when using a <a href="https://billauer.se/blog/2014/01/pa-multiple-users/" target="_blank">TCP socket</a> to connect to the PulseAudio server.</p>
<p>Portaudio doesn&#8217;t make things better. To begin with, it&#8217;s a bit confusing, as the API and device entries are empty. But just select it and click &#8220;OK&#8221; and these become populated after a restart of the program. Not graceful, but it works. Anyhow, picking the ALSA API and the hw:0,0 device (which is my sound card) gets the same result as with ALSA directly, minus I can&#8217;t control the volume with the Pulseaudio controls. But the card is still grabbed exclusively, messing up other programs.</p>
<p>Portaudio with OSS didn&#8217;t work either, despite running mscore with padsp. No devices appeared in the list.</p>
<p>Loading the OSS compatible driver (modprobe snd-pcm-oss) created a /dev/dsp file indeed, but again, the sound card was exclusively taken.</p>
<p>My ugly solution was to find a couple of USB speakers and plug them in. And use hw:2,0 as the ALSA target in Musescore.</p>
<p>The elegant solution would be to create a bogus hardware card in Pulseaudio, that routes all sound to hw:0,0. I&#8217;m sure it&#8217;s possible. I&#8217;m also sure that I&#8217;ve wasted enough time on this nonsense.</p>
]]></content:encoded>
			<wfw:commentRss>https://billauer.se/blog/2014/12/musescore-linux-fc12/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ALSA&#8217;s file plugin for playing back a raw pipe file</title>
		<link>https://billauer.se/blog/2014/04/alsa-pipe-playback-capture/</link>
		<comments>https://billauer.se/blog/2014/04/alsa-pipe-playback-capture/#comments</comments>
		<pubDate>Tue, 15 Apr 2014 09:16:17 +0000</pubDate>
		<dc:creator>eli</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Linux sound]]></category>

		<guid isPermaLink="false">https://billauer.se/blog/?p=4202</guid>
		<description><![CDATA[Motivation On an embedded system, I have a device file /dev/xillybus_audio, which can be opened for read and/or write. One can write raw (signed 16 bit Little Endian Rate 48000 Hz stereo) samples to this file, and they&#8217;re played on a &#8220;headphones out&#8221; plug, and one can read samples of the same time, which are [...]]]></description>
			<content:encoded><![CDATA[<h3>Motivation</h3>
<p>On an embedded system, I have a device file /dev/xillybus_audio, which can be opened for read and/or write. One can write raw (signed 16 bit Little Endian Rate 48000 Hz stereo) samples to this file, and they&#8217;re played on a &#8220;headphones out&#8221; plug, and one can read samples of the same time, which are captured from a &#8220;mic input&#8221; plug. Clean and simple. Now let&#8217;s use that as an ALSA sound interface. This is where it doesn&#8217;t get all that simple.</p>
<p>How about a kernel driver for that interface? Nice idea, but the stream interface is already there. Besides, this is useful for piping with programs etc.</p>
<h3>Attempt I</h3>
<p>To make along story short, making /etc/asound.conf read like this, and playing back works <strong>(but capturing doesn&#8217;t!)</strong>.</p>
<pre>pcm.xillybus {
    type asym
    playback.pcm {
        type plug
        slave {
            pcm {
                type file
                file "/dev/xillybus_audio"
                slave.pcm null
                format raw
            }
            rate 48000
            format s16_le
            channels 2
        }
    }
    capture.pcm {
        type plug
        slave {
            pcm {
                type file
                file "/dev/null"
                infile "/dev/xillybus_audio"
                <span style="color: #ff0000;"><strong>slave.pcm null</strong></span>
            }
            rate 48000
            format s16_le
            channels 2
        }
    }
}</pre>
<p>Playback works with rates other than 48000 Hz (and other formats), because of the wrapping with the &#8220;plug&#8221; plugin.</p>
<pre># aplay -D "xillybus" rate8000.wav
Playing WAVE 'rate8000.wav' : Signed 16 bit Little Endian, Rate 8000 Hz, Stereo</pre>
<p>Note that &#8220;file&#8221; &#8212; which defines the output file &#8212; <strong>must be defined</strong> or arecord (or whatever program is used) quits on a segmentation fault. Not very polished.</p>
<p>Capturing doesn&#8217;t work at all, however. It&#8217;s just a silence file, which grows way too fast. It <a href="http://stackoverflow.com/questions/4580986/simulate-microphone-virtual-mic" target="_blank">has been said</a> that the slave of the capturing device shouldn&#8217;t be null, and indeed this probably the issue.</p>
<h3>Diving into it</h3>
<p>The problem seems to lie in the implementation of the file capture routine. Taken from alsa-lib-1.0.27.2/src/pcm/pcm_file.c:</p>
<pre>static snd_pcm_sframes_t snd_pcm_file_readi(snd_pcm_t *pcm, void *buffer, snd_pcm_uframes_t size)
{
    snd_pcm_file_t *file = pcm-&gt;private_data;
    snd_pcm_channel_area_t areas[pcm-&gt;channels];
    snd_pcm_sframes_t n;

    n = <span style="color: #ff0000;"><strong>snd_pcm_readi(file-&gt;gen.slave, buffer, size)</strong></span>;
    if (n &lt;= 0)
         return n;
    if (file-&gt;ifd &gt;= 0) {
        n = read(file-&gt;ifd, buffer, n * pcm-&gt;frame_bits / 8);
        if (n &lt; 0)
             return n;
        return n * 8 / pcm-&gt;frame_bits;
    }
    snd_pcm_areas_from_buf(pcm, areas, buffer);
    snd_pcm_file_add_frames(pcm, areas, 0, n);
    return n;
}</pre>
<p>This is the method, which the plugin exposes for reading samples. Note that it attempts to read the desired amount of samples from the slave first, and then attempts to fetch the same number of samples it got from the slave, from the file. This probably makes sense when reading from a plain file, because it would otherwise slurp the entire file in no-time. The slave is used as a data rate controller. Great.</p>
<h3>Attempt II</h3>
<p>To come around this, I changed /etc/asound.conf to this:</p>
<pre>pcm.xillybus_raw {
                type file
                file "/dev/xillybus_audio"
                slave.pcm null
                format raw
}
pcm.xillybus_play {
        type plug
        slave {
            pcm "xillybus_raw"
            rate 48000
            format s16_le
            channels 2
        }
}

pcm.xillybus {
    type asym
    playback.pcm "xillybus_play"
    capture.pcm {
        type plug
        slave {
            pcm {
                type file
                file "/dev/null"
                infile "/dev/xillybus_audio"
                slave.pcm "xillybus_play"
            }
            rate 48000
            format s16_le
            channels 2
        }
    }
}</pre>
<p>This isn&#8217;t perfect either. When attempting</p>
<pre># arecord -D "xillybus" --rate 48000 --channels 2 --format s16_le try.wav</pre>
<p>sound is indeed recorded into try.wav. The captured sound is echoed in the headphones (with a delay), so the output interface is now busy and noisy. But worst of all, this only works if the parameters are set exactly to the sound interface&#8217;s. So I could have read directly from /dev/xillybus_audio as well.</p>
<h3>Changes in pcm_file.c</h3>
<p>Based upon alsa-lib-1.0.25, the following functions were changed in pcm_file.c. The intention of  these changes is to detach the I/O operations from the slave, which is  null in the setting of Attempt I above.</p>
<pre>static int snd_pcm_file_drop(snd_pcm_t *pcm)
{
	return 0;
}

static int snd_pcm_file_drain(snd_pcm_t *pcm)
{
	return 0;
}

static snd_pcm_sframes_t snd_pcm_file_readi(snd_pcm_t *pcm, void *buffer, snd_pcm_uframes_t size)
{
	snd_pcm_file_t *file = pcm-&gt;private_data;
	snd_pcm_channel_area_t areas[pcm-&gt;channels];
	snd_pcm_sframes_t n;

	n = read(file-&gt;ifd, buffer, size * pcm-&gt;frame_bits / 8);
	if (n &lt; 0)
		return n;
	return n * 8 / pcm-&gt;frame_bits;
}

static snd_pcm_sframes_t snd_pcm_file_readn(snd_pcm_t *pcm, void **bufs, snd_pcm_uframes_t size)
{
	snd_pcm_file_t *file = pcm-&gt;private_data;
	snd_pcm_channel_area_t areas[pcm-&gt;channels];
	snd_pcm_sframes_t n;

	SNDERR("DEBUG: Noninterleaved read not yet implemented.\n");
	return 0;	/* TODO: Noninterleaved read */
}</pre>
<p>(these functions don&#8217;t appear one after the other in the source file)</p>
<h3>Compiling to obtain libasound.so</h3>
<p>After making the changes in pcm_file.c, compiled natively on the embedded board</p>
<pre># ./configure
# make -j 2</pre>
<p>and then copy the result to the library directory:</p>
<pre># cp src/.libs/libasound.so.2.0.0 /usr/lib/arm-linux-gnueabihf/</pre>
<p>This overwrites the previous file.</p>
<h3>Plugin library issue</h3>
<p>When attempting to use a sound interface with the new libasound, the following error occurs:</p>
<pre># aplay -D "xillybus" snip.wav
ALSA lib conf.c:3314:(snd_config_hooks_call) <strong>Cannot open shared library libasound_module_conf_pulse.so</strong>
ALSA lib pcm.c:2217:(snd_pcm_open_noupdate) Unknown PCM xillybus
aplay: main:682: audio open error: No such file or directory</pre>
<p>this is because the plugin loader looks in the wrong directories: It  does look in /usr/lib/arm-linux-gnueabihf/, but not in  /usr/lib/arm-linux-gnueabihf/alsa-lib/.</p>
<p>Trying configure parameters <strong>didn&#8217;t help</strong>:</p>
<pre><span style="text-decoration: line-through;"># ./configure --libdir=/usr/lib/arm-linux-gnueabihf/
# ./configure --with-plugindir=/usr/lib/arm-linux-gnueabihf/alsa-lib/</span></pre>
<p>The dirty solution was to create symbolic links to all files in alsa-lib/ that aren&#8217;t symbolic links themselves with</p>
<pre># cd /usr/lib/arm-linux-gnueabihf
# for i in `find alsa-lib/ -type f -a ! -type l` ; do ln -s "$i" ; done</pre>
<p>Not the most elegant solution, but after spending a couple of hours on trying to figure this out, at least it works.</p>
<p>This is the list of files that were symlinked:</p>
<pre>alsa-lib/libasound_module_pcm_speex.so
alsa-lib/libasound_module_ctl_oss.so
alsa-lib/libasound_module_ctl_pulse.so
alsa-lib/libasound_module_pcm_usb_stream.so
alsa-lib/libasound_module_pcm_pulse.so
alsa-lib/libasound_module_rate_samplerate.so
alsa-lib/libasound_module_ctl_bluetooth.so
alsa-lib/libasound_module_pcm_jack.so
alsa-lib/libasound_module_pcm_upmix.so
alsa-lib/libasound_module_pcm_bluetooth.so
alsa-lib/libasound_module_conf_pulse.so
alsa-lib/libasound_module_pcm_oss.so
alsa-lib/libasound_module_rate_speexrate.so
alsa-lib/libasound_module_ctl_arcam_av.so
alsa-lib/libasound_module_pcm_vdownmix.so
alsa-lib/smixer/smixer-sbase.so
alsa-lib/smixer/smixer-ac97.so
alsa-lib/smixer/smixer-hda.so</pre>
<h3>Current position</h3>
<p>Both record and playback work with the <strong>first</strong> asound.conf above  (a.k.a. Attempt I), as long as the parameters for recording are the  same. For playback, the parameters must be the 48000 Hz, s16_le but it&#8217;s  fine to work in mono and stereo. If other parameters are attempted, a  huge file which is filled with click sounds is created.</p>
<p>So</p>
<pre># arecord -D "xillybus" --rate 48000 --format s16_le --channels 2 good.wav
Recording WAVE 'good.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Stereo</pre>
<p>makes a nice sound file, but</p>
<pre># arecord -D "xillybus" --format s16_le --channels 2 justclicks.wav
Recording WAVE 'justclicks.wav' : Signed 16 bit Little Endian, Rate <strong>8000</strong> Hz, Stereo</pre>
<p>creates a huge file with just clicks. The intriguing thing about those failing just-click scenarios, is that snd_pcm_file_readi() is never called when this happens. It looks like something in the data flow goes wrong when a rate resampler is pushed into the system. When the rate is the same, snd_pcm_file_readi() has been observed to be called in a steady way.</p>
<p>Both of the following are OK:</p>
<pre># aplay -D "xillybus" good.wav
Playing WAVE 'good.wav' : Signed 16 bit Little Endian, Rate 48000 Hz, Stereo
# aplay -D "xillybus" rate8000.wav
Playing WAVE 'rate8000.wav' : Signed 16 bit Little Endian, Rate <strong>8000</strong> Hz, Stereo</pre>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>https://billauer.se/blog/2014/04/alsa-pipe-playback-capture/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ALSA and Pulseaudio random jots</title>
		<link>https://billauer.se/blog/2014/04/alsa-pulseaudio-jots/</link>
		<comments>https://billauer.se/blog/2014/04/alsa-pulseaudio-jots/#comments</comments>
		<pubDate>Mon, 14 Apr 2014 11:42:50 +0000</pubDate>
		<dc:creator>eli</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Linux sound]]></category>

		<guid isPermaLink="false">https://billauer.se/blog/?p=4190</guid>
		<description><![CDATA[Background This is just things I wrote down while trying to make aplay play sound through a fake module-based Pulseaudio sink. Spoiler: I failed. Spoiler II: Sometimes people ask me question about posts I write. I don&#8217;t think I&#8217;ll answer any on this post. I&#8217;ll probably forget all about this five minutes from now. So [...]]]></description>
			<content:encoded><![CDATA[<h3>Background</h3>
<p>This is just things I wrote down while trying to make aplay play sound through a fake module-based Pulseaudio sink. Spoiler: I failed.</p>
<p>Spoiler II: Sometimes people ask me question about posts I write. I don&#8217;t think I&#8217;ll answer any on this post. I&#8217;ll probably forget all about this five minutes from now.</p>
<p>So &#8211;</p>
<p>It all worked fine as long as there was only one of those sinks, because it was set to the default of Pulseaudio, and apparently aplay was ready to consider Pulseaudio as a sound card, playing sound to whatever the user configured as its sink (on Pulseaudio&#8217;s configuration interface). But what if I wanted two of those at the same time. Problem.</p>
<p>The following segment in /etc/pulse/default.pa indeed creates two  sources and sinks in Pulseaudio&#8217;s environment:</p>
<pre>load-module module-file-sink file=/dev/xillybus_audio rate=48000
load-module module-file-source file=/dev/xillybus_audio rate=48000
load-module module-file-sink file=/dev/xillybus_audio2 rate=48000
load-module module-file-source file=/dev/xillybus_audio2 rate=48000</pre>
<p>Using &#8220;pacmd list-sources&#8221; and &#8220;pacmd list-sinks&#8221;, I have found Pulseaudio&#8217;s names for these, so that it&#8217;s possible to record and play with</p>
<pre>parecord -d 'fifo_input' --file-format=wav --rate=44100 &gt; junk.wav</pre>
<p>or</p>
<pre>parecord -d 'fifo_input.2' --file-format=wav --rate=44100 &gt; junk.wav</pre>
<p>and then play the sound back with</p>
<pre>paplay -d 'fifo_output' junk.wav</pre>
<p>or</p>
<pre>paplay -d 'fifo_output.2' junk.wav</pre>
<p>And there&#8217;s always the possibility to fake old-style /dev/dsp devices with padsp, and use them with whatever application that work with these.</p>
<h3>ALSA random jots</h3>
<p>/usr/share/alsa/alsa.conf defines the well-known PCM names &#8220;hw:&#8221;  included, as pcm.hw { &#8230; } and also lists the other files to look at.  So it&#8217;s definitely the place to start looking for understanding those  name conventions. Or maybe the &#8216;hw:&#8221; prefix is no more than a reference to the <a href="http://www.alsa-project.org/alsa-doc/alsa-lib/pcm_plugins.html" target="_blank">ALSA hw plugin</a>&#8230;?</p>
<p>The device&#8217;s name is used in aplay when in calls snd_pcm_open(), which is an alsa-lib call. In other words, aplay doesn&#8217;t use Pulseaudio in this case.</p>
<p>It&#8217;s part of alsa-lib, in src/pcm/pcm.c. This function calls snd_pcm_open_noupdate(), which in turn calls snd_config_search_definition() with the device name. If it returns with an error, we get the</p>
<pre>ALSA lib pcm.c:2217:(<strong>snd_pcm_open_noupdate</strong>) Unknown PCM fifo_input
arecord: main:682: audio open error: No such file or directory</pre>
<p>snd_config_search_definition() is defined in src/conf.c. It strips off anything after a &#8216;:&#8217; (if such exists) and calls snd_config_search_alias_hooks() with the stripped name. So crucial question seems to be how to convince pulseaudio to inject an alias to the file sink, as it does when it&#8217;s the default.</p>
<p>It looks like snd_device_name_hint() is useful (supersedes the deprecated snd_names_list() in src/names.c). The following C code snippet (found <a href="http://stackoverflow.com/questions/6866103/finding-all-the-devices-i-can-use-to-play-pcm-with-alsa" target="_blank">here</a>)</p>
<pre>  {
    char **hints;
    /* Enumerate sound devices */
    int err = snd_device_name_hint(-1, "pcm", (void***)&amp;hints);
    if (err != 0)
      return;//Error! Just return

    char** n = hints;
    while (*n != NULL) {

      char *name = snd_device_name_get_hint(*n, "NAME");

      if (name != NULL &amp;&amp; 0 != strcmp("null", name)) {
	printf("Name hint: %s\n", name);
        free(name);
      }
      n++;
    }

    snd_device_name_free_hint((void**)hints);
  }</pre>
<p>prints out (on my PC, note that the &#8220;hw&#8221; name isn&#8217;t listed).</p>
<pre>Name hint: default
Name hint: front:CARD=Intel,DEV=0
Name hint: surround40:CARD=Intel,DEV=0
Name hint: surround41:CARD=Intel,DEV=0
Name hint: surround50:CARD=Intel,DEV=0
Name hint: surround51:CARD=Intel,DEV=0
Name hint: surround71:CARD=Intel,DEV=0
Name hint: iec958:CARD=Intel,DEV=0
Name hint: hdmi:CARD=HDMI</pre>
<p>BTW, when Pulseaudio is shut down on a machine where only &#8220;default&#8221; is listed (no ALSA cards), &#8220;default&#8221; goes away, and there&#8217;s &#8220;pulse&#8221; instead.</p>
<p><a href="http://www.volkerschatz.com/noise/alsa.html" target="_blank">This page</a> talks about ALSA tweaking.</p>
<p>The format of the asound.conf file is described on <a href="http://www.alsa-project.org/main/index.php/Asoundrc" target="_blank">this page</a>. The C library reference, mentioning the naming convention is <a href="http://www.alsa-project.org/alsa-doc/alsa-lib/pcm.html" target="_blank">here</a>.</p>
<h3>Pulseaudio jot</h3>
<p>Download pulseaudio&#8217;s source with</p>
<pre>git clone git://anongit.freedesktop.org/pulseaudio/pulseaudio</pre>
<p>An interesting function is pa_alsa_source_new() in src/modules/alsa/alsa-source.c.</p>
]]></content:encoded>
			<wfw:commentRss>https://billauer.se/blog/2014/04/alsa-pulseaudio-jots/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Pulseaudio for multiple users, without system-mode daemon</title>
		<link>https://billauer.se/blog/2014/01/pa-multiple-users/</link>
		<comments>https://billauer.se/blog/2014/01/pa-multiple-users/#comments</comments>
		<pubDate>Sat, 18 Jan 2014 15:20:48 +0000</pubDate>
		<dc:creator>eli</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Linux sound]]></category>

		<guid isPermaLink="false">https://billauer.se/blog/?p=4065</guid>
		<description><![CDATA[This is a simple and quick solution for those of us who want to run certain programs as a different user on the same desktop, for example running several user profiles of a browser at the same time. The main problem is usually that Pulseaudio doesn&#8217;t accept connections from a user other than the one [...]]]></description>
			<content:encoded><![CDATA[<p>This is a simple and quick solution for those of us who want to run certain programs as a different user on the same desktop, for example running several user profiles of a browser at the same time. The main problem is usually that Pulseaudio doesn&#8217;t accept connections from a user other than the one logged in on the desktop.</p>
<p>It&#8217;s often suggested to go for a <a href="http://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/SystemWide/" target="_blank">system mode</a> Pulseaudio daemon, but judging from the developer&#8217;s <a href="http://www.freedesktop.org/wiki/Software/PulseAudio/Documentation/User/WhatIsWrongWithSystemWide/" target="_blank">own comments</a> on this, and the friendly messages left in the system&#8217;s log when doing this, like</p>
<pre>Jan 18 16:35:33 ocho pulseaudio[11158]: main.c: OK, so you are running PA in system mode. Please note that you most likely shouldn't be doing that.
Jan 18 16:35:33 ocho pulseaudio[11158]: main.c: If you do it nonetheless then it's your own fault if things don't work as expected.
Jan 18 16:35:33 ocho pulseaudio[11158]: main.c: Please read http://pulseaudio.org/wiki/WhatIsWrongWithSystemMode for an explanation why system mode is usually a bad idea.
Jan 18 16:35:33 ocho pulseaudio[11158]: module.c: module-hal-detect is deprecated: Please use module-udev-detect instead of module-hal-detect!
Jan 18 16:35:33 ocho pulseaudio[11158]: module-hal-detect-compat.c: We will now load module-udev-detect. Please make sure to remove module-hal-detect from your configuration</pre>
<p>it&#8217;s probably not such a good idea. Plus that in my case, the sound card wasn&#8217;t detected in system wide mode, probably because some configuration issue, which I didn&#8217;t care much about working on. The bottom line is that the software&#8217;s authors don&#8217;t really want this to work.</p>
<h3>Opening a TCP socket instead</h3>
<p>The simple solution is given on <a href="http://forums.fedoraforum.org/showthread.php?t=190954" target="_blank">this forum thread</a>. This works well when there&#8217;s a specific user always logged on, and programs belonging to other dummy users are always run for specific purposes.</p>
<p>The idea behind this trick is to open a TCP port for native Pulseaudio communication, only it doesn&#8217;t require authentication, as long as the connection comes from 127.0.0.1, i.e. from the host itself. This opens the audio interface to any program running on the computer, including recording from the microphone. This makes no significant difference security-wise if the computer is accessed by a single user anyhow (possible spyware is likely to run with the logged in user ID anyhow, which has full access to audio either way).</p>
<p>This solution works on Fedora Core 12, but it&#8217;s probably the way to do it on any distribution released since 2009 or so.</p>
<p><em>Edit: It has been suggested in the comments below to use a UNIX socket instead of TCP. Haven&#8217;t tried it, but it seems like a better solution.</em></p>
<h3>To do as the desktop&#8217;s user</h3>
<p>So let&#8217;s get to the hands-on: First, copy /etc/pulse/default.pa into a file with the same name in the .pulse directory, that is</p>
<pre>cp /etc/pulse/default.pa ~/.pulse/</pre>
<p>And then edit the file, adding the following line at the end:</p>
<pre>load-module module-native-protocol-tcp auth-ip-acl=127.0.0.1</pre>
<p>At this point, restart the pulseaudio deamon,</p>
<pre>$ pulseaudio -k
$ pulseaudio -D</pre>
<h3>To do as the &#8220;fake&#8221; user</h3>
<p>Now <strong>switch to the second user</strong>,  and create a file named client.conf under that user&#8217;s .pulse subdirectory</p>
<pre>$ echo "default-server = 127.0.0.1" &gt; ~/.pulse/client.conf</pre>
<p>Note that default.pa and client.conf are in completely different directories, each belonging to a different user!</p>
<p>Surprisingly enough, that&#8217;s it. Any program running as the second user now has sound access.</p>
]]></content:encoded>
			<wfw:commentRss>https://billauer.se/blog/2014/01/pa-multiple-users/feed/</wfw:commentRss>
		<slash:comments>35</slash:comments>
		</item>
		<item>
		<title>No sound on Firefox on x86_64 Linux with Pulseaudio / ALSA</title>
		<link>https://billauer.se/blog/2012/04/alsa-upgrade-firefox-pulseaudio-flash-html5-adobe/</link>
		<comments>https://billauer.se/blog/2012/04/alsa-upgrade-firefox-pulseaudio-flash-html5-adobe/#comments</comments>
		<pubDate>Tue, 24 Apr 2012 07:30:14 +0000</pubDate>
		<dc:creator>eli</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Linux sound]]></category>

		<guid isPermaLink="false">https://billauer.se/blog/?p=2773</guid>
		<description><![CDATA[This is yet another suggestion on what to do if the Firefox doesn&#8217;t play sound (with flash videos in particular) but all other applications do (mplayer, for example). The video in Firefox runs smoothly, but no sound at all. This is a popular subject on the web, it turns out. My platform: Fedora Core 12, [...]]]></description>
			<content:encoded><![CDATA[<p>This is yet another suggestion on what to do if the Firefox doesn&#8217;t play sound (with flash videos in particular) but all other applications do (mplayer, for example). The video in Firefox runs smoothly, but no sound at all. This is a popular subject on the web, it turns out.</p>
<p>My platform: Fedora Core 12, 64 bit, hda sound card. I should also mention this all was fine on my computer until I upgraded  to alsa-1.0.24 kernel drivers from sources. With  &#8220;make install-modules&#8221; (as opposed to &#8220;make install&#8221;). Even after this installation, I don&#8217;t have an ALSA init script on my  computer (and neither should I have one, as the drivers are autoloaded  anyhow).</p>
<p>The first thing to do is to go to System &gt; Preferences &gt; Sound and pick the &#8220;Applications&#8221; tab. Now do something that does play sound. The application should be listed there while the sound is played. Stop playing, and the application vanishes from the list.</p>
<p>Now try to play a flash video. If you&#8217;re lucky, the Firefox applications appears there (as &#8220;ALSA plug-in [firefox-bin]&#8220;), only with the sound muted or volume very low. Just fix that, and you&#8217;re good.</p>
<p>In my case, nothing appeared on this list when playing a video on Firefox. This means that Firefox doesn&#8217;t connect to Pulseaudio at all. This has in fact nothing to do with the flash player: This happens when the video is played in HTML5 mode as well (a common situation in Youtube, for example).</p>
<p>Like many others who have addressed this issue, I know how I solved it, but not why things broke in the first place.</p>
<p>The problem, as it turned out, was that Firefox didn&#8217;t find the /usr/lib/alsa-lib/libasound_module_pcm_pulse.so shared library. Note that it&#8217;s &#8220;lib&#8221; and not &#8220;lib64&#8243; it was looking for, because the part producing sound runs in 32-bit mode. Or something like that.</p>
<p>So I went</p>
<pre>$ yum provides '/usr/lib/alsa-lib/libasound_module_pcm_pulse.so'</pre>
<p>Which told me I needed alsa-plugins-pulseaudio-1.0.21-2.fc12.i686. I then went (as root):</p>
<pre># yum install alsa-plugins-pulseaudio-1.0.21-2.fc12.i686</pre>
<p>just to be told by yum that &#8220;package alsa-plugins-pulseaudio-1.0.22-1.fc12.x86_64 (which is newer than alsa-plugins-pulseaudio-1.0.21-2.fc12.i686) is already installed&#8221;. This is when I really love this RPM magic.</p>
<p>Googled for the exact RPM file, downloaded it, and basically went (nothing like the &#8211;force flag)</p>
<pre># rpm -i --force alsa-plugins-pulseaudio-1.0.21-2.fc12.i686.rpm</pre>
<p>And the sound is back. Hurray! Not. That problem shouldn&#8217;t have started in the first place.</p>
]]></content:encoded>
			<wfw:commentRss>https://billauer.se/blog/2012/04/alsa-upgrade-firefox-pulseaudio-flash-html5-adobe/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Fedora 12: Audio headache notes (ALSA and JACK)</title>
		<link>https://billauer.se/blog/2010/11/fedora-12-audio-jack-alsa/</link>
		<comments>https://billauer.se/blog/2010/11/fedora-12-audio-jack-alsa/#comments</comments>
		<pubDate>Sat, 27 Nov 2010 16:14:44 +0000</pubDate>
		<dc:creator>eli</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[Linux sound]]></category>

		<guid isPermaLink="false">https://billauer.se/blog/?p=785</guid>
		<description><![CDATA[Just a few notes about getting the sound working. Pulseaudio Pulseaudio belongs to the Linux Windowization era, meaning there are plenty of instructions of what-to-do-if but very little info about how the machinery works. Because it never fails, right? Who needs that info? My notes about problems with sound from Firefox are in a different [...]]]></description>
			<content:encoded><![CDATA[<p>Just a few notes about getting the sound working.</p>
<h3>Pulseaudio</h3>
<p>Pulseaudio belongs to the Linux Windowization era, meaning there are plenty of instructions of what-to-do-if but very little info about how the machinery works. Because it never fails, right? Who needs that info?</p>
<p>My notes about problems with sound from Firefox are in a <a title="No sound on Firefox on x86_64 Linux with Pulseaudio / ALSA" href="https://billauer.se/blog/2012/04/alsa-upgrade-firefox-pulseaudio-flash-html5-adobe/" target="_blank">different post</a>.</p>
<p><strong>Important: </strong>Any user needing to access Pulseaudio sound must belong to the &#8220;audio&#8221; group, since the device files in /dev/snd/ need to be opened.</p>
<p>Anyhow, if this is what you get:</p>
<pre>$ aplay -D hw:0,0 file.wav
aplay: main:654: audio open error: Device or resource busy</pre>
<p>Then just go</p>
<pre>$ killall -9 pulseaudio</pre>
<p>or</p>
<pre>$ pulseaudio -k</pre>
<p>(which is a pleasing action for some reason) and the pulseaudio daemon will (unfortunately&#8230;!) restart as a result of some other will-always-work hocus-pocus daemon, whose identity I may still need to find (rtkit?).</p>
<p>To prevent pulseaudio from restarting all the time, edit /etc/pulse/client.conf and change &#8220;autospawn = yes&#8221; to &#8220;autospawn = no&#8221; (possibly uncomment the line if necessary). Note that in the absence of the daemon, the volume control applet goes away.</p>
<p>To start it again, go</p>
<pre>$ pulseaudio -D</pre>
<p><em>Update:</em> There&#8217;s the pacmd command-line utility, which supplies pretty useful info about what&#8217;s going on internally. If it says &#8220;No  PulseAudio daemon running, or not running as session daemon&#8221; just kill  -9 pulseaudio. That seems to be the solution for everything.</p>
<p>Using aplay and lsof, I managed to figure out that hw0,1 (Card 0, Device 1) is in fact /dev/snd/pcmC0D1p. To check who&#8217;s using my default sound device, go</p>
<pre>$ lsof /dev/snd/pcmC0D0p</pre>
<p>Pulseaudio may be in the list, because it&#8217;s running the device. When running aplay, it takes the file. Sometimes nobody does. I&#8217;m not sure what&#8217;s going on here.</p>
<p>And as silly as this comment is: To change the output sink, just use Gnome&#8217;s Preferences &gt; Sound and set it up there. Also try &#8220;pavucontrol&#8221; from command line for a slightly different GUI tool.</p>
<h3>ALSA</h3>
<p>For (too much) information about the audio hardware, run alsa-info at command prompt.</p>
<p>The devices on my system:</p>
<pre>$ aplay -l
**** List of PLAYBACK Hardware Devices ****
card 0: Intel [HDA Intel], device 0: ALC888 Analog [ALC888 Analog]
  Subdevices: 0/1
  Subdevice #0: subdevice #0
card 0: Intel [HDA Intel], device 1: ALC888 Digital [ALC888 Digital]
  Subdevices: 1/1
  Subdevice #0: subdevice #0
card 1: HDMI [HDA ATI HDMI], device 3: ATI HDMI [ATI HDMI]
  Subdevices: 1/1
  Subdevice #0: subdevice #0</pre>
<h3>Jack</h3>
<p>The idea about Jack is to allow the user route sound sources to sinks, so there is better control of what goes where. This makes sense in particular when MIDI devices are involved, since picking the MIDI player can make a significant change.</p>
<p>To work correctly, Jack relies on the audio group, which the user of the Jack application must belong to. Prepare for a relogin when fiddling with this.</p>
<p>Applications requiring JACK must have the Jack server running before being executed. QJackCtl is the preferred tool for that. Settings: Input/output device is hw:0,0 and sample rate 48000. Then press &#8220;Start&#8221; to kickoff the server.</p>
<p>Jack needs to be exclusive on the hardware device, so if another application is using hw:0,0 jackd will not start, resulting in annoying periodic popup messages by QJackCtl. To find out who&#8217;s to blame, see notes about Pulseaudio above.</p>
<p>Also, if it manages to start, no other sound application (including console alerts) will be able to play any sound. Did I say annoying? Or hiJack?</p>
<p>This is what happens when jackd is running, making all other sounds die out.</p>
<pre>$ lsof /dev/snd/pcmC0D0p
COMMAND   PID USER   FD   TYPE DEVICE SIZE/OFF  NODE NAME
jackd   14825  eli  mem    CHR  116,7          14591 /dev/snd/pcmC0D0p
jackd   14825  eli   10u   CHR  116,7      0t0 14591 /dev/snd/pcmC0D0p</pre>
<p>And finally, this is the setup screen that worked for me:</p>
<p><a href="https://billauer.se/blog/wp-content/uploads/2010/11/screenshot-setup-jack-audio-connection-kit.png"><img class="alignnone size-full wp-image-786" title="screenshot-setup-jack-audio-connection-kit" src="https://billauer.se/blog/wp-content/uploads/2010/11/screenshot-setup-jack-audio-connection-kit.png" alt="screenshot-setup-jack-audio-connection-kit" width="431" height="349" /></a></p>
<h3>Audacity</h3>
<p>Can have its audio devices set to &#8220;default&#8221;. hw:0,0 has been used in the past to solve noisy sound problems, but it looks like killing pulseaudio is much better (and more fun).</p>
<h3>LMMS</h3>
<p>The GUI looks a bit like those cars with ultraviolet lights underneath. More like a toy, and not a professional tool. But judging from its variety of sound sources (some of which are outright stupid. Commodore 64 emulation? Come on) and its by-programmers-for-programmers feel I gave it a go. So it&#8217;s indeed mostly a nice toy: A fantastic variety of sounds, fun editing, but if you want to insert a few bars in the middle of an edited song, there&#8217;s no way to just make some space. No bulk operations, as needed when you really want to do something serious. So as for v0.48 it&#8217;s nice to play with but not really a working horse. The real-life production scenarios are not handled yet (in particular, moving and copying large portions). The undo operation is also very partially supported, so a simple mouse click can easily destroy some work irrecoverably. Having said all this, I hope its developers will stick to it, and I will take all my criticism back in a year or so. It looks like they are on the right path.</p>
<p>I was surprised to find out that the output format is binary, but that&#8217;s just compressed XML. If hand editing is desired, it&#8217;s possible to save to .mpp rather than .mppz.</p>
<p>Ah, and using ZynAddSubFX as a sound bank, I ran into a bug causing notes to be stuck playing indefinitely during playback and conversion to WAV. This happens at random. Just some note refuses to release until reloading the entire project. Making WAVs is impossible with this bug, of course. But it <a href="https://billauer.se/blog/2010/12/linux-multimedia-studio-double-notes-stuck-remove/" target="_blank">looks like I know</a> how to fix this.</p>
<h3>Rosegarden</h3>
<p>It&#8217;s maybe a wonderful application, but I have to admit that its dependency on Jack made it far less attractive compared with LMMS. Having all pulseaudio dependent applications die out is not fun. The alternative would be to connect all other applications to Jack, which I would maybe consider had I been a real sound guy.</p>
]]></content:encoded>
			<wfw:commentRss>https://billauer.se/blog/2010/11/fedora-12-audio-jack-alsa/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
