Skip to content

openat(AT_FDCWD, "/dev/dsp", O_RDWR) = -1 EINVAL (Invalid argument) #17

@Randrianasulu

Description

@Randrianasulu

I was trying to see why old proprietary application was failing to play sound with osspd (self compiled on Slackware 15.0 i586 with libfuse3 3.16.2 recompiled from -current).

It turned out it was using openat with O_RDWR argument, while sox/mplayer were using O_WRONLY and thus were unaffected by this bug.

Actually, tests seems to fail for ro case too:

guest@slax:~/botva/src/src/ossp$ ./osstest                                                         test_open@120 test succeeded (mixerfd >= 0)
test_open@129 test failed (ro_fd >= 0): Invalid argument
test_open@137 test succeeded (wo_fd >= 0)
test_wo@81 test succeeded (ret < 0)
test_wo@84 test succeeded (ret >= 0)
test_wo@87 test succeeded (ret < 0)
test_wo@89 test succeeded (errno == EINVAL)
test_wo@92 test succeeded (ret >= 0)
test_open@145 test failed (rw_fd >= 0): Invalid argument
test_mixer@160 test succeeded (ret >= 0)
Mixer id: OSS Proxy
Name: Mixer
Tests: 2 errors 8 success

git commit 72f82cc

I enabled alsa provider because I do not use pulseaudio normally.

I also set

/etc/modprobe.d/soundcore.conf
with single line
options soundcore preclaim_oss=0

proprietary application in question:
https://web.archive.org/web/20060615000000*/http://www.linuxmedialabs.com/LMLCD/contrib/RPMS/MainActor-3.6-5.i386.rpm

extract into /opt (I used midnight commander)

You can see what it tries to do with /dev/dsp by using
strace -P /dev/dsp app

kernel level OSS emulation with snd-pcm-oss module as itself works, aoss not.

Not sure from where this EINVAL comes? I tried running app and tests with sudo just in case, but they fail like for normal user.

you can try to compile dsp_info program from this page:

https://www.gbppr.net/guerrilla.net/reference/dsp/prog_dsp.htm

it shows similar error by default but if you set flag for openat to O_WRONLY it works.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions