Bug 16799 - Squeezeplay needs MMAP-able ALSA, prevents use with pulseaudio + PATCH
: Squeezeplay needs MMAP-able ALSA, prevents use with pulseaudio + PATCH
Status: CLOSED INVALID
Product: SqueezePlay
Classification: Unclassified
Component: Audio
: 7.5.x
: PC Ubuntu Linux
: -- major with 2 votes (vote)
: 7.6.0
Assigned To: Andy Grundman
: patch_waiting
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2011-01-14 05:43 UTC by Stephan Diestelhorst
Modified: 2011-05-09 09:17 UTC (History)
3 users (show)

See Also:
Category: ---


Attachments
Patch that fixes SqueezePlay playback with pulseaudio on Ubuntu. (3.53 KB, patch)
2011-01-14 05:43 UTC, Stephan Diestelhorst
Details | Diff
fallback to portaudio patch (1.83 KB, patch)
2011-04-07 13:05 UTC, Adrian Smith
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Stephan Diestelhorst 2011-01-14 05:43:33 UTC
Created attachment 7081 [details]
Patch that fixes SqueezePlay playback with pulseaudio on Ubuntu.

Squeezeplay (as of SVN 9284) does not play sound on recent Ubuntu machines, due
to them using pulseaudio as  ALSA's default device. Jive_alsa tries to
initialise the ALSA device with SND_PCM_ACCESS_MMAP_INTERLEAVED, which does not
have to be provided by ALSA, and inparticular is not through pulseaudio's ALSA
emulation.

The attached patch detects whether things work with MMAP and an additional
buffer and normal calls to snd_pcm_writei, if that is not possible. This give
me audio on my ubuntu 10.10 system.

I am a n00b at ALSA coding, feel free to edit this patch.
Comment 1 Stephan Diestelhorst 2011-01-14 12:45:32 UTC
(In reply to comment #0)
> The attached patch detects whether things work with MMAP and an additional
> buffer and normal calls to snd_pcm_writei, if that is not possible. This give
> me audio on my ubuntu 10.10 system.

The patch detects whether things work with MMAP, and if not resorts to an additional buffer and calls to snd_pcm_writei. This makes audio work in squeezeplay on my Ubuntu 10.10 system.

(Typos from utter "patch fixed"-excitement ;-)
Comment 2 Andy Grundman 2011-03-16 07:53:02 UTC
Thanks! We will review.
Comment 3 SVN Bot 2011-04-07 09:59:43 UTC
 == Auto-comment from SVN commit #9409 to the jive repo by agrundman ==
 == http://svn.slimdevices.com/jive?view=revision&revision=9409 ==

Fixed bug 16799, patch from Stephan Diestelhorst to fix pulseaudio playback on Ubuntu
Comment 4 Adrian Smith 2011-04-07 12:58:51 UTC
I still get errors with this patch on my 32 bit Ubuntu 10.10 VM:

20110401 19:55:24.275 DEBUG  audio.output - decode_alsa_init:266 Playback device: default
20110401 19:55:24.275 DEBUG  audio.output - decode_alsa_fork:143 fork jive_alsa -v -d default -c default -b 30000 -p 3 -s 16 -f 3 
ALSA lib conf.c:3288:(snd_config_hooks_call) Cannot open shared library libasound_module_conf_pulse.so
ALSA lib pcm.c:2208:(snd_pcm_open_noupdate) Unknown PCM default
20110401 19:55:24.278 ERROR  pcm_test:716 Playback open error: No such file or directory
20110401 19:55:24.776 ERROR  audio.output - decode_alsa_fork:178 jive_alsa failed to start
20110401 19:55:24.777 DEBUG  audio.decode - decode_thread_execute:392 decode_thread_execute

I sent Ben another patch which falls back from the alsa backend to portaudio if alsa failes (portaudio tries harder to start alsa and pick a device).  This seems to work on my VMs - may want to consider this too.  Must admit I didn't spend too long trying to work out why alsa could not be started when I realised portaudio would work though!
Comment 5 Adrian Smith 2011-04-07 13:05:12 UTC
Created attachment 7228 [details]
fallback to portaudio patch

Fallback patch as mentioned in previous comment.
Comment 6 Mickey Gee 2011-05-09 09:17:50 UTC
Desktop Squeezeplay only.