~ubuntu-branches/ubuntu/maverick/alsa-utils/maverick-proposed

« back to all changes in this revision

Viewing changes to alsactl/utils.c

  • Committer: Bazaar Package Importer
  • Author(s): Luke Yelavich
  • Date: 2010-05-21 12:54:56 UTC
  • mfrom: (1.2.14 upstream) (2.3.5 squeeze)
  • Revision ID: james.westby@ubuntu.com-20100521125456-kxrb3ggrjnf06nd8
Tags: 1.0.23-0ubuntu1
* New upstream release
  - backport-fixes-head.patch: Dropped, applied upstream
* Merge from debian unstable, remaining changes:
  - debian/init:
    + wait until /usr/bin and /var/lib/alsa exist
    + only display an error when dealing with alsactl if there is no card
      specified
    + Set sane level for 'Speaker' and 'Headphone', needed for Dell Mini 9
      and Dell E series
    + ute PC Beep on hda cards that support it during initial volume setup
    + update lsb header to indicate no running of the script unless the
      udev rule is run
    + Mute *Analog/Digital Control for Creative cards by default
    + Default Digital Input Source to be Digital Mic 1 so that users
      with digital mic will be able to use it out of the box
    + Mute "IEC958 Optical Raw" by default
    + Set sane level for headphone 1 for Dell Studio XPS with 2.6.30
    + Don't muck with sound card state if alsactl restore fails 
    + Don't wait for 1 second after alsactl store
    + Stop muting on reboot/shutdown
    + Prefer built-in digital mics on newer Dells
    + Unmute 'Line HP Swap' for Dove boards
  - debian/rules:
    + ship udev rules file in /lib/udev/rules.d
    + Do not install start symlinks for the alsa-utils init script, it gets
      run from a udev rule
  - debian/udev.script: do not use hotplug functions
  - debian/README.init.cs4236: Include in /usr/share/doc/alsa-utils so that
    users of snd-cs4236 (e.g., ThinkPad 600) can have audible sound
  - debian/patches/unset_pulse_internal.patch: We don't want alsamixer to
    show the pulse mixer by default, since it can be controlled from
    pulseaudio itself
  - debian/patches/fix_misspelling_speaker-test_man_page.patch: Fix
    misspelling in speaker-test(1)
  - Remove alsaconf from build system and remove po files
  - Create an upstart job specifically saving mixer levels to resolve race
  - Version build-dep to upstart-aware debhelper.
  - Move the initscript into /sbin. We now have an upstart job just for
    handling alsactl store
* debian/init: Revert Debian's change to allow alsamixer/amixer and aumix to
  cooperate. OSS is going away in Maverick, so we don't care about OSS mixer
  applications any more

Show diffs side-by-side

added added

removed removed

Lines of Context:
79
79
        return count - pos;
80
80
}
81
81
 
82
 
void initfailed(int cardnumber, const char *reason)
 
82
void initfailed(int cardnumber, const char *reason, int exitcode)
83
83
{
84
84
        int fp;
85
85
        char *str;
 
86
        char sexitcode[16];
86
87
 
87
88
        if (statefile == NULL)
88
89
                return;
89
90
        if (snd_card_get_name(cardnumber, &str) < 0)
90
91
                return;
 
92
        sprintf(sexitcode, "%i", exitcode);
91
93
        fp = open(statefile, O_WRONLY|O_CREAT|O_APPEND, 0644);
92
94
        write(fp, str, strlen(str));
93
95
        write(fp, ":", 1);
94
96
        write(fp, reason, strlen(reason));
 
97
        write(fp, ":", 1);
 
98
        write(fp, sexitcode, strlen(sexitcode));
95
99
        write(fp, "\n", 1);
96
100
        close(fp);
97
101
        free(str);