Page MenuHomeFreeBSD

mixer(3): temporary fix in mixer_open()
AbandonedPublic

Authored by christos on Sep 30 2021, 1:53 PM.
Referenced Files
Unknown Object (File)
May 21 2024, 4:58 AM
Unknown Object (File)
May 21 2024, 4:48 AM
Unknown Object (File)
May 20 2024, 11:57 AM
Unknown Object (File)
May 18 2024, 6:58 AM
Unknown Object (File)
Dec 24 2023, 7:23 AM
Unknown Object (File)
Dec 20 2023, 7:20 AM
Unknown Object (File)
Jun 18 2023, 6:19 AM
Unknown Object (File)
Jun 18 2023, 6:09 AM
Subscribers

Details

Reviewers
hselasky
Summary

This patch fixes the case where m->unit = -1 (when we pass
a /dev/dsp<N>.vp<N> device), which results in mixer(8) not
printing any info about the device (audio card name, ...).

Note this is a temporary patch until a more elegant solution is
found.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

christos created this revision.

Why do you need to do a strdup() when you are not writing the string? Or did I miss something?

lib/libmixer/mixer.c
135

free() already has a NULL check.

What about virtual_oss in ports? It can create any such device ....

Why do you need to do a strdup() when you are not writing the string? Or did I miss something?

Fixed.

What about virtual_oss in ports? It can create any such device ....

What do you mean?

Try:

pkg install virtual_oss
man virtual_oss

Maybe you find the answer. Else let me know.

--HPS

Try:

pkg install virtual_oss
man virtual_oss

Maybe you find the answer. Else let me know.

It can create arbitrary DSP devices but they're "tied" to an actual
/dev/dspX device, right? If so, will this patch break things if the user
passes a VDSP device to mixer(8) for example?

Try:

pkg install virtual_oss
man virtual_oss

Maybe you find the answer. Else let me know.

It can create arbitrary DSP devices but they're "tied" to an actual
/dev/dspX device, right? If so, will this patch break things if the user
passes a VDSP device to mixer(8) for example?

Not neccessarily. It can also be a bluetooth audio device.

--HPS

Could you run some tests on your side to confirm that the patches you've made work as expected?

Since virtual_oss can create arbitrary virtual devices, this patch might
not work as expected in those cases. It's better that we leave it as is then.
Closing the revision.