Friday Jul 01, 2011

Getting Audio from a Zone

Now that I have Firefox and Java Web Start running from a zone, the last piece of the puzzle was audio (essential because most Flash content is accompanied by sound). 

In the global zone there's a nice little utility called audiotest for testing your sound:

bleonard@solaris:~$ audiotest
Sound subsystem and version: SunOS Audio 4.0 (0x00040003)
Platform: SunOS 5.11 snv_151a i86pc

*** Scanning sound adapter #1 ***
/dev/sound/audio810:0dsp (audio engine 0): audio810#0
  - Performing audio playback test... 
	<left> ................OK
	<right> ...............OK
	<stereo> ..............OK
	<measured sample rate 47727.00 Hz (-0.57%)>

*** All tests completed OK ***

Of course, before you can try audiotest in a zone, it must be installed:

root@myzone:~# pkg install audio-utilities
               Packages to install:     1
           Create boot environment:    No
DOWNLOAD                                  PKGS       FILES    XFER (MB)
Completed                                  1/1         6/6      0.4/0.4

PHASE                                        ACTIONS
Install Phase                                  20/20 

PHASE                                          ITEMS
Package State Update Phase                       1/1 
Image State Update Phase                         2/2

However, we'll need to do more than just install audiotest:

root@myzone:~# audiotest
/dev/mixer: No such file or directory
The device file is missing from /dev.

The audio devices also need to be added to the zone. For this we modify the zone configuration as follows:

bleonard@solaris:~$ sudo zonecfg -z myzone
Password: 
zonecfg:myzone> add device
zonecfg:myzone:device> set match=/dev/audio*
zonecfg:myzone:device> end
zonecfg:myzone> add device
zonecfg:myzone:device> set match=/dev/sound/*
zonecfg:myzone:device> end
zonecfg:myzone> add device
zonecfg:myzone:device> set match=/dev/mixer*
zonecfg:myzone:device> end
zonecfg:myzone> add device
zonecfg:myzone:device> set match=/dev/sndstat
zonecfg:myzone:device> end
zonecfg:myzone> verify
zonecfg:myzone> exit

Then reboot the zone:

bleonard@solaris:~$ sudo zoneadm -z myzone reboot

After which, audiotest should work:

root@myzone:~# audiotest
Sound subsystem and version: SunOS Audio 4.0 (0x00040003)
Platform: SunOS 5.11 snv_151a i86pc

*** Scanning sound adapter #1 ***
/dev/sound/audio810:0dsp (audio engine 0): audio810#0
  - Performing audio playback test... 
        <left> ................OK
        <right> ...............OK
        <stereo> ..............OK
        <measured sample rate 48208.00 Hz (0.43%)>

*** All tests completed OK ***

You can also examine /dev/sndstat for additional information:

root@myzone:~# cat /dev/sndstat
SunOS Audio Framework

Audio Devices:
0: audio810#0 Intel AC'97, ICH (DUPLEX)

Mixers:
0: audio810#0 Intel AC'97, ICH
        AC'97 codec: SigmaTel STAC9700

However, when testing the sound from Firefox (from a user account other than root), such as this recent Flash presentation on Solaris availability, you may still be disappointed. This is simply a permissions problem, as the devices only have read and write permissions for root:

root@myzone:~# ls -l /dev/audio*
crw-------   1 root     root      99,  3 Jul  1 10:21 /dev/audio
crw-------   1 root     root      99,  4 Jul  1 10:21 /dev/audioctl

To address this:

root@myzone:~# chmod 777 /dev/audio*
root@myzone:~# chmod 777 /dev/sound/*

And you should be all set.

Wednesday Dec 23, 2009

Critical Security Update for Adobe Flash Player

Earlier this month, Adobe released a security update for its Flash Player. Adobe has assigned this update its highest risk rating of Critical. This update is available for OpenSolaris.[Read More]

Tuesday Feb 24, 2009

Flash Player 10 is Available

Flash player 10 is available now for OpenSolaris and Solaris. You can get it here.
About

The Observatory is a blog for users of Oracle Solaris. Tune in here for tips, tricks and more as we explore the Solaris operating system from Oracle.

Connect with Oracle Solaris:


Search

Archives
« April 2014
SunMonTueWedThuFriSat
  
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
20
21
22
23
24
25
26
27
28
29
30
   
       
Today