View Single Post
Posts: 915 | Thanked: 3,209 times | Joined on Jan 2011 @ Germany
#3048
[edit: Well, that was tricky! But I have the solution. More at the end of this post. ]

On a more serious note, I think I may be at the point of uploading an image, except for audio.
In general I try to avoid pulseaudio wherever I can. Here I can't and I don't know how to proceed.

steps in detail:

1. I recompiled pulseaudio with this patch [1] to account for Maemo's ancient PA version. (I did that for armel as well and the resulting packages work fine in my working armel image.)

2. I installed the following recompiled packages in my armhf image:
Code:
libpulse0
pulseaudio
pulseaudio-utils
3. To have the same starting point as in my working armel image I also installed these packages from the Debian repo (although I believe they aren't necessary at that point):
Code:
gstreamer0.10-pulseaudio
xmms2-plugin-pulse
4. I copied /etc/asound.conf from the armel image to the armhf image. It looks like this:
Code:
# PCM
# pcm.!default {
#         type alsa_dsp
#         playback_device_file ["/dev/dsptask/pcm3"] 
#         recording_device_file ["/dev/dsptask/pcm_rec1"]
# }

pcm.!default {
  type pulse
}

# Mixer
ctl.!master {
	type hw
	card 0
}

ctl.!default {
	type dsp_ctl
	playback_devices ["/dev/dsptask/pcm3"]
	recording_devices ["/dev/dsptask/pcm_rec1"]
}

# OSS emulation
pcm.dsp0 pcm.default
ctl.mixer0 mixer.default
5. dus (and dbus-x11) were already installed in the armhf image and as far as I can tell they work fine. roxterm doesn't complain about missing dbus and ps shows this output:
Code:
$ ps ax | grep dbus
  816 ?        S<s    1:14 /usr/bin/dbus-daemon --system --nofork
 1197 ?        S      0:00 dbus-launch --exit-with-session
 1202 ?        S<s    0:08 /usr/bin/dbus-daemon --fork --print-pid 5 --print-address 7 --session
 1541 ?        S<sl   0:01 /usr/bin/mafw-dbus-wrapper mafw-gst-renderer
 1543 ?        Ss     0:00 /usr/bin/mafw-dbus-wrapper mafw-iradio-source
 1548 ?        Ss     0:00 /usr/bin/mafw-dbus-wrapper mafw-upnp-source
 1554 ?        Ss     0:00 /usr/bin/mafw-dbus-wrapper mafw-tracker-source
21702 ?        S      0:00 dbus-launch --sh-syntax --exit-with-session
21703 ?        Ss     0:00 /usr/bin/dbus-daemon --fork --print-pid 5 --print-address 7 --session
21770 pts/1    S      0:00 dbus-launch --autolaunch b97b807cce17de74591ffb9000130353 --binary-syntax --close-stderr
21771 ?        Ss     0:00 /usr/bin/dbus-daemon --fork --print-pid 5 --print-address 7 --session
6. According to [2] these mounts from the host system have to be present in the chroot:
Code:
/var/lib/dbus
~/.pulse
/tmp
/dev/shm
#1 and #4 were already there because ED mounts them by default.
#2 was not mounted in my case but it was an identical copy of the host system's directory which works fine in my armel image. Mounting it from the host system didn't change anything.
#3 was a tmpfs mount in the image, which also works fine in the armel image. Mounting it from the host didn't get pA working.

7. Mentioned in [2], and stressed in [3] one has to make sure that the machine_id is the same in the chroot as on the host. Since /var/lib/dbus is a bind-mount this is the case:
Code:
# cat /var/lib/dbus/machine-id 
b97b807cce17de74591ffb9000130353
# cat /.debian/var/lib/dbus/machine-id 
b97b807cce17de74591ffb9000130353
The problem is, when I try to play an audio file from within the chroot via mplayer or moc I get this error:
Code:
$ mocp 10_-_Magic_Zone.ogg 
Running the server...
Trying JACK...
Trying ALSA...
ALSA lib dlmisc.c:254:(snd1_dlobj_cache_get) Cannot open shared library /usr/lib/arm-linux-gnueabihf/alsa-lib/libasound_module_ctl_dsp_ctl.so
ALSA lib pulse.c:243:(pulse_connect) PulseAudio: Unable to connect: Connection refused

Trying OSS...

FATAL_ERROR: No valid sound driver!


FATAL_ERROR: Server exited!

$ 
$ 
$ 
$ mplayer 10_-_Magic_Zone.ogg 
MPlayer svn r34540 (Debian), built with gcc-4.6 (C) 2000-2012 MPlayer Team
mplayer: could not connect to socket
mplayer: No such file or directory
Failed to open LIRC support. You will not be able to use your remote control.

Playing 10_-_Magic_Zone.ogg.
libavformat version 53.21.1 (external)
Mismatching header version 53.19.0
libavformat file format detected.
[lavf] stream 0: audio (vorbis), -aid 0, Magic Zone
Load subtitles in ./
==========================================================================
Opening audio decoder: [ffmpeg] FFmpeg/libavcodec audio decoders
libavcodec version 53.35.0 (external)
Mismatching header version 53.32.2
AUDIO: 44100 Hz, 2 ch, s16le, 256.0 kbit/18.14% (ratio: 32000->176400)
Selected audio codec: [ffvorbis] afm: ffmpeg (FFmpeg Vorbis)
==========================================================================
AO: [pulse] Init failed: Connection refused
Failed to initialize audio driver 'pulse'
[AO_ALSA] alsa-lib: pulse.c:243:(pulse_connect) PulseAudio: Unable to connect: Connection refused

[AO_ALSA] Playback open error: Connection refused
Failed to initialize audio driver 'alsa'
[AO SDL] Samplerate: 44100Hz Channels: Stereo Format s16le
[AO SDL] using aalib audio driver.
[AO SDL] Unable to open audio: No available audio device
Failed to initialize audio driver 'sdl:aalib'
Could not open/initialize audio device -> no sound.
Audio: no sound
Video: no video


Exiting... (End of file)
The problem seems to be that the PA in the chroot can't connect to the one on the host (possibly due to some dbus-related issue?).
This is what I get when I manually start PA as user in the chroot:
Code:
$ pulseaudio 
E: [pulseaudio] core-util.c: Failed to connect to system bus: Failed to connect to socket /var/run/dbus/system_bus_socket: Connection refused
E: [pulseaudio] core-util.c: Failed to connect to system bus: Failed to connect to socket /var/run/dbus/system_bus_socket: Connection refused
E: [pulseaudio] core-util.c: Failed to connect to system bus: Failed to connect to socket /var/run/dbus/system_bus_socket: Connection refused
E: [pulseaudio] core-util.c: Failed to connect to system bus: Failed to connect to socket /var/run/dbus/system_bus_socket: Connection refused
E: [pulseaudio] core-util.c: Failed to connect to system bus: Failed to connect to socket /var/run/dbus/system_bus_socket: Connection refused
E: [pulseaudio] core-util.c: Failed to connect to system bus: Failed to connect to socket /var/run/dbus/system_bus_socket: Connection refused
E: [pulseaudio] core-util.c: Failed to connect to system bus: Failed to connect to socket /var/run/dbus/system_bus_socket: Connection refused
E: [pulseaudio] core-util.c: Failed to connect to system bus: Failed to connect to socket /var/run/dbus/system_bus_socket: Connection refused
E: [pulseaudio] core-util.c: Failed to connect to system bus: Failed to connect to socket /var/run/dbus/system_bus_socket: Connection refused
E: [pulseaudio] core-util.c: Failed to connect to system bus: Failed to connect to socket /var/run/dbus/system_bus_socket: Connection refused
E: [pulseaudio] core-util.c: Failed to connect to system bus: Failed to connect to socket /var/run/dbus/system_bus_socket: Connection refused
libudev: udev_monitor_enable_receiving: bind failed: Operation not permitted
E: [pulseaudio] module-udev-detect.c: Failed to enable monitor: Operation not permitted
E: [pulseaudio] module.c: Failed to load module "module-udev-detect" (argument: ""): initialization failed.
E: [pulseaudio] main.c: Module load failed.
E: [pulseaudio] main.c: Failed to initialize daemon.
This is as root:
Code:
# pulseaudio
W: [pulseaudio] main.c: This program is not intended to be run as root (unless --system is specified).
E: [pulseaudio] module-console-kit.c: Unable to contact D-Bus system bus: org.freedesktop.DBus.Error.NoServer: Failed to connect to socket /var/run/dbus/system_bus_socket: Connection refused
E: [pulseaudio] module.c: Failed to load module "module-console-kit" (argument: ""): initialization failed.
E: [pulseaudio] main.c: Module load failed.
E: [pulseaudio] main.c: Failed to initialize daemon.
The first one says something about module-udev-detect, the second about module-console-kit. consolekit, udev and libudev0 are installed in the chroot.
What puzzles me is this line, as, according to Google, it usually seems to indicate a machine_id mismatch, which I've already ruled out (see step 7):
Code:
E: [pulseaudio] core-util.c: Failed to connect to system bus: Failed to connect to socket /var/run/dbus/system_bus_socket: Connection refused

edit/solution:
In a default Debian installation /var/run is a symlink to /run. But in ED /var/run needs to be a real directory because /run will be empty at the beginning, which means /var/run/dbus and /var/run/pulse will be missing.
On the other hand we can't simply make both of them real directories since we need Maemo's contents of these directories at the beginning.
So the solution is to reverse the order. Make /var/run a real directory and /run a symlink to /var/run.



[1] http://talk.maemo.org/showpost.php?p...6&postcount=34
[2] http://www.freedesktop.org/wiki/Soft...FAQ/#index36h3
[3] http://blog.einval.com/2010/11/12

Last edited by sulu; 2014-01-04 at 21:34.
 

The Following 2 Users Say Thank You to sulu For This Useful Post: