<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://wiki.webos-internals.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Playya</id>
	<title>WebOS Internals - User contributions [en]</title>
	<link rel="self" type="application/atom+xml" href="http://wiki.webos-internals.org/api.php?action=feedcontributions&amp;feedformat=atom&amp;user=Playya"/>
	<link rel="alternate" type="text/html" href="http://wiki.webos-internals.org/wiki/Special:Contributions/Playya"/>
	<updated>2026-04-21T03:02:38Z</updated>
	<subtitle>User contributions</subtitle>
	<generator>MediaWiki 1.35.1</generator>
	<entry>
		<id>http://wiki.webos-internals.org/index.php?title=Research_Pre_Audio&amp;diff=9467</id>
		<title>Research Pre Audio</title>
		<link rel="alternate" type="text/html" href="http://wiki.webos-internals.org/index.php?title=Research_Pre_Audio&amp;diff=9467"/>
		<updated>2010-03-29T21:17:11Z</updated>

		<summary type="html">&lt;p&gt;Playya: add script to strace audiod&lt;/p&gt;
&lt;hr /&gt;
&lt;div&gt;This side should cover the audio architecture used on the Palm Pre.&lt;br /&gt;
&lt;br /&gt;
== Hardware ==&lt;br /&gt;
&lt;br /&gt;
The used TWL4030 PMIC covers the audio part.&lt;br /&gt;
TODO: datasheet available?&lt;br /&gt;
&lt;br /&gt;
== Soundcards ==&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
root@castle:/var/home/root# aplay -l    &lt;br /&gt;
**** List of PLAYBACK Hardware Devices ****&lt;br /&gt;
card 0: mcbsp2 [twl4030-i2s (mcbsp2)], device 0: omap-mcbsp-pcm [omap-mcbsp-pcm]&lt;br /&gt;
  Subdevices: 1/1&lt;br /&gt;
  Subdevice #0: subdevice #0&lt;br /&gt;
card 1: mcbsp3 [btsco (mcbsp3)], device 0: omap-mcbsp-pcm [omap-mcbsp-pcm]&lt;br /&gt;
  Subdevices: 1/1&lt;br /&gt;
  Subdevice #0: subdevice #0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Scripts ==&lt;br /&gt;
&lt;br /&gt;
Palm uses scripts to configure the lower levels of the sound system that are executed inside the kernel. Audiod triggers them over a sysfs interface.&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
echo &amp;quot;#list&amp;quot; &amp;gt; /sys/devices/platform/twl4030_audio/scdebug&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
 for example lists you all available scripts over the kernel message output which you can view with dmesg. You can also try&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#all&lt;br /&gt;
#volume&lt;br /&gt;
#init&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
These scripts can be triggered by writing is name as a string into&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/sys/devices/platform/twl4030_audio/scrun&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
A good start to dive into this is sound/arm/omap-twl4030/script.c in the kernel patch from palm.&lt;br /&gt;
&lt;br /&gt;
New scripts are inserted into the kernel list via:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
/sys/devices/platform/twl4030_audio/scinit&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
This is also handled by audiod. The scripts can be found in /etc/audio&lt;br /&gt;
&lt;br /&gt;
== strace audiod ==&lt;br /&gt;
this script restarts the audiod with an attached strace which is saved in ./audio.log:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
#!/bin/sh&lt;br /&gt;
#Make sure audiod gets not restarted when we kill it&lt;br /&gt;
mv /usr/sbin/audiod /usr/sbin/audiod-backup&lt;br /&gt;
kill $(pidof audiod)&lt;br /&gt;
&lt;br /&gt;
sleep 2&lt;br /&gt;
&lt;br /&gt;
strace -x -s 10000 -f -F -o audio.log audiod-backup &amp;amp;&lt;br /&gt;
echo &amp;quot;press any key to return to normal mode&amp;quot;&lt;br /&gt;
read foo&lt;br /&gt;
kill $(pidof audiod-backup)&lt;br /&gt;
&lt;br /&gt;
sleep 2&lt;br /&gt;
&lt;br /&gt;
#Bring the system into a useable state again           &lt;br /&gt;
mv /usr/sbin/audiod-backup /usr/sbin/audiod&lt;br /&gt;
sh /etc/event.d/audiod&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;/div&gt;</summary>
		<author><name>Playya</name></author>
	</entry>
</feed>