Page MenuHomeFreeBSD

dev_submerge.ch (Florian Walpen)
User

Projects

User does not belong to any projects.

User Details

User Since
Nov 25 2021, 6:20 PM (139 w, 1 d)

Recent Activity

Today

dev_submerge.ch accepted D46166: sound: Add OSS channel capabilities to sndstat nvlist.
Fri, Jul 26, 6:27 PM
dev_submerge.ch accepted D46164: sound: Add *vchanrate and *vchanformat to sndstat nvlist.
Fri, Jul 26, 6:27 PM
dev_submerge.ch accepted D46163: sound: Add device status string to sndstat nvlist.
Fri, Jul 26, 6:26 PM
dev_submerge.ch added a comment to D46163: sound: Add device status string to sndstat nvlist.

Could we add this field to the test in D45901?

Fri, Jul 26, 2:19 PM
dev_submerge.ch accepted D45974: mixer(8): Add tests.
Fri, Jul 26, 2:10 PM

Yesterday

dev_submerge.ch accepted D46100: sound: Simplify feeder_remove().
Thu, Jul 25, 1:29 PM
dev_submerge.ch added a comment to D45974: mixer(8): Add tests.

Shouldn't we select the snd_dummy device for our mixer tests?
Current default could be set to any device, with not all features available that we want to test. Or am I missing something?

Thu, Jul 25, 1:27 PM

Mon, Jul 22

dev_submerge.ch added a comment to D45973: mixer(8): Make mute and recsrc argument parsing more robust.

For the deprecated argument interfaces of the mute (1, 0, ^) and recsrc
(+, -, =, ^) controls,

On a side note, how do people know that these are deprecated? The CLI interface of mixer(8) is used as an API by user scripts - there's been some resentment already due to the change from percentage to decimal values (difficult to parse and modify in shell script).

I think adding a man page notice would suffice for now.

Mon, Jul 22, 1:58 PM
dev_submerge.ch accepted D45985: sound: Simplify chn_init().

Don't see anything suspicious, no regressions in my (brief) tests.

Mon, Jul 22, 12:40 AM
dev_submerge.ch accepted D45982: snd_hdsp*: Free up channel resources in case of CHANNEL_INIT() failure.

@dev_submerge.ch You are the only one I know who owns a HDSP card, so could you give this a quick test?

I suppose it's ok, although the code change does not run in normal circumstances. I'll try to provoke that with a hack before I give you a go.

Mon, Jul 22, 12:14 AM

Sun, Jul 21

dev_submerge.ch added a comment to D45982: snd_hdsp*: Free up channel resources in case of CHANNEL_INIT() failure.

@dev_submerge.ch You are the only one I know who owns a HDSP card, so could you give this a quick test?

Sun, Jul 21, 11:51 PM
dev_submerge.ch accepted D45967: sound: Implement dummy driver.
Sun, Jul 21, 3:49 PM
dev_submerge.ch accepted D45986: sound: Remove unused defines from pcm/sound.h.
Sun, Jul 21, 3:28 PM
dev_submerge.ch added a comment to D45973: mixer(8): Make mute and recsrc argument parsing more robust.

For the deprecated argument interfaces of the mute (1, 0, ^) and recsrc
(+, -, =, ^) controls,

Sun, Jul 21, 3:26 PM

Fri, Jul 19

dev_submerge.ch accepted D45984: sound: Remove unused FEEDER_DEBUG.
Fri, Jul 19, 12:04 AM
dev_submerge.ch accepted D45983: sound: Rename chn_* feeder functions to feeder_*.
Fri, Jul 19, 12:03 AM
dev_submerge.ch accepted D45979: sound: Fix memory leak in chn_init().
Fri, Jul 19, 12:01 AM

Thu, Jul 18

dev_submerge.ch added inline comments to D45967: sound: Implement dummy driver.
Thu, Jul 18, 11:47 PM
dev_submerge.ch accepted D45973: mixer(8): Make mute and recsrc argument parsing more robust.

Did some brief tests, looks good to me.

Thu, Jul 18, 7:27 PM

Wed, Jul 17

dev_submerge.ch accepted D45969: sound examples: Add sndstat nvlist example.
Wed, Jul 17, 12:12 AM
dev_submerge.ch accepted D45968: sound examples: Organize files in directories.
Wed, Jul 17, 12:03 AM

Sun, Jul 14

dev_submerge.ch added a comment to D45967: sound: Implement dummy driver.

I know it's WIP, but it would be nice to have a brief comment or description somewhere, to document what is and what is not implemented / working.

Sun, Jul 14, 9:42 PM
dev_submerge.ch accepted D45901: sound tests: Add sndstat nvlist ATF test.
Sun, Jul 14, 9:01 PM
dev_submerge.ch added a comment to D45969: sound examples: Add sndstat nvlist example.

This file should probably also be added to share/examples/Makefile?

Sun, Jul 14, 7:03 PM
dev_submerge.ch added a comment to D45968: sound examples: Organize files in directories.

Fails to build - I think the path changes have to be reflected in share/examples/Makefile.

Sun, Jul 14, 7:00 PM
dev_submerge.ch added a comment to D45951: [WIP] audio(3): New OSS audio and MIDI library.

If our library does the same thing as sndio, we might as well implement the sndio library API - more compatibility for free. The question is: Can our own library provide something for them that is not possible through the sndio API?

No, the library cannot provide something more than sndio, but I don't think that's the point of this library in the first place, at least for now. My initial goal behind it is to have an easier-to-use API for OSS, so applications that already (or in the rare case that someone wants to write a new one) use OSS, can work with something simpler. It doesn't have to do with providing something "better" compared to another API per se.

Sun, Jul 14, 4:49 PM

Fri, Jul 12

dev_submerge.ch added a comment to D45951: [WIP] audio(3): New OSS audio and MIDI library.

Writing in smaller chunks doesn't work in conjunction with poll() or blocking write(). The application would have to apply a time-based wakeup approach, and thereby account for all the drift / loss introduced by the hardware. I do that in the sosso library, and it's quite difficult to get right. Another possibility is to set SNDCTL_DSP_LOW_WATER accordingly, but there are some caveats too.

I also advise against changing the buffer size, you can easily break playback on some sound cards, snd_hda(4) in particular. SNDCTL_DSP_SETFRAGMENT is conceptually broken (power of 2). One of the goals developing the sosso library was to not touch any buffer sizes, and work around that with the time-based approach.

As indirectly mentioned in my initial message, I am also against touching buffer sizes. Can you elaborate on the time-based approach? I have taken a look at sosso but I cannot say I fully understand the logic behind it.

Fri, Jul 12, 2:28 PM
dev_submerge.ch added a comment to D45951: [WIP] audio(3): New OSS audio and MIDI library.

So, this is still a WIP patch, which means some things are intentionally left out or not properly implemented yet. Apart from the various XXX/TODO/FIXMEs throughout the source code, which are mostly minor things, there are a few things which I would really appreciate some discussion and ideas in order to continue.

  1. Memory-mapped IO doesn't really work properly yet. I've been mostly testing playback, and stuff can be heard, but with lots of stuttering and noise in between. @dev_submerge.ch That being said, I am not decided whether providing mmaped IO is actually needed or worth the effort in the first place. I try to follow what the manual suggests, and it seems to be discouraging caring about mmap too much. http://manuals.opensound.com/developer/mmap.html
Fri, Jul 12, 12:10 AM

Mon, Jul 8

dev_submerge.ch added a comment to D45901: sound tests: Add sndstat nvlist ATF test.

I am not really sure if it's meaningful to check each individual value returned by the nvlist_get_* calls. If any of these calls fails, the test will fail as well, so I think just calling them and making sure nothing fails is enough. Any opinions?

How exactly does it fail when a value is not available? Does it print a comprehensible error message? Otherwise we should test explicitly for the existence of the fields through nvlist_exists_*().

After some accidental failures I had when testing, I saw that if an nvlist call fails, the test will fail with it (because it core dumps, @markj is this acceptable in a test case?), and if you run kyua report --verbose -r ... you can see what was printed to stderr. Alternatively, if we want to be extra safe, we can actually call nvlist_exists() for every single field, I just found it a bit tedious.

Mon, Jul 8, 12:05 PM

Sun, Jul 7

dev_submerge.ch added a comment to D45901: sound tests: Add sndstat nvlist ATF test.

I am not really sure if it's meaningful to check each individual value returned by the nvlist_get_* calls. If any of these calls fails, the test will fail as well, so I think just calling them and making sure nothing fails is enough. Any opinions?

Sun, Jul 7, 4:55 PM

Sat, Jul 6

dev_submerge.ch accepted D45898: sound: Add missing CHN_[UN]LOCKs in sndstat.

This fixes the panic for me, thank you.

Sat, Jul 6, 3:56 PM
dev_submerge.ch accepted D45872: sound: Refactor sndstat_get_caps().
Sat, Jul 6, 3:52 PM
dev_submerge.ch added a comment to D45872: sound: Refactor sndstat_get_caps().

Ok, it's not a regression - same panic on the main branch as of yesterday:

Sat, Jul 6, 10:58 AM
dev_submerge.ch added a comment to D45872: sound: Refactor sndstat_get_caps().

Can you try testing this on main with (I know this is boring) all the open patches here applied? I have you as a reviewer in all of them so they should be easy to find and apply.

Sat, Jul 6, 10:33 AM

Fri, Jul 5

dev_submerge.ch accepted D45876: sound: Add min_rate and min_channels safety check in SNDCTL_AUDIOINFO.
Fri, Jul 5, 6:54 PM
dev_submerge.ch accepted D45835: sound: Improve simplex handling in dsp_open().
Fri, Jul 5, 6:52 PM
dev_submerge.ch added a comment to D45872: sound: Refactor sndstat_get_caps().

I get the following panic, but I may be missing some commit - any prerequisites for this?

Fri, Jul 5, 6:50 PM
dev_submerge.ch added inline comments to D45835: sound: Improve simplex handling in dsp_open().
Fri, Jul 5, 6:17 PM
dev_submerge.ch added inline comments to D45835: sound: Improve simplex handling in dsp_open().
Fri, Jul 5, 2:25 PM
dev_submerge.ch added a comment to D45872: sound: Refactor sndstat_get_caps().

Is there a test / application available to run this? I'd like to check the return values for my setup.

Fri, Jul 5, 12:03 PM

Thu, Jul 4

dev_submerge.ch accepted D45862: sound: Fix min/max rate for SNDCTL_AUDIOINFO and SNDCTL_ENGINEINFO.

Looks good to me, in my tests with ossinfo this returns the expected sample rate values.

Thu, Jul 4, 3:23 PM
dev_submerge.ch added a comment to D45835: sound: Improve simplex handling in dsp_open().

You may want to simplify the direction check and error handling on occasion and consolidate it with DSP_FIXUP_ERROR(), but that's not strictly necessary.

Thu, Jul 4, 2:11 PM
dev_submerge.ch added a comment to D45664: sound: Fix min/max sample rate assignment for VCHANs.

The issue is not that we can feed any rate/format, this is of course the point of VCHANs. The issue is that it seems wrong to me (maybe I am missing something?) to feed a rate of 100, and report a min/max range of 44100/96000 in SNDCTL_ENGINEINFO. Someone who doesn't know how these values get assigned would have a hard time understanding why the min/max range is 44100/96000 but yet we could feed a value outside the range. I think what we should report in SNDCTL_ENGINEINFO as the min/max range is feeder_rate_min and feeder_rate_max.

Agreed, but vchan_getcaps() seems to be the wrong place to fix this. As explained above, I think it is used in chn_setparam() and changing it may have severe consequences.

I think this patch still is needed, no? What we are currently reporting is definitely wrong.

Thu, Jul 4, 1:46 PM

Wed, Jul 3

dev_submerge.ch added a comment to D45835: sound: Improve simplex handling in dsp_open().

What about the case where we request SIMPLEX (i.e only READ or WRITE) but the device is already playing in the opposite direction? Shouldn't we return an error at least here?

Wed, Jul 3, 6:31 PM
dev_submerge.ch added a comment to D45664: sound: Fix min/max sample rate assignment for VCHANs.

But isn't that the whole point of vchans? Allow to feed any format / sample rate and let it convert to the common format set in vchanrate and vchanformat, so it can be mixed with other vchans?

Frankly I'm a bit puzzled now, what are we trying to fix here? If I'm not mistaken vchan_getcaps() is used in chn_setparam() (through chn_getcaps()), which is prerequisite for a working feeder chain. And the capabilities we report here are treated as the end of the feeder chain we create. Thus it has to be the common mixing format when vchans are enabled, otherwise we cannot mix the vchans.

I think if we want to fix values reported in SNDCTL_ENGINEINFO or elsewhere, we have to fix it there, not in vchan_getcaps().

The issue is not that we can feed any rate/format, this is of course the point of VCHANs. The issue is that it seems wrong to me (maybe I am missing something?) to feed a rate of 100, and report a min/max range of 44100/96000 in SNDCTL_ENGINEINFO. Someone who doesn't know how these values get assigned would have a hard time understanding why the min/max range is 44100/96000 but yet we could feed a value outside the range. I think what we should report in SNDCTL_ENGINEINFO as the min/max range is feeder_rate_min and feeder_rate_max.

Wed, Jul 3, 6:09 PM
dev_submerge.ch added a comment to D45835: sound: Improve simplex handling in dsp_open().

Also, in case the device is playback only or recording only, we don't return an error either for a duplex request. The channel allocation part in dsp_open() is explicitly designed to only return an error when there would be no channel at all.

Wed, Jul 3, 6:03 PM
dev_submerge.ch added a comment to D45835: sound: Improve simplex handling in dsp_open().

Hmm I think I get what you mean.. That in case the device is SIMPLEX but we request DUPLEX, instead of failing, we should create _one_ channel only, either in a direction that already exists, or choose a default (playback) in case no channels are playing already.

Wed, Jul 3, 5:55 PM
dev_submerge.ch accepted D45776: sound: Make DSP_FIXUP_ERROR() regular code.
Wed, Jul 3, 5:05 PM
dev_submerge.ch accepted D45775: sound: Simplify getchns().

Further discussion about the simplex check in D45835.

Wed, Jul 3, 5:04 PM
dev_submerge.ch added a comment to D45835: sound: Improve simplex handling in dsp_open().

Overall approach is good, except we shouldn't fail for simplex when duplex is requested. Generic applications will not be prepared to handle this error, but will usually check the results of other operations (ioctl etc). Just search the channels for an already used direction in that case, or decide for one. And then make sure we don't try to allocate the opposite direction.

What do you mean by "fail for simplex when duplex is requested"? This check happens only if the device has SD_F_SIMPLEX.

Wed, Jul 3, 4:57 PM
dev_submerge.ch added a comment to D45835: sound: Improve simplex handling in dsp_open().

Overall approach is good, except we shouldn't fail for simplex when duplex is requested. Generic applications will not be prepared to handle this error, but will usually check the results of other operations (ioctl etc). Just search the channels for an already used direction in that case, or decide for one. And then make sure we don't try to allocate the opposite direction.

Wed, Jul 3, 4:04 PM
dev_submerge.ch added a comment to D45664: sound: Fix min/max sample rate assignment for VCHANs.

I think both the sysctl_dev_pcm_vchanrate and the checks in vchan_create are related to the primary channel mixer / multiplexer, not relevant for the application end of the vchans. De facto you can feed any sample rate supported by the conversion chain into the vchan, and that should be reflected in SNDCTL_ENGINEINFO, right?

If you set the rate through SNDCTL_DSP_SPEED, yes, you can feed any rate within the [feeder_rate_min, feeder_rate_max] range. However this is not reflected in SNDCTL_ENGINEINFO's min_rate and max_rate. Without the patch it reports whatever is set in *vchanrate, and with the patch it reports either the parent's or feeder_rate's min/max. This is wrong in both cases if we feed a rate outside the min/max.

Wed, Jul 3, 3:40 PM

Mon, Jul 1

dev_submerge.ch added a comment to D45664: sound: Fix min/max sample rate assignment for VCHANs.

Could you give some explanation for the hw.snd.feeder_rate_round logic?
I don't think that value affects the vchans capability for sample rate conversions. When I test with ossinfo now, it always returns the hardware sample rates for all of SNDCTL_AUDIOINFO, SNDCTL_AUDIOINFO_EX and SNDCTL_ENGINEINFO, since feeder_rate_round > 0 by default. And I can play a 96kHz sound just fine on a 48kHz only hardware, so vchan sample rate conversion works with feeder_rate_round > 0.

feeder_rate_round seems to be used as a flag to cap the minimum and maximum VCHAN rates to whatever the hardware's ones are. See sysctl_dev_pcm_vchanrate and vchan_create. This is the pattern I followed here.

Mon, Jul 1, 10:55 PM
dev_submerge.ch added a comment to D45775: sound: Simplify getchns().

See the inline comment. I found only one hardware driver that sets the SD_F_SIMPLEX, the snd_solo(8) which is quite "retro", and the driver is compiled in duplex mode by default. Other uses of SD_F_SIMPLEX do not require any tie-breaking I think, but please double-check.

This suggests that we can remove the tie-breaking part. About the release of the opposite direction channel, I'd expect pcm_chnalloc() or chn_reset() to fail anyway in the fixed direction simplex cases. But we may want to handle this more explicitly in dsp_open() for safety and robustness, e.g. not try to allocate a channel at all in the wrong direction.

Doesn't the second case in DSP_FIXUP_ERROR check this already? For example, if the device supports either only playback or recording, dsp_open() will fail with ENOTSUP if we try to open it in the opposite direction.

Mon, Jul 1, 10:12 PM

Sun, Jun 30

dev_submerge.ch added a comment to D45775: sound: Simplify getchns().

See the inline comment. I found only one hardware driver that sets the SD_F_SIMPLEX, the snd_solo(8) which is quite "retro", and the driver is compiled in duplex mode by default. Other uses of SD_F_SIMPLEX do not require any tie-breaking I think, but please double-check.

Sun, Jun 30, 2:42 PM

Sat, Jun 29

dev_submerge.ch accepted D45773: sound: Remove MIDI_TYPE.
Sat, Jun 29, 7:07 PM
dev_submerge.ch added a comment to D45772: sound: Remove *MINOR from midi/.

What are the requirements for the unit argument to make_dev()? Should it be unique? We're always producing the same unit number in seq_addunit() now.

Sat, Jun 29, 7:05 PM
dev_submerge.ch accepted D45771: snd_uaudio: Remove unused sc_sndstat sbuf.
Sat, Jun 29, 6:39 PM
dev_submerge.ch accepted D45770: sound: Fix lock order reversals in mseq_open().
Sat, Jun 29, 6:37 PM
dev_submerge.ch accepted D45722: sound: SNDCTL_AUDIOINFO: Do not skip physical channels if VCHANs are disabled.
Sat, Jun 29, 1:06 PM
dev_submerge.ch added a comment to D45664: sound: Fix min/max sample rate assignment for VCHANs.

Could you give some explanation for the hw.snd.feeder_rate_round logic?
I don't think that value affects the vchans capability for sample rate conversions. When I test with ossinfo now, it always returns the hardware sample rates for all of SNDCTL_AUDIOINFO, SNDCTL_AUDIOINFO_EX and SNDCTL_ENGINEINFO, since feeder_rate_round > 0 by default. And I can play a 96kHz sound just fine on a 48kHz only hardware, so vchan sample rate conversion works with feeder_rate_round > 0.

Sat, Jun 29, 1:02 PM

Thu, Jun 27

dev_submerge.ch added inline comments to D45664: sound: Fix min/max sample rate assignment for VCHANs.
Thu, Jun 27, 11:30 PM
dev_submerge.ch added a comment to D45664: sound: Fix min/max sample rate assignment for VCHANs.

Sorry for the delay, had some serious outage due to virus infection (me, not my machines). Just to make sure, this is for the SNDCTL_ENGINEINFO case, right?

Thu, Jun 27, 3:02 PM
dev_submerge.ch accepted D45662: sound: Get rid of snd_sb16 workaround in vchan_create().
Thu, Jun 27, 2:49 PM

Jun 20 2024

dev_submerge.ch added inline comments to D45664: sound: Fix min/max sample rate assignment for VCHANs.
Jun 20 2024, 6:42 PM

Jun 18 2024

dev_submerge.ch accepted D45605: sound: Remove outdated comment in dsp_oss_engineinfo().
Jun 18 2024, 12:31 AM
dev_submerge.ch accepted D45604: sound: Fix oss_audioinfo's card_number, port_number and legacy_device.
Jun 18 2024, 12:30 AM
dev_submerge.ch accepted D45603: sound: Support oss_audioinfo->cmd.
Jun 18 2024, 12:24 AM

Jun 7 2024

dev_submerge.ch accepted D45501: sound: Include sound(4) channel information in sndstat nvlist.

I couldn't build the test program, missing some symbols like FreeBSD_nvlist_exists? How is an application supposed to consume this?

Jun 7 2024, 11:19 PM

May 23 2024

dev_submerge.ch accepted D45164: sound: Separate implementations for SNDCTL_AUDIOINFO[_EX] and SNDCTL_ENGINEINFO.
May 23 2024, 12:51 AM
dev_submerge.ch accepted D45312: sound: Fix minchn, maxchn and fmts in sndstat_get_caps().
May 23 2024, 12:32 AM
dev_submerge.ch added inline comments to D45312: sound: Fix minchn, maxchn and fmts in sndstat_get_caps().
May 23 2024, 12:04 AM

May 22 2024

dev_submerge.ch added a comment to D45164: sound: Separate implementations for SNDCTL_AUDIOINFO[_EX] and SNDCTL_ENGINEINFO.

Tests with ossinfo(1) run fine.

May 22 2024, 11:56 PM
dev_submerge.ch accepted D45276: mixer(8): Use mixer_get_path().
May 22 2024, 12:54 PM
dev_submerge.ch accepted D45275: mixer(3): Implement mixer_get_path() function.
May 22 2024, 12:54 PM
dev_submerge.ch accepted D45256: sound: Handle unavailable devices in various OSS IOCTLs.

In my tests this worked as expected with unavailable devices, both in mixer(8) and audio/oss ossinfo.

May 22 2024, 12:53 PM
dev_submerge.ch added a comment to D45164: sound: Separate implementations for SNDCTL_AUDIOINFO[_EX] and SNDCTL_ENGINEINFO.

All in all the output shows up correctly now in ossinfo, except for the issues already mentioned here.

May 22 2024, 12:49 PM

May 20 2024

dev_submerge.ch added inline comments to D45256: sound: Handle unavailable devices in various OSS IOCTLs.
May 20 2024, 8:44 PM
dev_submerge.ch added inline comments to D45275: mixer(3): Implement mixer_get_path() function.
May 20 2024, 8:13 PM
dev_submerge.ch added inline comments to D45275: mixer(3): Implement mixer_get_path() function.
May 20 2024, 7:55 PM
dev_submerge.ch added inline comments to D45164: sound: Separate implementations for SNDCTL_AUDIOINFO[_EX] and SNDCTL_ENGINEINFO.
May 20 2024, 7:26 PM
dev_submerge.ch added a comment to D45256: sound: Handle unavailable devices in various OSS IOCTLs.

@dev_submerge.ch I am not really sure if we can implement this in SNDCTL_ENGINEINFO as well. In SNDCTL_ENGINEINFO we choose an "engine"/channel on a device that is already opened, so in the case of an unavailable device, we won't be able to open it in the first place.

May 20 2024, 5:53 PM
dev_submerge.ch added inline comments to D45164: sound: Separate implementations for SNDCTL_AUDIOINFO[_EX] and SNDCTL_ENGINEINFO.
May 20 2024, 4:45 PM
dev_submerge.ch accepted D45150: sound: Fix oss_sysinfo->nummixers.
May 20 2024, 3:48 PM
dev_submerge.ch added a comment to D45150: sound: Fix oss_sysinfo->nummixers.

The patch is fine as is, but it does not fully address the issue described in the commit message, only D45256 does actually resolve it. You could either merge the two commits (and commit messages) when D45256 is ready, or adapt the commit messages to describe what part of the issue is addressed in each.

May 20 2024, 3:47 PM
dev_submerge.ch added a comment to D45164: sound: Separate implementations for SNDCTL_AUDIOINFO[_EX] and SNDCTL_ENGINEINFO.

Uhm, sorry again, how do I take back the review accepted and change requested flags?

May 20 2024, 3:46 PM
dev_submerge.ch requested changes to D45164: sound: Separate implementations for SNDCTL_AUDIOINFO[_EX] and SNDCTL_ENGINEINFO.

Sorry, this was meant for D45150, "Login to comment" took me to the wrong page.

May 20 2024, 3:32 PM
dev_submerge.ch accepted D45151: mixer(8): Ignore mixer_open() failures for the -a option.
May 20 2024, 3:28 PM
dev_submerge.ch added inline comments to D45154: mixer.3: Showcase example of how to loop through all mixers.
May 20 2024, 3:24 PM
dev_submerge.ch accepted D45164: sound: Separate implementations for SNDCTL_AUDIOINFO[_EX] and SNDCTL_ENGINEINFO.

The patch is fine as is, but it does not fully address the issue described in the commit message, only D45256 does actually resolve it. You could either merge the two commits (and commit messages) when D45256 is ready, or adapt the commit messages to describe what part of the issue is addressed in each.

May 20 2024, 3:13 PM

May 18 2024

dev_submerge.ch accepted D45237: sound: Correctly check nvlist_unpack() error.

The current check is never false and If nvlist_unpack(), we might panic later down the road.

May 18 2024, 1:24 AM

May 12 2024

dev_submerge.ch added inline comments to D45164: sound: Separate implementations for SNDCTL_AUDIOINFO[_EX] and SNDCTL_ENGINEINFO.
May 12 2024, 12:14 AM

May 11 2024

dev_submerge.ch added a comment to D45150: sound: Fix oss_sysinfo->nummixers.

We're missing a piece of the puzzle, as mixer_oss_mixerinfo() still skips unavailable devices. Which means SNDCTL_MIXERINFO returns an error instead of a device with enabled == 0, thus breaking the ossinfo utility from audio/oss, and probably other software using the same approach.

That's right. So before I implement this I want to make sure we agree on what each oss_mixerinfo field should contain:

devloop counter
idmixer<loop counter> (unavailable)
namePerhaps something like pcm<loop_counter>:mixer (unavailable)
modify_counter0
card_numberloop counter
port_number0
enabled0
capsNot supported.
nrextNot supported.
priorityNot supported.
devnodeNothing.
legacy_deviceloop counter

I am not really sure whether we want to include the mixer name in id and name or simply leave it blank, or unavailable.

May 11 2024, 10:49 PM

May 10 2024

dev_submerge.ch added a comment to D45150: sound: Fix oss_sysinfo->nummixers.

@dev_submerge.ch Can you test that this and D45151 fix the problem? I cannot reproduce it right now.

May 10 2024, 8:14 PM
dev_submerge.ch added a comment to D45144: sound: Remove ncards variable from sound_oss_card_info().

This is ok as is, but it has the same problem as SNDCTL_MIXERINFO: We should consider returning "blank" oss_card_info structs for unavailable devices / device indices, instead of an error. Current implementation breaks audio/oss and probably kodi when devices are unavailable, since they stop iterating the SNDCTL_CARDINFO indices if there's an error. There is no enabled in oss_card_info to signal that a device is unavailable, but the info is mostly descriptive. We could return "unavailable" or something like that in the strings, which would hopefully be picked up by the application and shown to the user.

You are talking about the !PCM_REGISTERED(d) case right?

May 10 2024, 4:11 PM
dev_submerge.ch accepted D45144: sound: Remove ncards variable from sound_oss_card_info().

This is ok as is, but it has the same problem as SNDCTL_MIXERINFO: We should consider returning "blank" oss_card_info structs for unavailable devices / device indices, instead of an error. Current implementation breaks audio/oss and probably kodi when devices are unavailable, since they stop iterating the SNDCTL_CARDINFO indices if there's an error. There is no enabled in oss_card_info to signal that a device is unavailable, but the info is mostly descriptive. We could return "unavailable" or something like that in the strings, which would hopefully be picked up by the application and shown to the user.

May 10 2024, 1:52 PM

May 9 2024

dev_submerge.ch accepted D45135: sound: Remove nmix variable from mixer_oss_mixerinfo().

mixer_get_nmixers() returns the oss_sysinfo->nummixers, which, in 277615's case at least, is 5, but we have 8 sound cards, just 3 of them do not have a mixer. So now in mixer(8) we are looping from 0 to 5 and we start opening from /dev/mixer0 to /dev/mixer4, and this is why we're failing to open /dev/mixer0 as his error message reports.

I think a solution can be to get the number of sound cards (i.e oss_sysinfo->numcards) as opposed to the number of mixers, loop through them and if we fail to open a mixer, continue to the next one without printing any error/warning. I can add a mixer_get_ncards() routine to do this.

May 9 2024, 5:47 PM
dev_submerge.ch accepted D45138: sound: Rename oss_audioinfo->real_device to oss_audioinfo->legacy_device.
May 9 2024, 4:27 PM
dev_submerge.ch accepted D45137: sound: Add missing oss_mixerinfo devnode and legacy_device fields.
May 9 2024, 4:15 PM
dev_submerge.ch accepted D45136: sound: Fix oss_sysinfo->numcards.
May 9 2024, 4:03 PM